diff --git a/Dockerfile b/Dockerfile index c33877aa..411ff4a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,7 +69,10 @@ RUN apt-get update -q --fix-missing && \ RUN echo "0 0,6,12,18 * * * /usr/bin/freshclam --quiet" > /etc/cron.d/freshclam && \ chmod 644 /etc/clamav/freshclam.conf && \ - freshclam + freshclam && \ + sed -i 's/Foreground false/Foreground true/g' /etc/clamav/clamd.conf && \ + mkdir /var/run/clamav && \ + chown -R clamav:root /var/run/clamav # Configures Dovecot COPY target/dovecot/auth-passwdfile.inc target/dovecot/??-*.conf /etc/dovecot/conf.d/ @@ -111,7 +114,7 @@ RUN sed -i -r 's/#(@| \\%)bypass/\1bypass/g' /etc/amavis/conf.d/15-content_fil # Configure Fail2ban COPY target/fail2ban/jail.conf /etc/fail2ban/jail.conf COPY target/fail2ban/filter.d/dovecot.conf /etc/fail2ban/filter.d/dovecot.conf -RUN echo "ignoreregex =" >> /etc/fail2ban/filter.d/postfix-sasl.conf +RUN echo "ignoreregex =" >> /etc/fail2ban/filter.d/postfix-sasl.conf && mkdir /var/run/fail2ban # Enables Pyzor and Razor USER amavis @@ -168,7 +171,7 @@ RUN chmod +x /usr/local/bin/* EXPOSE 25 587 143 993 110 995 4190 -CMD /usr/local/bin/start-mailserver.sh +CMD /usr/local/bin/start-mailserver.sh > /var/log/container-startup.log ADD target/filebeat.yml.tmpl /etc/filebeat/filebeat.yml.tmpl diff --git a/target/start-mailserver.sh b/target/start-mailserver.sh index 4292eab0..2e29d4d8 100644 --- a/target/start-mailserver.sh +++ b/target/start-mailserver.sh @@ -1249,7 +1249,7 @@ notify 'taskgrp' "#" notify 'taskgrp' "#" notify 'taskgrp' "" -supervisord -c /etc/supervisor/conf.d/supervisor-app.conf +supervisord -c /etc/supervisor/supervisord.conf register_functions @@ -1265,7 +1265,7 @@ notify 'taskgrp' "# $HOSTNAME is up and running" notify 'taskgrp' "#" notify 'taskgrp' "" - +touch /var/log/mail/mail.log tail -fn 0 /var/log/mail/mail.log diff --git a/target/supervisor/supervisor-app.conf b/target/supervisor/supervisor-app.conf index 6a99635f..c7311b3d 100644 --- a/target/supervisor/supervisor-app.conf +++ b/target/supervisor/supervisor-app.conf @@ -10,14 +10,6 @@ autostart=false autorestart=true command = /usr/sbin/rsyslogd -n - -# Couldn't figure out how to run this in the foreground. We'll start it without supervisor. -#[program:saslauthd] -#startsecs=0 -#autostart=false -#autorestart=true -#command = /etc/init.d/saslauthd start - [program:fail2ban] startsecs=0 autostart=false @@ -36,13 +28,6 @@ autostart=false autorestart=true command = /usr/sbin/opendmarc -f -p local:/var/run/opendmarc/opendmarc.sock -# Couldn't figure out how to run this in the foreground. We'll start it without supervisor. -#[program:postfix] -#startsecs=0 -#autostart=false -#autorestart=true -#command = /etc/init.d/postfix start - [program:dovecot] startsecs=0 autostart=false @@ -55,13 +40,6 @@ autostart=false autorestart=true command = /usr/bin/filebeat -c /etc/filebeat/filebeat.yml -# Couldn't figure out how to run this in the foreground. We'll start it without supervisor. -#[program:fetchmail] -#startsecs=0 -#autostart=false -#autorestart=true -#command = /usr/bin/fetchmail - [program:clamav] startsecs=0 autostart=false @@ -79,3 +57,23 @@ startsecs=0 autostart=false autorestart=true command = /usr/sbin/amavisd-new foreground + + +# Couldn't figure out how to run these in the foreground. We'll start them without supervisor. +#[program:fetchmail] +#startsecs=0 +#autostart=false +#autorestart=true +#command = /usr/bin/fetchmail + +#[program:postfix] +#startsecs=0 +#autostart=false +#autorestart=true +#command = /etc/init.d/postfix start + +#[program:saslauthd] +#startsecs=0 +#autostart=false +#autorestart=true +#command = /etc/init.d/saslauthd start