From da6c7fca0eacc1d12dc0aca1939d98343a35e5b2 Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 18 Dec 2024 12:04:04 +0100 Subject: [PATCH] install_postfix_base.sh: fix error if IPv4 address is a loopback address (127.x). --- install_postfix_base.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/install_postfix_base.sh b/install_postfix_base.sh index 38617d4..1d305bd 100755 --- a/install_postfix_base.sh +++ b/install_postfix_base.sh @@ -674,12 +674,25 @@ mydestination = ## - mynetworks = 127.0.0.0/8 - ${IPV4}/32 +EOF -smtp_bind_address = $IPV4 -smtp_bind_address6 = $IPV6 + if [[ ${IPV4} =~ ^127 ]] ; then + + cat <> /etc/postfix/main.cf + +smtp_bind_address = +smtp_bind_address6 = EOF + else + cat <> /etc/postfix/main.cf + ${IPV4}/32 + +smtp_bind_address = $IPV4 +#smtp_bind_address6 = + +EOF + fi fi cat <> /etc/postfix/main.cf