Mauro Torrez 4de1ce0dc6
All checks were successful
continuous-integration/drone/push Build is passing
feat: single user (all mails go to the same inbox)
2020-10-19 12:38:28 -03:00

46 lines
1.1 KiB
Cheetah

auth_realms = {{ getv "/mail/domains" }}
auth_default_realm = {{ index (split (index (split (getv "/mail/domains") " ") 0) ",") 0 }}
auth_username_format = {{ getv "/auth/username/format" }}
auth_mechanisms = {{ getv "/auth/mechanisms" }}
{{ if eq (getv "/auth/master/enable") "yes"}}
passdb {
driver = passwd-file
master = yes
args = /etc/dovecot/master-users
# Unless you're using PAM, you probably still want the destination user to
# be looked up from passdb that it really exists. pass=yes does that.
pass = yes
}
{{ 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
args = /etc/dovecot/local.d/ldap.conf.ext
}
userdb {
driver = prefetch
}
userdb {
driver = ldap
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 }}