#31167 [NEW]: mail() is not RFC 822 compliant
| From: | polone at townnews dot com | Date: | Sat, 18 Dec 2004 00:23:43 +0000 |
| Subject: | #31167 [NEW]: mail() is not RFC 822 compliant | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-70557@lists.php.net to get a copy of this message | ||
From: polone at townnews dot com
Operating system: RedHat Linux 7.3
PHP version: 4.3.10
PHP Bug Type: Mail related
Bug description: mail() is not RFC 822 compliant
Description:
------------
Please note, I have READ ticket #30226 - this person was right, but for
the wrong reasons. The mail() function is not RFC822 compliant:
BEGIN RFC822 SNIPPET >>>
3.2. HEADER FIELD DEFINITIONS
These rules show a field meta-syntax, without regard for the particular
type or internal syntax. Their purpose is to permit detection of fields;
also, they present to higher-level parsers an image of each field as
fitting on one line.
field = field-name ":" [ field-body ] CRLF
<<< END RFC822 SNIPPET
All header fields inserted by PHP's mail() function are only separated
with LF. Note that this causes issues with RFC822 compliant MTAs. The file
where this is occuring is in ext/standard/mail.c, lines 228-233. As it
turns out, probably anywhere you are doing LF you should be doing CRLF.
References:
RFC822
http://www.faqs.org/rfcs/rfc822.html
Reproduce code:
---------------
<?php
mail("anyone@example.com", "RFC822 problems", "This message fails RFC822
compliance!");
?>
Expected result:
----------------
The generated mail message should be:
To: anyone@example.com\r\n
Subject: RFC822 problems\r\n
\r\n
This message fails RFC822 compliance!\r\n
Actual result:
--------------
To: anyone@example.com\n
Subject: RFC822 problems\n
\n
This message fails RFC822 compliance!\n
--
Edit bug report at http://bugs.php.net/?id=31167&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31167&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31167&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31167&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31167&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31167&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31167&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31167&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31167&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31167&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31167&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=31167&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=31167&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31167&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31167&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31167&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31167&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31167&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31167&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31167&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31167&r=mysqlcfg