From 0797714d18a1f2916c6c3dfc6c7b6fc8e54fd9c0 Mon Sep 17 00:00:00 2001 From: myve Date: Fri, 10 Jan 2025 22:07:20 +0000 Subject: [PATCH] Update build/run/docker-entrypoint/init.d/30-postfix.sh --- .../docker-entrypoint/init.d/30-postfix.sh | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/build/run/docker-entrypoint/init.d/30-postfix.sh b/build/run/docker-entrypoint/init.d/30-postfix.sh index 68fa317..20ca4f5 100755 --- a/build/run/docker-entrypoint/init.d/30-postfix.sh +++ b/build/run/docker-entrypoint/init.d/30-postfix.sh @@ -37,7 +37,7 @@ echo -n | tee /etc/postfix/{helo_access,{whitelisted,blacklisted}_{domains,email for domain in ${addmx[@]} do echo "${domain} OK Primary and backup mail servers" | tee -a /etc/postfix/helo_access >/dev/null - echo "/${domain}/ OK Primary and backup mail servers" | tee -a /etc/postfix/whitelisted_domains >/dev/null + echo "/${domain/./\\.}$/ OK Primary and backup mail servers" | tee -a /etc/postfix/whitelisted_domains >/dev/null done # Whitelist domains or server IP addresses @@ -59,6 +59,8 @@ then do echo "${whitelist_email} OK Whitelisted email" | tee -a /etc/postfix/whitelisted_emails >/dev/null done +else + echo "null@null.void OK Dummy entry" >/etc/postfix/whitelisted_emails fi # Blacklist domains or server IP addresses @@ -67,8 +69,10 @@ then addblacklist_domain+=(${MYVEMAIL_BLACKLIST_DOMAINS//,/ }) for blacklist_domain in ${addblacklist_domain[@]} do - echo "/${blacklist_domain}/ OK Blacklisted domain" | tee -a /etc/postfix/blacklisted_domains >/dev/null + echo "/${blacklist_domain}/ REJECT Blacklisted domain" | tee -a /etc/postfix/blacklisted_domains >/dev/null done +else + echo "/^null.void$/ OK Dummy entry" >/etc/postfix/blacklisted_domains fi # Blacklist emails @@ -77,8 +81,10 @@ then addblacklist_email+=(${MYVEMAIL_BLACKLIST_EMAILS//,/ }) for blacklist_email in ${addblacklist_email[@]} do - echo "${blacklist_email} OK Blacklisted email" | tee -a /etc/postfix/blacklisted_emails >/dev/null + echo "${blacklist_email} REJECT Blacklisted email" | tee -a /etc/postfix/blacklisted_emails >/dev/null done +else + echo "null@null.void OK Dummy entry" >/etc/postfix/blacklisted_emails fi # Virtual mailboxes @@ -97,11 +103,5 @@ postfix start postmap /etc/postfix/helo_access \ /etc/postfix/smtp_header_checks /etc/postfix/header_checks \ /etc/postfix/body_checks \ - /etc/postfix/postscreen_access.cidr -for map in /etc/postfix/{whitelisted,blacklisted}_{domains,emails} -do - if [ -s ${map} ] - then - postmap ${map} - fi -done \ No newline at end of file + /etc/postfix/postscreen_access.cidr \ + /etc/postfix/{whitelisted,blacklisted}_{domains,emails} \ No newline at end of file