Remove mail queue (spam) quickly

Find out size of spam emails:

# /opt/zimbra/postfix/sbin/postqueue -p | head

-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
E13B82CF2D27* 3874 Tue Apr 27 11:06:01 peter@springresort.com.tw
(delivery temporarily suspended: connect to genie.com[169.132.165.132]: Connection timed out)
cle2322518@genie.com
(delivery temporarily suspended: connect to genie.net[169.132.165.132]: Connection timed out)

We get 3874
Now, remove the spam:

# /opt/zimbra/postfix/sbin/postqueue -p | grep 3874 | awk -F '\*|\!| ' '{ print $1 }' | /opt/zimbra/postfix/sbin/postsuper -d -

postsuper: EEE0E6EE02D9: removed
postsuper: 4553C6EE0013: removed
postsuper: 6AB126EE035D: removed
postsuper: Deleted: 102837 messages


Comments

Popular posts from this blog

Optimize SSD on Linux

Manually clean up zimbra zmcat/zmcpustat exploit

Ports to allow for whatsapp call