Line 1: |
Line 1: |
− | ==mailstats== | + | ==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. | | 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. |
| | | |
− | ===Installation=== | + | 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 |
| + | |
| + | ==Installation== |
| yum install --enablerepo=smecontribs smeserver-mailstats | | yum install --enablerepo=smecontribs smeserver-mailstats |
| | | |
− | ===Configuration===
| + | ==Configuration== |
| 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: | | 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 | | less /usr/bin/spamfilter-stats-7.pl |
Line 11: |
Line 15: |
| The configuration options for v 0.6.20 have been listed below. | | The configuration options for v 0.6.20 have been listed below. |
| | | |
− | ====Create the service====
| + | ===Create the service=== |
| config set mailstats service | | config set mailstats service |
− | ====Status====
| + | ===Status=== |
| config setprop mailstats Status ("enabled"|"disabled") | | config setprop mailstats Status ("enabled"|"disabled") |
− | ====Column Header====
| + | ===Column Header=== |
| 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) | | 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") | | config setprop mailstats <column header> ("yes"|"no"|"auto") |
− | ====QpsmtpCodes====
| + | ===QpsmtpCodes=== |
| config setprop mailstats QpsmtpdCodes ("enabled"|"disabled") | | config setprop mailstats QpsmtpdCodes ("enabled"|"disabled") |
| See this note for more information about the qpsmtpd LogLevel setting: [[Updating_to_SME_7.2#qpsmtpd_LogLevel]] | | See this note for more information about the qpsmtpd LogLevel setting: [[Updating_to_SME_7.2#qpsmtpd_LogLevel]] |
| | | |
− | ====SpamAssassin Rules==== | + | ====SpamAssassin ules=== |
| config setprop mailstats SARules ("enabled"|"disabled") | | config setprop mailstats SARules ("enabled"|"disabled") |
− | ====JunkMailList====
| + | ===JunkMailList=== |
| config setprop mailstats JunkMailList ("enabled"|"disabled") | | config setprop mailstats JunkMailList ("enabled"|"disabled") |
− | ====SpamAssassin Rule Percent Threshold====
| + | ===SpamAssassin Rule Percent Threshold=== |
| Set a threshold for report cutoff | | Set a threshold for report cutoff |
| config setprop mailstats SARulePercentThreshold (0.5) | | config setprop mailstats SARulePercentThreshold (0.5) |
− | ====Email to send report====
| + | ===Email to send report=== |
| config setprop mailstats Email (admin) - email to send report | | config setprop mailstats Email (admin) - email to send report |
− | ====Save data to MySQL database====
| + | ===Save data to MySQL database=== |
| (default is "no") | | (default is "no") |
| config setprop mailstats SaveDataToMySQL ("yes"|"no") | | config setprop mailstats SaveDataToMySQL ("yes"|"no") |
− | ====MySQL server hostname====
| + | ===MySQL server hostname=== |
| (default is "localhost") | | (default is "localhost") |
| config setprop mailstats server <hostname> | | config setprop mailstats server <hostname> |
− | ====MySQL server port====
| + | ===MySQL server port=== |
| (default is "3306")''' | | (default is "3306")''' |
| config setprop mailstats DBPort <####> | | config setprop mailstats DBPort <####> |
− | ====Reporting Interval====
| + | ===Reporting Interval=== |
| config setprop mailstats Interval ("day"|"week"|"fortnight"|"month"|"#####")) | | config setprop mailstats Interval ("day"|"week"|"fortnight"|"month"|"#####")) |
| Note: a number is interpreted as seconds | | Note: a number is interpreted as seconds |
− | ====Base====
| + | ===Base=== |
| config setprop mailstats Base ("Midnight"|Midday"|"Now"|"##") | | config setprop mailstats Base ("Midnight"|Midday"|"Now"|"##") |
| Note: a number is interpreted as the hour of the day (0-23) | | Note: a number is interpreted as the hour of the day (0-23) |
| | | |
− | ===Logging to a MySQL database===
| + | ==Logging to a MySQL database== |
| In order to log your data to a MySQL database, you will need to create a database named 'mailstats'. Here are the notes from spamfilter-stats-7.pl on what is required: | | In order to log your data to a MySQL database, you will need to create a database named 'mailstats'. Here are the notes from spamfilter-stats-7.pl on what is required: |
| <nowiki>############################################################################# | | <nowiki>############################################################################# |