Should I use ~all or -all in my SPF record?

Summary

The consensus is that the choice between '~all' (soft fail) and '-all' (hard fail) in an SPF record hinges primarily on DMARC implementation. When DMARC is correctly configured with a 'reject' policy, the choice becomes less critical, as DMARC handles SPF failures. Without DMARC, the decision requires more nuance. '-all' offers stricter security by instructing receiving servers to reject unauthorized emails, but risks blocking legitimate emails if SPF is misconfigured. '~all' is more forgiving, accepting emails but potentially marking them as spam. Some experts recommend starting with '~all' for safety. It's also crucial to remember that SPF only prevents forgery of the envelope sender address and doesn't address all forms of spoofing. Therefore, SPF is a component of a broader email authentication strategy, and publishing an SPF record is generally considered a best practice.

Key findings

  • DMARC Dominance: DMARC with a 'reject' policy makes the '~all' vs. '-all' decision less impactful.
  • Hard vs. Soft Fail Defined: '-all' rejects failing emails; '~all' accepts but may mark as spam.
  • Configuration Risks: Misconfigured SPF with '-all' can lead to legitimate email rejections.
  • SPF Limitations: SPF solely addresses envelope sender forgery, not all types of spoofing.
  • Best Practice: Publishing an SPF record is a generally accepted best practice.

Key considerations

  • DMARC Prioritization: Implement and correctly configure DMARC (especially 'reject' policy).
  • SPF Accuracy: Ensure SPF record accuracy to avoid unintended consequences from '-all'.
  • Start with '~all'?: Consider beginning with '~all' as a safer starting point.
  • Comprehensive Authentication: View SPF as part of a wider email authentication strategy (DKIM, DMARC).
  • Testing is Essential: Test and monitor SPF setup to avoid deliverability issues.

What email marketers say
8Marketer opinions

The choice between using '~all' (soft fail) and '-all' (hard fail) in an SPF record depends largely on whether DMARC is implemented and configured correctly. '-all' instructs receiving servers to reject emails that fail SPF, offering stricter security but risking deliverability issues if SPF is misconfigured. '~all' is more lenient, allowing emails to be accepted but potentially marked as spam. With DMARC properly configured (especially with a 'reject' policy), the choice becomes less critical as DMARC dictates how SPF failures are handled. Experts recommend prioritizing proper DMARC setup and thorough testing of SPF configurations. Some favor '~all' initially for safety, while others advocate for '-all' for stronger authentication once confident in their SPF setup.

Key opinions

  • Hard vs. Soft Fail: -all (hard fail) rejects emails failing SPF; ~all (soft fail) accepts but may mark as spam.
  • DMARC Impact: With DMARC 'reject' policy, the choice between ~all and -all is less critical.
  • Configuration Matters: Misconfigured SPF with -all can cause legitimate emails to be rejected.
  • Initial Setup Recommendation: Starting with ~all provides a safety net during initial SPF setup.

Key considerations

  • DMARC Implementation: Ensure DMARC is properly configured to handle SPF failures effectively.
  • SPF Accuracy: Thoroughly test and monitor SPF configuration to avoid deliverability issues with -all.
  • Security vs. Deliverability: Balance the need for stricter security (-all) with the risk of blocking legitimate emails.
  • Host Requirements: Some email hosts may have specific requirements or behaviors regarding SPF policies.
Marketer view

Email marketer from Mailhardener shares that using '-all' can potentially cause issues with legitimate email if SPF is not perfectly configured. '~all' is more forgiving but might result in more spam reaching inboxes if DMARC is not in place. They recommend proper testing and monitoring when implementing SPF.

December 2024 - Mailhardener
Marketer view

Email marketer from StackOverflow answers that '~all' provides a safety net, allowing for potential misconfigurations without immediately blocking legitimate emails, while '-all' is stricter and ensures that only authorized sources are accepted. Recommends starting with '~all' and transitioning to '-all' once confident in the SPF setup.

July 2023 - StackOverflow
Marketer view

Email marketer from EasyDMARC explains that '-all' is a hard fail, telling receiving servers to reject emails that don't pass SPF. '~all' is a soft fail, telling receiving servers to accept the email but mark it, usually as spam. They suggest considering DMARC implementation, as it can override SPF results.

May 2022 - EasyDMARC
Marketer view

Email marketer from MXToolbox explains that '~all' (Soft Fail) is a more lenient setting for your SPF record. If the receiving server sees an email from your domain that fails SPF, it will still accept the message. The server may mark it as spam or junk. '-all' (Hard Fail) option gives a clear directive: reject emails from sources not listed in the SPF record. This offers a more secure and explicit declaration of your authorized sending sources.

October 2021 - MXToolbox
Marketer view

Email marketer from EmailonAcid shares the importance of making sure your SPF record is set up correctly. If you have a DMARC record that tells email providers to reject email that doesn't authenticate, it doesn't matter which option you use for your SPF record. If you don't have DMARC, they say to use -all.

January 2024 - EmailonAcid
Marketer view

Email marketer from Email Geeks shares that they favor ~ALL (softfail) because they’ve seen some email hosts (web hosting services in particular) that abruptly start honoring -ALL (hardfail) which can make legit mail fail if everything isn’t squared away.

August 2021 - Email Geeks
Marketer view

Email marketer from Reddit suggests that in modern email setups with DMARC, the choice between '~all' and '-all' is less critical. If DMARC is properly implemented with a policy of 'reject', the DMARC policy will handle SPF failures. Therefore, focus should be on ensuring DMARC is correctly configured.

December 2021 - Reddit
Marketer view

Email marketer from AuthSMTP explains that -all will hard fail, with the intent that the email should be rejected, whilst ~all is a 'soft fail', meaning that the email should be accepted but may be flagged in some way, for example it may be sent to the recipient's spam folder. -all is recommended.

January 2023 - AuthSMTP

What the experts say
5Expert opinions

The choice between '~all' and '-all' in an SPF record is less critical when DMARC with a 'reject' policy is implemented; in this scenario, '~all' is often preferred. Without DMARC, the decision is more complex, with some still favoring '-all'. While SPF helps prevent forgery of the envelope sender address, it doesn't prevent all types of spoofing and is just one component of a comprehensive email authentication strategy. Publishing an SPF record is now considered a best practice.

Key opinions

  • DMARC Impact: DMARC p=reject makes the choice between '~all' and '-all' less significant.
  • No DMARC: Without DMARC, the decision between '~all' and '-all' requires more consideration; some prefer '-all'.
  • SPF Scope: SPF prevents envelope sender forgery but not all spoofing methods.
  • Best Practice: Publishing an SPF record is now a recommended best practice.

Key considerations

  • DMARC Configuration: Prioritize implementing and correctly configuring DMARC, especially with a 'reject' policy.
  • Spoofing Protection: Understand that SPF alone does not provide complete protection against spoofing.
  • Authentication Strategy: View SPF as one part of a broader email authentication and security strategy.
  • Testing: Ensure your setup doesn't cause issues.
Expert view

Expert from Word to the Wise explains that SPF prevents forgery of the envelope sender address, which is used for bounce processing. It does not prevent display name spoofing, content spoofing, or reply-to spoofing. She concludes that SPF is a piece of the puzzle, but not the whole answer.

July 2021 - Word to the Wise
Expert view

Expert from Email Geeks explains that SPF does not prevent spoofed emails and publishing SPF records is now a best practice.

January 2023 - Email Geeks
Expert view

Expert from Email Geeks explains that if DMARC p=reject is implemented, ~all is probably the way to go. If not, then it’s a more complex discussion, but they still vote for -all.

July 2023 - Email Geeks
Expert view

Expert from Spam Resource explains that if you have implemented DMARC p=reject, ~all is probably the way to go. If not, then it’s a more complex discussion, but they still vote for -all.

June 2021 - Spam Resource
Expert view

Expert from Email Geeks responds that it doesn’t really matter whether to use “~all” or “-all” in an SPF record and tends to recommend ~all out of habit.

January 2023 - Email Geeks

What the documentation says
4Technical articles

The documentation indicates that '-all' (hard fail) in an SPF record tells receiving servers to reject emails that fail SPF checks, signifying that the sender is not authorized. '~all' (soft fail) instructs servers to accept such emails but potentially mark them as suspicious. The significance of this choice diminishes with DMARC adoption, as DMARC policies then govern SPF failure handling. RFC 7208 specifies the technical details of the 'all' mechanism and its qualifiers. Microsoft documentation adds that '~all' provides leniency for misconfigurations, while '-all' is a stricter declaration. Therefore, DMARC implementation becomes a key consideration.

Key findings

  • Hard Fail vs Soft Fail: '-all' rejects emails failing SPF; '~all' accepts but may flag as suspicious.
  • DMARC Supersedes: DMARC configuration largely determines the handling of SPF failures.
  • RFC Specification: RFC 7208 defines technical details of the 'all' mechanism.
  • Lenient vs Strict: '~all' is lenient for potential misconfigurations; '-all' is a stricter declaration.

Key considerations

  • Implement DMARC: Ensure DMARC is implemented to effectively manage email authentication.
  • SPF Accuracy: Maintain an accurate SPF record to avoid false rejections with '-all'.
  • Testing and Monitoring: Monitor email deliverability after SPF configuration changes.
  • Understand Implications: Know the implications of hard vs soft fail on deliverability and security.
Technical article

Documentation from Google Workspace Admin Help explains that -all (Fail) indicates that emails from a domain that do not match the SPF record should be rejected. ~all (Softfail) indicates that emails from a domain that do not match the SPF record should be accepted but marked.

August 2024 - Google Workspace Admin Help
Technical article

Documentation from RFC 7208 defines the 'all' mechanism in SPF records. It explains that 'all' always matches and can be qualified with '+', '-', '~', or '?' to specify the desired result. '-all' results in a 'fail' result, while '~all' results in a 'softfail' result. This document highlights the technical specifications of the 'all' mechanism.

April 2024 - RFC Editor
Technical article

Documentation from Microsoft explains that a hard fail in SPF records (-all) instructs recipient servers to reject messages that fail SPF authentication. This indicates the domain owner has explicitly stated that the server is not authorized to send emails on behalf of the domain. A soft fail (~all) instructs recipient servers to accept messages that fail SPF authentication but mark or treat them as suspicious. This provides a more lenient approach, allowing for potential misconfigurations or legitimate senders not yet included in the SPF record. They also state that DMARC can use SPF results as part of its authentication checks.

October 2024 - Microsoft
Technical article

Documentation from DMARC.org explains that the practical difference between ~all and -all has diminished with the adoption of DMARC. With DMARC properly configured, the DMARC policy dictates the handling of SPF failures, making the choice less critical. It recommends ensuring DMARC is implemented correctly.

June 2021 - DMARC.org