Upgrade to 16.04 (#571)

* Upgrade to ubuntu:16.04
This commit is contained in:
Thomas A. Kilian 2017-04-27 17:59:28 +02:00 committed by Thomas VIAL
parent 50ac2bdc07
commit 95d3375010
4 changed files with 15 additions and 37 deletions

View file

@ -1,4 +1,4 @@
FROM ubuntu:14.04 FROM ubuntu:16.04
MAINTAINER Thomas VIAL MAINTAINER Thomas VIAL
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND noninteractive
@ -6,12 +6,16 @@ ENV VIRUSMAILS_DELETE_DELAY=7
ENV ONE_DIR=0 ENV ONE_DIR=0
# Packages # Packages
RUN apt-get update -q --fix-missing && \
apt-get -y upgrade && \
apt-get -y install postfix
RUN apt-get update -q --fix-missing && \ RUN apt-get update -q --fix-missing && \
apt-get -y upgrade && \ apt-get -y upgrade && \
apt-get -y install --no-install-recommends \ apt-get -y install --no-install-recommends \
amavisd-new \ amavisd-new \
arj \ arj \
bzip2 \ bzip2 \
ca-certificates \
clamav \ clamav \
clamav-daemon \ clamav-daemon \
curl \ curl \
@ -29,14 +33,15 @@ RUN apt-get update -q --fix-missing && \
gamin \ gamin \
gzip \ gzip \
iptables \ iptables \
locales \
libmail-spf-perl \ libmail-spf-perl \
libnet-dns-perl \ libnet-dns-perl \
libsasl2-modules \ libsasl2-modules \
netcat-openbsd \
opendkim \ opendkim \
opendkim-tools \ opendkim-tools \
opendmarc \ opendmarc \
p7zip \ p7zip \
postfix \
postfix-ldap \ postfix-ldap \
postfix-policyd-spf-python \ postfix-policyd-spf-python \
pyzor \ pyzor \
@ -47,8 +52,6 @@ RUN apt-get update -q --fix-missing && \
postgrey \ postgrey \
unzip \ unzip \
&& \ && \
curl -sk http://neuro.debian.net/lists/trusty.de-m.libre > /etc/apt/sources.list.d/neurodebian.sources.list && \
apt-key adv --recv-keys --keyserver hkp://pgp.mit.edu:80 0xA5D32F012649A5A9 && \
curl https://packages.elasticsearch.org/GPG-KEY-elasticsearch | apt-key add - && \ curl https://packages.elasticsearch.org/GPG-KEY-elasticsearch | apt-key add - && \
echo "deb http://packages.elastic.co/beats/apt stable main" | tee -a /etc/apt/sources.list.d/beats.list && \ echo "deb http://packages.elastic.co/beats/apt stable main" | tee -a /etc/apt/sources.list.d/beats.list && \
apt-get update -q --fix-missing && apt-get -y upgrade fail2ban filebeat && \ apt-get update -q --fix-missing && apt-get -y upgrade fail2ban filebeat && \
@ -69,6 +72,7 @@ RUN sed -i -e 's/^.*postmaster_address.*/postmaster_address = '${POSTMASTER_ADDR
RUN sed -i 's/#imap_idle_notify_interval = 2 mins/imap_idle_notify_interval = 29 mins/' /etc/dovecot/conf.d/20-imap.conf RUN sed -i 's/#imap_idle_notify_interval = 2 mins/imap_idle_notify_interval = 29 mins/' /etc/dovecot/conf.d/20-imap.conf
COPY target/dovecot/auth-passwdfile.inc /etc/dovecot/conf.d/ COPY target/dovecot/auth-passwdfile.inc /etc/dovecot/conf.d/
COPY target/dovecot/??-*.conf /etc/dovecot/conf.d/ COPY target/dovecot/??-*.conf /etc/dovecot/conf.d/
RUN cd /usr/share/dovecot && ./mkcert.sh
# Configures LDAP # Configures LDAP
COPY target/dovecot/dovecot-ldap.conf.ext /etc/dovecot COPY target/dovecot/dovecot-ldap.conf.ext /etc/dovecot

View file

@ -56,7 +56,7 @@ run:
-v "`pwd`/test":/tmp/docker-mailserver-test \ -v "`pwd`/test":/tmp/docker-mailserver-test \
-e PERMIT_DOCKER=network \ -e PERMIT_DOCKER=network \
-e OVERRIDE_HOSTNAME=mail.my-domain.com \ -e OVERRIDE_HOSTNAME=mail.my-domain.com \
-h unknown.domain.tld \ -h mail.my-domain.com \
-t $(NAME) -t $(NAME)
sleep 15 sleep 15
docker run -d --name mail_fail2ban \ docker run -d --name mail_fail2ban \

View file

@ -224,7 +224,6 @@ action = %(action_)s
port = ssh port = ssh
logpath = %(sshd_log)s logpath = %(sshd_log)s
backend = %(sshd_backend)s
[sshd-ddos] [sshd-ddos]
@ -233,14 +232,12 @@ backend = %(sshd_backend)s
# in the body. # in the body.
port = ssh port = ssh
logpath = %(sshd_log)s logpath = %(sshd_log)s
backend = %(sshd_backend)s
[dropbear] [dropbear]
port = ssh port = ssh
logpath = %(dropbear_log)s logpath = %(dropbear_log)s
backend = %(dropbear_backend)s
[selinux-ssh] [selinux-ssh]
@ -419,7 +416,6 @@ port = http,https
port = http,https port = http,https
logpath = %(syslog_daemon)s logpath = %(syslog_daemon)s
backend = %(syslog_backend)s
[guacamole] [guacamole]
@ -436,14 +432,12 @@ logpath = /var/log/monit
port = 10000 port = 10000
logpath = %(syslog_authpriv)s logpath = %(syslog_authpriv)s
backend = %(syslog_backend)s
[froxlor-auth] [froxlor-auth]
port = http,https port = http,https
logpath = %(syslog_authpriv)s logpath = %(syslog_authpriv)s
backend = %(syslog_backend)s
# #
@ -472,28 +466,24 @@ logpath = /var/log/3proxy.log
port = ftp,ftp-data,ftps,ftps-data port = ftp,ftp-data,ftps,ftps-data
logpath = %(proftpd_log)s logpath = %(proftpd_log)s
backend = %(proftpd_backend)s
[pure-ftpd] [pure-ftpd]
port = ftp,ftp-data,ftps,ftps-data port = ftp,ftp-data,ftps,ftps-data
logpath = %(pureftpd_log)s logpath = %(pureftpd_log)s
backend = %(pureftpd_backend)s
[gssftpd] [gssftpd]
port = ftp,ftp-data,ftps,ftps-data port = ftp,ftp-data,ftps,ftps-data
logpath = %(syslog_daemon)s logpath = %(syslog_daemon)s
backend = %(syslog_backend)s
[wuftpd] [wuftpd]
port = ftp,ftp-data,ftps,ftps-data port = ftp,ftp-data,ftps,ftps-data
logpath = %(wuftpd_log)s logpath = %(wuftpd_log)s
backend = %(wuftpd_backend)s
[vsftpd] [vsftpd]
@ -520,14 +510,12 @@ logpath = /root/path/to/assp/logs/maillog.txt
port = smtp,465,submission port = smtp,465,submission
logpath = %(syslog_mail)s logpath = %(syslog_mail)s
backend = %(syslog_backend)s
[postfix] [postfix]
port = smtp,465,submission port = smtp,465,submission
logpath = /var/log/mail/mail.log logpath = /var/log/mail/mail.log
backend = %(postfix_backend)s
enabled = true enabled = true
@ -535,7 +523,6 @@ enabled = true
port = smtp,465,submission port = smtp,465,submission
logpath = %(postfix_log)s logpath = %(postfix_log)s
backend = %(postfix_backend)s
maxretry = 1 maxretry = 1
@ -543,14 +530,12 @@ maxretry = 1
port = submission,465,smtp port = submission,465,smtp
logpath = %(syslog_mail)s logpath = %(syslog_mail)s
backend = %(syslog_backend)s
[sendmail-reject] [sendmail-reject]
port = smtp,465,submission port = smtp,465,submission
logpath = %(syslog_mail)s logpath = %(syslog_mail)s
backend = %(syslog_backend)s
[qmail-rbl] [qmail-rbl]
@ -566,7 +551,6 @@ logpath = /service/qmail/log/main/current
port = pop3,pop3s,imap,imaps,submission,465,sieve port = pop3,pop3s,imap,imaps,submission,465,sieve
logpath = /var/log/mail/mail.log logpath = /var/log/mail/mail.log
backend = %(dovecot_backend)s
enabled = true enabled = true
@ -574,7 +558,6 @@ enabled = true
port = smtp,465,submission port = smtp,465,submission
logpath = %(dovecot_log)s logpath = %(dovecot_log)s
backend = %(dovecot_backend)s
[solid-pop3d] [solid-pop3d]
@ -610,7 +593,6 @@ logpath = /opt/kerio/mailserver/store/logs/security.log
port = smtp,465,submission,imap3,imaps,pop3,pop3s port = smtp,465,submission,imap3,imaps,pop3,pop3s
logpath = %(syslog_mail)s logpath = %(syslog_mail)s
backend = %(syslog_backend)s
[postfix-sasl] [postfix-sasl]
@ -620,7 +602,6 @@ port = smtp,465,submission,imap3,imaps,pop3,pop3s
# running postfix since it would provide the same log lines at the # running postfix since it would provide the same log lines at the
# "warn" level but overall at the smaller filesize. # "warn" level but overall at the smaller filesize.
logpath = /var/log/mail/mail.log logpath = /var/log/mail/mail.log
backend = %(postfix_backend)s
enabled = true enabled = true
@ -628,7 +609,6 @@ enabled = true
port = imap3,imaps,pop3,pop3s port = imap3,imaps,pop3,pop3s
logpath = %(syslog_mail)s logpath = %(syslog_mail)s
backend = %(syslog_backend)s
[squirrelmail] [squirrelmail]
@ -641,14 +621,12 @@ logpath = /var/lib/squirrelmail/prefs/squirrelmail_access_log
port = imap3,imaps port = imap3,imaps
logpath = %(syslog_mail)s logpath = %(syslog_mail)s
backend = %(syslog_backend)s
[uwimap-auth] [uwimap-auth]
port = imap3,imaps port = imap3,imaps
logpath = %(syslog_mail)s logpath = %(syslog_mail)s
backend = %(syslog_backend)s
# #
@ -730,7 +708,6 @@ maxretry = 10
port = 3306 port = 3306
logpath = %(mysql_log)s logpath = %(mysql_log)s
backend = %(mysql_backend)s
# Jail for more extended banning of persistent abusers # Jail for more extended banning of persistent abusers
@ -755,14 +732,12 @@ findtime = 86400 ; 1 day
# pam-generic filter can be customized to monitor specific subset of 'tty's # pam-generic filter can be customized to monitor specific subset of 'tty's
banaction = %(banaction_allports)s banaction = %(banaction_allports)s
logpath = %(syslog_authpriv)s logpath = %(syslog_authpriv)s
backend = %(syslog_backend)s
[xinetd-fail] [xinetd-fail]
banaction = iptables-multiport-log banaction = iptables-multiport-log
logpath = %(syslog_daemon)s logpath = %(syslog_daemon)s
backend = %(syslog_backend)s
maxretry = 2 maxretry = 2
@ -792,7 +767,6 @@ action = %(banaction)s[name=%(__name__)s-tcp, port="%(tcpport)s", protocol="tcp
[nagios] [nagios]
logpath = %(syslog_daemon)s ; nrpe.cfg may define a different log_facility logpath = %(syslog_daemon)s ; nrpe.cfg may define a different log_facility
backend = %(syslog_backend)s
maxretry = 1 maxretry = 1

View file

@ -15,7 +15,7 @@ load 'test_helper/bats-assert/load'
} }
@test "checking configuration: hostname/domainname override: check container hostname is applied correctly" { @test "checking configuration: hostname/domainname override: check container hostname is applied correctly" {
run docker exec mail_override_hostname /bin/bash -c "hostname | grep unknown.domain.tld" run docker exec mail_override_hostname /bin/bash -c "hostname | grep mail.my-domain.com"
assert_success assert_success
} }
@ -57,7 +57,7 @@ load 'test_helper/bats-assert/load'
# #
@test "checking process: postfix" { @test "checking process: postfix" {
run docker exec mail /bin/bash -c "ps aux --forest | grep -v grep | grep '/usr/lib/postfix/master'" run docker exec mail /bin/bash -c "ps aux --forest | grep -v grep | grep '/usr/lib/postfix/sbin/master'"
assert_success assert_success
} }
@ -82,12 +82,12 @@ load 'test_helper/bats-assert/load'
} }
@test "checking process: fail2ban (disabled in default configuration)" { @test "checking process: fail2ban (disabled in default configuration)" {
run docker exec mail /bin/bash -c "ps aux --forest | grep -v grep | grep '/usr/bin/python /usr/bin/fail2ban-server'" run docker exec mail /bin/bash -c "ps aux --forest | grep -v grep | grep '/usr/bin/python3 /usr/bin/fail2ban-server'"
assert_failure assert_failure
} }
@test "checking process: fail2ban (fail2ban server enabled)" { @test "checking process: fail2ban (fail2ban server enabled)" {
run docker exec mail_fail2ban /bin/bash -c "ps aux --forest | grep -v grep | grep '/usr/bin/python /usr/bin/fail2ban-server'" run docker exec mail_fail2ban /bin/bash -c "ps aux --forest | grep -v grep | grep '/usr/bin/python3 /usr/bin/fail2ban-server'"
assert_success assert_success
} }
@ -121,7 +121,7 @@ load 'test_helper/bats-assert/load'
# #
@test "checking process: postgrey (disabled in default configuration)" { @test "checking process: postgrey (disabled in default configuration)" {
run docker exec mail /bin/bash -c "ps aux --forest | grep -v grep | grep '/usr/sbin/postgrey'" run docker exec mail /bin/bash -c "ps aux --forest | grep -v grep | grep 'postgrey'"
assert_failure assert_failure
} }
@ -141,7 +141,7 @@ load 'test_helper/bats-assert/load'
} }
@test "checking process: postgrey (postgrey server enabled)" { @test "checking process: postgrey (postgrey server enabled)" {
run docker exec mail_with_postgrey /bin/bash -c "ps aux --forest | grep -v grep | grep '/usr/sbin/postgrey'" run docker exec mail_with_postgrey /bin/bash -c "ps aux --forest | grep -v grep | grep 'postgrey'"
assert_success assert_success
} }