From 6dacac1ad0f93357dbb25e3451fc25b015b384e9 Mon Sep 17 00:00:00 2001 From: myve Date: Fri, 10 Jan 2025 21:36:26 +0000 Subject: [PATCH] Update build/run/docker-entrypoint/init.d/30-postfix.sh --- build/run/docker-entrypoint/init.d/30-postfix.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/build/run/docker-entrypoint/init.d/30-postfix.sh b/build/run/docker-entrypoint/init.d/30-postfix.sh index fcce5c8..2d0e9cc 100755 --- a/build/run/docker-entrypoint/init.d/30-postfix.sh +++ b/build/run/docker-entrypoint/init.d/30-postfix.sh @@ -33,7 +33,7 @@ fi # Whitelist Primary and Backup mail servers addmx=(${MYVEMAIL_DOMAIN}) addmx+=(${MYVEMAIL_ADDMX//,/ }) -echo -n | tee /etc/postfix/{helo_access,whitelist_{domains,emails},blacklist_{domains,emails}} >/dev/null +echo -n | tee /etc/postfix/{helo_access,{whitelist,blacklist}_{domains,emails}} >/dev/null for domain in ${addmx[@]} do echo "${domain} OK Primary and backup mail servers" | tee -a /etc/postfix/helo_access >/dev/null @@ -92,9 +92,16 @@ setfacl -R -m u:postfix:rx /etc/postfix/sql/ # Start postfix postfix start + +# Create postfix db tables postmap /etc/postfix/helo_access \ - /etc/postfix/whitelisted_domains /etc/postfix/whitelisted_emails \ - /etc/postfix/blacklisted_domains /etc/postfix/blacklisted_emails \ /etc/postfix/smtp_header_checks /etc/postfix/header_checks \ /etc/postfix/body_checks \ - /etc/postfix/postscreen_access.cidr \ No newline at end of file + /etc/postfix/postscreen_access.cidr +for map in /etc/postfix/{helo_access,{whitelist,blacklist}_{domains,emails}} +do + if [ -s ${map} ] + then + postmap ${map} + fi +done \ No newline at end of file