Hi, On Thu, 22 Jan 2004, Vermyndax wrote:
> Hi Bob... > > Thanks for the suggestions. I downloaded the latest sa-stats.pl from > www.sf.net CVS (v1.3) and tried as you suggested, but I'm still getting > all zeros. > > Details... > > My mail logs are at /var/log/mail/maillog. Try this: sa-stats.pl -l /var/log/mail/maillog -s midnight -- Bob > > Here's a sample of a log line concerning spamd: > > Jan 22 09:00:49 sara-too spamd[6599]: connection from localhost > [127.0.0.1] at port 39780 > Jan 22 09:00:49 sara-too spamd[14917]: info: setuid to filter succeeded > Jan 22 09:00:49 sara-too spamd[14917]: processing message > <[EMAIL PROTECTED]> for filter:500. > Jan 22 09:00:52 sara-too spamd[14917]: clean message (-97.2/5.0) for > filter:500 in 2.8 seconds, 6762 bytes. I saved the above log fragment to /tmp/sample_maillog.txt and ran: /usr/local/bin/sa-stats.pl -l /tmp/sample_maillog.txt -s midnight and got: ----- cut ----- Report Title : SpamAssassin - Spam Statistics Report Date : 2004-01-22 Period Beginning : Thu Jan 22 00:00:00 2004 Period Ending : Fri Jan 23 00:00:00 2004 Reporting Period : 24.00 hrs -------------------------------------------------- Note: 'ham' = 'nonspam' Total spam detected : 0 ( 0.00%) Total ham accepted : 1 ( 100.00%) ------------------- Total emails processed : 1 ( 0/hr) Average spam threshold : 5.00 Average spam score : 0.00 Average ham score : -97.20 Spam kbytes processed : 0 ( 0 kb/hr) Ham kbytes processed : 6 ( 0 kb/hr) Total kbytes processed : 6 ( 0 kb/hr) Spam analysis time : 0 s ( 0 s/hr) Ham analysis time : 2 s ( 0 s/hr) Total analysis time : 2 s ( 0 s/hr) Statistics by Hour ------------------------------------- Hour Spam Ham -------------- -------- -------- 2004-01-22, 00 0 0 2004-01-22, 01 0 0 2004-01-22, 02 0 0 2004-01-22, 03 0 0 2004-01-22, 04 0 0 2004-01-22, 05 0 0 2004-01-22, 06 0 0 2004-01-22, 07 0 0 2004-01-22, 08 0 0 2004-01-22, 09 0 1 2004-01-22, 10 0 0 2004-01-22, 11 0 0 2004-01-22, 12 0 0 2004-01-22, 13 0 0 2004-01-22, 14 0 0 2004-01-22, 15 0 0 2004-01-22, 16 0 0 2004-01-22, 17 0 0 2004-01-22, 18 0 0 2004-01-22, 19 0 0 2004-01-22, 20 0 0 2004-01-22, 21 0 0 2004-01-22, 22 0 0 2004-01-22, 23 0 0 Done. Report generated in 0 sec. ----- cut ----- Note: I think this my hacked-up version of sa-stats.pl at http://www.cynistar.net/~apthorpe/code/sa-contrib/sa-stats.pl I'm not sure where the canonical version of sa-stats.pl lives since the migration from Sourceforge/CVS to Apache/SVN. I worked from the source at http://cvs.sourceforge.net/viewcvs.py/spamassassin/spamassassin/tools/sa-stats.pl and I think Duncan fixed some date problems in my patch involving the new year before committing it. The current version is probably in Apache's SVN repository but I have no clue where that is, how to browse it, etc. :/ Running /usr/local/bin/sa-stats.pl -s midnight I get: Can't find /var/log/maillog No such file or directory > Are we sure it's not a problem with the parsing of my log? I'm not a > perl master, so I have no idea. But hopefully this is enough evidence > to see what the problem might be. It should complain if it can't find your mail log. > As for modifications... In the "it would be nice" category I have... The > ability to dump this output to an HTML file (probably easy to do without > tweaking the script regardless) and the ability to see the top ten spam > receivers (available as a command-line switch since we wouldn't the > organizational public to see that one). Try the version of sa-stats.pl at http://www.cynistar.net/~apthorpe/code/sa-contrib/sa-stats.pl It requires Parse::Syslog (for cleaner coding and so we're not reinventing the wheel) and it takes the -u flag to generate per-user statistics (apologies for awful text report wrapping): ----- cut ----- Top 1 spam victims: User S AvScr H AvScr Count % Count Bytes % Bytes Time % Time -------------------------------- ------- ------- -------- ---------- --- ----- ---------- -------- ---------- filter 0.00 -97.20 0 ( 0.00%) 0 ( 0.00%) 0 ( 0.00%) ----- cut ----- hth, -- Bob ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk