> I'm currently test spamassassin (spamd/spamc) to see if we should > implement it sitewide here. Is there a way to log how many mails that > spamassassin tags as spam and how many that aren't counted as spam. If > it's possible I also want to log the score so we can have our own little > high score here :)
I use the attached Perl script which grabs the numbers (including highest spam score) from my syslog files. The script accepts data from stdin. I use a shell script which basically does "spamcount.pl < mail.log" and then mails the output to me. The reason for having a separate count for each 'host' is that I'm combining logs from cluster members. --Rick #!/usr/local/bin/perl -w # Takes the file from standard input looking for spamd 'clean' lines # and counts how many were counted and how many were spam my %total; my %spam; my %prob_spam; my $highest = 0; my $host; my ($total, $spam, $prob_spam) = 0; while (<>) { next if ! /\s(\w+)\sspamd/; $host = $1; next if $host eq ''; if (/(clean message|identified spam)\s+\(([\d\-\.]+)\/([\d\-\.]+)\)/) { $total{$host}++; $spam{$host}++ if $2 >= $3; $prob_spam{$host}++ if $2 >= 5; $highest = $2 if $2 > $highest; } } print <<EOM; This reports shows number of messages processed by SpamAssassin. "Spam" is the number actually flagged as spam. "Probable Spam" is the number that would have been marked if all users had their number of "required hits" set to 5. EOM my $format = "%12.12s Messages: %6d Marked spam: %6d Probable spam: %6d\n"; foreach $host (keys %total) { printf ($format,$host, $total{$host}, $spam{$host}, $prob_spam{$host}); $total += $total{$host}; $spam += $spam{$host}; $prob_spam += $prob_spam{$host}; } printf ($format,'Grand total', $total, $spam, $prob_spam); printf( "\n%3d%% of all messages were spam\n", ($prob_spam/$total) *100); print "\n (Highest spam value: $highest)\n"; ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk