From 922a8db7a5c6e9e28d23a67a8b31f92271d6aa5a Mon Sep 17 00:00:00 2001 From: andryyy Date: Sat, 18 May 2019 23:01:05 +0200 Subject: [PATCH] [Dovecot] Auto-generate shared namespace --- data/Dockerfiles/dovecot/docker-entrypoint.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/data/Dockerfiles/dovecot/docker-entrypoint.sh b/data/Dockerfiles/dovecot/docker-entrypoint.sh index 7034fc08..0c44c41a 100755 --- a/data/Dockerfiles/dovecot/docker-entrypoint.sh +++ b/data/Dockerfiles/dovecot/docker-entrypoint.sh @@ -139,6 +139,23 @@ echo ${RAND_USER}@mailcow.local:{SHA1}$(echo -n ${RAND_PASS} | sha1sum | awk '{p echo ${RAND_USER}@mailcow.local::5000:5000:::: > /usr/local/etc/dovecot/dovecot-master.userdb echo ${RAND_USER}@mailcow.local:${RAND_PASS} > /etc/sogo/sieve.creds +if [[ -z ${MAILDIR_SUB} ]]; then + MAILDIR_SUB_SHARED= +else + MAILDIR_SUB_SHARED=/${MAILDIR_SUB} +fi +cat < /usr/local/etc/dovecot/shared_namespace.conf +# Auto-generated file +namespace { + type = shared + separator = / + prefix = Shared/%%u/ + location = maildir:%%h${MAILDIR_SUB_SHARED}:INDEX=~${MAILDIR_SUB_SHARED}/Shared/%%u;CONTROL=~${MAILDIR_SUB_SHARED}/Shared/%%u + subscriptions = no + list = children +} +EOF + if [[ "${ALLOW_ADMIN_EMAIL_LOGIN}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then # Create random master Password for SOGo 'login as user' via proxy auth RAND_PASS=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1)