note 52856 deleted from function.mail by crell
| From: | crell@php.net | Date: | Tue, 12 Apr 2022 01:09:51 +0000 |
| Subject: | note 52856 deleted from function.mail by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218221@lists.php.net to get a copy of this message | ||
Note Submitter: msheldon at desertraven dot com
----
Just a comment on some of the examples, and as a note for those who may be unaware. The SMTP RFC 822
is VERY explicit in stating that \r\n is the ONLY acceptable line break format in the headers,
though is a little vague about the message body. While many MTAs will deal with just \n, I've
run accross plenty of them that will exhibit "interesting" behaviours when this happens.
Those MTAs that are strict in compliance will definitely break when header lines are terminated with
only \n. They will also most likely break if the body of the message contains more than 1000
consecutive characters without a \r\n.*
Note that RFC 821 is a little more clear in defining:
"line
A a sequence of ASCII characters ending with a <CRLF>."
RFC 821 makes no distinction between header lines and message body lines, since both are actually
transmitted during the DATA phase.
Bottom line, best practice is to be sure to convert any bare \n characters in the message to \r\n.
* "The maximum total length of a text line including the <CRLF> is 1000 characters"
(RFC 821)