Pages

Wednesday, July 17, 2013

Exim: remove mails in queue from a particular sender

“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

No comments:

Post a Comment