From: kdaniel at aosepc dot com Operating system: Windows\Apache PHP version: 4.3.6 PHP Bug Type: Mail related Bug description: Ability to disable Return-Path header or use From header instead of php.ini
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 bug report at http://bugs.php.net/?id=28976&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28976&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28976&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=28976&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=28976&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=28976&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=28976&r=needscript Try newer version: http://bugs.php.net/fix.php?id=28976&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=28976&r=support Expected behavior: http://bugs.php.net/fix.php?id=28976&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=28976&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=28976&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=28976&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28976&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=28976&r=dst IIS Stability: http://bugs.php.net/fix.php?id=28976&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=28976&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=28976&r=float