The above filtering configurations are static. Mail that follows
a given path is either always filtered or it is never filtered. As
of Postfix 2.0 you can also turn on content filtering on the fly.
To turn on content filtering with an
access(5) table rule:
/etc/postfix/access:
whatever FILTER foo:bar
To turn on content filtering with a
header_checks(5) or
body_checks(5) table pattern:
/etc/postfix/header_checks:
/whatever/ FILTER foo:bar
You can do this in smtpd access maps as well as the cleanup
server's header/body_checks. This feature must be used with great
care: you must disable all the UCE features in the after-filter
smtpd and cleanup daemons or else you will have a content filtering
loop.
Limitations:
-
FILTER actions from smtpd access maps and header/body_checks
take precedence over filters specified with the
main.cf
content_filter
parameter.
-
If a message triggers more than one filter action, only
the last one takes effect.
-
The same content filter is applied to all the recipients
of a given message.