--- smeserver-mailstats-0.0.3/root/usr/bin/spamfilter-stats-7.pl.removeChangelogFromScript 2008-10-04 10:43:48.000000000 +0200 +++ smeserver-mailstats-0.0.3/root/usr/bin/spamfilter-stats-7.pl 2008-10-04 10:41:18.000000000 +0200 @@ -6,97 +6,9 @@ # junkmails. Configuration of the script is done by the Spam Filter # Server-Manager module # -# April 2006 - no longer controlled by server manager, and does not delete files -# -# This script has been developed +# This script has originally been developed # by Jesper Knudsen at http://sme.swerts-knudsen.dk # -# Revision History: -# -# August 13, 2003: Initial version -# August 25, 2004: fixed problem when hostname had no-ASCII chars -# March 23, 2006 Revised for sme7 RM -# March 27, 2006 ditto BJR (http://www.abandonmicrosoft.co.uk) -# - Merged Clamav and SA stats -# - Moved all analysis to qsmtpd log -# - Removed parameterised interval (for simplicity - not sure of format anyway) -# - add in archived log files for people who have high turnover -# - Alter labels to be more accurate -# - Detect deleted spam (over threshold) without using spam score -# - Detect RBL rejections -# - Detect pattern (executible) rejections -# - Look for the DENY labels - add in Miscellaneous category -# April 6, 2006 - check qpsmtp log level and also DNS enable properties -# - Average spam scores for under and over threshold seperatly -# - Log tag and Reject levels -# - TBD - check that RBL DENY are being detected (I have no date to check this) -# April 7, 2007 - re-written by Charlie Brady totally in Perl -# April 16, 2006 - move warnings to report -# - Spot fetchmail deliveries -# - Spot Internal connections from client PCs -# - TBD check that RBL DENY are being detected (I have no data to check this) -# April 30, 2006 - Pascal Schirrmann Start Time and End Time to noon - should be a param -# so the script can be run at any time in the day. -# - adds 'by recipients domains' stats Useful for MX-Backup or multi domains hosts -# - Add a 'recipients per mail' stat. Useful : until now the sums are correct :-) -# - Correct some messages about rbl who can led to wrong entry in the config database -# ( and without expected results, of course !) -# - improve a regexp in the SPAM detection -# May 1, 2006 - BJR - Fix situation where mxbackup prop is not defined -# - fix a spelling and minor format of domain report -# May 9, 2006 - bjr - Make RBL percentage a percentage of total connections (else it >100%) -# May 9, 2006 - ps - some 'sanity check' in the 'per domains part of the stats (to avoid / 0) -# May 12, 2006 - ps - some cleanup in the 'per domains' stats -# - Add a version number, logged in the mail -# June 20, 2006 - bjr - Minor change to RBL instructions, and adjust domain table format -# Feb 19, 2007 - bjr - Adjust table lines oin a couple of places -# - bjr - and add documentation details about percentages etc -# - bjr - Alter misc to "non conforming" anmd accumulated these hourly -# - bjr - Express change over tag count to exclude spam rejected over threshold -# - bjr - Change "processsed" to "fully downloaded" -# - bjr - Change percentages so that they are all a percetnage of the total emails received -# 0.6.1 - bjr - Change to use output from the logterse qpsmtpd plugin -# 0.6.2 - bjr - Fix fetchmail tests -# 0.6.3 - bjr - adjust for log-items change in order -# 0.6.4&5 - bjr - Adjust table formatting -# 0.6.6 - bjr - Take outgoing emails out of "others", add "Outgoing" and "Internal" -# 0.6.7 - bjr - Fix missing plugins/wrong names. pull invalid recipient out of deny msg for goodrcptto -# 0.6.8 - bjr - catch a few more plugin name failures -# 0.6.9 - bjr - Catch webmail and mailman -# 0.6.10 - bjr - Refine Webmail identification -# 0.6.11 - bjr - Fix Webmail identification -# 0.6.12 - bjr - split logterse line a bit more carefully (multiple sent to addresss with space and comma confuse it) -# 0.6.13 - bjr - add totals and percentages to bottom of the table -# - Generalise counts so that columns can be brought in and out -# - control columns with Db entries -# 0.6.14 - bjr - Add in league tables of qpsmtpd codes and SA rules -# - Add in loglevel check -# - parameterise email address for report -# 0.6.15 - bjr - fix columns included in totals -# - sort out domains when more that one email address in recipient field -# 0.6.16 - cb - fix date range bug (http://bugs.contribs.org/show_bug.cgi?id=3366) -# 0.6.17 - cb - avoid numerous re-openings of config db -# 0.6.18 - cb - tidy up options configuration section -# 0.6.19 - cb - rename parse_args => analysis_period, and simplify -# 0.6.20 - bjr - Retofit bjr fixes since file edited by charlie - Details -# - Add Average SA Scores to SA league table, -# - sort junkmail counts, sorted out xfererr for domains -# - Fixed multiple recipients for single emails -# - Fix Report suppression code for qpsmtpd codes etc -# - Added code to save stats to MySQL DB (defaulted to off) -# - Fixed interval so that it analyzes Midnight to midnight -# - Allow varied interval for report -# 0.6.21 - bjr - Move initial test (and create) for mailstats prop before -# first reference to mailstats -# 0.6.22 - bjr - bug fix [SME:3734] -# -# TODO -# ---- -# -# sort out multiple emails recipients, count each one, and log multiple counts -# -# -# ############################################################################# # # SMEServer DB usage @@ -123,6 +35,7 @@ use Pod::Usage; use POSIX qw/strftime floor/; use Time::Local; +#use Date::Manip; use Date::Parse; use Time::TAI64; use esmith::ConfigDB;