Why multiple senders create an SPF problem

SPF lets a domain publish which servers may send mail using that domain in the SMTP envelope, usually called the MAIL FROM or return-path domain. A business might use a mailbox provider, a newsletter platform, a help desk and a billing service. If all of them use the same envelope domain, its SPF policy may need to authorize all of them.

Each service may ask you to add an include mechanism to your SPF record. An include often points to another SPF policy, which may contain further includes. SPF evaluation allows at most ten DNS-querying mechanisms and modifiers along a check. If a check exceeds that limit, the result is a permanent error rather than a useful authorization decision. That can make otherwise legitimate messages harder for receivers to assess.

The limit applies to the evaluation path, not just the number of includes visible in your record. The include, a, mx, ptr and exists mechanisms, plus the redirect modifier, count when evaluated. The ip4, ip6 and all mechanisms do not require DNS lookups for this limit. Nested policies matter: one include can consume several lookups before the receiver returns to your record.

Audit the senders before editing DNS

Start with a list of services that actually send mail for your organization. For each one, identify the envelope domain it uses, the SPF instructions it provides, and whether it supports a custom return-path domain. Do not assume that a service belongs in the SPF record for your main domain merely because its messages display an address at that domain in the visible From field. The envelope domain may belong to the provider instead.

Check the existing SPF TXT record at each relevant domain name. Remove references to retired services only after confirming they no longer send legitimate mail. Keep one SPF record per domain name: publishing several separate SPF records does not divide the workload and can produce an SPF error. If you are unsure which systems still send mail, review your service settings and test representative messages before removing authorization.

Use an SPF inspection tool, or trace the referenced policies manually, to see how many lookups an expected sender's evaluation path uses. Check more than one sender because SPF may stop at a matching mechanism, while another message continues through more of the record. Leave room for providers to change their published policies; a record that sits exactly at the limit may become fragile.

Choose changes that reduce lookups safely

The simplest improvement is often to remove unnecessary includes and avoid authorizing the same service twice. If you operate a sending server with a stable, known IP address, an ip4 or ip6 mechanism can authorize it without consuming an SPF DNS lookup. Only list addresses you control or have reliably confirmed for that sender. Copying a cloud provider's current addresses into your record can become inaccurate when that provider changes its infrastructure.

Some tools offer to “flatten” includes by replacing them with IP addresses. This can reduce lookup use, but it transfers maintenance to you: the flattened record must stay synchronized with the sender's authorized addresses. Treat flattening as an ongoing process with checks, not a one-time fix. Similarly, redirect can make a policy easier to organize, but it is not a way around the lookup limit; a redirect and the policy it reaches still take part in evaluation.

Put an all mechanism, such as ~all or -all, at the end of a policy only after considering how you want unauthorized senders handled. Neither choice fixes excess lookups. Confirm that legitimate senders are covered before tightening a policy, and avoid adding broad authorizations just to make a test message pass.

Use separate sending domains when they fit

A dedicated subdomain can give a service its own, shorter SPF policy. For example, a newsletter platform might use a return-path domain under a mail subdomain, while ordinary employee mail uses the main domain. This works only if the service can use that subdomain as its envelope domain and the required DNS is configured. Creating a subdomain record alone does not move the service's SPF checks there.

Separate policies also make ownership clearer: changes for one sender are less likely to disturb another. Test mail from each service after making changes, checking the actual return-path domain and SPF result. SPF is only one part of email authentication; DKIM and DMARC may also matter, especially when you want authenticated mail to align with the visible From domain. The practical goal is not simply to get under ten lookups, but to keep each sending identity accurately authorized and maintainable.

Back to category ↗