Clear mail queue by using SSH

If you found your email queue is full with spam emails, first you have to find out which domain is sending the spam emails.

Run the command below in your ssh terminal it will show you a list of domains along with emails it sent during a period, by showing this list your can easily identify that which domain/website has been compromised.

exim -bp | exiqsumm | egrep -v "\-\-|Volume|^$" | sort -bg | awk '{print "Volume: " $1 " \t Domain: " $5}'

If you want to remove all the messages from the queue

exim -bp | exiqgrep -i | xargs exim -Mrm
, , ,

Leave a Reply