Docs / Email Servers / Troubleshooting Email Delivery Issues

Troubleshooting Email Delivery Issues

By Admin · Feb 25, 2026 · Updated Apr 25, 2026 · 29 views · 1 min read

Check Mail Queue

# View queued messages
mailq
postqueue -p

# Flush the queue (retry delivery)
sudo postqueue -f

# Delete specific message
sudo postsuper -d MESSAGE_ID

# Delete all queued messages
sudo postsuper -d ALL

Check Mail Logs

# Recent delivery attempts
sudo tail -100 /var/log/mail.log

# Filter for errors
sudo grep -i "reject\|bounced\|deferred\|error" /var/log/mail.log | tail -20

# Check specific recipient
sudo grep "recipient@example.com" /var/log/mail.log

Common Issues

Emails Going to Spam

  • Check SPF, DKIM, and DMARC records
  • Verify PTR record matches your mail hostname
  • Check IP reputation on blocklists

Connection Refused

# Test SMTP connection
telnet mail.example.com 25
# or
openssl s_client -connect mail.example.com:465

Authentication Failures

# Check Dovecot auth log
sudo grep "auth failed" /var/log/mail.log

DNS Verification

# Check MX records
dig MX example.com

# Check SPF
dig TXT example.com

# Check DKIM
dig TXT selector._domainkey.example.com

# Check DMARC
dig TXT _dmarc.example.com

Was this article helpful?