SPF, DKIM and DMARC: Why Your Email Goes to Spam

SPF, DKIM and DMARC checks sending an email to the inbox or the spam folder

If your email keeps landing in spam, or someone has been sending mail that looks like it came from your company, the cause is usually three DNS records: SPF, DKIM and DMARC. Here is what each one actually does, in plain English, with the technical detail tucked into boxes you can skip.

Email & Productivity
Plain English, with deeper dives for IT staff

Three small records in your domain’s DNS decide whether the rest of the internet trusts your email. SPF, DKIM and DMARC are not optional extras any more. Since 2024, Gmail, Yahoo and Outlook.com have all made some version of them a condition of delivery, and the mail that fails quietly ends up in junk folders instead of inboxes.

The good news is that the idea behind each one is simple. You do not need to understand DNS to follow it. Each section below starts in plain language, then offers a collapsible box with the real technical detail for whoever administers your domain.

Email Was Built Without an ID Check

When email was designed, there was no way to prove who sent a message. A sending server simply announced which address the mail was from, and the receiving server believed it. That is still how the underlying protocol works.

Which means anyone, anywhere, can type your company’s address into the “From” line and send mail as you. No password required. No access to your mailbox needed. This is why a customer sometimes calls to ask about an invoice you never sent.

SPF, DKIM and DMARC are the three layers that were bolted on afterwards to fix this. They are published as records in your domain’s DNS, which is the public phone book for your domain name, so any receiving mail server in the world can look them up and check your mail against them.

A MESSAGE ARRIVES SPF Did this come from an approved server? DKIM Is the signature still intact? DMARC Do either of those match the From line you see? Deliver, quarantine or reject, as the domain owner asked
The three checks run in that order. SPF and DKIM each answer one narrow question. DMARC is the only one of the three that looks at the address your recipient actually sees.

SPF, DKIM and DMARC in Plain English

SPF: the approved sender list

SPF is a list of the mail servers allowed to send on your behalf. You publish it, and a receiving server checks the incoming connection against it. If a message arrives from somewhere that is not on your list, the receiver knows the mail did not come from your mail system.

Think of it as leaving a guest list at the front desk. The desk does not verify who anyone claims to be, it only checks whether they are on the list.

Most small businesses need one SPF record that covers their mail platform, plus whatever else sends on their behalf: an accounting system that emails invoices, a marketing platform, a web form on the company website.

▸ For IT: how SPF actually works

SPF is defined in RFC 7208. The record is published as a DNS TXT record and nothing else: section 3.1 states that “SPF records MUST be published as a DNS TXT (type 16) Resource Record (RR) only”, and that use of alternative RR types “has been discontinued”. If you still have a legacy type 99 SPF record, it is doing nothing.

What it evaluates. Section 2.2 states that “The ‘MAIL FROM’ and ‘HELO’ identities are checked”. The MAIL FROM identity is the envelope sender (RFC5321.MailFrom), which is not the header your recipient reads. Checking other identities against an SPF version 1 record is described as “NOT RECOMMENDED”.

Qualifiers are + pass, - fail, ~ softfail and ? neutral, with + as the default when omitted. Microsoft recommends -all (hard fail) for Microsoft 365 domains.

The limits that break real records:

  • Ten DNS-querying terms, total. Section 4.6.4 requires implementations to “limit the total number of those terms to 10 during SPF evaluation” and to return permerror if the limit is exceeded. The terms that count are include, a, mx, ptr, exists and the redirect modifier. all, ip4, ip6 and exp do not count. The limit is global across the whole evaluation, including everything pulled in by nested includes, which is why adding one more vendor can silently break a working record.
  • Void lookups. Implementations “SHOULD limit void lookups to two”, and exceeding that also produces permerror.
  • One record only. Section 3 states that “multiple SPF records are not permitted for the same owner name”, and section 4.5 specifies that more than one surviving record makes the check produce permerror. Two SPF records do not merge. They fail.
  • Size. Section 3.4 advises keeping the DNS answer within 512 octets, and the record itself under 450 octets.

Microsoft 365. Microsoft’s guidance is v=spf1 include:spf.protection.outlook.com -all, with each sending subdomain needing its own record, and parked domains publishing v=spf1 -all. Microsoft notes there are no admin portal or PowerShell tools for managing SPF records, since they live in DNS.

DKIM: the tamper-evident seal

DKIM adds a cryptographic signature to every message your mail system sends. The matching key is published in your DNS, so a receiving server can verify two things: that the signature was applied by someone holding your domain’s private key, and that the message has not been altered since.

Think of it as a wax seal on an envelope. Anyone can check the seal is genuine and unbroken without needing to ask you.

Unlike SPF, a DKIM signature travels with the message. That matters, because it is the layer most likely to survive when mail is forwarded.

▸ For IT: how DKIM actually works

DKIM is defined in RFC 6376 (September 2011), which is an Internet Standard, part of STD 76. It has been updated four times since: RFC 8301, RFC 8463, RFC 8553 and RFC 8616.

What it claims, and what it does not. The abstract says DKIM “permits a person, role, or organization that owns the signing domain to claim some responsibility for a message”. Section 1.5 is blunter: verifying the signature “asserts that the hashed content has not changed since it was signed and asserts nothing else”. It is a responsibility claim plus an integrity check, not proof of who wrote the message. Section 1.2 states that DKIM “separates the question of the identity of the Signer of the message from the purported author”.

Where the key lives. A TXT record at <selector>._domainkey.<domain>, carrying v=DKIM1 and the public key in p=. An empty p= value means the key has been revoked.

Selectors exist, per section 3.1, “To support multiple concurrent public keys per signing domain”. That is how one domain can have several signing services and how keys get rotated: publish the new key alongside the old, switch signing over, then remove the old one. The RFC warns that “Signers are ill-advised to reuse selectors for new keys”.

The From header must be signed. Section 5.4 requires it: “The From header field MUST be signed (that is, included in the ‘h=’ tag of the resulting DKIM-Signature header field).” If h= omits From, section 6.1.1 requires the verifier to ignore the signature entirely. Note that the d= signing domain itself is not required to match the From address; section 1.2 says the signing identity “is not required to match an address in any particular header field”. That gap is exactly what DMARC was created to close.

Avoid the l= tag. It limits how much of the body is covered by the signature. Section 8.2 warns that using it “enables attacks in which an intermediary with malicious intent can modify a message to include content that solely benefits the attacker”, and advises that “Signers should be extremely wary of using this tag”. Section 5.4.1 adds that it provides “an avenue for unauthorized addition of text to a message”, and that l=0 permits “complete alteration of the text of the message without invalidating the signature”.

Algorithms and key sizes. RFC 8301 is the one to go by: “rsa-sha1 MUST NOT be used for signing or verifying”, “Signers MUST use RSA keys of at least 1024 bits for all keys”, and “Signers SHOULD use RSA keys of at least 2048 bits”. Verifiers must handle 1024 to 4096 bits and must not treat anything under 1024 bits as valid. RFC 8463 added Ed25519-SHA256 as an additional signing method. Google states separately that sending to personal Gmail accounts requires a DKIM key of 1024 bits or longer, and recommends 2048.

Microsoft 365 specifics. Mail from the onmicrosoft.com domain is signed automatically, but Microsoft states that “Currently, no DKIM signing occurs for outbound mail from custom domains”, so your real domain needs DKIM turned on explicitly. Setup publishes two CNAMEs, at selector1._domainkey and selector2._domainkey, and Microsoft notes there is currently no automatic key rotation for the onmicrosoft.com domain. Get the exact target values from the Defender portal rather than copying an example, because the pattern changed for domains added from May 2025.

Fragility. Section 3.4 acknowledges that “Some mail systems modify email in transit, potentially invalidating a signature”. A mailing list that appends a footer is the classic case.

DMARC: the instructions and the reports

SPF and DKIM each produce a result, but neither says what a receiving server should do about it, and neither one looks at the address your recipient actually sees in their mail client. DMARC fixes both gaps.

DMARC does two jobs. First, it tells receiving servers what to do with mail that claims to be from you but fails the other two checks: nothing, treat it as suspicious, or refuse it. Second, and this is the part most people never switch on, it asks those servers to send you reports about mail using your domain name. Those reports are how you discover a system you forgot was sending mail, or someone else sending as you.

Think of it as the note you leave with the guest list that says what to do when someone is not on it, plus a request for the visitor log.

▸ For IT: how DMARC actually works

Worth knowing before you read anything else on this: DMARC was re-published in May 2026 as RFC 9989, on the Standards Track, and it “obsoletes RFCs 7489 and 9091”. A great deal of DMARC material online still describes RFC 7489, which is now historical.

Alignment is the whole point. DMARC takes the Author Domain from the RFC5322.From header, the address your recipient sees, and asks whether an authenticated identifier matches it. For DKIM, the compared value is the d= tag of a validated signature. For SPF, section 3.2.4 is explicit that “DMARC relies solely on SPF validation of the MAIL FROM identity”, so the HELO identity does not count here even though SPF itself checks it.

Relaxed or strict. Relaxed alignment requires the same Organizational Domain; strict requires the names be identical. adkim and aspf both default to relaxed, and the RFC notes that “nearly all Domain Owners have found relaxed alignment sufficient”. In RFC 9989 the Organizational Domain is determined by a DNS Tree Walk rather than the Public Suffix List that RFC 7489 relied on.

One aligned pass is enough. Section 5.3.5 gives a pass when “one or more of the Authenticated Identifiers align”. You do not need both. That said, section 4.5 recommends domain owners use both, and section 8 is firm that a domain publishing p=reject “MUST NOT rely solely on SPF for a DMARC pass”; section 7.4 adds that such domains “MUST apply valid DKIM signatures”. Given how easily forwarding breaks SPF, that is sound advice regardless of policy.

Policy values, in the RFC’s own words: none means “The Domain Owner offers no expression of preference”, quarantine means “The Domain Owner considers such mail to be suspicious”, and reject means “The Domain Owner considers all such failures to be a clear indication that the use of the domain name is not valid”. A missing p tag is treated as none.

Policy is advisory, not binding. Receivers are not required to obey. Section 8 states they “MUST NOT reject messages solely on the basis of a ‘p=reject’ policy”, section 5.4 says they may reject mail that passes and may accept mail that fails, and section 7.4 says that absent other analysis, failing mail should be treated “as if the policy were ‘p=quarantine'”. Equally, section 5.4 requires that a discovered p=none “MUST NOT modify existing mail handling processes”, which is why p=none on its own changes nothing about your deliverability.

Tag changes in RFC 9989. pct is now marked historic and removed; Appendix A.6 explains it “was usually not accurately applied” outside the values 0 and 100. Its replacement is t, a test mode that asks receivers to apply one level below the stated policy. Also defined: np for non-existent subdomains, sp for subdomains, and psd for public suffix domains. Unknown tags “MUST be ignored”, and v=DMARC1 is unchanged, so existing records stay valid.

Indirect mail. Section 7.4 states that forwarded mail “will most likely fail SPF checks unless the RFC5321.MailFrom address is rewritten by the relaying MTA”, while “DKIM signatures will generally remain valid in these relay situations”. For mailing lists it notes that mail with unmodified From headers “is frequently rejected” under p=reject, and that rejections can cause list software to unsubscribe the recipient. Its guidance is that domains hosting users who post to mailing lists “SHOULD NOT publish” p=reject. ARC (RFC 8617) is mentioned as a possible remedy but described as “not widely used”.

The Part That Surprises Everyone

Here is the detail that catches out most people who set up SPF and assume they are protected from spoofing.

SPF does not check the “From” address your recipient reads. It checks a separate, hidden address that the sending servers use between themselves, called the envelope sender. The two are usually the same on legitimate mail, but nothing forces them to match.

RFC 7208 says so directly. Section 11.2 states that the identities SPF authorizes “do not provide assurance about the authorization/authenticity of other identities”, and names the From header field as one of those other identities.

Why SPF, DKIM and DMARC Suddenly Became Mandatory

For years these records were best practice that plenty of businesses skipped without obvious consequence. That changed in February 2024, when Google and Yahoo began enforcing sender requirements, and again in 2025 when Microsoft followed for Outlook.com. What each provider demands differs, so here is what their own documentation says.

RequirementGmailYahooOutlook.com
Enforcing sinceFeb 2024Feb 2024May 2025
Every sender needsSPF or DKIMSPF or DKIMNot specified
High-volume thresholdAbout 5,000 a day to personal GmailNo number publishedOver 5,000 a day
High-volume senders needSPF and DKIMSPF and DKIMSPF and DKIM must pass
DMARC requiredYes, p=none acceptedYes, p=none acceptedYes, p=none accepted
Alignment requiredFrom must align with SPF or DKIMRelaxed alignment acceptableAlign with SPF or DKIM
Spam complaint ceilingUnder 0.10%, never 0.30%Under 0.3%Not specified
One-click unsubscribeMarketing and subscribed mailYes, honored within 2 daysNot specified

Compiled from each provider’s own published sender documentation, read on 1 December 2026. These requirements change; check the current pages before relying on any single line.

Two things in that table deserve emphasis. First, every one of the three accepts p=none, the weakest possible DMARC policy, so meeting the letter of these rules does not protect your domain from being spoofed. Second, Gmail’s thresholds for complaints are tighter than most people quote: Google’s own wording is to “Keep spam rates reported in Postmaster Tools below 0.10% and avoid ever reaching a spam rate of 0.30% or higher”.

▸ For IT: the enforcement details worth knowing

Gmail. Google’s FAQ defines a bulk sender as “any email sender that sends close to 5,000 messages or more to personal Gmail accounts within a 24-hour period”. Note “close to”, and note the scope: personal Gmail accounts, not Workspace recipients. Messages from the same primary domain count together, and Google states that senders who meet the criteria once are permanently treated as bulk senders. Google’s main guidelines page words the same threshold as “more than 5,000 messages per day” and does not reconcile the two. Beyond authentication, all senders need valid forward and reverse DNS (PTR records) on sending IPs and must use TLS. Google states that from November 2025 it began ramping up enforcement on non-compliant traffic with temporary and permanent rejections. Google also says DMARC alignment is likely to become a requirement eventually, but gives no date.

Yahoo. Yahoo’s best-practices page splits requirements into “All Senders” and “Bulk Senders” but publishes no volume number defining the second group, which is worth knowing if you are trying to work out whether you are in scope. It requires bulk senders to “Publish a valid DMARC policy with at least p=none” and adds that “DMARC must pass”. On consequences it says only to meet the requirements “in order to avoid a negative impact to the delivery of your mail at Yahoo domains”.

Outlook.com. Microsoft’s requirements apply to its consumer service, covering outlook.com, hotmail.com and live.com addresses, for “domains sending over 5,000 emails per day”. Microsoft’s own post is inconsistent about the endpoint: it states that after 5 May 2025 non-compliant high-volume mail is routed to the Junk folder, and separately that rejection will follow at a date “to be announced”. It publishes the rejection response as 550; 5.7.515 Access denied, sending domain [SendingDomain] does not meet the required authentication level, and notes that a recipient’s Safe Sender list will not override the block.

What a Healthy Setup Looks Like

The order matters, because DMARC depends on the other two working first. Microsoft’s documentation states the prerequisite plainly: configure SPF and DKIM before you configure DMARC.

  1. Inventory everything that sends mail as you. Your mail platform, accounting software, CRM, booking system, newsletter tool, the contact form on your website. This step is the one people skip, and it is the reason records break later.
  2. Publish one SPF record covering all of it, staying inside the ten-lookup limit.
  3. Turn DKIM on for your real domain, not just the default one your provider signs automatically.
  4. Publish DMARC at p=none with a reporting address. This changes nothing about delivery, which is the point: it starts the reports flowing so you can see what is actually sending as you.
  5. Read the reports for a few weeks and fix whatever shows up failing that should not be.
  6. Move to quarantine, then reject. Only once the reports are clean. This is the step that actually stops people spoofing your domain, and it is the step most businesses never reach.
  7. Lock down domains you own but never send from, including spare domains parked at your registrar. Microsoft’s guidance for these is an SPF record of v=spf1 -all, a DMARC record at p=reject, and no DKIM records at all.

Where SPF, DKIM and DMARC Go Wrong

  • Two SPF records instead of one. Adding a second record when a new vendor asks for one does not combine them. It produces a permanent error, and the safest reading is that your SPF stops working entirely. Merge everything into a single record.
  • Quietly exceeding ten DNS lookups. Each include can pull in more lookups of its own. A record that worked for years can break the day you add one more service, with no warning and no error message anywhere you would normally look.
  • DKIM enabled only on the provider’s default domain. In Microsoft 365, mail from the onmicrosoft.com domain gets signed automatically, which makes it easy to assume DKIM is handled. Your actual domain needs it switched on separately.
  • Forwarding. If staff auto-forward mail to a personal address, SPF will usually fail at the far end, because the forwarding server is not on your list. DKIM normally survives, which is a practical reason to have DKIM working before you tighten DMARC.
  • Mailing lists. Lists that add a footer to each message can invalidate the signature, and under a strict policy that mail can be rejected. RFC 9989 advises against p=reject for domains whose users post to mailing lists.
  • Publishing reject on day one. Going straight to p=reject without reading reports first is how a business discovers its invoicing system was never authenticated, by way of customers not receiving invoices.
  • Nobody reading the reports. The reports are the entire diagnostic value of DMARC. A reporting address that nobody monitors means the records are decoration.

If your inbound mail filtering also needs attention, we have covered quarantining email by country in Proofpoint Essentials, and if you are still weighing up platforms, POP email versus Microsoft Exchange Online covers that ground.

📖

Terms Explained

The jargon you will hit if you go looking at your own DNS

DNS TXT record

In plain EnglishA line of text published against your domain name that anyone on the internet can look up. SPF, DKIM and DMARC are all published this way.

Envelope sender

In plain EnglishThe behind-the-scenes return address that sending and receiving servers use to talk to each other. It is not the From address you see, and SPF checks this one.

AnalogyThe address pencilled on the outside of the envelope for the postal service, as opposed to the letterhead on the page inside.

Alignment

In plain EnglishWhether the domain that passed SPF or DKIM is the same domain shown in the From line. Without alignment, a pass proves nothing about the name your recipient reads.

Selector

In plain EnglishA short label that lets one domain publish several DKIM keys at once, so different services can each sign with their own key and keys can be replaced without an outage.

Policy (p=)

In plain EnglishYour instruction to receiving servers about mail that claims to be from you and fails the checks: none do nothing, quarantine treat as suspicious, reject refuse it.

Aggregate report (rua)

In plain EnglishA daily summary, sent to you by receiving mail providers, of what passed and failed while using your domain name. This is how you find out what is really sending as you.

Frequently Asked Questions

Do I need all three, or is SPF enough? +

You need all three. SPF on its own does not check the From address your recipient sees, so it does not prevent someone putting your company name on their mail. DKIM proves the message was signed by your domain and not altered. DMARC is the only one of the three that ties either result to the visible From line and tells receiving servers what to do when it does not match. Gmail and Yahoo both require SPF or DKIM from every sender, and both SPF and DKIM plus DMARC from high-volume senders.

Will setting these up stop my email going to spam? +

It removes one of the most common reasons, but authentication is not the only factor. Gmail also requires valid forward and reverse DNS on sending IPs, a TLS connection, and a user-reported spam rate that Google wants kept below 0.10% and never at or above 0.30%. Authentication gets you considered. Sending mail people actually want is what keeps you in the inbox.

Is p=none good enough? +

It is good enough to satisfy Gmail, Yahoo and Outlook.com, which all accept it as the minimum. It is not good enough to protect your domain. The DMARC specification requires that a p=none policy must not change how receivers handle your mail, so it offers no anti-spoofing protection at all. Its real value is that it starts the reports flowing, which is how you get safely to quarantine and then reject.

Why did my email stop being delivered after we added a new service? +

Two likely causes, both SPF. Either someone added a second SPF record rather than merging the new vendor into the existing one, which produces a permanent error, or the new vendor pushed the record past the limit of ten DNS-querying terms, which also produces a permanent error. Neither failure announces itself. The record simply stops being usable, and the fix is to consolidate into one record that stays inside the limit.

Does DMARC break forwarded email and mailing lists? +

It can. The specification notes that forwarded mail will most likely fail SPF unless the forwarding server rewrites the return address, while DKIM signatures generally stay valid through a relay. Mailing lists are harder, because a list that appends a footer can invalidate the signature, and the specification advises against publishing p=reject for domains whose users post to mailing lists. This is the main argument for getting DKIM working properly before tightening your policy.

We own domains we never send mail from. Do they need anything? +

Yes, and they are frequently forgotten. An unused domain with no records is an easy one to spoof. Microsoft’s guidance for a parked domain is an SPF record of v=spf1 -all, a DMARC record set to p=reject, and no DKIM records. That takes a few minutes per domain and closes the gap permanently.

Not Sure Where Your Domain Stands?

Two ways to find out. Watch your own records with Service Sentinel, or hand the whole thing to us and we will fix what is broken and get you to a policy that actually stops people sending mail as your company. US based, no offshore help desk, and we will explain what we found in language you can act on.

Talk to us about email security
Monitor it yourself, free

SPF
DKIM
DMARC
Email Security
Microsoft 365
Deliverability

Sources

  1. 1RFC 7208: Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1, IETF, April 2014.
  2. 2RFC 6376: DomainKeys Identified Mail (DKIM) Signatures, IETF, September 2011 (Internet Standard, STD 76).
  3. 3RFC 8301: Cryptographic Algorithm and Key Usage Update to DomainKeys Identified Mail (DKIM), IETF, January 2018.
  4. 4RFC 8463: A New Cryptographic Signature Method for DomainKeys Identified Mail (DKIM), IETF, September 2018.
  5. 5RFC 9989: Domain-Based Message Authentication, Reporting, and Conformance (DMARC), IETF, May 2026. Obsoletes RFC 7489.
  6. 6Email sender guidelines, Google Workspace Admin Help, read 1 December 2026.
  7. 7Email sender guidelines FAQ, Google Workspace Admin Help, read 1 December 2026.
  8. 8Sender Best Practices, Yahoo Sender Hub, read 1 December 2026.
  9. 9Strengthening Email Ecosystem: Outlook’s New Requirements for High-Volume Senders, Microsoft Tech Community, 2 April 2025, updated 30 April 2025.
  10. 10Set up SPF to identify valid email sources for your Microsoft 365 domain, Microsoft Learn, read 1 December 2026.
  11. 11Set up DKIM to sign mail from your Microsoft 365 domain, Microsoft Learn, read 1 December 2026.
  12. 12Set up DMARC to validate the From address domain for senders in Microsoft 365, Microsoft Learn, read 1 December 2026.

Need help with this?

Questions about this post, or want it set up for your business? Twilight I.T. can take care of it.