I have sender_bcc_maps set up and working with postfix so that outgoing mail gets bcc'd to the sender's address. My configuration is more or less:
main.cf
sender_bcc_maps = regexp:/etc/postfix/regexp_sender_bcc
regexp_sender_bcc
/^([^@]+)@[a-zA-Z0-9_]+\.[a-zA-Z0-9_]+$/ [email protected]
This works great. Now I have an email address [email protected]
that I'd like to exclude from this configuration.
Idea 1: I first tried adding a row to route to a non-existent mailbox
/^nobody.*$/ [email protected]
Predictably, this results in an attempt to bcc that address and a bounceback since it doesn't exist.
Idea 2: Next I tried simply changing the target to an empty string:
/^nobody.*$/
This generates a warning and completely drops the outgoing mail as well:
warning: sender_bcc_maps lookup of [email protected] returns an empty string result
warning: sender_bcc_maps should return NO RESULT in case of NOT FOUND
warning: sender_bcc_maps map lookup problem -- message not accepted, try again later
Idea 3: I then tried routing this mail to a local user:
/^nobody.*$/ nobody@localhost
This somewhat does the job but then all these messages are still delivered to the local mail system.
I'd like to do either one of these - preferring the former:
- configure sender_bcc_maps to completely ignore a specific sender's address
- configure postfix to completely discard mail to a specific user