How to add a SPF record through WHM to prevent mails from of your domain from going to the spam folder?
One of our Drupal clients had reported that the emails from the Google Apps mail accounts on their Drupal site were going into the spam folder of the recipients inbox. When we analyzed the situation we noticed that the SPF records for the domain were not set correctly. Read on to know how to add a SPF record through WHM to prevent mails from of your domain from going to the spam folder.
What is an SPF
SPF(Sender Policy Framework) is a DNS text record that specifies which mail server can sent the email on behalf of our domain.
If our domain does not have a SPF record, the recipients cannot determine whether this mail was send from an authorized mail server or not which will often result in our mails being send to their spam folder. To avoid this we have to add an SPF record for our domain. Using this we can also prevent spam mails which is coming from other sites with 'our domain' From address.
For example: If our domain uses Gmail for sending mail, then we have to create a SPF record which identifies the Gmail server as our authenticated mailserver. This will result in all mails except the one from Gmail to be marked as spam.
Configuring the SPF
Here is an example of how you can configure an SPF record for your domain
- Login to WHM
- Select the edit zone from the side menu
- Select domain name from drop-down list.
- Edit the txt file to
v=spf1 +a +mx +ip4:204.197.252.69 include:_spf.google.com ~all"
In this rule,
- + qualifier stands for accept mail or allowed to send.
- a - indicates the A record of domains
- +mx +ip4:204.197.252.69 - allow mails from this domain.
- include:_spf.google.com - allow mails from google apps server
- ~all - accept all mails and mark as spam mail which is not sent from the authorized mail server.
For testing SPF records, you use this site http://www.kitterman.com/spf/validate.html
Hope the article was helpful. Use the comment form below to give your feedback regarding the article
References: