Sometimes you find yourselve facing spammers on the server. How do you handle them?

Here are Sendmail, exim cheatsheets. I’ve found useful

1. List domains sending most email

exim -bp | egrep -o "[a-z0-9A-Z\.]+@[a-z0-9A-Z\.]+" | awk -F @ '{if(/'`hostname`'/){print$1}else{print$2}}' | sort | uniq -c | sort -rn | head

2.Frozen mails are of no use in exim queue. To remove all the frozen mails:

exim -bpr | grep frozen | awk {'print $3'} | xargs exim -Mrm

2a. This seems to work for me to delete Mail queue

exiqgrep -z -i | xargs exim -Mrm

3. To list the mail queue in sendmail do this:

sendmail -bp

4. To remove mails from

# exiqgrep -i -f | xargs exim -Mrm

A good source