[Mailman-Developers] EOL handling in Mailmanc
mads at kiilerich.com
Sun Mar 20 14:29:27 CET 2005
Today I got mail from Sylvain Beucler:
> Thanks for the pointer. So we should use CRLF anywhere.
On the network, yes. Not locally through the sendmail interface.
> Savane uses the PHP "mail()" function, that executes the local
> sendmail-compatible command.
Php mail() is IMHO quite buggy. On windows it connects to an smtp server and
sends whatever the user provided directly - \r\n is thus mandatory. (But IIRC
php internally adds some header lines ending with \n.) On unix php uses
sendmail (and can NOT be configured to use smtp :-( and can thus NOT confirm to
the php script that the local MTA has received and accepted the message) and
the message should thus not contain CRLF. Only the windows behaviour seems
documented in the php docs.
> At both GNU Savannah (savannah.gnu.org) and Gna! (gna.org), we use the
> Exim version packaged by Debian. In both cases, the mail we receive
> via mailing lists (and in the Mailman archives) have the newlines
> doubled. The mails we receive at our personnal mail addresses is
> correct (no doubling). As far as I'm concerned, line doubling _does_
> look ugly and unprofessional ;)
> As a result, I was under the impression that Mailman is the one that
> doubles the newlines. Now maybe Exim as an SMTP server (not as a
> sendmail-compatible command) is doubling lines. But are you completely
> sure Mailman (or a Python library used by Mailman) is not converting
> \r\n to \n\n?
My guess: When exim receives \r\n at its sendmail interface it is kind and
cleans it up and converts it to a \n, and when sending over SMTP it converts to
When Mailman receives \r\n it trusts the user and considers it a line with a \r
before the lineending \n. When Mailman delivers the mail over SMTP it writes
the lineending \n as \r\n, ending up with SMTP lines ending with \r\r\n. A
receiving MTA might consider that a malformed (mac) lineending followed by a
wellformed one and be kind enough to make the first wellformed, causing two
I suggest that you try to convert all \r\n to \n before calling mail(), that
you avoid using mail() and delivers through smtp instead, and finally that you
fix mail() ;-)
More information about the Mailman-Developers