Delete specific email queues in Postfix

If an email message is undeliverable, it will bounce back with ‘MAILER-DAEMON’  telling you that the message could not be delivered to the destination addresses. The queue will try to keep delivering based on your mail server configuration. Unfortunately it will make your mail server takes some resources to the queues. And we dont want this thing happened.

In this example, we want to delete all ‘MAILER-DAEMON’ email queues. Using this trick you can free your mail server from ‘MAILER-DAEMON’ queues at that time. Below is the command:

for i in `postqueue -p|grep 'MAILER-DAEMON' |awk {'print $1'}|grep -v 'MAILER-DAEMON'`; do postsuper -d $i ; done

To delete all queues, simply use ‘postsuper -d ALL’ command.
Hope this trick useful for you.

Incoming search terms for this post:

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Related Posts

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Leave a Comment