[ SPF ]

SPF include: authorise a service without copying its entire infrastructure

Use include to evaluate a service policy while keeping control of your own final SPF result.

By the EmailAuth research team · 4 min read

[ Key points ]

  • Include tests the recursive result, not copied policy text.
  • Qualifiers and child errors determine the actual outer behavior.
  • Verify the supported target, envelope identity and recursive budget.
On this page

The include mechanism lets an SPF policy rely on another domain's authorisation decision. It is useful when a sending service maintains changing infrastructure. Instead of copying an address list into your record, you evaluate the provider's current policy when that include is reached.

This convenience is also a dependency. An include can change permissions as its target changes, consume the SPF lookup budget, or propagate a target error. Its behaviour is specified in RFC 7208 section 5.2.

Read include as a pass test

A normal include:service.example.net matches only if the recursively evaluated service policy returns pass for the connecting IP. The outer mechanism's default + qualifier then produces pass.

If the service returns fail, softfail or neutral, the include does not match and evaluation continues in the outer policy. If the service returns temperror or permerror, that error propagates. A target with no SPF record produces permerror for include, rather than being harmlessly ignored.

A qualifier can also precede include. For example, -include produces fail when the child returns pass. That is valid syntax but usually not the intended way to authorise a provider. Check the qualifier rather than assuming that the word include always grants access.

Worked example: preserve your own policy ending

Assuming valid syntax, one selected SPF record at each name and successful DNS retrieval, this synthetic fixture uses v=spf1 ip4:192.0.2.10 include:service.example.net -all at example.com. The service publishes v=spf1 ip4:198.51.100.9 -all.

A connection from 192.0.2.10 passes on the local mechanism. A connection from 198.51.100.9 reaches the include and passes because the child passes. A connection from 203.0.113.20 reaches the child, receives child fail, resumes the outer policy and receives fail from its final -all.

Change the outer ending to ~all and the last address receives softfail instead. The provider still decides whether include matches, but your policy determines the ordinary result when it does not. That distinction is why copying the child's whole text is not equivalent to using include.

Verify that the include belongs to your service

Obtain the exact target from current first-party product instructions. A vendor's marketing platform, transactional platform and employee mail service may have different sending paths. Do not select a plausible-looking hostname from a third-party article.

Also establish which domain the product uses in MAIL FROM. Publishing an include at example.com does not help an SPF check performed against a vendor-owned envelope domain. If you need a custom envelope, configure that capability through the product and verify it in received mail.

Maintain an owner, purpose and retirement condition for each include. A cancelled service should not retain permission indefinitely, but remove it only after checking scheduled jobs, infrequent campaigns and delegated teams.

Budget for recursive dependencies

Under RFC 7208 §4.1 and RFC 7208 §4.6.4, an include is one of the DNS-query-causing terms covered by SPF's ten-term evaluation limit. Its nested terms also count when evaluated. Several top-level includes can therefore exceed the limit even when the visible record looks short.

Use input-specific traces for legitimate sending IPs and for an unauthorised IP that traverses more of the policy. Record the target answers and evaluation time. A successful test today is not proof that a provider will never alter its dependency tree.

Replacing includes with copied IP ranges transfers maintenance responsibility to you. Do not describe that as a free simplification. You need a verified update process, IPv6 coverage and a plan for changes that occur while DNS answers are cached.

The practical takeaway

Include imports a pass decision and an operational dependency, not a promise about the visible author or message safety. Keep the target verified, the permission intentional and the recursive path within limits.

Keep the decision reproducible

Record child result and outer outcome in different columns: pass→match→outer qualifier; fail/softfail/neutral→nonmatch→continue; temperror/permerror→same error; none→permerror. For -include, child pass means outer fail. Preserve the exact target, qualifier, DNS observation and input IP with any support request. This is the RFC mapping, not live provider evidence.

[ Takeaway ]

Include tests the recursive result, not copied policy text. Qualifiers and child errors determine the actual outer behavior. Verify the supported target, envelope identity and recursive budget.

[ By role ]

What this means for you

Choose your role for practical next steps.

IT / Mail Admin

Trace child and parent outcomes.

Include has a specific mapping from recursive result to outer behaviour.

Next steps

  1. Verify the official target.
  2. Test nonmatching and error paths.
  3. Track recursive term headroom.

CISO / SecOps

Treat providers as permission dependencies.

Provider policy changes can change the authorised infrastructure without a local DNS edit.

Next steps

  1. Review provider identity controls.
  2. Monitor dependency changes.
  3. Retire permissions deliberately.

Founder / Non-technical

Give every service permission an owner.

An include should correspond to a real business sender, not an unexplained historical dependency.

Next steps

  1. Record the service purpose.
  2. Review renewal and retirement events.
  3. Check rare sending jobs before removal.

[ FAQs ]

Frequently asked questions

Does include copy the target record?

No. It recursively evaluates the target policy and tests whether that result is pass.

RFC 7208 §5.2

Does a child -all stop my outer policy?

Not by itself. A child fail makes the include not match, and the outer policy continues.

RFC 7208 §5.2

What if the include target has no SPF?

The include produces permerror.

RFC 7208 §5.2

What if the target has a temporary DNS error?

A temperror from its SPF evaluation propagates through the include.

RFC 7208 §5.2

Does each include use just one lookup?

The include consumes a counted term, and reached recursive dependencies also count. Trace the complete evaluation.

RFC 7208 §4.1 RFC 7208 §4.6.4

Can -include authorise a provider?

A matching -include gives fail rather than pass. Confirm that any explicit qualifier matches your intention.

RFC 7208 §5.2

Does include automatically configure my bounce domain?

No. Custom MAIL FROM configuration is a separate service setting and must be verified in received mail.

RFC 7208 §2.4

Should I remove an include when a contract ends?

First verify that no approved sending workflow still depends on it, then remove the obsolete permission through change control.

[ Sources ]

Sources

  1. RFC 7208

    Sections §2.4 · §4.1 · §4.6.4 · §5.2

[ Glossary ]

Glossary

SPF
Authorization evaluation for a connecting IP and the relevant SMTP identity.

RFC 7208 §2.4

SPF include
A recursive pass makes the include match; its qualifier then determines the outer result, while errors follow the specified mapping.

RFC 7208 §5.2

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