Docs / Email Servers / How to Debug Email Delivery Issues

How to Debug Email Delivery Issues

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 69 views · 2 min read

Check If Your Server Can Send Mail

# Test with sendmail
echo "Test" | sendmail -v user@gmail.com

# Check mail queue
postqueue -p

# Check mail log
tail -f /var/log/mail.log

Common Delivery Problems

1. Email Goes to Spam

# Check your authentication records
dig example.com TXT +short | grep spf
dig mail._domainkey.example.com TXT +short
dig _dmarc.example.com TXT +short

All three (SPF, DKIM, DMARC) should be properly configured.

2. IP Is Blacklisted

# Check Spamhaus
dig +short YOUR_IP_REVERSED.zen.spamhaus.org
# Empty = not listed, 127.0.0.x = listed

# Check multiple blacklists at once
# Use MXToolbox.com blacklist check

3. Port 25 Is Blocked

# Test outbound port 25
telnet gmail-smtp-in.l.google.com 25
# If it times out, your provider blocks port 25

Solution: Use a relay service (SendGrid, Mailgun, Amazon SES) on port 587.

4. Missing PTR Record

dig -x YOUR_IP +short
# Should return your mail hostname

5. TLS Issues

# Test TLS
openssl s_client -starttls smtp -connect mail.example.com:587

Email Testing Tools

  • mail-tester.com — send a test email, get a spam score
  • MXToolbox — check DNS records, blacklists, and connectivity
  • Gmail headers — check Received-SPF, DKIM, and DMARC results

Reading Email Headers

In Gmail, click the three dots on any email → "Show original". Look for:

Received-SPF: pass
DKIM-Signature: ... (verify with dkim=pass)
Authentication-Results: dmarc=pass

Was this article helpful?