Clear the whole Postfix mail queue

To clear the whole Postfix mail queue you can use this command:

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

Thomas Sewell from coolsewell.com contributed with this helpful notes:you could also just do:

postsuper -d ALL

to clear all mail queues or even

postsuper -d ALL deferred

to just get rid of deferred mail from the queue.Thanks Thomas! 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s