How to delete e-mails from Zimbra’s MTA Postfix Queue


Sometimes you will end up on a situation where you need to delete a lot of e-mails that got stuck on your Postfix’s queue (SPAM issues, most probably). Here are the steps when using Zimbra.

For deleting e-mails from a specific sender, we will launch mailq, grep for the domain or sender’s address and then feed through postsuper with:

/opt/zimbra/postfix/sbin/mailq | tail -n +2 | \
grep -v ‘^ *(‘ | awk ‘BEGIN { RS = “” } { if ($8 ~ / print $1 }’ | tr -d ‘*!’ | \
/opt/zimbra/postfix/sbin/postsuper -d –
For deleting all e-mails from the queue:

/opt/zimbra/postfix/sbin/postsuper -d ALL
All commands should be run as root.


This entry was posted in Zimbra. Bookmark the permalink.