FAQ / Routing for local delivery / Q0407
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.
FAQ / Routing for local delivery / Q0407
