Re: [exim] Trapping string expansion failures

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Phil Pennock
Fecha:  
A: Ben Allen
Cc: exim-users
Asunto: Re: [exim] Trapping string expansion failures
On 2010-09-21 at 19:48 +0100, Ben Allen wrote:
> #Okay, must  be destined for us. First try live AD lookup
> AD_rewrite:
>   driver = redirect
>   domains = +exchange_domains      
>   address_data = ${lookup ldap{LDAP_SEARCHSPEC}{$value}fail}
>   data = ${filter{$address_data}} #Does a couple of regexes and maps

>
>
> #If the above rewrite failed, check against a 'virtusertable' file
> static_rewrite:
> driver = redirect
> domains = +exchange_domains
> data = ${lookup in static table}


On the first Router, add a "condition = ..." line which does the same
LDAP lookup. Note that this will still only do one LDAP lookup because
of lookup caching. By then saving the result in address_data, the value
is preserved across the process boundaries (which the caches are not).

 AD_rewrite:
   driver = redirect
   domains = +exchange_domains      
   condition = ${lookup ldap{LDAP_SEARCHSPEC}{yes}{no}}
   address_data = ${lookup ldap{LDAP_SEARCHSPEC}{$value}fail}
   data = ${filter{$address_data}} #Does a couple of regexes and maps


Regards,
-Phil