To clear SPAMS and unwanted mails from the mail queue
exim -bp | awk ‘$6~”frozen” {print $3 }’ | xargs exim -Mrm
grep -lr ‘nobody@’ /var/spool/exim/input/ | sed -e ‘s/^.*/([a-zA-Z0-9-]*)-[DH]$/1/g’ | xargs exim -Mrm
grep -rl ‘From: Mail Delivery System’ /var/spool/exim/input/ | sed -e ‘s/^.*/([a-zA-Z0-9-]*)-[DH]$/1/g’ | xargs exim -Mrm
grep -rl ‘X-Spam-Status: Yes’ /var/spool/exim/input/ | sed -e ‘s/^.*/([a-zA-Z0-9-]*)-[DH]$/1/g’ | xargs exim -Mrm
grep -rl ‘Subject: Mail delivery failed’ /var/spool/exim/input/ | sed -e ‘s/^.*/([a-zA-Z0-9-]*)-[DH]$/1/g’ | xargs exim -Mrm
grep -rl ‘Message rejected’ /var/spool/exim/input/ | sed -e ‘s/^.*/([a-zA-Z0-9-]*)-[DH]$/1/g’ | xargs exim -Mrm
grep -rl ‘retry time not reached for any host’ /var/spool/exim/input/ | sed -e ‘s/^.*/([a-zA-Z0-9-]*)-[DH]$/1/g’ | xargs exim -Mrm
grep -lr ‘Cialis’ /var/spool/exim/input/ | sed -e ‘s/^.*/([a-zA-Z0-9-]*)-[DH]$/1/g’ | xargs exim -Mrm
grep -lr ‘viagra’ /var/spool/exim/input/ | sed -e ‘s/^.*/([a-zA-Z0-9-]*)-[DH]$/1/g’ | xargs exim -Mrm
grep -lr ‘Pharmaceutical’ /var/spool/exim/input/ | sed -e ‘s/^.*/([a-zA-Z0-9-]*)-[DH]$/1/g’ | xargs exim -Mrm
grep -lr ‘***SPAM***’ /var/spool/exim/input/ | sed -e ‘s/^.*/([a-zA-Z0-9-]*)-[DH]$/1/g’ | xargs exim -Mrm
To remove all mails from the email account xxx@xxx.com
grep -lr ‘xxx@xxx.com’ /var/spool/exim/input/ | sed -e ‘s/^.*/([a-zA-Z0-9-]*)-[DH]$/1/g’ | xargs exim -Mrm
Leave A Comment
You must be logged in to post a comment.