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 = mynetworks =
127.0.0.0/8 127.0.0.0/8
${IPV4}/32 EOF
smtp_bind_address = $IPV4 if [[ ${IPV4} =~ ^127 ]] ; then
smtp_bind_address6 = $IPV6
cat <<EOF >> /etc/postfix/main.cf
smtp_bind_address =
smtp_bind_address6 =
EOF EOF
else
cat <<EOF >> /etc/postfix/main.cf
${IPV4}/32
smtp_bind_address = $IPV4
#smtp_bind_address6 =
EOF
fi
fi fi
cat <<EOF >> /etc/postfix/main.cf cat <<EOF >> /etc/postfix/main.cf