As per http://php.net/function.mail header should be separated with CRLF not LF.

drupal_mail_send() separates with LF only. patch attached.

Comments

dries’s picture

Version: 7.x-dev » 6.x-dev

I've committed the patch to CVS HEAD as it is conform the documentation. Lowering to DRUPAL-6 so Gabor can considering fixing this in Drupal 6.

dries’s picture

Status: Needs review » Reviewed & tested by the community
gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

I agree that we should fix this for purity. I took note of this from the php docs page linked however:

Note: If messages are not received, try using a LF (\n) only. Some poor quality Unix mail transfer agents replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with » RFC 2822.

In anticipation that this would be a miniscule problem, committed to 6.x. Thanks.

Bevan’s picture

StatusFileSize
new912 bytes

This is causing double line breaks to be inserted between headers on multiple systems, which in turn is causing headers to be rendered as part of content. Should be reverted for d6. For d7 we could perhaps detect what mailing system is being used and accordingly whether CRLF or just LF should be set.

Attached is the inverse patch

damien tournoud’s picture

Version: 6.x-dev » 7.x-dev
Status: Fixed » Needs review
StatusFileSize
new996 bytes

So it seems that this patch was committed way too fast. The PHP manual states:

If messages are not received, try using a LF (\n) only. Some poor quality Unix mail transfer agents replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with » RFC 2822.

I suggest we document that (see attached patch).

gábor hojtsy’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.03 KB

I added a reference to this issue and made "MTAs" out of "MTA". Committed to 6.x. Let's commit to 7.x and find out a possibly better path later.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks all.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

danieldbird’s picture

I just want you all to know i love you and appreciate the effort.

You are lifesavers.

Daniel.