Hi all,

I am using the following version of postfix on CentOS7 as shipped by the distro:

postfix-2.10.1-6.el7.x86_64

I am trying to convert this configuration into the new per-file LDAP 
configuration, and I have run into a problem:

virtual_mailbox_domains = ldap:acceptdomains
acceptdomains_server_host = localhost
acceptdomains_server_port = 389
acceptdomains_bind = yes
acceptdomains_search_base = ...
acceptdomains_query_filter = 
(&(associatedDomain=%s)(!(associatedDomain=$myhostname)))
acceptdomains_result_attribute = associatedDomain

The “myhostname” value is interpolated correctly as described by 
http://www.postfix.org/postconf.5.html.

When I convert the configuration to this:

virtual_mailbox_domains = ldap:/etc/postfix/acceptdomains.cf

And:

server_host = localhost
server_port = 389
bind = yes
search_base = ...
query_filter = (&(associatedDomain=%s)(!(associatedDomain=$myhostname)))
result_attribute = associatedDomain

The $myhostname variable is no longer interpolated, and mail delivery fails:

[26/Aug/2017:23:20:09.997464232 +0200] conn=711 op=1 SRCH base=“..." scope=2 
filter="(&(associatedDomain=...)(!(associatedDomain=$myhostname)))" 
attrs=“associatedDomain"

Can anyone confirm what I need to do to get variables interpolated correctly in 
LDAP tables as per http://www.postfix.org/postconf.5.html?

Regards,
Graham
—

Reply via email to