[Exim] Re: Help with regular expressions

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Paul Miles
Date:  
À: exim-users
Sujet: [Exim] Re: Help with regular expressions
On Wednesday 20 Mar 2002 11:39 am, Paul Miles wrote:

I really should RTFM ...

The solution, if anyone is interested is :

condition = ${if eq {}
{${lookup{$sender_address_domain}lsearch{/etc/sysconfig/exim/local_domains}{$value}{no}}}{yes}{no}}

Thanks ...

Paul.


> Hi All,
>
> I desperately need some help with a regular expression/lookup in Exim 3.34.
>
> I have a text file called /etc/sysconfig/exim/local_domains which contains
> entries such as :
>
> mydomain1.com
> mydomain2.co.uk
>
> I'm trying to write a 'condition' statement that evaluates whether or not a
> certain Director runs based on the senders email address.
>
> ie. If the sender is in one of the domains listed by the local_domains
> file, process the director, otherwise don't bother.
>
> My condition is :
>
> condition = {$sender_address = /^.*@(.*)/} ${if eq {}
> {${lookup{$1}lsearch{/etc/sysconfig/exim/local_domains}{$value}{no}}}{yes}}
>
> This doesn't work :-( My problem is that the sender_address contains both a
> local_part and a domain, and I just can't seem to strip the local_part
> before comparing against my text file of local_domains.
>
> Please please help,
>
> Thanks in advance,
>
> Paul