# SPF ~all (SoftFail) vs -all (HardFail) Under DMARC Enforcement: RFC Truth & Forwarding

> Compare SPF ~all SoftFail, -all Fail, and ?all Neutral under RFC 7208 and RFC 7489 DMARC, including why forwarded DKIM-signed mail interacts differently with -all.

- **Canonical URL**: https://opslint.dev/spf/softfail-tilde-all-vs-hardfail-minus-all-dmarc/
- **Category**: `SPF`
- **Interactive Workbench**: [Open in Live Workbench](https://opslint.dev/spf/#domain=paypal.com)
- **Normative Specifications**: `RFC 7208 §8.4 (Fail '-all') & §8.5 (SoftFail '~all')`, `RFC 7489 §4.1 & §6.6.2 (DMARC Evaluation of SPF Fail & SoftFail)`, `M3AAWG Best Practices for SPF & DMARC Enforcement`

## Incident Symptom & Root Cause

**Production Symptom**: After switching a domain's SPF record from ~all to -all, legitimate customer emails forwarded through university/alumni auto-forwarders or corporate Exchange rules get rejected at the SMTP envelope stage BEFORE the receiving MTA even verifies a valid DKIM signature!

**Protocol / Engine Root Cause**: Under pure DMARC (RFC 7489), BOTH ~all (SoftFail) and -all (Fail) produce the exact same DMARC SPF result ('fail'), allowing a surviving aligned DKIM signature to pass DMARC! However, RFC 7208 §8.4 explicitly permits pre-DATA SMTP receivers to issue an immediate 550 5.7.23 rejection on -all during MAIL FROM/RCPT TO—before the message body and DKIM-Signature header are even transmitted!

## Remediation Diff (Broken vs Verified Fix)

### Never-Ending ?all Neutral (Zero Spoofing Protection) vs Blind -all Without DKIM

```text
; DANGEROUS: '?all' (Neutral) or '+all' (Pass-Everyone!) grants spoofers free rein!
; '+all' gets domains blocklisted immediately!
example.com. 3600 IN TXT "v=spf1 include:_spf.google.com ?all"
```

### Two Verified Production Configurations (~all + DMARC Reject vs -all Parked/Strict)

```text
; Strategy A (M3AAWG Recommended for Human Mailboxes with Forwarding + DKIM + DMARC p=reject):
; '~all' fails DMARC SPF identically to '-all', while letting SMTP servers read DATA + verify DKIM!
example.com.        3600 IN TXT "v=spf1 include:_spf.google.com ~all"
_dmarc.example.com. 3600 IN TXT "v=DMARC1; p=reject; sp=reject; rua=mailto:dmarc@example.com"

; Strategy B (Strict '-all' for Non-Sending / Parked Domains or Transactional Subdomains):
; Zero forwarding ambiguity; reject unauthorized IPs at the earliest possible SMTP gate!
parked-brand.com.   3600 IN TXT "v=spf1 -all"
notify.example.com. 3600 IN TXT "v=spf1 include:spf.mtasv.net -all"
```

## Engineering Deep Dive

For years, generic security checklists mechanically docked a grade point if an active domain used ~all instead of -all, without understanding the multi-layer interaction between SMTP stages, SPF, DKIM, and DMARC. During an SMTP transaction, MAIL FROM:<alice@example.com> arrives BEFORE the DATA phase (which carries headers and DKIM-Signature). If Bob forwards mail from bob@alumni.edu to bob@corp.com without SRS (Sender Rewriting Scheme), alumni.edu's relay IP is NOT in example.com's SPF record.

With -all, an aggressive receiver running an early SMTP milter rejects the forwarded email right after RCPT TO with 550 SPF Fail—never reading DATA, never verifying Alice's intact 2048-bit DKIM signature, and bouncing legitimate mail! With ~all paired with DMARC p=reject (or p=quarantine), the receiver accepts DATA, sees SPF=SoftFail (which DMARC treats as SPF fail!) AND DKIM=Pass (aligned!), so legitimate forwarded mail passes DMARC while spoofed unsigned mail hits DMARC p=reject!

Where SHOULD you enforce -all unconditionally? On three high-certainty surfaces: (1) every parked domain, defensive typo domain, and non-mail subdomain (v=spf1 -all); (2) domains that do NOT yet enforce DMARC p=quarantine/reject (where ~all alone leaves spoofed mail in the inbox or spam without hard rejection); and (3) high-security transactional subdomains where every message is DKIM-signed and compliance policy favors hard envelope rejection.

## SPF 'all' Qualifiers Behavior Across SMTP & DMARC

| Case / Engine | Protocol Behavior | Production Remediation |
| :--- | :--- | :--- |
| **+all (or bare 'all' without prefix!)** (`#qualifier-plus-all`) | Authorizes EVERY IPv4 and IPv6 address on the internet to send as your domain (SPF Pass)! | NEVER publish +all or bare all (bare 'all' defaults to '+all'!). Replace immediately with ~all or -all. |
| **?all (Neutral)** (`#qualifier-question-all`) | Asserts nothing (equivalent to having no policy); fails DMARC SPF alignment. | Upgrade ?all to ~all during initial discovery, then enforce DMARC. |
| **~all (SoftFail)** (`#qualifier-tilde-all`) | Fails DMARC SPF evaluation; avoids premature pre-DATA SMTP rejection so DKIM can rescue forwarded mail. | Ideal on active corporate domains ONCE paired with 100% DKIM signing and DMARC p=quarantine/reject. |
| **-all (Fail / HardFail)** (`#qualifier-minus-all`) | Fails DMARC SPF evaluation AND signals receivers they may 550-reject at SMTP envelope before DKIM. | Mandatory on all parked/non-sending domains (v=spf1 -all) and strict automated subdomains. |

## Frequently Asked Engineering Questions

### Wait: what does writing bare 'all' with NO prefix ('v=spf1 include:_spf.google.com all') do?

CRITICAL SECURITY BUG! Per RFC 7208 §4.6.2, omitting a qualifier prefix defaults to '+' (Pass)! Writing bare 'all' at the end of an SPF record means '+all', authorizing every botnet IP on Earth to pass SPF and pass DMARC for your domain!

### Does Microsoft Defender for Office 365 treat -all and ~all identically?

Both fail DMARC SPF checks, though Microsoft's anti-spoofing composite authentication heuristics historically weighted -all slightly stricter when a sender lacked DMARC enforcement (p=none). Once DMARC p=reject or p=quarantine is active with DKIM, DMARC policy governs disposition.

### Why does Gmail still pass forwarded -all mail while some enterprise gateways block it?

Gmail purposefully defers SPF action until after DATA so it can evaluate DKIM, ARC, and DMARC holistically; older Postfix policyd-spf or Exim ACLs configured with reject_fail_spf=true reject -all before DATA.

## Related Problem-Cluster Guides

- [DMARC Identifier Alignment Explained: SPF Pass + DKIM Pass Can Still Fail DMARC!](https://opslint.dev/dmarc/identifier-alignment-spf-dkim-relaxed-vs-strict/) — Why emails with spf=pass and dkim=pass still bounce with dmarc=fail when Return-Path or DKIM d= domains don't align with From:, plus aspf=r/s and adkim=r/s rules.
- [Why Email Forwarding & Mailing Lists Break SPF/DKIM under DMARC p=reject (SRS, DKIM & ARC)](https://opslint.dev/dmarc/mailing-lists-forwarding-arc-spf-breakage/) — Understand how auto-forwarding breaks SPF and how mailing lists break DKIM signatures under DMARC p=reject, plus SRS, relaxed DKIM canonicalization, and RFC 8617 ARC.
- [DMARC Rollout Playbook: p=none -> quarantine -> reject and How pct= Actually Works](https://opslint.dev/dmarc/gradual-rollout-p-none-quarantine-reject-pct-tag/) — Execute a zero-outage DMARC enforcement rollout from p=none to p=reject, and avoid the dangerous myth that pct=10 on p=reject drops unthrottled messages to None.
- [Protect Parked Domains & Non-Mail Hosts with Null SPF (v=spf1 -all), Null MX, and DMARC Reject](https://opslint.dev/spf/null-spf-v-spf1-minus-all-parked-domains/) — Lock down parked domains, API/CDN subdomains, and defensive lookalike domains in 4 DNS lines using RFC 7208 v=spf1 -all, RFC 7505 Null MX, and DMARC p=reject.
