Delete spam from mail queue (Exim - sender/recipient based)
Print
0
When a server/VM mail queue size is large:-
1. Go to WHM -> Mail Queue - Analyze (click on magnifiying glass) some of the repetitious / suspicious mail to determine whether it's spam (google subject line / from / some content to verify) - Also determine the email account used/hijacked to propagate the spam (Click on 'Show Control Data' when viewing a queued message) - If confirmed, see if the From header is the same (normally it is), then you can do bulk removal as follows:-
i) SSH to server
ii) Verify the spam search pattern by sender in queue:- # exiqgrep -f 'sender@address.com'
iii) If confirmed, get the queue IDs:- # exiqgrep -i -f 'sender@address.com'
iv) If list looks OK, now delete all the spam mails from queue:- # exiqgrep -i -f 'sender@address.com' | xargs exim -Mrm
v) Sometimes there are backscatter (bounce messages back to the hijacked account) or spam sent to one particular address. For this, use spam search pattern by recipient in queue:- # exiqgrep -r 'recipient@address.com' # exiqgrep -i -r 'recipient@address.com' # exiqgrep -i -r 'recipient@address.com' | xargs exim -Mrm