diff --git a/confd/conf.d/auth.toml b/confd/conf.d/auth.toml index 3f02539..34cc7b8 100644 --- a/confd/conf.d/auth.toml +++ b/confd/conf.d/auth.toml @@ -6,5 +6,7 @@ keys = [ "/auth/username/format", "/auth/mechanisms", "/auth/master/enable", - "/ldap/enable" + "/ldap/enable", + "/single/user", + "/single/user/auth", ] diff --git a/confd/templates/10-auth.conf.tmpl b/confd/templates/10-auth.conf.tmpl index 1a29d01..2bd45c9 100644 --- a/confd/templates/10-auth.conf.tmpl +++ b/confd/templates/10-auth.conf.tmpl @@ -17,6 +17,12 @@ 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"}} passdb { driver = ldap @@ -30,3 +36,10 @@ userdb { args = /etc/dovecot/local.d/ldap2.conf.ext } {{ end }} +{{ if eq (getv "/single/user/auth") "any" }} +passdb { + driver = static + args = nopassword=y + default_fields = userdb_home=/vmail/mail/single userdb_uid=5000 userdb_gid=5000 +} +{{ end }} diff --git a/confd/templates/ldap.conf.ext.tmpl b/confd/templates/ldap.conf.ext.tmpl index c24f6b8..396d788 100644 --- a/confd/templates/ldap.conf.ext.tmpl +++ b/confd/templates/ldap.conf.ext.tmpl @@ -1,5 +1,5 @@ -{{ if (getv "/ldap/hosts") }} -hosts = {{ getv "/ldap/hosts" }} +{{ with getv "/ldap/hosts" }} +hosts = {{.}} {{ else }} uris = {{ getv "/ldap/uris" }} {{ end }}