My previous post showed how to set up gmail for your own custom domain. A friend pointed out that any email I send through gmail for xtargets may be considered spam. This is because some mail gateways are implementing authentication techniques to detect if an email is ham or spam.
One way to authenticate an email is to declare via a DNS record which machines are allowed to send email on behalf of xtargets.com. The way we do this is add an SPF record to our DNS for xtargets.com. As before I do this with the Zerigo web gui associated with my heroku account.
I add a TXT record and populate the data section with
v=spf1 include:_spf.google.com ~all
If we do an
nslookup -type=TXT _spf.google.com
_spf.google.com text = "v=spf1 ip4:188.8.131.52/19 \ ip4:184.108.40.206/19 \ ip4:220.127.116.11/20 \ ip4:18.104.22.168/18 \ ip4:22.214.171.124/17 \ ip4:126.96.36.199/20 \ ip4:188.8.131.52/16 \ ip4:184.108.40.206/20 \ ip4:220.127.116.11/20 \ ip4:18.104.22.168/16 \ ?all"
which are the IP address ranges that google delivers mail from.
I can prove this to myself by sending an email to another account I have on yahoo and inspecting the headers I find that yahoo has checked the SPF record and verified the authenticity of my email.
Received-SPF: pass (mta1000.mail.sp2.yahoo.com: \ domain of firstname.lastname@example.org \ designates 22.214.171.124 as permitted sender