Re: [Exim] "system filter" needs in a non system_filter filt…

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: chad
CC: exim-users
Subject: Re: [Exim] "system filter" needs in a non system_filter filter
On Thu, 13 Mar 2003, Chad Leigh -- Shire.Net LLC wrote:

> I have a filter that I would like to run conditionally, based on a flag
> set in my user ldap database. I have it set to run, but I would like
> to be able to do things like set headers and stuff in it. Basically, I
> have a spam filter that I want to run conditionally, depending on
> whether a user wants it to be run or not, and if it is run, and thinks
> it is spam, I want to add my own header into the message and then
> continue with delivery.


This kind of thing always has the same problem: what do you want to do
if the message has more than one recipient, and one wants the filtering
and the other does not?

> However, the "header add" is only available for "system filters", which
> seem to only be called by the filter specified in "system_filter". Is
> there any way for me to set up a router that calls a filter that the
> system will allow "system filter" commands in?


You can allow certain commands (defer, fail, freeze) in filters run by
the redirect router, but not header manipulation stuff, because the
filtering commands that operate on headers do so on the single copy of
the headers that is used for all recipients.

However, routers themselves have headers_add and headers_remove options.
These apply only to the one address that is being routed. Unfortunately,
there isn't an easy way of tieing them in to what goes on in a user
filter. There's probably some hacky way of tieing this all together, but
I can't think of it offhand.

--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.