From: ts at dreamcoder dot dk
Operating system: Linux
PHP version: 4.3.3
PHP Bug Type: Mail related
Bug description: Using /r/n in mailheaders causes mailbody to become currupt
Description:
------------
When running the attached code, the mail headers will not be sent
correctly
This results in the mailheaders becomming corrupt and send two linebreaks,
thus dumping the remaining headers to the mail body. Notice how two
Message-Id's and Date headers are sent with the mail
The attached code worked fine in PHP 4.3.2. But also works when using \n
instead of \r\n
Reproduce code:
---------------
<?php
echo mail("[EMAIL PROTECTED]", "Test Mail", "Hello",
"From: John <[EMAIL PROTECTED]>\r\n"
."X-Engine: This\r\n"
."X-Mailer: PHP/" . phpversion());
?>
Expected result:
----------------
Headers:
From: John <[EMAIL PROTECTED]>
X-Engine: This
X-Mailer: PHP/4.3.3
Message-Id: <[EMAIL PROTECTED]>
Date: Tue, 26 Aug 2003 18:48:02 +0200 (CEST)
Hello
Actual result:
--------------
Headers:
From: John <[EMAIL PROTECTED]>
X-Engine: This
Message-ID: <[EMAIL PROTECTED]>
Date: Tue, 26 Aug 2003 18:48:09 +0200
X-Mailer: PHP/4.3.3
Message-Id: <[EMAIL PROTECTED]>
Date: Tue, 26 Aug 2003 18:48:02 +0200 (CEST)
Hello
--
Edit bug report at http://bugs.php.net/?id=25254&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25254&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25254&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25254&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25254&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25254&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25254&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25254&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25254&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25254&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25254&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25254&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25254&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25254&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25254&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25254&r=gnused