diff --git a/dockerfiles/email/postfix/Dockerfile b/dockerfiles/email/postfix/Dockerfile index bc1616484b9e4cebd902d478306abe94a55df356..46142f16b3839ae9fa13944d7744043c522d8f24 100644 --- a/dockerfiles/email/postfix/Dockerfile +++ b/dockerfiles/email/postfix/Dockerfile @@ -14,10 +14,12 @@ RUN apt-get update \ supervisor \ && rm -rf /var/lib/apt/lists/* -COPY install.sh /opt/install.sh +COPY install.sh install.sh + +RUN chmod 755 /install.sh VOLUME ["/etc/postfix", "/var/spool/mail", "/var/log"] EXPOSE 25 -CMD /opt/install.sh;/usr/bin/supervisord -c /etc/supervisor/supervisord.conf +CMD /install.sh;/usr/bin/supervisord -c /etc/supervisor/supervisord.conf diff --git a/dockerfiles/email/postfix/install.sh b/dockerfiles/email/postfix/install.sh index 8a43b605961ff338ff26c06078be425c97c098ba..194b1d30cb6d315994aafa9efe2459181e594ac8 100755 --- a/dockerfiles/email/postfix/install.sh +++ b/dockerfiles/email/postfix/install.sh @@ -11,25 +11,15 @@ cat > /etc/supervisor/conf.d/supervisord.conf <<EOF nodaemon=true [program:postfix] -command=/opt/postfix.sh +process_name = master +command = /etc/init.d/postfix start +startsecs = 0 +autorestart = false [program:rsyslog] command=/usr/sbin/rsyslogd -n EOF -############ -# postfix -############ -cat >> /opt/postfix.sh <<EOF -#!/bin/bash -service postfix start -touch /var/log/mail.log -tail -f /var/log/mail.log -postmap /etc/postfix/virtual -service postfix restart -EOF -chmod +x /opt/postfix.sh - # put the same FQDN in /data/hostname and in reverse DNS # for the public IP address on which this server will be # receiving smtp traffic. @@ -46,3 +36,5 @@ cp /data/forwards /etc/postfix/virtual # accept mails from docker networked machines: /usr/sbin/postconf -e "mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 172.17.42.0/24" +# configure virtual +postmap /etc/postfix/virtual