diff --git a/data/Dockerfiles/postfix/postfix.sh b/data/Dockerfiles/postfix/postfix.sh index 39e5989c..3b18de40 100755 --- a/data/Dockerfiles/postfix/postfix.sh +++ b/data/Dockerfiles/postfix/postfix.sh @@ -341,9 +341,11 @@ 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 +touch /opt/postfix/conf/extra.cf +sed -i '/myhostname/d' /opt/postfix/conf/extra.cf +echo -e "myhostname = ${MAILCOW_HOSTNAME}\n$(cat /opt/postfix/conf/extra.cf)" > /opt/postfix/conf/extra.cf + +cat /opt/postfix/conf/extra.cf >> /opt/postfix/conf/main.cf if [ ! -f /opt/postfix/conf/custom_transport.pcre ]; then echo "Creating dummy custom_transport.pcre" diff --git a/docker-compose.yml b/docker-compose.yml index 36758ef3..30ee3b64 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -254,7 +254,7 @@ services: - dovecot postfix-mailcow: - image: mailcow/postfix:1.57 + image: mailcow/postfix:1.58 depends_on: - mysql-mailcow volumes: @@ -273,6 +273,7 @@ services: - DBPASS=${DBPASS} - REDIS_SLAVEOF_IP=${REDIS_SLAVEOF_IP:-} - REDIS_SLAVEOF_PORT=${REDIS_SLAVEOF_PORT:-} + - MAILCOW_HOSTNAME=${MAILCOW_HOSTNAME} cap_add: - NET_BIND_SERVICE ports: