1

I want to extend a new Postfix / Dovecot setup with virtual domains and virtual mailboxes (more or less everything in default configuration) by a simple, self-made email archival solution.

Therefore I want to make Postfix push all incoming and outgoing mails - regardless of virtual domain etc.

  • either to a listening TCP socket (preferred due to performance and easier programming)
  • or to a script (pipe)
  • or to files in the file system.

I don't want the socket or pipe process to be the final destination for the mails. (For incoming mails, it's a Dovecot LMTP.)

It's just about "intercepting" the mails in addition (!) to normal processing.

What are the config options I have to touch? I guess I have to add a service in the master.cf. Maybe someone here has done this before as the task of email archival for postfix seems to be quite common.

mailbox_command is probably not what I'm looking for as I want the mail tap in addition to normal processing and I need it for incoming AND outgoing mails.

This question is NOT about the development of an email archival system. It's just about configuring Postfix to "blow out" all incoming and outgoing mails to some external process, in addition to normal processing.

MrSnrub
  • 153
  • 1
  • 2
  • 8

1 Answers1

0

Have you tried always_bcc? It is an

Optional address that receives a "blind carbon copy" of each message that is received by the Postfix mail system.

I've tested and it captured both incoming and outgoing email messages.

There's a guide here to configuring Postfix to use it to create a maildir-based mail archive. But since you're configuring it for a recipient you could also pipe it to a script.

gowenfawr
  • 406
  • 2
  • 7