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

Assalamualaikum..

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 ~ /@domain.com/) 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.

ref:
http://8bitmime.marques.cx/2012/05/how-to-delete-e-mails-from-postfixs-queue.html
https://sathisharthars.wordpress.com/2013/11/11/managing-spam-mails-in-zimbra-mail-server/

Advertisements
This entry was posted in Zimbra. Bookmark the permalink.