Mail::Toaster::Logs - objects and functions for interacting with email logs


Mail-Toaster documentation  | view source Contained in the Mail-Toaster distribution.

Index


NAME

Top

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.

METHODS

Top

new

Create a new Mail::Toaster::Logs object.

    use Mail::Toaster::Logs;
    $logs = Mail::Toaster::Logs->new;




report_yesterdays_activity

email a report of yesterdays email traffic.

verify_settings

Does some checks to make sure things are set up correctly.

    $logs->verify_settings();

tests:

  logs base directory exists
  logs based owned by qmaill
  counters directory exists
  maillogs is installed




parse_cmdline_flags

Do the appropriate things based on what argument is passed on the command line.

	$logs->parse_cmdline_flags(prot=>$prot, debug=>0);

$conf is a hashref of configuration values, assumed to be pulled from toaster-watcher.conf.

$prot is the protocol we're supposed to work on.

check_log_files
	$logs->check_log_files( $check );




compress_yesterdays_logs
	$logs->compress_yesterdays_logs(
	    file  => $file, 
	);

You'll have to guess what this does. ;)

count_rbl_line
    $logs->count_rbl_line($line);




count_send_line
 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




counter_read
	$logs->counter_read( file=>$file, debug=>$debug);

$file is the file to read from. $debug is optional, it prints out verbose messages during the process. The sub returns a hashref full of key value pairs.

counter_write
	$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.

imap_count
	$logs->imap_count(conf=>$conf);

Count the number of connections and successful authentications via IMAP and IMAP-SSL.

pop3_count
	$logs->pop3_count(conf=>$conf);

Count the number of connections and successful authentications via POP3 and POP3-SSL.

process_pop3_logs
process_rbl_logs
    process_rbl_logs(
        roll  => 0,
        files => $self->check_log_files( "$logbase/smtp/current" ),
    );







process_send_logs
qms_count
	$logs->qms_count($conf);

Count statistics logged by qmail scanner.

purge_last_months_logs
	$logs->purge_last_months_logs(
        fatal   => 0,
	);

For a supplied protocol, cleans out last months email logs.

rbl_count

Count the number of connections we've blocked (via rblsmtpd) for each RBL that we use.

	$logs->rbl_count(conf=>$conf, $debug);

roll_rbl_logs
	$logs->roll_rbl_logs($conf, $debug);

Roll the qmail-smtpd logs (without 2>&1 output generated by rblsmtpd).

RollPOP3Logs
	$logs->RollPOP3Logs($conf);

These logs will only exist if tcpserver debugging is enabled. Rolling them is not likely to be necessary but the code is here should it ever prove necessary.

roll_send_logs
	$logs->roll_send_logs();

Roll the qmail-send multilog logs. Update the maillogs counter.

send_count
	$logs->send_count(conf=>$conf);

Count the number of messages we deliver, and a whole mess of stats from qmail-send.

smtp_auth_count
	$logs->smtp_auth_count(conf=>$conf);

Count the number of times users authenticate via SMTP-AUTH to our qmail-smtpd daemon.

spama_count
	$logs->spama_count($conf);

Count statistics logged by SpamAssassin.

syslog_locate
	$logs->syslog_locate($debug);

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.

webmail_count
	$logs->webmail_count();

Count the number of webmail authentications.

what_am_i
	$logs->what_am_i()

Determine what the filename of this program is. This is used in maillogs, as maillogs gets renamed in order to function as a log post-processor for multilog.

AUTHOR

Top

Matt Simerson <matt@tnpi.net>

BUGS

Top

None known. Report any to author. Patches welcome.

SEE ALSO

Top

The following are relevant man/perldoc pages:

 maillogs
 Mail::Toaster 
 toaster.conf

 http://mail-toaster.org/




COPYRIGHT

Top


Mail-Toaster documentation  | view source Contained in the Mail-Toaster distribution.