Remove queued mails for particular Email account – Zimbra/Postfix

Login to the server via SSH and run below command:-

# /opt/zimbra/common/sbin/postqueue -p | tail -n +2 | awk 'BEGIN { RS = "" } /navdeep.singh@the-d2\.com/ { print $1 }' | tr -d '*!' | /opt/zimbra/common/sbin/postsuper -d -
  • Replace navdeep.singh and domain name with your choice
  • You can also use above command on a non-zimbra server but make sure it has postfix for the mailing puprose, in this case you can just use postqueue and postsuper instead of using their full path.
  • Your zimbra server may has postqueue and postsuper in a bit different folder so try to find them and best way to do that is this:-
# updatedb         # make sure you has mlocate package OR locate command installed
# locate postqueue
# locate postsuper

 

One Reply to “Remove queued mails for particular Email account – Zimbra/Postfix”

Leave a Reply

%d bloggers like this: