diff --git a/docker/postfix/rootfs/init.sh b/docker/postfix/rootfs/init.sh index 6a3be659..ce4ed4c0 100755 --- a/docker/postfix/rootfs/init.sh +++ b/docker/postfix/rootfs/init.sh @@ -1,44 +1,47 @@ #!/bin/bash +set -e + cat ${SSL_CERTIFICATE} ${SSL_CERTIFICATE_FULLCHAIN} ${SSL_CERTIFICATE_KEY} > /etc/pki/tls/private/postfix.pem chown postfix:mail /etc/pki/tls/private/postfix.pem chmod 655 /etc/pki/tls/private/postfix.pem sed -i -r \ -e "s|APP_SERVICES_DOMAIN|$APP_SERVICES_DOMAIN|g" \ -e "s|SERVICES_PORT|$SERVICES_PORT|g" \ /etc/saslauthd.conf /usr/sbin/saslauthd -m /run/saslauthd -a httpform -d & # If host mounting /var/spool/postfix, we need to delete old pid file before # starting services rm -f /var/spool/postfix/pid/master.pid /usr/libexec/postfix/aliasesdb /usr/libexec/postfix/chroot-update sed -i -r \ -e "s|LMTP_DESTINATION|$LMTP_DESTINATION|g" \ /etc/postfix/main.cf sed -i -r \ -e "s|APP_DOMAIN|$APP_DOMAIN|g" \ -e "s|MYNETWORKS|172.18.0.0/24|g" \ /etc/postfix/main.cf sed -i -r \ -e "s|SERVICES_HOST|http://$APP_SERVICES_DOMAIN:$SERVICES_PORT|g" \ /usr/libexec/postfix/kolab_policy* sed -i -r \ -e "s|DB_HOST|$DB_HOST|g" \ -e "s|DB_USERNAME|$DB_USERNAME|g" \ -e "s|DB_PASSWORD|$DB_PASSWORD|g" \ -e "s|DB_DATABASE|$DB_DATABASE|g" \ /etc/postfix/sql/* # echo "/$APP_DOMAIN/ lmtp:$LMTP_DESTINATION" >> /etc/postfix/transport # postmap /etc/postfix/transport +/usr/sbin/postfix check exec /usr/sbin/postfix -c /etc/postfix start-fg