LDAP maps and query_filters:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

LDAP maps and query_filters:

Graham Leggett
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 | Threaded
Open this post in threaded view
|

Re: LDAP maps and query_filters:

Viktor Dukhovni

> On Aug 26, 2017, at 5:28 PM, Graham Leggett <[hidden email]> wrote:
>
> 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?

There is no support for main.cf variable interpolation in separate "table.cf" files.
You can use make(1) or similar to build such files from templates.

--
        Viktor.