Browse Source

Merge branch 'master' of ssh://medusa.casa.alemor.org:4323/mar/container

feature/startup-from-labels
Mario Alegre 5 years ago
parent
commit
019d57ddd4
  1. 14
      src/mailsrv/Containerfile
  2. 17
      src/mailsrv/assets/bin/mkvirt
  3. 4
      src/mailsrv/assets/dovecot/conf.d/10-mail.conf
  4. 2
      src/mailsrv/assets/postfix/main.cf

14
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
# set /vol/etc as working directory
WORKDIR /vol/etc

17
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

4
src/mailsrv/assets/dovecot/conf.d/10-mail.conf

@ -27,7 +27,7 @@
#
# <doc/wiki/MailLocation.txt>
#
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/".

2
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

Loading…
Cancel
Save