Saturday, August 9, 2014

Exim remove all messages From the Mail Queue ssh

There are various ways to remove mails from exim queue
One way will be to use terminal to execute exim command as follows

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

 this command will get the list of all the mails and then execute the command exim -Mrm on each mail which can be quick for few thousand mails but for a huge mail box of mails above 1 million you need a different approach which is safe and super quick

open terminal using ssh and type the following command

cd /var/spool/exim/

then type

mv input input2

all done. now check your mail queue using

exim -bpc

thanks