ID:               28976
 Updated by:       [EMAIL PROTECTED]
 Reported By:      kdaniel at aosepc dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Mail related
 Operating System: Windows\Apache
 PHP Version:      4.3.6
 New Comment:

You mean it uses the sendmail_from ini setting?



Previous Comments:
------------------------------------------------------------------------

[2004-06-30 18:19:53] kdaniel at aosepc dot com

Description:
------------
The mail function always sticks in the Return-Path header based on the
php.ini setting even though the email address does not correspond with
the From header.

There needs to be a way to either disable the Return-Path header from
being inserted into the mail headers or the Return-Path should use the
>From header email address.



Reproduce code:
---------------
$To = "[EMAIL PROTECTED]";
$Text = "This is a test.";
$Html = "<H1>This is a test.</H1>";
$Subject = "PHP Mail Test";
$message = "";

$headers = "From: [EMAIL PROTECTED]";
$headers .= "X-Mailer: PHP4\n";
$headers .= "X-Priority: 3\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/alternative;
boundary=\"==MIME_BOUNDRY_alt_main_message\"\n\n";
$headers .= "This part of the E-mail should never be seen. If you are
reading this, consider upgrading your e-mail client to a
MIME-compatible client.";


$message .= "--==MIME_BOUNDRY_alt_main_message\n";
$message .= "Content-Type: text/plain; charset=ISO-8859-1\n";
$message .= "Content-Transfer-Encoding: 7bit\n\n";
$message .= $Text . "\n\n";
$message .= "--==MIME_BOUNDRY_alt_main_message\n";
$message .= "Content-Type: text/html; charset=ISO-8859-1\n";
$message .= "Content-Transfer-Encoding: 7bit\n\n";
$message .= "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0
Transitional//EN\">\n";
$message .= "<HTML><BODY>\n";
$message .= $Html . "\n";
$message .= "</BODY></HTML>\n\n";
$message .= "--==MIME_BOUNDRY_alt_main_message--\n";

mail($To, $Subject, $message, $headers); 


Expected result:
----------------
Microsoft Mail Internet Headers Version 2.0
Received: from server ([ipaddress]) by servername.com with Microsoft
SMTPSVC(6.0.3790.0);
         Wed, 30 Jun 2004 12:16:25 -0400
Date: Wed, 30 Jun 2004 12:16:41 -0500
Subject: PHP Mail Test
To: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
X-Mailer: PHP4
X-Priority: 3
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="==MIME_BOUNDRY_alt_main_message"
Return-Path: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
X-OriginalArrivalTime: 30 Jun 2004 16:16:25.0817 (UTC)
FILETIME=[9794FC90:01C45EBD]

--==MIME_BOUNDRY_alt_main_message
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

--==MIME_BOUNDRY_alt_main_message
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit


--==MIME_BOUNDRY_alt_main_message--


Actual result:
--------------
You will notice that the Return-Path header uses the php.ini setting
and not the From header.


Microsoft Mail Internet Headers Version 2.0
Received: from server ([ipaddress]) by servername.com with Microsoft
SMTPSVC(6.0.3790.0);
         Wed, 30 Jun 2004 12:16:25 -0400
Date: Wed, 30 Jun 2004 12:16:41 -0500
Subject: PHP Mail Test
To: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
X-Mailer: PHP4
X-Priority: 3
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="==MIME_BOUNDRY_alt_main_message"
Return-Path: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
X-OriginalArrivalTime: 30 Jun 2004 16:16:25.0817 (UTC)
FILETIME=[9794FC90:01C45EBD]

--==MIME_BOUNDRY_alt_main_message
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

--==MIME_BOUNDRY_alt_main_message
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit


--==MIME_BOUNDRY_alt_main_message--



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=28976&edit=1

Reply via email to