For incoming emails to a postfix server, i would like to record the timestamp in the "Receive: from" header.
For example, from an email containing:
Received: from mailserver01 ([192.168.0.25]) by mailserver01.domain.intra with Microsoft SMTPSVC(6.5);
Mon, 16 Jul 2012 17:09:36 +0200
I would like to extract:
Mon, 16 Jul 2012 17:09:36 +0200
What i would like to know is how to configure postfix to log that information (just the timezone or the whole "Received: from" header). I can handle the parsing to extract the information once i have that line logged.
You can pass it to cut
or if you place email content in bash variable:
I'm not aware of any config option to customize the log format. Have you tried running
postconf
to see if there's any option that deals with the log format?Anyway, a similar question has been asked before, and it seems that it's not possible
Postfix custom log