XF 1.5 Email sending issue - SPF test fails in the emails by XF board


Well-known member
I use Google Apps (now GSuit) to send email from my domain. I noticed that the SPF test fails each time an email is sent via XF board.

At first I thought it was due to some issue in my domain/hosting. However, strangely enough, I noticed that if I send an email using usual PHP mail() function from the same domain, SPF test passes.

Below is the code snippet I use which results passed SPF test (just created a file called test.php in the root, where XF is installed)

$to      = 'someone@gmail.com';
$subject = 'Whatever subject it is';
$headers = 'From: Example <admin@exmpale.com>'. "\r\n";
$headers .= 'Reply-To: Example <admin@exmpale.com>'. "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion() . "\r\n";
$headers .= 'MIME-Version: 1.0'. "\r\n";
$headers .= 'Content-Type: text/plain; charset=UTF-8'. "\r\n";

mail($to, $subject, "this is a test message", $headers);

SPF Result (from Gmail):
Received-SPF: pass (google.com: domain of exmpale@a.hosting.com designates 12.123.456.12 as permitted sender)

On the contrary, when the XF board sends an email to the same user from the same domain
SPF Result (from Gmail):
Received-SPF: fail (google.com: domain of admin@exmpale.com does not designate 12.123.456.12 as permitted sender)

Below is my email setup in XF


Can you please comment?


Well-known member
SPF is a domain record.

Your domain must be listed in the SPF.

This is outside the scope of xf as it's not xf's responsiblity.


That's a nifty tool.

SPF is like a check point. Is this domain listed as a sender. Can this IP send on the behalf of the domain owner?

It prevents spammers tarnishing your domain.