How to set SPF record?
Solution 1:
You will need a TXT SPF record for each domain.
The following reason explains why:
If you send me an email from mail.example.com (as your postfix server) and claim to be [email protected] then my server (SPF capable) would look up the SPF record of domain1.com.
It would be specifically looking in the TXT SPF record of domain1.com for the mention of mail.example.com and whether it is permitted to send emails on behalf of domain1.com.
(http://www.openspf.org/FAQ/What_it_does)
Solution 2:
I suggest you setup the SPF record for example.com as:
v=spf1 mx -all
(assuming mail.example.com is the MX for example.com) then set all of the virtual domains SPF records as:
v=spf1 redirect=example.com
so all further changes would be done on the example.com record.
Of course, these are suggestions; feel free to customize for your case.
Solution 3:
Here are some free tools that helps you creating and validating SPF records:
- The SPF Setup Wizard
- SPF Record Testing Tools
- SPF Project Overview