Facebook tracking pixel

MailGenius

SPF Multiple Include Without Hitting the Limit

“Just keep your SPF record under ten includes” is bad advice. You can follow it, publish a record that looks tidy, and still get an authentication error when a mailbox provider checks your mail.

The mistake is counting what you can see instead of what the receiver evaluates. An SPF multiple include setup shares its lookup budget with the policies inside those includes. The practical job is to trace that dependency chain, leave room for changes, and resist shortcuts that turn today's DNS fix into tomorrow's delivery problem.

What an SPF Multiple Include Actually Costs

The limit is 10 DNS-querying terms in an SPF evaluation. Encountering the 11th requires a permerror result, according to the IETF's RFC 7208. That's a permanent evaluation error, not a softfail and not an SPF pass.

People usually call this the DNS lookup limit. More precisely, it's a limit on evaluated DNS-dependent mechanisms and modifiers, not a simple count of every DNS packet a resolver sends. That distinction matters when you inspect mechanisms such as mx, which can require additional address resolution.

An include lets your domain authorize sending infrastructure through another domain's SPF policy. It doesn't paste that company's current policy into your TXT record, and it doesn't give the company an independent budget inside yours.

Which SPF terms spend the lookup budget

Mechanism Counts toward 10 What to remember
include Yes At least 1 counted term, plus counted terms evaluated inside the included policy
a Yes Looks up addresses for the named host
mx Yes Looks up MX hosts and then their addresses
ptr Yes Uses reverse lookups; don't add it to a new record
exists Yes Uses a DNS query as a true-or-false test
redirect Yes Evaluates another policy if no mechanism matches; the target's counted terms also apply
ip4 No Literal IPv4 address or CIDR range; free against this limit
ip6 No Literal IPv6 address or CIDR range; free against this limit
all No Catch-all mechanism, usually placed last; it doesn't query DNS

Technically, all is a mechanism. The symbol before it, such as the tilde in ~all, is its qualifier. Marketers don't need to memorize the terminology, but separating the two helps when someone suggests changing a qualifier to fix a lookup problem. It won't.

Consider this illustrative record:

v=spf1 include:_spf.google.com include:sendgrid.net include:servers.mcsv.net include:mail.zendesk.com ~all

You can identify the direct lookup-generating terms immediately. What you can't determine from that line alone is the expanded evaluation cost. These providers' policies can change, so this isn't a statement about their current combined lookup count.

Score the chain, not its appearance

Each include opens another policy for evaluation. If that policy contains more includes, an a mechanism, or another DNS-dependent term, those evaluated terms share the parent's budget.

A short record isn't necessarily a cheap record. Nor does a low visible include count establish that every sending path will pass.

Practical rule: Treat spare lookup capacity as an operating requirement, not wasted space.

For planning, I recommend keeping a cushion below the ceiling rather than designing a record that only just fits. That's an editorial operating target, not an additional SPF standard. Your provider can change its nested policy without changing a character in your DNS, so a record with no headroom is fragile before you add another tool.

Count the Full Lookup Path Before Editing

Start with the domain the receiver checks: the SMTP envelope sender domain, commonly exposed through the Return-Path after delivery. Don't assume it's identical to the address your subscriber sees in the From field.

Retrieve that name's SPF TXT policy and preserve a copy before editing. You need a baseline that shows both the published text and the dependency chain behind it.

Build a recursive inventory

Use this sequence to make the count reproducible:

  1. Identify the parent terms. List every include, a, mx, ptr, exists, and redirect in the policy.
  2. Expand referenced policies. Open each included policy and follow its nested references, keeping one shared running counter.
  3. Separate literal authorization. Record ip4, ip6, and all without adding them to the DNS-dependent term count.
  4. Evaluate actual sending paths. Test representative sending IPs rather than assuming every message follows the same route through the policy.
  5. Save the evidence. Keep the expanded tree, observed results, and change date beside the DNS change request.

Google's SPF troubleshooting guidance explains why nested lookups need attention: counting visible includes alone doesn't establish compliance. A recursive inspection is the useful check, not merely a syntax verdict.

SPF evaluation can stop when a mechanism matches. An inventory of every branch is therefore a conservative planning tool, while path testing establishes what a receiver encounters for a particular sender.

Worked lookup count for one parent record

Say a hypothetical parent policy contains the terms below. Assume the nested policies contain only literal address mechanisms beyond the nested includes shown, and the evaluated path reaches every listed lookup-generating term.

Lookup Found in Counts
include:vendor-a.example Parent TXT 1
include:nested-a1.example, include:nested-a2.example, include:nested-a3.example Vendor A TXT 3
include:vendor-b.example Parent TXT 1
include:nested-b1.example Vendor B TXT 1
a Parent TXT 1
ip4:203.0.113.0/24 Parent TXT 0
Total Whole hypothetical evaluation path 7 of 10

The arithmetic is straightforward once the hidden terms are visible. The Vendor A branch costs four counted terms, Vendor B costs two, and the parent's address lookup adds another.

For this hypothetical record, an internal working target of eight would leave room for one additional counted term before reaching that target. Adding a new provider with its own nested include would add two, not one, so the proposed change needs another decision.

When you check SPF and DKIM records, keep the findings with your sender inventory. A count without the underlying branches becomes obsolete too easily.

Keep Includes Flatten or Split by Subdomain

Visible include strings can make an SPF record look simple while hiding a long evaluation path. Choose the structure based on the full path and who will maintain it, not just the number of includes on the parent record.

This comparison shows the structural choices. A flat organizational layout does not necessarily mean an IP-flattened SPF policy.

A diagram comparing single SPF records to split subdomain records and ineffective mixed pattern configurations for email.

Choose a primary pattern

Approach Lookup cost Upkeep Choose it when
One include per sender Direct include plus evaluated nested terms Low while vendor policies stay stable The expanded path has comfortable headroom
Flatten to ip4 and ip6 Literal addresses do not use this lookup budget You must track every IP change A vendor publishes stable ranges and someone owns maintenance
Subdomain per sender Independent policy budget on that name Additional sending-domain and DNS configuration A platform nests deeply or your stack keeps growing
redirect Redirect plus evaluated target-policy terms Requires careful inheritance design The name should use another policy when its own mechanisms do not match

Keep includes as the default when the expanded path fits comfortably. The provider maintains its authorization list, while your team maintains the relationship between that provider and your domain.

Flattening shifts that work to you. You replace a provider reference with literal addresses, then must keep those addresses current as the provider changes them. A copied snapshot is not a maintenance process.

Flattening does not remove complexity. It makes your team responsible for tracking provider changes.

Subdomain isolation can suit a growing stack. Marketing, billing, and support can use separate sending names, but each provider must use the intended envelope domain. Publishing a policy on a new subdomain alone does not move traffic there.

Don't confuse delegation with another include

redirect is not a shortcut for adding a sender. It supplies another policy when the current policy's mechanisms do not match. Its position in the text does not make it an immediate stop instruction.

An all mechanism always matches, so it prevents redirect from being used. Combining both without understanding that behavior can leave the target policy unused.

SPF lookup problems also arise in managed-service-provider configurations. That is another reason to examine the nested evaluation path rather than count only the visible includes.

Use the walkthrough below alongside your sender inventory when reviewing the structure.

Before approving flattening, name the owner, identify the provider's authoritative address list, and define how updates reach DNS. Without those steps, flattening is a maintenance debt, not a lasting fix.

How to Publish One Record for Every Sender

A mathematically efficient record can still omit the platform that sends your receipts. Authorization coverage comes before tidiness.

Google's email sender guidelines say your SPF record should include all email senders for the domain and recommend DMARC. That means building from an inventory, not from whichever vendor's setup wizard you opened most recently.

Use this workflow to connect the sending inventory to the policy you publish.

A four-step infographic explaining how to publish a single SPF record for every email sender.

Prepare the sender list

  1. Inventory every system. Include workspace mail, marketing, CRM, support, billing, and outbound sales. Record each system's envelope domain, visible From domain, responsible teammate, and whether it still sends.
  2. Copy current vendor instructions. Get include hosts from current documentation, not an old screenshot or a record copied from another business. Account-specific return-path configuration may matter more than a generic include.
  3. Select the hostname and existing policy. Edit the SPF policy on the name receivers evaluate. Don't create a competing SPF record because a new vendor asks you to “add a TXT record.”

Other TXT records can coexist with SPF. The problem is multiple separate policies beginning with v=spf1 on the same name, not the presence of unrelated verification records.

Publish the chosen branch

  1. If you kept includes, consolidate them. An illustrative structure is v=spf1 include:_spf.google.com include:sendgrid.net include:mailgun.org ~all. This demonstrates syntax, not a prevalidated recommendation for your account or current provider dependencies.

For account-specific setup, use SendGrid SPF TXT values explained alongside SendGrid's current configuration instructions.

  1. If you flattened a vendor, retain only documented ranges. An illustrative mixed structure is v=spf1 include:_spf.google.com ip4:203.0.113.0/24 ~all. The address range shown is for documentation, not a real provider authorization list, and must not be published as production configuration.
  2. If you split by subdomain, configure the sender too. A separate policy such as v=spf1 include:sendgrid.net ~all on news.example.com only helps traffic evaluated against that name. Configure the platform's custom envelope sender and review its visible From identity.
  3. Verify after cached DNS data expires. Query the published name, confirm that a single SPF policy appears, and compare the retrieved value with your approved change. Then send through the platform rather than stopping at a DNS screenshot.

A visible From address doesn't choose the SPF policy. The envelope sender does.

For DMARC to pass through SPF, the authenticated envelope domain must align with the visible From domain under your alignment settings. DMARC can also pass through aligned DKIM, so an SPF problem doesn't automatically mean DMARC fails.

Don't change the ending qualifier merely to make a test look better. ~all describes how unmatched senders should be treated; it doesn't authorize a missing platform or repair a broken dependency chain.

Permerror After a Record That Looked Fine

A lookup-related permerror means you need to inspect the evaluated chain, not shorten the record at random. A parent TXT record can have clean syntax while its dependencies make evaluation impossible.

Microsoft's email authentication guidance provides the useful mental model: a direct include whose policy contains three additional includes contributes four lookups when that branch is fully evaluated. The visible parent token is only the entrance.

Match the symptom before changing DNS

Symptom What actually happened What to change
permerror and the evaluated path exceeds the budget Nested terms exhausted the shared allowance Remove an obsolete sender, isolate traffic, or substitute documented literals
permerror with competing SPF TXT policies The receiver can't treat separate SPF records as one policy Consolidate required authorization, then remove the extra SPF policy
A parent-only checker accepts the record but a mailbox provider returns permerror The check may have missed dependencies, or observed different DNS data Expand referenced policies and compare the DNS answers
Softfail from a particular platform Its sending IP didn't match the policy evaluated for its envelope domain Verify that domain and authorize the correct infrastructure there
Previously working flattened traffic now softfails The provider may have changed addresses, leaving your snapshot stale Compare current documented ranges, then update or restore the include
Redirect behavior doesn't match expectations A matching mechanism, especially all, prevented delegation Use redirect only where fallback policy delegation is intended

The table is a diagnostic list, not permission to assume the first plausible cause is proven. Collect the receiving provider's Authentication-Results, the sending IP, the envelope domain, and the DNS policy observed during the failure.

Don't republish from scratch. A broad rewrite can remove working authorization while leaving the problem untouched.

Separate evaluation errors from authorization misses

For a permerror, inspect the expanded policy and check for competing SPF records. If the failure appears only at a particular recipient provider, compare the DNS answers that provider could have cached with the answers your checker sees now.

A checker's green status might mean only that the parent text parses correctly. It can also reflect a different sending path. Ask what the tool evaluated before treating its result as a contradiction.

For a softfail, start with the message, not the DNS editor. Find the actual envelope domain and source IP, then check whether that source matches its evaluated policy. Adding another include to your organizational root won't help if the platform uses a different envelope domain.

Troubleshooting discipline: Change the smallest proven cause, then resend through the same failing path.

Flattened records deserve particular attention because a previously valid address list can become outdated without a local DNS edit. Still, don't declare every new softfail a stale-IP problem. A changed return-path configuration, different regional infrastructure, or failover sender can produce a similar symptom.

Redirect deserves the same precision. Mechanisms written after a redirect modifier aren't automatically ignored merely because they appear later in the text. Mechanisms are evaluated before fallback delegation, so inspect matching behavior rather than treating redirect as a left-to-right termination command.

Keep the original failing message and the successful retest together. That gives the next teammate evidence of what changed instead of a vague note saying SPF was fixed.

Monitor Headroom and Confirm With a Spam Test

Publishing the record isn't the finish. Your vendors maintain their own policies, and their changes can alter your evaluation path without a DNS change from your team.

The RFC 7208 specification with inline errata permits up to 10 counted DNS-dependent terms, while the 11th requires permerror. My operating recommendation is to reserve headroom instead of treating the permitted maximum as a design target.

Give the policy an owner

Assign responsibility for the sender inventory and the expanded policy review. If you flatten provider addresses, assign responsibility for that address list explicitly too. “The marketing team handles it” isn't specific enough when a provider changes infrastructure.

Use operational events to trigger a review:

  • Adding a platform. Inspect its account-specific sending configuration before inserting an include.
  • Changing infrastructure. Recheck when a provider announces new sending systems, regions, or failover arrangements.
  • Canceling a service. Confirm it no longer sends, then remove its obsolete authorization.
  • Updating flattened ranges. Compare against the authoritative vendor list and retain a record of the change.

Removing an unused include is usually the cleanest capacity improvement because it also removes authorization you no longer need. Don't keep a canceled platform authorized merely because deleting it feels risky.

If a vendor's address list stops being stable, reconsider flattening. A policy that requires updates your team can't reliably deliver is the wrong policy, even if its lookup count looks excellent.

Test the message, not just the record

Send ordinary messages through each authorized route, including workspace mail, marketing, transactional systems, and isolated subdomains. Exercise failover infrastructure where you can. A test from your personal mailbox doesn't validate a receipt sent by your commerce platform.

At the homepage, run an email spam test and read the authentication findings before focusing on the overall score. We check whether SPF follows best practices and is set up correctly. Our Authentication Checker also scans SPF, DKIM, DMARC, and BIMI together and guides you through fixes; each test report includes authentication feedback, spam trigger flags, inbox-placement tips, and a final score.

A passing SPF result isn't an inbox guarantee. Content, reputation, and blacklist status can still affect delivery, which is why a real-message test belongs after DNS validation.

If you see permerror, correct the evaluation problem before calling the deployment complete. If SPF passes, inspect alignment and the rest of the authentication results rather than assuming the job is done.

Once representative paths work and monitoring has a named owner, leave the policy alone until a meaningful change requires attention. Reliable SPF is maintained deliberately, not rewritten every time a campaign underperforms.


MailGenius helps you check authentication and identify message-level issues that a DNS-only review can miss. Visit MailGenius, send a test from the platform you've just configured, and use the report to confirm your SPF multiple include setup works for the mail you send.

Free Email Spam Test:

Will your Email Land in the Spam Folder?

Send an email to the address below to see your Spam Score:
loading...
MailGenius users test over 1M emails per year! By using our Email Tester, you will agree to our Privacy Policy and Terms of Service. The sending email address will receive emails from MailGenius. All tests are hosted on public links.

Try MailGenius Today

Run a Free Email Deliverability Test - Send an Email to the Address Below, then Click “See Your Score”:

Free Email Spam Test:

Will your Email Land in the Spam Folder?

Send an email to the address below to see your Spam Score:
loading...
MailGenius users test over 1M emails per year! By using our Email Tester, you will agree to our Privacy Policy and Terms of Service. The sending email address will receive emails from MailGenius. All tests are hosted on public links.

Try MailGenius Today