From: Ralf Jung Date: Mon, 3 Jun 2019 17:45:18 +0000 (+0200) Subject: dovecot: make maildir not the same as homedir X-Git-Url: https://git.ralfj.de/ansible.git/commitdiff_plain/bfce704c606d3278a1123bb2d3efed52bfbaabe4?hp=02ac218b8d01b532c9ea483ef38d688ff923c58c dovecot: make maildir not the same as homedir --- diff --git a/roles/email/templates/dovecot/conf.d/10-mail.conf b/roles/email/templates/dovecot/conf.d/10-mail.conf index d9f97af..db650c6 100644 --- a/roles/email/templates/dovecot/conf.d/10-mail.conf +++ b/roles/email/templates/dovecot/conf.d/10-mail.conf @@ -27,7 +27,7 @@ # # # -mail_location = maildir:/var/vmail/%u +mail_location = maildir:~/mail # If you need to set multiple mailbox locations or want to change default # namespace settings, you can do it by defining namespace sections. diff --git a/roles/email/templates/dovecot/dovecot-sql.conf.ext b/roles/email/templates/dovecot/dovecot-sql.conf.ext index 1aca7d9..bbd9378 100644 --- a/roles/email/templates/dovecot/dovecot-sql.conf.ext +++ b/roles/email/templates/dovecot/dovecot-sql.conf.ext @@ -127,7 +127,7 @@ default_pass_scheme = SSHA #user_query = \ # SELECT home, uid, gid \ # FROM users WHERE username = '%n' AND domain = '%d' -user_query = SELECT '/var/vmail/%u' as home, 'maildir:/var/vmail/%u' as mail, {{postfix.dovecot.vmail_uid}} AS uid, {{postfix.dovecot.mail_gid}} AS gid FROM users WHERE username = '%u' AND active = '1' +user_query = SELECT '/var/vmail/%u' as home, 'maildir:~/mail' as mail, {{postfix.dovecot.vmail_uid}} AS uid, {{postfix.dovecot.mail_gid}} AS gid FROM users WHERE username = '%u' AND active = '1' # If you wish to avoid two SQL lookups (passdb + userdb), you can use # userdb prefetch instead of userdb sql in dovecot.conf. In that case you'll @@ -137,7 +137,7 @@ user_query = SELECT '/var/vmail/%u' as home, 'maildir:/var/vmail/%u' as mail, {{ # SELECT userid AS user, password, \ # home AS userdb_home, uid AS userdb_uid, gid AS userdb_gid \ # FROM users WHERE userid = '%u' -password_query = SELECT username as user, password, '/var/vmail/%u' as userdb_home, 'maildir:/var/vmail/%u' as userdb_mail, {{postfix.dovecot.vmail_uid}} as userdb_uid, {{postfix.dovecot.mail_gid}} as userdb_gid \ +password_query = SELECT username as user, password, '/var/vmail/%u' as userdb_home, 'maildir:~/mail' as userdb_mail, {{postfix.dovecot.vmail_uid}} as userdb_uid, {{postfix.dovecot.mail_gid}} as userdb_gid \ FROM users WHERE username = '%u' AND active = '1' # Query to get a list of all usernames.