ONE CHARACTER, WHOLE POLICY

SPF +all, ?all, ~all and -all: what each qualifier tells receivers and how to move to a strict policy safely

The last term of an SPF record decides what receivers think of every server you did not list. +all vouches for anyone, ?all says nothing, and ~all and -all are the two real policies. This guide explains what receivers do with each, how DMARC changes the picture, and how to tighten the record without losing legitimate mail.

Concept illustration of an ivory ceramic garden gate set in a low wall, its mint-glowing glass latch closing, beside a small glass guest ledger on a copper stand, while an identical gate further back stands wide open.
Concept illustration

An SPF record is a short line of text in your DNS that lists the servers allowed to send mail for your domain. Most of the record is that list. The final term, usually some form of all, answers a different question: what should a receiving mail server think about every other server on the internet that claims to be you?

The answer depends on a single character in front of all. A plus sign says every server is authorized, a question mark says you have no opinion, a tilde says unlisted servers are probably not authorized, and a minus sign says they are not. Two of these turn SPF into a working policy; the other two leave your domain with little or no protection against spoofed envelope senders.

This guide explains how the all mechanism is evaluated, what RFC 7208 tells receivers to do with each result, the real trade-off between ~all and -all, how DMARC changes that trade-off, and a staged way to move a permissive record to a strict one without bouncing your own invoices or newsletters. Examples use example.com and documentation IP addresses.

Scope of this guide

This guide covers SPF records readable in public DNS and how receivers interpret them. Automated checks see only the published record, not your real sending sources, receiver decisions or DKIM setup. Sitelemetry is not a pentest or a compliance attestation.

1. How SPF is evaluated and where all fits

Sender Policy Framework is defined in RFC 7208. A domain publishes one TXT record that starts with v=spf1. When a message arrives, the receiving server takes the IP address of the connecting client and the domain from the SMTP MAIL FROM command (the envelope sender, which later appears as the Return-Path), or from the HELO/EHLO name when the envelope sender is empty. It then evaluates the record from left to right.

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

Each term is a mechanism such as ip4, ip6, a, mx, include, exists or all, optionally preceded by a qualifier. The first mechanism that matches the client IP decides the result, and nothing after it is evaluated. Because all matches every address, it belongs at the end and works as the catch-all: it determines the result for any IP that none of the earlier mechanisms listed.

So the record has two halves. Everything before all says who may send. The qualifier on all is your policy for everyone else. Two details matter here:

  • The default qualifier is plus. A mechanism written without a qualifier is treated as +. A record ending in a bare all therefore means +all.
  • No match means neutral. If no mechanism matches and there is no redirect= modifier, RFC 7208 says the result is neutral, just as if ?all were the last term. Leaving all out does not make the record strict.

SPF checks the envelope sender, not the From address people see in their mail client. Connecting the two is DMARC’s job, covered in section 6.

2. The four qualifiers and the results they produce

RFC 7208 maps each qualifier to a named result and, in section 8, describes what that result means to a receiver. The table summarizes the catch-all case, where a server not listed anywhere earlier in the record sends mail using your domain.

EndingResult for unlisted serversWhat it assertsReceiver handling per RFC 7208Sitelemetry finding
+all (or bare all)passEvery server on the internet is authorizedTreated as authorized maildns.email.spf.permissive, high (explicit +all)
?allneutralNo assertion either wayMust be treated exactly like no SPF record (result none)dns.email.spf.neutral, low
~allsoftfailProbably not authorized, without a strong claimShould not be rejected on this result alone; may get closer scrutinyNone
-allfailExplicitly not authorizedReceiver may mark the message or reject it outrightNone

Servers you do list get pass in every case, as long as the mechanism that matches them has no qualifier or a +. The ending only changes how the rest of the internet is judged, which is exactly the population a spoofer belongs to.

Receivers record the outcome in an Authentication-Results header (RFC 8601), for example spf=softfail smtp.mailfrom=example.com, and many also add a Received-SPF header. Both are useful when you verify a change.

3. Why +all is worse than no SPF record

+all makes every IP address match with a pass result. Any server, anywhere, that puts your domain in its envelope sender gets spf=pass. This is worse than publishing no record at all: with no record the result is none and proves nothing, while +all actively vouches for the message.

It also undermines DMARC. DMARC passes when SPF or DKIM passes for a domain aligned with the visible From address. A sender who uses your domain both in the envelope and in the From header gets an SPF pass from +all, that pass is aligned, and DMARC passes, even if your DMARC policy is p=reject. One character switches off the protection the rest of your email setup provides.

Common ways a record ends up with +all:

  • a quick fix copied from a forum to stop legitimate mail from failing, never reverted;
  • a belief that + means “add the servers above” rather than “authorize everyone”;
  • a bare all with no qualifier, which RFC 7208 treats as +all;
  • a placeholder record from a hosting panel or domain template.

The fix is to list the real senders and end the record with ~all or -all. If +all was added because some legitimate mail was failing, find that sender first (section 7) rather than restoring the catch-all.

4. Why ?all is effectively no policy

RFC 7208 is direct about neutral: it must be treated exactly like the result none. A record ending in ?all still helps your listed senders, because they get pass, and that pass can satisfy DMARC for legitimate mail. For everyone else it says nothing, so spoofed mail is evaluated as if you had no SPF policy.

Sitelemetry reports ?all with low severity rather than high. Neutral is not a pass, so it cannot be used to forge an aligned DMARC result the way +all can. If your domain enforces DMARC and signs its mail with DKIM, a spoofed message with a neutral SPF result and no valid aligned DKIM signature still fails DMARC. Without DMARC enforcement, though, ?all leaves receivers with no SPF signal against impersonation of your envelope domain.

You sometimes see ?all in setup instructions from providers, or chosen by administrators who were unsure of their sender list and wanted to avoid any risk. The safer path to the same goal is ~all plus DMARC reporting: you still avoid outright rejections, and receivers get a meaningful signal.

5. ~all vs -all: what receivers actually do

On paper the difference is clear. Softfail says “probably not authorized” and RFC 7208 says receivers should not reject on that result alone. Fail says “not authorized” and receivers may reject. In practice the choice involves three effects.

Early rejection before DMARC

RFC 9989, section 7.1, warns that some receivers evaluate SPF before any DMARC processing. A -all fail can then cause rejection early in handling, before the receiver ever looks at a valid DKIM signature that would have passed DMARC. Such early rejections also never appear in DMARC aggregate reports. With ~all, the message reaches DMARC evaluation, and DKIM can still rescue it.

Forwarding

When a mailbox forwards a message, the forwarding server connects from its own IP address but often keeps your envelope sender. That IP is not in your record, so SPF fails or softfails. With -all, a receiver that rejects on SPF fail drops the forwarded copy; a DKIM signature that survives forwarding is the usual way such messages still pass DMARC.

Signal strength

Where DMARC is not enforced, -all gives receivers the clearest instruction about unlisted senders, and many administrators use it on domains whose sending sources are fully known.

SituationReasonable endingWhy
Sender list still being confirmed~allUnknown senders are flagged, not rejected, while DMARC reports reveal what you missed
DMARC at p=quarantine or p=reject, DKIM on all senders~all or -allDMARC carries the enforcement; ~all avoids pre-DMARC rejection of forwarded mail
No DMARC enforcement, complete sender inventory-allThe strongest SPF-only signal against envelope spoofing
Domain that never sends mailv=spf1 -allNothing is authorized, so there is nothing to break

Both endings are legitimate policies, and Sitelemetry raises no finding for either. The mistakes are +all and, to a lesser degree, ?all.

6. How SPF works together with DMARC

SPF on its own has a gap: it authenticates the envelope sender, which recipients never see. A message can pass SPF for bounces.mailer.example.net while its From header says billing@example.com. DMARC closes that gap with alignment.

  • Pass and align. DMARC passes if SPF passes and the envelope domain aligns with the From domain, or if DKIM passes and the signing domain (d=) aligns with the From domain. One of the two is enough.
  • Relaxed or strict. By default alignment is relaxed, so mail.example.com aligns with example.com because they share an organizational domain. aspf=s in the DMARC record requires an exact match.
  • Any non-pass is a non-pass. For DMARC, softfail, fail, neutral and none are all simply “SPF did not pass”. That is why, once DMARC is enforced, the gap between ~all and -all matters less than many guides suggest.
  • Reports show your real senders. A rua= address in the DMARC record makes receivers send aggregate reports listing the IPs that sent mail as your domain and their SPF and DKIM results. These reports are the safest inventory you will get.

Many third-party senders use their own envelope domain by default, so their SPF pass is not aligned with yours. For those, configure DKIM signing with your domain, or a custom return-path subdomain under your domain if the provider supports it. Google’s email sender guidelines require all senders to set up SPF or DKIM, and bulk senders to set up SPF, DKIM and DMARC. The DNS and email security audit guide covers the DMARC policy stages in more detail.

7. Moving to a strict policy without losing mail

The risk in tightening SPF is not the attacker; it is the forgotten legitimate sender, such as the invoicing tool that has quietly sent receipts as your domain for years. Work through these steps in order.

  1. Inventory senders. List every system that sends as your domain: your mailbox provider, newsletter and marketing platforms, CRM, help desk, billing and invoicing, e-commerce notifications, transactional email APIs, website contact forms and server cron jobs. Ask each team, and check vendor settings pages for SPF or DKIM instructions.
  2. Turn on DMARC reporting. If you have no DMARC record, publish one at _dmarc.example.com with p=none and a rua= address. Read a few weeks of aggregate reports and add any legitimate source you missed.
  3. Lower the TTL. Set the TXT record TTL to a few minutes a day before the change, so a mistake can be corrected quickly.
  4. Publish the list with ~all. Replace +all or ?all with the real mechanisms and ~all. Unlisted mail now softfails instead of passing, without outright rejections.
  5. Set up DKIM everywhere. Enable signing with your domain on each platform, so DMARC can pass even when SPF breaks through forwarding.
  6. Watch and fix. Keep reading reports and bounce messages. Any legitimate source showing softfail gets added to the record or moved to a properly configured provider.
  7. Decide on the final ending. Stay on ~all with DMARC enforcement, or switch to -all when you are confident in the inventory. Then restore a normal TTL.

Keep the record within the 10 DNS-lookup limit from RFC 7208 section 4.6.4: include, a, mx, ptr, exists and redirect each count, and exceeding the limit produces a permerror that many receivers treat as no SPF. Remove includes for services you no longer use instead of stacking new ones; the SPF lookup-limit guide covers this in detail.

8. Editing the record on common DNS stacks

A corrected record for a domain using Google Workspace, one marketing platform and one web server might look like this:

v=spf1 include:_spf.google.com include:spf.esp-example.net ip4:192.0.2.10 ~all

Use the include values your providers document. Google documents include:_spf.google.com in its SPF setup help, and Microsoft 365 documents include:spf.protection.outlook.com.

  • One record only. RFC 7208 treats more than one v=spf1 record at the same name as a permerror. When adding a new provider, edit the existing record; do not create a second one.
  • Cloudflare DNS and most registrar panels. Edit the TXT record at the root (shown as @ or the bare domain), paste the value without surrounding quotes and save. If the panel shows an orange proxy toggle, it does not apply to TXT records.
  • Amazon Route 53. TXT values are entered in double quotes, for example "v=spf1 include:_spf.google.com ~all". A single string cannot exceed 255 characters; longer records are split into several quoted strings in the same record, which receivers join without adding spaces, so put the split at a point where a space already ends one string.
  • Infrastructure as code. In Terraform or similar tools, search the repository for +all and bare all as well as the live zone, or the next deploy may restore the old value.
  • Domains that never send mail. Publish v=spf1 -all and a DMARC record with p=reject. If the domain also receives no mail, a null MX record (RFC 7505) states that clearly. Parked and campaign domains are common spoofing targets precisely because nobody watches them.

9. Verifying the fix

Start with the published record. From a terminal:

dig +short TXT example.com
dig +short TXT _dmarc.example.com

On Windows, use nslookup -type=TXT example.com. Confirm that exactly one value begins with v=spf1, that it ends in ~all or -all, and that the DMARC record exists. If you still see the old value, the previous TTL has not expired yet on that resolver; query your authoritative name server directly with dig @ns1.your-dns-provider.example TXT example.com to see what is actually published.

Then test real mail from each sending platform to a mailbox you control, and open the full headers (in Gmail, “Show original”). You are looking for something like:

Authentication-Results: mx.receiver.example;
  spf=pass smtp.mailfrom=example.com;
  dkim=pass header.d=example.com;
  dmarc=pass header.from=example.com

A softfail or fail on mail you sent yourself means a sender is missing from the record or is using its own envelope domain; in the latter case check that DKIM passes and aligns. Finally, keep watching DMARC aggregate reports for a few weeks after the change: they show results from receivers you cannot test by hand, including forwarded mail.

10. What Sitelemetry checks

Both findings come from the passive dns-email security module, which reads public DNS for the scanned hostname. It runs in every scan profile on every plan: Free ($0), Starter ($49/month), Professional ($149/month) and Enterprise ($249/month). It needs no ownership verification by itself: the free Launch Readiness Snapshot and a Free account’s security audit of an unverified site both run it, while a default security audit on a paid plan also runs checks that need a verified target. You can also start from the SPF and DMARC checker.

  • dns.email.spf.permissive (high severity, high confidence) is raised when the domain’s v=spf1 TXT record contains an all mechanism with an explicit + qualifier. The evidence is the record text, and the recommended fix is to end the record with -all, or at least ~all.
  • dns.email.spf.neutral (low severity, high confidence) is raised when that all mechanism uses ?. The evidence is again the record text, with a recommendation to use -all or ~all.

Records ending in ~all or -all produce neither finding. The check reads TXT records on the exact hostname you scan, with no fallback to the parent domain, so scan example.com rather than www.example.com to have your mail domain’s record read. The scanned name must also resolve to an address: if it has no A or AAAA record, as on some mail-only domains, the scan stops at the DNS step with dns.resolve.failed and the email records are not read, so check them with dig as shown in section 9. It looks for all written with a qualifier in the first string of the v=spf1 record; for a long record split into several strings, an all term in a later string is not evaluated, and the evidence shows only the first string. A bare all (which RFC 7208 treats as +all) or a record that relies on redirect= with no all of its own does not trigger these findings; review those by eye. The same module also reports a missing SPF record when the domain has MX records, an approximate count of DNS-querying mechanisms above the limit of 10, a missing DMARC record when the host has MX records, and a DMARC policy left at p=none. It cannot see which servers really send your mail, how individual receivers act on the result, or whether DKIM is configured on each platform. It is an automated audit, not a penetration test or compliance attestation. For reading and checking the whole record, see the SPF and DMARC check guide.

Common questions

Is ~all or -all better for SPF?

Both are valid policies. -all gives the strongest SPF-only signal and suits domains with a complete sender inventory. ~all avoids early rejection of forwarded mail before DMARC runs, which RFC 9989 warns about. With DMARC enforced and DKIM on every sender, either works; the mistakes are +all and ?all.

Does +all ever make sense in an SPF record?

No. +all gives a pass to every server on the internet, so it removes SPF protection and can even let spoofed mail pass DMARC through an aligned SPF result. If legitimate mail was failing, find and list the missing sender instead of authorizing everyone.

Is ?all a safe setting while I set up email?

It is safe for your own mail but gives no protection: RFC 7208 says a neutral result must be treated exactly like having no SPF record. ~all together with DMARC at p=none and reporting is a better transition setting, because unlisted senders are flagged without being rejected.

What happens if my SPF record has no all at the end?

If no mechanism matches and there is no redirect modifier, RFC 7208 defines the result as neutral, the same as ?all. A bare all without a qualifier is different: it means +all. Always write the qualifier explicitly, normally ~all or -all.

Does SPF stop people from faking my From address?

Not on its own. SPF checks the envelope sender, which recipients do not see. DMARC ties SPF or DKIM results to the visible From domain through alignment and tells receivers what to do when neither passes, so SPF is most useful as part of a DMARC setup.

Sources & further reading

  1. RFC 7208: Sender Policy Framework (SPF) for Authorizing Use of Domains in Emailwww.rfc-editor.org
  2. RFC 9989: Domain-Based Message Authentication, Reporting, and Conformance (DMARC)www.rfc-editor.org
  3. RFC 8601: Message Header Field for Indicating Message Authentication Statuswww.rfc-editor.org
  4. RFC 7505: A "Null MX" No Service Resource Record for Domains That Accept No Mailwww.rfc-editor.org
  5. Google Workspace Help: Set up SPFknowledge.workspace.google.com
  6. Gmail Help: Email sender guidelinessupport.google.com
Sitelemetry team

Prepared by the Sitelemetry editorial team. Explore the linked sources for further detail.

SITELEMETRY

Put what you learned to work.

Explore your website’s structure, settings and signals with Sitelemetry.