home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.mail.sendmail
- Path: sparky!uunet!ukma!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!mp.cs.niu.edu!rickert
- From: rickert@mp.cs.niu.edu (Neil Rickert)
- Subject: Re: UIUC/IDA sendmail 565c bug + FIX
- Message-ID: <1992Nov18.014417.8200@mp.cs.niu.edu>
- Organization: Northern Illinois University
- References: <1992Nov17.234000.14505@usl.edu>
- Date: Wed, 18 Nov 1992 01:44:17 GMT
- Lines: 48
-
- In article <1992Nov17.234000.14505@usl.edu> jpd@ucs.usl.edu (Dugal James P.) writes:
- >Here is a smtp trace from the KA9Q program, sending mail to a SunOS system
- >running sendmail 5.65c. Note that the second MAIL FROM is lost (or more
- >properly, received out-of-order) by sendmail, resulting in a 503 error.
- >The KA9Q option SMTP BATCH was set on, which causes the HELO, MAIL FROM,
- >RCPT TO, and DATA commands to be sent in one transmission.
-
- This is very definitely not a sendmail bug. You can argue that it was
- a bad design decision if you wish, but you cannot call it a bug. It is
- also not unique to IDA versions of sendmail. This happens in the vanilla
- BSD version also.
-
- If you read RFC821 you will see that it describes a dialogue. The client
- sends a verb to the server then the server replies. With your batch
- mode you are breaking this dialogue assumption. If there is a bug it
- is in running KA9Q in BATCH mode.
-
- >*** srvrsmtp.c.orig Mon Jun 24 15:27:31 1991
- >--- srvrsmtp.c Tue Nov 17 13:31:18 1992
- >***************
- >... [patch deleted for brevity]
-
- >Is there a more elegant fix, or at least a diagnosis of what's
- >happening and why this fixes the problem?
-
- Your fix will work, but may cause other problems.
-
- Sendmail, after processing the MAIL command, does a fork(). The rest
- of the transaction is handled by the child. At the end of the message
- the child exits, and the parent reads the next transaction (or the QUIT).
-
- When you batch data, the input buffer is not empty at the time of the
- fork(). The child gets its own copy of the buffer, and processes that.
- When the child exits, the parent resumes where it left off, and since
- there was unprocessed data in the buffer at the time of fork(), that is
- now processed. The parent sendmail is thus seeing the RCPT verbs which
- the child had already processed. Moreover, with batching, when the
- child sees the line beginning with '.' at the end of the message, its
- buffer may not be empty, but could contain the next MAIL command. It
- is likely that this second MAIL was not in the parent's original buffer,
- and since it has already been read() once, cannot be read again. Thus
- the second MAIL might be lost completely when the child terminates.
-
- The best fix is to follow RFC821, and not assume such batching will
- work. Note that sendmail depends on the fork()/exit() to reset state
- at the end of a message. With the fork() removed other problems may
- occur, such as running out of memory or running out of file descriptors.
-
-