Q0407 - Exim/exim GitHub Wiki
Q0407
How can I arrange for a default value when using a query-style lookup such as LDAP or NIS+ to handle aliases?
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.