You press send. Your email leaves your outbox. And then — somewhere in the milliseconds between your server and the recipient's inbox — a decision gets made.
That decision determines whether your message is seen by a human, banished to the spam folder, or silently discarded. And it's made not by a person, but by an algorithm running hundreds of checks in real time.
Understanding how email spam filters work is the closest thing to having X-ray vision into your email deliverability. Here's exactly what happens inside the black boxes at Gmail, Microsoft, and Yahoo.
In this guide:
The Three-Layer Filtration Model
Every major inbox provider runs incoming mail through a layered filtration system. Think of it like airport security:
Layer | What Happens | Bad Outcome |
|---|
Connection-level | Is this server allowed to talk to us? IP reputation, TLS, rDNS, rate limits | Connection refused |
Authentication | Can the sender prove they are who they claim to be? SPF, DKIM, DMARC | Rejected or flagged |
Content & Reputation | Does this message look like spam? Machine learning, user feedback, heuristics | Spam folder |
Each layer eliminates some percentage of incoming mail. By the time a message reaches the third layer, most spam has already been stopped. The messages that survive all three layers reach the inbox.
Layer 1: Connection-Level Checks
Before a single byte of your email content is examined, the receiving server decides whether to accept the connection at all.
IP Reputation
Every sending IP address has a reputation score maintained independently by each major provider. This score is the single most important factor in whether your mail is accepted.
Gmail, Microsoft, and Yahoo each maintain their own reputation databases. They track:
- Volume patterns: Is the IP sending consistent, predictable volumes? Or does it spike erratically?
- Spam complaint rates: What percentage of recipients mark mail from this IP as spam?
- Bounce rates: How many messages to invalid addresses?
- Blacklist status: Is the IP listed on any major DNSBLs (Spamhaus, Barracuda, SORBS)?
A new IP starts with a neutral reputation. It takes 4-6 weeks of consistent, low-complaint sending to build a good reputation — and one bad campaign can destroy it overnight.
TLS Encryption
Gmail has required TLS for all incoming connections since 2016. Microsoft and Yahoo have similar requirements. If your sending server doesn't support TLS 1.2 or higher, the connection is downgraded or refused.
For high-volume senders, MTA-STS (Mail Transfer Agent Strict Transport Security) goes a step further by publishing a policy that requires TLS and certificate validation. Without it, you're missing a trust signal.
Rate Limiting
Every provider imposes rate limits. Exceed them and your connections are throttled or rejected. The limits are dynamic — a sender with a good reputation gets higher limits than one with a poor reputation.
Google publishes recommended sending limits in their Postmaster Tools. Microsoft exposes similar data through SNDS (Smart Network Data Services).
Reverse DNS (rDNS)
Your sending IP must have a PTR record that resolves to a valid hostname, and that hostname's A record must point back to the same IP (forward-confirmed reverse DNS). Without FCrDNS, your server looks like a compromised residential machine — an instant spam signal.
Layer 2: Authentication Checks
If your mail passes the connection-level gauntlet, it faces authentication. This is where SPF, DKIM, and DMARC do their work.
SPF (Sender Policy Framework)
How it works: The receiving server checks the Return-Path domain's DNS for an SPF record. It extracts all authorized IPs from that record and checks if the sending server's IP is listed.
What happens on failure: If the IP isn't authorized, the server checks the SPF qualifier:
-all (hard fail): Message is rejected or marked as spam~all (soft fail): Message is accepted but flagged — it may still reach the inbox if other signals are strong?all (neutral): No assertion is made — essentially useless
In 2026, ~all is the minimum acceptable policy. Most major senders use -all to prevent spoofing.
DKIM (DomainKeys Identified Mail)
How it works: The sending server signs the message with a private key. The receiving server fetches the public key from the sender's DNS and verifies the signature. If the signature is valid, the message hasn't been altered in transit.
What happens on failure: A DKIM failure doesn't automatically send mail to spam, but it removes a strong positive signal. Messages that fail DKIM are treated with much more suspicion — especially if other signals (SPF, IP reputation) are also weak.
DMARC (Domain-based Message Authentication, Reporting, and Conformance)
How it works: DMARC ties SPF and DKIM together. It checks whether at least one of them passes AND aligns with the From: domain. It also specifies what to do on failure:
p=none: Monitor only, take no actionp=quarantine: Send to spamp=reject: Reject outright
What happens on failure: With p=reject, the message never reaches the recipient — it's bounced at the server level. With p=quarantine, it goes to spam. With p=none, it may still reach the inbox, but other signals (reputation, content) will decide.
The real power of DMARC is the reporting. DMARC aggregate reports (rua) tell you exactly who is sending email on your domain's behalf — authorized or not.
ARC (Authenticated Received Chain)
ARC is used primarily by mailing lists and forwarders. When a mailing list forwards your message, it breaks SPF (the forwarding server's IP isn't in your SPF record). ARC preserves the original authentication results so the final recipient can still verify them.
Without ARC support, forwarded messages from legitimate mailing lists often fail authentication and end up in spam.
Layer 3: Content Analysis and Machine Learning
This is the layer most people think of when they hear "spam filter" — but it's actually the last line of defense, not the first.
The Bayesian Filter
Bayesian spam filters use statistical analysis to calculate the probability that a message is spam based on its content. They learn from:
- Words and phrases commonly found in spam
- Words and phrases commonly found in legitimate mail (ham)
- The ratio of spam-to-ham characteristics
A message with "free," "act now," and "limited offer" scores higher on the spam probability scale. A message with "meeting agenda," "quarterly report," and "attached invoice" scores lower.
But in 2026, Bayesian filtering is no longer the primary content filter. Machine learning models have largely replaced it.
Google's Machine Learning Engine
Gmail's spam filter is now primarily ML-driven. Google has trained models on billions of messages — both spam and legitimate — and the models learn continuously from user feedback (the "Mark as spam" and "Not spam" buttons).
Key signals the Gmail ML model evaluates:
- User engagement history: Has this recipient opened, clicked, replied to, or deleted messages from this sender before?
- Sender history: What is this sender's overall complaint rate, bounce rate, and engagement across all Gmail users?
- Content patterns: Does the message structurally resemble known spam campaigns?
- Link reputation: Are the URLs in the message associated with phishing, malware, or spam?
- Attachment analysis: Are attachments scanned for malware and suspicious patterns?
The model is a black box — Google doesn't publish its exact algorithm. But we know it's heavily weighted toward engagement signals. A sender with low complaint rates and high engagement gets a massive head start regardless of content.
Microsoft's Filtering (Exchange Online Protection)
Microsoft's approach is more transparent than Google's. EOP uses:
- Connection filtering: IP allow/block lists, safe lists
- Anti-spam policies: Configurable thresholds for spam confidence level (SCL)
- Advanced Threat Protection (ATP): Safe Links and Safe Attachments scanning
- Reputation-based filtering: Similar to Gmail's IP and domain reputation systems
Microsoft also exposes a Bulk Complaint Level (BCL) score (1-9) for bulk mail. A BCL above 5 means higher likelihood of spam filtering.
Yahoo's Filtering
Yahoo (now under Apollo Global Management) uses a similar multi-layered approach. Their filtering emphasizes:
- Domain reputation over IP reputation (Yahoo was an early adopter of domain-based reputation)
- DMARC compliance — Yahoo is aggressive about rejecting DMARC failures
- User engagement — like Gmail, user behavior heavily influences filtering
How Reputation Scoring Actually Works
Reputation isn't a single number — it's a composite built from dozens of signals. Here's a simplified model of how a typical provider scores your mail:
Reputation Score =
(IP Reputation × 0.35) +
(Domain Reputation × 0.25) +
(Authentication Signals × 0.20) +
(Engagement Signals × 0.15) +
(Content Signals × 0.05)
The weights are approximate and vary by provider, but the pattern is consistent: infrastructure and behavior matter far more than content.
A message with perfect authentication but terrible IP reputation will still land in spam. A message with mediocre content but excellent engagement history will reach the inbox.
Real-Time Blacklists (DNSBLs)
Over 100 public DNSBLs track known spam sources. The most influential:
- Spamhaus: The most widely used — a Spamhaus listing affects deliverability across virtually all providers
- Barracuda: Heavily used by corporate mail systems
- SORBS: Tracks open relays and compromised servers
- Invaluement: Focuses on snowshoe spam (distributed across many IPs)
A listing on any major DNSBL dramatically reduces your reputation score. Most providers check multiple blacklists during the connection phase.
Putting It All Together: A Real-World Example
Let's trace a message through Gmail's filters:
- Connection: Your server at 192.0.2.100 connects to Gmail's MX. Gmail checks the IP's reputation — it's been sending consistently for 6 months with a 0.05% complaint rate. Reputation: Good. Connection accepted.
- Authentication: Gmail checks SPF — your IP is authorized. Pass. Checks DKIM — signature valid. Pass. Checks DMARC — aligned with
From: domain, policy is p=reject. Pass. Authentication: Clean. - Engagement: Gmail checks the recipient's history with your domain. They've opened 6 of your last 10 messages and replied to one. Engagement: Strong.
- Content: ML model scans the content. No suspicious URLs, no phishing patterns, no known spam templates. Content: Clean.
- Result: Inbox. Total processing time: under 100 milliseconds.
Now the same scenario with a different sender:
- Connection: IP has been sending for 3 days, volume spiked 500% today, complaint rate is 0.4%. Reputation: Poor. Connection is throttled.
- Authentication: SPF passes. DKIM is missing. DMARC policy is
p=none. Authentication: Weak. - Engagement: Recipient has never interacted with this sender. Engagement: None.
- Content: Contains "FREE OFFER" in all caps, three exclamation marks, and a shortened URL. Content: Suspicious.
- Result: Spam folder. Processing time: same 100 milliseconds.
What This Means for You
If you take one thing from this guide, make it this: spam filters don't read your email. They read your reputation.
The content of your message matters far less than:
- Whether your authentication is properly configured (SPF, DKIM, DMARC)
- What your sending IP and domain reputation scores are
- How recipients have historically engaged with your mail
- Whether your sending patterns are consistent and predictable
Fix these, and the content almost takes care of itself.
Want to see exactly how Gmail, Microsoft, and Yahoo score your emails? mailtest.ai runs real inbox placement tests and shows you where your messages land — inbox, spam, or blocked.