Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
share|improve this question
2  
FWIW, Google suggest that you should include:_spf.google.com –  nickgrim May 7 '12 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 May 7 '12 at 21:14

1 Answer 1

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 your@email.com
fi
share|improve this answer
    
Google search S*CK, 3 hours and only wrong information -- THX , that solve my problem –  Userpassword May 7 '12 at 21:55
    
OK now its working i had receive 4 new email that should be delivery day ego :) –  Userpassword May 7 '12 at 23:27
    
Very glad to hear it! –  Eric May 8 '12 at 13:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.