Affected versions: Debian 11

πŸ“– ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

Outgoing mail remains deferred, delaying alerts and transactional messages.

Environment & Reproduction

Seen when relayhost, DNS, or TLS settings are incorrect.

mailq
postqueue -p | head -n 80
systemctl status postfix

Root Cause Analysis

Remote delivery failures from DNS lookup issues, rejected relay auth, or blocked SMTP egress.

Quick Triage

Read postfix logs and inspect queue reason codes.

sudo tail -n 120 /var/log/mail.log
postqueue -p | sed -n '1,80p'
postconf -n

Step-by-Step Diagnosis

Validate DNS MX resolution and relay credentials.

dig +short MX example.com
postconf relayhost smtp_sasl_auth_enable
openssl s_client -connect smtp.example.net:587 -starttls smtp -brief </dev/null
Illustrative mockup for debian-11 β€” terminal_or_shell
Inspecting deferred Postfix queue β€” Illustrative mockup β€” Progressive Robot

Solution – Primary Fix

Correct relay and authentication settings, then flush queue.

Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

sudo postconf -e 'relayhost=[smtp.example.net]:587'
sudo postconf -e 'smtp_sasl_auth_enable=yes'
sudo systemctl restart postfix
sudo postqueue -f
Illustrative mockup for debian-11 β€” log_or_config
Correcting relay and DNS mail settings β€” Illustrative mockup β€” Progressive Robot

Solution – Alternative Approaches

Route through internal smarthost to simplify outbound policy.

sudo postconf -e 'relayhost=[mailgw.internal]:25'
sudo systemctl restart postfix

Verification & Acceptance Criteria

Deferred queue decreases and test email is delivered.

echo test | mail -s 'postfix test' [email protected]
mailq
postqueue -p | head

Rollback Plan

Restore prior postfix configuration from backup.

sudo cp -a /etc/postfix/main.cf /var/tmp/main.cf.bak.$(date +%s)
sudo systemctl restart postfix

Prevention & Hardening

Monitor queue depth and relay health continuously.

postqueue -p | tail -n 1
systemctl is-active postfix

Can overlap with DNS resolver failures and expired relay credentials.

Related tutorial: View the step-by-step tutorial for Debian 11.

View all Debian 11 tutorials on the Tutorials Hub β†’

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

Debian Postfix administration and troubleshooting docs.

Need Expert Help?

If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today β€” we respond within one business day.