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("[EMAIL PROTECTED]", "RFC822 problems", "This message fails RFC822
compliance!");

?>

Expected result:
----------------
The generated mail message should be:

To: [EMAIL PROTECTED]
Subject: RFC822 problems\r\n
\r\n
This message fails RFC822 compliance!\r\n

Actual result:
--------------
To: [EMAIL PROTECTED]
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

Reply via email to