The qmail logs were showing an incoming connection but no message was logged as being delivered. Some sleuthing around with the help of davehart, including writing a SMTP shim that logged the precise contents of the mail delivery transaction, revealed the problem. Qmail was rejecting the message with an error message: "451 See http://pobox.com/~djb/docs/smtplf.html."
It turns out that the sending software was trying to send a message that was composed with only LF characters at the end of each line (normally email is sent with both CR and LF line ending characters). Qmail considers this illegal, and when it detects such characters it responds with the above error message and immediately drops the connection. This causes the sending server to save the undelivered message and try again later.
The qmail document refers to a document it calls "822bis", which apparently was an older name for RFC 2822. Section 2.3 of this document does indeed prohibit the use of bare LF characters within the message body. However, this document is not considered a standard; to find a standard relating to email transfer we must look at RFC 822, also known as STD 11. RFC 822 does not specifically prohibit the use of bare LF characters in message bodies.
RFC 821 also requires, in section 4.1.1, that "The receiver should not close the transmission channel until it receives and replies to a QUIT command (even if there was an error)." Based on this, I have concluded that the qmail behaviour is in error and should not be used as is.
The culprit in qmail is the function
blast() in the qmail-smtpd.c file. This function scans the message body and if it detects a bare LF character, calls the straynewline() function. This function prints the above 451 message, and abruptly exits:void straynewline() { out("451 See http://pobox.com/~djb/docs/smtplf.html .\r\n"); flush(); _exit(1); }There is no evidence that anything bad will happen if the bare LF characters are permitted in the message body. So, in order to fix this problem in qmail, I modified qmail-smtpd.c so that the
straynewline() function takes no action:void straynewline() { }This modification finally let the order confirmation I was expecting arrive successfully.
I recommend that everybody who runs qmail apply this modification. You may be missing mail and not know it.
Deleted comment
December 1 2003, 05:38:13 UTC 8 years ago
Deleted comment
December 1 2003, 05:42:02 UTC 8 years ago
December 1 2003, 05:38:52 UTC 8 years ago
December 1 2003, 07:49:07 UTC 8 years ago
So far, it's been great and has given me no problems at all. I'm currently looking into implementing greylisting for it.
Deleted comment
December 1 2003, 12:21:21 UTC 8 years ago
The best thing is that you can read the config files.
It's also fast. It will send out messages in parallel, which isn't that big a deal unless you're running mailing lists.
December 2 2003, 11:20:47 UTC 8 years ago
The only downside I've seen to postfix is that (last I looked), you couldn't send all email for an entire domain to one email address with a single alias like you can in qmail.
December 1 2003, 20:32:03 UTC 8 years ago
February 19 2004, 14:31:17 UTC 8 years ago
qmail is doing the right thing
Don't blame qmail for doing the right thing. Blame the broken client.See Jonathan de Boyne Pollard's "qmail Myths Dispelled" for a good analysis of the bare LF problem and why Postfix's behavior is harmful to interoperability.