From 2f80df9c5ad2e8de50d705a3631422dec7fff38f Mon Sep 17 00:00:00 2001 From: nd Date: Fri, 29 May 2020 11:52:48 +0200 Subject: [PATCH] added README --- README.md | 30 ++++++++++++++++++++++++++++++ defaults/main.yml | 10 ++++++++++ tasks/main.yml | 8 -------- templates/10-auth.conf.j2 | 2 +- templates/20-managesieve.conf.j2 | 3 --- templates/dovecot.conf.j2 | 4 ++-- 6 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 README.md create mode 100644 defaults/main.yml diff --git a/README.md b/README.md new file mode 100644 index 0000000..834b49a --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# dovecot + +## Parameters and defaults + +All configuration is to be placed inside the `dovecot` dict. + +``` +# Array of protocols to enable, by default 'imaps' and 'sieve' are enabled. +# Can be 'imap', 'imaps', 'pop3', 'pop3s', 'sieve' + protocols: ['imaps', 'sieve' ] + +# Array of IPs to bind on. By default we bind wildcard IPv4 and IPv6 + listen: ["*", "::"] + +# Authentication mechanisms to support, for options see https://doc.dovecot.org/configuration_manual/authentication/authentication_mechanisms/ + auth_mechanisms: ["plain", "login"] + +# Array of users if dovecot should handle users in a db. Not usable if you enable ldap. +# Each user is a dict, for options see *userdict* below + user: [] +``` + +**userdict** +``` +# username +name: "name" + +# clear text password +password: "pw" +``` diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..037015b --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,10 @@ +dovecot: + protocols: + - imaps + listen: + - "*" + - "::" + auth_mechanisms: + - plain + - login + user: [] diff --git a/tasks/main.yml b/tasks/main.yml index 4390fa5..4078e28 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -30,14 +30,6 @@ notify: - restart dovecot -- name: replace lines in config - lineinfile: - path: /etc/dovecot/conf.d/10-mail.conf - line: "mail_location = maildir:~/Maildir" - regexp: '^mail_location ' - notify: - - restart dovecot - - name: setup dovecot users template: src: passwd.j2 diff --git a/templates/10-auth.conf.j2 b/templates/10-auth.conf.j2 index 840c5bc..bdc433e 100644 --- a/templates/10-auth.conf.j2 +++ b/templates/10-auth.conf.j2 @@ -96,7 +96,7 @@ # plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp skey # gss-spnego # NOTE: See also disable_plaintext_auth setting. -auth_mechanisms = {{ dovecot.auth_mechanisms }} +auth_mechanisms = {{ dovecot.auth_mechanisms|join(' ') }} ## ## Password and user databases diff --git a/templates/20-managesieve.conf.j2 b/templates/20-managesieve.conf.j2 index c210e0c..f116941 100644 --- a/templates/20-managesieve.conf.j2 +++ b/templates/20-managesieve.conf.j2 @@ -2,9 +2,6 @@ ## ManageSieve specific settings ## -# Uncomment to enable managesieve protocol: -protocols = $protocols sieve - # Service definitions service managesieve-login { diff --git a/templates/dovecot.conf.j2 b/templates/dovecot.conf.j2 index 8b69472..e687b0c 100644 --- a/templates/dovecot.conf.j2 +++ b/templates/dovecot.conf.j2 @@ -1,13 +1,13 @@ ## Dovecot configuration file # Enable installed protocols -protocols = {{ dovecot.protocols }} +protocols = {{ dovecot.protocols|join(' ') }} # A comma separated list of IPs or hosts where to listen in for connections. # "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces. # If you want to specify non-default ports or anything more complex, # edit conf.d/master.conf. -listen = {{ dovecot.listen }} +listen = {{ dovecot.listen|join(', ') }} # Base directory where to store runtime data. #base_dir = /var/run/dovecot/