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

-- 
## List details at http://lists.exim.org/mailman/listinfo/exim-users 
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to