@lbutlr:
> I was wondering if it would be possible to use a map for always_bcc that
> would bcc emails for some users and not others, and to bcc to a custom
> address for each user.
>
> right now, I have always_bcc set to [email protected] but I would like to
> set it up to something like:
>
> [email protected]
>
> But then only do that for some of the users and not use always bcc at all for
> the rest.
>
> I suspect I can do this with a simple regex match, but am not sure what
> happens if a map results in no return data for always_bcc. There?s nothing at
> http://www.postfix.org/postconf.5.html about using maps with always_bcc at
> all, so maybe not?
>
> (I use dovecot if that matters)
Postfix sender_bcc_maps and recipient_bcc_maps will add a BCC address
depending on sender or recipient. These tables work with regexp:
and pcre: maps. Strictly speaking, recipient_bcc_maps is redundant
because the same can be done (more clumsily) with virtual_alias_maps.
/etc/postfix/main.cf:
recipient_bcc_maps = pcre:/etc/postfix/recipient_bcc.pcre
/etc/postfix/recipient_bcc.pcre
/^(.+)@([^@]+)$/ [email protected]
This backs up all recipients in all domains; you may want to make
the pattern more specific, like this:
/etc/postfix/recipient_bcc.pcre
/^(.+)@(example\.com|example\.net)$/ [email protected]
Don't forget the ^, $, and the \.
Wietse