<div dir="ltr"><div><div>Package: exim4<br></div>Version: 4.80-7+deb7u<br><br><br><br>The SMTP Spec states that:<br><br>> 2.1.1. Line Length Limits<br>>   There are two limits that this standard places on the number of<br>>   characters in a line. Each line of characters MUST be no more than<br>>   998 characters, and SHOULD be no more than 78 characters, excluding<br>>   the CRLF.<br><br>However, if exim gets a message in the queue whose line length is longer than 998 chars it will happily send it to other hosts, thus violating the protocol.<br><br>In addition, MANY  MTAs (including gmail) will respond to an over-length line by hanging up on the connection (TCP RST) without any error message. Exim misclassifies this as a host error (as documented in <a href="http://www.exim.org/exim-html-current/doc/html/spec_html/ch-smtp_processing.html#SECToutSMTPerr">http://www.exim.org/exim-html-current/doc/html/spec_html/ch-smtp_processing.html#SECToutSMTPerr</a>) <br><br>As a result, sending messages that contain long header lines to a local server for delivery to a remote site  can interrupt delivery of legitimate messages to that remote site. This has been seen with certain "References" headers.<br><br></div><div>As a proposed work-around, a way might be found to limit long header length in the ACL area, to push the problem up stream toward its source.<br><br></div><div>I have also reported this upstream to exim, where a more proper solution is being considered: <a href="https://bugs.exim.org/show_bug.cgi?id=1684">https://bugs.exim.org/show_bug.cgi?id=1684</a><br></div><div><br></div><div>Expected behavior: A  message with too-long header line bounces back to sender with useful message<br><br></div><div>Observed behavior: All messages to the same MTA as the destination of the message with malformed header experience delays. Log shows "closed connection in response to sending data block", and "retry time not reached for any host"<br><br></div><div>How to reproduce:<br><br></div><div>Use netcat or telnet to connect to exim, and send it an email containing a header such as:<br><br></div><div>Subject: test<br></div><div>From: your@address<br></div><div>To: your@address<br></div><div>x-test: 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789<br><br><br><br><br></div></div>