Where and when does SPF actually break?


If you’ve worked with SPF (Sender Policy Framework) for any length of time, you’ve probably run into the ten-lookup limit. The SPF specification allows no more than ten DNS lookups when evaluating a record. That effectively caps how many “include” mechanisms you can add, which caps how many sending services you can authorize in a single SPF record. Go past ten, and the spec says the receiving mailbox provider should fail the record, causing breakage and preventing successful delivery of affected messages.

In practice, though, some mailbox providers are a little more forgiving than that. I know from personal experience that Gmail will let mail through with eleven lookups. That makes sense: some mailbox providers might want to reduce their own pain, and nobody wants to block legitimate mail when a sender is just slightly over the line.

But they also don’t want to reward sending domains whose authentication settings are wildly out of spec. So there IS a hard limit somewhere. Which brings us to the question: where and when does SPF actually break?

Aliaksandr Markau, co-founder of deliverability tools vendor GlockApps, set out to answer exactly that. He tested increasingly long SPF records against Gmail, Google Workspace, Yahoo, AOL, AT&T, Microsoft, and Apple, and he tried two different setups: lots of includes side by side, and includes nested inside each other. Does the structure matter? How far does the tolerance stretch? And is every mailbox provider equally forgiving?

I won’t spoil the numbers. Go read his findings here. And thank you, Aliaksandr, for doing the testing so the rest of us don’t have to.

TL;DR? Just because some mailbox providers bend the rules a little doesn’t mean you should count on it. There’s a limit, and you can run into it.