Read the parts of an SPF record

  • v=spf1

    Identifies a TXT record as SPF. The mechanisms that follow it say which sending servers are allowed.

  • ip4 and ip6

    Authorize the IP addresses or address ranges written in the record.

  • include

    Uses another domain's SPF policy to authorize senders. That policy can lead to further DNS lookups of its own.

  • all

    Matches any sender that earlier mechanisms didn't match. Its qualifier determines the result for those senders.

These terms come from RFC 7208.

Your SPF email sender record has a problem

Keep one SPF record at each domain name

Different mail services must share one SPF record for the same DNS name. Publishing a separate SPF record for each service creates a permanent error. A single TXT record split into quoted strings is different from multiple SPF records.

Follow includes when counting DNS lookups

  • SPF allows at most 10 terms that trigger DNS lookups during a check, including terms reached through nested includes and redirects. The initial SPF lookup doesn't count toward that limit. Going over it produces a permanent error.

  • The limit counts only terms that are evaluated and trigger lookups, not every word in the record. Direct IP mechanisms don't count toward it. Review senders you no longer use and repeated includes before adding another mail service.

  • The counting rules are in RFC 7208, section 4.6.4.

Tell a sender failure from a record error

ResultMeaning
SoftfailThe ~all ending says an unmatched server is probably unauthorized. That's weaker than fail; it doesn't tell the receiver where to deliver the message.
FailThe -all ending says an unmatched server is unauthorized. The receiver still decides how to handle the message.
PermerrorThe published policy can't be evaluated correctly. Fix the DNS policy rather than retrying the same message unchanged.
TemperrorA temporary problem, usually with DNS, prevented evaluation. A later attempt may succeed.

Frequently asked questions

Should I switch from softfail to fail?

First list every service that sends using this domain. A stricter ending changes what the record says about senders outside that list; it doesn't authorize a sender you left out.