Yang Zhang:
> 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.

This function is not built into Postfix. 

It is usually achieved with a small SMTP-based "null filter" that
forks the incoming mail stream into two output streams.

- The first output stream goes back to Postfix (as is normal with
  an SMTP-based content filter).

- The second output stream is a new mail transaction with the
  original MAIL FROM/RCPT TO information prepended to the message
  content.

This "null filter" program sends "." on the first stream only after
the "." on the second stream produces a 250 reply. Otherwise it
just closes the first stream without sending "." and reports a
temporary error to the Postfix SMTP client.

Writing an SMTP-based "null filter" is easy in scripting languages
such as Perl.

        Wietse

Reply via email to