Day 4 · Deliverability & spam

Why emails go to spam: every common cause and how to fix it

lesson 12 / 1916 min1 labpublished
Course contents
On this page
  1. Who decides, and how
  2. The causes, one by one
  3. Myths worth dropping
  4. Blocklists (DNSBLs)
  5. Finding out why a message went to spam

“Our emails are going to spam” is the most common email complaint an IT person hears, and the least precise. Spam filtering isn’t one test but a pipeline of decisions, each made by the receiver with information you only partly control. This lesson explains how that pipeline works, then goes through every common reason legitimate mail ends up in the spam folder, grouped so you can check them one by one, with the fix for each. At the end you score messages with a real spam filter.

Who decides, and how

The receiving system decides, and you never see its full reasoning. But all filters, from Gmail’s to a company’s own Rspamd, follow roughly the same stages, from cheap to expensive:

1. ConnectionIP reputation · blocklists · PTRreject / defer2. SMTP dialogueHELO · sender · recipient · TLSreject (5xx)3. AuthenticationSPF · DKIM · DMARC · ARCDMARC policy4. Contentlinks · attachments · HTML · textquarantine5. Reputation & peopledomain · complaints · historyspam folderInbox (or a tab)
The stages of a typical filter. Early stages can reject during the SMTP session; later stages decide between quarantine, the spam folder and the inbox.
  1. Connection. Before the sender says anything, the receiver knows the IP address. Is it on a blocklist? Does it have a proper PTR? Is it a residential or dynamic address? What is its reputation in the receiver’s own data? Is it opening too many connections? Bad answers here mean an immediate rejection or a temporary deferral (rate limiting).
  2. SMTP dialogue. Is the HELO name valid? Does the sender’s domain exist? Does the recipient exist? Is the client using TLS? Is it behaving like a real MTA (waiting for replies, retrying after a 4xx)?
  3. Authentication. SPF, DKIM, DMARC and ARC. A DMARC failure for a domain with p=reject is rejected here; missing authentication counts heavily against the message even without DMARC.
  4. Content. Links (and the reputation of their domains), attachments (malware scanning, dangerous types), the HTML and the text, compared with known spam and phishing.
  5. Reputation and people. The reputation of the domains involved (From, DKIM d=, links), built from everything the receiver has seen: how many recipients marked mail from this sender as spam, how many opened, replied, moved it out of spam, or deleted it unread. Plus this particular recipient’s history with the sender: contacts, previous replies, personal filters.

Large mailbox providers combine all of this in machine-learning models, and their strongest signals are reputation and user engagement. Content rules, the “spam words” everyone worries about, matter much less at Gmail than in a company’s own filter, but they do matter there.

Inbox, spam, or rejection

  • Rejected (a bounce): the receiver refused during SMTP. You get an error code, which is good: you know, and you can act. Common for blocklisted IPs, failed DMARC with p=reject, and the Gmail/Microsoft sender requirements.
  • Spam folder: accepted, but filed as junk. The sender gets no signal at all. This is the hard case.
  • Quarantine: held by a company’s gateway or Microsoft 365 for an admin or the user to release.
  • Inbox, but in a tab: Gmail’s Promotions or Updates tabs are not spam. They are a classification of the content type, and trying to “escape the Promotions tab” with tricks usually makes things worse.

The causes, one by one

1. Identity and authentication

CauseHow to recognize itFix
No SPF, no DKIM, or neitherspf=none, dkim=none in Authentication-ResultsPublish SPF; enable DKIM for every sender (lessons 8–9)
SPF or DKIM passes, but for another domain (no alignment)dmarc=fail while spf=pass or dkim=passCustom return-path and DKIM with your domain at every ESP and SaaS tool (lesson 10)
Broken SPF (two records, more than 10 lookups)spf=permerrorMerge records, cut lookups
DKIM broken by a footer, disclaimer or gateway added after signingdkim=fail (body hash did not verify)Sign last
DMARC fails and the domain has p=quarantine or p=rejectdmarc=fail (p=QUARANTINE ...)Fix alignment for that sender
The From domain doesn’t exist or can’t receive mail (no MX, no A)Rejected or penalized as unverifiableSend from a real domain that receives replies and bounces
Display name or From that impersonates a known brand or personLands in spam or is flagged as phishingDon’t; send as yourself
From, Reply-To and link domains that have nothing to do with each otherLooks like phishingKeep the domains of a message consistent

2. Infrastructure

CauseHow to recognize itFix
The sending IP is on a blocklistBounces naming Spamhaus, Barracuda, etc.; blocklist lookupFind and fix the cause (a compromised account, an open relay, a bad list), then request delisting
No PTR, a generic PTR, or a PTR that doesn’t matchGmail 550 5.7.25; rDNS rules in headersSet a PTR matching the server’s HELO name (lesson 5)
Sending from a home or dynamic IPSpamhaus PBL listing, immediate rejectionSend through your provider or an ESP
Shared IP pool with bad neighbors at a cheap ESPProblems you didn’t cause, varying by dayBetter ESP, or a dedicated IP once your volume justifies it
No TLSGmail rate limits or rejects mail not sent over TLSEnable TLS on your outgoing server
A new IP or a new domain (no reputation yet)Deferrals and spam placement at first, improving slowlyWarm up gradually (lesson 13)
IPv6 sending without PTR or authenticationGmail rejects IPv6 mail without PTRFix PTR, or send over IPv4

3. Reputation and sending behavior

CauseHow to recognize itFix
Too many spam complaints (“Report spam” clicks)Google Postmaster Tools spam rate; Microsoft SNDS; feedback loop reportsSend only what people asked for, make unsubscribing easy, keep Gmail’s rate under 0.1% and never reach 0.3%
Hitting spam trapsSudden blocklisting, reputation dropNever buy or scrape lists; confirm sign-ups; remove inactive addresses
High bounce rate (invalid addresses)Many 550 5.1.1 in your logsClean lists; suppress hard bounces immediately
Sudden volume spikesRate-limit deferrals (421 4.7.28 at Gmail)Send at a steady, predictable volume; ramp up gradually
Low engagement: mail nobody opens or readsSlow slide from inbox to spam over weeksStop mailing inactive recipients; send less, better
Link domains with a bad reputation (a shared URL shortener, a tracking domain used by spammers)Content rules about URLs; domain blocklists (Spamhaus DBL, SURBL, URIBL)Use your own domain for links and tracking; no public shorteners
A compromised account sent spam from your domain or IPQueue full of junk, outbound spam alerts, blocklistingIncident response: lock the account, purge the queue, then rebuild reputation

4. Content

CauseWhy it hurtsFix
Only an image, or very little textFilters can’t read images; image-only mail is a classic spam trickReal text content, images as illustration (lesson 15)
Link text that shows one URL and links to anotherThe classic phishing patternMake visible URLs match their targets, or use plain words as link text
Links to bare IP addresses, URL shorteners, many redirectsHides the destinationLink directly to your own domain over HTTPS
Broken or bloated HTML, hidden text, tiny or invisible fontsSigns of filter evasionClean, simple HTML from a tested template
No plain-text partA minor signal, but free to fixSend multipart/alternative
Dangerous attachments (executables, macros, HTML files, encrypted archives)Malware risk; often blocked outrightSend links to files instead
Missing or malformed headers (no Message-ID, no Date, bad MIME)Real mail software doesn’t do thatUse a proper library or MTA
Misleading subject lines, fake “RE:” or “FWD:”, shouting, !!!, $$$Classic spam patterns; also annoys recipients into complainingWrite honest subjects
No visible unsubscribe in bulk mail, no List-Unsubscribe headersPeople hit “Report spam” instead; also a Gmail/Yahoo requirementOne-click unsubscribe (lesson 13)

5. The audience and the recipient

  • No real consent. Purchased lists, scraped addresses, “everyone who ever gave us a business card”: the single biggest cause of bad reputation, and in many countries illegal.
  • Old lists. Addresses that haven’t received mail for a year or more bounce, and some have been turned into recycled spam traps.
  • Mail people don’t expect: sent too often, or about something different from what they signed up for.
  • The recipient’s own history. If this person marked your earlier mail as spam, more of it will go there, regardless of anything else. Their filters, blocked senders and company policies apply too.

Myths worth dropping

  • “There’s a list of spam words.” Big providers don’t work from a word list. Content can contribute, especially in smaller filters (you’ll see SpamAssassin’s rules below), but no word sends a message from a reputable, authenticated sender to spam by itself.
  • “Keep a 60/40 text-to-image ratio.” There’s no magic ratio. Image-only mail is the problem; a normal newsletter with images and real text is fine.
  • “A 10/10 on a testing site means inbox.” Tools that score a test message check authentication and content well, but they can’t see your reputation with Gmail or your recipients’ engagement, which matter most.
  • “Seed tests show where my mail lands.” Seed addresses don’t behave like real recipients, and providers personalize placement per recipient. They’re a rough indicator, not the truth.

Blocklists (DNSBLs)

A blocklist is a DNS zone: to check IP 198.51.100.9, reverse its octets and look up 9.100.51.198.zen.spamhaus.org. An answer in 127.0.0.x means “listed” (the last octet says which list); no answer means not listed. Every blocklist keeps one test address permanently listed, 127.0.0.2, so you can verify that lookups work:

dig +short 2.0.0.127.zen.spamhaus.org        # test entry: always listed
dig +short 9.100.51.198.zen.spamhaus.org     # your IP, octets reversed

The ones you’ll meet most:

ListWhat it lists
Spamhaus ZENThe combination of SBL (spam sources), XBL/CSS (infected and abused hosts) and PBL (IPs that shouldn’t send directly at all, such as home connections)
Spamhaus DBLDomains found in spam (links, senders)
Barracuda BRBLIPs seen sending spam to Barracuda’s customers
SpamCopIPs reported by users; entries expire quickly
SURBL, URIBLDomains found in message bodies

Notes: Spamhaus doesn’t answer queries that come through large public resolvers (it returns error codes in 127.255.255.x instead), so check from your own resolver or use their website. Delisting is usually free after you fix the cause; a list that charges for removal deserves skepticism. And the big mailbox providers rely mostly on their own reputation data, so being off every public list doesn’t guarantee Gmail likes you.

Finding out why a message went to spam

  • Read the headers of a message in the spam folder (lesson 14 shows how): Authentication-Results first. Gmail also shows a short reason in a banner above spam messages (“This message is similar to messages that were identified as spam in the past”, “Gmail couldn’t verify that this message was sent by…”).
  • Microsoft 365 writes its verdict in headers: X-Forefront-Antispam-Report contains SCL (spam confidence level: -1 trusted, 0–1 clean, 5–6 spam, 9 high-confidence spam), SFV (the filter verdict, such as SPM for spam or NSPM for not spam), CIP (the connecting IP), and X-Microsoft-Antispam contains BCL (bulk complaint level, 0–9).
  • SpamAssassin and Rspamd list every rule that matched in X-Spam-Status or X-Spamd-Result, with scores.
  • Google Postmaster Tools and Microsoft SNDS show your domain’s and IPs’ reputation and spam rates at those providers. Set them up before you need them.
  • DMARC reports show authentication failures across all receivers.