From 0957dc1553453176e012e7c0e92b655761ebb529 Mon Sep 17 00:00:00 2001 From: H Yi Date: Wed, 18 Jan 2023 10:09:06 -0600 Subject: [PATCH 1/3] introduce enviorment variable NET_DEV so net device does need to be eth0 --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index b9f945f..59d640a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -55,7 +55,7 @@ fi opts=( dc_local_interfaces "[${BIND_IP:-0.0.0.0}]:${PORT:-25} ; [${BIND_IP6:-::0}]:${PORT:-25}" dc_other_hostnames "${OTHER_HOSTNAMES}" - dc_relay_nets "$(ip addr show dev eth0 | awk '$1 == "inet" { print $2 }' | xargs | sed 's/ /:/g')${RELAY_NETWORKS}" + dc_relay_nets "$(ip addr show dev ${NET_DEV:-eth0} | awk '$1 == "inet" { print $2 }' | xargs | sed 's/ /:/g')${RELAY_NETWORKS}" ) if [ "$DISABLE_IPV6" ]; then From bbf98e1e6b9021bc452fa124cee1ef294f90c731 Mon Sep 17 00:00:00 2001 From: Alex Thomae Date: Fri, 20 Jan 2023 17:35:21 +0100 Subject: [PATCH 2/3] #13: update README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 7bd4815..1187c03 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ To disable IPV6 you can set the `DISABLE_IPV6` environment variable to any value The container accepts `OTHER_HOSTNAMES` environment variable which will set the list of domains for which this machine should consider itself the final destination. +The container accepts `NET_DEV` environment variable to override the default `eth0` interface for retrieving the IP address for relay networks. + ## Below are scenarios for using this container ### As SMTP Server From 9feb1837af8b54aff17c27872941c4daac7e3121 Mon Sep 17 00:00:00 2001 From: Alex Thomae Date: Fri, 20 Jan 2023 17:39:02 +0100 Subject: [PATCH 3/3] #13: Making the linter happy --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 59d640a..9cb200e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -55,7 +55,7 @@ fi opts=( dc_local_interfaces "[${BIND_IP:-0.0.0.0}]:${PORT:-25} ; [${BIND_IP6:-::0}]:${PORT:-25}" dc_other_hostnames "${OTHER_HOSTNAMES}" - dc_relay_nets "$(ip addr show dev ${NET_DEV:-eth0} | awk '$1 == "inet" { print $2 }' | xargs | sed 's/ /:/g')${RELAY_NETWORKS}" + dc_relay_nets "$(ip addr show dev "${NET_DEV:-eth0}" | awk '$1 == "inet" { print $2 }' | xargs | sed 's/ /:/g')${RELAY_NETWORKS}" ) if [ "$DISABLE_IPV6" ]; then