brent.gardner at gmail
Jan 5, 2011, 9:38 AM
Post #1 of 4
Dropped connections with header lines longer than 998 characters
I'm seeing an issue where qmail appears to be dropping connections from remote senders that try to send us messages with header lines that are longer than 998 characters.
I'm running qmail as part of qmailtoaster, qmail is patched to netqmail-1.05.
Running on 32-bit CentOS v5.3 which runs as a VMware guest.
This setup serves as a spam filter for our corporate Exchange server.
The remote senders are using Outlook & Exchange in their local environments, and their messages route through external services such as Google/Postini or GoDaddy email servers on their way to us.
One of the remote senders sent us an NDR from their system, which included full headers from the rejected message. It looks like their systems are generating a 'References:' header line that includes message IDs from their systems and our Exchange server. Message IDs are added with each correspondence in the thread so that over time the header line has grown to be longer than 998 characters. The line gets folded during transit, so it looks like a series of 20 to 30 character lines, but reading the RFCs, it seems that a header line is still counted as a single line, folded or not, and a single line can not be longer than 998 characters, but I could be totally wrong about this.
When they try to send us the message, qmail seems to drop the connection without any kind of logging or notification to the sender, such as perhaps '500 line too long'.
I've tested this by sending messages through our system with a fake 'References:' header line. Messages with a header line that totals 998 characters go through. Sending fails for messages with a header line that totals 999 characters. My mailer reports that the connection was dropped unexpectedly and qmail doesn't log anything special about the disconnection event.
Has anyone seen similar behavior?
How can I work around this?