Re: [exim] System Filters

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Gareth Hastings
CC: exim-users
Subject: Re: [exim] System Filters
On Fri, 16 Jun 2006, Gareth Hastings wrote:

> Aren't I able to search through $header_to and $header_cc using
> foranyaddress? I'm currently trying to move a system filter that's
> running on an Exim 3.x system to a Exim 4.62 system. We current have
> filters that check for lots of domains a long winded way i.e.
>
> if $header_to contains "twi.co.uk" or $header_to contains "dom1.co.uk"
> then
> ...
> endif


Yes, sure, you can certainly search those headers. I was just concerned
that you might be about to make a very common mistake. :-)

> I would like to archive a copy of every email that comes in and out of
> the server to a different mailbox but only for select domains!


That is a classic system filter application. If you must search the
headers, then you have to do it as suggested. But if you want to check
for domains in *actual* recipients, as opposed to what appears in the
headers, you can search $recipients.

Given a domain, you can search a list like this:

if "${match_domain{<the domain>}{twi.co.uk:dom1.co.uk:...}}" is "true"
then...


-- 
Philip Hazel            University of Cambridge Computing Service
Get the Exim 4 book:    http://www.uit.co.uk/exim-book