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

5. Change password for an email account

# pwtemp -d setmail

6. Push stuck emails through the mail queue

exim -q -v

7. Open the maillog with a text editor and inspect it, just don’t save it.
You might also need to look at the system logs (/var/log/messages) if a process is failing.

# tail -n40 /var/log/maillog


A good source