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

From: Date: Thu, 18 Jun 2015 19:08:31 +0000
Subject: Bug #69874 [Opn->Ver]: Can't set empty additional_headers for mail()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193668@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: cmb@php.net Reported by: buglloc at yandex dot ru Summary: Can't set empty additional_headers for mail() -Status: Open +Status: Verified Type: Bug Package: Mail related Operating System: Linux PHP Version: 5.6.10 -Assigned To: +Assigned To: yohgaki Block user comment: N Private report: N New Comment: Yasuo, can you please have a look at this issue? Previous Comments: ------------------------------------------------------------------------ [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 (#193668) next »