ID:               25373
 Updated by:       [EMAIL PROTECTED]
 Reported By:      shane at sell dot com
 Status:           Open
 Bug Type:         Documentation problem
 Operating System: linux
 PHP Version:      4.3.3
 New Comment:

AFAIK \r\n has to be on Windows, \n on Unix (even it may work sometimes
with \r\n as explained by "jhaar at trimble dot co dot nz"). I don't
know what's correct on Mac.

I wish to change this in php-src to work same on all platforms rather
than documenting it.


Previous Comments:
------------------------------------------------------------------------

[2004-07-02 13:23:45] php at grandrath-net dot de

I experienced the very same issue with exim. Replacing '\r\n' with '\n'
and removing any linebreak from the last header-line did the trick.

Please update your documentation. THX!

Martin Grandrath

------------------------------------------------------------------------

[2004-04-08 05:23:16] Jon at cytekstudios dot com

Ive also had that issue, because the manual indicates to use \r\n. I
just removed the \r and everything worked fine. 
Maybe we could just change the manual entry to only have the \n's? Does
using only \n's create problems with other mailers or OS's? I've only
tested on linux with qmail. 

Thanks,
Jonathan
CytekStudios.com

------------------------------------------------------------------------

[2004-03-09 02:53:48] jhaar at trimble dot co dot nz

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

------------------------------------------------------------------------

[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

Reply via email to