Tutorial

Why Are My Emails Going to Spam? A Complete Deliverability Fix Guide

April 10, 2026

Back to Blog

You have spent hours crafting the perfect email — a welcome message, an invoice, a password reset, or a marketing campaign. You hit send, and it vanishes into the void. No bounce, no error, no delivery. It just lands in spam, or worse, never arrives at all. Email deliverability is a complex system of authentication records, IP reputation, content analysis, and sending practices. When any piece fails, your emails go to spam.

This guide walks you through every aspect of email deliverability, from DNS authentication records to content optimization, with exact commands to diagnose and fix each issue. By the end, you will have a systematic checklist for ensuring your emails reach the inbox.

How Email Authentication Works

Modern email relies on three authentication systems that work together to verify the legitimacy of a message. Understanding how these three protocols interact is essential before you can fix deliverability issues.

SPF
Who can send
DKIM
Message integrity
DMARC
Policy & reporting
Inbox
ProtocolWhat It DoesDNS Record Type
SPFLists which IP addresses are authorized to send email for your domainTXT record on root domain
DKIMAdds a cryptographic signature to each email to prove it was not tampered withTXT record on selector._domainkey subdomain
DMARCTells receiving servers what to do when SPF or DKIM fails, and where to send reportsTXT record on _dmarc subdomain

Step 1: Check Your PTR Record (Reverse DNS)

The PTR record maps your server's IP address back to a hostname. This is the first thing receiving mail servers check. If your sending IP does not have a valid PTR record, many servers will reject the email outright.

# Check PTR record for your server IP
$ dig -x 203.0.113.10 +short
mail.example.com.

# Verify the forward DNS matches
$ dig mail.example.com A +short
203.0.113.10

# Both should match! (Forward-confirmed reverse DNS)
Gmail Error 5.7.25
If you see the bounce message "The IP address sending this message does not have a PTR record setup," your server lacks a PTR record. Contact your hosting provider or VPS provider to set it. PTR records are managed by the IP address owner, not your DNS provider. Point the PTR to a hostname like mail.yourdomain.com, and make sure that hostname resolves back to the same IP.

Step 2: Verify SPF Record

SPF (Sender Policy Framework) is a DNS TXT record that lists which servers are authorized to send email for your domain. Without SPF, any server in the world can claim to send email from your domain.

# Check your SPF record
$ dig example.com TXT +short | grep spf
"v=spf1 ip4:203.0.113.10 include:_spf.google.com -all"

Understanding SPF Syntax

MechanismPurposeExample
ip4:Authorize a specific IPv4 address or rangeip4:203.0.113.10
ip6:Authorize a specific IPv6 address or rangeip6:2001:db8::/32
include:Include another domain's SPF recordinclude:_spf.google.com
aAuthorize the domain's A record IPa
mxAuthorize the domain's MX record IPsmx
-allHard fail — reject all non-matching sendersRecommended
~allSoft fail — accept but mark suspiciousAcceptable
?allNeutral — no policyUseless
SPF Lookup Limit
SPF records are limited to 10 DNS lookups. Each include:, a, mx, and redirect mechanism counts as a lookup. Exceeding 10 lookups causes a permanent SPF error (PermError), and many receivers treat this as a failure. If you use multiple email services (Google Workspace, Mailchimp, SendGrid, etc.), you can easily exceed this limit. Use tools like mxtoolbox.com/spf.aspx to count your lookups.
Gmail 2025+ Requirement
Google now requires bulk senders (5,000+ messages/day) to use -all (hard fail) in their SPF records. The lenient ~all soft fail is no longer sufficient for full deliverability. If you send any volume of email, switch to -all.

Step 3: Verify DKIM Signing

DKIM (DomainKeys Identified Mail) adds a cryptographic signature to every outgoing email. The receiving server uses your public key (published in DNS) to verify the signature, confirming the email was not modified in transit and was sent by an authorized server.

# Check DKIM public key (replace 'default' with your selector)
$ dig default._domainkey.example.com TXT +short
"v=DKIM1; h=sha256; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAO..."

# If you don't know your selector, check email headers:
# Look for: DKIM-Signature: ... s=selector; d=example.com

How to Find DKIM Issues in Email Headers

When you receive a bounced email or want to check DKIM for a sent message, look at the email headers. In Gmail, click the three dots on a message and select "Show original."

# Healthy DKIM header
Authentication-Results: mx.google.com;
dkim=pass [email protected] header.s=default;
spf=pass (google.com: 203.0.113.10 is permitted by SPF);
dmarc=pass (p=QUARANTINE) header.from=example.com

# Failed DKIM (message was modified or key mismatch)
Authentication-Results: mx.google.com;
dkim=fail (body hash did not verify);
Common DKIM Failure Causes
Body hash mismatch — a mailing list or forwarding service modified the message body after signing. Use relaxed/relaxed canonicalization to tolerate minor modifications. Key not found — the DKIM DNS record is missing or not propagated. Signature expired — the signature has a timestamp and validity period that has passed. Wrong selector — the DNS record uses a different selector than the one in the signature.

Step 4: Verify DMARC Policy

DMARC (Domain-based Message Authentication, Reporting, and Conformance) ties SPF and DKIM together and tells receiving servers what to do when authentication fails.

# Check DMARC record
$ dig _dmarc.example.com TXT +short
"v=DMARC1; p=quarantine; rua=mailto:[email protected]; ruf=mailto:[email protected]; fo=1"
TagPurposeRecommended Value
p=Policy for failing messagesquarantine or reject
rua=Aggregate report destinationmailto:[email protected]
ruf=Forensic report destinationmailto:[email protected]
fo=When to send forensic reports1 (on any failure)
pct=Percentage of messages to apply policy100 (default)
adkim=DKIM alignment moder (relaxed)
aspf=SPF alignment moder (relaxed)
DMARC Policy Progression
Start with p=none to collect reports without affecting delivery. After analyzing reports for 2-4 weeks, move to p=quarantine (spam folder). Once confident, upgrade to p=reject (block completely). Never jump straight to reject without monitoring — you might block legitimate email from third-party services that send on your behalf.

Step 5: Check Blacklist Status

If your server IP address is listed on email blacklists (also called blocklists or DNSBLs), your emails will be rejected or sent to spam regardless of your authentication setup.

# Check against major blacklists manually
$ dig +short 10.113.0.203.zen.spamhaus.org A
(no output = not listed)

# If listed, you'll see something like:
127.0.0.2 (SBL - Spamhaus Block List)
127.0.0.4 (XBL - Exploits Block List)
127.0.0.10 (PBL - Policy Block List)

For comprehensive checking, use online tools that query multiple blacklists simultaneously:

MXToolbox Blacklist Check

Checks 100+ blacklists at once. Visit mxtoolbox.com/blacklists.aspx and enter your server IP.

Spamhaus Lookup

The most influential blacklist. Visit check.spamhaus.org — being listed here is the most damaging to your reputation.

Delisting Process
Each blacklist has its own delisting procedure. Spamhaus usually deactivates listings automatically after the abuse stops. Other lists require manual delisting requests. Before requesting delisting, identify and fix the cause — if the issue persists, you will be relisted and future requests may be denied.

Step 6: IP Reputation and Warm-Up

If you are sending from a new IP address, email providers are inherently suspicious. A new IP with no sending history has zero reputation, and sending a large volume immediately looks like spam behavior.

1

Week 1: Seed Phase

Send 50-100 emails per day to your most engaged recipients — people who will open and interact with your emails. This establishes positive signals.

2

Week 2-3: Ramp Up

Double your volume every 2-3 days. Monitor bounce rates and spam complaints. If either exceeds 2%, slow down.

3

Week 4+: Full Volume

Gradually reach your target sending volume. Continue monitoring deliverability metrics.

DayRecommended VolumeNotes
1-350-100 emailsSend to known, active recipients only
4-7200-500 emailsMonitor opens, clicks, bounces
8-14500-2,000 emailsGradually include broader audience
15-212,000-10,000 emailsContinue monitoring spam complaint rate
22-30Target volumeFull sending capacity reached

Step 7: Content Analysis

Even with perfect authentication, your email content can trigger spam filters. Content-based filtering analyzes the text, HTML structure, and formatting of your emails.

Common Content Triggers

Avoid These

  • ALL CAPS in subject lines or body
  • Excessive exclamation marks!!!
  • Spam trigger phrases: "Act now", "Limited time", "Free money", "Click here"
  • Image-only emails with no text
  • Too many links (especially shortened URLs)
  • Mismatched From address and Reply-To
  • Missing unsubscribe link (for marketing)
  • HTML-only with no text/plain alternative

Best Practices

  • Maintain a good text-to-HTML ratio (60:40 minimum)
  • Include a clear unsubscribe mechanism
  • Use a recognizable From name
  • Send both HTML and plain text versions
  • Personalize when possible (reduces spam signals)
  • Keep image sizes reasonable (under 1 MB total)
  • Use full URLs instead of URL shorteners
  • Include your physical address (CAN-SPAM requirement)

Step 8: Test Your Configuration

Before sending to real recipients, use testing tools to evaluate your full email setup.

mail-tester.com

Send a test email to the provided address and get a score out of 10. Checks SPF, DKIM, DMARC, blacklists, content, and formatting. Aim for a score of 9 or above.

Gmail Postmaster Tools

Free tool from Google that shows your domain's reputation, spam rate, authentication rates, and delivery errors. Requires domain verification and sufficient volume to show data.

MXToolbox Deliverability

Comprehensive suite that checks your DNS records, blacklist status, and mail server configuration in one pass.

Command-Line Testing

Send a test email and check the raw headers for authentication results. The Authentication-Results header shows SPF, DKIM, and DMARC pass/fail status.

# Send a test email from command line
$ echo "This is a test email." | mail -s "Test from server" [email protected]

# Check mail queue for stuck messages
$ mailq
Mail queue is empty

# Check mail logs for delivery status
$ tail -20 /var/log/mail.log
Mar 17 10:30:01 server postfix/smtp[1234]: ABC123: to=<[email protected]>,
relay=gmail-smtp-in.l.google.com[142.250.x.x]:25,
status=sent (250 2.0.0 OK)

Complete Deliverability Checklist

  • PTR record exists and matches the forward DNS of your mail hostname
  • SPF record published with all sending IPs and -all at the end
  • SPF record has 10 or fewer DNS lookups
  • DKIM signing is active with 2048-bit RSA key (minimum)
  • DKIM public key is published in DNS and matches the private key
  • DMARC record is published with at least p=quarantine
  • DMARC reporting addresses (rua and ruf) are configured
  • Server IP is not on any major blacklists
  • Email content passes spam filter checks (mail-tester.com score 9+)
  • Both HTML and plain-text parts are included in multipart emails
  • Unsubscribe link is present in marketing emails
  • Bounce handling is configured to remove invalid addresses
  • New IP has been properly warmed up before high-volume sending
  • TLS is enabled for outbound connections (smtp_tls_security_level=may)

Automated DNS Authentication with Panelica

Configuring SPF, DKIM, and DMARC records correctly requires understanding both the DNS and mail server sides of the equation. Getting even one detail wrong — like a mismatched DKIM selector or an SPF record with too many lookups — can cause deliverability issues that are hard to diagnose.

Auto DNS
SPF, DKIM, DMARC records configured automatically via Cloudflare integration
DKIM
OpenDKIM signing with 2048-bit keys, auto-configured per domain

Panelica's Mail DNS Sync feature automatically configures all six essential mail DNS records when you enable email for a domain: MX record, mail A record, SPF (with hard fail), DKIM (2048-bit RSA), DMARC (with reporting), and the mail subdomain SPF record for HELO identity. The built-in Postfix mail server supports proper DKIM signing through OpenDKIM, and TLS is enabled by default for secure mail delivery.

Key Takeaway
Email deliverability is not a single fix — it is a system of interconnected components that all need to work correctly. Start with the authentication fundamentals (PTR, SPF, DKIM, DMARC), verify you are not blacklisted, warm up new IPs gradually, and pay attention to content quality. Regular monitoring through tools like Gmail Postmaster Tools and periodic mail-tester.com checks will keep your emails landing in the inbox.
Share: