Re: [Exim] No searchable archives?

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Philip Hazel
Ημερομηνία:  
Προς: John Horne
Υ/ο: Exim Users List
Αντικείμενο: Re: [Exim] No searchable archives?
On Tue, 20 Jun 2000, John Horne wrote:

> The problem - since it may be quicker to ask the list - is simply are
> multiple lookups possible using previous lookup results (and I have that
> funny feeling I've asked this before...hence the search of the archives)?
> For example:  ${lookup .....
>                      {${lookup {$value} ....

>
> So using the result of the first lookup (in $value) as the key for the
> second lookup. Running exim with -d9 seems to show that $value becomes null
> and hence the second lookup fails.


Your example isn't precise enough to show exactly what you are doing.
There are two ways to do it. The first is this:

${lookup{x}lsearch{/file1}{${lookup{$value}lsearch{/file2 .... } fail}

The second is this

${lookup{${lookup{x}lsearch{/file1}{$value}{*}}}lsearch{/file2}...

The first way fails in the way you describe because the contents of
$value are reset at the start of a lookup item; the second one should work.

I will see if I can delay the resetting of $value until after the
expansion of the key and file strings so that the first way will also
work, but in the meantime, the workaround is to use the second form.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.