Skip to content
Snippets Groups Projects
Commit 27bdbf6a authored by Pierre Ozoux's avatar Pierre Ozoux
Browse files

Reorganises postfix install script

parent ccc2a413
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment