> On Aug 21, 2016, at 5:13 AM, Wietse Venema <wie...@porcupine.org> wrote:
> 
> Robert Schetterer:
>> Am 21.08.2016 um 05:10 schrieb Steve Atkins:
>>> I find I need to extract a list of deliveries, and delivery attempts, from 
>>> postfix logs. Ideally I'd like to feed /var/log/mail.log into some script 
>>> and get out something like {timestamp, peer ip, helo, envelope from, 
>>> recipient, message-id} for every email.
>>> 
>>> Does anyone know of a log analyzer or some other script that'll do that?
>>> 
>>> Cheers,
>>>  Steve
>>> 
>> 
>> http://linux.die.net/man/1/pflogsumm
>> https://github.com/benningm/saftpresse
>> https://sourceforge.net/projects/logwatch/

All good analyzers - I've been using pflogsumm for years - but they
do too much analyzing and summarizing for what I need today.

> 
> There also is auxiliary/collate/collate.pl in the Postfix 3.2
> source-code distribution.
> 
>    "This script, by Viktor Dukhovni, untangles a Postfix logfile and
>    groups the records one "session" at a time based on queue ID and
>    process ID information. Records from different sessions are separated
>    by an empty line.  Such text is easy to process with $/="" in perl,
>    or RS="" in awk."
> 
> With the logging organized by email "session", all you need 
> is a script that picks out the desired fields.

Nice. That'll make it easier to pull out the deliveries. (And the rejected
delivery attempts are just a single line in the original logs, so easy
enough to handle separately).

Thanks.

Cheers,
  Steve

Reply via email to