Wed, Jan 21, 2009 at 07:59:46PM +0100, mouss wrote:
> > All is working as I want. But some of my users needs to be forwarded
> > to other machine (running postfix+dspam to) to avoid NFS mount, so I would 
> > like to filter their mail only on destination machine. Filter is
> > triggered depend on client info/envelope from etc., so even when mail
> > needs to be forwarded it goes to dspam first.
> > 
> > Is there a possibility to trigger content filters _after_ expanding aliases 
> > (virtual/local)? 

Hello again,
I've played a little with various combinations and I've found following 
solution, 
but it's pretty complicated, I think :)

I'm launching filter through smtpd_recipient_restrictions:
smtpd_recipient_restrictions =
        permit_sasl_authenticated
        permit_mynetworks
        [...]
        check_recipient_access pcre:/usr/local/etc/postfix/filter_dspam

To make it work as I wish I have to:
1) provide virtual aliases to get correct destination user for dspam:
user.alias      user1
user.second.alias       user1

2) set a filter:
/user1/         REDIRECT        us...@second-server
/./             FILTER          lmtp:unix:/var/run/dspam/sock

3) Maintain local aliases too:
user.alias:     user1
user1:          us...@second-server

Now, when I'm getting mail for user.al...@first-server it's beeing
forwarded to us...@second-server without any filtering. Other mail is
filtered, local mail is bypassed too.
Is there really no way to fire up the filter only after knowing mail final 
destination?

> if you want filtering per recipient, then you can do this in dspam
> (optin...). otherwise, you need multiple postfix instances (run postfix
> twice) in which case you can use transport_maps for filtering (instead
> of content_filter and FILTER).

So I need one instance to forward some users to other server or
transport to dspam filter and the second for filtering and local
delivery? I would like to avoid surplus solutions ;)

-- 
Marcin Rzepecki
m.rzepecki(at)iem.pw.edu.pl

Reply via email to