Loading ...
Sorry, an error occurred while loading the content.

Re: Why the dlyjob 5 in MMAIL SENDMAIL?

Expand Messages
  • Monte Schmiege
    ... private data, ... headers were ... takes ... overwrite that ... result ... the ... there s a ... that ... called ... use that ... shouldn t ... Thanks,
    Message 1 of 10 , May 1, 2006
    • 0 Attachment
      --- In Easy400Group@yahoogroups.com, Scott Klement <easy400@...>
      wrote:
      >
      >
      > > One day I found out that the message to Mr. X, containing his
      private data,
      > > was sent to Mr. Y, in spite of the fact that the distribution
      headers were
      > > just perfect, as it was the info passed to API QTMMSENDMAIL.
      >
      > That's because of the way QtmmSendMail() works. A background job
      takes
      > the stream file and loads it into the e-mail queue. If you
      overwrite that
      > stream file immediately after calling QtmmSendMail() you can end up
      > changing it before the background job has queued the message. The
      result
      > is that the background job ends up sending your new stream file to
      the
      > original recipient.
      >
      > The DLYJOB solution isn't the best solution because:
      >
      > a) If (for some reason) the system is running extremely slow,
      there's a
      > chance that the background job may not be done in 5 seconds.
      >
      > b) You cause your job to run slower.
      >
      > A better solution is to use a unique filename for each stream file
      that
      > you feed into QtmmSendMail(). The ILE C runtime has a function
      called
      > tmpnam() that can be used to generate a unique filename. If you
      use that
      > to create the stream file that you pass to QtmmSendMail() you
      shouldn't
      > ever have this problem.
      >

      Thanks, Scott.

      Since I am using MMAIL's TempCrtF() to create a unique file before
      calling SendMail and, therefore, QtmmSendMail, it appears this dlyjob
      is unnecessary for me and, more importantly, the integrity of my
      email is assured. However, I can't vouch for the command line
      programs in MMAIL, as I haven't studied them.

      Perhaps Giovanni will see this and reflect.
    • Giovanni B. Perotti
      Reply to Scott Klement. Scott, thanks for spending yout time and providing us with some insight on QTMMSENDMAIL. Your suggestion is to have unique names for
      Message 2 of 10 , May 2, 2006
      • 0 Attachment
        Reply to Scott Klement.

        Scott,
        thanks for spending yout time and providing us with some insight on
        QTMMSENDMAIL.
        Your suggestion is to have "unique" names for the different MIME stream
        files.
        Well, this is exacy what MMAIL does: a unique stream file name for each
        different message.
        The problem of mismatched messages does not seem to depend from unique file
        names.
        I know that a delay job is not the best solution, wat else then?

        Thanks,

        Giovanni
        ----- Original Message -----
        From: "Monte Schmiege" <monte@...>
        To: <Easy400Group@yahoogroups.com>
        Sent: Monday, May 01, 2006 3:02 PM
        Subject: [Easy400Group] Re: Why the dlyjob 5 in MMAIL SENDMAIL?


        > --- In Easy400Group@yahoogroups.com, Scott Klement <easy400@...>
        > wrote:
        >>
        >>
        >> > One day I found out that the message to Mr. X, containing his
        > private data,
        >> > was sent to Mr. Y, in spite of the fact that the distribution
        > headers were
        >> > just perfect, as it was the info passed to API QTMMSENDMAIL.
        >>
        >> That's because of the way QtmmSendMail() works. A background job
        > takes
        >> the stream file and loads it into the e-mail queue. If you
        > overwrite that
        >> stream file immediately after calling QtmmSendMail() you can end up
        >> changing it before the background job has queued the message. The
        > result
        >> is that the background job ends up sending your new stream file to
        > the
        >> original recipient.
        >>
        >> The DLYJOB solution isn't the best solution because:
        >>
        >> a) If (for some reason) the system is running extremely slow,
        > there's a
        >> chance that the background job may not be done in 5 seconds.
        >>
        >> b) You cause your job to run slower.
        >>
        >> A better solution is to use a unique filename for each stream file
        > that
        >> you feed into QtmmSendMail(). The ILE C runtime has a function
        > called
        >> tmpnam() that can be used to generate a unique filename. If you
        > use that
        >> to create the stream file that you pass to QtmmSendMail() you
        > shouldn't
        >> ever have this problem.
        >>
        >
        > Thanks, Scott.
        >
        > Since I am using MMAIL's TempCrtF() to create a unique file before
        > calling SendMail and, therefore, QtmmSendMail, it appears this dlyjob
        > is unnecessary for me and, more importantly, the integrity of my
        > email is assured. However, I can't vouch for the command line
        > programs in MMAIL, as I haven't studied them.
        >
        > Perhaps Giovanni will see this and reflect.
        >
        >
        >
        >
        >
        >
        >
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        >
        >
      • Scott Klement
        ... I ve only encountered this problem when re-using the same file name. Maybe you ve found a different error than the one I had. Another solution would be to
        Message 3 of 10 , May 2, 2006
        • 0 Attachment
          > Well, this is exacy what MMAIL does: a unique stream file name for each
          > different message. The problem of mismatched messages does not seem to
          > depend from unique file names. I know that a delay job is not the best
          > solution, wat else then?

          I've only encountered this problem when re-using the same file name. Maybe
          you've found a different error than the one I had.

          Another solution would be to simply open a socket to the SMTP server and
          send the message that way. This would eliminate the need to call
          QtmmSendMail and would also open up the possibility of sending through
          other SMTP servers instead of just the one on the local iSeries.

          In fact, I wrote an article that was published in this month's iSeries
          NEWS that demonstrates this technique. If you're a ProVIP subscriber, you
          can read it on-line at the following link:
          http://www.iseriesnetwork.com/article.cfm?ID=20520
        • Giovanni B. Perotti
          Thanks Scott for providing more on this item. Unluckily I m not a ProVIP subscriber. How much is that? Horrible to say: I have no revenue and I m on my own
          Message 4 of 10 , May 2, 2006
          • 0 Attachment
            Thanks Scott for providing more on this item.

            Unluckily I'm not a ProVIP subscriber.

            How much is that?
            Horrible to say: I have no revenue and I'm on my own expenses.

            Giovanni
            ----- Original Message -----
            From: "Scott Klement" <easy400@...>
            To: <Easy400Group@yahoogroups.com>
            Sent: Tuesday, May 02, 2006 8:29 PM
            Subject: Re: [Easy400Group] Re: Why the dlyjob 5 in MMAIL SENDMAIL?


            >> Well, this is exacy what MMAIL does: a unique stream file name for each
            >> different message. The problem of mismatched messages does not seem to
            >> depend from unique file names. I know that a delay job is not the best
            >> solution, wat else then?
            >
            > I've only encountered this problem when re-using the same file name. Maybe
            > you've found a different error than the one I had.
            >
            > Another solution would be to simply open a socket to the SMTP server and
            > send the message that way. This would eliminate the need to call
            > QtmmSendMail and would also open up the possibility of sending through
            > other SMTP servers instead of just the one on the local iSeries.
            >
            > In fact, I wrote an article that was published in this month's iSeries
            > NEWS that demonstrates this technique. If you're a ProVIP subscriber, you
            > can read it on-line at the following link:
            > http://www.iseriesnetwork.com/article.cfm?ID=20520
            >
            >
            >
            > Yahoo! Groups Links
            >
            >
            >
            >
            >
            >
            >
            >
            >
          • Scott Klement
            I wrote some very similar articles back in October for Club Tech. These are available to someone with a free ( Associate ) membership:
            Message 5 of 10 , May 2, 2006
            • 0 Attachment
              I wrote some very similar articles back in October for Club Tech. These
              are available to someone with a free ("Associate") membership:

              http://www.iseriesnetwork.com/article.cfm?id=51701
              http://www.iseriesnetwork.com/article.cfm?id=51720

              Hopefully those will be easier for you to access, Giovanni.

              ---
              Scott Klement http://www.scottklement.com

              On Tue, 2 May 2006, Giovanni B. Perotti wrote:

              > Thanks Scott for providing more on this item.
              >
              > Unluckily I'm not a ProVIP subscriber.
              >
              > How much is that?
              > Horrible to say: I have no revenue and I'm on my own expenses.
              >
              > Giovanni
              > ----- Original Message -----
              > From: "Scott Klement" <easy400@...>
              > To: <Easy400Group@yahoogroups.com>
              > Sent: Tuesday, May 02, 2006 8:29 PM
              > Subject: Re: [Easy400Group] Re: Why the dlyjob 5 in MMAIL SENDMAIL?
              >
              >
              >>> Well, this is exacy what MMAIL does: a unique stream file name for each
              >>> different message. The problem of mismatched messages does not seem to
              >>> depend from unique file names. I know that a delay job is not the best
              >>> solution, wat else then?
              >>
              >> I've only encountered this problem when re-using the same file name. Maybe
              >> you've found a different error than the one I had.
              >>
              >> Another solution would be to simply open a socket to the SMTP server and
              >> send the message that way. This would eliminate the need to call
              >> QtmmSendMail and would also open up the possibility of sending through
              >> other SMTP servers instead of just the one on the local iSeries.
              >>
              >> In fact, I wrote an article that was published in this month's iSeries
              >> NEWS that demonstrates this technique. If you're a ProVIP subscriber, you
              >> can read it on-line at the following link:
              >> http://www.iseriesnetwork.com/article.cfm?ID=20520
              >>
              >>
              >>
              >> Yahoo! Groups Links
              >>
              >>
              >>
              >>
              >>
              >>
              >>
              >>
              >>
              >
              >
              >
              >
              >
              >
              > Yahoo! Groups Links
              >
              >
              >
              >
              >
              >
            • Giovanni B. Perotti
              Thanks Scott. Giovanni ... From: Scott Klement To: Sent: Tuesday, May 02, 2006 9:04 PM Subject: Re:
              Message 6 of 10 , May 2, 2006
              • 0 Attachment
                Thanks Scott.

                Giovanni
                ----- Original Message -----
                From: "Scott Klement" <easy400@...>
                To: <Easy400Group@yahoogroups.com>
                Sent: Tuesday, May 02, 2006 9:04 PM
                Subject: Re: [Easy400Group] Re: Why the dlyjob 5 in MMAIL SENDMAIL?


                >
                > I wrote some very similar articles back in October for Club Tech. These
                > are available to someone with a free ("Associate") membership:
                >
                > http://www.iseriesnetwork.com/article.cfm?id=51701
                > http://www.iseriesnetwork.com/article.cfm?id=51720
                >
                > Hopefully those will be easier for you to access, Giovanni.
                >
                > ---
                > Scott Klement http://www.scottklement.com
                >
                > On Tue, 2 May 2006, Giovanni B. Perotti wrote:
                >
                >> Thanks Scott for providing more on this item.
                >>
                >> Unluckily I'm not a ProVIP subscriber.
                >>
                >> How much is that?
                >> Horrible to say: I have no revenue and I'm on my own expenses.
                >>
                >> Giovanni
                >> ----- Original Message -----
                >> From: "Scott Klement" <easy400@...>
                >> To: <Easy400Group@yahoogroups.com>
                >> Sent: Tuesday, May 02, 2006 8:29 PM
                >> Subject: Re: [Easy400Group] Re: Why the dlyjob 5 in MMAIL SENDMAIL?
                >>
                >>
                >>>> Well, this is exacy what MMAIL does: a unique stream file name for each
                >>>> different message. The problem of mismatched messages does not seem to
                >>>> depend from unique file names. I know that a delay job is not the best
                >>>> solution, wat else then?
                >>>
                >>> I've only encountered this problem when re-using the same file name.
                >>> Maybe
                >>> you've found a different error than the one I had.
                >>>
                >>> Another solution would be to simply open a socket to the SMTP server and
                >>> send the message that way. This would eliminate the need to call
                >>> QtmmSendMail and would also open up the possibility of sending through
                >>> other SMTP servers instead of just the one on the local iSeries.
                >>>
                >>> In fact, I wrote an article that was published in this month's iSeries
                >>> NEWS that demonstrates this technique. If you're a ProVIP subscriber,
                >>> you
                >>> can read it on-line at the following link:
                >>> http://www.iseriesnetwork.com/article.cfm?ID=20520
                >>>
                >>>
                >>>
                >>> Yahoo! Groups Links
                >>>
                >>>
                >>>
                >>>
                >>>
                >>>
                >>>
                >>>
                >>>
                >>
                >>
                >>
                >>
                >>
                >>
                >> Yahoo! Groups Links
                >>
                >>
                >>
                >>
                >>
                >>
                >
                >
                >
                > Yahoo! Groups Links
                >
                >
                >
                >
                >
                >
                >
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.