SPF

v=spf1 ip4:22.23.24.25 include:another-domain-that-can-send-email-for-us.com -all

v=spf1 – This simply states that version 1 of SPF is being implemented. There is no other version at this point, so this should always stay “v=spf1”, at least until another version is released. (If you’re curious, there was another version at one time – SenderID – but it’s been discontinued.)

ip4:22.23.24.25 – This is the IP address of the mail server and/or domain that’s authorized to send email for that domain. Multiple IPs can be used. So if your mail provider rotates IPs, all IP addresses can be listed either individually (ip4:22.23.24.25 ip4:12.13.14.15) or through a CIDR range (ip4:22.23.24.0/20). Note that both IPv4 and IPv6 addresses should be listed if both are used by the mail server.

include:another-domain-that-can-send-email-for-us.com – This is a secondary domain that is authorized to send email on behalf of the primary mail domain. If multiple domains are authorized, they should all be listed as separate “includes.” However, a maximum of 10 includes are allowed for any sending domain.

all – The “all” tag basically tells the receiving server how it should handle all messages sent from a domain if it sees a domain in the header that’s not listed in the SPF record. There are a few options, and these options are dictated by the character that precedes the “all” tag. These are:

  • -all (dash all) – This is a hard fail. This means that servers that aren’t listed in the SPF record aren’t recognized or authorized to send email for the domain, so the email should be rejected by the receiving server.
  • ~all (tilde all) – This is a soft fail. Basically, that means that the server isn’t listed in the SPF record, but it should not be flat out rejected by the receiving server. Instead, the message will be marked as possible spam.
  • +all (plus all) – THIS IS NOT RECOMMENDED. Now that THAT is out of the way: this tag essentially means any domain listed is authorized to send email, even if it’s not listed in the SPF record.

Refs

Very good government information here:

National Cyber Security Centre