Troubleshoot - by Hostrare
Email / Exim server troubleshooting methods. You can use the next email server troubleshooting choices in your Cpanel. Mostly applied this command to find spam emails and bulk email senders. You can also apply regularly used Exim rules, also you can apply to opportunities in WHM – > Tweak Settings – > mail
To get exim mail stats
eximstats -ne -nr /var/log/exim_mainlog >> eximstats.txt
open the eximstats.txt file and verify details.
Notice the details of lines that are used to send out spam emails :
grep "cwd=" /var/log/exim_mainlog|awk ‘{for(i=1;i teststats
Script to know the mail count by various accounts
grep "cwd=" /var/log/exim_mainlog|awk ‘{for(i=1;i<=10;i++){print $i}}’|sort|uniq -c|grep cwd|sort -n
List number of mails by a domain
exigrep @domain.com /var/log/exim_mainlog|grep 2009-04-17|grep Completed|wc -l
List the number of mails send by each one.
exim -bpr | grep "<" | awk {'print $4'} | cut -d "" -f 1 | sort -n | uniq -c | sort -n
Show the list from which user’s home the mail is going, so that you can easily trace it and block it if needed.
ps -C exim -fH ewww |grep home
Show the top 50 domains using mail server with options.
eximstats -ne -nr /var/log/exim_mainlog
Show the list of main domains receiving and sending mails on the server.
exim -bp | exiqsumm
Give the IPs which are related to the server through port number 25. If one particular Ip is doing more than 10 connections you can block it in the server firewall.
netstat -plan|grep :25|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1
List the “nobody” ownership spamming emails
ps -C exim -fH ewww|awk '{for(i=1;i<=40;i++){print $i}}'|sort|uniq -c|grep PWD|sort -n
The high command will give the spamming is currently in process. If the spamming has occurred some hours earlier, use the next command.
grep “cwd=” /var/log/exim_mainlog|awk ‘{for(i=1;i<=10;i++){print $i}}'|sort|uniq -c|grep cwd|sort -n
This will result in something like :
47 cwd=/root
8393 cwd=/home/sample/public_html/test
/etc/exim.conf – exim main configuration file
/etc/localdomains – list of domains allowed to relay mail
/etc/remotedomains – list of remote MX record domains.
/var/log/exim_mainlog – incoming/outgoing mails are logged here
/var/log/exim_rejectlog – exim rejected mails are reported here
/var/log/exim_paniclog – exim errors are logged here
/var/spool/exim/input – Mail queue
/scripts/restartsrv_exim – Cpanel script to restart exim
/etc/valiases/domainname.com – Email forwarders and catchall address file
/etc/vfilters/domainname.com – Email filters file
/home/username/etc/domainname/passwd – POP user authentication file
/home/username/mail/inbox – catchall inbox
/home/username/mail/domainname/popusername/inbox – POP user inbox
/home/username/mail/domainname/popusername/spam – POP user spambox
our suuport team here for you 24/7
+8801977507015support@hostrare.comsend a leter Whether you are looking for a personal website hosting plan or a business website hosting plan, We are the perfect solution for you. Our powerful website hosting services will not only help you achieve your overall website goals, but will also provide you with the confidence you need in knowing that you are partnered with a reliable and secure website hosting platform.