On Fri, July 3, 2009 2:50 am, sosogh said:

> I just want to filter the inbound mails(whose destination is postifx)
> excluding outbound mails (whose destination is outside world)
>
> the content filter will filter all the mails

A proper solution to this requires you to have two separate instances of
Postfix (see http://www.postfix.org/MULTI_INSTANCE_README.html), but you
might be able to get away with a simpler solution:

main.cf:
smtpd_recipient_restrictions =
    check_recipient_access regexp:/path/to/file,
    ...

/path/to/file:
# Let all of your own domains return DUNNO
/@example\.com$/           DUNNO
/^/                        FILTER dspam (or whatever filter you use)

This has the drawback that if a message is addressed to one recipient in
your domain(s) and one recipient is external, the message will be filtered
for both recipients. This can only be solved with multiple instances.

This has been asked many times before, so I'm sure you can find additional
discussion and solution proposals in the list archives.

-- 
Magnus Bäck
mag...@dsek.lth.se

Reply via email to