SendmailAnalyzer v3.1: Installation and usage instruction
---------------------------------------------------------

Just unpack the distribution tarball in the desired location
as follow:

	tar xzf SendmailAnalyzer-3.x.tar.gz --directory /usr/local/

then create a configuration file in /etc/SendmailAnalyzer.conf.

This distribution comes with configuration file sample designed
for a mail gateway (SendmailAnalyzer.conf.gw) and for a mail hub
(SendmailAnalyzer.conf.hub)

Copy the content of the cgi-bin directory into a CGI location usable
from your favorite browser.

Create the statistic output directory in a directory readable from
the sa_report.pl CGI script. Copy barorng.gif in the top of your
DocumentRoot (sa_report.pl call it by default as /barorng.gif or
change the path in the configuration file, see 'BARORNG')

Edit file /etc/SendmailAnalyzer.conf to set/modify any configuration
directive following your installation.

Running SendmailAnalyzer:
-------------------------

You can run SendmailAnalyzer each day by cron job or run it in
background to have realtime statistic report.

To run it by cron job use this command line :

	/usr/local/SendmailAnalyzer/SendmailAnalyzer.pl -i -b -f -l /var/log/maillog

To run SendmailAnalyzer as a daemon, use the start/stop/restart script given
with this distribution:

	/usr/local/SendmailAnalyzer/rc.sendmailanalyzer start

Caching output:
---------------

When consulting CGI report, statistics are computed each time from the data
files. In day view it can be really speed but when you consult month or year
views it can take a very very long time.

This is why you have to run the cache script that will create Perl data files
for each days, months and years. This cache script should be run against each
per domain statistic report you have set in configuration file.

It will also help to reduce space disk usage by archivnig or removing all data
file older than current month.
 

Install SendmailAnalyzer cache into CROND

0 6 * * * /usr/local/SendmailAnalyzer/sa_cache.pl mailhost firstdomain.dom
10 6 * * * /usr/local/SendmailAnalyzer/sa_cache.pl mailhost seconddomain.dom
20 6 * * * /usr/local/SendmailAnalyzer/sa_cache.pl mailhost

WARNING: when sa_cache.pl is run without domain name (only the mail hostname)
all data are archived, so caching per domain are no more available. If you want
per domain report you must run sa_cache.pl on each domain before the global
report cache.

Log rotate case
---------------

If you use realtime mode and you have logrotate installed on you maillog
file you must restart SendmailAnalyzer each time logrotate is used.
To install it edit the /etc/logrotate.d/syslog file and add a line
in the postrotate part as follow:

/var/log/cron /var/log/debug /var/log/maillog /var/log/messages /var/log/secure /var/log/spooler /var/log/syslog {
    sharedscripts
    postrotate
	/bin/kill -HUP `cat /var/run/syslogd.pid 2>/dev/null` 2>/dev/null || true
	/usr/local/SendmailAnalyzer/rc.sendmailanalyzer restart >/dev/null 2>&1 || true
    endscript
}

Configuration
-------------

The default path to configuration file is /etc/SendmailAnalyzer.conf
To know how to configure your report read carefully the example, all
is explain: See SendmailAnalyzer.conf


