On 26 Nov 2012, at 11:25 PM, Wietse Venema <wie...@porcupine.org> wrote:

>> 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.

In my case $myhostname is unset, meaning fall back to the default of using the 
fully-qualified domain name from gethostname(), and this has worked in the past 
for LDAP tables specified in main.cf.

If I am understanding you correctly are you saying that only if parameters are 
explicitly set to a concrete value in main.cf, will this value be available in 
the LDAP table, the defaults are no longer enough?

Regards,
Graham
--

Reply via email to