What is the proper newline in emails? LF or CRLF? -
recently customers complained getting garbled emails. mime headers showing, , base64 encoded data, etc. stuff should have been decoded mail clients.
after investigating found mail clients (gmx.de webmail name one) inserted blank line after every other line, indeed messing up.
following hunch, changed mail sending code replace crlf lf. , lo , behold - mail arrived whole.
now, weird, because rfc 5322 explicitly states that
2.3. body
the body of message lines of us-ascii characters. 2 limitations on body follows:
o cr , lf must occur crlf; must not appear independently in body.
huh? bad webmail? or did go wrong somewhere? other webmails (like gmail) have no problems this, , indeed seems majority of people have no problems (since complaints few).
just note - i'm sending email through php's mail()
function on linux box. underlying mail software seems qmail, i'm not sure.
it seems qmail doesn't crlf under similar conditions. problem? isn't fixed (that page hasn't updated in 4 years)?
http://www.php.net/manual/en/function.mail.php states
note:
if messages not received, try using lf (\n) only. unix mail transfer agents (most notably qmail) replace lf crlf automatically (which leads doubling cr if crlf used). should last resort, not comply rfc 2822.
Comments
Post a Comment