Skip to content
Stefan Heumader edited this page Jun 2, 2013 · 2 revisions

Welcome to the PostfixLog wiki!

Description

PostfixLog is a Collectd Plugin, which analyses the Postfix logfiles for incoming and outgoing emails.

Installation and Configuration

Installation

Copy the PostfixLog.pm from the Git repository to a directory of your choice (i.e. /usr/local/bin/) or simply clone the repository by executing git clone https://geuma@github.com/geuma/PostfixLog.git.

PostfixLog Configuration

To configure the PostfixLog Perl Module, edit the configuration hash in the beginning of the PostfixLog.pm file by setting the following keys to their correct values:

  • LogFile: specify the path of the Postfix logfile.
  • TmpFile: specify the path to a temporary file, which will be used by PostfixLog to keep track of already evaluated log events

A small example is listed below:

my $config =
{
    LogFile => '/var/log/mail.log', # path to the access log file of apache
    TmpFile => '/tmp/collectd-postfixlog.tmp', # path for the temporary file of this plugin
};

Collectd configuration

To configure Collectd to use PostfixLog Perl Module, edit the configuration file of Collectd (i.e. /etc/collectd/collectd.conf) by adding the following lines. Please ensure to set IncludeDirto your installation directory.

LoadPlugin perl
<Plugin perl>
    IncludeDir "/usr/local/bin"
    LoadPlugin "PostfixLog"
</Plugin>