Re: [exim] Stupid lsearch/lookup-question?

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Mike Cardwell
Date:  
À: exim-users
Sujet: Re: [exim] Stupid lsearch/lookup-question?
* on the Wed, Feb 21, 2007 at 03:06:03PM +0000, Mike Cardwell wrote:

> | mike@rabies:~/foo$ echo -ne "Username: yes\nUsername2: yes" >
> | lookup_file.txt
> | mike@rabies:~/foo$ /usr/sbin/exim4 -be
> | > ${lookup{Username}lsearch{lookup_file.txt}}
> | yes
> | > ${lookup{UsernameFoo}lsearch{lookup_file.txt}}
> |
> | >
>
> This shows that your lookup method returns either "yes" or "" when
> expanded. This means that the only address that would match is
> "yes@???" and that would only match if the username "yes" was
> in the "domain-redirect" file.
>
> The expansion should return the local part it's self. Try replacing
> with:
>
> ${if eq{${lookup{$local_part}lsearch{lookup_file.txt}}}{yes}{$local_part}{}}


Ok. I just saw the other two answers. Do it their way, my suggestion's
crap. I'm very familiar with mysql and dnsdb lookups, but I've never
really done much with file lookups other than copy and paste other
peoples examples.

Mike