Re: [Exim] nisplus lookups in rewrite rules.

Página Inicial
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
Para: Stuart Jenkins
CC: exim-users
Assunto: Re: [Exim] nisplus lookups in rewrite rules.
On Thu, 6 Mar 2003, Stuart Jenkins wrote:

> However when we try and do the same thing with a nisplus query it
> fails. We can find no specific examples for this sort in any of the
> documentation, the nearest we can figure out to something which should
> work is.


A quick grep on spec.txt (for Exim 4.10) finds this example:

     ${lookup nisplus {[name=$local_part],passwd.org_dir:gcos} \
       {$value}fail}


> *@host ${lookup{$0}nisplus{[expansion="${0}"],mail_aliases.org_dir:alias}\
> {$value}fail}@???


As you discovered, that won't work because that syntax is for single-key
lookups. For lookups in databases that use "queries", the syntax is

${lookup <search type> {<query>} {<string1>} {<string2>}}

(that line is a direct quote from spec.txt too).

> Expansion of
> ${lookup{$0}nisplus{[expansion="${0}"],mail_aliases.org_dir:alias}{$value}fail}@
> oup.co.uk failed while rewriting: a single key was given for lookup type
> "nisplus", which is not a single-key lookup type


Yes, that is the correct error message.

> The relevant part of the Exim Specification (6.10, more about NIS+,
> http://www.exim.org/exim-html-3.30/doc/html/spec_6.html#SEC155 ) implies we've
> got it right.


Exim 3 is obsolete, but this aspect of Exim has not changed in Exim 4.

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