Koldo Navarro: > [using sender_bcc_maps] > user@mydomain.local registry@mydomain.local > then I get copy of all emails, both internal and outgoing ones. But I don't > want to keep a copy of internal emails as there are too many of them, and I > wouldn't want to have to set filters in the mail client program. > > As far as I know, it happens because address rewriting is performed after > processing bcc maps. And here comes my question:
When the copy is primarily destination-dependent, recipient_bcc_maps may be more appropriate. Conveniently, Postfix regexp and pcre maps have a negation operator that can be used to select remote destinations: /etc/postfix/main.cf: recipient_bcc_maps = pcre:/etc/postfix/recipient_bcc /etc/postfix/recipient_bcc: !/@local\.destination$/ registry@mydomain.local When the copy must depend on both the sender *and* the destination, then you need an external solution: - A dummy SMTP-based content filter that splits the mail stream, for example based on smtpprox from http://bent.latency.net/smtpprox/ - A Milter that selectively adds the carbon-copy recipient. Milters are available in Python, Perl, and other languages. Wietse