diff --git a/amavis/Dockerfile b/amavis/Dockerfile index c8f43dc..a2cce83 100644 --- a/amavis/Dockerfile +++ b/amavis/Dockerfile @@ -31,19 +31,5 @@ RUN chmod 755 /boot ENV AMAVIS=true -# Redirect logs for Docker to pickup -RUN ln -sf /dev/stdout /var/log/razor-agent.log && \ - ln -sf /dev/stdout /var/log/mail.log && \ - ln -sf /dev/stdout /var/log/mail.info && \ - ln -sf /dev/stdout /var/log/mail.warn && \ - ln -sf /dev/stderr /var/log/mail.err -# Make logs writable for everyone -RUN chmod 002 /var/log/razor-agent.log \ - /var/log/mail.log \ - /var/log/mail.info \ - /var/log/mail.warn \ - /var/log/mail.err - EXPOSE 10024 - ENTRYPOINT ./boot; amavisd-new foreground diff --git a/amavis/boot b/amavis/boot index 9170403..41010b1 100644 --- a/amavis/boot +++ b/amavis/boot @@ -14,3 +14,10 @@ sed "/# DOCKERMAIL DOMAINS START/,/# DOCKERMAIL DOMAINS END/{//!d}" /etc/amavis/ sed "/# DOCKERMAIL DOMAINS START/,/# DOCKERMAIL DOMAINS END/{//!d}" /etc/amavis/conf.d/50-user -i sed "/# DOCKERMAIL DOMAINS START/a $first_fqdn" /etc/amavis/conf.d/05-node_id -i sed "/# DOCKERMAIL DOMAINS START/a $domain_acl" /etc/amavis/conf.d/50-user -i + + +ln -sf /dev/stdout /var/log/razor-agent.log +ln -sf /dev/stdout /var/log/mail.log +ln -sf /dev/stdout /var/log/mail.info +ln -sf /dev/stdout /var/log/mail.warn +ln -sf /dev/stderr /var/log/mail.err diff --git a/email_core/Dockerfile b/email_core/Dockerfile index 7f7cc34..42aa742 100644 --- a/email_core/Dockerfile +++ b/email_core/Dockerfile @@ -43,16 +43,5 @@ VOLUME ["/vmail"] RUN groupadd -g 5000 vmail RUN useradd -g vmail -u 5000 vmail -d /vmail -m -# Redirect logs for Docker to pickup -RUN ln -sf /dev/stdout /var/log/mail.log && \ - ln -sf /dev/stdout /var/log/mail.info && \ - ln -sf /dev/stdout /var/log/mail.warn && \ - ln -sf /dev/stderr /var/log/mail.err -# Make logs writable for everyone -RUN chmod 002 /var/log/mail.log \ - /var/log/mail.info \ - /var/log/mail.warn \ - /var/log/mail.err - EXPOSE 25 143 587 ENTRYPOINT /boot; service postfix start; dovecot -F diff --git a/email_core/boot b/email_core/boot index f80b4a2..fe5923c 100755 --- a/email_core/boot +++ b/email_core/boot @@ -47,6 +47,11 @@ chmod u+w /vmail # Add password file cp /mail_settings/passwords /etc/dovecot/passwd +ln -sf /dev/stdout /var/log/mail.log +ln -sf /dev/stdout /var/log/mail.info +ln -sf /dev/stdout /var/log/mail.warn +ln -sf /dev/stderr /var/log/mail.err + # Run boot scripts for SCRIPT in /boot.d/* do diff --git a/opendkim/Dockerfile b/opendkim/Dockerfile index d42fd1f..d31871b 100644 --- a/opendkim/Dockerfile +++ b/opendkim/Dockerfile @@ -18,17 +18,5 @@ RUN chmod 755 /boot ENV OPEN_DKIM=true -# Redirect logs for Docker to pickup -RUN ln -sf /dev/stdout /var/log/mail.log && \ - ln -sf /dev/stdout /var/log/mail.info && \ - ln -sf /dev/stdout /var/log/mail.warn && \ - ln -sf /dev/stderr /var/log/mail.err -# Make logs writable for everyone -RUN chmod 002 /var/log/mail.log \ - /var/log/mail.info \ - /var/log/mail.warn \ - /var/log/mail.err - EXPOSE 8891 - ENTRYPOINT /boot; opendkim -f -p inet:8891@0.0.0.0 diff --git a/opendkim/boot b/opendkim/boot index 22b8c8f..1a00c56 100755 --- a/opendkim/boot +++ b/opendkim/boot @@ -5,3 +5,8 @@ cp /mail_settings/opendkim.conf /etc/opendkim.conf cp /mail_settings/mail.private /etc/dkim.key chown root:root /etc/dkim.key chmod 600 /etc/dkim.key + +ln -sf /dev/stdout /var/log/mail.log +ln -sf /dev/stdout /var/log/mail.info +ln -sf /dev/stdout /var/log/mail.warn +ln -sf /dev/stderr /var/log/mail.err