Is it a correct way to clear the exim mail queue?
4
votes
4
answers
12486
views
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
Asked by Mani
(634 rep)
Feb 19, 2016, 10:54 AM
Last activity: Oct 11, 2022, 05:22 PM
Last activity: Oct 11, 2022, 05:22 PM