Mail::Log::Trace::Postfix - Trace an email through Postfix logs.
use Mail::Log::Trace::Postfix; my $tracer = Mail::Log::Trace::Postfix->new({log_file => 'path/to/log'}); $tracer->set_message_id('message_id'); $tracer->find_message(); my $from_address = $tracer->get_from_address(); etc.
A subclass for Mail::Log::Trace that handles Postfix logs. See the documentation for the root class for more. This doc will just deal with the additions to the base class.
An object-oriented module: See the base class for most of the meathods.
Additions are:
Sets the connection id of the message we are looking for.
Sets the process id of the message we are looking for. (Note that pids are often reused, and Postfix will use several processes for a specific message.)
Sets the status id of the message we are looking for.
Currently this is the full status, not just the numeric code.
Sets the year the logfile was written in, since Postfix doesn't log that.
Assumes the current year if not set. (See Mail::Log::Parse::Postfix.)
Returns the connection id of the message we are looking for/have found.
Returns the process id of the message we are looking for/have found.
This will be the process id of the first part of the message found, which may or may not be the first entry of the message in the log.
Returns the status of the message we are looking for/have found.
Tracing a message works, but is slow. The statuses should probably be smart about what they take/return, so we can say 'find all rejected messages' or something of the sort...
Scalar::Util, Mail::Log::Exceptions, Mail::Log::Trace
Something that can pretend it is Mail::Log::Parse::Postfix. (The actual class not required, but it is the default. Another parser class can be set at runtime. However, it is assumed to behave exactly like Mail::Log::Parse::Postfix.)
1.0.1 Dec 5, 2008 - Licence clarification.
1.0 Nov 28, 2008. - original version.
Daniel T. Staal CPAN ID: DSTAAL dstaal@usa.net
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
This copyright will expire in 30 years, or five years after the author's death, whichever occurs last, at which time the code will be released to the public domain.
Mail::Log::Trace
To install Mail::Log::Trace, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mail::Log::Trace
CPAN shell
perl -MCPAN -e shell install Mail::Log::Trace
For more information on module installation, please visit the detailed CPAN module installation guide.