Pre-processor for pflogsumm or awstats

Introduction

The preprocessor script could be of help if you use:

perl is a prerequisite (tested with perl 5.8.5)

The script processes mail log files that are to be passed to pflogsumm or awstats disregarding the lines relating to the re-injection of messages into postfix. I use it with amavisd-new configured as a postfix after queue content filter which does anti spam checks through spamassassin and antivirus checks through a third party virus checker. If your postfix setup requires additional content filters resulting in 3 or more passages of the same message through postfix, this script will not work for you.

I developed it for my own use, so testing is limited to my own server and with small volumes. It should be considered a beta version. If you use it and have feedback, let me know how you got on. I'd be particularly interested to know if it scales to larger installations and whether the logic behind it holds up in general. You might want to use it on a test server before installing in a production environment.

Usage

Use prepflog.pl -help for the options.

Typical usage with pflogsumm:

prepflog.pl -d yesterday /var/log/mail | pflogsumm

Typical usage with awstats:

In awstats configuration file set

LogFile="/usr/local/bin/prepflog.pl < /var/log/mail | perl /usr/local/awstats/tools/maillogconvert.pl standard |"

Note for Debian users (courtesy of Corné van Eeden)

Debian users: make sure the libdate-calc-perl package is installed.

Usage on debian with default amavis and postfix installation (Tested on Sarge):

LogFile= "/usr/local/bin/prepflog.pl < /var/log/mail.info | perl /usr/share/doc/awstats/examples/maillogconvert.pl standard < /var/log/mail.info |"

Updated version for postfix 2.3

prepflog version 0.2 is the update for the changed logging format of postfix 2.3 snapshots. It has been tested with postfix-2.3-20050510. Pflogsumm itself requires a small patch to take into account the DSN logging in postfix 2.3-20050510: patch to pflogsumm 1.1.0.

Updated plogsumm patch to take into account new logging format of postfix-2.3-20051106 patch to pflogsumm 1.1.0

Obtaining and installing

Download

prepflog0.2.tgz

Installation

Contact

johnfawcett at tiscali.it