Spent quite a bit of time Googling around for an answer to this but couldn’t find an article that described it properly anywhere. I was having a bit of trouble with “undelivered mail” email spam, ie – people were using my domain to send spam emails to other people but the emails were bouncing back to me when no inbox was found. Adding an SPF record to your domain tells other email clients that your domain is a little bit more trustworthy and can also help avoid your legitimate emails going into other people’s spam.
I Googled how to setup an SPF record manually in WHM but found conflicting results on the correct syntax to use but then I realised that there’s an actual automated tool inside Cpanel! If you go to “Email Authentication” under “Mail” in your site’s Cpanel (see below) and “Enable” SPF, you can then customise it slightly for your situation and the resulting SPF record will be added automatically to your DNS zone:
Once SPF is enabled, it will add automatic rules to your record based on your sending server IP address but you can add server/domain details for other servers which might send email from your domain. For example I use Google Apps email and have switched all my email to them from my own domain via DNS. The screenshot below shows the “Incude” setup for me:
Finally, here’s my full SPF record, added automatically to my DNS zone via the above process:
[php]reverbstudios.ie. 14400 IN TXT "v=spf1 +a +mx +ip4:220.127.116.11 +include:_spf.google.com +include:reverbstudios.ie ~all"[/php]
You can test your new SPF record HERE once the DNS change has propogated.