[TYPO3-core] RFC: #8522 Problems with PHP mail function on Windows

Martin Kutschker martin.kutschker-n0spam at no5pam-blackbox.net
Sat Apr 26 15:56:01 CEST 2008


Dmitry Dulepov [typo3] schrieb:
> Hi!
> 
> Andreas Otto wrote:
>> Problem:
>> The implementation of the mail function in PHP differs on Windows [1].
>>
>> Emails containing to and from email adresses formatted like:
>>
>> John Doe <john at example.com>
>>
>> will result in the email not being sent on Windows.
> 
> I think I know why... It is not Windows-specific but will also happen if 
> regular *nix sendmail is replaced with programs line mini_sendmail who 
> emulate sendmail to connect to smtp server. They all (including PHP's 
> mail() on Windows) do the same mistake: they take whatever is in "to" 
> and use it in smtp RCPT TO command, which is wrong syntax. They should 
> extract e-mail address and use that.
> 
> I think bug should be failed for PHP as well.

But why are then the From: and Reply-To: headers affected? They won't 
appear in the SMTP protocol itself. And it's these fields that the patch 
addresses.

It's quite clear (and even stated in the PHP docs) that the described 
behaviour is true for the To: header. Though To: is set also by the 
first mail() argument. *

Masi

* A clever implementation of mail() would set the To: header only if not 
present in the additional header argument.


More information about the TYPO3-team-core mailing list