On Tue, Sep 21, 2010 at 11:56:41AM -0700, Yang Zhang wrote:

> How do you get Postfix to keep a log of all outgoing mails, in their
> complete form (all headers + payload) as received from clients? The
> closest param I've found so far are always_bcc & friends, but these
> lose some information (at least the BCC field). Thanks in advance for
> any hints.

The archives of this list contain suggestions of how to achieve this
with a regexp or pcre recipient_bcc_maps which generates copies of
the message without losing envelope information.

The alternative, as suggested by Wietse, is an SMTP "Y-adaptor" that forks
an SMTP transaction into two streams. I've been using this approach for
5+ years. Messages are transmitted in parallel to both the archive and
the real destination, but "." is sent to the archive stream first, and
if that fails, the transmission to the real destination is aborted.
This has proved quite reliable.

The main risk is that mail can be archived, but the main delivery could
tempfail, leading to multiple archive copies. It is useful to have
de-duplication logic in the archive-stream. And of course keep that
parallel to the archive next-hop as reliable as possible, in my case,
a local Postfix instance that does the real message routing.

-- 
        Viktor.

Reply via email to