Graham Leggett: > Hi all, > > I've had an LDAP table in main.cf configured for a number of years > containing the following filter, and this has worked fine. The > filter matches all email addresses that should be delivered anywhere > except for the local server: > > ldapremote_query_filter = > (&(|(mail=%s)(mailAlternateAddress=%s))(!(mailHost=$myhostname))) > > I have since tried to update the LDAP table configuration to use > separate files as recommended by the docs, for example > ldap:/etc/postfix/remove.cf, and after doing so delivery fails > with a mail loop. It turns out using the new LDAP table syntax the > value of "myhostname" is no longer parsed and the string is passed > through to the LDAP query unmodified:
Postfix will expand $myhostname etc. in LDAP parameters *only* when you specify those parameters in main.cf. Wietse