Automated Email Goes to Spam: SPF, DKIM and DMARC as an Operations Process
Back to blog
automation·September 5, 2026·4 min read·By Yehonatan Saadia

Automated Email Goes to Spam: SPF, DKIM and DMARC as an Operations Process

Your automated invoices land in spam. The order to actually work in: read Authentication-Results, fix SPF and DKIM, publish DMARC, and confirm each step worked.

Key takeaways

  • The evidence is in the message headers, not in your impression. `Authentication-Results` states what passed and what failed.
  • SPF authorises sending servers, DKIM signs the message, and DMARC decides what happens when one of them fails.
  • Alignment is the part most people miss: SPF can pass and DMARC can still fail.
  • A high-volume sender is measured on its spam complaint rate too, not only on DNS records.
  • Always start at `p=none` with reporting, and only tighten to `quarantine` after you have read the reports.

When automated invoices land in the spam folder, the first move is not rewording the message. It is opening one delivered message and reading its Authentication-Results header. That header reports three verdicts - spf, dkim and dmarc - and whichever one failed is what you fix, in that order.

Step one: read the Authentication-Results header

Every mail client can show a message's full source. Inside it is a line shaped like Authentication-Results: mx.google.com; spf=pass ...; dkim=pass ...; dmarc=fail .... That line is the diagnosis.

  • spf=pass and dkim=pass but dmarc=fail means an alignment problem, not a records problem.
  • spf=fail means the server that actually sent is not authorised in the domain's SPF record.
  • dkim=none means the message was never signed at all. This is the single most common finding on automated systems configured once and then forgotten.
  • spf=permerror means the record itself is broken, most often by exceeding the lookup limit.

Without that header you are rewording copy and hoping. With it you know which of the three records you are dealing with.

What each of the three records actually does

RecordWhere it lives in DNSWhat it assertsConsequence of not having it
SPFA TXT record on the domain itselfWhich servers may send on the domain's behalfA receiver cannot reject a forged sender by IP
DKIMA TXT record at selector._domainkey.example.comThe public key that verifies the message signatureNo proof the message was not altered in transit
DMARCA TXT record at _dmarc.example.comWhat to do when the first two fail, and where to send reportsThe receiver has no policy to follow

The values look like this in practice: v=spf1 include:_spf.example.net ~all for SPF, v=DKIM1; k=rsa; p=<base64 key> for DKIM, and v=DMARC1; p=none; rua=mailto:dmarc@example.com for DMARC. Three notes that save a round trip: publish exactly one SPF record per domain, SPF evaluation is capped at 10 DNS-querying terms and returns permerror above that, and your DKIM selector is chosen by whichever provider sends for you.

What is alignment, and why does a passing SPF still fail DMARC?

Alignment is the requirement that the domain which authenticated is the same domain the recipient sees in the From field. This is where most businesses come unstuck, and it explains the confusing state where everything looks green and DMARC still fails.

  • SPF authenticates the envelope domain, 5321.MailFrom. The recipient sees 5322.From. If your sending provider sets an envelope in its own domain, SPF passes but is not aligned.
  • DKIM is aligned when the domain that signed the message matches the domain in the From header.
  • DMARC passes if at least one of the two is aligned. So DKIM alignment alone is sufficient even when SPF belongs to the provider.
  • Alignment mode is controlled by the aspf and adkim tags. The value r is relaxed and is the default; s demands an exact match of the full domain.

The practical translation: if you send through a third party, ask them to sign with DKIM using your domain. That single change produces alignment without touching SPF at all.

The order to work in

  1. Inventory everything that sends as you: the website server, the invoicing system, the marketing platform, the CRM, the automation tool. A record that misses one source will break that source.
  2. Publish a single SPF record covering all of them, ending in ~all at this stage.
  3. Turn on DKIM at every provider and publish the selector record each one gives you.
  4. Publish DMARC at p=none with rua, then wait. none blocks nothing; it only makes the reports flow.
  5. Read the reports for one to two weeks and identify sources sending as you that you did not know about.
  6. Fix what the reports exposed, and only then move to p=quarantine.
  7. Move to p=reject at the end of the process, not the beginning. reject over incomplete infrastructure blocks your own invoices.

Which thresholds are you being measured against?

The large mailbox providers have published explicit requirements for high-volume senders. They apply to anyone sending more than 5,000 messages a day to that provider.

Measured onGmailOutlook.com, Hotmail and Live
Volume thresholdOver 5,000 messages per dayOver 5,000 messages per day
Authentication requiredSPF, DKIM and DMARCSPF, DKIM and DMARC
Minimum DMARC policyp=none is sufficientp=none is sufficient
AlignmentFrom must align with SPF or DKIMSame, against 5321.MailFrom or the signing domain
Spam rateStay below 0.10%, never reach 0.30%Not published as a number
RejectionDeliverability damage550 5.7.515 Access denied

Two points worth noting: Google also requires a valid PTR record for the sending IP address and a TLS connection, plus List-Unsubscribe and List-Unsubscribe-Post: List-Unsubscribe=One-Click headers on marketing messages with unsubscribe requests honoured within two days. Microsoft states that a domain which has ever crossed the threshold stays subject to the requirements even if its daily volume later drops.

How do you confirm each step actually worked?

  • Send a test message to a Gmail address and read Authentication-Results again. It is the only check that reflects reality.
  • Confirm there is exactly one TXT record starting with v=spf1. Two SPF records break evaluation.
  • Count the include mechanisms in the chain. Exceeding ten DNS lookups returns permerror, which is equivalent to a failure.
  • Send one message from each system separately - website, invoicing, marketing. They are usually signed differently from each other.
  • Verify that rua reports are actually arriving in the mailbox you nominated. An unmonitored mailbox is the same as no reports.
  • After moving to quarantine, watch your critical operational messages for a week before tightening further.

What still lands in spam when authentication is perfect

Authentication is necessary and not sufficient. It proves you are who you claim to be, not that the message was wanted. Once everything passes, what remains is behaviour:

  • Addresses that do not exist. A high bounce rate damages sender reputation faster than anything else on this list.
  • Sending at volume from a new domain with no ramp-up.
  • Mixing marketing campaigns with operational mail on the same domain. Separating them onto subdomains keeps invoices delivering when a campaign goes badly.
  • No obvious way to unsubscribe, which turns quiet opt-outs into spam complaints.

Related: an invoice email that never arrived checklist, email automation for a small business, what DNS is.

Sources

#SPF#DKIM#DMARC#email deliverability#transactional email#שגיאות

Frequently asked questions

What is the difference between ~all and -all in an SPF record?

`~all` is a soft fail: a server not on the list is marked suspicious but the message is usually still delivered. `-all` is a hard fail and instructs the receiver to reject. Stay on `~all` until you have confirmed every one of your sending systems appears in the record.

Is p=none worth anything if it blocks nothing?

Yes. `p=none` is observation mode: it changes no deliverability outcome but it switches on the report flow to `rua`, which is how you discover sending sources you did not know existed. It also satisfies the DMARC requirement both Gmail and Outlook place on high-volume senders.

Why does DKIM fail on only some messages?

Almost always because those messages come from a different system that does not sign, or because they pass through a mailing list or forwarding service that alters the body. A signature broken in transit is worth the same as no signature. Check the selector in the header of each failing message.

How long before I see an improvement?

DNS changes take effect within hours according to the TTL, but sender reputation is built over weeks. Splitting marketing mail away from operational mail onto separate subdomains is the fastest way to protect the invoices while reputation stabilises.

Keep reading

Related service

Business Automation

I build custom automations that remove repetitive work end to end.

Learn more →←

About the author

Yehonatan Saadia

Freelance automation, web & MVP developer

I'm Yehonatan Saadia, a senior developer who builds business automation, custom websites, and MVPs for small and mid-sized companies across the US, Europe, and Israel. These guides come from real client work, not theory.

Work with me

Have a project like this?

Tell me what you're trying to automate or build. I reply within 24 business hours with a few targeted questions, then we walk through it on a free 30-minute call, with no commitment. You come away with a scope, a timeline and a fixed price - or a straight answer that it isn't worth building.