[CentOS] sendmail and rbl blocking - generating statistics

Wed Mar 14 16:56:47 UTC 2007
Ryan Simpkins <centos at ryansimpkins.com>

On Wed, March 14, 2007 01:38, Erick Perez wrote:
> I have enabled the feature in sendmail.mc to check with spamhaus for
> spammers. However since this block is being made at MTA level, I would
> like to know is something can be done to obtain statistics of blocked
> attemps.

I do this by parsing the logs:

Mar 14 09:31:36 io sendmail[19416]: ruleset=check_relay, arg1=[],
arg2=, relay=[], reject=554 5.7.1 Rejected found in

Try doing a simple 'cat /var/log/maillog | grep -c check_relay'

For my server:

cat /var/log/maillog | grep checK_relay | grep -c spamhaus

cat /var/log/maillog | grep checK_relay | grep -c spamcop

cat /var/log/maillog | grep checK_relay | grep -c njabl

You could write a simple script to give you more details, like highest hit days. I'm
*sure* there are log analyzers out there that do this. I've also seen a few people
who have written script and stuffed the numbers in to RRDTool to visualize the RBLs.