Email security

SPF Softfail vs Hardfail: Which One Should Your Domain Use?

Softfail (~all) says an unlisted sender is probably not authorised; hardfail (-all) says it is not authorised. For active senders, use softfail and enforce with DMARC.

Cysoro Security TeamPublished · 8 min read
EMAIL SECURITYSPF Softfailvs Hardfail~all or -all? One character decideshow receivers treat your mail~allSOFTFAILprobably not authorised-allHARDFAILnot authorisedv=spf1 include:_spf.google.com ~allCYSORO • cysoro.com
Quick answer

SPF softfail (~all) tells receivers that a sender not listed in your SPF record is probably not authorised, while hardfail (-all) says it is definitely not authorised. For domains that send email, use ~all and enforce the policy with DMARC at p=reject, because DMARC treats both results as SPF failed. For domains that never send email, use -all.

Key takeaways

  • Softfail (~all) means probably not authorised; hardfail (-all) means not authorised — one character changes the signal.
  • DMARC treats softfail and hardfail identically as SPF failed, so enforce with DMARC rather than with -all alone.
  • Use ~all while you are still finding senders, and -all only for domains that never send email or whose sender list is fully verified.

One character at the end of your SPF record decides how the world treats mail from senders you did not list. A tilde says "probably not authorised"; a dash says "not authorised". Pick the wrong one and you either let spoofed mail through or block your own.

What is the difference between SPF softfail and hardfail?

Softfail (~all) means a sender not listed in your SPF record is probably not authorised, while hardfail (-all) means it is not authorised. The difference is the strength of the statement your domain makes — and how receivers are likely to act on it.

SPF, Sender Policy Framework, lets a domain owner publish a DNS TXT record listing the hosts allowed to send mail for that domain. When a receiving server gets a message, it checks the sending IP against that list. If the IP is not listed, the all mechanism at the end of the record decides the result.

That ending is a qualifier placed before all. There are four:

QualifierSyntaxSPF resultMeaning
Pass+allPassEvery sender is authorised — do not use this
Fail (hardfail)-allFailUnlisted senders are not authorised
Softfail~allSoftFailUnlisted senders are probably not authorised
Neutral?allNeutralThe domain makes no assertion about unlisted senders

In practice, only ~all and -all are useful endings. +all authorises everyone and defeats the purpose of SPF, and ?all — neutral — tells receivers nothing. Use one of the two real choices and ignore the others.

What does SPF softfail (~all) mean?

Softfail means your domain believes an unlisted sender is probably not authorised, but it is not willing to make the strongest policy statement. RFC 7208 says receiving software should not reject a message based solely on a softfail result, but may subject it to closer scrutiny.

A typical softfail record looks like this:

v=spf1 include:_spf.google.com ~all

This authorises Google Workspace to send for the domain and softfails everything else. In practice, a receiving server usually accepts the message but may route it to spam, flag it as suspicious, add to its spam score, or apply greylisting — accepting it on a later attempt, as RFC 7208 describes.

Softfail is the cautious choice. It signals concern without demanding rejection, which is why it is the safer default while you are still learning which services send mail for you.

How the all qualifier decides the resultReceiver checks the sending IP against your SPF recordIP listed? → Pass. IP not listed? → the all qualifier decides.~all — SoftFailProbably not authorisedAccept, but flag, filter or score it-all — FailNot authorisedMore likely to reject or quarantineThe qualifier is one character — but it changes the signal your domain sends.
SPF softfail versus hardfail: what each qualifier tells the receiver. Illustration by Cysoro.

What does SPF hardfail (-all) mean?

Hardfail means your domain states that an unlisted sender is not authorised to send mail for it. It is the strictest of the commonly used SPF endings, and receivers are more likely to reject, quarantine or score the message harshly.

A typical hardfail record looks like this:

v=spf1 include:_spf.google.com -all

Only Google Workspace is authorised; everything else fails. But note the important limit: an SPF Fail result does not require a receiver to reject the message. RFC 7208 says a fail result can be used to reject during the SMTP transaction, or as one input into a larger evaluation. The receiving server still makes the final call, using its own policy, DMARC, DKIM, reputation and content signals.

For a domain that never sends email, hardfail is the right answer:

v=spf1 -all

That single record states that no host may send mail for the domain. It is short, unambiguous, and helps receivers reject spoofed mail that pretends to come from a parked domain.

SPF softfail vs hardfail: side by side

Both results mean SPF did not confirm the sender. The difference is how strongly your domain asks the receiver to interpret that failure — and how much risk you take if your own record is incomplete.

Softfail (~all)Hardfail (-all)
Syntax~all (tilde)-all (dash)
SignalProbably not authorisedNot authorised
RFC 7208 resultSoftFailFail
Typical receiver actionAccept, flag, filter or score more harshlyMore likely to reject or quarantine
With DMARC p=rejectTreated as SPF failedTreated as SPF failed — identical outcome
Risk if a sender is missingReal mail may land in spamReal mail may be rejected outright
Best forActive sending domains, and while auditing sendersNon-sending domains, and verified sending domains

The row that matters most is the DMARC one. When DMARC is in place, it treats both softfail and hardfail identically as SPF failed. That changes the whole decision, as the next section explains.

How does DMARC change the softfail vs hardfail choice?

DMARC makes the choice far less important than it looks. DMARC checks whether a message passes SPF or DKIM and whether the domain in the check aligns with the From domain. If SPF returns softfail or fail, DMARC counts SPF as failed either way.

That means an attacker spoofing your domain gets the same DMARC outcome under ~all as under -all — provided your DMARC policy is set to p=reject and the message fails DKIM too. The security outcome is the same, but hardfail adds a risk softfail does not: it can block legitimate mail before DMARC ever gets a chance to evaluate it, for example when a message is forwarded and SPF breaks.

This is why Valimail and other email-security guides recommend the same rule: for active sending domains, use softfail and enforce your policy through DMARC. For domains that never send email, use hardfail. Valimail's softfail vs hardfail guide reaches the same conclusion.

Learn the full setup in our guide to what DMARC is and how to set it up, and check your own domain with the free DMARC checker linked at the end of this article.

Hardfail is not a DMARC replacementSPF alone cannot stop spoofing reliably, because SPF checks the envelope sender, not the From address your reader sees. Only DMARC ties the check to the visible From domain — so publish SPF, DKIM and DMARC together.

Which should you use: -all or ~all?

Use ~all if your domain sends email and you have not yet verified every sender, and use -all only for a domain that never sends email or after you have fully verified your sender list. The decision tree is short.

  1. Does the domain send email? If no, publish v=spf1 -all and stop there.
  2. Have you listed every legitimate sender? Include your mail provider, your CRM, your helpdesk, your marketing tool and any other service that sends as your domain. If you are unsure, stay on ~all.
  3. Have you watched DMARC reports? Run DMARC at p=none first, read the aggregate reports for a few weeks, and fix every legitimate source that fails. Only then consider -all.
  4. Is your DNS stable? If you change providers often or add new tools regularly, ~all forgives the gap. -all does not.

Even after you switch to -all, keep DMARC at p=reject. Hardfail without DMARC still leaves the visible From address unprotected, and softfail with DMARC at p=reject already gives you the enforcement you want.

Choose your ending in four steps1. Does the domain send email?No → use -allv=spf1 -allNo host is authorisedYes → use ~allList every sender firstAudit with DMARC reports2. Enforce with DMARC p=reject — not with -all alone
Decision flow for choosing between SPF softfail and hardfail. Illustration by Cysoro.

How do I switch from softfail to hardfail safely?

Switching is a one-character change in DNS, but do the homework first or you will block real mail. Follow this sequence and give each step time to take effect.

  1. Inventory every sender. List your mail host, CRM, marketing platform, support desk, invoicing tool and any service that sends on your behalf. Check your DMARC aggregate reports for sources you missed.
  2. Publish SPF with ~all and DMARC at p=none. Watch the reports for at least two weeks. Fix every legitimate source that shows up as failing.
  3. Move DMARC to p=quarantine, then p=reject. This is the enforcement step that actually stops spoofed mail. Keep SPF on ~all throughout.
  4. Only then change ~all to -all. Do it after a quiet period with no new senders and no DMARC failures from legitimate mail.
  5. Test after the change. Send test mail from each service, check the headers, and confirm SPF passes. Use the free SPF checker to verify the record parses and the qualifier is what you intended.

Watch out for the SPF 10-DNS-lookup limit while you do this. Each include in your record triggers lookups, and a record that exceeds 10 lookups returns a permanent error. Flattening includes or removing unused services is part of a clean switch. Our guide to what DKIM is covers the second half of the authentication pair you need alongside SPF.

What mistakes cause SPF softfail and hardfail problems?

Most SPF trouble is not the qualifier — it is the record around it. These are the errors that turn a good policy into blocked mail or a false sense of security.

  • Missing a sender. A new marketing tool or helpdesk sends mail, is not in the record, and its messages fail. Audit senders before tightening anything.
  • Two SPF records. A domain must have exactly one SPF TXT record. Two records cause a permanent error and SPF fails for everything.
  • Too many DNS lookups. More than 10 lookups in a record, counting nested includes, returns PermError. Keep the record lean.
  • Using +all or ?all. Both give attackers a free pass or no signal at all. Neither belongs at the end of a real record.
  • Thinking SPF alone stops spoofing. SPF checks the envelope sender, not the From header. Without DMARC, an attacker can pass SPF with their own domain and still show your domain in the From line. That is why phishing emails can look so convincing even when SPF exists.
  • Forgetting forwarding. Mail forwarded by a third party often fails SPF because the forwarder's IP is not in your record. DKIM survives forwarding better, which is another reason to publish both.

The bottom line

For a domain that sends email, publish ~all and let DMARC at p=reject do the enforcing — you get the same protection as hardfail without the risk of blocking real mail. For a domain that never sends email, publish v=spf1 -all.

Check your own record today with the free SPF checker, fix any missing senders it finds, and pair SPF with DKIM and DMARC before you tighten anything.

Frequently asked questions

What is SPF softfail?

SPF softfail is the result when a sender is not listed in your SPF record and the record ends in ~all. It means the domain owner believes the sender is probably not authorised, but is not making the strongest policy statement. Receivers should not reject on softfail alone.

What is SPF hardfail?

SPF hardfail is the result when a sender is not listed in your SPF record and the record ends in -all. It means the domain owner states the sender is not authorised. Receivers are more likely to reject, quarantine or score the message harshly.

Should I use -all or ~all in my SPF record?

Use ~all for a domain that sends email, and enforce with DMARC at p=reject. Use -all for a domain that never sends email, or for a sending domain only after you have verified every legitimate sender and watched DMARC reports.

Does hardfail stop spoofing better than softfail?

Not on its own. An SPF fail does not force a receiver to reject the message, and many receivers treat both results as one input among others. DMARC at p=reject is what turns an SPF failure into a real rejection.

Can -all break legitimate email?

Yes. If a legitimate sender is missing from your SPF record, or a message is forwarded, hardfail can cause receivers to reject real mail. Softfail is more forgiving while you clean up your sender list.

What does v=spf1 -all mean for a domain that never sends mail?

It states that no host is authorised to send mail for the domain. That is the correct record for a parked or non-sending domain, and it helps receivers reject spoofed mail that uses it.

What are the other SPF qualifiers?

Plus (+) means pass, tilde (~) means softfail, minus (-) means fail, and question mark (?) means neutral. Neutral and plus-all give little or no protection and should not normally be used at the end of a record.

How do I check my SPF record?

Use a free checker to look up your domain's TXT record and see the result for a sending IP. Cysoro's free SPF checker shows your record, your qualifier and any syntax or lookup-count problems.

Sources

  1. IETF — RFC 7208: Sender Policy Framework (SPF) for Authorizing Use of Domains in Email
  2. Valimail — SPF Softfail vs Hardfail: Which Should You Use?
  3. DMARC Report — SPF Authentication: Understanding SPF -all vs ~all
  4. Mimecast — SPF Hard Fail vs Soft Fail: Key Differences
  5. DMARCwise — Should You Use -all or ~all in Your SPF Record?
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against RFC 7208, Valimail's softfail vs hardfail guide, and DMARC Report, Mimecast and DMARCwise explainers.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free