yasma.pl (Yet Another Sendmail Log Analyzer)
Copyright (c) 2006 by Peter_Siegrist(SystemLoesungen) (PSS@ZweierNet.ch)
All Rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
BE CAREFUL BEFORE YOU USE THIS SOTWARE ! In some Countries it might be illegal to read mail logs and produce mail log summaries. Or, at least, it is illegal to view names of users you run a mail service for it. If so, make sure that you run Yasma always with command line option (-u) or configuration file parameter "HIDE_USERS = TRUE".
Thanks to Sébastien Aperghis-Tramoni
Yasma uses a slightly modified Parse::Syslog::Mail perl module from Sébastien Aperghis-Tramoni email@example.com.
Therefore you dont have to install this module, its delivered within the Yasma package.
Download the archive, unpack it to a directory of your choice (ie. /usr/local/) with
- tar xvfz yasma.tar.gz
tar will create a new directory (ie. yasma/) with all necessary files. You can rename this directory if you like so, or, for updates just copy the perl script to your old yasma location and check the differences of the config file.
Go to this directory an edit the 'yasma.conf' file suited to your environment and fancy. The configuration variables are explained within this file.
The 'yasma.pl' programm have to run within the directory where yasma.conf resides and must have read access to logfiles and write access to the folder where the html output file will be written.
To run the program, just type:
#> yasma.pl [-c config-file] [-f output-file] [-u] /path_to_logfiles/logfile[*]
Yasma can read single or multiple logfiles who can be plain, gzipped (.gz), compressed (.Z) or mixed.
! Be sure the program cannot be started from an insecure place or user !
-c config full name of yasma.conf config-file
-u dont show user names of mail addresses
-f file print the report to this file. Else output will sent to file defined in configfile.
#> yasma.pl -f /opt/httpd/htdocs/report.html /var/log/mail*
this will read all logs beginning with mail* and puts the html report to the file specified by the -f option.
#> yasma.pl /var/log/mail
this will read the logfile /var/log/mail and puts the html report to file you have defined in 'yasma.conf'
#> yasma.pl -u /var/log/mail
the same as above but do not show user part of addresses.
For installing and upgrading GeoIP-database you should do the following:
* Linux/Unix System mit Perl >= 5.6 und Web-Server * Perlmodule CGI, IO::Handle, File::Basename, Parse::Syslog and POSIX from CPAN * Optional Geo::IP::PurePerl and its GeoIP Database
0.94: new comandline parameter -c configfile
allow timestamps in the future in mailfile
0.95: fix a senseless isa() call when no logfile is given.
0.96: give Parse::Syslog::Mail a year attribute if we can grep it from the filename.
Useful for leap years.
Yasma is very unfinished. Yasma is tested just for sendmail logfiles. Other mailsystems should be added in future. Therefor I'm looking for logfiles from other mailsystems as well as strange sendmail logfiles.
I would be pleased about suggestions, experience or problems.
Please send any mails regarding yasma to yasma@ZweierNet.ch
Copyright © 2006 by Peter_Siegrist(SystemLoesungen) firstname.lastname@example.org.
This program is free software under the terms of the GNU General Public License.