On Mon, Jan 08, 2024 at 10:24:15AM +0530, anant--- via Postfix-users wrote:

> For specific 2 recipients of our domain, we don't want always_bcc to be
> implemented.  ie. if a mail is addressed to a...@xx.com  (our domain only),
> mail should not be Bcc to zz...@xx.com. similarly if mail recipient is
> d...@xx.com (our domain only), mail should not be Bcc to zz...@xx.com.  For
> all others always_bcc to continue.

Suggested approach (this uses "inline" tables, but equivalent file-based
PCRE, or, in the case of the transport(5) table, hash or cdb tables also
work.

    main.cf:
        recipient_delimiter = +
        recipient_bcc_maps = pcre:{
            { /^"(.*)"@example\.com$$/  "bcc+$${1}"@example.com }
            { /^(.*)@example\.com$$/  bcc+$${1}@example.com }
            }
        transport_maps = inline:{
            { bcc+...@example.com = discard:silently }
            { bcc+...@example.com = discard:silently }
            }

The "$$" syntax is only needed for inline tables in main.cf, just a
single "$" is needed in  a file-based PCRE table

    rcpt-bcc.pcre:
        /^"(.*)"@example\.com$/  "bcc+${1}"@example.com
        /^(.*)@example\.com$/  bcc+${1}@example.com

-- 
    Viktor.
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to