[Postfix] Allow to create an extra.cf file besides main.cf to merge overrides

[Postfix] Better logging while bootstrapping
[Postfix] Stop container, when a service fails (easier to monitor)
master
andryyy 2019-09-02 18:37:05 +02:00
parent 893ce5a789
commit b4f159da86
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
4 changed files with 15 additions and 3 deletions

View File

@ -39,6 +39,7 @@ RUN groupadd -g 102 postfix \
COPY supervisord.conf /etc/supervisor/supervisord.conf COPY supervisord.conf /etc/supervisor/supervisord.conf
COPY syslog-ng.conf /etc/syslog-ng/syslog-ng.conf COPY syslog-ng.conf /etc/syslog-ng/syslog-ng.conf
COPY stop-supervisor.sh /usr/local/sbin/stop-supervisor.sh
COPY postfix.sh /opt/postfix.sh COPY postfix.sh /opt/postfix.sh
COPY rspamd-pipe-ham /usr/local/bin/rspamd-pipe-ham COPY rspamd-pipe-ham /usr/local/bin/rspamd-pipe-ham
COPY rspamd-pipe-spam /usr/local/bin/rspamd-pipe-spam COPY rspamd-pipe-spam /usr/local/bin/rspamd-pipe-spam

View File

@ -292,6 +292,12 @@ query = SELECT goto FROM spamalias
AND validity >= UNIX_TIMESTAMP() AND validity >= UNIX_TIMESTAMP()
EOF EOF
sed -i '/User overrides/q' /opt/postfix/conf/main.cf
echo >> /opt/postfix/conf/main.cf
if [ -f /opt/postfix/conf/extra.cf ]; then
cat /opt/postfix/conf/extra.cf >> /opt/postfix/conf/main.cf
fi
# Fix Postfix permissions # Fix Postfix permissions
chown -R root:postfix /opt/postfix/conf/sql/ chown -R root:postfix /opt/postfix/conf/sql/
chmod 640 /opt/postfix/conf/sql/*.cf chmod 640 /opt/postfix/conf/sql/*.cf
@ -300,7 +306,7 @@ chgrp -R postdrop /var/spool/postfix/maildrop
postfix set-permissions postfix set-permissions
# Check Postfix configuration # Check Postfix configuration
postconf -c /opt/postfix/conf postconf -c /opt/postfix/conf > /dev/null
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
echo "Postfix configuration error, refusing to start." echo "Postfix configuration error, refusing to start."

View File

@ -1,4 +1,5 @@
[supervisord] [supervisord]
pidfile=/var/run/supervisord.pid
nodaemon=true nodaemon=true
user=root user=root
@ -12,6 +13,10 @@ autostart=true
[program:postfix] [program:postfix]
command=/opt/postfix.sh command=/opt/postfix.sh
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=true autorestart=true
[eventlistener:processes] [eventlistener:processes]

View File

@ -98,7 +98,7 @@ services:
- rspamd - rspamd
php-fpm-mailcow: php-fpm-mailcow:
image: mailcow/phpfpm:1.43 image: mailcow/phpfpm:1.44
build: ./data/Dockerfiles/phpfpm build: ./data/Dockerfiles/phpfpm
command: "php-fpm -d date.timezone=${TZ} -d expose_php=0" command: "php-fpm -d date.timezone=${TZ} -d expose_php=0"
depends_on: depends_on:
@ -145,7 +145,7 @@ services:
- phpfpm - phpfpm
sogo-mailcow: sogo-mailcow:
image: mailcow/sogo:1.59 image: mailcow/sogo:1.60
build: ./data/Dockerfiles/sogo build: ./data/Dockerfiles/sogo
environment: environment:
- DBNAME=${DBNAME} - DBNAME=${DBNAME}