Why agent email lands in spam even when SPF and DKIM pass
The fault usually lies in alignment between the From header and the signing domain, and an FDE can fix it with a dedicated sending subdomain.
In brief
- Gmail and Outlook.com require senders of more than 5,000 messages a day to have SPF, DKIM and DMARC, and Yahoo sets its own rules for bulk senders; Outlook has routed failing mail to Junk since May 5, 2025.
- Passing SPF and DKIM is not enough: DMARC passes only when the SPF or DKIM domain matches the domain in the From header.
- The cleanest fix is to give the agent its own subdomain, sign DKIM with that subdomain and set a custom Return-Path.
- 1Read the From domainThis is the Author Domain, the one the recipient sees, for example notify.client.com
- 2Check SPF on the Return-PathIs the sending server in the SPF record of the Return-Path domain, within 10 DNS lookups
- 3Check the DKIM signatureIs the signature valid, and which domain signed it in the d= field
- 4Compare alignment with FromAt least one passing SPF or DKIM domain must match the From domain
- 5Apply the DMARC policyOnly a pass moves on to further checks such as spam rate; a fail can be filtered to spam, Junk or rejected
A message passes DMARC only when SPF or DKIM passes for the exact domain in the From header.
Graphic: FDE Times
Since May 5, 2025, Outlook.com has been sending to the Junk folder mail from domains that send more than 5,000 messages a day without meeting SPF, DKIM and DMARC requirements.
Gmail and Yahoo already impose similar requirements on bulk senders. Microsoft has also warned that on a date it has yet to announce, failing mail will be rejected outright rather than merely filed as Junk.
For an FDE, this usually surfaces right after go-live. The agent is running: sending appointment confirmations, post-call follow-ups and payment reminders, all in the client’s name. The sending platform’s logs say “delivered”, yet recipients see nothing. Then a ticket arrives: “all the bot’s emails are going to spam.”
This kind of failure lands on the FDE because it sits between three parties. The client’s IT department owns DNS, the email platform owns the servers, and you own the deployment. Nobody sees the whole picture except whoever understands all three records and how they connect.
Three records answer three different questions
SPF asks: is this server allowed to send mail for the domain in the Return-Path address? That is the address that receives bounced mail. It is usually set by the sending platform, and recipients almost never see it.
DKIM asks: is the digital signature on the message valid, and who signed it? The signing domain sits in the d= field of the DKIM-Signature header. Yahoo recommends DKIM keys of at least 1024 bits.
DMARC asks the most important question: does that pass belong to the domain the recipient actually sees in the From header?
RFC 9989, the DMARC specification published in May 2026 to replace RFC 7489, treats a message as passing DMARC when SPF or DKIM passes and the authenticated identifier matches the Author Domain, meaning the domain in From.
Google and Yahoo both state this requirement explicitly: the From domain must align with either the SPF domain or the DKIM domain.
Why everything “passes” and mail still goes to spam
Take a hypothetical case to make it concrete. An agent sends mail as [email protected] through an email platform whose domain is mail-platform.com. Because nobody has configured the client’s domain on the platform, messages go out with the platform’s own Return-Path and DKIM signature. Open the original message in Gmail and you see roughly this:
From: Support <[email protected]>
Return-Path: <[email protected]>
DKIM-Signature: v=1; a=rsa-sha256; d=mail-platform.com; s=s1; ...
Authentication-Results:
spf=pass smtp.mailfrom=mail-platform.com
dkim=pass header.d=mail-platform.com
dmarc=fail header.from=client.com
Read it line by line. SPF passes, but for mail-platform.com, not the From domain. DKIM passes, but the signer is also mail-platform.com. No identifier matches client.com, so DMARC fails, and for a bulk sender a DMARC failure is enough to get filtered.
A second variant is just as common: the platform uses the client’s own Return-Path, but the client never added the platform to its SPF record. Gmail Help addresses this case directly: if a third-party sender is not in the SPF record, authentication can fail. Three lines of Authentication-Results are enough to tell which variant you are facing.
| Header field | Question it answers | Before the fix | After the fix |
|---|---|---|---|
| From | Which domain does the recipient see? | client.com | notify.client.com |
| Return-Path (SPF) | Is the server allowed to send? | mail-platform.com | bounce.notify.client.com |
| DKIM d= | Who signed the message? | mail-platform.com | notify.client.com |
| DMARC | Does any identifier match From? | fail | pass |
Fix it with a dedicated subdomain for the agent
Resend, an email platform popular with developers and agent systems, recommends sending from one or more subdomains and lets you set a custom subdomain for the Return-Path. That is the right approach on most platforms: give the agent its own sending domain such as notify.client.com, sign DKIM with that same domain, then point the Return-Path to a child of it.
The DNS work usually comes down to three groups of records. The exact values are generated by the platform; the skeleton below only shows where each record belongs:
; 1. DKIM: public key, supplied by the platform
s1._domainkey.notify.client.com TXT "v=DKIM1; k=rsa; p=MIIB..."
; 2. Custom Return-Path with its own SPF
bounce.notify.client.com TXT "v=spf1 include:<platform-domain> ~all"
; 3. DMARC for the subdomain, starting in monitoring mode
_dmarc.notify.client.com TXT "v=DMARC1; p=none; rua=mailto:[email protected]"
Yahoo accepts a DMARC policy as weak as p=none, provided DMARC passes. That makes it a safe starting point: mail is not blocked by an overly strict policy, and the reports show you who is sending under the domain. Tighten the policy only once the reports are clean.
A subdomain also sidesteps a trap few people notice. RFC 7208 caps SPF at 10 DNS lookups; exceed it and the result is permerror, which amounts to a broken SPF record.
A company’s main domain that already serves an office email suite, a CRM, a marketing tool and an invoicing system can easily be near that limit. One more include for the agent could break SPF for all of the company’s mail, including the CEO’s.
Step by step at the client site
Start with diagnosis and leave DNS alone. Send a test message to a Gmail inbox, open the original, and copy the three domains for From, Return-Path and DKIM d= into the ticket, along with the three spf, dkim and dmarc results.
Next, agree with the client on the agent’s sending domain. Propose a subdomain and explain it to IT in one sentence: if the agent misbehaves, the reputation of their main domain is not dragged down with it.
Then verify the subdomain on the email platform, enable the custom Return-Path, and send the client’s IT team exactly the list of records the platform generates. Do not retype them by hand: a single wrong character in a DKIM key makes mail fail without a clear error.
Once DNS has updated, send another test message and accept the result only when all three lines pass. Finally, switch the From header in the agent’s configuration to the new subdomain. This is the step most often forgotten, because it lives in your code rather than in DNS.
Common mistakes
The first mistake is stopping when SPF and DKIM pass without checking which domain passed. The second is adding an include to the main domain’s SPF record without counting DNS lookups. The third is setting DMARC to p=reject on day one, which also blocks legitimate mail flows nobody has listed yet.
The fourth is assuming that once authentication is in place, mail is certain to reach the inbox. Authentication is only the entry ticket. Google asks senders to keep their spam rate from reaching 0.30%, and Yahoo requires it to stay below 0.3% along with one-click unsubscribe for marketing mail. An agent that fires off follow-ups that recipients mark as spam can still push the whole subdomain into the filters.
A skill worth putting on a CV
When reading FDE job ads, look for products whose agents send email, make calls or send messages on a client’s behalf: that work will touch the client’s DNS. On a CV, rather than “familiar with SPF/DKIM”, describe a specific incident: DMARC failed because no identifier matched From, you moved sending to a dedicated subdomain, and here is what happened.
Before an interview, practice reading three lines of Authentication-Results and explaining them to someone non-technical.
The more work agents take over from people, the more mail they send in other people’s names. The FDE who can tell whether that mail is “really from the client” will be the first person called when the bot goes quiet and nobody knows why.
Was this article useful?
Thanks for the feedback!
6 sources
- Email sender guidelines - Gmail Help
- Sender Best Practices | Sender Hub
- Strengthening Email Ecosystem: Outlook's New Requirements for High‐Volume Senders · 2025-04-02
- RFC 9989: Domain-Based Message Authentication, Reporting, and Conformance (DMARC) · 2026-05
- Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1 (RFC 7208) · 2014-04
- Verified Domains