Please help to set up a SPF record. I have found several SPF record generators but all questions are too complicated and I am afraid to make something wrong.

I want to allow sending mail only from:

1) from all IP addresses that are listed as A records for this domain. 2) from other servers in my data center in the same IP range 2) from Gmail servers - my domain is set up to use Gmail (all MX records are Google's MX records). Google's instructions say to include include:_spf.google.com ~all in the SPF record. Do I need mx in this case?

Which is correct:

v=spf1 a ip4:111.222.333.0/24 include:_spf.google.com ~all

or

v=spf1 mx a ip4:111.222.333.0/24 include:_spf.google.com ~all

Thanks.

link|improve this question
feedback

migrated from stackoverflow.com Oct 12 '11 at 14:35

This question came from our site for professional and enthusiast programmers.

1 Answer

The first is correct for testing. The second is unnecessary because of the Google include.

When you're done testing (send an e-mail from all authorized servers to a test service) change the "~all" to "-all". The tilde indicates that you're testing.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown