<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Battle Hardened</title>
    <description>The latest articles on DEV Community by Battle Hardened (@battlehardened).</description>
    <link>https://dev.to/battlehardened</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3963526%2F4c4b1680-c461-4dae-aeef-9b4849ef6a7e.png</url>
      <title>DEV Community: Battle Hardened</title>
      <link>https://dev.to/battlehardened</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/battlehardened"/>
    <language>en</language>
    <item>
      <title>Why Your Email is an Open Door for Spammers -- And How to Lock It</title>
      <dc:creator>Battle Hardened</dc:creator>
      <pubDate>Tue, 02 Jun 2026 12:00:00 +0000</pubDate>
      <link>https://dev.to/battlehardened/why-your-email-is-an-open-door-for-spammers-and-how-to-lock-it-1k1n</link>
      <guid>https://dev.to/battlehardened/why-your-email-is-an-open-door-for-spammers-and-how-to-lock-it-1k1n</guid>
      <description>&lt;p&gt;&lt;em&gt;A practical guide to SPF, DKIM, DMARC, and Sieve filtering for anyone who owns a domain&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem Nobody Fixes
&lt;/h2&gt;

&lt;p&gt;Everyone complains about spam. It clogs inboxes, wastes time, and tricks enough people often enough that it remains wildly profitable for the people sending it. The numbers game works: send a billion emails, fool 0.01% of recipients, and you have 100,000 victims.&lt;/p&gt;

&lt;p&gt;Here's the uncomfortable truth: we have the tools to make a significant dent in this problem. They've existed for years. They're not complicated to implement. And the vast majority of domain owners — including many who absolutely should know better — haven't bothered.&lt;/p&gt;

&lt;p&gt;This isn't a technical limitation. It's a collective choice.&lt;/p&gt;

&lt;p&gt;This article explains what those tools are, why they work, why they're underused, and exactly how to configure them correctly. We'll walk through real-world examples using Cloudflare for DNS, then generalize to any provider.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Scope: this article is written primarily for personal domains and small deployments using a single outbound mail provider. Large enterprises and multi-sender environments have additional operational constraints — those are acknowledged throughout, but the primary audience is the domain owner running a single inbox who has no good excuse for weak defaults.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What Authentication Actually Does (And Doesn't Do)
&lt;/h2&gt;

&lt;p&gt;Before diving in, it's important to set expectations. Email authentication is not a spam filter. It does one specific thing: it proves that mail claiming to come from your domain actually came from your domain.&lt;/p&gt;

&lt;p&gt;That matters because a huge category of spam and phishing relies on spoofing — forging the sender address to make an email look like it came from someone trustworthy. Authentication closes that door.&lt;/p&gt;

&lt;p&gt;It does not stop a spammer who registers their own domain, sets up authentication correctly, and sends spam from there. A perfectly authenticated spam email is still spam. Content filtering handles that problem — and we'll get to that too.&lt;/p&gt;




&lt;h2&gt;
  
  
  If You Only Read One Section
&lt;/h2&gt;

&lt;p&gt;Three DNS records. That's the entire deployment. Everything else in this article explains why they matter and how to get them right.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Record&lt;/th&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;SPF (&lt;code&gt;‑all&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;TXT at &lt;code&gt;@&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Tells receivers which servers are authorized to send as your domain&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DKIM&lt;/td&gt;
&lt;td&gt;TXT at &lt;code&gt;selector._domainkey&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Cryptographically signs outgoing mail so tampering is detectable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DMARC &lt;code&gt;p=reject&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;TXT at &lt;code&gt;_dmarc&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Publishes your enforcement policy and ties SPF/DKIM to your visible From address&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Verify with &lt;a href="https://mail-tester.com" rel="noopener noreferrer"&gt;mail-tester.com&lt;/a&gt; after deploying. All three passing means you're done.&lt;/p&gt;

&lt;p&gt;Provider-specific setup guides for Google Workspace, Microsoft 365, Proton Mail, GoDaddy, Amazon SES, and Cloudflare are in the "Provider Setup Guides" section below. The rest of this article explains the why, the caveats, and the inbound filtering layer for those who want to go further.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Three Pillars
&lt;/h2&gt;

&lt;h3&gt;
  
  
  SPF — Sender Policy Framework
&lt;/h3&gt;

&lt;p&gt;SPF lets you publish a list of servers authorized to send mail from your domain. When a receiving mail server gets a message claiming to be from you, it checks your DNS records to see if the sending server is on your approved list.&lt;/p&gt;

&lt;p&gt;SPF lives in a DNS TXT record at your root domain and looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v=spf1 include:_spf.example.com -all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The critical part is the end: &lt;code&gt;-all&lt;/code&gt; means mail from unauthorized senders produces an SPF Fail result. Most receivers treat this as a strong rejection signal — but it's the receiver's policy, not SPF itself, that determines what happens next. In modern mail systems, SPF failures become significantly more meaningful when paired with DMARC alignment and enforcement — SPF alone is not sufficient to prevent spoofing of your visible From address. By contrast, &lt;code&gt;~all&lt;/code&gt; — softfail — signals "be suspicious but deliver it anyway." That's a weak default that essentially tells receivers the rule is optional.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For a personal domain or a single-provider setup, &lt;code&gt;-all&lt;/code&gt; should usually be your goal.&lt;/strong&gt; Large providers and enterprises often default to &lt;code&gt;~all&lt;/code&gt; for reasons beyond ignorance — support costs from broken outbound mail are real, and permissive authentication is operationally safer when you're not certain what's sending on your behalf. That's a defensible posture during discovery. It should be a waypoint, not a destination. On a domain you run out of a single inbox, you don't have that excuse.&lt;/p&gt;

&lt;p&gt;The argument against hardfail is that mail forwarding breaks SPF — when someone forwards your mail, the forwarding server's IP isn't on your approved list. This is true. But it's not a reason to use softfail indefinitely; it's a reason to also configure DKIM and DMARC, which handle forwarding correctly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common SPF mistakes:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using &lt;code&gt;~all&lt;/code&gt; (softfail) instead of &lt;code&gt;-all&lt;/code&gt; (hardfail)&lt;/li&gt;
&lt;li&gt;Using &lt;code&gt;mx&lt;/code&gt; to authorize senders — operationally convenient for simple setups, but it couples outbound authorization to inbound routing. If your MX records change, your SPF authorization changes too, sometimes unintentionally&lt;/li&gt;
&lt;li&gt;Exceeding the 10 DNS lookup limit by including too many third-party senders&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  DKIM — DomainKeys Identified Mail
&lt;/h3&gt;

&lt;p&gt;DKIM adds a cryptographic signature to every outgoing message. The receiving server looks up your public key in DNS and uses it to verify the signature. If the message was tampered with in transit, the signature breaks.&lt;/p&gt;

&lt;p&gt;More importantly for forwarding: where SPF fails on forwarded mail, DKIM generally passes — because the signature travels with the message. It isn't a 100% guarantee. Forwarders that aggressively rewrite subjects or inject security banners into the message body will still break the signature. But DKIM remains the primary safety net that makes a strict DMARC policy operationally viable, and modern forwarding infrastructure preserves it far better than older list software did.&lt;/p&gt;

&lt;p&gt;Modern large providers increasingly use ARC (Authenticated Received Chain) to preserve authentication context across forwarding hops and mailing lists. ARC doesn't replace DKIM or DMARC — it adds a chain of custody that lets receivers trust authentication results that would otherwise appear broken after redistribution. It's worth knowing the term exists if you're debugging forwarding failures, though for most personal domain operators it's infrastructure that works in the background rather than something you configure directly.&lt;/p&gt;

&lt;p&gt;DKIM is configured in two places:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your mail server generates a key pair and signs outgoing messages with the private key&lt;/li&gt;
&lt;li&gt;You publish the public key in DNS as a TXT record under a selector subdomain, like &lt;code&gt;cf2024-1._domainkey.yourdomain.com&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Your mail provider handles the signing. Your job is publishing the DNS record they give you.&lt;/p&gt;

&lt;h3&gt;
  
  
  DMARC — Domain-based Message Authentication, Reporting and Conformance
&lt;/h3&gt;

&lt;p&gt;DMARC is the piece that ties everything together and actually gives you enforcement.&lt;/p&gt;

&lt;p&gt;Without DMARC, receivers can see your SPF and DKIM results but have no instruction from you about what to do when they fail. DMARC lets you publish that policy.&lt;/p&gt;

&lt;p&gt;More importantly, DMARC checks &lt;em&gt;alignment&lt;/em&gt; — it verifies that the authenticated domain matches the visible &lt;code&gt;From:&lt;/code&gt; header that recipients actually see. SPF alone authenticates the envelope sender (the technical bounce address), which can differ from the From header. DMARC closes that gap.&lt;/p&gt;

&lt;p&gt;DMARC lives in a DNS TXT record at &lt;code&gt;_dmarc.example.com&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v=DMARC1; p=reject; sp=reject; adkim=r; aspf=r;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Breaking that down:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;p=reject&lt;/code&gt; — requests that receivers reject mail failing DMARC alignment&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sp=reject&lt;/code&gt; — apply the same policy to subdomains&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;adkim=r&lt;/code&gt; — relaxed DKIM alignment: the signing domain must match or be a subdomain of your From domain&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;aspf=r&lt;/code&gt; — relaxed SPF alignment: same requirement for SPF&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;A critical clarification on forwarding:&lt;/strong&gt; DMARC only requires &lt;em&gt;either&lt;/em&gt; SPF &lt;em&gt;or&lt;/em&gt; DKIM to align — not both. When mail is forwarded, SPF breaks because the forwarding server's IP isn't in your SPF record. But DKIM signatures travel with the message and survive forwarding intact. Because DKIM alignment still passes, DMARC passes too. This is the key reason &lt;code&gt;p=reject&lt;/code&gt; doesn't destroy forwarded mail — DKIM is the safety net.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A note on alignment modes:&lt;/strong&gt; The ecosystem default is relaxed alignment (&lt;code&gt;adkim=r; aspf=r&lt;/code&gt;), which allows subdomains to match — so &lt;code&gt;mail.yourdomain.com&lt;/code&gt; aligns with &lt;code&gt;yourdomain.com&lt;/code&gt;. Changing this to strict (&lt;code&gt;adkim=s; aspf=s&lt;/code&gt;) is a deliberate hardening step. Only do it if you are certain your provider isn't routing outbound mail through a tracking or bounce subdomain. Strict alignment is where many real-world deployments break unexpectedly — ESPs, marketing platforms, bounce-handling infrastructure, and Salesforce-style senders all commonly use subdomains that require relaxed to function.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The policy ladder:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;p=none&lt;/code&gt; — monitoring only, no enforcement. Useful temporarily when first setting up.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;p=quarantine&lt;/code&gt; — send failures to spam. A reasonable middle step.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;p=reject&lt;/code&gt; — requests that receivers reject mail failing DMARC alignment. This is the goal. Most major receivers honor it; a small number apply local overrides.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most domains that have DMARC at all are sitting on &lt;code&gt;p=none&lt;/code&gt; — which means they've done the paperwork but none of the work. It's the equivalent of posting a "no trespassing" sign with no fence.&lt;/p&gt;




&lt;h2&gt;
  
  
  Your Three Records — Right Now
&lt;/h2&gt;

&lt;p&gt;This is the complete configuration. Three DNS records. Everything else in this article is the why; this is the what.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Records
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;SPF&lt;/strong&gt; — TXT record at &lt;code&gt;@&lt;/code&gt; (your root domain)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v=spf1 include:_spf.example.com -all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace the include with what your mail provider specifies. The &lt;code&gt;-all&lt;/code&gt; at the end is yours to set — use it regardless of what your provider recommends.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DKIM&lt;/strong&gt; — TXT record at &lt;code&gt;selector._domainkey.yourdomain.com&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v=DKIM1; h=sha256; k=rsa; p=[key your provider gives you]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your provider generates this. Copy it exactly. Don't type it manually.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DMARC&lt;/strong&gt; — TXT record at &lt;code&gt;_dmarc.yourdomain.com&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v=DMARC1; p=reject; sp=reject; adkim=r; aspf=r;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the enforcement record. &lt;code&gt;p=reject&lt;/code&gt; is the goal — not &lt;code&gt;p=none&lt;/code&gt;, not &lt;code&gt;p=quarantine&lt;/code&gt;. Relaxed alignment (&lt;code&gt;r&lt;/code&gt;) is the safe default and works for most setups. If you are certain your provider sends from your exact root domain — not a subdomain — you can harden further with &lt;code&gt;adkim=s; aspf=s&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Provider Setup Guides
&lt;/h3&gt;

&lt;p&gt;Your mail provider gives you the SPF include string and DKIM key. Here's where to find them:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;Setup Documentation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Google Workspace&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://knowledge.workspace.google.com/admin/security/set-up-dmarc" rel="noopener noreferrer"&gt;Admin Console → Apps → Gmail → Authenticate Email&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Microsoft 365&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://learn.microsoft.com/en-us/defender-office-365/email-authentication-dmarc-configure" rel="noopener noreferrer"&gt;Security Portal → Email Auth Settings&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Proton Mail&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://proton.me/support/anti-spoofing-custom-domain" rel="noopener noreferrer"&gt;Settings → Domain Names → Review&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;GoDaddy Email&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://www.godaddy.com/help/add-spf-dkim-and-dmarc-to-my-domain-for-professional-email-42437" rel="noopener noreferrer"&gt;Email &amp;amp; Office Dashboard → Manage&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Amazon SES&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://docs.aws.amazon.com/ses/latest/dg/send-email-authentication-dkim.html" rel="noopener noreferrer"&gt;SES Console → Identities → Easy DKIM&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cloudflare + any provider&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Add records in DNS dashboard → DNS → Add Record&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites before adding DMARC:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SPF record must exist and be correct&lt;/li&gt;
&lt;li&gt;DKIM must be active and signing outbound mail&lt;/li&gt;
&lt;li&gt;Verify SPF and DKIM are passing on real outbound mail before enforcing DMARC — send a test message and check the headers or use mail-tester.com to confirm both are working&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Verify It Worked
&lt;/h3&gt;

&lt;p&gt;Once records propagate — usually minutes to an hour, though some providers cache aggressively and full propagation can occasionally take several hours depending on TTLs and recursive resolver behavior:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://mxtoolbox.com" rel="noopener noreferrer"&gt;MXToolbox&lt;/a&gt; — checks all three records&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://mail-tester.com" rel="noopener noreferrer"&gt;mail-tester.com&lt;/a&gt; — send a test email and get a score&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.dmarcanalyzer.com/spf/checker/" rel="noopener noreferrer"&gt;DMARC Analyzer&lt;/a&gt; — validates SPF specifically&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All green means you're done. One additional step worth taking: send a live email to a personal Gmail or Outlook account and check the raw headers ("View Original" in Gmail, "View Message Source" in Outlook). Confirm &lt;code&gt;dmarc=pass&lt;/code&gt; appears and that the alignment fields match your domain. mail-tester.com is an isolated test environment — real production alignment issues occasionally only surface in actual delivery.&lt;/p&gt;




&lt;h3&gt;
  
  
  Receive-Only Domains
&lt;/h3&gt;

&lt;p&gt;If a domain only receives mail and never sends, it's even simpler — no DKIM needed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SPF:   v=spf1 -all
DMARC: v=DMARC1; p=reject; sp=reject;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Why Most Domains Don't Do This
&lt;/h2&gt;

&lt;p&gt;This is worth understanding, because the technical setup is genuinely not hard.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The defaults are wrong.&lt;/strong&gt; Most mail providers auto-generate an SPF record with &lt;code&gt;~all&lt;/code&gt;. Most DNS providers don't prompt you to add a DMARC record. Most registrars don't mention authentication during domain setup. The path of least resistance leads to a weak configuration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The coordination problem is real but overused as an excuse.&lt;/strong&gt; The argument goes: if I enforce strictly, I might break legitimate forwarded mail, so I'll wait for everyone else to upgrade first. But everyone waits. The result is collective inaction dressed up as prudence.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The pain falls on others.&lt;/strong&gt; If your domain gets spoofed in a phishing campaign, the victims suffer — not you. The cost of doing nothing is externalized. That's a broken incentive structure, and it's why voluntary adoption has been slow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The big players have leverage they haven't fully used.&lt;/strong&gt; Google and Microsoft together handle a majority of the world's email. Their 2024 mandate requiring DKIM and DMARC for bulk senders moved more domains into compliance than a decade of documentation. But they stopped at &lt;code&gt;p=none&lt;/code&gt; — monitoring only. Extending that requirement to enforcement would change the ecosystem overnight.&lt;/p&gt;




&lt;h2&gt;
  
  
  A Real-World Configuration: Cloudflare
&lt;/h2&gt;

&lt;p&gt;Here's what a correct, strongly enforced configuration looks like for a domain using Cloudflare for DNS. The mail provider is irrelevant — these records are the same regardless of who hosts your mail.&lt;/p&gt;

&lt;h3&gt;
  
  
  DNS Records Required
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;SPF&lt;/strong&gt; (TXT record at &lt;code&gt;@&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v=spf1 include:_spf.example.com -all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your mail provider's documentation will give you the correct &lt;code&gt;include:&lt;/code&gt; value. Whatever they recommend for the rest of the record, the &lt;code&gt;-all&lt;/code&gt; at the end is your decision — use it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DKIM&lt;/strong&gt; (TXT record — your provider gives you this):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;selector._domainkey.yourdomain.com  →  v=DKIM1; h=sha256; k=rsa; p=[your public key]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your provider generates and manages your DKIM key. They'll give you the exact record to add. Copy it exactly as provided.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DMARC&lt;/strong&gt; (TXT record at &lt;code&gt;_dmarc&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v=DMARC1; p=reject; sp=reject; adkim=r; aspf=r;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  A Note on DMARC Reporting
&lt;/h3&gt;

&lt;p&gt;DMARC supports &lt;code&gt;rua&lt;/code&gt; and &lt;code&gt;ruf&lt;/code&gt; tags for aggregate and forensic reports:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v=DMARC1; p=reject; sp=reject; adkim=r; aspf=r; rua=mailto:dmarc@yourdomain.com;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These reports arrive as zipped XML files — a format that is, charitably, not user-friendly. Two types exist: aggregate (&lt;code&gt;rua&lt;/code&gt;) and forensic (&lt;code&gt;ruf&lt;/code&gt;). Aggregate reports are the operationally important ones — they show who is sending as your domain and whether legitimate mail is failing alignment. Forensic reports were designed to provide per-message failure detail, but many receivers have stopped sending them due to privacy concerns, and many providers ignore them entirely. Don't worry if forensic reports never arrive. Focus on aggregate. Services like Postmark's free DMARC monitoring tool or Dmarcian parse and visualize aggregate reports without requiring you to touch XML. If you won't monitor them during rollout or troubleshooting, they quickly become noise — but during initial setup, they're worth having.&lt;/p&gt;

&lt;h3&gt;
  
  
  What This Looks Like in Cloudflare
&lt;/h3&gt;

&lt;p&gt;In Cloudflare's DNS dashboard, your mail-related records should look like this:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Content&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;MX&lt;/td&gt;
&lt;td&gt;@&lt;/td&gt;
&lt;td&gt;mail.example.com&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TXT&lt;/td&gt;
&lt;td&gt;@&lt;/td&gt;
&lt;td&gt;v=spf1 include:_spf.example.com -all&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TXT&lt;/td&gt;
&lt;td&gt;selector._domainkey&lt;/td&gt;
&lt;td&gt;v=DKIM1; h=sha256; k=rsa; p=[key]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TXT&lt;/td&gt;
&lt;td&gt;_dmarc&lt;/td&gt;
&lt;td&gt;v=DMARC1; p=reject; sp=reject; adkim=r; aspf=r;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;A word on Cloudflare:&lt;/strong&gt; They cannot safely force aggressive enforcement defaults without breaking legacy setups — scanner-to-email appliances, forgotten SaaS integrations, automated billing systems. But they could implement proactive validation wizards that nudge users away from abandoned &lt;code&gt;p=none&lt;/code&gt; policies and warn about broken SPF topologies. That gap between what they do and what they could do is a product decision, not a technical limitation. If you use Cloudflare, it's worth providing feedback directly.&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Advanced filtering ahead.&lt;/strong&gt; Everything above this point is baseline domain security — SPF, DKIM, and DMARC apply to any domain owner regardless of mail client or provider. Everything below is optional advanced filtering for operators whose mail host exposes Sieve scripting. If your provider doesn't support Sieve, or you're not comfortable editing server-side scripts, the authentication stack above is sufficient.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Server-Side Spam Filtering with Sieve
&lt;/h2&gt;

&lt;p&gt;Authentication hardens your outbound identity. For inbound spam that passes authentication — because the spammer owns a legitimate domain — you need filtering.&lt;/p&gt;

&lt;p&gt;Sieve is a server-side mail filtering language supported by many mail hosts. It runs before mail reaches your device, which means filtering happens regardless of which client you use. Check your mail provider's documentation or support to see if they offer Sieve scripting — it is often available but not prominently advertised.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before deploying any &lt;code&gt;discard&lt;/code&gt; rules:&lt;/strong&gt; Start by routing suspect messages to Junk with &lt;code&gt;fileinto "Junk"&lt;/code&gt; instead of discarding them. Run that way for several days and confirm no legitimate mail is being caught. Only switch to &lt;code&gt;discard&lt;/code&gt; once you're confident the rules aren't silently blackholing invoices from a broken vendor or notifications from a system that signs its mail poorly. &lt;code&gt;discard&lt;/code&gt; is irreversible — the sender gets no bounce, you get no copy, and there's no way to recover the message.&lt;/p&gt;

&lt;p&gt;A practical Sieve script for aggressive inbound filtering:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sieve"&gt;&lt;code&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"fileinto"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"regex"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;# Discard mail flagged by server spam detection&lt;/span&gt;
&lt;span class="c1"&gt;# X-Junk-Flag is applied probabilistically by your mail host — false positives&lt;/span&gt;
&lt;span class="c1"&gt;# on financial mail or invoices are possible. Start with fileinto "Junk" here&lt;/span&gt;
&lt;span class="c1"&gt;# too until you've audited your environment for at least a week.&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;allof&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;header&lt;/span&gt; &lt;span class="o"&gt;:is&lt;/span&gt; &lt;span class="s2"&gt;"x-junk-flag"&lt;/span&gt; &lt;span class="s2"&gt;"YES"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;discard&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# Discard mail with no DKIM signature that also fails DMARC&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;allof&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nv"&gt;header&lt;/span&gt; &lt;span class="o"&gt;:contains&lt;/span&gt; &lt;span class="s2"&gt;"Authentication-Results"&lt;/span&gt; &lt;span class="s2"&gt;"dkim=none"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nv"&gt;header&lt;/span&gt; &lt;span class="o"&gt;:contains&lt;/span&gt; &lt;span class="s2"&gt;"Authentication-Results"&lt;/span&gt; &lt;span class="s2"&gt;"dmarc=fail"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;discard&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# Discard mail with a broken DKIM signature&lt;/span&gt;
&lt;span class="c1"&gt;# dkim=fail means DKIM was attempted but the signature didn't verify —&lt;/span&gt;
&lt;span class="c1"&gt;# the message body was modified after signing. Legitimate mail rarely&lt;/span&gt;
&lt;span class="c1"&gt;# does this. Start with fileinto "Junk" to review before switching to discard.&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;header&lt;/span&gt; &lt;span class="o"&gt;:contains&lt;/span&gt; &lt;span class="s2"&gt;"Authentication-Results"&lt;/span&gt; &lt;span class="s2"&gt;"dkim=fail"&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;discard&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# Discard mail with high spam scores (Rspamd &amp;gt;= 6.0)&lt;/span&gt;
&lt;span class="c1"&gt;# Regex matches any positive score of 6.0 or above (single or double digit).&lt;/span&gt;
&lt;span class="c1"&gt;# The ^ anchor ensures negative scores like -6.5 never match.&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;header&lt;/span&gt; &lt;span class="o"&gt;:regex&lt;/span&gt; &lt;span class="s2"&gt;"X-Rspamd-Score"&lt;/span&gt; &lt;span class="s2"&gt;"^([6-9]|[1-9][0-9])&lt;/span&gt;&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;discard&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Inbound Filtering: The Spam Score Dilemma&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Filtering on &lt;code&gt;X-Rspamd-Score&lt;/code&gt; exposes a gap in Sieve's standard tooling: the protocol lacks a native, universally supported way to handle decimal and negative numbers safely. Because highly trusted mail can receive a negative score (e.g., &lt;code&gt;-2.1&lt;/code&gt;), how you write this rule requires an engineering trade-off between precision, portability, and predictability. Here are the three approaches, ordered by preference for predictability over syntax elegance:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tier 1 — Regex (precise and robust):&lt;/strong&gt; The script above. The &lt;code&gt;^&lt;/code&gt; anchor ensures negative scores like &lt;code&gt;-6.5&lt;/code&gt; never match. Single clean rule, no edge cases.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Pro:&lt;/em&gt; Highly precise. Explicitly avoids negative numbers via string positioning anchors.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Con:&lt;/em&gt; The &lt;code&gt;regex&lt;/code&gt; extension is optional and not universally supported by all mail hosts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Tier 2 — String matching (highly portable, safe fallback):&lt;/strong&gt; Works on every Sieve implementation without extensions. Negative scores never match because &lt;code&gt;-&lt;/code&gt; doesn't appear in any of the patterns. Verbose but deterministic.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sieve"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;anyof&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nv"&gt;header&lt;/span&gt; &lt;span class="o"&gt;:contains&lt;/span&gt; &lt;span class="s2"&gt;"X-Rspamd-Score"&lt;/span&gt; &lt;span class="s2"&gt;"6."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nv"&gt;header&lt;/span&gt; &lt;span class="o"&gt;:contains&lt;/span&gt; &lt;span class="s2"&gt;"X-Rspamd-Score"&lt;/span&gt; &lt;span class="s2"&gt;"7."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nv"&gt;header&lt;/span&gt; &lt;span class="o"&gt;:contains&lt;/span&gt; &lt;span class="s2"&gt;"X-Rspamd-Score"&lt;/span&gt; &lt;span class="s2"&gt;"8."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nv"&gt;header&lt;/span&gt; &lt;span class="o"&gt;:contains&lt;/span&gt; &lt;span class="s2"&gt;"X-Rspamd-Score"&lt;/span&gt; &lt;span class="s2"&gt;"9."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nv"&gt;header&lt;/span&gt; &lt;span class="o"&gt;:contains&lt;/span&gt; &lt;span class="s2"&gt;"X-Rspamd-Score"&lt;/span&gt; &lt;span class="s2"&gt;"10."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nv"&gt;header&lt;/span&gt; &lt;span class="o"&gt;:contains&lt;/span&gt; &lt;span class="s2"&gt;"X-Rspamd-Score"&lt;/span&gt; &lt;span class="s2"&gt;"11."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nv"&gt;header&lt;/span&gt; &lt;span class="o"&gt;:contains&lt;/span&gt; &lt;span class="s2"&gt;"X-Rspamd-Score"&lt;/span&gt; &lt;span class="s2"&gt;"12."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nv"&gt;header&lt;/span&gt; &lt;span class="o"&gt;:contains&lt;/span&gt; &lt;span class="s2"&gt;"X-Rspamd-Score"&lt;/span&gt; &lt;span class="s2"&gt;"13."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nv"&gt;header&lt;/span&gt; &lt;span class="o"&gt;:contains&lt;/span&gt; &lt;span class="s2"&gt;"X-Rspamd-Score"&lt;/span&gt; &lt;span class="s2"&gt;"14."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nv"&gt;header&lt;/span&gt; &lt;span class="o"&gt;:contains&lt;/span&gt; &lt;span class="s2"&gt;"X-Rspamd-Score"&lt;/span&gt; &lt;span class="s2"&gt;"15."&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;discard&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Pro:&lt;/em&gt; Universal — works on every Sieve engine without extensions. Safe from negative score edge cases.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Con:&lt;/em&gt; Verbose and repetitive. Prioritizes deterministic behavior over code elegance. Double-digit scores above 15 require additional entries (uncommon in practice).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Tier 3 — Relational extension (unpredictable; use with caution):&lt;/strong&gt; The &lt;code&gt;relational&lt;/code&gt; extension with &lt;code&gt;i;ascii-numeric&lt;/code&gt; handles integer comparison cleanly for positive numbers. The RFC does not officially support negative numbers and leaves behavior with unparseable input implementation-defined.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sieve"&gt;&lt;code&gt;&lt;span class="k"&gt;require&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"relational"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"comparator-i;ascii-numeric"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;# Use with caution: behavior with negative Rspamd scores is engine-dependent&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;header&lt;/span&gt; &lt;span class="o"&gt;:value&lt;/span&gt; &lt;span class="s2"&gt;"ge"&lt;/span&gt; &lt;span class="o"&gt;:comparator&lt;/span&gt; &lt;span class="s2"&gt;"i;ascii-numeric"&lt;/span&gt; &lt;span class="s2"&gt;"X-Rspamd-Score"&lt;/span&gt; &lt;span class="s2"&gt;"6"&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;discard&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Pro:&lt;/em&gt; Clean single-line numeric comparison for positive scores.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Con:&lt;/em&gt; When encountering a negative score like &lt;code&gt;-1.5&lt;/code&gt;, behavior varies by implementation — some servers evaluate it as 0, others skip the comparison, others may log an error. The worst-case outcome is that a negative-scored message fails to match and lands in your inbox, which is correct behavior for clean mail anyway. The real risk is that this script may behave differently if you ever migrate mail providers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Recommendation:&lt;/strong&gt; Try Tier 1 first. If your provider doesn't support &lt;code&gt;regex&lt;/code&gt;, use Tier 2. Reserve Tier 3 only if neither of the above works, and document why.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why &lt;code&gt;discard&lt;/code&gt; instead of moving to Junk?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;discard&lt;/code&gt; silently drops the message with no response to the sender. This is preferable to bouncing or junking for two reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Any response — even a bounce — confirms your address exists, which is valuable to spammers sending speculatively&lt;/li&gt;
&lt;li&gt;Spam often uses forged return addresses, so a bounce lands in an innocent person's inbox, making you a source of collateral spam&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Understanding DKIM results:&lt;/strong&gt; There are three distinct outcomes worth knowing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;dkim=none&lt;/code&gt; — the message carries no DKIM signature at all. Combined with a DMARC fail, this is a strong spam signal.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dkim=fail&lt;/code&gt; — DKIM was attempted but the signature didn't verify. This means the message body was modified after signing. Things that legitimately break DKIM include old mailing list software, enterprise security gateways that append disclaimers, "safe links" URL rewriting, and MIME normalization bugs. For a personal domain not participating in legacy mailing lists or enterprise forwarding chains, &lt;code&gt;dkim=fail&lt;/code&gt; is a strong spam signal.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dkim=pass&lt;/code&gt; — the signature verified correctly. This proves the message wasn't tampered with in transit, but says nothing about whether the content is spam.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Rollout recommendation for &lt;code&gt;dkim=fail&lt;/code&gt;:&lt;/strong&gt; Before setting it to &lt;code&gt;discard&lt;/code&gt;, run it as &lt;code&gt;fileinto "Junk"&lt;/code&gt; for a few days to confirm no legitimate mail is being caught. Once satisfied, switch to &lt;code&gt;discard&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A note on header portability:&lt;/strong&gt; The Sieve rules above match against &lt;code&gt;Authentication-Results&lt;/code&gt; header strings as they appear in real headers from a specific mail host. Different providers format these headers differently — some normalize them, some rewrite them, some strip upstream authentication results entirely. Before deploying any of these rules, send yourself a few test messages and inspect the raw headers your provider actually produces. The string patterns in your Sieve script need to match what your provider writes, not what the RFC says they should write.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A note on Rspamd score thresholds:&lt;/strong&gt; The threshold of 6.0 is a reasonable starting point. Monitor for false positives and adjust up or down based on what you see. Scores vary by provider — what Rspamd considers a 6 on one system may differ slightly from another.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Sieve won't catch:&lt;/strong&gt; Sophisticated spam from authenticated domains with low spam scores. This is the hardest category — mail that passes every technical check because the sender set everything up correctly and keeps content just below detection thresholds. Apple Mail, Outlook, and dedicated tools like SpamSieve use content analysis and learned patterns to catch these. Sieve and client-side filtering work best as complementary layers.&lt;/p&gt;




&lt;h2&gt;
  
  
  When Softer Settings Are Legitimate
&lt;/h2&gt;

&lt;p&gt;This article advocates for the strongest settings — SPF with &lt;code&gt;-all&lt;/code&gt; enforcement semantics (commonly called hardfail), strict DMARC enforcement, DKIM signing. For most home users and hobbyists with a single mail provider, those settings are correct and there is no good reason not to use them.&lt;/p&gt;

&lt;p&gt;There are, however, legitimate scenarios where softer settings reflect a genuine operational constraint rather than inaction:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mailing lists and list software.&lt;/strong&gt; Software like Mailman often rewrites message headers or strips DKIM signatures when redistributing mail to subscribers. This breaks DMARC alignment. Organizations running high-volume mailing lists sometimes stay on &lt;code&gt;p=quarantine&lt;/code&gt; or &lt;code&gt;p=none&lt;/code&gt; to avoid breaking list delivery for their users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Complex forwarding infrastructure.&lt;/strong&gt; If your domain uses a third-party forwarding service to redirect mail to another address, the forwarding server's IP won't be in your SPF record, and DKIM may not survive the forward intact. This is a real constraint that requires careful handling before moving to strict enforcement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Large enterprises with many third-party senders.&lt;/strong&gt; A company using Salesforce, Marketo, a ticketing system, a payment processor, and an HR platform — all sending mail as their domain — needs to audit every one of those senders before enforcing DMARC. Moving to &lt;code&gt;p=reject&lt;/code&gt; before that audit is complete means silently dropping legitimate business mail. &lt;code&gt;p=none&lt;/code&gt; during that audit period is the correct approach; the problem is that the audit period often becomes permanent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Domains mid-migration.&lt;/strong&gt; &lt;code&gt;p=none&lt;/code&gt; is the right starting point when you genuinely don't know all your sending sources. The DMARC policy ladder — none → quarantine → reject — exists for a reason. The mistake is treating &lt;code&gt;p=none&lt;/code&gt; as a destination rather than a waypoint.&lt;/p&gt;

&lt;p&gt;None of these apply to a home user or hobbyist running a single domain with one mail provider. If you send mail through exactly one service and receive reports that everything is working, there is no technical justification for softfail SPF or &lt;code&gt;p=none&lt;/code&gt; DMARC. The exceptions are real, but they belong to a specific category of organizational complexity that most readers of this article don't have.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Ceiling
&lt;/h2&gt;

&lt;p&gt;With SPF &lt;code&gt;-all&lt;/code&gt;, DKIM, DMARC &lt;code&gt;p=reject&lt;/code&gt;, and Sieve filtering in place, you've hit the ceiling of what the email authentication protocol allows. You will still receive some spam — the sophisticated kind, from properly authenticated domains with low spam scores. That's not a failure of your configuration; it's the unsolved remainder of a problem the entire industry is still working on.&lt;/p&gt;

&lt;p&gt;What you've done is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prevented straightforward spoofing of your domain at receivers that honor DMARC enforcement&lt;/li&gt;
&lt;li&gt;Discarded the majority of inbound spam before it reaches your device&lt;/li&gt;
&lt;li&gt;Configured your domain better than most commercial organizations bother to&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The configuration in this article was applied to a real personal domain in a single afternoon. Inbound spam dropped by over 160 messages per day — and that's counting only what reached the server. An unknown larger number was discarded silently before it ever arrived. The spam that still gets through is the sophisticated, fully authenticated kind that the entire industry hasn't solved yet. It goes to Junk. It doesn't reach the inbox.&lt;/p&gt;

&lt;p&gt;The tools exist. The setup takes an afternoon. The frustrating part is that this works remarkably well for preventing domain spoofing and cutting down low-quality inbound spam — and most people still won't do it.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>howto</category>
    </item>
  </channel>
</rss>
