Postfix mail server

Postfix queue management – list, debug and clean

Postfix mail server


Pstfix mail server and acomulate a queue of stuck emails, 
we monitor them via Nagios and sometime get alerts similar to this one,
there are some methods to take care of this queue:


msg_q = 17 warn=10 crit=20
WARNING: mailq is 17 (threshold w = 10)

log into the mail server and use the list command to see the mail queue:


-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
AAE603481BD 3471 Thu Oct 18 14:44:30
(connect to[]: Connection timed out)

the Q-id number is the id for the mail , you can read the mail to understnad what it is about and why its stuck with:

postcat -q AAE603481BD

you can delete it with:

postsuper -d AAE603481BD 


useful bash loop to delete all mails from

for i in $(mailq | grep -B1 ''| grep '^[A-Z,0-9]'| awk '{print $1}')
postsuper -d $i



Technorati Tags: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>