Email That Actually Reaches the Inbox
Updated: Oct 19
A product team's support queue fills with the same complaint: "I never got the password reset email." The application logs say every message was sent. The email service's dashboard says every message was delivered. Users find some of them in spam and never find others.
The team's first instinct is to rewrite the email: fewer links, no "Click here", a plainer subject line. Nothing changes. The real cause is in the message headers. SPF passes and DKIM passes, but both pass for the email service's domain, not the team's. To Gmail, the message claims to be from the team's domain and nothing proves it.
Deliverability problems feel random, but most have a cause you can find. This post shows where to look first, and what to fix in what order.
Read the headers before changing anything
Every receiving mail server records what it checked. In Gmail, open the message, choose "Show original", and look at the authentication results. They look like this:
Authentication-Results: mx.google.com;
dkim=pass header.d=esp-mail.net
spf=pass smtp.mailfrom=bounces.esp-mail.net
dmarc=fail (p=QUARANTINE) header.from=yourapp.com
Read it as three separate questions:
SPF: was the sending server allowed to send for the domain in the envelope (the bounce address)? Here, yes, but for the email service's bounce domain.
DKIM: is the message signed, and by whom? Here, yes, by the email service's domain.
DMARC: does either of those passing domains match the domain in the visible From address? Here, no. So DMARC fails, and the domain's own policy says to quarantine the message.
This is the most common pattern behind "it says delivered but it's in spam". Both checks pass, so a quick look says authentication is fine. It isn't, because neither check is aligned with your domain.
The test: send one message from each system that emails as your domain (the app, the newsletter tool, the CRM, the help desk) to a Gmail address. For each, check whether dmarc=pass. Any fail is your first fix, before content.
SPF: authorise your senders, and stay under ten lookups
SPF is a DNS TXT record on your domain listing the servers allowed to send for it:
v=spf1 include:_spf.google.com include:esp-mail.net ~all
Two things trip teams up.
SPF checks the envelope sender, not the From address. If your email service uses its own bounce domain, SPF passes for that domain and does nothing for DMARC on yours. Most services offer a custom bounce (return-path) domain, such as bounce.yourapp.com, which you set up with a CNAME. That makes SPF pass on a subdomain of your own domain, which counts for DMARC alignment.
SPF has a hard limit of ten DNS lookups. RFC 7208 counts every include, a, mx, ptr, exists and redirect, including those nested inside other includes. If evaluation needs more than ten, the result is permerror, and SPF fails for every message. Each new tool that asks you to "add our include" brings you closer to the limit, and some includes contain several more lookups each.
The test: count the lookups in your SPF record, including nested ones. Several free DNS tools do this. If you're at eight or more, remove includes for tools you no longer use before adding another.
DKIM: sign with your own domain
DKIM adds a cryptographic signature to each message. The signature names a domain (d= in the header), and the receiver checks it against a public key published in that domain's DNS.
If your email service signs with its own domain, DKIM passes but doesn't align. Every reputable service lets you sign with your domain instead: you add the CNAME or TXT records they give you, usually under a selector such as s1._domainkey.yourapp.com, and they sign with d=yourapp.com.
DKIM is the more robust of the two for DMARC, because the signature survives forwarding while SPF often doesn't. Set up DKIM on your own domain for every system that sends as you.
The test: in the headers of a message from each sender, check that header.d= is your domain or one of its subdomains.
DMARC: require alignment, then tighten the policy
DMARC is a DNS TXT record at _dmarc.yourapp.com. RFC 7489 defines it: a message passes if SPF or DKIM passes and the passing domain aligns with the domain in the From address. The record also says what receivers should do with failures and where to send reports.
Don't start with a strict policy. Turn it up in stages, using the aggregate reports (rua) to find every system sending as your domain:
Stage | Record | What happens to failing mail | Move on when |
1. Monitor | p=none; rua=mailto:dmarc@yourapp.com | Delivered as normal; you get reports | Reports show every legitimate sender passing |
2. Quarantine | p=quarantine | Usually sent to spam | A few weeks with no legitimate failures |
3. Reject | p=reject | Refused at the receiving server | Stay here; keep reading the reports |
The reports usually surprise people: a CRM sending as your domain, an old marketing tool, a help desk nobody mentioned. Each one needs SPF or DKIM aligned before you tighten the policy, or you'll quarantine your own mail.
The test: in your first week of DMARC reports, list every source sending as your domain. For each, name its owner and whether it passes. If you can't name the owner, find out before moving to quarantine.
Meet the mailbox providers' rules
Since 1 February 2024, Google has published requirements for anyone sending to Gmail accounts, with stricter ones for bulk senders:
Requirement | All senders | Over about 5,000 messages a day to Gmail |
Authentication | SPF or DKIM | SPF and DKIM, plus DMARC (p=none is the minimum) |
Alignment | Not required | From domain aligned with the SPF or DKIM domain |
Spam rate in Postmaster Tools | Below 0.3% | Below 0.3%; Google recommends below 0.1% |
Unsubscribe | Not specified | One-click unsubscribe on marketing mail, honoured within 48 hours |
Other | Valid forward and reverse DNS, TLS, RFC 5322 formatting | Same |
Google treats a sender who crosses the bulk threshold once as a bulk sender permanently. Transactional messages such as password resets are excluded from the one-click unsubscribe requirement, but not from authentication.
One-click unsubscribe is defined in RFC 8058. Marketing messages carry a List-Unsubscribe header with an HTTPS URL and a List-Unsubscribe-Post: List-Unsubscribe=One-Click header, both covered by the DKIM signature. Most email services add these if you turn the feature on.
In the US, the CAN-SPAM Act also requires a working opt-out on commercial email, honoured within 10 business days. Gmail's 48 hours is the stricter target to design for.
The test: check your Postmaster Tools spam rate for the last 30 days. If it's above 0.1%, look at who is complaining and why before sending more volume.
Separate transactional from marketing mail
Password resets and order confirmations are expected, and people rarely mark them as spam. Newsletters and promotions get more complaints. If they share a domain and a sending setup, a bad campaign can drag down the reputation your password resets depend on.
Send them as separate streams:
Different subdomains, such as mail.yourapp.com for transactional and news.yourapp.com for marketing, each with its own DKIM keys and bounce domain.
Separate streams or sub-accounts in your email service, so complaint and bounce rates are tracked apart.
The same organisational domain, so DMARC alignment still works. Subdomains align with the parent domain under DMARC's default relaxed alignment.
The test: could a marketing email with a high complaint rate affect your password reset delivery tomorrow? If they share a sending domain and stream, yes.
Keep the list clean
Reputation follows how recipients and their servers react to your mail.
Stop at the first hard bounce. An address that doesn't exist won't start existing. Your email service tells you through a webhook or suppression list; make sure your application reads it and stops sending.
Treat repeated soft bounces as a signal. A mailbox that's been full for weeks is probably abandoned.
Act on complaints immediately. When someone marks a message as spam, most large providers send a complaint report to your email service. Suppress that address for marketing straight away.
Don't send to people who never opted in. Purchased and scraped lists produce complaints and hit spam traps.
Content still matters, but less than folklore suggests. Clear subject lines, text that matches the subject, and a sensible balance of text and images help. Authentication, alignment and complaint rates matter more.
The test: does your application read bounce and complaint events from your email service and stop sending to those addresses? Check by looking for a suppression table or webhook handler, not by asking.
Choose a service by what it lets you control
Don't run your own SMTP server for application mail. A dedicated email service handles retries, bounce processing, feedback loops and IP reputation. When choosing one, check for:
Capability | Why it matters |
DKIM signing with your domain | Required for DMARC alignment |
Custom bounce (return-path) domain | Lets SPF align as well |
Separate streams or sub-accounts | Keeps marketing reputation away from transactional |
Bounce and complaint webhooks | Lets your app suppress addresses automatically |
Built-in one-click unsubscribe headers | Meets RFC 8058 and Gmail's bulk rules |
Dedicated IP as an option | Useful only with enough steady volume to build a reputation |
A dedicated IP isn't an upgrade by default. At low or irregular volume, a shared pool with good neighbours often performs better, because a new IP has no reputation of its own. Ask the provider what volume they recommend before buying one.
The test: for the service you use now, can you tick the first four rows? If not, those gaps are where the next delivery problem will come from.
A worked example
Here is the composite team from the opening. The figures are illustrative.
Before
Support tickets: "never got the reset email" 31 in a month
DMARC record p=quarantine, no rua
App mail (email service) SPF pass, DKIM pass,
DMARC fail: neither aligned
Newsletter tool not in SPF, no DKIM
SPF lookups 12: permerror on every check
Changes
DMARC set back to p=none with rua reports for three weeks
App mail: DKIM signed as d=mail.yourapp.com; bounce domain
bounce.mail.yourapp.com
Newsletter moved to news.yourapp.com with its own DKIM
Two unused includes removed from SPF: 12 lookups down to 7
Bounce and complaint webhooks wired to a suppression table
After
DMARC pass, all legitimate sources over 99% of volume
Support tickets about reset emails 3 the following month
Policy moved to p=quarantine after four clean weeks
The team never changed the wording of the email. Every fix was in DNS, the email service's settings, or the application's bounce handling.

What to do this week
Send one message from every system that emails as your domain to a Gmail address, and check dmarc=pass in each. Count your SPF lookups. If you have no DMARC record, publish p=none with a reporting address and read the first week of reports. If you send marketing mail, confirm one-click unsubscribe is on and that unsubscribes take effect within 48 hours. Then check that your application acts on bounce and complaint events. If those events arrive through background jobs, Scheduling Tasks: Cron, Queues, and Background Jobs covers making them reliable.
Final takeaway
Most "sent but in spam" problems are authentication that passes without aligning with your domain. Read the headers before rewriting content. Give SPF a bounce domain of your own and keep it under ten lookups, and sign DKIM with your domain. Bring DMARC in at p=none, use the reports to find every sender, then tighten the policy. Meet Gmail's published rules on authentication, spam rate and one-click unsubscribe. Keep transactional and marketing mail on separate subdomains, and let bounces and complaints remove addresses automatically.
Sources
Google, "Email sender guidelines", Google Workspace Admin Help: requirements for all senders and for senders of more than 5,000 messages a day, effective 1 February 2024; spam rate below 0.3%, recommended below 0.10%. https://support.google.com/a/answer/81126
Google, "Email sender guidelines FAQ", Google Workspace Admin Help: unsubscribe requests honoured within 48 hours; bulk sender status is permanent; transactional messages excluded from one-click unsubscribe. https://support.google.com/a/answer/14229414
Kitterman, S., "Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1", RFC 7208, 2014, §4.6.4: implementations MUST limit DNS-querying terms to 10 and return "permerror" if exceeded. https://www.rfc-editor.org/rfc/rfc7208
Kucherawy, M. and Zwicky, E., "Domain-based Message Authentication, Reporting, and Conformance (DMARC)", RFC 7489, 2015, §3.1: DMARC requires the From domain to align with an authenticated identifier. https://www.rfc-editor.org/rfc/rfc7489
Levine, J. and Herkula, T., "Signaling One-Click Functionality for List Email Headers", RFC 8058, 2017: List-Unsubscribe with an HTTPS URI, List-Unsubscribe-Post "List-Unsubscribe=One-Click", both covered by DKIM. https://www.rfc-editor.org/rfc/rfc8058
US Federal Trade Commission, "CAN-SPAM Act: A Compliance Guide for Business": opt-out requests honoured within 10 business days; transactional or relationship messages exempt from most provisions. https://www.ftc.gov/business-guidance/resources/can-spam-act-compliance-guide-business
Related reading
Keep learning. This article is part of the Automation & Process Improvement path in the ShiftQuality Learning Center. Remove the repetitive work — and keep the automation from becoming new debt.


