[Exim] Re: Help with regular expressions

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Paul Miles
Datum:  
To: exim-users
Betreff: [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