php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23525 Mail header not always interpreted
Submitted: 2003-05-07 06:55 UTC Modified: 2003-05-07 15:36 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: joce at presence-pc dot com Assigned:
Status: Closed Package: Mail related
PHP Version: 4.3.2RC2 OS: linux
Private report: No CVE-ID: None
 [2003-05-07 06:55 UTC] joce at presence-pc dot com
Hi,

With the following script :

<?
$headers_html  = "MIME-Version: 1.0\n";
$headers_html .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
$headers_html .= "From: Presence PC - Lettre express <serveur@presence-pc.com>\n";
$headers_html .= "Return-Path: serveur@presence-pc.com\n";

mail('joc@presence-pc.com', 'test', 'test', $headers_html);
?>

Using PHP-4.3.2RC1, all works just fine and I'm receiving :

'test'

Using PHP-4.3.2RC2, header infos are no longer rightly interpreted, and I'm receiving a mail containing :

'MIME-Version: 1.0
Content-Type: text/html; charset="iso-8859-1"
From: Presence PC - Lettre express <serveur@presence-pc.com>



test'

(ie only Return-Path header info is interpreted)

Regards,
  Jocelyn Fournier

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-07 15:36 UTC] edink@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 [2004-09-07 02:25 UTC] Mike Little <phpbugs at zed1 dot com>
This bug (or a variant of it) still seems to exist (current in version 4.3.6 build May 26 2004).
My experiments have show that if I add a 'MIME-Version: 1.0' header then PHP adds an extra carriage return newline after it.
This code (taken from Wordpress) reproduces the problem:

$message_headers = "MIME-Version: 1.0\r\n"
. "$from\r\n"
. "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\r\n";
@mail($user->user_email, $subject, $notify_message, $message_headers);

There is an extra blank line after the MIME-Version header.

If you replace the MIME-Version header with "Reply-To: fred\r\n" you do NOT get an extra blank line.
If you replace it with "X-Hello: world\r\n" then again you do get the blank line.

It appears to be related to whether the header in question is a 'well known' header???
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 01 19:01:31 2024 UTC