-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the smeserver-mailstats wiki!
This is a copy of the current mailstats wiki page on https://wiki.contribs.org/Mailstats
Brian Read's mailstats contrib analyzes your qpsmtpd log files and sends a periodic email to the address you specify summarizing your server's email activity.
The latest version also supports storing your mail server statistics in a MySQL database. You could potentially configure several servers to store their statistics in one central database in order to get consolidated statistics from several servers.
Read the original announcement here: http://forums.contribs.org/index.php?topic=40651.0
yum install --enablerepo=smecontribs smeserver-mailstats
If you install mailstats you should review the latest documentation, which is kept in the script itself. You can review the script after installation using:
less /usr/bin/spamfilter-stats-7.pl
The configuration options for v 0.6.21 have been listed below.
config set mailstats report
config setprop mailstats Status ("enabled"|"disabled")
(defaults to "auto") Column Header entries are created and set to "yes" if a non zero count is detected (they may not exist before). "Yes" means that that column is then always shown. If you delete the entry or set it to "auto" then it will only show if a non zero occurs again (and then get set to "yes").(enable, supress or only show if nonzero)
config setprop mailstats <column header> ("yes"|"no"|"auto")
Show league table of qpsmtd result codes (default to "enabled")
config setprop mailstats QpsmtpdCodes ("enabled"|"disabled")
See this note for more information about the qpsmtpd LogLevel setting: Updating_to_SME_7.2#qpsmtpd_LogLevel
Show league table of Spamassasin rules applied. (default to "enabled")
config setprop mailstats SARules ("enabled"|"disabled")
Show listing of each user and number of junkmail emails left, in descending order of number (default to "enabled")
config setprop mailstats JunkMailList ("enabled"|"disabled")
Set a threshold for report cutoff
config setprop mailstats SARulePercentThreshold (0.5)
config setprop mailstats Email (admin) - email to send report
(default is "no")
config setprop mailstats SaveDataToMySQL ("yes"|"no")
(default is "localhost")
config setprop mailstats server <hostname>
(default is "3306")
config setprop mailstats DBPort <####>
Length of time to report on (default is "day")
config setprop mailstats Interval ("day"|"week"|"fortnight"|"month"|"#####"))
Note: a number is interpreted as seconds. Also note that lengthening the report interval does not change the interval summary at the moment, this means you will still get an hourly summary over whatever period you run the report.
What time to base the report (default is "Midnight")
config setprop mailstats Base ("Midnight"|Midday"|"Now"|"##")
Note: a number is interpreted as the hour of the day (0-23)
Multilog occasionally generates log files that end in ".u" instead of ".s". The multilog manual says this:
- .s: This file is completely processed and safely written to disk.
- .u: This file was being created at the moment of an outage. It may have been truncated. It has not been processed.
However in the early days of an installation, there will be only the "current" file, this leads to a nightly error message:
Can't open /var/log/qpsmtpd/@*: No such file or directory
This is only a minor issue as it 'solves' itself once logrotate creates the .u or .s files.
You can eliminate this issue by forcing a qpsmtpd log rotation as described at http://wiki.contribs.org/Email_Statistics#Force_first_log_rotation
You can use the following command to generate a report
perl /usr/bin/spamfilter-stats-7.pl /var/log/qpsmtpd/@* /var/log/qpsmtpd/current
Please raise bugs under the SME-Contribs section in and select the smeserver-mailstats component or use this link:
Category:Contrib Category:Mail Category:Administration:Monitoring