How to remove a huge mail spam exim queue

If you server get victimized by spam and you fails in deleting emails from email queue using whm/cpanel interface then you need to using command line interface to delete that huge email queue in no time.

Simply login to your server as root user using any command line interface like putty.

and after login run this command.

exim -bp | awk ‘/^ *[0-9]+[mhd]/{print “exim -Mrm ” $3}’ | bash

You may also use these commands to delete the whole mail queue, if the above command will not work for you.

exim -bpru|awk {‘print $3?}|xargs exim -Mrm
exim -bp | grep < | awk ‘{print $3}’ | xargs exim -Mrm

If you wish to delete only frozen emails, use below command

exiqgrep -z -i | xargs exim -Mrm
Another command to delete server’s frozen e-mails

exim -bp | awk ‘$6 == “frozen” {print $3}’ | xargs exim -Mrm And before deleting frozen emails, you want to check the number of frozen emails, us below command exim -bp | grep frozen | wc -l


it will delete all the emails from queue and make your server fresh and then your clients would be able to send and receive emails, dont forget to restart exim and other email services, you may even restart them from WHM>Restart Services.

Add a Comment