Gaute Amundsen: > Hi > > We just changed our simple newsletter service from sendmail to postfix, and > went from 0,5 to 3 messages/ sec outgoing :) > (mail_version = 2.2.10) > > However I soon got bounces with "error: IllegalMIME chars found in header". > I gather this is a well known problem: > "CRLF to separate mail headers is incorrect": > http://bugs.php.net/bug.php?id=15841 > > The issue as I understand it : > Postfix expects EOL to be LF when picking up mail from sendmail on unix and > replaces that with CRLF when sending. When it gets CRLF it still replaces the > LF and we get CRCRLF.
This understanding is too simplistic. 1) Postfix receives local submissions in (LF or CRLF) format, SMTP submissions in SMTP format (CRLF), and QMQP submissions in a format that does not use CR or LF. Specifically, Postfix accepts local submissions in UNIX format (LF) or MSDOS format (CRLF) format BUT YOU MIST NOT MIX FORMATS. 2) Postfix stores mail in the queue in a format that does not use CR or LF. 3) Postfix delivers local mail in UNIX (LF) format, SMTP mail in SMTP format (CRLF). It would be really good if PHP application programmers formatted email messages in a consistent manner. For example, they could use a variable that contains the END-OF-LINE terminator, instead of hard-coding LF or CRLF line terminators all over the place. That is basic software engineering practice. Wietse > Apparently this is strictly speaking php's problem, as it ought to use the > systems EOL when sending. > > However... > Some grepping around reveals that we have about 150 occurrences of the match > "grep -i -R ' mail \+('" on our server. Most of these are in 3rd. party > software. > > In other words: It would be REALLY GOOD if there were some way of making the > postfix system handle this in a more robust manner. > > I have googled extensively, but with no clear solution. > The best so far is a rather nasty hack: > http://bugs.php.net/bug.php?id=15841#c123771 > > There _has_ to be some better way to handle this. > > Please, can anyone here give me a definitive answer? > > Regards > Gaute Amundsen > >