skip to content

When consolidating a company's SPF record, how do you decide which outside services get an include in the main domain's record, given what an include authorises?

level: principalimportance: should knowfreq 16%

answer

  1. live answer from their record
  2. shared pools pass for you
  3. whose envelope domain is used
  4. dedicated addresses you can list
  5. an owner and a removal date

basics

~20 s

An SPF include authorises whatever the service's record passes, live and under the service's control, shared pools included. Include a service in the main domain only if it sends with that domain in its envelope and its record is narrow.

solid answer

~40 s

An `include:` is a standing delegation: at every check the receiver evaluates the service's record, and whatever it passes, passes for your domain. That includes addresses shared with the service's other customers, and it changes whenever the service edits its record; if their record ended in `+all`, your include would match everyone. So for each candidate I ask: does it really send with our main domain in the envelope `MAIL FROM`, or with its own domain, in which case our record is not consulted for that mail; are its addresses dedicated and stable, so we can list them ourselves with `ip4`/`ip6`; is its record narrow, and what does it end in; and who owns the entry and removes it when the contract ends. Services that fail those questions move off the main domain.

go deeper

for a junior

Recall that an include matches whenever the named record returns pass, and that the named record belongs to someone else.

for a middle

Explain why shared sending pools and live evaluation make an include wider than the mail sent for you, and how the include's qualifier applies on a match.

for a senior

Audit an existing record: read every included record, find services that never use the main domain in their envelope, and remove stale terms with an owner's sign-off.

for a principal

Set the organisation's rule for who may send as the main domain, weigh simplicity against the trust each include delegates, and own the review cycle that keeps the record true.

## What an include actually hands over An `include:` in your record evaluates another domain's SPF policy, live, every time a receiver checks your domain, and matches when that policy returns `pass` (RFC 7208 section 5.2). Three properties follow, and they are the whole basis of the decision: - **The service controls the content.** Nothing is copied when you publish. If the service adds a new address range tomorrow, it passes for your domain tomorrow. - **Shared infrastructure passes too.** If the service sends for many customers from one pool, every host its record lists passes SPF for your domain, whoever's mail that host is carrying. - **Its result counts as pass or not-pass, errors apart.** A service record ending in `-all` cannot make your check fail; one ending in `+all` makes your include match every address on the Internet, which is the record-review finding from the other direction. A broken or deleted service record is the exception: it returns `permerror`, and so does your check for every client that reaches the include. Your own ending still decides for everyone not covered. But an include widens the set of hosts that pass for your domain to whatever another organisation says, for as long as the term stays in your record. ## Questions to ask of each candidate service 1. **Which domain does it put in the envelope `MAIL FROM`?** SPF checks the envelope domain (or the HELO name), not the From header. A service that sends with its own bounce domain is checked against its own record; including it in yours changes nothing for that mail. Whether that still satisfies DMARC is a separate question about alignment. 2. **Does it need the main domain at all?** Reply-to-customer traffic from a ticketing system may genuinely need to send as the brand's main domain; bulk CRM campaigns often do not. A dedicated envelope subdomain with its own record keeps the delegation away from the domain that staff and customers trust most. 3. **Are its sending addresses dedicated and stable?** If so, list them yourself with `ip4:`/`ip6:`. You then control exactly what passes, at the price of updating the record when the service renumbers. 4. **How narrow is its record, and what does it end in?** Read it before adding it. A record covering a whole cloud region, or ending in `+all` or `?all`, is a different risk from one listing a few dedicated ranges. 5. **Who owns the term?** Every include needs an owner, a reason and a trigger for removal: the end of the contract or the migration away from the service. A forgotten include keeps authorising the service's hosts long after the business relationship has ended. ## Patterns, and what each costs | Pattern | What passes for the main domain | Cost | |---|---|---| | `include:` the service's record | everything the service decides, live | least work; widest trust | | `ip4:`/`ip6:` of dedicated addresses | exactly what you list | you track their renumbering | | Service on its own envelope subdomain | nothing new on the main domain | DNS work per service; alignment to plan | | `?include:` the service's record | the service's hosts get `neutral`, not `pass` | rarely useful; RFC 7208 has receivers treat `neutral` like `none` | The `?include:` row is real but unusual. The include's qualifier applies on a match, so the service's hosts get `neutral` rather than `pass`. It records that the service is known without vouching for it, and most operators find a subdomain clearer. ## Applying it to one consolidation For a company bringing an outbound gateway, a CRM, a ticketing system and a floor of office printers into one record: - **Gateway**: its own fixed addresses, listed with `ip4:`/`ip6:`. - **Printers**: relay through the gateway, so no term at all; if some must send directly, list only the NAT address they use. - **Ticketing system**: answers customers as the main domain, so it earns a place, by `include:` if its addresses are shared, by `ip4:` if they are dedicated. - **CRM campaigns**: moved to an envelope subdomain with its own record, so the main domain's record does not vouch for a bulk-sending pool. - **Ending**: the record ends in `-all` or `~all`, never `+all`. Choosing between those two is the result-handling decision, and how many includes the record can hold is the lookup budget's question. ## Governance - Make the record a reviewed artefact: changes go through the mail or security owner, not whoever has access to the DNS panel. - Review every include at least when a contract changes, and read the included records, not just your own. - Record the reason for each term next to it in the change history, so removal is a decision rather than an archaeology project. There is no single right answer: a small team may accept a few well-run includes on the main domain for simplicity, while an organisation whose domain is a frequent impersonation target may allow none.

  • If a service's SPF record ends in -all, can including it make your own check fail for a host the service does not list?
    No. A `fail` from the included record only means the include does not match; your evaluation continues to your next term and your own `all`. RFC 7208 section 5.2 says a `-all` inside the referenced record does not terminate the overall processing, so the service can widen what passes for you but cannot turn your result into `fail`. An error in its record is different: a `temperror` or `permerror` from the include becomes your result.
  • When is listing a service's addresses with ip4 better than including its record?
    When the addresses are dedicated to you and change rarely. You then authorise exactly those hosts and nothing the service adds later. The price is maintenance: if the service renumbers without telling you, its mail falls to your record's ending until you update the list.

  • Including a service's record only authorises the mail it sends on our behalf.
  • Once published, an include is a fixed copy the service cannot change.
  • Every service that sends anything for us must be included in the main domain's record.
  • A service record ending in -all can make our own check fail.
  • Including a service that uses its own envelope domain makes its mail pass for us.