diff --git a/defaults/main.yml b/defaults/main.yml index 5ba7f17..aadd826 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -25,9 +25,6 @@ dovecot_auth_mechanisms: plain # como transformar el nombre de usuario antes de autenticar dovecot_auth_username_format: "%Lu" -# habilitar userdb/passdb de usuarios del sistema? -dovecot_auth_system_enable: no - # habilitar usuarios master? dovecot_auth_master_enable: no @@ -36,10 +33,16 @@ dovecot_auth_master_enable: no # habilitar userdb/passdb ldap? dovecot_ldap_enable: yes +# servidores ldap +dovecot_ldap_hosts: [] + # servidores ldap dovecot_ldap_uris: - "{{ ldap_uri | default('ldap://localhost') }}" +# autenticar con clave provista por usuario +dovecot_ldap_bind: yes + # version del protocolo LDAP dovecot_ldap_version: 3 diff --git a/files/10-auth.conf.tmpl b/files/10-auth.conf.tmpl new file mode 100644 index 0000000..839056f --- /dev/null +++ b/files/10-auth.conf.tmpl @@ -0,0 +1,32 @@ +auth_realms = {{ getv "/mail/domains" }} +auth_default_realm = {{ first 1 (split (getv "/mail/domains") " ") }} +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 "/auth/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 }} diff --git a/files/10-mail.conf b/files/10-mail.conf index 2a00ca3..c95f005 100644 --- a/files/10-mail.conf +++ b/files/10-mail.conf @@ -7,7 +7,7 @@ namespace inbox { # Namespace type: private, shared or public #type = private separator = / - #prefix = + #prefix = #location = # There can be only one INBOX, and this setting defines which namespace @@ -51,7 +51,7 @@ mail_gid = vmail # A comment or note that is associated with the server. This value is # accessible for authenticated users through the IMAP METADATA server -# entry "/shared/comment". +# entry "/shared/comment". #mail_server_comment = "" # Indicates a method for contacting the server administrator. According to @@ -59,7 +59,7 @@ mail_gid = vmail # is currently not enforced. Use for example mailto:admin@example.com. This # value is accessible for authenticated users through the IMAP METADATA server # entry "/shared/admin". -#mail_server_admin = +#mail_server_admin = ## ## Mail processes @@ -112,7 +112,7 @@ mail_gid = vmail # WARNING: Never add directories here which local users can modify, that # may lead to root exploit. Usually this should be done only if you don't # allow shell access for users. -#valid_chroot_dirs = +#valid_chroot_dirs = # Default chroot directory for mail processes. This can be overridden for # specific users in user database by giving /./ in user's home directory @@ -120,7 +120,7 @@ mail_gid = vmail # need to do chrooting, Dovecot doesn't allow users to access files outside # their mail directory anyway. If your home directories are prefixed with # the chroot directory, append "/." to mail_chroot. -#mail_chroot = +#mail_chroot = # UNIX socket path to master authentication server to find users. # This is used by imap (for shared users) and lda. @@ -237,7 +237,7 @@ mailbox_list_index = yes # fallbacks to re-reading the whole mbox file whenever something in mbox isn't # how it's expected to be. The only real downside to this setting is that if # some other MUA changes message flags, Dovecot doesn't notice it immediately. -# Note that a full sync is done with SELECT, EXAMINE, EXPUNGE and CHECK +# Note that a full sync is done with SELECT, EXAMINE, EXPUNGE and CHECK # commands. #mbox_dirty_syncs = yes diff --git a/files/10-master.conf b/files/10-master.conf index d5c907b..d7dfb7c 100644 --- a/files/10-master.conf +++ b/files/10-master.conf @@ -88,8 +88,8 @@ service auth { # permissions (e.g. 0777 allows everyone full permissions). unix_listener auth-userdb { #mode = 0666 - #user = - #group = + #user = + #group = } inet_listener { @@ -112,7 +112,7 @@ service dict { # For example: mode=0660, group=vmail and global mail_access_groups=vmail unix_listener dict { #mode = 0600 - #user = - #group = + #user = + #group = } } diff --git a/files/10-ssl.conf b/files/10-ssl.conf index e60f526..39c821d 100644 --- a/files/10-ssl.conf +++ b/files/10-ssl.conf @@ -21,7 +21,7 @@ ssl_key = :]path[;