Victor Duchovni:
> On Sat, Feb 20, 2010 at 03:43:25PM +0530, ram wrote:
>
> > One of our clients sends contract notes to their customers and they
> > require to store all logs of deliveries/bounces by some law.
> >
> > They have requirements like
> >
> > * The log should contain the full date including year
> > * The log line should indicate full info -->
> > sender,rcpt,datetime,size,status
> >
> > I have managed to add custom logs in postfix source in bounce.c and
> > sent.c. (Thanks to the neatly structured code it wasnt much of an
> > effort)
> >
> >
> > Only problem is when a message expires there is no log line that says
> > $queue-id: "$sender" to "$rcpt" status=expired
> >
> > How can I log this ?
>
> Collate the logs by message-id. What expired is the message, therefore,
> all recipients not yet delivered are expired.
The logs contain "status=deferred" for recipients that could not
be delivered. You are interested in the "status=deferred" records
logged after the last
postfix/qmgr[DDD]: HHHHHHH: from=<[email protected]>, size=12345 ...
> If the client uses a decently written bounce-bot, they can parse any
> bounces and extract the undelivered recipients.
Indeed, Postfix bounces are in RFC-standardized form.
Wietse