csere matyas wrote:
hi

i have a postfix set up with a bunch of virtual domains.
we've been using always_bcc to archive the mail, until one of the paranoid users asked us not to include his mail in the archive.

so i'm trying to do the same with recipient/sender maps:
----
recipient_bcc_maps = pcre:/etc/postfix/recipient_bcc
sender_bcc_maps = pcre:/etc/postfix/sender_bcc
----
the contents of the two files are the same:
----
/^paranoid\.u...@my\.tld$)/ null
/.*/                            mailbac...@my.tld
----
null points to /dev/null in my aliases file.

if i enable only the recipient line, it works, his mail gets delivered to null and his mailbox. if i enable only the sender line, it works, mail sent from him, gets sent to null, and whoever. BUT, if i enable both rules, both his sent and recieved emails get archived!

Of course it's archived - unless he's both the sender and recipient.

You can use a policy server that checks {sender, recipient} and returns "BCC whate...@example.com" if Mr. Paranoid isn't found. This may be tricky since the policy protocol doesn't report a full list of recipients, only the "current" recipient.

Better solution is to bcc everything and use a delivery filter (procmail or whatever) to throw away mail this is neither to nor from him.

But what about mail from him to someone who needs to be archived? or vice versa? What about multi-recipient mail to him plus someone that must be archived? Can't solve all these problems in an MTA.

BTW, you can use "DUNNO" as the result in a pcre table to pretend the string wasn't found. No need to use a "null" alias.

  -- Noel Jones

Reply via email to