On Tue, Feb 23, 2010 at 01:23:08PM +0100, Borja Marcos wrote:
> I'm enhancing a program I use to follow Postfix logs in sort of
> real-time. It does a couple of things, and the most important is to
> record a single-line summaries for each message, storing source IP
> address, from, to, timestamp, size, final delivery destination
> (mail relay or mailbox) and status.
You can trivially have smtpd(8) help you substantially. smtpd will
log everything it has regarding a message (everything before final
delivery) with one simple restriction:
smtpd_end_of_data_restrictions =
check_recipient_access static:warn
End of data was chosen because at that time the actual message size
is known. Recipient access was chosen because it gives a separate
entry per recipient of a multiple-recipient message. Salt to taste,
enjoy.
--
Offlist mail to this address is discarded unless
"/dev/rob0" or "not-spam" is in Subject: header