Insights

Should SPF End in ~all or -all? Decide by Who Else Sends Mail for You

November 8, 2026
0:00
You changed the end of your SPF record from ~all to -all because it looked stricter. A few days later, invoices from your billing platform start bouncing, or contact form notifications stop arriving and nobody can say why. The DNS change is small, but it changes how receivers treat every message your record does not cover. Whether -all is safe depends on who sends mail as your domain, and many site owners only find that out after something breaks. This walkthrough starts at the symptom, follows the message back to the sender, and ends with a qualifier you picked on purpose rather than by guessing.
SPF (Sender Policy Framework) is a TXT record that lists which servers may send mail for a domain. The receiver compares the connecting server's IP with that list. The final all mechanism, with its qualifier, says what to do when nothing earlier matched:
  • -all returns fail: the sender is not authorized.
  • ~all returns softfail: probably not authorized, but not certain.
  • ?all returns neutral, which is close to having no policy.
  • +all authorizes the whole internet. Never use it.
The record itself does not reject anything. It produces a result, and the receiving server decides what to do with it. A softfail might add to a spam score. A fail might do the same, or it might cause a rejection during the SMTP conversation. That decision belongs to the receiver, so the same record can behave differently at different mailbox providers. When mail breaks right after a switch to -all, the likely cause is a legitimate sender missing from the record. Before, it soft-failed and was tolerated. Now it fails and at least one receiver rejects it.
It is tempting to open the DNS zone and start adding include: entries. Look at evidence first. Get a copy of an affected message: a bounce with the original attached, a message from the spam folder, or a test sent to a mailbox you control. Then read its headers. Two headers matter most. Return-Path shows the envelope sender (also called MAIL FROM), and SPF checks this domain, not the From: address the recipient sees. Authentication-Results shows what the receiver concluded for SPF, DKIM, and DMARC.
TEXT
# Illustrative output format (example domains, not real values)
Return-Path: <[email protected]>
From: Billing <[email protected]>
Authentication-Results: mx.receiver.example;
       spf=pass smtp.mailfrom=mail.sender-platform.example;
       dkim=pass header.d=sender-platform.example;
       dmarc=fail header.from=yourdomain.example
This one deserves a careful read. SPF passed, but for sender-platform.example, because the platform uses its own bounce domain. Your SPF record was never consulted, so changing it to -all had no effect on this message, and adding the platform's include: would not help either. DKIM also passed, but signed by the platform's domain. Neither result matches yourdomain.example, so DMARC fails on alignment. The fix here is in the platform's settings: a custom return-path domain, DKIM signing with your domain, or both. Compare that with a message where smtp.mailfrom shows your own domain and spf=fail appears. That sender really does use your domain in the envelope and is missing from your record. That is the case -all breaks. This split is the most common source of confusion. Customers see a failing third-party service and assume SPF is the culprit, when the real gap is DKIM alignment. A support engineer usually reads smtp.mailfrom and header.d before touching DNS.
Headers show one message at a time. To see every source that sends as your domain, including ones nobody remembers setting up, use DMARC aggregate reports. Receivers that support DMARC send daily XML summaries to the address in your rua tag. Each report lists source IPs, message counts, SPF and DKIM results, and whether they aligned with your domain. If you do not have a DMARC record yet, publish one in monitoring mode. You can check what is already live in DNS with read-only lookups:
BASH
# Current SPF record (look for the TXT value starting with v=spf1)
dig +short TXT yourdomain.example

# Current DMARC record, if any
dig +short TXT _dmarc.yourdomain.example

# A minimal monitoring-only DMARC record looks like this (published as TXT at _dmarc):
# v=DMARC1; p=none; rua=mailto:[email protected]
p=none tells receivers not to act on failures, only to report them. If the rua address lives on a different domain, that domain has to publish an authorization record, or many receivers will not send reports there. Give the reports a couple of weeks, long enough to catch monthly invoices, newsletters, and occasional system alerts. Then sort the sources into three groups:
  1. Your own mail servers and hosting servers. These should pass SPF directly.
  2. Third-party services sending with your domain in the envelope, such as a helpdesk, CRM, or a website's SMTP plugin pointed at an external relay. These need an include: or IP entry in SPF, or aligned DKIM, ideally both.
  3. Sources you do not recognize. Some are forwarders or mailing lists relaying real mail. Others are spoofing attempts, which is what you want to block.
The raw XML is readable by hand but tedious. Any parser or report viewer works, as long as you can see source IP, envelope domain, DKIM domain, and alignment side by side.
Here is the part that changes the decision. DMARC passes if either SPF or DKIM passes and aligns with the From: domain. For DMARC, softfail and fail are the same thing: SPF did not pass. If your domain has DMARC at p=quarantine or p=reject, a receiver that follows DMARC handles unaligned mail through that policy whatever your SPF qualifier says. So with a strong DMARC policy, -all adds little protection on top. What it can add is risk. Some receivers act on an SPF hard fail during the SMTP session, before DKIM and DMARC are evaluated. A message that would have passed DMARC through a valid DKIM signature is rejected anyway. The DMARC specification itself notes this interaction. Forwarding makes it worse. When a message is forwarded, for example from an old address to a personal mailbox, the forwarding server's IP is not in your SPF record, so SPF fails at the final hop. DKIM usually survives forwarding if the body and signed headers are not modified. Under ~all, DKIM can still carry the message through DMARC. Under -all, a receiver that rejects on SPF fail early never reaches that point. Without DMARC, the picture flips. The SPF qualifier is one of the few signals you are sending, and -all gives receivers a clearer instruction against spoofers. It also means any forgotten sender is treated as forged.
The decision falls out of the inventory and your DMARC state:
  • If you have no DMARC yet, publish p=none with reporting first, regardless of the SPF qualifier. Changing ~all to -all blind is the move that causes the breakage described at the start.
  • If the reports show unlisted senders using your domain in the envelope, stay on ~all until each one is added to SPF or signs with aligned DKIM.
  • If every legitimate source passes aligned DKIM and DMARC is at quarantine or reject, ~all is a reasonable rule of thumb. DMARC already does the enforcing, and you avoid early rejections of forwarded mail.
  • If the domain sends no mail at all, such as a parked domain, v=spf1 -all together with a DMARC p=reject record is the clean choice. There is no legitimate sender to break.
  • If you have a narrow, fully known set of senders and a reason to want hard fails, such as a domain that is a frequent spoofing target, -all is defensible once the reports have been clean for a while.
One more check before any change: count the DNS lookups. Each include:, a, mx, exists, and redirect costs a lookup, and SPF allows at most 10. Adding services one by one can push you over, and the result is a permerror that breaks SPF for everyone, regardless of the qualifier. After changing the record, verify it the same way you diagnosed it. Run the dig lookup to confirm the new value is live. Then send a message from each known source to a mailbox you control and read Authentication-Results on each. Keep watching the aggregate reports for a full reporting cycle so new failures show up before users report them. The takeaway is simple. The qualifier at the end of SPF is the least interesting part of your email authentication. Find out who sends as your domain, make each of them pass aligned DKIM, and let DMARC carry the enforcement. Once that is in place, ~all versus -all is a small, informed choice instead of the change that silently broke your invoices.

Join My Newsletter & Get Updates!

Get notified whenever a new technical guide, server infrastructure breakdown, or personal reflection goes live, plus a curated weekly digest.