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 diff --git a/entrypoint.sh b/entrypoint.sh index b9f945f..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 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