Mail::Toaster::Logs - objects and functions for interacting with email logs
This module contains functions related to mail logging and are used primarily in maillogs. Some functions are also used in toaster-watcher.pl and toaster_setup.pl.
Create a new Mail::Toaster::Logs object.
use Mail::Toaster::Logs; $logs = Mail::Toaster::Logs->new;
email a report of yesterdays email traffic.
Does some checks to make sure things are set up correctly.
logs base directory exists logs based owned by qmaill counters directory exists maillogs is installed
Do the appropriate things based on what argument is passed on the command line.
$prot is the protocol we're supposed to work on.
$logs->check_log_files( $check );
$logs->compress_yesterdays_logs( $file );
usage: $logs->count_send_line( $count, $line ); arguments required: count - a hashref of counter values line - an entry from qmail's send logs results: a hashref will be returned with updated counters
$logs->counter_read( file=>$file );
$file is the file to read from. The sub returns a hashref full of key value pairs.
$logs->counter_write(log=>$file, values=>$values); arguments required: file - the logfile to write. values - a hashref of value=count style pairs. result: 1 if written 0 if not.
Count the number of connections and successful authentications via IMAP and IMAP-SSL.
Count the number of connections and successful authentications via POP3 and POP3-SSL.
process_rbl_logs( roll => 0, files => $self->check_log_files( "$logbase/smtp/current" ), );
Count statistics logged by qmail scanner.
$logs->purge_last_months_logs( fatal => 0, );
For a supplied protocol, cleans out last months email logs.
Count the number of connections we've blocked (via rblsmtpd) for each RBL that we use.
Roll the qmail-smtpd logs (without 2>&1 output generated by rblsmtpd).
These logs will only exist if tcpserver verbose is enabled. Rolling them is not likely to be necessary but the code is here should it ever prove necessary.
Roll the qmail-send multilog logs. Update the maillogs counter.
Count the number of messages we deliver, and a whole mess of stats from qmail-send.
Count the number of times users authenticate via SMTP-AUTH to our qmail-smtpd daemon.
Count statistics logged by SpamAssassin.
Determine where syslog.mail is logged to. Right now we just test based on the OS you're running on and assume you've left it in the default location. This is easy to expand later.
Count the number of webmail authentications.
Matt Simerson <email@example.com>
None known. Report any to author. Patches welcome.
The following are relevant man/perldoc pages:
maillogs Mail::Toaster toaster.conf http://mail-toaster.org/
Copyright (c) 2004-2008, The Network People, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the The Network People, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.