From af760295bdad8bc486328f19057d4581d29c5aee Mon Sep 17 00:00:00 2001 From: Steffen Sachse Date: Tue, 11 Jul 2017 22:15:32 +0200 Subject: [PATCH] Change Email-Folder to /var/mail/%d/%u/mails This solves the issue that when running managesieve, the .sieve-folder shows up as subscribable for IMAP clients but will produce an error when selecting. Mainly to remove clutter and to follow dovecot recommendations on not setting the same directory for user home and user mail. --- target/dovecot/10-mail.conf | 2 +- target/start-mailserver.sh | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/target/dovecot/10-mail.conf b/target/dovecot/10-mail.conf index da0a13e9..43be3a5c 100644 --- a/target/dovecot/10-mail.conf +++ b/target/dovecot/10-mail.conf @@ -27,7 +27,7 @@ # # # -mail_location = maildir:/var/mail/%d/%n +mail_location = maildir:/var/mail/%d/%n/mails # 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/target/start-mailserver.sh b/target/start-mailserver.sh index 94bddb6c..f9e688db 100644 --- a/target/start-mailserver.sh +++ b/target/start-mailserver.sh @@ -534,15 +534,16 @@ function _setup_dovecot_local_user() { # user:password:uid:gid:(gecos):home:(shell):extra_fields # Example : # ${login}:${pass}:5000:5000::/var/mail/${domain}/${user}::userdb_mail=maildir:/var/mail/${domain}/${user} - echo "${login}:${pass}:5000:5000::/var/mail/${domain}/${user}::" >> /etc/dovecot/userdb + echo "${login}:${pass}:5000:5000::/var/mail/${domain}/${user}::userdb_mail=maildir:/var/mail/${domain}/${user}/mails" >> /etc/dovecot/userdb mkdir -p /var/mail/${domain} if [ ! -d "/var/mail/${domain}/${user}" ]; then - maildirmake.dovecot "/var/mail/${domain}/${user}" - maildirmake.dovecot "/var/mail/${domain}/${user}/.Sent" - maildirmake.dovecot "/var/mail/${domain}/${user}/.Trash" - maildirmake.dovecot "/var/mail/${domain}/${user}/.Drafts" - echo -e "INBOX\nSent\nTrash\nDrafts" >> "/var/mail/${domain}/${user}/subscriptions" - touch "/var/mail/${domain}/${user}/.Sent/maildirfolder" + mkdir -p /var/mail/${domain}/${user} + maildirmake.dovecot "/var/mail/${domain}/${user}/mails" + maildirmake.dovecot "/var/mail/${domain}/${user}/mails/.Sent" + maildirmake.dovecot "/var/mail/${domain}/${user}/mails/.Trash" + maildirmake.dovecot "/var/mail/${domain}/${user}/mails/.Drafts" + echo -e "INBOX\nSent\nTrash\nDrafts" >> "/var/mail/${domain}/${user}/mails/subscriptions" + touch "/var/mail/${domain}/${user}/mails/.Sent/maildirfolder" fi # Copy user provided sieve file, if present test -e /tmp/docker-mailserver/${login}.dovecot.sieve && cp /tmp/docker-mailserver/${login}.dovecot.sieve /var/mail/${domain}/${user}/.dovecot.sieve