Re: [Exim] nisplus lookups in rewrite rules.

Página Inicial
Delete this message
Reply to this message
Autor: Stuart Jenkins
Data:  
Para: exim-users
Assunto: Re: [Exim] nisplus lookups in rewrite rules.
>Date: Fri, 7 Mar 2003 09:43:57 +0000 (GMT)
>From: Philip Hazel <ph10@???>
>To: Stuart Jenkins <swjenkins@???>
>cc: exim-users@???
>Subject: Re: [Exim] nisplus lookups in rewrite rules.
>
>On Thu, 6 Mar 2003, Stuart Jenkins wrote:
>
>
>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).
>


I'd found this in the documentation, but using a rewrite rule of.

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


gives an error of

unknown rewrite flag character (n) in line 437 (could be missing quotes round
replacement item)
search_tidyup called

Which seems to be objecting to the whitespace in the rewrite.

Whilst writing this, a colleague has just suggested using " around the entire
rewrite thusly.

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


and it works, so I will go and feel very daft that I think of this sooner.

Stuart