SPF flattening: what RFC 7208 says, and what it doesn't
Flattening writes IP addresses into your SPF record instead of entries that look them up. IP addresses don't count toward the 10-lookup limit.
Who keeps the list current?
With include:, the service publishes its servers, and receivers read that list, give or take DNS caching. With a flattened copy you keep yourself, the list is the one you wrote down, and it can go stale both ways:
- When the service adds servers, mail from them fails SPF at your domain until you update your copy. If DKIM passes and aligns, DMARC can still pass for that mail.
- When the service drops addresses, your copy keeps them, and whoever uses them next can pass SPF for your domain.
The standard doesn't say how often to compare your copy with the service's record. Whether a service allows its addresses to be copied, and whether it announces changes, is up to each service.
On the Managed plan, MailGlo keeps the networks of a flattened record up to date for you (how flattening works in MailGlo). MailGlo can't tell whether addresses you copied into your own record are still current.
What does the standard allow?
The flattened record itself: ip4 and ip6 need no lookup (which terms count).
The word "flattening" doesn't appear in RFC 7208. Neither does splitting a long list across your own subdomains. If you do that, each include still counts as a lookup.
What changes when you copy an include?
The results for matching addresses stay the same if you copy carefully: copy only the addresses that pass in the other record (how include works). Keep the entry's qualifier and position too. In -include:, a pass makes your record fail, and plain ip4: entries in its place would let those servers pass.
Errors don't carry over. If the other record disappears, the original include stops the check with "permerror". A sender that matches a copied address still gets that entry's result. Other senders go on to the next entry.
Some entries can't be copied without changing who passes:
exists, because the name can start or stop existing without your record changing.- Any entry whose target changes with the sender or the message, through a macro such as
%{i}or%{l}. ptr, because it reads the PTR records of the sending server's IP address. The standard advises against publishing it at all (recommendations).
A copied list of several services' networks also grows fast. The same recommendations cover record size.
What does section 10.1.1 add?
Advice, not a rule. For a domain's own two mail servers, section 10.1.1 calls a record that lists their addresses the "Best record" and an mx entry the "Expensive record". That example is about your own servers, whose addresses you know. It says nothing about copying a sending service's addresses.
Sources
- RFC 7208, section 10.1.1, the "Best record" and "Expensive record" examples.
Next: Should my SPF record use include or redirect? · All articles
Check your domain
See your SPF, DMARC and DKIM records and what to fix. Free, no account. Don't see your signing key? On the results page, enter the name your email service gives you under Signing keys.
Last updated : New article: what RFC 7208 says about flattening, and who keeps a flattened list current.
Found an error, or a question this page does not answer? Email support@mailglo.com.
For AI agents: this page in Markdown, llms.txt, the index of guides and public pages