#33976 [NEW]: mail() overrides the provided header

From: Date: Wed, 03 Aug 2005 12:05:07 +0000
Subject: #33976 [NEW]: mail() overrides the provided header
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-82870@lists.php.net to get a copy of this message
From: dominik dot blystak at pro-open dot de Operating system: Mandrake Linux PHP version: 4.3.11 PHP Bug Type: Mail related Bug description: mail() overrides the provided header Description: ------------ In php 4.3.10 and 4.3.4 of Mandrake Linux I encountered the following behaviour. The mail() function sets a second mime-header with Content-Type: text/plain; charset=UTF-8 and Content-Transfer-Encoding: BASE64 regardless of an already provided header. I could verify this problem with example code of the mail() documentation. Reproduce code: --------------- <?php $to = "dominik.blystak@pro-open.de"; // beachten Sie das Komma $subject = "Geburtstags-Erinnerung für August"; $message = ' <html> <head> <title>Geburtstags-Erinnerung für August</title> </head> <body> <p>Hier sind die Geburtstage im August!</p> </body> </html> '; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "Content-Transfer-Encoding: quoted-printable\r\n"; mail($to, $subject, $message, $headers); ?> Expected result: ---------------- There is just one mime-header (reduced to relevant parts): To: my@mail.com Subject: Geburtstags-Erinnerung für August MIME-Version: 1.0 Content-type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-Id: <20050803115921.B21BF9DCE6@server.com> Date: Wed, 3 Aug 2005 13:59:21 +0200 (CEST) From: apache@server.com (system user for apache) X-Length: 1114 X-KMail-EncryptionState: X-KMail-SignatureState: X-KMail-MDN-Sent: X-UID: 1135 Status: RO X-Status: OC <html> <head> <title>Geburtstags-Erinnerung für August</title> </head> <body> <p>Hier sind die Geburtstage im August!</p> </body> </html> Actual result: -------------- There are two mime-headers (reduced to relevant parts): To: my@mail.com Subject: Geburtstags-Erinnerung =?UTF-8?B?ZsO8ciBBdWd1?= =?UTF-8?B?c3Q=?= MIME-Version: 1.0 Content-type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: BASE64 Message-Id: <20050803115702.836366BC021@server.com> Date: Wed, 3 Aug 2005 13:57:02 +0200 (CEST) From: apache@server.com (system user for apache) X-UID: 39490 X-Length: 1211 Status: R X-Status: NC X-KMail-EncryptionState: X-KMail-SignatureState: X-KMail-MDN-Sent: Cgk8aHRtbD4KCTxoZWFkPgoJIDx0aXRsZT5HZWJ1cnRzdGFncy1FcmlubmVydW5nIGbDvHIgQXVn dXN0PC90aXRsZT4KCSA8L2hlYWQ+CgkgPGJvZHk+CgkgPHA+SGllciBzaW5kIGRpZSBHZWJ1cnRz dGFnZSBpbSBBdWd1c3QhPC9wPgoJCSAgICAgPC9ib2R5PgoJCSAgICAgPC9odG1sPgoJCSAgICAg -- Edit bug report at http://bugs.php.net/?id=33976&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33976&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33976&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33976&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33976&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33976&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33976&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33976&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33976&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33976&r=support Expected behavior: http://bugs.php.net/fix.php?id=33976&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33976&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33976&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33976&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33976&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33976&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33976&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33976&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33976&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33976&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33976&r=mysqlcfg

« previous php.bugs (#82870) next »