|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51604 newline in end of header is shown in start of message
Submitted: 2010-04-19 20:49 UTC Modified: 2010-04-22 04:23 UTC
From: pavol at klacansky dot com Assigned: aharvey (profile)
Status: Closed Package: Mail related
PHP Version: 5.3.2 OS: Ubuntu
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
6 + 10 = ?
Subscribe to this entry?

 [2010-04-19 20:49 UTC] pavol at klacansky dot com
if I have a newline (\n) at the end of last header, it will show to start of message of mail

Test script:
$email = '';
$headers = 'From: ' . $email . "\n";
$headers .= 'Cc: ' . $email . "\n";
$headers .= 'X-Mailer: PHP/' . phpversion() . "\n";
$headers .= 'Content-Type: text/plain; charset=utf-8' . "\n";
$headers .= 'Content-Transfer-Encoding: 8bit' . "\n";
mail('', 'test', 'Hallo', $headers);

Expected result:

Actual result:


php_bug51604.diff (last revision 2010-04-21 14:00 UTC by

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-19 20:50 UTC] pavol at klacansky dot com
Actual result:
 [2010-04-21 16:00 UTC]
The following patch has been added/updated:

Patch Name: php_bug51604.diff
Revision:   1271858442
 [2010-04-21 16:01 UTC]
The attached patch will fix this issue. I don't have php-src karma, so I can't commit it myself.
 [2010-04-22 04:05 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: aharvey
 [2010-04-22 04:22 UTC]
Automatic comment from SVN on behalf of aharvey
Log: Fix for bug #51604 (newline in end of header is shown in start of message).
Patch by Daniel Egeberg.
 [2010-04-22 04:23 UTC]
-Status: Assigned +Status: Closed
 [2010-04-22 04:23 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

Thanks for the patch, Daniel.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 19 16:01:30 2024 UTC