Re: [Exim] CRLF input through pipe causes mangled headers

Top Page
Delete this message
Reply to this message
Author: barryp
Date:  
To: James P. Roberts
CC: exim-users
New-Topics: [Exim] (PATCH) CRLF input through pipe causes mangled headers
Subject: Re: [Exim] CRLF input through pipe causes mangled headers
Quoting "James P. Roberts" <punster@???>:
>
> Summary:
> (1) MTA's should not modify message bodies.
> (2) This issue apparently only comes up with Cyrus?
> (3) Not everyone uses Cyrus...
>
> Conclusions:
> (1) The fix should really be done on the Cyrus side.
> (2) My opinion is to NOT make it the Exim default.


I used tcpdump to take a look at the traffic Exim was generating both for SMTP
and LMTP delivery of these CRLF terminated messages, and found that Exim *is*
modifying the message bodies, adding an extra CR, so the lines end up
transmitted over the wire with CRCRLF terminations.

So Exim is already violating point #1, but it has to, because as Philip said -
it's a Unix world, and most files have just LF termination. Exim usually needs
to add CR to make it legal SMTP - it's just that in this case, they're already
there, but unfortunately Exim is just blindly adding some more.

I don't agree with point #2 - Cyrus may be the only thing we know of today that
triggers this problem by submitting messages that are already SMTP-ready
(line-termination-wise), but that doesn't mean other things won't pop up down
the road. Maybe something you'll want to use :)

From what I can tell, the write_chunk() function in transport.c is where the
extra CRs come from. If it was made just a little smarter about when it adds
CRs, Exim could handle other kinds of input more gracefully.

    Barry