Add option to overwrite the From address

This commit is contained in:
lucas_nz
2020-09-29 21:33:52 +13:00
parent e0d3ab0af7
commit 6783d68f42
2 changed files with 11 additions and 0 deletions

7
run.sh
View File

@@ -68,6 +68,13 @@ if [ ! -z "${SMTP_NETWORKS}" ]; then
fi
add_config_value "mynetworks" "${nets}"
if [ ! -z "${OVERWRITE_FROM}" ]; then
echo -e "/^From:.*$/ REPLACE From: $OVERWRITE_FROM" > /etc/postfix/smtp_header_checks
postmap /etc/postfix/smtp_header_checks
postconf -e 'smtp_header_checks = regexp:/etc/postfix/smtp_header_checks'
echo "Setting configuration option OVERWRITE_FROM with value: ${OVERWRITE_FROM}"
fi
#Start services
# If host mounting /var/spool/postfix, we need to delete old pid file before