Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Windows (Apache2/PHP/5.2.6/MySQL5.1.30)

1.0-alpha has the same issue, despite the heroic attempts made to scrub the mail headers. I would have done this sooner but I tend to avoid alphas, especially when I am new to a system.

Let me try to summarize again, hopefully more clearly, for future readers. The PHP mail() function (in Windows, and without ‘sendmail_from’ being set in php.ini) overloads the meaning of the ‘From:’ header argument to include the SMTP ‘MAIL FROM:’ command value (the one sent over the socket to the SMTP server) in addition to the normal meaning of the header: the email message body ‘From:’ header (the one that most people think of — the one displayed in the headers of messages in your email client that frequently includes a textual name as well as an email address).

Not only is the nature of this issue obscure (two meanings for seemingly the same header), but it is further muddied by the behaviour of PHP mail() on different platforms (Windows and non-Windows) and within Windows itself (with and without ‘sendmail_from’ being set in php.ini). The obscure and incomplete Note in the PHP mail() documentation does not help matters either.

So, without either PHP mail() changing (seems unlikely as this issue has existed for years) or without specific knowledge of Windows being added to clients (cough), the solutions are: 1) if PHP is under your control, set the ‘sendmail_from’ variable (server-wide) in php.ini (and it will be used as the value for the SMTP ‘MAIL FROM:’ command), or 2) if the client supports SMTP directly (bbPress does so with a plugin), use it, specifying two values for the ‘From’ header (the SMTP value must be a simple email address such as “me@example.com” while the other value may include a textual name and an email address, such as “Myself <me@example.com>”.

Skip to toolbar