Setting SPF Record

SPF Record is becoming more important because some of the most used mail servers like Hotmail/Outlook, Gmail, … are making use of this value to filter the mails as SPAM.
When you set it, you must be careful. If you don’t set it properly your emails may not accept. Don’t worry about, we are going to analyze an example that should work in most of the systems.

Straight to our domain setting, we set a net TXT Record.

¡DEPRECATED! Don’t make a SPF Record, it has been deprecated!

Our value for set this record looks like this:

v=spf1 a mx ~all

In the beginning we set SPF version, in our case “spf1”.
Now, we set which servers are allowed to send emails using your domain name. For this purpose we have set a and mx values. First one (a) is allowing your current domain server and the other one (mx) is allowing all your mail servers.
We have more choices, some interest is the following:

  • ptr: this will give permission to your hostname(s) servers which could be a high range of servers, for this reason it is not recommended unless you have several mail servers.
  • ip4/ip6: this allow one server by its IP address.
  • include:[VALUE], VALUE can be an IP, Hostname, … This is quite interesting if you are using third-party companies to send email on behalf of you. Some services that you must set is Mandrill, Sparkpost, …

In the end we found this value ~all which indicates that if a server is not in your allowed list it is not allowed.

We hope it was useful, most of the systems works good using this configuration, however you could need further information which you can find in SPF Record Syntax.

Leave a Reply