On Fri, 18 Dec 1998, Steve Sargent wrote:
> I want to look the domain up in a file of domain names and use the returned
> value as a part of the file name for the second lookup.
>
> The rewrite rule is:-
>
> *@lsearch;/usr/local/exim/tables/rewrite_domains \
> ${lookup{$local_part}lsearch{/usr/local/exim/tables/$value-aliases}\
> {$value}fail}@??? Ffrs
This doesn't make sense. The variable $value is the result of a lookup.
Therefore, you cannot make use of it as part of the name of the file in
which you are going to look it up. Surely what you want is
*@lsearch;/usr/local/exim/tables/rewrite_domains \
${lookup{$local_part}lsearch{/usr/local/exim/tables/$domain-aliases}\
{$value}fail}@??? Ffrs
> rewrite_domains contains:-
>
> qmwcc8.qmw.ac.uk:compserv
>
> compserv-aliases contains:-
>
> cgaa392:B.Harding
Oh, I see, it isn't as simple as that. Well, in that case, you have to
replace $domain above with
${lookup{$domain}lsearch{/usr/local/exim/tables/rewrite_domains}{$value}}
This will be quite efficient, since Exim caches lookups.
--
Philip Hazel University of Cambridge Computing Service,
ph10@??? Cambridge, England. Phone: +44 1223 334714.
--
*** Exim information can be found at
http://www.exim.org/ ***