From 219c9c34c17f2470c4a89e00f86478cecca9dca4 Mon Sep 17 00:00:00 2001 From: Mauro Torrez Date: Tue, 20 Oct 2020 08:55:23 -0300 Subject: [PATCH] feat: better integration of single-mailbox setup with LDAP login --- confd/conf.d/ldap.toml | 1 + confd/conf.d/ldap2.toml | 1 + confd/templates/ldap.conf.ext.tmpl | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/confd/conf.d/ldap.toml b/confd/conf.d/ldap.toml index 492053c..dbfb84e 100644 --- a/confd/conf.d/ldap.toml +++ b/confd/conf.d/ldap.toml @@ -15,4 +15,5 @@ keys = [ "/ldap/iterate/attrs", "/ldap/iterate/filter", "/ldap/default/pass/scheme", + "/single/user", ] diff --git a/confd/conf.d/ldap2.toml b/confd/conf.d/ldap2.toml index 6bb380e..c0b60de 100644 --- a/confd/conf.d/ldap2.toml +++ b/confd/conf.d/ldap2.toml @@ -15,4 +15,5 @@ keys = [ "/ldap/iterate/attrs", "/ldap/iterate/filter", "/ldap/default/pass/scheme", + "/single/user", ] diff --git a/confd/templates/ldap.conf.ext.tmpl b/confd/templates/ldap.conf.ext.tmpl index 396d788..a8c88e4 100644 --- a/confd/templates/ldap.conf.ext.tmpl +++ b/confd/templates/ldap.conf.ext.tmpl @@ -7,9 +7,9 @@ auth_bind = {{ getv "/ldap/bind" }} ldap_version = {{ getv "/ldap/version" }} base = {{ getv "/ldap/base" }} scope = {{ getv "/ldap/scope" }} -user_attrs = {{ getv "/ldap/user/attrs" }} +user_attrs = {{ getv "/ldap/user/attrs" }}{{ if eq (getv "/single/user") "yes" }}, =home=/vmail/mail/single{{ end }} user_filter = {{ getv "/ldap/user/filter" }} -pass_attrs = {{ getv "/ldap/pass/attrs" }} +pass_attrs = {{ getv "/ldap/pass/attrs" }}{{ if eq (getv "/single/user") "yes" }}, =userdb_home=/vmail/mail/single{{ end }} pass_filter = {{ getv "/ldap/pass/filter" }} iterate_attrs = {{ getv "/ldap/iterate/attrs" }} iterate_filter = {{ getv "/ldap/iterate/filter" }}