Delete all MAILER-DAEMON notifications from Postfix queue:

Just run the following

#mailq | tail -n +2 | head -n -2 | grep -v '^ *(' | awk 'BEGIN { RS = "" } { if ($7 == "MAILER-DAEMON") print $1 }' | tr -d '*!' | postsuper -d -

Leave a Reply

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

5 × four =

This site uses Akismet to reduce spam. Learn how your comment data is processed.