[ SPF ]

Nested SPF includes: count dependencies before adding a service

Assess nested SPF dependencies using evaluated paths rather than counting only the includes visible in the customer record.

By the EmailAuth research team · 7 min read

[ Key points ]

  • The shared budget follows recursion, not just the top-level record.
  • Early matches and nonmatching branches change the evaluated path.
  • Supplier dependencies need current evidence and ownership review.
On this page

A short record can hide a long dependency path

A customer policy containing only a few includes can depend on many more DNS-causing terms beneath them. Include triggers recursive SPF evaluation; it does not grant a fresh independent allowance to every supplier. The relevant limit applies across the evaluation. Counting the customer’s visible include tokens therefore answers a different question from determining whether a specific sender path stays within the SPF budget.

This article proposes a dependency review before adding a sending service. It does not recommend copying provider records, flattening addresses without maintenance, or changing DNS based on a hypothetical diagram. First identify the actual sending route and the domain used for SPF. A vendor’s marketing brand may contain several products and account-specific configurations. Only the applicable supported instructions and current dependency evidence should enter the proposed policy. RFC 7208, section 4.6.4 and 5.2

Count terms, not packets or unique suppliers

RFC 7208 identifies include, a, mx, ptr, exists and redirect as terms that cause DNS queries during evaluation and imposes a limit of ten. Exceeding that limit must produce permerror. The all, ip4 and ip6 mechanisms and exp modifier are not subject to this particular limit. That does not make every other aspect of a policy unlimited: MX and PTR processing have additional rules, and void responses have separate guidance.

Keep the language precise when explaining cache behavior. A cached DNS answer can reduce network traffic, but it does not erase the evaluated mechanism from the logical budget. Counting unique domain names can also conceal repeated evaluation. Conversely, a static dependency map can include branches never reached for a given sender. A useful review distinguishes the complete discovered graph from each evaluated path through it. RFC 7208, section 4.6.4

Model the return from each include

A child pass makes the include match, with the include’s qualifier determining the parent result. Child fail, softfail and neutral mean that include does not match, so the parent can continue. Child temperror and permerror propagate as errors, and child none maps to permerror. Those mappings determine whether later customer-level services are reached and therefore whether their terms enter the observed path.

Do not assume that a supplier’s terminal -all fails the entire customer policy. It may simply end that child evaluation without a match and return control to the parent. Equally, do not assume a broken child is harmless because another supplier appears later. An error can terminate the path before that later supplier is considered. Show both the child result and the enclosing decision beside each dependency edge. RFC 7208, section 5.2

Build a route-specific dependency worksheet

Start with a route inventory: business owner, application, product, envelope domain, connecting-address family and supported configuration source. Then create a node for each evaluated policy and an ordered edge for each include or redirect. Preserve exact TXT boundaries and collection times. A diagram without the underlying policy text is not enough to explain why a particular edge exists or why its order matters.

For each representative sender, record the step number, current domain, mechanism, expanded target, cumulative term count, child result and next step. Identify branches excluded by an earlier match. Keep timeout and void information in separate columns. Distinguish an actually observed trace from a static possibility. Neither should be mislabeled as a complete enumeration of every receiver’s behavior.

Add a proposed-change column showing where the new service would enter. Evaluate the business reason for placement and any impact on existing paths. Reordering can change which terms are reached but is not a substitute for eliminating obsolete dependencies or obtaining a supported provider configuration. Preserve a rollback owner and evidence plan before seeking authorization to edit DNS.

Fictional diagnosis: a late transactional route

A fictional customer policy checks supplier A before supplier B. For a hypothetical transactional sender, A does not authorize the address. Assume A’s evaluated branch consumes four counted terms in addition to the customer’s include of A. Evaluation then reaches the customer’s include of B, bringing the running total to six. Assume B requires five further counted terms before it can establish a match. The proposed path would attempt an eleventh counted term and exceed the ten-term limit.

These numbers are an invented teaching example, not measurements of named suppliers. The important point is the shared running total. A dashboard that reports “two customer includes” would miss the problem, while a diagram that sums every possible branch might exaggerate the path for another sender that matches early inside A. Both views need labels and context.

A proposed repair is not automatically to move B first. That might help this route while moving A’s legitimate traffic onto a longer path. The defensible next step is to identify unused dependencies, obtain provider-confirmed alternatives where available, and compare the affected routes under the proposed design. No replacement record or successful reevaluation is claimed here.

Plan for change without promising permanent headroom

Supplier-managed records can change after a review. Record the snapshot time and ownership boundary rather than declaring that a dependency count is permanently safe. Where a documented change process exists, track the responsible supplier and the customer route owner. A monitoring proposal should define what changes matter, who reviews them and when a rollback decision is needed, without pretending monitoring is already deployed.

Avoid simplistic flattening advice. Replacing a maintained dependency with a copied list of addresses changes who is responsible for keeping authorization current. Stale addresses can break legitimate mail or preserve authorization longer than intended. Any alternative needs a supported maintenance design, actual route evidence and review of its security consequences. A smaller visible record is not automatically a safer policy.

Acceptance should cover at least the routes affected by the change and the meaningful nonmatching paths that reach later mechanisms. Document unsupported routes as unresolved. The aim is not to manufacture a green score; it is to show why the proposed policy authorizes the intended senders within the applicable evaluation constraints.

Evidence and release status

This manuscript contains no executed resolver queries, provider account changes or sent messages. Its dependency example is fictional. The required original evidence is an annotated path showing each counted term and the exact failing branch, and that remains open. No actual provider has confirmed a replacement configuration for this article.

Before operational publication, a qualified reviewer should verify the current source applicability, route inventory, transcript completeness and proposed change scope. Original evidence, human review, production routes, visual accessibility and owner release remain open alongside source applicability. Treat the worksheet as preparation for an authorized investigation, not proof that any real customer is over budget.

[ Takeaway ]

Before adding a service, review representative evaluated paths and preserve room for dependency changes.

[ By role ]

What this means for you

Choose your role for practical next steps.

Integration owner

Assess the complete route

A new service can change existing evaluation paths.

Next steps

  1. Identify the actual product and envelope domain.
  2. Obtain supported configuration values.

DNS reviewer

Count recursively

Visible include count is insufficient.

Next steps

  1. Retain ordered traces.
  2. Separate logical terms from DNS packets.

Operations lead

Own dependency changes

A snapshot cannot guarantee future headroom.

Next steps

  1. Assign supplier dependencies an owner.
  2. Prepare a reviewed rollback process.

[ FAQs ]

Frequently asked questions

Do nested includes receive separate ten-term allowances?

No. The limit applies across the SPF evaluation, including recursive processing.

RFC 7208: Sender Policy Framework

Are cached lookups free terms?

No. Network caching does not remove an evaluated DNS-causing term from the logical budget.

RFC 7208: Sender Policy Framework

Do ip4 and ip6 consume this budget?

They are not subject to the ten DNS-causing-term limit.

RFC 7208: Sender Policy Framework

Does every discovered branch execute?

No. Earlier matches or errors can stop evaluation.

RFC 7208: Sender Policy Framework

What does a child fail do?

It makes the include not match; the parent may continue.

RFC 7208: Sender Policy Framework

Is moving a supplier first always safe?

No. It changes other evaluated paths and requires route-specific review.

Were the fictional supplier counts measured?

No. They are explanatory assumptions, not provider observations.

What remains unverified?

The actual dependency trace, exact failing branch and any proposed provider-supported correction remain open.

[ Sources ]

Sources

  1. RFC 7208: Sender Policy Framework

    Sections §2.3 The HELO Identity · §2.4 The MAIL FROM Identity · §3.2 Multiple DNS Records · §3.3 Multiple Strings in a Single DNS Record · §4.5 Selecting Records · §4.6 Record Evaluation · §4.6.4 DNS Lookup Limits · §5.1 "all" · §5.2 "include" · §5.3 "a" · §5.7 "exists" · §6 Modifier Definitions · §6.1 redirect: Redirected Query · §8 Result Handling · §8.4 Fail · §8.7 Permerror · §10 Effects on Infrastructure

[ Glossary ]

Glossary

Dependency graph
The policies and references discovered for analysis, broader than one evaluated path.
Shared budget
The overall limit applied during recursive SPF evaluation.

RFC 7208: Sender Policy Framework

Child result
The recursive result mapped into include matching or error handling.

RFC 7208: Sender Policy Framework

Route inventory
The owned sending workflows selected for policy review.

Enterprise provenance

Why top financial institutions and governments retired their email security dashboards.

Traditional email authentication platforms sell you a dashboard and ask your engineers to do the labour. In high-stakes environments, manual oversight means delayed enforcement, configuration drift and unmonitored shadow domains.

EmailAuth is the agentic email provenance platform. Our agents enforce p=reject, keep third-party senders aligned and move your domains to full RFC 9989 compliance, the new DMARC standard,, with human-in-the-loop auditability.

Governments Large enterprises Tier-1 financial institutions

SaaS · Dedicated tenancy · Air-gapped on-prem · BYOK encryption

Knowledge Base