On Sat, 2009-03-28 at 10:36 -0400, Gene Heskett wrote:
> On Saturday 28 March 2009, Martin Gregorie wrote:

[snippage]

> >Total mail   2968 messages
> >Spam                 198 messages
> >MG_LIVESP    91 hits
> >MG_LIVESF    22 hits
> 
> How did you generate this report?
> 
I used grep and wc to produce individual rule usage from the spamd log
messages:

grep MG_LIVESP /var/log/maillog* | wc
grep MG_LIVESF /var/log/maillog* | wc

The totals come from a Perl script I wrote to analyse local rule usage
as an aid to weeding out any that become redundant. It analyses mail
logs and produces three types of output:

- totals (all/spam/ham) by looking at log messages output by a custom
  spamkiller that's immediately downstream of spamc, though it could
  equally well work off the Y/N flag logged by spamd

- local rules hit counts (all rules or just the top 10)

- local rules that didn't fire

I also run it as part of logwatch to produce daily totals and the daily
top 10 hits. If it would be useful to you, say so and I'll be happy to
tar it up for release under the GPL along with the shell scripts,
spamkiller and even (gasp!) write a bit of documentation.


Martin


Reply via email to