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 mail@domain.co.ke

# exiqgrep -i -f mail@domain.co.ke | xargs exim -Mrm

5. Change password for an email account

# pwtemp -d setmail mail@domain.co.ke

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 https://www.nixtree.com/blog/mailq-management-exim/

 


Leave a Reply

Your email address will not be published. Required fields are marked *