|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-01-05 21:33 UTC] tony2001@php.net
[2006-01-05 23:15 UTC] derick@php.net
[2006-01-06 01:36 UTC] sniper@php.net
[2006-01-06 01:59 UTC] brian at macserve dot net
[2006-01-06 02:13 UTC] sniper@php.net
[2006-01-06 03:05 UTC] brian at macserve dot net
[2006-01-06 09:11 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 13:00:01 2025 UTC |
Description: ------------ The Date header that is generated in the mail() command is not RFC compliant in that it generates 2 spaces right before the day of the month, when there should only be one. This trips spam filters that are looking for sloppy programming by spammers. Interstingly, date('r') produces a correctly spaced date: Thu, 05 Jan 2006 08:51:13 -0600 Probably because the day of month is padded. line 716 from 4.4.1's sendmail.c: sprintf(header_buffer, "Date: %s, %02d %s %04d %02d:%02d:%02d %s%02d%02d\r\n", Looks like this was fixed in the 5.x branch by changing this to effectively use: date('r') in response to bug # 29334 line 706: char *dt = php_format_date("r", 1, tNow, 1 TSRMLS_CC); sprintf(header_buffer, "Date: %s\r\n", dt); Reproduce code: --------------- $toAddress = 'brian@macserve.net'; $fromAddress = 'brian@macserve.net'; $extraParams = '-f'.$fromAddress; $subj = 'Test Date Hdr'; $emailMsg = 'Test Message'; echo mail($toAddress, $subj, $emailMsg, '', $extraParams); Expected result: ---------------- Date: Thu, 5 Jan 2006 08:51:03 -0600 (CST) Actual result: -------------- Date: Thu, 5 Jan 2006 08:51:03 -0600 (CST)