|
From: Mark M. <Mar...@ij...> - 2004-04-14 23:17:31
|
Evan,
| I don't maintain a corpus of e-mail, but when I'm playing with new
| spamassassin rules I would like to be able to see every time it hits (not
| just the spam) in my maillog. Is there any way to set up amavisd-new to do
| this? ...
| For instance, I want to get some stats on the Spamhaus XBL blacklist so I
| can make a case for moving it up to the MTA level. I can tell you right off
| that out of X number of spam messages it hits Y number of times. But how
| many times does it hit on non-spam messages?
Perhaps it would be easiest to add a call to do_log(0, "...") into
sub spam_scan (where most spam-related information is collected)
log whatever information you need, and parse that later. E.g.:
do_log(0, "SA TESTS: ".$sa_tests);
| Ok, I've figured out that basically what I need to do is create a token that
| can be inserted into my log template. I can use the %A token, but it's the
| big ugly SA report.
| A => sub {[split(/\r?\n/, $spam_report)]}, # SpamAssassin report
| lines
| So, I want to create something like...
| U => sub {$sa_tests}
| But I get errors telling me that the global symbol $sa_tests "requires
| explicit package name". My guess is that somehow the variable isn't defined.
| But here I'm getting in a little over my head with Perl - I can't really see
| what $spam_report has defined that allows it to be inserted as a token that
| $sa_tests doesn't...
$sa_tests is a local variable inside sub spam_scan.
$spam_report is a module-global variable in package Amavis:
use vars qw($spam_level $spam_status $spam_report);
I agree it is a bit of a mess with these legacy global variables.
I'm gradually getting rid of them.
Mark
|