From ad41061774fe7208870fc5d09423e0ee8bc16bcd Mon Sep 17 00:00:00 2001 From: Myve Date: Thu, 22 Aug 2024 01:50:57 +0000 Subject: [PATCH] Fix duplicate entries on docker compose reset --- build/Dockerfile.alpine | 4 ++-- build/run/docker-entrypoint/init.d/30-postfix.sh | 7 ++++++- build/run/installer.sh | 6 ------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/build/Dockerfile.alpine b/build/Dockerfile.alpine index dd1970a..67ee602 100644 --- a/build/Dockerfile.alpine +++ b/build/Dockerfile.alpine @@ -16,8 +16,8 @@ ADD run/docker-entrypoint /docker-entrypoint/ ADD run/installer.sh /tmp/ # Update Ubuntu Software repository and install requisites -RUN printf '%s\n' 'https://dl-cdn.alpinelinux.org/alpine/edge/main/' \ - 'https://dl-cdn.alpinelinux.org/alpine/edge/community/' >/etc/apk/repositories \ +RUN printf '%s\n' 'https://dl-cdn.alpinelinux.org/alpine/latest-stable/main/' \ + 'https://dl-cdn.alpinelinux.org/alpine/latest-stable/community/' >/etc/apk/repositories \ # Pre-create vmail user && addgroup -g 600 vmail \ && adduser -S -D -h /var/vmail -u 600 -G vmail vmail \ diff --git a/build/run/docker-entrypoint/init.d/30-postfix.sh b/build/run/docker-entrypoint/init.d/30-postfix.sh index 809301b..67baa8e 100755 --- a/build/run/docker-entrypoint/init.d/30-postfix.sh +++ b/build/run/docker-entrypoint/init.d/30-postfix.sh @@ -9,7 +9,11 @@ mkdir /var/spool/postfix/etc cp /etc/resolv.conf /var/spool/postfix/etc/resolv.conf # Whitelist localhost -sed -i "s/{{LOCAL_IPADDRESS}}/$(wget -q4O- ipv4.icanhazip.com)/" /etc/postfix/postscreen_access.cidr +tee /etc/postfix/postscreen_access.cidr >/dev/null <<- postscreen_access.cidr +# Permit my own IP addresses +$(wget -q4O- ipv4.icanhazip.com)/32 permit + +postscreen_access.cidr # Configure backup mail servers if [ ${MYVEMAIL_BACKUPMX} ] @@ -29,6 +33,7 @@ fi # Whitelist addmx=(${MYVEMAIL_DOMAIN}) addmx+=(${MYVEMAIL_ADDMX//,/ }) +echo | tee /etc/postfix/{helo_access,rbl_override} >/dev/null for domain in ${addmx[@]} do echo "${domain} OK" | tee -a /etc/postfix/{helo_access,rbl_override} >/dev/null diff --git a/build/run/installer.sh b/build/run/installer.sh index 47121e0..e116d1d 100755 --- a/build/run/installer.sh +++ b/build/run/installer.sh @@ -157,12 +157,6 @@ echo "/free mortgage quote/ DISCARD /repair your credit/ DISCARD /lose weight/ DISCARD" | tee -a /etc/postfix/body_checks >/dev/null -# Whitelist localhost -tee /etc/postfix/postscreen_access.cidr >/dev/null <<- postscreen_access.cidr -# Permit my own IP addresses -{{LOCAL_IPADDRESS}}/32 permit -postscreen_access.cidr - # Touch aliases db newaliases