From 6e9616dc8d9f2488fa9863d4caae84ef4c4a9f79 Mon Sep 17 00:00:00 2001 From: theonlydoo Date: Tue, 7 Oct 2014 15:09:49 +0200 Subject: [PATCH] dovecot configs --- roles/mail/templates/dovecot-mysql.conf.j2 | 5 +++ roles/mail/templates/dovecot.conf.j2 | 51 ++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 roles/mail/templates/dovecot-mysql.conf.j2 create mode 100644 roles/mail/templates/dovecot.conf.j2 diff --git a/roles/mail/templates/dovecot-mysql.conf.j2 b/roles/mail/templates/dovecot-mysql.conf.j2 new file mode 100644 index 0000000..57987a5 --- /dev/null +++ b/roles/mail/templates/dovecot-mysql.conf.j2 @@ -0,0 +1,5 @@ +driver = mysql +connect = host=127.0.0.1 dbname=postfix user=postfix password={{ dbpassword }} +default_pass_scheme = MD5-CRYPT +user_query = SELECT '/home/facteur/%d/%n' as home, 3000 AS uid, 3000 AS gid FROM mailbox WHERE username = '%u' +password_query = SELECT password FROM mailbox WHERE username = '%u' diff --git a/roles/mail/templates/dovecot.conf.j2 b/roles/mail/templates/dovecot.conf.j2 new file mode 100644 index 0000000..7b38fe8 --- /dev/null +++ b/roles/mail/templates/dovecot.conf.j2 @@ -0,0 +1,51 @@ +## Dovecot configuration file + +protocols = imap imaps pop3 pop3s managesieve +log_timestamp = "%Y-%m-%d %H:%M:%S " +mail_privileged_group = mail + +disable_plaintext_auth = no +mail_location = maildir:/home/facteur/%d/%n:INDEX=/home/facteur/%d/%n/indexes + +protocol imap { +} +protocol pop3 { +} +protocol managesieve { + listen = *:4190 + login_executable = /usr/lib/dovecot/managesieve-login + mail_executable = /usr/lib/dovecot/managesieve +} +protocol lda { + postmaster_address = admin@{{ domain }} + mail_plugin_dir = /usr/lib/dovecot/modules/lda + auth_socket_path = /var/run/dovecot/auth-master + mail_plugins = sieve quota +} +auth default { + userdb sql { + args = /etc/dovecot/dovecot-mysql.conf + } + passdb sql { + args = /etc/dovecot/dovecot-mysql.conf + } + socket listen { + master { + path = /var/run/dovecot/auth-master + mode = 0600 + user = facteur + } + client { + path = /var/spool/postfix/private/auth + mode = 0660 + user = postfix + group = postfix + } + } +} +dict { +} +plugin { + sieve_dir = /home/facteur/%d/%n/sieve + sieve = /home/facteur/%d/%n/.dovecot.sieve +}