From 32980f67dea8c8cf12dfdb81d7a5b875bddfa3a0 Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 18 Feb 2026 01:32:08 +0100 Subject: [PATCH] install_postfix_advanced.sh: fix handling of additional smtp port. --- install_postfix_advanced.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/install_postfix_advanced.sh b/install_postfix_advanced.sh index 37d1cd0..71316d2 100755 --- a/install_postfix_advanced.sh +++ b/install_postfix_advanced.sh @@ -4147,6 +4147,14 @@ else dmarc_pipe_present=false fi +if ${LISTEN_ON_ADDITIONAL_RELAY_PORT} ; then + if grep -iq -E "^${ADDITIONAL_RELAY_LISTEN_PORT}\s+" $postfix_master_cf > /dev/null 2>&1 ; then + additional_relay_port_present=true + else + additional_relay_port_present=false + fi +fi + _found=false echononl " Create new file \"${postfix_master_cf}\"" if [[ -f "${postfix_master_cf}.$backup_date" ]]; then @@ -4176,9 +4184,11 @@ smtps inet n - y - - smtpd EOF fi elif $LISTEN_ON_ADDITIONAL_RELAY_PORT ; then - cat >> $postfix_master_cf << EOF + if ! ${additional_relay_port_present} ; then + cat >> $postfix_master_cf << EOF ${ADDITIONAL_RELAY_LISTEN_PORT} inet n - y - - smtpd EOF + fi fi continue fi