abdfahim
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)
SPF Result (from Gmail):
On the contrary, when the XF board sends an email to the same user from the same domain
SPF Result (from Gmail):
Below is my email setup in XF
Can you please comment?
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)
Code:
$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?