Qmail-Scanner home : internet : mail : toaster : filtering : content filtering : Qmail-Scanner : qmailscanner statistics Simscan

Qmail-Scanner Statistics

QSS is a spiffy little PHP program that reads the Qmail-Scanner log file and produces some pretty graphs. An example is included below.

Unfortunately, the code has been abandoned for a long time. On various occasions I have made alterations to keep it working as the logging format of Qmail-Scanner has changed. As of this date (April 8, 2005), I have discontinued maintenance of it as the use of Qmail-Scanner has been deprecated in favor of simscan.

How do I get QmailScanner Statistics to work?

Easy way:

  • Upgrade to Mail::Toaster 3.37 or higher.
  • rm -rf /usr/local/www/data/qss
  • toaster_setup.pl -s qss

The hard way:

  • cd /usr/local/www/data
  • mkdir qss; cd qss
  • download tar archive from: http://sourceforge.net/projects/qss/
  • tar -xzf qss-2.0.2.tar.gz
  • vi config.php

Change the start date to the earliest date shown in your log file (head /var/spool/qmailscan/quarantine.log). Change the logFile variable to point to "/var/spool/qmailscan/quarantine.log". Then open up the permissions a bit on the quarantine so qmail-scanner stats can read it:

  • chmod o+x /var/spool/qmailscan
  • chmod o+r /var/spool/qmailscan/quarantine.log

Qmail-Scanner changed the logging date format at version 1.20 but qmailscanner stats doesn't have a fix for it yet. If you log files with dates in this format: 23-09-2003 then it'll work great. If you are using a newer version of qmail-scanner, you'll notice that your log entries are not showing up. I have both (before/after upgrade) so I fixed qmailscanner stats it by editing the index.php as follows (The if..else block is my addition):

  • vi index.php
  • if ( eregi("(^ [0-9]+)", $val[0]) )
  • {
    • # Calc the date timestamp
    • $date = explode("/",$val[0]);
    • $dateT = $date[0];
    • $date[0] = $date[1];
    • $date[1] = $dateT;
    • $date = strtotime(implode("/",$date));
  • }
  • else
  • {
    • $date = strtotime ($val[0]);
  • };

Point your browser at http://mail.example.com/qss/ and voila! You should see something like this:


Last modified on 4/8/05.