SPF goes over its lookup limit
Your SPF record needs more than 10 DNS lookups once the records it includes are counted. A receiver that reaches the eleventh stops and returns an error instead of a pass, so mail from a service listed late in your record, or one it doesn't list, can fail SPF.
RFC 7208 section 4.6.4 sets the limit. Each include, a, mx, ptr and exists, and a redirect=, counts as one, and those inside the records you include count too: "SPF implementations MUST limit the total number of those terms to 10 during SPF evaluation". ip4, ip6 and all don't count.
On the result:
SPF goes over its lookup limit
Receivers stop after 10 DNS lookups, so mail from a service listed after that point fails SPF.
How the check counts
The check follows every include and redirect= in your record, and every one inside those, and adds up the terms above. It counts the whole record, not only up to the service that sends a given message, because a receiver checking mail from your last service, or from a server you never listed, can walk that far. The count is the most a receiver can need: it stops at the first entry that matches, so mail from a service listed early may still pass, and an included record that ends in +all means none of the later entries are ever read.
A service's include can cost more than one lookup, because it may include further records of its own. The service can change that without telling you, so a record that was under 10 can go over without any change on your side.
Look it up
Details → on your result shows your record. To count by hand, put your domain in place of example.com, then look up each include the same way:
dig +short TXT example.com
dig +short TXT _spf.example-service.com
On Windows, use nslookup -type=TXT with the same names.
Bring it under 10
- Remove services you no longer use. An old newsletter tool or a past mailbox provider is the usual find.
- Replace an
aormxentry with every address it stands for, IPv4 asip4:and IPv6 asip6:, if those addresses rarely change. Find them withdig +short A example.comanddig +short AAAA example.comfora, ordig +short MX example.com, thenAandAAAAfor each server it lists, formx. If the servers' addresses change later, you have to update the record yourself.aandmxmatch both kinds, so leaving out theip6:entries makes IPv6 mail fail. Keep any-,~or?in front:~mxbecomes~ip4:192.0.2.10 ~ip6:2001:db8::10, since a plain entry would pass servers the old one failed. Keep any prefix too. Ina/24//64,/24applies to IPv4 and//64to IPv6, so it becomesip4:192.0.2.0/24 ip6:2001:db8::/64.a/24alone leaves IPv6 at single addresses:ip4:192.0.2.0/24 ip6:2001:db8::10. - Remove a
ptrentry: RFC 7208 section 5.5 says it "SHOULD NOT be published". Mail it passed then needs another entry, so check first which of your servers it was there for. - Move a service to a subdomain. First publish the subdomain's SPF record with the service's include, for example at
bounce.news.example.com. If your DMARC record hasaspf=s, mail fromexample.comwith a return address on the subdomain won't align, so first make sure DKIM passes forexample.comitself, not only for the service's own domain. Then set the service to use that return address (Return-Path) in its domain settings. Keep the include in your main record until a test message showsspf=passwithsmtp.mailfrom=naming the subdomain underAuthentication-Results; then remove it. - Run the check again.
If you still need more than 10, SPF explains hosted SPF, where MailGlo serves your services as addresses and keeps them current.
Last updated .