Postfix Tips and Tricks

Postfix mail for loops back to myself

Update mydestination using postconf or by editing file:

mydestination = localhost.$mydomain, localhost,

Once done reload postfix:

service postfix reload

Sender address rejected not owned by user

Remove ‘reject_sender_login_mismatch’ in postfix /etc/postfix/

Allow an IP without Auth

Discconect from unknown after auth

vi /etc/postfix/ smtpd_sasl_exceptions_networks = ip/32

Postfix view Email in Queue

First find the mail ID by issuing the following command

postqueue -p

Or , for a specific email address

postqueue -p | grep –A 2 –B 2 ‘’

Now that you have the mail ID you can view the message by issuing the following command :

postcat –q 

Remove All Mailer Daemon Emails From Mail Queue

for emailID in mailq | grep '^[A-Z0-9]' | grep 'MAILER-DAEMON' | awk '{print$1}'| tr -d '*!'; do postsuper -d $emailID; done

Remove Email From / To an Specific Email Address from Queue :

postqueue -p | tail -n +2 | awk 'BEGIN { RS = "" } / { print $1 }' | tr -d '*!' | postsuper -d -