Mailing List Archive

spamstats hack needed?
I'm not sure how many people use the spamstats.pl program found here:
http://www.gryzor.com/tools/
But I love it! I was wondering if anyone had tweak/hacked/improved it to
also tally denials at the MTA level? (500 or 553)

I honestly can't remember if I ever emailed Vincent on this topic. :-)
BCC'ing on this post.

The code is a little over my head for me to give it a whirl.

Chris Santerre
System Admin and SA Custom Rules Emporium keeper
http://www.merchantsoverseas.com/wwwroot/gorilla/sa_rules.htm
'It is not the strongest of the species that survives,
not the most intelligent, but the one most responsive to change.'
Charles Darwin
Re: spamstats hack needed? [ In reply to ]
At 4:41pm -0500 2/17/04, Chris Santerre wrote:

>I'm not sure how many people use the spamstats.pl program found here:
>http://www.gryzor.com/tools/
>But I love it! I was wondering if anyone had tweak/hacked/improved it to
>also tally denials at the MTA level? (500 or 553)
>
>I honestly can't remember if I ever emailed Vincent on this topic. :-)
>BCC'ing on this post.
>
>The code is a little over my head for me to give it a whirl.
>
>Chris Santerre
>System Admin and SA Custom Rules Emporium keeper
>http://www.merchantsoverseas.com/wwwroot/gorilla/sa_rules.htm
>'It is not the strongest of the species that survives,
>not the most intelligent, but the one most responsive to change.'
>Charles Darwin

I use this for quick numbers. We are currently seeing 55% of all
mail coming into the server being bounced by rbls and entries in the
access.db - and many thanks to this list and Theo in particular for
the scripting help...

#!/bin/bash
#
# spam-stats -- print counts of clean and spammy messages
# from spamassassin.
#echo -e "========================================="
echo -e "SpamAssassin Results:"
echo -e "spam:" `grep "identified spam" /var/log/maillog | wc -l`
echo -e "clean:" `grep "clean message" /var/log/maillog | wc -l`
echo -e "skipped:" `grep "skipped large" /var/log/maillog | wc -l`
echo -e "total:" `grep "spamd[[0-9]*]: connection from"
/var/log/maillog | wc -l`
echo -e "processed:" `grep "processing message" /var/log/maillog | wc -l`

echo -e "========================================="
echo -e "Blocked by access.db:"
echo -e "open relay:" `grep "We don't like open relay servers sending
us spam" /var/log/maillog | wc -l` / "possible open rely:" `grep
"accept mail that wasn't requested" /var/log/maillog | wc -l`
echo -e "can't get removed:" `grep "from mailing list"
/var/log/maillog | wc -l`
echo -e "bad domain:" `grep "Domain of sender address"
/var/log/maillog | wc -l` / "no domain:" `grep "Domain name required
for sender address" /var/log/maillog | wc -l`
echo -e "isp ignores spam reports:" `grep "ignores reports of spam"
/var/log/maillog | wc -l`
echo -e "failed ip name lookup:" `grep "IP name lookup failed"
/var/log/maillog | wc -l` / "possible forged ip:" `grep "IP name
possibly forged" /var/log/maillog | wc -l`
echo -e "can't resolve PTR:" `grep "Cannot resolve PTR"
/var/log/maillog | wc -l`
echo -e "no postmaster:" `grep "No postmaster" /var/log/maillog | wc -l`
echo -e "can't report to postmaster:" `grep "Can't reliably report
spam" /var/log/maillog | wc -l`
echo -e "no authentication:" `grep "Proper authentication required"
/var/log/maillog | wc -l`
echo -e "access denied:" `grep "Access denied" /var/log/maillog | wc -l`
echo -e "spamhaus:" `grep "refused by Spamhaus" /var/log/maillog | wc -l`
echo -e "spamcop:" `grep "see: http://spamcop.net/bl"
/var/log/maillog | wc -l` / "spamcop lookup failure:" `grep
"Temporary lookup failure" /var/log/maillog | wc -l`
echo -e "maps rbl+:" `grep "refused by blackhole site
rbl-plus.mail-abuse.org" /var/log/maillog | wc -l`
echo -e "dsbl.org:" `grep "Spam blocked see: http://dsbl.org/"
/var/log/maillog | wc -l`
echo -e "njabl.org:" `grep "rejected - see http://njabl.org/"
/var/log/maillog | wc -l`
echo -e "total rejected:" `grep "reject=" /var/log/maillog | wc -l`

#echo -e "========================================="

Ed Kasky
=======
"No man is above the law and no man is below it; nor do we ask any
man's permission when we require him to obey it. Obedience to the
law is demanded as a right; not asked as a favor."
--Theodore Roosevelt