[Mailman-Developers] [ mailman-Bugs-634737 ] <CRLF>.<CRLF> in message body

noreply@sourceforge.net noreply@sourceforge.net
Thu Nov 7 17:27:09 2002

Bugs item #634737, was opened at 2002-11-06 19:05
You can respond by visiting: 

Category: mail delivery
Group: 2.0.x
Status: Open
Resolution: None
Priority: 5
Submitted By: Luca De Santis (lucadex)
Assigned to: Nobody/Anonymous (nobody)
Summary: <CRLF>.<CRLF> in message body

Initial Comment:
I looked in the bugs archive but couldn't find anything similar 
reported, so I write down something about it, hoping it could be of 
any help.

I experienced a problem with Mailman 2.0.11 when a mail posted 
to the list contained the sequence <CRLF>.<CRLF> (eg. \n.\n) in 
the middle of the message body.

This is the normal char sequence used to indicate the end of the 
body message (cfr RFC821).

In my Mailman installation I use Sendmail for the actual delivery. 
If a similar message was sent to the list, the qrunner script 
crashed and I found the following errors in the log:
Nov 06 02:05:02 2002 (16085) Delivery exception: [Errno 32] 
Broken pipe
Nov 06 02:05:02 2002 (16085) Traceback (innermost last):
  File "/home/mailman/Mailman/Handlers/HandlerAPI.py", line 82, 
in do_pipeline
    func(mlist, msg, msgdata)
  File "/home/mailman/Mailman/Handlers/Sendmail.py", line 86, in 
IOError: [Errno 32] Broken pipe

It seems like the <CRLF>.<CRLF> in the body of the message 
was interpreted as the end of the message by Sendmail, so it 
closed the pipe causing the errors above.

All the subscrivers of the list received only the portion of the mail 
just before the  <CRLF>.<CRLF>.

Now, since the message was not removed from the qfiles 
directory, it was resent over and over again to the list.
To solve the problem I patched the Handlers/Sendmail.py script 
adding the following function:

def cleanPeriod(str):
    pattern = re.compile(r"^\.$(.+)", re.DOTALL|re.MULTILINE)
    return (pattern.sub(r'. \1', str))

and changing line 80 from:
    msgtext = str(msg)
    msgtext = cleanPeriod(str(msg))


Comment By: Greg Ward (gward)
Date: 2002-11-07 12:27

Logged In: YES 

A possibly cleaner fix is to run sendmail with the "-oi"
switch.  I'm not
sure if all MTAs recognize this, but I think at least
Sendmail proper and Exim do.  Here's what Exim's man page
has to say:

       -oi    This option, which has the same effect as -i,
              ifies  that  a  dot  on a line by itself
should not
              terminate an incoming, non-SMTP message.  
This  is
              the default if Exim is called as rmail.

So maybe "-i" is the portable way to specify this option?

I wonder how Mailman handles such messages when SMTP is used?


You can respond by visiting: 

More information about the Mailman-Developers mailing list