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

Dmitry Dulepov [typo3] dmitry at typo3.org
Sun May 4 15:33:31 CEST 2008


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.
> 
> This can be fixed quite easily in class.t3lib_htmlmail.php as shown in 
> the patch.
> 
> Solution:
> Apply the patch.
> 
> Notes:
> This issue cannot be tested from the mail test inside the install tool 
> since only the email address is used there.
> 
> [1]<http://www.php.net/manual/en/function.mail.php>

After looking to this issue I think we need a bit different solution. This patch will work but not for all cases. It is possible to call t3lib_htmlmail in several different ways and patch fixes only some of them.

Also there is t3lib_div::plainMailEncoded(), which has the same problem. I think we need a system wide solution.

I got mini_sendmail on my local computer and I think we can make another patch during t3dd08 and include it to 4.1.7 and 4.2.1.

The patch should have a new function in t3lib_div (proposed name is "isBrokenEmailEnv") and that function should check for TYPO3_OS=='WIN' and for mini_sendmail in sendmail_path. Another system wide function should convert input parameter to e-mail address only (i.e. '"John Doe" <john at doe.com>' becomes 'john at doe.com') if the first function returns true. t3lib_htmlmail and t3lib_div::plainMailEncoded() should use the second function for "From:" header and in mail() call.

-- 
Dmitry Dulepov
TYPO3 core team
Web: http://typo3bloke.net/
Skype: callto:liels_bugs
"Nothing is impossible. There are only limits to our knowledge"


More information about the TYPO3-team-core mailing list