Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Fixed a bug where mail messages were malformed when using the Sendmail #3757

Closed
wants to merge 2 commits into from
Closed

Conversation

stewartlord
Copy link
Contributor

transport on Unix systems with certain versions of sendmail (e.g.
Postfix < 2.9). Specifically, message headers spilled into the body
and the body text was double-spaced.

The source of the problem was the use of CRLF as the EOL sequence
when sending messages via PHP's built-in mail() function on Unix
systems. Despite what the PHP manual says, LF should be used as the
sole EOL character on Unix. This is because mail() is a wrapper for
sendmail on Unix and does not speak SMTP except on Windows.

See http://zend-framework-community.634137.n4.nabble.com/Zend-Mail-and-Postfix-lt-2-9-td4658920.html for further discussion.

transport on Unix systems with certain versions of sendmail (e.g.
Postfix < 2.9). Specifically, message headers spilled into the body
and the body text was double-spaced.

The source of the problem was the use of CRLF as the EOL sequence
when sending messages via PHP's built-in mail() function on Unix
systems. Despite what the PHP manual says, LF should be used as the
sole EOL character on Unix. This is because mail() is a wrapper for
sendmail on Unix and does not speak SMTP except on Windows.
@stewartlord
Copy link
Contributor Author

Looks like I didn't cast a wide-enough net. The recipients and subject must also be EOL translated.

being independantly wrapped. Now we convert line-endings on $to, $subject,
$body and $headers immediately before calling mail().
@ghost ghost assigned weierophinney Feb 14, 2013
weierophinney added a commit that referenced this pull request Feb 14, 2013
weierophinney added a commit to zendframework/zend-mail that referenced this pull request May 14, 2015
weierophinney added a commit to zendframework/zend-mail that referenced this pull request May 14, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants