ID: 25373
Comment by: jhaar at trimble dot co dot nz
Reported By: shane at sell dot com
Status: Open
Bug Type: Documentation problem
Operating System: linux
PHP Version: 4.3.3
New Comment:
This reference to <CR><LF> is causing grief.
That is a reference to the SMTP RFCs - not "how to write text to a
command-line mailer like /usr/sbin/sendmail".
As mail() calls the command-line program, it should refer to EOL as
being "<LF>" only.
It so happens that sendmail converts <CR><LF> it sees in text into <LF>
before processing it any further - but that was a wee sendmail-specific
feature - not an official standard.
e.g. Qmail has a "sendmail clone" /usr/sbin/sendmail - and it *doesn't*
do that. Then you end up with e-mail going out with <CR><CR><LF> within
the SMTP transaction - yuck!
Thanks
Jason
Previous Comments:
------------------------------------------------------------------------
[2003-09-02 21:23:42] shane at sell dot com
Description:
------------
>From the PHP source (ext/standard/mail.c:215):
fprintf(sendmail, "To: %s\n", to);
fprintf(sendmail, "Subject: %s\n", subject);
if (headers != NULL) {
fprintf(sendmail, "%s\n", headers);
}
fprintf(sendmail, "\n%s\n", message);
>From the manual (http://us4.php.net/manual/en/function.mail.php):
Note: You must use \r\n to separate headers, although some Unix mail
transfer agents may work with just a single newline (\n).
The source and the manual seem to differ in their treatment of
newlines.
We were alerted to this problem by a customer's mail server, which is
having trouble parsing "\r\n" (which is the RFC standard, right?).
Expected result:
----------------
550 error on remote SMTP server
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25373&edit=1