SPF, DKIM and DMARC: What to Fix First

MLE Technology Insight

SPF, DKIM and DMARC: What to Fix First

When your invoices reach the spam folder, or a supplier receives a fake message that appears to come from your domain, the fix is almost always email authentication. Here is what each record checks, the order that works, and how to test your own domain today.

The short answer

Three DNS records do three different jobs, and they only work as a set.

  • SPF publishes the list of servers that are allowed to send mail for your domain. It is a single DNS TXT record, defined in RFC 7208.
  • DKIM puts a cryptographic signature on each message so a receiving server can verify that the message really came from your domain and was not changed in transit (RFC 6376).
  • DMARC tells receiving servers what to do when SPF or DKIM does not pass, and where to send reports about it (RFC 7489).

If you have SPF only, you have published a list of allowed senders that nobody has been told to enforce. If you have DKIM only, receivers can verify signatures but you have not set a policy for messages that fail. DMARC is the part that turns the other two into a decision.

Why it matters for a business of any size

Authentication solves two problems that look unrelated until you see them together.

The first is impersonation. Without a DMARC policy, an attacker can send email that claims to come from your domain, to your customers, with an invoice attached. Your mail server never sees that message. The recipient’s provider is the only place where a decision can be made, which is exactly what SPF, DKIM and DMARC give it the information to do.

The second is delivery. Large mailbox providers weigh authentication when they decide whether a message belongs in the inbox. Google’s sender guidelines have required SPF or DKIM from all senders since 1 February 2024, and add DMARC alignment plus one-click unsubscribe for senders pushing 5,000 or more messages a day to Gmail accounts. Most small businesses are far below that volume and should not assume the rules do not apply: the baseline expectations apply to every sender, and a domain with no records looks exactly like a domain that has something to hide.

What SPF checks, and where it usually breaks

An SPF record is a single line of text that names the systems allowed to send as your domain. A typical Microsoft 365 business record looks like this:

v=spf1 include:spf.protection.outlook.com -all

The include: mechanism pulls in somebody else’s record, which is how hosted mail providers publish their ranges. The -all at the end says that anything not listed should fail.

Two failure modes account for most broken SPF records.

  • More than 10 DNS lookups. The specification limits an SPF check to 10 DNS lookups (RFC 7208, section 4.6.4). Every include: spends some of that budget, and a chain of marketing tools, CRMs and ticketing systems can exhaust it. The record then returns permerror, which is not a pass and not a fail: it is no result at all, and DMARC has nothing to evaluate.
  • Two SPF records on one domain. This is also a permanent error. It usually appears after a hosting or email migration, when a second record was added and the old one was never removed. There must be exactly one.

You can check the current record and the lookup count before changing anything:

dig +short TXT yourdomain.com | grep spf1

What DKIM adds

DKIM signs each outgoing message with a private key held by your mail system. The matching public key sits in DNS at a selector address such as selector1._domainkey.yourdomain.com, and the signature travels in the message headers. A receiver that can verify the signature knows two things: the message was signed by a system holding your key, and the signed parts were not altered along the way.

Two practical points matter more than the cryptography.

  • Signing has to be switched on. In Microsoft 365, DKIM is enabled per domain in the Defender portal rather than being on by default. A published public key with no signing configured proves nothing.
  • Rotation needs both selectors. Providers publish two selectors so keys can be rotated without a gap. If only one is live, rotation will break signing later.

What DMARC ties together

DMARC is the policy record at _dmarc.yourdomain.com, and it introduces one idea that neither SPF nor DKIM has: alignment. A message passes DMARC only if SPF or DKIM passed for the domain in the From: header. This is what closes the gap that lets a third-party sending service pass its own SPF check on your behalf while the visible sender is somebody else entirely.

A monitoring record looks like this:

v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com; adkim=r; aspf=r

The p= value is the instruction: none means take no action and just report, quarantine means treat failures as suspicious, reject means refuse them. rua is where aggregate reports are delivered. The adkim and aspf settings choose strict or relaxed alignment for each mechanism.

Aggregate reports arrive as XML attachments from receiving providers, usually daily. They are the only way to find the senders you forgot about before you enforce a policy against them.

The order that works

Doing these steps out of order is how businesses block their own invoices. The sequence below is deliberately conservative.

  1. Inventory every sender. Email platform, website contact forms, the accounting system, the CRM, the shipping notifier, any marketing tool. Include anything that sends as your domain, even once a month.
  2. Publish one SPF record that covers those senders, and remove duplicates and dead includes until the lookup count is comfortably under 10.
  3. Turn on DKIM signing for each domain you send from, and confirm both selectors resolve.
  4. Publish DMARC at p=none with a reporting address you actually read.
  5. Read the reports for two to four weeks and add any legitimate sender that shows up as failing.
  6. Move to p=quarantine, wait, then to p=reject once the reports are clean.
  7. Re-check the records whenever you add a tool, change email providers, or hand off marketing to an agency.

The single most common mistake is step four to six compressed into one afternoon. Enforcing before the inventory is complete turns a deliverability project into a support incident, because legitimate mail from a forgotten system starts being quarantined with no explanation.

Common failures and what they mean

  • SPF permerror. Too many DNS lookups, or duplicate records. The sender gets no SPF result, so DMARC falls back to DKIM.
  • DKIM signature present but not verifying. The selector is not published, the key was rotated on one side only, or a mailing system is rewriting the message body after it was signed.
  • DMARC failing while SPF passes. Classic misalignment: the message was sent through a service using its own envelope domain, so SPF passed for that service and not for your From: domain.
  • DMARC passing but mail still landing in spam. Authentication is not reputation. Content, complaint rates and sending history still matter, and that is where a broader review helps.
  • Everything passing except one mailbox. That is a receiving-side problem, not an authentication problem. A single user’s Safe Senders list is a different topic entirely, covered in how to add people to your safe senders list.

How to test your own domain in a few minutes

You do not need a paid tool to see the basics. These commands run on macOS and Linux, and in PowerShell with Resolve-DnsName if you are on Windows.

dig +short TXT yourdomain.com | grep spf1
dig +short TXT selector1._domainkey.yourdomain.com
dig +short TXT _dmarc.yourdomain.com

The second answer should contain a public key. If it is empty, DKIM is not published for that selector. Then look at a real message you received from your own domain and find the Authentication-Results header: it lists the SPF, DKIM and DMARC results as the receiving provider saw them, which is the only version that counts.

Where this fits in the rest of your setup

Email authentication is infrastructure, not a project with an end date. It sits alongside the other basics that decide whether business email is trustworthy: correct DNS, a reviewed domain inventory, and a security baseline for the accounts that can send as your company.

If the records are wrong, the practical starting point is a short review of what you already own and pay for. Our cybersecurity services cover the security side of the same inventory, and the review below covers the rest of your stack at the same time.

Get a free technology cost review

Bring vendor bills, renewal dates, current email and DNS providers, user counts, and any notes about spoofed messages or deliverability problems you have already seen. You will get a practical read on what to fix first, in the order that avoids breaking working mail. If you would rather talk it through first, contact MLE Solutions.

FAQ

Do I need all three records?

In practice, yes, and in that order. SPF and DKIM give receivers something to check; DMARC tells them what to do with the result. A DMARC record on a domain with no SPF or DKIM signing is a policy with nothing behind it.

Will publishing a reject policy block legitimate email?

It can, which is why the policy is staged. Start at p=none, read the aggregate reports until every sender you recognise is passing, then move to quarantine and finally reject. If a sender only appears after you enforce, you enforced too early.

How long before the reports are useful?

Most large providers send aggregate reports within a day of the first message, but coverage builds as more mail flows. Allow two to four weeks before treating the picture as complete. Not every receiver sends reports at all.

Does DMARC stop someone using our name in the display name?

No. DMARC evaluates the domain in the From: header, not the friendly name shown in a mail client. Display-name impersonation has to be handled with user awareness and inbound filtering, and that is a separate conversation from your own sending records.

Sources and further reading

© MLE Solutions Inc. Practical technology guidance for growing businesses.