Fix bug: mailserver's accounts could not be removed from portal if network is enabled (Posty Api connection refused)

This commit is contained in:
Alexey Safronov 2016-08-10 15:18:34 +03:00
parent 54449e67d0
commit f48590ef29
1 changed files with 6 additions and 1 deletions

View File

@ -491,9 +491,14 @@ END
echo "mysql mail server access token is ${MYSQL_MAIL_SERVER_ACCESS_TOKEN}";
fi
MAIL_SERVER_API_HOST_ADDRESS=${MAIL_SERVER_API_HOST};
if [[ $MAIL_SERVER_DB_HOST == "onlyoffice-mail-server" ]]; then
MAIL_SERVER_API_HOST_ADDDRESS=${MAIL_SERVER_DB_HOST};
fi
mysql_scalar_exec "DELETE FROM mail_server_server;"
mysql_scalar_exec "INSERT INTO mail_server_server (mx_record, connection_string, server_type, smtp_settings_id, imap_settings_id) \
VALUES ('${MAIL_SERVER_HOSTNAME}', '{\"DbConnection\" : \"Server=${MAIL_SERVER_DB_HOST};Database=${MAIL_SERVER_DB_NAME};User ID=${MAIL_SERVER_DB_USER};Password=${MAIL_SERVER_DB_PASS};Pooling=True;Character Set=utf8;AutoEnlist=false\", \"Api\":{\"Protocol\":\"http\", \"Server\":\"${MAIL_SERVER_API_HOST}\", \"Port\":\"${MAIL_SERVER_API_PORT}\", \"Version\":\"v1\",\"Token\":\"${MYSQL_MAIL_SERVER_ACCESS_TOKEN}\"}}', 2, '${id2}', '${id1}');"
VALUES ('${MAIL_SERVER_HOSTNAME}', '{\"DbConnection\" : \"Server=${MAIL_SERVER_DB_HOST};Database=${MAIL_SERVER_DB_NAME};User ID=${MAIL_SERVER_DB_USER};Password=${MAIL_SERVER_DB_PASS};Pooling=True;Character Set=utf8;AutoEnlist=false\", \"Api\":{\"Protocol\":\"http\", \"Server\":\"${MAIL_SERVER_API_HOST_ADDRESS}\", \"Port\":\"${MAIL_SERVER_API_PORT}\", \"Version\":\"v1\",\"Token\":\"${MYSQL_MAIL_SERVER_ACCESS_TOKEN}\"}}', 2, '${id2}', '${id1}');"
fi
if [ "${CONTROL_PANEL_ENABLED}" == "true" ]; then