I have finally managed to get the mailstats contrib into an rpm and up to date.
It is now installable by:
yum install --enablerepo=smecontribs smeserver-mailstats
It is a merge of Charlie's efficiency (and other) changes, and my latest bug fixes. Current version of the script is 0.6.20, the rpm is version 0.0.3-4
It also has few more options via db entries (see below) and also will save the data day by day into a MySQL db (if you set the relevant option).
Unfortunately I have not yet got round to writing any analysis code yet (I am thinking of a php web application), if anyone is interested in helping, please email me.
Here are summary of the db options:
#############################################################################
#
# SMEServer DB usage
# ------------------
#
# mailstats / Status ("enabled"|"disabled")
# / <column header> ("yes"|"no"|"auto") - enable, supress or only show if nonzero
# / QpsmtpdCodes ("enabled"|"disabled")
# / SARules ("enabled"|"disabled")
# / JunkMailList ("enabled"|"disabled")
# / SARulePercentThreshold (0.5) - threshold of SArules percentage for report cutoff
# / Email (admin) - email to send report
# / SaveDataToMySQL - save data to MySQL database (default is "no")
# / DBHost - MySQL server hostname (default is "localhost").
# / DBPort - MySQL server post (default is "3306")
# / Interval - "day", "week", "fortnight", "month", "99999" - last is number of seconds
# / Base - "Midnight", "Midday", "Now", "99" hour (0-23)
#
#############################################################################
Interval defaults to "day" and Base to "midnight". Note that if you lengthen the interval of the report, it still shows hourly summaries!
You could arrange for multiple servers to log the data to the same MySQL server, although I have not tested this.
You'll need to create the mailstats db and the table structure, more info in the comments of the script (or from me).
All plaudits here please, all bugs to the bug tracker.