I needed to be able to set the name of the smart host for a manualroute router in the Exim MTA(Mail Transport Agent) and came up with this:

LDAP_SMARTHOST = ldap:///ou=Config,BASEDN?dadConfigData?sub?(cn=exim-
smarthost)

with a router defined as

smart_route:
  driver = manualroute
  domains = !+local_domains
  transport = remote_smtp
  route_list = * "${extract{1}{/}{ ${lookup ldap{LDAP_SMARTHOST}} }}"
  condition  = ${lookup ldap{LDAP_SMARTHOST}}

I love Exim. And LDAP.

LDAP, Exim, and DAD/miniDAD :: 24 May 2006 :: e-mail