Sometimes your server may send large amount of outgoing spam (due to compromised email account or scripts) and you may require to clean all emails from Exim mail queue. Following are the few commands that will help you to remove all emails from Exim mail queue using SSH:

To print a list of the messages in the queue:

exim -bp

To remove particular message from the queue:

exim -Mrm {message-id}

To remove all messages from the queue:

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


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

Looking for Linux hosting?? Try AccuWebHosting, HostGator, Arvixe

How to remove all messages from Exim mail queue via SSH

Last Updated on

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.