SPF Qualifiers and the 'all' Mechanism: Defining Your Domain's Policy
Every SPF record ends with an all mechanism—the default policy that applies to any sending server not matched by earlier mechanisms. But the all mechanism alone isn't enough. It must be prefixed with a qualifier that tells receiving servers what to do with unauthorized senders.
The choice between Soft Fail (~all) and Hard Fail (-all) is one of the most important decisions in SPF configuration. Get it wrong, and you could either leave your domain vulnerable to spoofing or accidentally block legitimate emails.
The Four Qualifier Options
+all(Pass): EVERY server is authorized. NEVER use this—it completely disables SPF protection. Any server can send email as your domain, and receiving servers will trust it.?all(Neutral): No statement about authorization. Receiving servers treat the result as "none" (no SPF). Not helpful. Avoid.~all(SoftFail): Unauthorized servers likely shouldn't be sending. Receiving servers accept the email but mark it as suspicious (increasing spam score).-all(Fail/HardFail): Unauthorized servers absolutely should not be sending. Receiving servers should reject the email entirely (bounce) or send to spam with high confidence.
In practice, ~all and -all are the only qualifiers you should consider using. The debate between them is central to SPF configuration.
Soft Fail (~all) Explained: The Lenient, Forgiving Approach
The Soft Fail qualifier (pronounced "tilde all") tells receiving servers: "The sending server likely isn't authorized, but I'm not 100% sure. Please accept the email but mark it as suspicious."
How Receiving Servers Handle Soft Fail
When an email fails SPF with ~all, receiving servers typically:
- Accept the email (no rejection/bounce)
- Increase the spam score (often by 2-5 points)
- Add an "Authentication-Results" header showing
spf=softfail - May send the email to the spam folder depending on other signals (DKIM, content, reputation)
Importantly, Soft Fail does NOT guarantee spam folder placement. If the email has strong DKIM authentication, good content, and a positive sender reputation, it can still reach the inbox despite SPF Soft Fail.
When to Use Soft Fail (~all)
Soft Fail is appropriate in these scenarios:
- During SPF setup and testing: When you're still identifying all your legitimate sending sources, Soft Fail prevents accidental rejection of authorized emails.
- When you're unsure about some sending sources: If you suspect there may be legitimate senders you haven't yet added to SPF, Soft Fail provides a safety net.
- When email forwarding is common for your domain: Forwarded emails often fail SPF because the forwarder's IP isn't authorized. Soft Fail allows these emails to still be delivered (though they may go to spam).
- When you don't have DKIM implemented: Without DKIM as a backup, rejecting email that fails SPF could block legitimate messages.
Real-World Soft Fail Example
Your domain's SPF includes Google Workspace and SendGrid. An email arrives from a server at 203.0.113.50 (not authorized). The recipient's server sees ~all and:
- Adds 3 points to the spam score
- Accepts the email
- If the email passes DKIM, has reasonable content, and comes from a known sender, it might still reach the inbox despite the SPF Soft Fail.
Hard Fail (-all) Explained: The Strict, Protective Approach
The Hard Fail qualifier (pronounced "hyphen all") tells receiving servers: "Any server not explicitly authorized should NOT be sending email for my domain. Reject these messages."
How Receiving Servers Handle Hard Fail
When an email fails SPF with -all, receiving servers typically:
- Reject the email during the SMTP conversation (bounce message sent to sender)
- OR accept the email but send directly to spam (provider-dependent)
- Add an "Authentication-Results" header showing
spf=fail - Apply the highest spam score (often 5-10 points)
The exact handling varies by email provider. Gmail, for example, typically sends Hard Fail emails to spam rather than rejecting them outright. Many corporate email systems (Microsoft Exchange with strict policies) may reject Hard Fail emails completely.
When to Use Hard Fail (-all)
Hard Fail is appropriate when:
- You have a complete, accurate SPF record: Every legitimate sender is authorized, and no authorized senders are missing.
- You have DKIM implemented: DKIM provides a backup authentication method for forwarded emails that would fail SPF.
- You have DMARC configured: DMARC gives you visibility into SPF failures and allows you to adjust policy gradually.
- Email spoofing is a significant risk: For domains that are frequently targeted by phishers (banks, financial services, government), Hard Fail provides maximum protection.
- Your recipients are consumers (not corporate): Consumer email providers like Gmail and Yahoo handle Hard Fail reasonably well (spam folder instead of rejection).
Real-World Hard Fail Example
Your domain's SPF includes Google Workspace and SendGrid with -all. An email arrives from a server at 203.0.113.50 (not authorized). The recipient's server sees -all and:
- Gmail: Sends email to spam folder, adds warning banner ("Be careful with this message")
- Corporate Exchange: May reject with "550 5.7.1 SPF validation failed"
- Outlook.com: Sends to Junk Email folder
Which One Should You Choose? Soft Fail vs Hard Fail Decision Framework
There's no universal "right" answer. The best choice depends on your specific situation, risk tolerance, and email infrastructure maturity.
Decision Matrix
Factor | Soft Fail (~all) | Hard Fail (-all)
-------------------------------------|------------------|------------------
SPF record completeness | Incomplete/uncertain | Complete/verified
DKIM implementation | Not implemented | Implemented
DMARC implementation | Not implemented | Implemented
Email forwarding volume | High | Low or DKIM-protected
Spoofing risk level | Low | High
Recipient type | Corporate | Consumer
Transition stage | Initial setup | Mature/stable
Recommendation by Organization Type
Small Business (Limited IT Resources)
Recommendation: Start with ~all (Soft Fail)
Why: Small businesses often use multiple services and may miss legitimate senders. Soft Fail prevents accidental blocking while providing basic protection. Once stable, consider transitioning to -all.
Enterprise (Dedicated IT/Email Team)
Recommendation: -all (Hard Fail) after thorough testing
Why: Enterprises have resources to audit all email sources, implement DKIM, and monitor DMARC reports. Hard Fail provides the strongest protection against spoofing and phishing.
E-commerce/Transactional Email Heavy
Recommendation: -all (Hard Fail) with DKIM alignment
Why: Transactional emails (receipts, password resets) must be trusted. Hard Fail signals high authenticity. DKIM protects forwarded emails.
Marketing/Newsletter Focused
Recommendation: ~all (Soft Fail)
Why: Marketing emails are often forwarded by recipients. Hard Fail would cause forwarded emails to fail. DKIM can help, but many forwarders strip DKIM signatures.
Government/Financial Services (High Spoofing Risk)
Recommendation: -all (Hard Fail) + DMARC reject
Why: These domains are prime targets for phishing. Hard Fail and DMARC reject provide maximum protection, even if some legitimate forwarded emails are lost.
A Safe Transition Strategy: Moving from Soft Fail to Hard Fail
Most domains should start with Soft Fail and transition to Hard Fail after validation. Here's a step-by-step transition plan.
Phase 1: Start with Soft Fail (~all) (Weeks 1-4)
Publish your SPF record with ~all. Monitor DMARC aggregate reports (if you have DMARC configured) to see SPF pass/fail rates.
Phase 2: Identify Missing Sources (Weeks 4-8)
Review DMARC reports to identify IP addresses that sent email from your domain but failed SPF. For each failed IP:
- Determine if it's a legitimate source (e.g., a forgotten marketing platform)
- If legitimate, add its include or IP to your SPF record
- If illegitimate (spoofing attempt), note that your Soft Fail policy is working
Phase 3: Implement DKIM for All Sources (Weeks 4-12)
Before switching to Hard Fail, ensure every email source has DKIM signing configured. DKIM provides a backup authentication path for emails that fail SPF (e.g., forwarded emails).
Phase 4: Set Up DMARC with p=none (Monitoring)
Configure DMARC with p=none to receive reports without affecting delivery. Monitor for 30-60 days to understand your authentication landscape.
Phase 5: Analyze SPF Failure Reasons (Weeks 8-12)
In your DMARC reports, analyze why emails are failing SPF:
- Missing legitimate sources: Add to SPF
- Email forwarding: Accept that forwarded emails will fail SPF; rely on DKIM
- Spoofing attempts: Good—Soft Fail is protecting you
Phase 6: Transition to Hard Fail (Week 12+)
Once you're confident:
- All legitimate sources are in your SPF record
- DKIM is configured for all sources
- DMARC reports show minimal unexpected SPF failures
Change your SPF record from ~all to -all.
Phase 7: Monitor After Transition (Ongoing)
After switching to Hard Fail, closely monitor DMARC reports for 30 days. If you see a sudden increase in SPF failures from legitimate sources, you may have missed an include or IP range. Revert to Soft Fail while investigating.
Common Misconceptions About SPF Failures and the 'all' Qualifier
Many misunderstandings about SPF lead to poor configuration decisions. Let's clear them up.
Misconception 1: "Soft Fail means my email might go to spam, so I should use Hard Fail"
Reality: Hard Fail emails are MORE likely to go to spam (or be rejected) than Soft Fail emails. Soft Fail gives your email a chance to be delivered based on other signals (DKIM, content, reputation). Hard Fail is stricter, not more lenient.
Misconception 2: "Google/Gmail requires Hard Fail for good deliverability"
Reality: Gmail does not require Hard Fail. Gmail respects both ~all and -all appropriately. What matters more is that your SPF record is complete and accurate, regardless of the qualifier.
Misconception 3: "If I use Hard Fail, spammers can't spoof my domain"
Reality: Hard Fail instructs receiving servers to reject unauthorized emails, but not all servers enforce it strictly. Some spammers' emails may still bypass rejection. DMARC with p=reject provides stronger protection than SPF Hard Fail alone.
Misconception 4: "I should use +all or ?all to avoid blocking any email"
Reality: This is the worst possible choice. +all disables SPF completely, offering zero protection against spoofing. ?all is almost as useless. Always use at least ~all.
Misconception 5: "SPF Soft Fail doesn't do anything—it's the same as no SPF"
Reality: Soft Fail definitely does something. It increases spam scores and adds authentication headers that spam filters use. Domains with Soft Fail are significantly less likely to be spoofed successfully than domains with no SPF.
~all) is the safer, forgiving option for most domains. It protects against spoofing while minimizing the risk of blocking legitimate email. Hard Fail (-all) provides maximum protection but requires a complete, accurate SPF record and DKIM implementation. Use our SPF Checker to verify your current qualifier and determine if you're ready to transition from Soft Fail to Hard Fail.
