From d23d7d7f2c6854d298178d9c1b1d3f09cbfbf736 Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Mon, 11 Jul 2022 11:05:21 -0300 Subject: [PATCH] Updated Postfix to version 3.7.2 with Alpine 3.16. Fixed issue with comments and blank lines in overrides --- Dockerfile | 6 ++---- conf/postfix-service.sh | 2 +- docker-compose.yml | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6384328..c2edeb3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.15 +FROM alpine:3.16 LABEL MAINTAINER="Fabio Rauber " RUN apk add --no-cache bash postfix postfix-pcre @@ -7,8 +7,6 @@ COPY conf /etc/postfix VOLUME ["/var/spool/postfix"] -ENTRYPOINT ["etc/postfix/postfix-service.sh"] - -CMD [ "start" ] +ENTRYPOINT ["/etc/postfix/postfix-service.sh"] EXPOSE 25 diff --git a/conf/postfix-service.sh b/conf/postfix-service.sh index 17572f7..c64a05f 100755 --- a/conf/postfix-service.sh +++ b/conf/postfix-service.sh @@ -14,7 +14,7 @@ function serviceConf { # Override Postfix configuration if [ -f /overrides/postfix.cf ]; then while read line; do - postconf -e "$line" + [[ -n "$line" && "$line" != [[:blank:]#]* ]] && postconf -e "$line" done < /overrides/postfix.cf echo "Loaded '/overrides/postfix.cf'" else diff --git a/docker-compose.yml b/docker-compose.yml index 74a6e6f..7b48723 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,5 +4,4 @@ services: build: . ports: - 25 - entrypoint: /bin/bash - tty: true \ No newline at end of file + tty: true