Bug #69874 [Ver->Csd]: Can't set empty additional_headers for mail()

From: Date: Mon, 29 Jun 2015 07:32:25 +0000
Subject: Bug #69874 [Ver->Csd]: Can't set empty additional_headers for mail()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193979@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69874&edit=1 ID: 69874 Updated by: stas@php.net Reported by: buglloc at yandex dot ru Summary: Can't set empty additional_headers for mail() -Status: Verified +Status: Closed Type: Bug Package: Mail related Operating System: Linux PHP Version: 5.6.10 Assigned To: yohgaki Block user comment: N Private report: N New Comment: Automatic comment on behalf of yohgaki Revision: http://git.php.net/?p=php-src.git;a=commit;h=dacea3f6fb3f84c79a3412b24547eb2c636754f6 Log: Fixed Bug #69874 : Can't set empty additional_headers for mail() Previous Comments: ------------------------------------------------------------------------ [2015-06-19 03:23:03] yohgaki@php.net This is the PR that fixes this bug. https://github.com/php/php-src/pull/1350 ------------------------------------------------------------------------ [2015-06-19 02:48:59] yohgaki@php.net Sure ------------------------------------------------------------------------ [2015-06-18 19:08:31] cmb@php.net Yasuo, can you please have a look at this issue? ------------------------------------------------------------------------ [2015-06-18 14:17:33] buglloc at yandex dot ru Description: ------------ After update to PHP 5.6.10 with fix https://bugs.php.net/bug.php?id=68776 i can't set empty additional_headers for mail() function (i.e. if i want to set additional_parameters). Test script: --------------- echo 'without additional headers at all:'; var_dump(mail('to', 'subj', 'mess')); echo 'with additional headers:'; var_dump(mail('to', 'subj', 'mess', 'X-Header: foo')); echo 'with empty string as additional headers:'; var_dump(mail('to', 'subj', 'mess', '')); echo 'with additional parameters and null as additional headers:'; var_dump(mail('to', 'subj', 'mess', null, 'foo')); Expected result: ---------------- without additional headers at all:bool(true) with additional headers:bool(true) with empty string as additional headers:bool(true) with additional parameters and null as additional headers:bool(true) Actual result: -------------- without additional headers at all:bool(true) with additional headers:bool(true) with empty string as additional headers:PHP Warning: mail(): Multiple or malformed newlines found in additional_header in /tmp/test.php on line 9 Warning: mail(): Multiple or malformed newlines found in additional_header in /tmp/test.php on line 9 bool(false) with additional parameters and null as additional headers:PHP Warning: mail(): Multiple or malformed newlines found in additional_header in /tmp/test.php on line 11 Warning: mail(): Multiple or malformed newlines found in additional_header in /tmp/test.php on line 11 bool(false) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69874&edit=1

« previous php.bugs (#193979) next »