NAME
Mail::Log::Parse::Postfix - Parse and return info in Postfix maillogs
SYNOPSIS
use Mail::Log::Parse::Postfix;
(See Mail::Log::Parse for more info.)
DESCRIPTION
This is a subclass of Mail::Log::Parse, which handles parsing for Postfix mail logs.
USAGE
set_year
Sets the year, for the log timestamps. If not set, the log is assumed to be for the current year. (Can also be passed in new
, with the key 'year'.)
next
Returns a hash of the next line of postfix log data.
Hash keys are:
delay_before_queue, delay_connect_setup, delay_in_queue,
delay_message_transmission, from, host, id, msgid, pid, program,
relay, size, status, text, timestamp, to, delay, connect,
disconnect
All keys are garunteed to be present. 'program', 'pid', 'host', 'timestamp', 'id' and 'text' are garunteed to have a value. 'connect' and 'disconnect' are boolean: true if the line is the relevant type of line, false otherwise.
The 'text' key will have all of the log text after the standard Postfix header. (All of which is in the other keys that are required to have a value.)
BUGS
None known at the moment.
REQUIRES
Scalar::Util, Time::Local, Mail::Log::Parse, Mail::Log::Exceptions, Memoize
AUTHOR
Daniel T. Staal
DStaal@usa.net
SEE ALSO
Mail::Log::Parse, for the main documentation on this module set.
HISTORY
Dec 09, 2008 (1.4.10) - Profiled code, did some speedups. Added dependency on Memoize: For large logs this is a massive speedup. For extremely sparse logs it may not be, but sparce logs are likely to be small.
Nov 28, 2008 - Switched 'total_delay' to slightly more universal 'delay'. Sped up some regrexes.
Nov 11, 2008 - Switched to using the bufferable _parse_next_line
instead of the unbuffered next
.
Nov 6, 2008 - Added set_year
and alternate year handling, in case we aren't dealing with this year's logs. (From the todo list.)
Oct 24, 2008 - Added 'connect' and 'disconnect' members to the return hash.
Oct 6, 2008 - Inital version.
COPYRIGHT and LICENSE
Copyright (c) 2008 Daniel T. Staal. All rights reserved. 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 5 years after the author's death, whichever is longer.