The last mechanism in an SPF record decides what a receiver is told to do with mail from a sender you did not list:

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

What the qualifiers mean

  • -all (fail): the sending IP is not authorised. Mail should not be trusted.
  • ~all (softfail): probably not authorised, but accept it and treat it with suspicion.
  • ?all (neutral): no statement. Avoid it on a real domain.
  • +all: everyone is authorised. This is never what you want.

What actually happens at the receiver

SPF alone is advisory. Many large receivers do not reject on -all by themselves. They record the SPF result and feed it into their spam scoring and, if you publish one, your DMARC policy.

DMARC passes if SPF or DKIM passes and is aligned with the From: domain. So:

  • A message that fails SPF but has a valid, aligned DKIM signature still passes DMARC. ~all and -all make no difference to that outcome.
  • A message that fails both is judged by your DMARC p= value (none, quarantine, reject), not by the SPF qualifier.
  • Some receivers do reject on -all before DMARC is ever evaluated. The DMARC specification warns about this, because it can discard mail that a valid DKIM signature would have rescued. Mailing lists and forwarders trip this most often, since forwarding breaks SPF.

Which one to publish

  • If you enforce DMARC (p=quarantine or p=reject) and sign everything with DKIM, ~all is the safer choice. DMARC does the enforcing, and you avoid early rejection of forwarded mail.
  • If you do not sign with DKIM everywhere, fix that first. Switching to -all does not make a weak setup stronger, it only makes failures harder.
  • Use -all for domains that never send mail (a parked domain, or a legacy domain that only redirects): v=spf1 -all, together with p=reject in DMARC.

Check before you change it

  1. List every system that sends as your domain: your mail platform, invoicing, CRM, helpdesk, newsletters, website forms.
  2. For each one, confirm DKIM signs with your domain, not the vendor's.
  3. Read a week or two of DMARC aggregate reports and look for sources you do not recognise.
  4. Count DNS lookups. SPF is limited to 10 lookups, and a record over the limit returns a permanent error regardless of ~all or -all.

Then change the qualifier, and re-read the reports a week later. The qualifier is the easy part. Knowing every sender is what makes a change safe, and senders change every few months.

Inspect your live SPF, DKIM & DMARC alignment free in 5 seconds: https://email-fix-pack.pages.dev/?src=devto