Update build/run/docker-entrypoint/init.d/30-postfix.sh

This commit is contained in:
myve 2025-01-10 22:07:20 +00:00
commit 0797714d18

View file

@ -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
/etc/postfix/postscreen_access.cidr \
/etc/postfix/{whitelisted,blacklisted}_{domains,emails}