Skip to content

Systems

SPF's 10-lookup limit: why mail fails once your includes expand past ten

SPF counts include, a, mx, ptr, exists and redirect terms toward a limit of ten. Past it the record returns a permanent error, and a few vendors can get you there.

Computing America IT. Help desk support, backups and network infrastructure.

Send the domain
3 min readComputing America
A mail sorting rack with every slot full and one envelope on the floor beneath it.

In short

  • SPF permits ten terms that cause DNS queries. Past that, RFC 7208 requires a permanent error, so every sender in the record loses SPF, not only the one that overran it.
  • Each vendor you authorize costs at least one term, and more when its own record nests further includes. You count by resolving the record, not by reading it.
  • ip4 and ip6 terms cost nothing because they cause no query. Flattening fixes the count and creates a maintenance job: vendors change addresses and your record doesn't.
  • A website form that sends as your domain is one more sender, and one more term to fit under ten.
  • Passing SPF isn't passing DMARC: the visible From domain must align with the domain SPF or DKIM authenticated. RFC 9989 (May 2026) removed the pct tag, so don't plan a percentage ramp.

SPF lets a receiver evaluate at most ten terms that cause DNS queries, and past ten it returns a permanent error for your whole record. A few senders can get you there, because an include expands into whatever includes the vendor's own record contains.

The first sign is an invoice in a customer's junk folder, a payroll notice that went missing, or a form submission that vanished. Nothing on your side reports an error. Whichever sender you add last tips it over: a marketing platform, a billing system, the web host behind your contact form.

Which terms count, and a worked count

RFC 7208 section 4.6.4 (opens in a new tab) requires implementations to limit evaluation to ten terms that cause DNS queries and to return a permanent error past that. Six kinds count: the include, a, mx, ptr and exists mechanisms, and the redirect modifier. The ip4, ip6 and all mechanisms don't. Include is the one that matters, because it's what every vendor hands you when you authorize them, and it counts again for every include inside the record it points to.

Here is a count from public DNS on 2026-10-30. include:spf.protection.outlook.com (Microsoft 365) costs 1, because that record holds only addresses. include:servers.mcsv.net (Mailchimp) costs 1. include:sendgrid.net costs 2: SendGrid's record includes ab.sendgrid.net. include:mailgun.org costs 5, because its record nests further includes, drawn below. Together the four spend nine of the ten lookups.

Fig. 1
  1. include:mailgun.org

    1 lookup, 5 of the 10 with everything nested

    • To _spf.mailgun.org
    • To _spf.eu.mailgun.org
  2. _spf.mailgun.org

    +1

    • To _spf1.mailgun.org
    • To _spf2.mailgun.org
  3. _spf1.mailgun.org

    +1

  4. _spf2.mailgun.org

    +1

  5. _spf.eu.mailgun.org

    +1

Adding include:mailgun.org spends five of the ten lookups, because its record includes two records and one of those includes two more.

SourceTXT records read through Google Public DNS on 2026-10-30 and counted by the RFC 7208 section 4.6.4 rules. Vendors change their records, so recount your own.

Nothing in your own record shows the nested includes, so you resolve it to count them. Once the count passes ten, evaluation stops. Servers you had correctly authorized no longer pass SPF, and mail that passed for years now depends on DKIM (the signature a sender attaches) being intact.

Terminalshell
dig +short TXT example.comdig +short TXT mailgun.orgdig +short TXT _spf.mailgun.org
Replace example.com with your domain, then run the command again on every include: domain you find, until each record holds only addresses. On Windows, nslookup -type=TXT does the same.

One kind of term is free. An ip4 or ip6 term is an address, so it causes no lookup. Replacing a vendor's include with the addresses it resolves to today is called flattening. It fixes the count and creates a maintenance job, because the vendor changes those addresses without telling you. If you flatten, someone has to re-resolve the records on a schedule.

Your website form is one more sender

A contact form usually sends from an address at your domain, through your web host's mail server. If your record doesn't authorize that server, the receiver rejects the message or files it as spam, while the form still shows its thank-you page. The obvious fix, adding the host to your record, spends another term from a record that may already be at ten.

A pass on SPF is not a pass on DMARC

SPF authenticates the envelope address given during the SMTP conversation. A recipient doesn't see it. They see the From header, and the two differ whenever a vendor sends for you. RFC 9989 (opens in a new tab) requires the From domain to align with a domain that SPF or DKIM authenticated, so a message can pass SPF cleanly and still fail DMARC. The same RFC, published in May 2026, removed the pct tag, so advice that ramps a policy by percentage describes a tag the standard no longer defines.

The order to do this in

  1. 1.Resolve your SPF record with the commands above and add up what the includes expand to. Over ten, you've found the reason something stopped arriving.
  2. 2.Match each sender, including the host behind your website form, to a tool someone still uses. Removing a sender you no longer use frees every lookup it spent.
  3. 3.Submit your own contact form with a message you'll recognize, and look in the destination mailbox and its spam folder.
  4. 4.Confirm DKIM signing on every sender you kept. DKIM survives forwarding and keeps working when SPF has been thrown away.
  5. 5.Publish v=DMARC1; p=none; rua=mailto:dmarc@yourdomain, which asks receivers to take no action and to send aggregate reports to that mailbox. Without an rua tag, receivers send none. Read the reports for a few weeks to find the legitimate sender you forgot, so that enforcement doesn't delete your own invoices.
  6. 6.When every legitimate sender passes aligned SPF or DKIM, move to p=quarantine, then p=reject, and name who reads the reports afterwards.

For a quick outside view, the free domain security check (opens in a new tab) tells you whether anyone can send mail that looks like it came from your domain.

Sources

  1. 1.Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1 (opens in a new tab), IETF RFC 7208,
  2. 2.Domain-Based Message Authentication, Reporting, and Conformance (DMARC) (opens in a new tab), IETF RFC 9989,

Next step

Send us your domain name.

Just the domain, because all of this is published in public DNS and needs no access to anything of yours. We will tell you how much of the budget of ten your record currently spends, what it authorizes that you may not recognize, and what your DMARC record is actually asking receivers to do.

Reply
A person replies, not a sequence: within one business day, from someone who would be on the engagement.

Packages

Start with a package

Four packages, each with its price on the page. Pick one and buy it online.

Billing