diff --git a/src/mailsrv/Containerfile b/src/mailsrv/Containerfile index 7a97424..8e74fb7 100644 --- a/src/mailsrv/Containerfile +++ b/src/mailsrv/Containerfile @@ -10,9 +10,9 @@ LABEL deployopts="\ -p 587:587 \ -p 143:143 \ -p 993:993 \ --v /srv/volumes/mailsrv/db:/vol/db \ --v /srv/volumes/mailsrv/mail:/vol/mail \ --v /srv/volumes/mailsrv/ssl:/vol/ssl:ro" +-v /srv/vol/mailsrv/etc:/vol/etc \ +-v /srv/vol/mailsrv/mail:/vol/mail \ +-v /srv/vol/mailsrv/ssl:/vol/ssl:ro" # Build Variables # uid that the files owner user should have @@ -66,8 +66,8 @@ RUN ln -s /vol/mail /var/mail/virtual ### Working Directory ### -# make sure /vol/db exists -RUN mkdir -p /vol/db +# make sure /vol/etc exists +RUN mkdir -p /vol/etc -# set /vol/db as working directory -WORKDIR /vol/db \ No newline at end of file +# set /vol/etc as working directory +WORKDIR /vol/etc diff --git a/src/mailsrv/assets/bin/mkvirt b/src/mailsrv/assets/bin/mkvirt index 975ec5d..4c07ae0 100755 --- a/src/mailsrv/assets/bin/mkvirt +++ b/src/mailsrv/assets/bin/mkvirt @@ -6,16 +6,27 @@ set -e ### Users ### # copy users db to dovecot config -cp /vol/db/users /etc/dovecot/users +cp /vol/etc/users /etc/dovecot/users chown dovecot:dovecot /etc/dovecot/users # copy users db to postfix config, but without passwords -cat /vol/db/users | cut -d':' -f1 | perl -pe 's/(.*)/\1 ./' > /etc/postfix/users +cat /vol/etc/users | cut -d':' -f1 | perl -pe 's/(.*)/\1 ./' > /etc/postfix/users postmap /etc/postfix/users ### Aliases ### # copy aliases to postifx config cd /etc/postfix -cat /vol/db/aliases.d/*.list > aliases +cat /vol/etc/aliases.d/*.list > aliases postmap aliases + +### Sieve ### + +# copy users sieve to mail +cd /vol/etc/sieve.d +for user in * ; do + mkdir -p /vol/mail/${user} + chown vmail:vmail /vol/mail/${user} + chown vmail:vmail ${user} + cp -p ${user} /vol/mail/${user}/.dovecot.sieve +done diff --git a/src/mailsrv/assets/dovecot/conf.d/10-mail.conf b/src/mailsrv/assets/dovecot/conf.d/10-mail.conf index 98a397e..4df36e8 100644 --- a/src/mailsrv/assets/dovecot/conf.d/10-mail.conf +++ b/src/mailsrv/assets/dovecot/conf.d/10-mail.conf @@ -27,7 +27,7 @@ # # # -mail_location = maildir:~/Maildir:LAYOUT=fs +mail_location = maildir:~/Maildir # If you need to set multiple mailbox locations or want to change default # namespace settings, you can do it by defining namespace sections. @@ -46,7 +46,7 @@ namespace inbox { # Hierarchy separator to use. You should use the same separator for all # namespaces or some clients get confused. '/' is usually a good one. # The default however depends on the underlying mail storage format. - separator = / + separator = . # Prefix required to access this namespace. This needs to be different for # all namespaces. For example "Public/". diff --git a/src/mailsrv/assets/postfix/main.cf b/src/mailsrv/assets/postfix/main.cf index 40cd54b..7852c86 100644 --- a/src/mailsrv/assets/postfix/main.cf +++ b/src/mailsrv/assets/postfix/main.cf @@ -22,7 +22,7 @@ myorigin = $mydomain # domains to consider primary (local) endpoints mydestination = $myhostname, $mydomain, localhost.localdomain, localhost # domains to consider secondary (virtual) endpoints -virtual_alias_domains = epic.alemor.org, mail.alemor.org, home.alemor.org, alegre.alemor.org, daniel.alemor.org, fernando.alemor.org, juana.alemor.org, mario.alemor.org, moreno.alemor.org, mbox.alemor.org, pirealps.org +virtual_alias_domains = epic.alemor.org, home.alemor.org, alegre.alemor.org, daniel.alemor.org, fernando.alemor.org, juana.alemor.org, mario.alemor.org, moreno.alemor.org ### Users ### # get list of valid users from here instead of /etc/passwd