|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-11-12 18:10 UTC] mattcoz at yahoo dot com
Description:
------------
When the server is set up with the mail.add_x_header preference enabled, an extra space is added before the additional headers. In my example where I set the From address in my additional headers, this causes it to add an additional From header. The email is then blocked if sent to gmail addresses. This does not happen on another server running PHP 5.3.13 with the same settings.
I've attempted to look at the mail.c code and find the problem, but I don't see anywhere that might explain why the extra space is being added.
Test script:
---------------
mail("to@email.com", "Subject", "Message", "From: from@email.com");
Expected result:
----------------
To: <to@email.com>
X-PHP-Originating-Script: 0:test.php
From: <from@email.com>
Actual result:
--------------
To: <to@email.com>
X-PHP-Originating-Script: 0:test.php
From: from@email.com
From: <from@email.com>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 13 01:00:02 2025 UTC |
I can't reproduce the reported behavior (neither on Windows with php-7.0.13-nts-Win32-VC14-x86, nor on Linux with current PHP-5.6 and PHP-7.0): php -n -d mail.add_x_header=1 -d sendmail_path="cat -" -r "mail('to@email.com', 'Subject', 'Message', 'From: from@email.com');" To: to@email.com Subject: Subject X-PHP-Originating-Script: 1:Command line code From: from@email.com Message