Fork me on GitHub
Subscribe 3

Ticket #667 (fixed bug)

Use PHP_EOL to separate headers in emails

  • Created: 2012-05-07 14:31:01
  • Reported by: Franz
  • Assigned to: Franz
  • Milestone: 1.5.1
  • Component: email
  • Priority: normal

To avoid problems caused by rather bizarre behaviour caused by the combination of PHP's mail() and Postfix, we should use PHP_EOL instead of \r\n to separate headers in emails.

This way, on Windows, everything will still be correct (\r\n) and, on Linux, Postfix will be able to correctly replace all linebreaks (\n) by the correct CRLF.

Forum topic: https://fluxbb.org/forums/viewtopic.php?id=6306

History

Franz 2012-05-09 15:21:16

  • Owner set to Franz.

Franz 2012-05-09 15:39:41

So what about SMTP? Should we change headers to use \n (or rather, PHP_EOL), too, when SMTP is enabled? I would argue yes, since PHP adds this one incorrect \n anyway, so it's probably better to be consistently incorrect than have it all messed up like it is now.

Franz 2012-08-08 15:37:48

Commit 5751ae2 to fluxbb fluxbb-1.5

#667: Use PHP_EOL to separate headers when sending email.

quy 2012-10-23 03:14:08

So what about SMTP?

I investigated SMF and its smtp_mail function uses \r\n like FluxBB. Since it is working, I would not change it.

Franz 2012-10-30 10:15:37

  • Status changed from open to fixed.

Fixed for me, then.