Skip to content

Commit

Permalink
Merge pull request #136 from ONLYOFFICE/bugfix/mail-external-resolves
Browse files Browse the repository at this point in the history
Fix Bug 54911/Correction of resolving the external address of the machine
  • Loading branch information
agolybev authored Jan 21, 2022
2 parents 21079d5 + 2bc6f09 commit e5d2476
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions run-community-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit e5d2476

Please sign in to comment.