From cc155c578a31602ede1add0cea39dd5cda86d431 Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 10 Dec 2025 02:13:58 +0100 Subject: [PATCH] install_amavis.sh: fix error in creating master.cf if aditional port is used. --- install_amavis.sh | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/install_amavis.sh b/install_amavis.sh index 5bca502..5481b98 100755 --- a/install_amavis.sh +++ b/install_amavis.sh @@ -5006,19 +5006,6 @@ EOF EOF fi - if ${listen_on_additional_smtp_port} ; then - cat >> $postfix_master_cf << EOF -${additional_smtp_port} inet n - y - - smtpd - -o smtpd_proxy_filter=127.0.0.1:10024 - -o content_filter= -EOF - if [[ "$SASL_AUTH_ENABLED" = "no" ]] ; then - cat >> $postfix_master_cf << EOF - -o smtpd_sasl_auth_enable=no -EOF - fi - fi - if ! $submission_present && ! $smtps_present && ! $localhost_10025_present ; then cat >> $postfix_master_cf << EOF localhost:10025 inet n - y - - smtpd @@ -5046,8 +5033,26 @@ EOF continue fi + if ${listen_on_additional_smtp_port} \ + && echo "$_line" | grep -i -E "^\s*${additional_smtp_port}\s+inet" > /dev/null 2>&1 ; then + _found=true + cat >> $postfix_master_cf << EOF +${additional_smtp_port} inet n - y - - smtpd + -o smtpd_proxy_filter=127.0.0.1:10024 + -o content_filter= +EOF + if [[ "$SASL_AUTH_ENABLED" = "no" ]] ; then + cat >> $postfix_master_cf << EOF + -o smtpd_sasl_auth_enable=no +EOF + fi - if $submission_present && echo "$_line" | grep -i -E "^^submission\s+" > /dev/null 2>&1 ; then + continue + + fi + + + if $submission_present && echo "$_line" | grep -i -E "^submission\s+" > /dev/null 2>&1 ; then _found=true cat >> $postfix_master_cf << EOF submission inet n - y - 20 smtpd