From 6584780e0a8fadef4f0a7fab67c8f4831d13488b Mon Sep 17 00:00:00 2001 From: Mauro Torrez Date: Tue, 20 Oct 2020 00:43:53 -0300 Subject: [PATCH] feat: single user working with LDAP login --- confd/templates/10-auth.conf.tmpl | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/confd/templates/10-auth.conf.tmpl b/confd/templates/10-auth.conf.tmpl index 2bd45c9..40060a5 100644 --- a/confd/templates/10-auth.conf.tmpl +++ b/confd/templates/10-auth.conf.tmpl @@ -17,13 +17,7 @@ passdb { {{ end }} -{{ if eq (getv "/single/user") "yes" }} -userdb { - driver = static - args = uid=5000 gid=5000 home=/vmail/mail/single -} -{{ end }} -{{ if eq (getv "/ldap/enable") "yes"}} +{{ if eq (getv "/ldap/enable" "") "yes"}} passdb { driver = ldap args = /etc/dovecot/local.d/ldap.conf.ext @@ -36,10 +30,18 @@ userdb { args = /etc/dovecot/local.d/ldap2.conf.ext } {{ end }} -{{ if eq (getv "/single/user/auth") "any" }} +{{ if eq (getv "/single/user" "") "yes" }} +userdb { + driver = static + args = uid=5000 gid=5000 home=/vmail/mail/single +} passdb { driver = static +{{ if eq (getv "/single/user/auth" "") "any" }} args = nopassword=y +{{ else }} + args = password= +{{ end }} default_fields = userdb_home=/vmail/mail/single userdb_uid=5000 userdb_gid=5000 } {{ end }}