Skip to content
Nigel Metheringham edited this page Nov 29, 2012 · 2 revisions

Q0407


`Navigation(siblings)`_


Q0407

Question

How can I arrange for a default value when using a query-style lookup such as LDAP or NIS+ to handle aliases?

Answer

Use a second query in the failure part of the original lookup, like this:

data = ${lookup ldap\
  {ldap://x.y.z/l=yvr?aliasaddress?sub?(&(mail=$local_part@$domain))}\
  {$value}\
  {\
  ${lookup ldap \
    {ldap://x.y.z/l=yvr?aliasaddress?sub?(&(mail=default@$domain))}}\
  }}

Of course, if the default is a fixed value you can just include it directly.


Clone this wiki locally