While working with the eZ Mail component, for sending some emails comfortably, I noticed some issue with my Qmail installation. With some email accounts that received the emails, the headers were broken and had double line break characters, so the complete email was broken. That (weirdly) happened only with some servers (e.g. Gmail), while my own server handeled the emails gracefully.
The problem here was not our Mail component, which (correctly taken over from the PHP manual) used "rn", but my Qmail installation. The sendmail-wrapper delivered with Qmail seems to have an issue here and requiresyou to use just "n". However, our Mail component allows you to change the characters used for line breaks and you can simply do:
<?php
ezcMailTools::setLineBreak( "\n" );
?>on the components tool class before building your mail and everything will work fine.
Wie also added a note to our manual, so that nobody else will fall into this pitt.
If you liked this blog post or learned something, please consider using flattr to contribute back: .
Hey, pull some strings and get this put in the manual ASAP! This single point has caused me more frustration than any other related to PHP (I'm understand it's not actually a PHP issue BTW).
So a question arises-
Is it possible to automatically figure out when the Qmail Sendmail-wrapper is being used, so software can be distributed without the line-endings having to be customized by the end user?
This is documented here:
http://www.lifewithqmail.org/lwq.html#cr
There is a long running bug report for PHP here: http://bugs.php.net/bug.php?id=15841
Qmail is very standards compliant!
Fields with bold names are mandatory.
Qmail ? PHP ? Mail() ??
Tobias Schlitt ?????? ez Mail ??? Qmail ???????????????????????????????????????????????????????? ez Mail ??????