always_bcc exceptions?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

always_bcc exceptions?

Corey Chandler
Is there a way to exempt users from the always_bcc option (i.e.,  
general counsel doesn't want mail logged in the system)?  I seem to  
recall there was a way to build an exclusion class, but my brain's  
gone to bed before I have tonight, it would seem...

--Jay
Reply | Threaded
Open this post in threaded view
|

Re: always_bcc exceptions?

mouss-2
Jay Chandler wrote:
> Is there a way to exempt users from the always_bcc option (i.e., general
> counsel doesn't want mail logged in the system)?  I seem to recall there
> was a way to build an exclusion class, but my brain's gone to bed before
> I have tonight, it would seem...


use recipient_bcc_maps instead.

you can generate the list of recipients to bcc with a script or
"generate" them on the fly using sql, ldap, or pcre (or regexp).

alternative, bcc every recipient but embed the original recipient into
the bcc address. you can then discard selective bcc addresses.


For example:

recipient_bcc_maps =
        pcre:/etc/postfix/recipient_bcc


== recipient_bcc:
/(.*)@example\.com$/ $1=[hidden email]
...

then use transport_maps to discard some:

boss=[hidden email] discard:
...

if you don't want per user transports (latency), first use a virtual
alias to rewrite the addresses to [hidden email], then discard
mail to "discard.example.org".



Reply | Threaded
Open this post in threaded view
|

Re: always_bcc exceptions?

Wietse Venema
mouss:
[ Charset ISO-8859-1 unsupported, converting... ]

> Jay Chandler wrote:
> > Is there a way to exempt users from the always_bcc option (i.e., general
> > counsel doesn't want mail logged in the system)?  I seem to recall there
> > was a way to build an exclusion class, but my brain's gone to bed before
> > I have tonight, it would seem...
>
>
> use recipient_bcc_maps instead.
>
> you can generate the list of recipients to bcc with a script or
> "generate" them on the fly using sql, ldap, or pcre (or regexp).
>
> alternative, bcc every recipient but embed the original recipient into
> the bcc address. you can then discard selective bcc addresses.
>
>
> For example:
>
> recipient_bcc_maps =
> pcre:/etc/postfix/recipient_bcc
>
>
> == recipient_bcc:
> /(.*)@example\.com$/ $1=[hidden email]
> ...
>
> then use transport_maps to discard some:
>
> boss=[hidden email] discard:
> ...

Another approach:

/etc/postfix/main.cf:
    recipient_bcc_maps =
       pcre:/etc/postfix/recipient_bcc

/etc/postfix/recipient_bcc:
    # Rely on Postfix built-on duplicate elimination.
    /^counsel@example\.com$/ [hidden email]
    # All other recipients are archived.
    /(.*)@example\.com$/ archive+$[hidden email]

This does not require a transport mapping.

        Wietse