How to fix an SPF record ending in ?all or ~all

Change the final ?all in the SPF record to ~all now, and consider -all once the DMARC reports show every legitimate sender passing.

Last reviewed

Why it matters

A record ending in ?all says nothing about senders it does not list, and the SPF standard says a neutral result must be treated exactly like having no SPF at all. The record gives no protection against forged senders.

How to fix it

The record now reads:

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

What the endings mean:

  • ?all (neutral): no statement about unlisted senders; treated like no SPF. Microsoft calls it a testing value.
  • ~all (soft fail): unlisted senders are probably not authorised; receivers usually mark the message rather than reject it. A normal, safe stage, and the one Google recommends for Workspace.
  • -all (fail): unlisted senders are not authorised. Microsoft recommends it alongside DKIM and DMARC, but some receivers act on it before DMARC runs and reject forwarded mail that DKIM would have passed.

With DMARC at quarantine or reject and DKIM in place, ~all and -all protect about equally: DMARC treats both as an SPF fail.

Replace the highlighted values: v=spf1 include:_spf.google.com ~all with your current SPF record, example.com with your domain.

Any DNS host

  1. Edit the existing SPF TXT record at example.com and change only the last term from ?all to ~all:
before: v=spf1 include:_spf.google.com ?all
after:  v=spf1 include:_spf.google.com ~all
  1. Keep a single v=spf1 record, TTL 3600.

  2. Move to -all only after the DMARC reports show every legitimate source passing SPF.

Sources: RFC 7208 §8, RFC 7489 §10.1.

Google Workspace

Google's record for a domain that sends only through Workspace:

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

If other services send as the domain, keep their includes in the same record.

Source: Set up SPF.

Microsoft 365

Microsoft's record for a domain that sends only through Microsoft 365 (GCC High and DoD use include:spf.protection.office365.us):

v=spf1 include:spf.protection.outlook.com -all

There is no portal for SPF: edit it at the DNS host. Use ~all first if you have not checked every sender yet.

Source: Microsoft: configure SPF.

Check that it worked

dig TXT example.com +short | grep spf1

The record should end in ~all (or -all). Wait out the old TTL, run the Owl Keeper Email authentication check again, and send a test from each known sender: Authentication-Results should show spf=pass.

Test it now with the free SPF checker. No account needed.

What can go wrong

  • A sender you missed moves from neutral to soft fail and may land in spam; under -all it may be rejected.
  • -all can reject forwarded mail at receivers that check SPF before DMARC.
  • Edit the record, never add a second: two SPF records are a permerror.