Sunday 22 April 2012

Identfy spamming accounts in cPanel servers

For detailed troubleshooting on Spamming issue in cPanel servers, refer the following link.

http://linux-bloggers.blogspot.in/2011/12/exim-message-transfer-agent-mta.html

In this post, we have provided the script to identify accounts that is senting more mails in a day.

==============
awk -v dt=$(date +"%Y-%m-%d" --date "$(date +"%F %T") 1 days ago") '$1~dt && $0~/ [UA]=/ &&  $0!~/U=(mailnull)/ {printf("%s %s",$1,$2); for (i=1;i<=NF;i++) if ($i ~ /\<[UA]=/) printf(" %s\n",$i)}' /var/log/exim_mainlog | sed -r 's/(:..:..|\<U=|\<A=|courier_login:|courier_plain:)//g'| sort -f | uniq -c | awk '$1>50 {print}'
==============

If you execute this script then, you will get the account that is senting more mails in a day with number of emails.

Courtesy: Madhan Kumar(Collegue)



 

No comments: