• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Contact Form WP / SPF record

othmaqsa

Regular Pleskian
Server operating system version
Ubuntu 20.04.4 LTS
Plesk version and microupdate number
18.0.45
Hello,

I have a Wordpress/Woocommerce site with a contact us page configured with the CF7 form.
When I try to test the form, I receive the email returned by the form.

One thing that bothers me in the Mail Log Browser, everything is marked as "PASS" except the SPF line:
SPF record was not found in Authentication-Results

I note that the SPF record is already in place in the DNS side and I also note when I send mails to the server and gmail or another domain, everything is marked as "PASS", SPF too.

Can I ignore this error or there is any way to solve this error ?

Thank you in advance.
 
When I send mail from the server to an email address (gmail, yahoo etc), everything is PASS, even the SPF.

When a visitor contacts me through the contact form, I receive the mail with the details he has filled in.
In the mail log, everything is PASS, except the SPF, that's what I don't understand.
 
Please post your SPF record.

Maybe you are using two different IPs when sending mail to gmail, yahoo etc and contact form.
 
At what point do you see this?
I'd guess it's where the contact form script connects to postfix. localhost is not used in spf because you usually trust localhost implicitly and it is of no value to others and may even be harmful because it's not their localhost.
spf is only relevant when another system is receiving mail claiming to be from you, and at that point it will check that it comes from a permitted IP.
 
@othmaqsa, could you please post the solution that you finally chose?

Sure.

In my case, I use WP as CMS.

So, I added this on functions.php:

Code:
// Send email via SMTP
add_action('phpmailer_init', 'send_smtp_email');
function send_smtp_email( $phpmailer ) {
$phpmailer->isSMTP();
$phpmailer->Host = SMTP_HOST;
$phpmailer->SMTPAuth = SMTP_AUTH;
$phpmailer->Port = SMTP_PORT;
$phpmailer->Username = SMTP_USER;
$phpmailer->Password = SMTP_PASS;
$phpmailer->SMTPSecure = SMTP_SECURE;
$phpmailer->From = SMTP_FROM;
$phpmailer->FromName = SMTP_NAME;
}

I then added this to wp-config.php:

Code:
// SMTP email settings
define('SMTP_USER', '[email protected]'); // Username to use for SMTP authentication
define('SMTP_PASS', 'mypassword'); // Password to use for SMTP authentication
define('SMTP_HOST', 'mysmtphost'); // The hostname of the mail server
define('SMTP_FROM', '[email protected]'); // SMTP From email address
define('SMTP_NAME', 'MyWebsite'); // SMTP From name
define('SMTP_PORT', '465'); // SMTP port number - e.g. 25, 465 or 587
define('SMTP_SECURE', 'ssl'); // Encryption system to use - ssl or tls
define( 'SMTP_AUTH', true ); // Use SMTP authentication (true|false)
 
Back
Top