1

So this TEXT record response hardfail

XX.XX.XX.XX => my mail server

v=spf1 ip4:XX.XX.XX.XX include:aspmx.googlemail.com ~all

Question is how to create valid SPF record for sending e-mail

  • for my server IP
  • and using google mail servers, i thin problem is witch -all ~all
2
  • 2
    FWIW, Google suggest that you should include:_spf.google.com
    – nickgrim
    Commented May 7, 2012 at 20:41
  • 2
    The ending ~all is used while you are testing your SPF records but don't want them to actually do anything yet. The ending -all is for once they are correct and you want people to reject email that claims to be from you but isn't.
    – Ladadadada
    Commented May 7, 2012 at 21:14

1 Answer 1

3

I used to work for a company that had Google as their main email provider and this is an example of the SPF record.

v=spf1 a mx ip4:X.X.X.X ip4:Y.Y.Y.Y include:_spf.google.com include:blackberryservers.domain.com -all

So we could definite additional static IPs that we want to relay through us as well as the Google servers. We also did a lot of Blackberry email so we had a dig command set up to pull the SPF servers for the Blackberry servers. From here we put them in a separate spf record and then included it on the main SPF record. If you don't trust the _spf.google.com you can create a similar dig script to show all of the IPs and then cron it and diff the results on an hourly or daily basis.

Below is a small part of that code. I haven't used this in a while but I believe the output should still be the same.

PREVIOUS=/home/user/google_ips
NEW=`dig txt _spf.google.com | grep _spf | grep -ve ";" | awk -F\" '{print $2}' | tr ' ' '\n' | sort`
if [ "$PREVIOUS" != "$NEW" ]; then
echo $NEW | nail -r [email protected]
fi
3
  • Google search S*CK, 3 hours and only wrong information -- THX , that solve my problem
    – user956584
    Commented May 7, 2012 at 21:55
  • OK now its working i had receive 4 new email that should be delivery day ego :)
    – user956584
    Commented May 7, 2012 at 23:27
  • Very glad to hear it!
    – Eric
    Commented May 8, 2012 at 13:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .