SendGrid SPF passes but DMARC not aligned: fix with DKIM CNAMEs
SPF can pass for SendGrid and still fail DMARC, because SPF validates the envelope-from (a SendGrid domain), not your From domain. Fix it with DKIM alignment: authenticate your domain in SendGrid, publish the CNAME records it gives you, and ask any vendor for DKIM records, not SPF includes.
Sohail Hussain10 min readShort answer
- SPF passing without alignment is normal on SendGrid. SPF checks the Return-Path domain, which is not your From domain until you authenticate your domain in SendGrid.
- Authenticate your sending domain in SendGrid, publish the CNAME records it generates, and let DKIM carry DMARC alignment.
- When a vendor or agency sends as you, ask for their DKIM records and a return-path CNAME. Do not add an SPF include to your root record.
A sysadmin finds an outsourced agency sending as the company's domain through SendGrid. The headers say SPF passes, yet DMARC reports the message as not aligned. The question that follows is whether that is a problem and what to ask the agency for. It is normal, and the agency can fix it with DKIM records.
Why SPF passes but DMARC says not aligned
DMARC does not ask whether SPF passed. It asks whether SPF or DKIM passed and the domain that passed matches the domain in the visible From address. The RFC puts it this way: a DMARC pass requires an SPF or DKIM pass, plus alignment of the passing domain with the Author Domain, in relaxed or strict mode.
SPF and DKIM look at different domains:
| Check | Domain examined | Where you see it |
|---|---|---|
| SPF | Envelope-from (MAIL FROM) | Return-Path header, smtp.mailfrom in results |
| DKIM | The d= tag of the signature | DKIM-Signature header, header.d in results |
| DMARC | The From header domain, compared to both | From header, header.from in results |
When SendGrid has no authenticated domain for you, the envelope-from and the DKIM d= both sit on a SendGrid domain. SPF passes for that domain, DKIM passes for that domain, and neither matches example.com. A header from such a message looks like this (illustrative):
Authentication-Results: mx.google.com;
spf=pass smtp.mailfrom=bounces.sendgrid.net;
dkim=pass header.d=sendgrid.net;
dmarc=fail header.from=example.com
Paste a real header into the email header analyzer to pull out the three domains. Understanding email headers explains the fields.
A second, subtler case: you did authenticate the domain, but your DMARC record uses aspf=s (strict SPF). SendGrid's return-path is then a subdomain such as em1234.example.com. SendGrid's support article says that causes issues if aspf=s, because the From domain must strictly match the return-path domain.
Fix 1: authenticate the domain and publish the CNAMEs
Adding SendGrid to your own SPF record does not change this. SPF alignment depends on the envelope-from domain, so an include on example.com does nothing for a message whose Return-Path is elsewhere. DKIM through SendGrid's CNAMEs is the route the platform is built around.
- In SendGrid, open Settings > Sender Authentication and start Authenticate Your Domain. SendGrid's own support text refers to "settings > sender authentication" for this.
- Pick your DNS host if it is listed, or choose the generic option.
- In the Domain You Send From box, enter your root domain. Type only the root domain, without subdomains or a protocol like www.
- Open Advanced Settings and leave Use automated security checked. With it on, SendGrid handles DKIM signing and SPF authentication through CNAME records.
- Copy the records on the Install DNS Records page exactly. With Automated Security, SendGrid gives you 3 CNAME records. The values are specific to your account.
- Publish them at whoever hosts your DNS (registrar, Cloudflare, Microsoft 365 DNS, and so on), then click Verify in SendGrid.
- Send a test message and look for
dkim=pass header.d=example.comin the headers.
The records have this shape. Hostnames and targets are placeholders; use what SendGrid shows you.
em0000.example.com. CNAME u0000000.wl000.sendgrid.net.
s1._domainkey.example.com. CNAME s1.domainkey.u0000000.wl000.sendgrid.net.
s2._domainkey.example.com. CNAME s2.domainkey.u0000000.wl000.sendgrid.net.
SendGrid documents the same layout: an em CNAME for SPF and two _domainkey CNAMEs for DKIM. See SendGrid's domain authentication guide for the current screens.
Why CNAMEs instead of a TXT key? With automated security on, SendGrid manages your DKIM and SPF records behind the CNAMEs, so key changes happen without you editing DNS. The signature comes out as d=example.com, which aligns with your From domain.
DNS mistakes that break verification
- Doubled domain. Some DNS panels append your domain automatically. SendGrid's docs describe a value stored as
em123.example.com.example.com, which fails verification. Enter only the host part, such asem123. - Proxying. On Cloudflare, set these CNAMEs to DNS only.
- A record already at that name. A CNAME cannot share a name with another record. SendGrid also warns that a custom return path CNAME matching an existing CNAME overwrites it, so check first.
- Underscores. If your DNS provider does not accept underscores in CNAME records, you cannot use Automated Security. In that case SendGrid gives you TXT and MX records instead.
- Microsoft 365's own DKIM is separate. Enabling DKIM for mail sent from Outlook does not sign SendGrid mail. Each sender needs its own DKIM.
Subdomains do not inherit
SendGrid states that subdomains do not inherit authentication from the parent domain. If you send From news.example.com, authenticate that exact domain, not only example.com.
Fix 2: make SPF align too (optional)
DKIM alone is enough for DMARC to pass. If you want SPF aligned as well, or your policy demands it, you have three options, in this order:
- Keep relaxed alignment. With
aspf=r(the default), a return-path such asem1234.example.comaligns withexample.com. SendGrid's DMARC documentation lists a pass for From@example.comwith return-path@mail.example.comin relaxed mode and a fail in strict mode. - Use a custom return path and send from a subdomain. If you need strict alignment, SendGrid's guidance is to send from a subdomain and use Custom Return Path so the subdomain matches. This is set under Advanced Settings when you create the authentication, and an existing domain authentication cannot be edited this way, so you create a new one.
- Ask SendGrid support about Preserve Sender. It is the last resort for sending from the root domain under strict SPF. SendGrid says it stops the system from overwriting the return path so it stays the same as the From address, and you have to contact support to enable it.
I would pick option 1 or 2. Strict SPF alignment buys little when DKIM is already aligned, and SendGrid itself suggests auditing whether strict is truly necessary.
| Situation | Symptom | Fix |
|---|---|---|
| Domain never authenticated | spf=pass and dkim=pass on a SendGrid domain, DMARC fail | Fix 1 |
Authenticated, DMARC aspf=s | DKIM aligned, SPF pass but not aligned | Relaxed aspf, or custom return path |
| Authenticated, DKIM fails | dkim=fail or neutral | Check CNAME hostnames, verify in SendGrid |
| Sending from a subdomain not authenticated | DMARC fail only on that subdomain | Authenticate that subdomain |
Prices and screens at SendGrid change; treat its dashboard as the source of truth as of November 2026.
What to tell a vendor or agency that sends as you
Users on sysadmin forums report the same pattern: an agency starts sending as the company domain, SPF shows a pass, and nobody can say why DMARC fails. The consistent advice is that this is normal and the vendor should supply DKIM records.
Send the vendor something like this:
We are authorizing you to send as marketing.example.com.
Please send the DNS records for your sending platform: the DKIM
CNAME (or TXT) records and any return-path CNAME. We will not add
an SPF include for your platform to our root record.
Please also confirm the exact From address and the platform account
that will send, so we can check alignment in our DMARC reports.
I would push back on unknown includes in your root SPF record, for three reasons:
- SPF allows at most 10 DNS lookups, and each vendor include can use several. Check yours with the SPF lookup count calculator.
- An include authorizes the vendor's whole sending infrastructure for your domain, which shared customers also use.
- It still does not produce alignment when the vendor's envelope-from is on its own domain.
Better practice is one subdomain per vendor, such as news.example.com, with the vendor's DKIM records published there. Ending the relationship means deleting those records. Relaxed alignment, in the RFC's words, compares the Organizational Domains of the two identifiers, so a vendor signing as a subdomain still aligns with your root From domain. Strict mode requires an exact match; the RFC 7489 text has the definitions.
Use DMARC reports to find surprise senders
Add a rua address to your DMARC record. Aggregate reports list every source sending as your domain, so the next unannounced vendor shows up before you move to quarantine or reject.
Checklist before you try again
- The domain in SendGrid's Domain You Send From matches the domain in your From address.
- All three CNAMEs show as valid in SendGrid after Verify.
- Hostnames in your DNS panel are not doubled with your domain.
- Cloudflare records are DNS only.
- A test message to Gmail shows DKIM
PASSforexample.comunder Show original. - Your DMARC
adkimandaspftags match what you intend. - A
ruaaddress is set. - You move to
p=quarantineorp=rejectonly after reports show every legitimate sender aligned.
If nothing works
If DKIM still fails after the records verify, common causes are a gateway that rewrites message bodies in transit, a selector published at the wrong hostname, or a different SendGrid account or subuser sending than the one you authenticated. SendGrid also documents a custom DKIM selector for authenticating one domain on multiple accounts without DNS conflicts.
Contact SendGrid support through your account, and include the full headers of a failing message, the domain authentication ID, your DMARC record, and the DNS records you published. Your DNS host's support can confirm what is actually stored at each hostname.
Subject: Domain authentication verified but DMARC alignment fails
Domain: example.com (From: news@example.com)
Authenticated domain ID: {id from SendGrid}
Problem: DMARC fails with spf=pass (smtp.mailfrom on SendGrid domain)
and dkim result below. Full headers of a failing message attached.
DMARC record: {paste your _dmarc TXT value}
Already done: published 3 CNAMEs, clicked Verify, checked for doubled
hostnames, DNS-only in Cloudflare.
Question: why is header.d not example.com, and do I need Custom Return
Path or Preserve Sender?
Where Mailneo fits
The alignment rules are the same for every platform that sends as your domain. Mailneo sends through the mailboxes and providers you connect, SendGrid included, so alignment depends on the authentication you set up with that provider. Mailneo checks your sending domain's SPF, DKIM and DMARC records and tells you whether they authorize the provider you use, but it cannot change your DNS or sign mail for you. See email accounts, and how to set up SPF, DKIM and DMARC for the full record setup.
Common questions
Is "SPF pass, DMARC fail" a security problem?
Not by itself. It means the message is not aligned yet, so it will fail once your DMARC policy is enforced. Fix alignment before moving to quarantine or reject, or legitimate vendor mail gets blocked.
Do I need both SPF and DKIM aligned?
No. DMARC passes if either one passes with alignment. DKIM is the more dependable choice because it survives forwarding, which usually breaks SPF.
Should I add include:sendgrid.net to my SPF record?
It does not fix alignment, and it spends DNS lookups. SendGrid's manual-setup option does publish a v=spf1 include:sendgrid.net ~all TXT record, but on the return-path host, not your root. Follow what SendGrid generates.
Can I use adkim=s with SendGrid CNAMEs?
Yes, as long as the DKIM d= equals your From domain exactly. If you send From news.example.com, authenticate that domain so the signature carries it.
Explore: Email Deliverability
Related Articles
421-4.7.0 Gmail Has Detected This Message Is Suspicious: Fix
The 421-4.7.0 "suspicious due to the nature of the content and/or the links" error means Gmail's content filter rejected your message after DATA, not an authentication check. Remove click tracking or move it to your own domain, drop URL shorteners, check link reputation, then retest with a plain message.
421 4.7.28 Gmail Unusual Rate of Unsolicited Mail: Fixes
The 421 4.7.28 error is a temporary Gmail deferral, not a block. Gmail is rate limiting a domain, DKIM domain or IP range it sees sending too much unwanted mail. Retries usually deliver, but you should fix authentication, unsubscribe headers, sending pace and shared infrastructure to stop it recurring.
451 4.7.500 Server busy: SMTP2GO stuck at Processed (Microsoft)
`451 4.7.500 Server busy. Please try again later.` is a temporary Microsoft deferral of the connecting IP, not a problem with your message. SMTP2GO keeps retrying, so mail sits at "Processed" for hours. Ask SMTP2GO to rotate your IP, move to a dedicated IP, or allow-list carefully in Defender.
535 5.7.139 Authentication unsuccessful: Microsoft 365 SMTP fixes
535 5.7.139 means Microsoft 365 refused the SMTP login even though the password may be right. The usual cause is that Authenticated SMTP is disabled for the mailbox or tenant, or Security Defaults blocks basic auth. Enable SMTP AUTH per mailbox, adjust Security Defaults or Conditional Access, use OAuth, or switch to a connector.
Ready to supercharge your email marketing?
Start sending smarter emails with AI-powered campaigns. No credit card required.
Get Started Free