Author: Dean Brooks Date: To: exim-users Subject: Re: [exim] Per-User Filter
On Mon, Dec 30, 2013 at 08:48:49PM +0800, Rob Gunther wrote: > I just learned about Exim's filtering language.
>
> I would like to implement a 'per-user' filter, on that runs from a redirect
> router if some conditions are met.
>
> Problem is none of the users are actual local, there is no mailbox on the
> server. The server is just a forwarder to other servers.
>
> When I try and allow_filter and include file = /some.filter it will fail
> because it can't locate the local user.
Just add the following to your existing redirect router and you should
be good:
user = <user that owns the filter file>
group = <group that owns the filter file, optional>
require_files = <filter filename>
errors_to = ""
The require_files is optional, but will quietly skip the router if
the user's filter file doesn't exist. You would basically set this
the same as the "file=" value if you want to use it.
I also set errors_to="" so that if there are any syntax errors in
the filter that they don't get sent back to the sender. You could
also set that to hostmaster@yourdomain if you wanted the noise.
Oh, and of course make sure your filtering redirect router occurs
before your forwarding router in the config file.