ID: 35906 Updated by: [EMAIL PROTECTED] Reported By: brian at macserve dot net -Status: Open +Status: Closed Bug Type: Mail related PHP Version: 4.4.1 New Comment:
I don't know what you're talking about, but the sendmail.c you pointed at is only used within Windows. And that part is now fixed. Previous Comments: ------------------------------------------------------------------------ [2006-01-06 01:59:56] brian at macserve dot net I don't have Windows either. I was seeing this under Mac OS 10.3.9 (Postfix/sendmail), so looking at the code and the bug fixes told me it was still around. I guess it's Postfix fixup that is the culprit here. 2 Questions: 1. What logic was applied that determined that *nix PHP can't utilize the SMTP engine that is present in Win32PHP? 2. For consistency sake, wouldn't it be better to have the code for outputting messages across the same platforms do the same thing regardless of final SMTP chain injection method? As in, the same code that is used to detect/add Date: headers (in the proper format) should be used on messages submitted through mail() on ALL platforms. This should have zero effect on *nix platforms as the "sendmail" emulators shouldn't add another Date header, if already present. Brian ------------------------------------------------------------------------ [2006-01-06 01:36:20] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip I just committed a fix for this. Please test in about 6 hours. ------------------------------------------------------------------------ [2006-01-05 23:15:50] [EMAIL PROTECTED] I am not the maintainer of Win32 mail code, I don't even have windows so I can't test this. This is not a problem on any other OS than Windows either, as that doesn't use the sendmail.c code. ------------------------------------------------------------------------ [2006-01-05 21:33:38] [EMAIL PROTECTED] Assigned to the maintainer. ------------------------------------------------------------------------ [2006-01-05 16:27:17] brian at macserve dot net 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 = '[EMAIL PROTECTED]'; $fromAddress = '[EMAIL PROTECTED]'; $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) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35906&edit=1