You may come across a problem when trying to clean Zimbra mail queue as Zimbra user as lack of privileges.
When trying to log in as Zimbra and run the command below, I came across a privilege’s problem as Zimbra user was unable to run postsuper command:
[zimbra@mailmachine root]$ mailq | tail -n +2 | awk 'BEGIN { RS = "" } / spam.user@spammer.net/ { print $1 }' | tr -d '*!' | postsuper -d - postsuper: fatal: use of this command is reserved for the superuser
If you check mail queue as root user, you won’t see Zimbra messages. What you can do, is use binaries of Zimbra. Here is how I was able to clean mail queue with root user for Zimbra:
[root@mailmachine sbin]# /opt/zimbra/common/sbin/mailq | tail -n +2 | awk 'BEGIN { RS = "" } / spam.user@spammer.net/ { print $1 }' | tr -d '*!' | /opt/zimbra/common/sbin/postsuper -d -
postsuper: F22125044F450: removed postsuper: F24D45044B05C: removed postsuper: F31595048D7A0: removed postsuper: F307B50478E75: removed postsuper: F155F5049BCF0: removed postsuper: F3A22504CAC00: removed postsuper: F40E2504A3B49: removed ...
This will successfully clean Zimbra mail queue – messages from user spam.user@spammer.net. You may have different paths to your mailq and postsuper. I noticed that on some installations, path is “/opt/zimbra/postfix/sbin/postsuper”.
Recent Comments