Postfix is powerful but its configuration syntax and interconnected settings can trip up even experienced administrators. This guide covers the most common configuration mistakes and their fixes.
"Relay Access Denied"
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
Occurs when Postfix isn't configured to relay for a specific network/user that should be authorized — verify mynetworks includes the correct IP ranges, and that SASL authentication is properly configured if relying on authenticated relay.
"Mail Loops Back to Myself"
postconf mydestination
Occurs when a domain is listed in both mydestination (local delivery) and being routed elsewhere via transport maps or virtual domains — verify a given domain isn't configured for conflicting delivery methods.
Not Actually Applying Configuration Changes
sudo postfix reload
A remarkably common mistake — editing main.cf/master.cf without reloading Postfix means changes don't take effect; always reload (or restart for changes requiring it) after configuration edits.
"Unknown User" Despite Correct Virtual Mailbox Configuration
sudo postmap /etc/postfix/virtual
Hash-based lookup files (like virtual) require running postmap after every edit to regenerate the actual database file Postfix reads — editing the source file alone isn't sufficient.
Messages Stuck in the Queue
postqueue -p
postqueue -f
View the queue, then force a delivery attempt — if messages remain stuck, check /var/log/mail.log for the specific reason (often a DNS resolution issue or unreachable destination server).
"Client Host Rejected: Access Denied" (Being Blocked by Others)
This is the receiving server rejecting you, not a Postfix misconfiguration on your end necessarily — check your IP against blacklists (see How to Check and Remove Your IP from Email Blacklists (RBL)) and verify reverse DNS is properly configured.
SASL Authentication Not Working
postconf smtpd_sasl_auth_enable
Verify SASL is actually enabled, and that Dovecot's SASL socket (if using Dovecot for authentication, a common pattern) is correctly referenced in Postfix's configuration.
Certificate/TLS Errors
postconf smtpd_tls_cert_file smtpd_tls_key_file
Verify these point to valid, currently-existing certificate files — an expired or incorrectly-pathed certificate causes TLS negotiation failures.
Debugging Approach: Increase Logging Verbosity Temporarily
sudo postconf -e "debug_peer_list=PROBLEM_IP"
sudo postconf -e "debug_peer_level=2"
Provides much more detailed logging for connections from a specific problematic source, useful for diagnosing issues that aren't clear from standard log verbosity — remember to remove this debug configuration once the issue is resolved.
General Debugging Workflow
- Check
/var/log/mail.logfirst for the actual specific error - Verify configuration with
postconf -n(shows non-default settings, often the most relevant view) - Test configuration syntax with
postfix checkbefore assuming a running-config issue
Continue Reading
- How to Install and Configure Postfix as a Mail Transfer Agent
- How to Troubleshoot Email Not Sending or Going to Spam
- How to Check and Remove Your IP from Email Blacklists (RBL)
Browse more articles in Email Hosting & Deliverability.