Getting Qmail-Scanner Statistics to work correctly

Started by matt, February 04, 2004, 01:42:21 PM

Previous topic - Next topic

matt

I did as follows:

 download distribution to /usr/local/www/data
 cd /usr/local/www/data
 vi config.php

change the start date to the first month shown in your quarantine.log. Change the logFile to point to "/var/spool/qmailscan/quarantine.log. Then open up the permissions
a bit on the quarantine so qmailscanner stats can read it:

 chmod o+x /var/spool/qmailscanner
 chmod o+r /var/spool/qmailscanner/quarantine.log

 vi index.php

qmailscanner changed the date log format at version 1.20 but qmailscanner stats doesn't have a fix for it yet. You'll notice that your log entries aren't exactly right b
ecause of this. I fixed it by editing the index.php as follows (The if..else block is my addition):

  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]);
  };

Then point your browser at http://mail.example.com/qss/" target="_blank">http://mail.example.com/qss/ and voila!