Major move around
This commit is contained in:
parent
90a0de099b
commit
a56a8d917e
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2014 Benno Evers
|
Copyright (c) 2015 Valentin Arkhipov
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
auth_mechanisms = plain login
|
|
||||||
|
|
||||||
passdb {
|
|
||||||
driver = passwd-file
|
|
||||||
args = /etc/dovecot/passwd
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
userdb {
|
|
||||||
driver = static
|
|
||||||
args = uid=vmail gid=vmail home=/vmail/%d/%n allow_all_users=yes
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
|||||||
service imap-login {
|
|
||||||
inet_listener imap {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#disable imaps since we use TLS connections through the standard imap
|
|
||||||
inet_listener imaps {
|
|
||||||
port = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
service imap {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
# not sure if this is needed
|
|
||||||
service lmtp {
|
|
||||||
unix_listener /var/spool/postfix/private/dovecot-lmtp {
|
|
||||||
group = vmail
|
|
||||||
mode = 0660
|
|
||||||
user = postfix
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
service auth {
|
|
||||||
unix_listener /var/spool/postfix/private/auth {
|
|
||||||
mode = 0660
|
|
||||||
user = postfix
|
|
||||||
group = vmail
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
service auth-worker {
|
|
||||||
}
|
|
@ -8,7 +8,6 @@ RUN apt-get update && apt-get install -y \
|
|||||||
ssl-cert \
|
ssl-cert \
|
||||||
postfix \
|
postfix \
|
||||||
dovecot-imapd \
|
dovecot-imapd \
|
||||||
opendkim && \
|
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
@ -19,8 +18,8 @@ RUN cat /etc/postfix/master-additional.cf >> /etc/postfix/master.cf
|
|||||||
|
|
||||||
# configure settings script
|
# configure settings script
|
||||||
VOLUME ["/mail_settings"]
|
VOLUME ["/mail_settings"]
|
||||||
COPY process_settings /process_settings
|
COPY boot /boot
|
||||||
RUN chmod 755 /process_settings
|
RUN chmod 755 /boot
|
||||||
|
|
||||||
# add user vmail who own all mail folders
|
# add user vmail who own all mail folders
|
||||||
VOLUME ["/vmail"]
|
VOLUME ["/vmail"]
|
||||||
@ -34,12 +33,9 @@ ADD ./config/dovecot.auth /etc/dovecot/conf.d/10-auth.conf
|
|||||||
ADD ./config/dovecot.master /etc/dovecot/conf.d/10-master.conf
|
ADD ./config/dovecot.master /etc/dovecot/conf.d/10-master.conf
|
||||||
ADD ./config/dovecot.lda /etc/dovecot/conf.d/15-lda.conf
|
ADD ./config/dovecot.lda /etc/dovecot/conf.d/15-lda.conf
|
||||||
ADD ./config/dovecot.imap /etc/dovecot/conf.d/20-imap.conf
|
ADD ./config/dovecot.imap /etc/dovecot/conf.d/20-imap.conf
|
||||||
# add verbose logging
|
|
||||||
|
# Uncomment to add verbose logging
|
||||||
# ADD ./config/dovecot.logging /etc/dovecot/conf.d/10-logging.conf
|
# ADD ./config/dovecot.logging /etc/dovecot/conf.d/10-logging.conf
|
||||||
|
|
||||||
EXPOSE 25 143 587
|
EXPOSE 25 143 587
|
||||||
# todo: enable port 587 for outgoing mail, separate ports 25 and 587
|
ENTRYPOINT /boot; service rsyslog start; service postfix start; dovecot -F
|
||||||
# http://www.synology-wiki.de/index.php/Zusaetzliche_Ports_fuer_Postfix
|
|
||||||
|
|
||||||
# start necessary services for operation (dovecot -F starts dovecot in the foreground to prevent container exit)
|
|
||||||
ENTRYPOINT /process_settings; service rsyslog start; service opendkim start; service postfix start; dovecot -F
|
|
@ -12,12 +12,6 @@ else
|
|||||||
cp /etc/ssl/certs/ssl-cert-snakeoil.pem /mail_settings/ssl-cert-snakeoil.pem
|
cp /etc/ssl/certs/ssl-cert-snakeoil.pem /mail_settings/ssl-cert-snakeoil.pem
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy OpenDKIM config
|
|
||||||
cp /mail_settings/opendkim.conf /etc/opendkim.conf
|
|
||||||
cp /mail_settings/mail.private /etc/dkim.key
|
|
||||||
chown opendkim:opendkim /etc/dkim.key
|
|
||||||
chmod 600 /etc/dkim.key
|
|
||||||
|
|
||||||
if [ -f /mail_settings/myhostname ]; then
|
if [ -f /mail_settings/myhostname ]; then
|
||||||
sed -i -e "s/myhostname = localhost/myhostname = $(sed 's:/:\\/:g' /mail_settings/myhostname)/" /etc/postfix/main.cf
|
sed -i -e "s/myhostname = localhost/myhostname = $(sed 's:/:\\/:g' /mail_settings/myhostname)/" /etc/postfix/main.cf
|
||||||
echo $(sed 's:/:\\/:g' /mail_settings/myhostname) > /etc/mailname
|
echo $(sed 's:/:\\/:g' /mail_settings/myhostname) > /etc/mailname
|
||||||
@ -27,13 +21,13 @@ fi
|
|||||||
cp /mail_settings/aliases /etc/postfix/virtual
|
cp /mail_settings/aliases /etc/postfix/virtual
|
||||||
cp /mail_settings/domains /etc/postfix/virtual-mailbox-domains
|
cp /mail_settings/domains /etc/postfix/virtual-mailbox-domains
|
||||||
|
|
||||||
# todo: this could probably be done in one line
|
# parse mailbox settings
|
||||||
mkdir /etc/postfix/tmp
|
mkdir /etc/postfix/tmp
|
||||||
awk < /etc/postfix/virtual '{ print $2 }' > /etc/postfix/tmp/virtual-receivers
|
awk < /etc/postfix/virtual '{ print $2 }' > /etc/postfix/tmp/virtual-receivers
|
||||||
sed -r 's,(.+)@(.+),\2/\1/,' /etc/postfix/tmp/virtual-receivers > /etc/postfix/tmp/virtual-receiver-folders
|
sed -r 's,(.+)@(.+),\2/\1/,' /etc/postfix/tmp/virtual-receivers > /etc/postfix/tmp/virtual-receiver-folders
|
||||||
paste /etc/postfix/tmp/virtual-receivers /etc/postfix/tmp/virtual-receiver-folders > /etc/postfix/virtual-mailbox-maps
|
paste /etc/postfix/tmp/virtual-receivers /etc/postfix/tmp/virtual-receiver-folders > /etc/postfix/virtual-mailbox-maps
|
||||||
|
|
||||||
# give postfix the ownership of his files
|
# give postfix ownership of its files
|
||||||
chown -R postfix:postfix /etc/postfix
|
chown -R postfix:postfix /etc/postfix
|
||||||
|
|
||||||
# map virtual aliases and user/filesystem mappings
|
# map virtual aliases and user/filesystem mappings
|
11
email_core/config/dovecot.auth
Normal file
11
email_core/config/dovecot.auth
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
auth_mechanisms = plain login
|
||||||
|
|
||||||
|
passdb {
|
||||||
|
driver = passwd-file
|
||||||
|
args = /etc/dovecot/passwd
|
||||||
|
}
|
||||||
|
|
||||||
|
userdb {
|
||||||
|
driver = static
|
||||||
|
args = uid=vmail gid=vmail home=/vmail/%d/%n allow_all_users=yes
|
||||||
|
}
|
33
email_core/config/dovecot.master
Normal file
33
email_core/config/dovecot.master
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
service imap-login {
|
||||||
|
inet_listener imap {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#disable imaps since we use TLS connections through the standard imap
|
||||||
|
inet_listener imaps {
|
||||||
|
port = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
service imap {
|
||||||
|
}
|
||||||
|
|
||||||
|
# not sure if this is needed
|
||||||
|
service lmtp {
|
||||||
|
unix_listener /var/spool/postfix/private/dovecot-lmtp {
|
||||||
|
group = vmail
|
||||||
|
mode = 0660
|
||||||
|
user = postfix
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
service auth {
|
||||||
|
unix_listener /var/spool/postfix/private/auth {
|
||||||
|
mode = 0660
|
||||||
|
user = postfix
|
||||||
|
group = vmail
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
service auth-worker {
|
||||||
|
}
|
@ -1,12 +1,11 @@
|
|||||||
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
|
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
|
||||||
|
|
||||||
|
|
||||||
# Debian specific: Specifying a file name will cause the first
|
# Debian specific: Specifying a file name will cause the first
|
||||||
# line of that file to be used as the name. The Debian default
|
# line of that file to be used as the name. The Debian default
|
||||||
# is /etc/mailname.
|
# is /etc/mailname.
|
||||||
#myorigin = /etc/mailname
|
#myorigin = /etc/mailname
|
||||||
|
|
||||||
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
|
smtpd_banner = $myhostname ESMTP $mail_name
|
||||||
biff = no
|
biff = no
|
||||||
|
|
||||||
# appending .domain is the MUA's job.
|
# appending .domain is the MUA's job.
|
||||||
@ -27,7 +26,6 @@ smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
|
|||||||
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
|
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
|
||||||
# information on enabling SSL in the smtp client.
|
# information on enabling SSL in the smtp client.
|
||||||
|
|
||||||
|
|
||||||
myhostname = localhost
|
myhostname = localhost
|
||||||
alias_maps = hash:/etc/aliases
|
alias_maps = hash:/etc/aliases
|
||||||
alias_database = hash:/etc/aliases
|
alias_database = hash:/etc/aliases
|
18
opendkim/Dockerfile
Normal file
18
opendkim/Dockerfile
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
FROM ubuntu:14.10
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
RUN locale-gen en_GB en_GB.UTF-8 && dpkg-reconfigure locales
|
||||||
|
|
||||||
|
# Prerequisites
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
opendkim && \
|
||||||
|
apt-get clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
|
# configure settings script
|
||||||
|
VOLUME ["/mail_settings"]
|
||||||
|
COPY boot /boot
|
||||||
|
RUN chmod 755 /boot
|
||||||
|
|
||||||
|
# start necessary services for operation (dovecot -F starts dovecot in the foreground to prevent container exit)
|
||||||
|
ENTRYPOINT /boot; service rsyslog start; opendkim -f
|
5
opendkim/boot
Normal file
5
opendkim/boot
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Copy OpenDKIM config
|
||||||
|
cp /mail_settings/opendkim.conf /etc/opendkim.conf
|
||||||
|
cp /mail_settings/mail.private /etc/dkim.key
|
||||||
|
chown opendkim:opendkim /etc/dkim.key
|
||||||
|
chmod 600 /etc/dkim.key
|
Loading…
Reference in New Issue
Block a user