Re: [exim] System Filters

Pàgina inicial
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
A: Gareth Hastings
CC: exim-users
Assumpte: Re: [exim] System Filters
On Fri, 16 Jun 2006, Gareth Hastings wrote:

> I'm trying to match domains in system filter. I current have a text file
> with a list of domains in it called /etc/exim/test/gdh which contains:
>
> dom1.co.uk
> dom2.co.uk
>
> So far I've been testing my filter from the command line using exim -be.
>
> exim -be
> '${lookup{gareth@???}wildlsearch{/etc/exim/test/gdh}{yes}{no}}'
>
> So far this fails because there isn't any wildcard pattern matching. If
> I change my file gdh so it reads
>
> *dom1.co.uk
> *dom2.co.uk
>
> Then this matches fine! I can't do this because the file is using in a
> domain list within Exim. Is there a way to match this without modifying
> the file?


exim -be
'${lookup{${domain:gareth@???}}lsearch{/etc/exim/test/gdh}{yes}{no}}'

perhaps? (Note that you don't need wildlsearch.) But more importantly,
how are you going to obtain a domain in a system filter? Remember that
$domain is not set, because there may be more than one recipient for a
message. Of course, there's no problem if you are trying to match a
sender domain.

What are you *really* trying to achieve?

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