Problem
How to delete e-mails from deferred queue sent by a particular account?
Solution
1) This command will show the queue id of messages sent by “sender@domain.com”. Check it is deleting correct queue id.
Run as root:
# /opt/zimbra/common/sbin/postqueue -p | egrep -v '^ *\(|-Queue ID-' | awk 'BEGIN { RS = "" } { if ($7 == "sender@domain.com") print $1} '
2) Once it will confirm, delete email sent by “sender@domain.com”
Run as root:
# /opt/zimbra/common/sbin/postqueue -p |egrep -v '^ *\(|-Queue ID-' | awk 'BEGIN { RS = "" } { if ($7 == "sender@domain.com") print $1} '| tr -d '*!'| /opt/zimbra/common/sbin/postsuper -d -
Note: Replace “sender@domain.com” with actual sender e-mail address.
3) Delete ALL Messages From The deferred queue.
Run as root:
# /opt/zimbra/common/sbin/postsuper -d ALL deferred
4) Delete ALL Messages From The queue.
Run as root:
# /opt/zimbra/common/sbin/postsuper -d ALL
Ref:
https://wiki.zimbra.com/wiki/How_to_delete_e-mails_from_deferred_queue_sent_by_a_particular_account