diff --git a/run-community-server.sh b/run-community-server.sh index 5d3631b..3477aad 100644 --- a/run-community-server.sh +++ b/run-community-server.sh @@ -805,6 +805,9 @@ if [ "${MAIL_SERVER_ENABLED}" == "true" ]; then if check_ip_is_internal $DOCKER_APP_SUBNET $MAIL_SERVER_API_HOST; then SENDER_IP=$(hostname -i); + if [[ -n ${MAIL_DOMAIN_NAME} ]]; then + echo "$(dig +short myip.opendns.com @resolver1.opendns.com) ${MAIL_DOMAIN_NAME}" >> /etc/hosts + fi elif [[ "$(dig +short myip.opendns.com @resolver1.opendns.com)" =~ $VALID_IP_ADDRESS_REGEX ]]; then SENDER_IP=$(dig +short myip.opendns.com @resolver1.opendns.com); log_debug "External ip $SENDER_IP is valid";