install_postfix_base.sh: fix error if IPv4 address is a loopback address (127.x).

This commit is contained in:
Christoph 2024-12-18 12:04:04 +01:00
parent f1f56f48f6
commit da6c7fca0e

View File

@ -674,12 +674,25 @@ mydestination =
## -
mynetworks =
127.0.0.0/8
EOF
if [[ ${IPV4} =~ ^127 ]] ; then
cat <<EOF >> /etc/postfix/main.cf
smtp_bind_address =
smtp_bind_address6 =
EOF
else
cat <<EOF >> /etc/postfix/main.cf
${IPV4}/32
smtp_bind_address = $IPV4
smtp_bind_address6 = $IPV6
#smtp_bind_address6 =
EOF
fi
fi
cat <<EOF >> /etc/postfix/main.cf