Empty postfix mail queue

A quick way to empty your postfix mail queue (for whatever reason) can be done as follows fromout your console as root or equal:

 

root@localhost: for i in `mailq|grep '@' |awk {'print $1'}|grep -v '@'`; do postsuper -d $i ; done

Be sure you know what you are doing, this cannot be undone! You’re deleting all your messages in the current mail queue!

Leave a Reply

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