This is a discussion on Re: simple per-user content filter question within the mailing.postfix.users forums, part of the Mail Servers and Related category; On Mon, 9 Feb 2004, steve j. kondik wrote: > I need the filter to trigger on the final destination ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
On Mon, 9 Feb 2004, steve j. kondik wrote:
> I need the filter to trigger on the final destination address (which > would be found in virtual_mailbox_maps), rather than the "real" address. > using content_filter gets it right, and I had thought about just dealing > with the sql lookups in amavisd-new to decide if it should just pass the > message thru, but this adds _substantial_ overhead and i have to avoid > that. > > this seems like it should be simple, but every solution has been a dead > end so far. am i missing something here? > To do per-user content filtering, you need two instances of Postfix (two configuration directories each with main.cf, master.cf, separate queue, ....). The filter selection is made via a per-user transport table in the first instance, filtered mail is injected into the second instance for delivery (first instance is not an option, it would loop). Recipients not subjected to content filtering can be delivered directly from the first instance, but if you want to ensure that bounces are filtered also, you need to clear "mydestination" in the first instance, moving any local domains to relay_domains, and set "relayhost" in the first instance to point directly at the loopback injection port of the second instance. Postfix A ---> filter ---> Postfix B \ ^ \------- relayhost ----/ The transport map decides which user/domains are sent to the filter and which are sent directly to Postfix B. -- Viktor. |