#25254 [NEW]: Using /r/n in mailheaders causes mailbody to become currupt

From: Date: Tue, 26 Aug 2003 16:59:33 +0000
Subject: #25254 [NEW]: Using /r/n in mailheaders causes mailbody to become currupt
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-46690@lists.php.net to get a copy of this message
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("example@example.com", "Test Mail", "Hello", "From: John <test@example.com>\r\n" ."X-Engine: This\r\n" ."X-Mailer: PHP/" . phpversion()); ?> Expected result: ---------------- Headers: From: John <test@example.com> X-Engine: This X-Mailer: PHP/4.3.3 Message-Id: <20030826164802.3A2B314152@mail.example.com> Date: Tue, 26 Aug 2003 18:48:02 +0200 (CEST) Hello Actual result: -------------- Headers: From: John <test@example.com> X-Engine: This Message-ID: <1061916489.17277@example.com> Date: Tue, 26 Aug 2003 18:48:09 +0200 X-Mailer: PHP/4.3.3 Message-Id: <20030826164802.3A2B314152@mail.example.com> 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

« previous php.bugs (#46690) next »