The goal here is to send an BCC message for every email send to or from the outside world, for a group of internal addresses.
Use sender_bcc_maps or recipient_bcc_maps. Configure them so that the archive copy is made when the sender is remote OR the receiver is remote.
/etc/postfix/main.cf:
sender_bcc_maps = pcre:/etc/postfix/archive-check recipient_bcc_maps = pcre:/etc/postfix/archive-check
/etc/postfix/archive-check:
!/@example.com$/ archive@example.com
This is a predicate transformation, from (NOT (local AND local)), what you asked for, into ((NOT local) OR (NOT local)), shown above.
Hi,
how can i archive incoming and outgoing mails for individual mailboxes in postfix