Question : How to bypass sender_bcc_maps & recipient_bcc_maps for specific users within the same domain

Hi,

I have a postfix setup for a client domain "domain.com" wherein I have configured sender_bcc and recipient_bcc maps in this manner:

sender_bcc

[email protected]  [email protected]
[email protected]  [email protected]
[email protected]  [email protected]

where a,b and c are regular users and d is their team leader. However the problem I have is that when d sends mail to either a, b or c, based on the sender_bcc and recipient_bcc rules, d gets a copy of the mail as well -- which is not required.

What I would like to know is that how do I restrict sender/recipient_bcc for a specific user -- i.e. is it possible for me to set a rule where mails between users on the same domain will not be affected by the sender/recipient_bcc rule.

Appreciate your inputs/ideas to implement this.

Best Regards,
Krish

Answer : How to bypass sender_bcc_maps & recipient_bcc_maps for specific users within the same domain

Would it not be easiest to use a delivery agent filter to eliminate such duplicate mail?

You may be able to achieve this with a content_filter which does the following:

If the sender is [email protected] and recipient is one or more of [email protected] ,[email protected] and [email protected]
then send the mail forward as it is.
If the sender is not [email protected] and recipient is one or more of [email protected] ,[email protected] and [email protected]
then return the mail to Postfix with an additional recipient.

Alternatively, you could use a restriction_class which works like this:

route_differently = check_recipient_access hash:/etc/postfix/recipients

check_sender_access hash:/etc/postfix/senders

/etc/postfix/senders contains
[email protected]      route_differently

/etc/postfix/recipients contains
[email protected]       PREPEND   X-Message-From-d: True
[email protected]       PREPEND   X-Message-From-d: True
[email protected]       PREPEND   X-Message-From-d: True

This will prepend the X-Message-From-d: True header in the message (see access(5) for the details of PREPEND).
Then in the delivery agent, or the MUA, filter on this header and deliver to /dev/null.
Random Solutions  
 
programming4us programming4us