Suped

What is the difference between '-all' and '?all' in SPF?

Matthew Whittaker profile picture
Matthew Whittaker
Co-founder & CTO, Suped
Published 3 Mar 2025
Updated 22 Oct 2025
6 min read
Illustration of an email envelope with a question mark and a minus sign, symbolizing SPF qualifiers.
Email authentication protocols like SPF (Sender Policy Framework) are essential for ensuring your emails reach their intended recipients and protecting your domain from spoofing. An SPF record published in your DNS specifies which mail servers are authorized to send email on behalf of your domain. At the heart of this record are mechanisms that tell receiving servers how to handle emails coming from unauthorized sources.
Among the most crucial parts of an SPF record are the qualifiers that define the policy for unlisted sending IP addresses. Specifically, '-all' and '?all' are two common, yet fundamentally different, qualifiers that dictate how strictly receiving mail servers should treat emails that fail SPF checks.
Understanding the distinction between these two 'all' mechanisms is vital for anyone managing email deliverability and security. Choosing the wrong one can either leave your domain vulnerable to impersonation or cause legitimate emails to be rejected. Let's delve into what each qualifier means and when to use them.

Understanding SPF qualifiers

Understanding SPF qualifiers

Before we dive into '-all' and '?all', it helps to understand the general concept of SPF qualifiers. Every SPF mechanism, including all, can be prefixed by a qualifier that tells the receiving server how to interpret a match or non-match. The all mechanism itself is a catch-all, meaning it applies to any sending IP address not explicitly covered by the preceding mechanisms in the SPF record.
There are four standard SPF qualifiers, each with a distinct meaning. These qualifiers are crucial in defining your domain's email sending policy. For a comprehensive overview of how these work, you can refer to a guide on what SPF all qualifiers mean.
  1. '+': Pass (default). If no qualifier is specified, this is assumed.
  2. '-': Hard Fail. The email should be rejected.
  3. '~': Soft Fail. The email should be accepted but marked as suspicious.
  4. '?': Neutral. No policy is explicitly stated, so the email is accepted.
Example SPF record structureDNS
v=spf1 include:_spf.example.com ip4:192.0.2.1 -all

The hard fail: '-all'

The hard fail: '-all'

The '-all' mechanism (often pronounced "minus all" or "dash all") is the most stringent SPF qualifier. When a receiving mail server encounters '-all' in your SPF record, it means that any email originating from an IP address not explicitly listed or authorized by other mechanisms in the record should be treated as a hard fail. This typically results in the email being rejected or bounced.
Using '-all' provides the strongest protection against email spoofing and phishing attacks, as it explicitly tells receiving servers to reject unauthorized mail. However, it requires precise configuration. If your SPF record does not accurately list all legitimate sending sources, emails from those unlisted sources will be rejected, even if they are legitimate.
This strong stance makes '-all' the preferred qualifier once your domain has a solid understanding of all its email sending sources. It’s particularly effective when paired with a DMARC policy set to p=reject, as it gives clear instructions to receiving servers. You might want to consider should you be concerned about '-all' if you are unsure.

The neutral qualifier: '?all'

The neutral qualifier: '?all'

In stark contrast, the '?all' mechanism (question mark all) indicates a neutral policy. This means that if an email comes from an IP address not listed in your SPF record, the receiving server should treat it as if no policy exists. Essentially, it doesn't give any instruction to reject or flag the email as suspicious; it simply says, "I don't have an opinion on this sender."
While '?all' ensures that no legitimate emails will be rejected due to SPF failures, it offers virtually no protection against spoofing. Any attacker can send emails impersonating your domain, and receiving servers configured only with SPF will likely accept them. This lack of enforcement means that your domain remains vulnerable.
For this reason, '?all' is rarely recommended for active sending domains. Its primary use case is typically during initial SPF record setup or for domains that do not send email at all, where it serves as a placeholder or a very relaxed policy. It can also be a starting point when you are beginning your DMARC journey with a p=none policy to gather data without impacting deliverability.

Comparing '-all' and '?all'

Comparing '-all' and '?all'

The choice between '-all' and '?all' is a trade-off between strict security and maximum deliverability. While '-all' offers robust protection, it carries the risk of legitimate emails being blocked if your SPF record is incomplete. Conversely, '?all' ensures deliverability but sacrifices security, leaving your domain open to abuse. For a deeper look into which is better, explore our article on SPF ~all vs -all.

'-all': Hard fail

  1. Security: Highest level of protection against spoofing and phishing.
  2. Deliverability: Risks legitimate emails being rejected if SPF record is inaccurate.
  3. Use case: Recommended for domains actively protected by DMARC p=reject.

'?all': Neutral

  1. Security: No protection against spoofing. Emails treated as neutral.
  2. Deliverability: All emails will be delivered, regardless of authorization.
  3. Use case: For domains not sending email or during initial DMARC implementation with p=none.

Best practices and DMARC integration

Best practices and DMARC integration

For domains committed to strong email security, the ultimate goal is to transition to '-all' in your SPF record, alongside a robust DMARC policy. DMARC (Domain-based Message Authentication, Reporting, and Conformance) builds upon SPF and DKIM to provide comprehensive protection and reporting. It's the most effective way to protect your domain from impersonation and ensure your emails are delivered correctly.
Illustration of a shield protecting an email, representing strong email security through DMARC.
When implementing DMARC, many organizations start with a p=none policy and an SPF record using '~all' (soft fail). This allows them to monitor email traffic and identify all legitimate sending sources without impacting deliverability. Once all legitimate sources are identified and authorized, they can then safely transition to quarantine or reject with their DMARC policy and set SPF to '-all'. This phased approach minimizes risks and ensures continuous email flow.
For monitoring SPF and DMARC, tools like suped.com logoSuped provide comprehensive insights. Our platform offers DMARC monitoring with AI-powered recommendations to simplify complex issues. We also offer SPF flattening and real-time alerts to proactively manage your email security. Learning more about SPF qualifiers and their usage is key to maintaining a robust email infrastructure.

Choosing the right qualifier

Choosing the right qualifier

The choice between '-all' and '?all' in SPF records boils down to your domain's security posture and its stage in email authentication implementation. While '?all' offers no real protection, '-all' provides critical security against spoofing when correctly implemented. Always aim to move towards a more restrictive policy, ideally managed and monitored through DMARC.

Frequently asked questions

DMARC monitoring

Start monitoring your DMARC reports today

Suped DMARC platform dashboard

What you'll get with Suped

Real-time DMARC report monitoring and analysis
Automated alerts for authentication failures
Clear recommendations to improve email deliverability
Protection against phishing and domain spoofing