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! 🙂