SPF redirect= Modifier vs include: Mechanism: Precedence, Fallback, and Silent Ignore Traps

Learn the exact RFC 7208 §5.2 vs §6.1 execution difference between include: and redirect=, including why combining redirect= with ~all/-all silently disables redirect=.

RFC 7208 §5.2 ('include' Mechanism Match/No-Match Table)RFC 7208 §6.1 ('redirect' Modifier: Ignored When 'all' Exists!)

Incident Symptom & RFC 7208 Root Cause

SMTP & Deliverability Symptom

An engineer writes 'v=spf1 ip4:198.51.100.10 redirect=_spf.example.com -all' expecting corporate mail to fall through to _spf.example.com—and 100% of cloud mail bounces with SPF Fail because redirect= is completely ignored whenever 'all' is present! Conversely, replacing -all with include: without a terminal 'all' leaves unmatched IPs returning Neutral (?all)!

DNS Resolver & RFC 7208 Mechanics

include: is a positional mechanism evaluated left-to-right that ONLY triggers when the child record returns Pass (ignoring child ~all/-all Fail results and continuing to the next token in the parent!). redirect= is a whole-policy modifier evaluated ONLY at the very end if zero mechanisms matched—AND RFC 7208 §6.1 explicitly mandates that ANY 'all' mechanism anywhere in the record causes redirect= to be ignored!

Broken vs Verified DNS Configuration

BrokenTwo Opposite include: vs redirect= Precedence Bugs
; BUG 1: Presence of '-all' causes RFC 7208 §6.1 parsers to IGNORE redirect= completely!
; Only 198.51.100.10 passes; _spf.google.com is NEVER queried!
subsidiary-a.com. 3600 IN TXT "v=spf1 ip4:198.51.100.10 redirect=_spf.google.com -all"

; BUG 2: Using 'include:' with NO terminal '-all'/'~all' in parent!
; Child '-all' inside _spf.corp.com does NOT propagate Fail out of include: -> defaults to ?all Neutral!
subsidiary-b.com. 3600 IN TXT "v=spf1 include:_spf.corp.com"
Verified FixCorrect Composition (include: + -all) vs Pure Alias Delegation (redirect= Alone)
; Pattern 1 — Combining local IPs + external policy: use 'include:' PLUS terminal '-all'!
subsidiary-a.com. 3600 IN TXT "v=spf1 ip4:198.51.100.10 include:_spf.google.com -all"

; Pattern 2 — 100% identical shared policy across 20 brand domains: use 'redirect=' WITH NO 'all'!
; Final -all/~all qualifier inside _spf.corp.com becomes subsidiary-b.com's exact result!
subsidiary-b.com. 3600 IN TXT "v=spf1 redirect=_spf.corp.com"

Protocol Mechanics & Operational Deep Dive

Understanding how RFC 7208 §5.2 isolates child qualifiers inside include: unlocks every advanced SPF pattern. When example.com evaluates include:_spf.vendor.com, the verifier runs a sub-evaluation of _spf.vendor.com: if that sub-evaluation returns Pass, include: matches! Crucially, if that sub-evaluation hits '-all' (Fail) or '~all' (SoftFail) or '?all' (Neutral), include: does NOT abort the parent evaluation—it simply treats include: as 'not matched' and moves on to the next mechanism in example.com! That is why an aggressive '-all' inside one vendor's SPF record never blocks later includes in your parent record, AND why omitting your own terminal '-all' or '~all' leaves unmatched IPs falling off the end to implicit Neutral (?all)!

By contrast, redirect=_spf.corp.com (RFC 7208 §6.1) means 'replace the remainder of my SPF evaluation—including the final ~all or -all disposition!—with _spf.corp.com's policy.' That makes redirect= ideal for organizations managing 30 regional brand domains (example.de, example.fr, example.co.jp) that share the exact same central email infrastructure: updating _spf.corp.com from ~all to -all updates all 30 domains instantaneously in one DNS edit.

Keep two hard RFC 7208 §6.1 constraints in mind whenever using redirect=: (1) NEVER include any all mechanism (?all, ~all, -all, +all) in the same record as redirect=, or redirect= is silently skipped; (2) redirect= DOES count as +1 toward the 10-mechanism DNS lookup limit, and if the target domain of redirect= has no valid v=spf1 TXT record, the evaluation returns PermError (just like a broken include: target).

include: Mechanism vs redirect= Modifier Behavioral Matrix

Mechanism / CaseRFC 7208 EvaluationProduction Remediation
Child record ends with -all (Fail)include: treats child Fail as 'no match' and continues parent; redirect= returns Fail immediately!Always end records using include: with your own explicit ~all or -all.
Record contains both redirect= and -all-all wins unconditionally; redirect= is NEVER executed per RFC 7208 §6.1!Remove -all when delegating via redirect=, or replace redirect= with include: before -all.
Multiple occurrences in one SPF recordMultiple include: mechanisms allowed; >1 redirect= modifier in one record is an immediate PermError!Use include: whenever aggregating 2+ providers; use redirect= at most once.
%{d} macro domain context in targetBoth include: and redirect= update %{d} to the target domain (that is why redirect= exists instead of CNAME!).Never CNAME an apex domain; use 'v=spf1 redirect=_spf.corp.com' for multi-brand SPF sharing.

Edge Cases & Engineering FAQs

Wait: what happens if an include: child record returns PermError (for example >10 lookups or syntax error)?

Per RFC 7208 §5.2 Table 1, while child Fail/SoftFail/Neutral simply evaluate as 'no match', a child TempError propagates TempError AND a child PermError or None (missing SPF record!) immediately aborts the ENTIRE parent SPF check with PermError!

Can I prepend local ip4: addresses before redirect= (like 'v=spf1 ip4:198.51.100.5 redirect=_spf.corp.com')?

Yes! That is completely valid RFC 7208 §6.1 as long as there is NO 'all' mechanism in the record: 198.51.100.5 matches ip4: and returns Pass immediately, while any other IP reaches the end with no 'all' and executes redirect=_spf.corp.com.

Does negated '-include:bad-actor.com' work in SPF?

Syntactically yes! Putting a '-' qualifier in front of include: inverts a child Pass into an immediate parent Fail (-). In practice it is rarely needed unless carving an exception out of a broader CIDR later in the record.

Aligned Transactional Delivery Infrastructure

Transactional Email InfrastructurePostmark →

Dedicated transactional delivery streams with custom Return-Path subdomain SPF alignment and 2048-bit DKIM signing.