Exim: remove mails in queue from a particular sender.E

“spams”, its one of the major issue that a sys admin has to deal with throughout his job.  First you need to find the user who is generating it. You can get it from the mail headers.  Once you find the user, disable the script that was responsible for spams, but it may have already kept thousands(may be lacks) of mails in the exim queue waiting for its chance to get delivered.  To delete these mails one by one is impossible.  In a cPanel server having exim mail,  you can use the following command to delete mails in the current queue generated by that particular user only.

SSH into the server

exiqgrep -i -f user@domain.com | xargs exim -Mrm

-i print messages id
-f from address
-Mrm remove mails

Remove mails to a particular sender in the queue :-

exiqgrep -i -t user@domain.com | xargs exim -Mrm

-t to address

One thought on “Exim: remove mails in queue from a particular sender.E

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>