FluxBB email to Gmail fails

I recently installed a simple forum using FluxBB version 1.5.2 ( fluxbb.org ). I configured it such that on a new registration, an email is sent to the new user with a temporary password. This works fine for everyone, except for people with a Gmail account. What is wrong?

I configured FluxBB to use the SMTP server of my ISP. Email to GMail accounts are returned with the following message:

SMTP error from remote mail server after end of data:
host gmail-smtp-in.l.google.com [173.194.66.26]:
550-5.7.1 [212.54.42.164      11] Our system has detected that this message is
550-5.7.1 not RFC 2822 compliant. To reduce the amount of spam sent to Gmail,
550-5.7.1 this message has been blocked. Please review
550 5.7.1 RFC 2822 specifications for more information. gq7si2167397wib.62 – gsmtp

Unfortunately, this message gives no clue on what is wrong… After many experiments and examining the outgoing smtp traffic by Wireshark, I found that some of the email headers were separated by <nl> (“\n”)  only, instead of <cr><nl> (“\r\n”).

The problem was solved by adding one line in include/email.php, line 249:

if ($pun_config['o_smtp_host'] != '')
{
 // Headers should be \r\n
 // Message should be ??
 $headers = str_replace("\n", "\r\n", $headers); //<--ADDED
 $message = str_replace("\n", "\r\n", $message);
 smtp_mail($to, $subject, $message, $headers);
}

Leave a comment