Dev.to Security 🔐 Cybersecurity 👁 0 📖 1 min read

SPF ~all vs -all: softfail or fail?

-all says email from anyone not listed fails SPF; ~all says it soft-fails (suspicious). With DMARC in place, either is fine; -all is stricter, ~all is gentler with forwarded email. What the endings mean The l

-all says email from anyone not listed fails SPF; ~all says it soft-fails (suspicious). With DMARC in place, either is fine; -all is stricter, ~all is gentler with forwarded email.

What the endings mean

The last part of an SPF record says what happens to email from servers that aren't listed (the SPF standard, RFC 7208):

  • -all: fail. The receiver may reject the email.
  • ~all: softfail. The receiver should accept it but treat it as suspicious.
  • ?all: neutral, no opinion. +all: allow everyone. Neither protects you.

Which to choose

  • You have DMARC: DMARC decides what happens to failing email, so ~all and -all usually end the same way. Many senders keep ~all because some receivers reject a -all failure straight away, before checking DKIM, which can drop forwarded email that DKIM would have saved.
  • You have no DMARC yet: -all gives clearer protection, but add DMARC: it's what the big inboxes look for.
  • A domain that never sends email: use v=spf1 -all together with a DMARC reject record.

Before you switch to -all

List every service that sends as you. A forgotten one will fail.

Common questions

Does ~all hurt my deliverability?

No. Your own email passes SPF either way. The ending only affects servers you didn't list.

Is -all more secure?

Slightly, without DMARC. With DMARC at reject, the DMARC policy does the blocking.

First published on DNSFix. Check your own domain free at dnsfix.com.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.