[Mimedefang] Bare returns in message body

Jan Pieter Cornet johnpc at xs4all.nl
Wed Nov 16 04:54:24 EST 2005

On Tue, Nov 15, 2005 at 10:56:49AM -0600, Aleksandar Milivojevic wrote:
> >- There is no way to see a lone LF from milter.
> >- There IS a way to see a lone CR.
> >- There is no way to know if the CRLF you see in your milter was REALLY
> > a CRLF on the wire, or just a LF on the wire.
> >- When you send a body BACK to Sendmail, it makes no difference if you
> > terminate lines with LF or CRLF.
> >
> >What a mess.
> In other words, it should be Sendmail that should be patched to reject
> bare CR and bare LF. Patch against Sendmail (as config option)?

I have already experimented with rejecting on bare CR characters in
september 2004, and reported about it on this list. It does reject some
otherwise legal email.

Patching sendmail to reject on bare LF terminated lines is likely
asking for a LOT of trouble. Since traditionally sendmail doesn't care
if you used CRLF or just LF, it's likely that lots of (local, unix-
specific) programs submit messages using only LF line endings. Some
programs might even implicitly rely on the fact that sendmail
"corrects" the line endings.

So you could rephrase this as:
- sendmail treats both LF and CRLF identical, as legal line endings.
- a lone CR is treated like a regular character by sendmail, and
  simply passed on (just like a NUL character, in fact...)

That latter part is breaking RFCs if you send the message on, so
MIMEDefang gives you the option of blocking it by flagging the message
with $SuspiciousCharsInBody.

IMHO, MIMEDefang should just mimick sendmail's behaviour of treating a
lone CR as a regular character, and pass it on. (Still flagging it as
$SuspiciousChar*, of course).

#!perl -wpl # mmfppfmpmmpp mmpffm <pmmppfmfpppppfmmmf at fpffmm4mmmpmfpmf.ppppmf>
$_[2]}->(map{/p|f/i+/f/i}split//,$&)+97):qw(m p f)[map{((ord$&)%32-1)/$_%3}(9,
3,1)]),5,1)='`'lt$&;$f.eig;                                # Jan-Pieter Cornet

More information about the MIMEDefang mailing list