I use the following command to delete the exim mail queues
exiqgrep -i | xargs exim -Mrm
or
# following commands seems to work faster compared to the above.
exim -bpru | awk {'print $3'} | xargs exim -Mrm
But the above commands do not work when the mail queue size is more than 100,000. It get stuck. So, I am using the following script which works fine regardless of the number of mails in the queue.
My question is, will it delete correctly ?
/etc/init.d/exim stop;
sleep 10;
killall -9 exim eximd
sleep 5;
#clean out the mail queue
find /var/spool/exim -mindepth 2 -type f -exec rm -rfv {} \;
#clean out the mail db files
find /var/spool/exim/db -type f -exec rm -rvf {} \;
/etc/init.d/exim restart
--max-args
or--max-lines
(-L
) options forxargs
?