make inet_protocol configurable

This commit is contained in:
Michael Grote 2023-10-31 10:25:38 +01:00
parent 4723a4336f
commit eeb6be696b
3 changed files with 10 additions and 1 deletions

View File

@ -40,3 +40,6 @@
# Optional: This will use allow you to set a custom $message_size_limit value. Default is 10240000.
#MESSAGE_SIZE_LIMIT=
# Optional: This will let you decide which ip-protocol should be used.
#INET_PROTOCOL=[ipv4|ipv6|all]

View File

@ -10,7 +10,6 @@ RUN apk update --no-cache && \
postfix && \
mkdir -p /var/log/supervisor/ /var/run/supervisor/ && \
sed -i -e 's/inet_interfaces = localhost/inet_interfaces = all/g' /etc/postfix/main.cf && \
sed -i -e 's/inet_protocols = all/inet_protocols = ipv4/g' /etc/postfix/main.cf && \
chmod +x /run.sh && \
newaliases

7
run.sh
View File

@ -120,6 +120,13 @@ if [ ! -z "${MESSAGE_SIZE_LIMIT}" ]; then
echo "Setting configuration option message_size_limit with value: ${MESSAGE_SIZE_LIMIT}"
fi
# Set inet_protocol
if [ ! -z "${INET_PROTOCOL}" ]; then
sed -i -e 's/inet_protocols = all/inet_protocols = ipv4/g' /etc/postfix/main.cf
echo "Setting configuration option inet_protocols with value: ${INET_PROTOCOL}"
fi
#Start services
# If host mounting /var/spool/postfix, we need to delete old pid file before