Try the fastest and simplest way to install ONLYOFFICE

Issues with MailSever

Questions/problems on Docker

Issues with MailSever

Postby Takahashi » Sun Aug 06, 2017 8:12 pm

I installed only office using the script ...

When I first logged in, everything appeared to be working fine. I was able to go though the domain verification steps and set up a new mailbox.

Since then I've restarted the Docker host a few times. Now when I click on "Settings > Mail Server" I get "Internal Server Error. Try again later"

Chrome console shows the following:
GET ... n?__=43443 400 (Invalid arguments)
GET ... 3&__=43443 400 (Invalid arguments)
GET ... 3&__=43443 400 (Invalid arguments)

And manually following any of those links returns the following JSON:
{"status":1,"statusCode":400,"error":{"message":"Invalid mx host\u000aParameter name: builder","hresult":-2147024809,"data":{}}}

Then I go to "Integration > Mail Service" and click Connect" and get "Error pinging host"

So then I check the IP addresses of the various docker images:
"Name": "onlyoffice",
"Id": "dafaa1da61dfec8b8e68e87d920fdb1689a823b0b1282aec15144b061e622a5a",
"Created": "0001-01-01T00:00:00Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": {},
"Config": [
"Subnet": "",
"Gateway": ""
"Internal": false,
"Attachable": false,
"Ingress": false,
"Containers": {
"5802067ba9c88e330579a49b629ce850babc15f4120ee7771b23495be2c5ec03": {
"Name": "onlyoffice-community-server",
"EndpointID": "ac42f7902be051547f415288adb7b1a648c8435479186606600d6d28a892e66b",
"MacAddress": "02:42:ac:12:00:04",
"IPv4Address": "",
"IPv6Address": ""
"71118860f83c897fa69becf19b61fe4fbae0a48338bf440a57b239d9e869561e": {
"Name": "onlyoffice-mail-server",
"EndpointID": "6ba0a1f1bc74911ca59357ea613832346e86fcd8419dbf3080ca6f864fc15355",
"MacAddress": "02:42:ac:12:00:02",
"IPv4Address": "",
"IPv6Address": ""
"a747eb7c74a95366a561cb75a179395e02982f8abfc9db2233d75453d37f0b5b": {
"Name": "onlyoffice-document-server",
"EndpointID": "4c81489833ade754e32a9c974415a0bba15dd457dc7d05b2ed9cba44b20bcba7",
"MacAddress": "02:42:ac:12:00:05",
"IPv4Address": "",
"IPv6Address": ""
"f76e0496397be223065b50b0512444690d936e20854f296207e729f256a64246": {
"Name": "onlyoffice-mysql-server",
"EndpointID": "9cdd965727cb3aa9c491ee197a56362054eded54c00482ede4a2ff6d4588112f",
"MacAddress": "02:42:ac:12:00:03",
"IPv4Address": "",
"IPv6Address": ""
"Options": {},
"Labels": {}

So this indicated 17218.0.4 is the IP of community server not the mail server, is this correct?

I tried changing it to, but I get the same can't ping error.

Any suggestions?

I'm thinking about adding port mappings to the mail-server docker image to expose 3306 and 8081 and then changing the mail server to point at the docker host (not an ideal setup but I'm curious to see if it will fix it).
Posts: 1
Joined: Sun Aug 06, 2017 7:32 pm

Re: Issues with MailSever

Postby Maxim » Mon Aug 07, 2017 1:23 pm

Hello Takahashi!
We have detected the issue! Thank you for the information! We will fix it!
So, there is a script (*.sh) you can use which will fix the problem. Run it with bash command.
Code: Select all


MYSQL=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $MYSQL_CONTAINER)

echo "mysql ip: $MYSQL"

MAIL=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $MAIL_CONTAINER)

echo "mail ip: $MAIL"

TOKEN=$(docker exec $MYSQL_CONTAINER mysql --silent --skip-column-names -p$ROOT_PWD -D $MAIL_DB -e "select access_token from onlyoffice_mailserver.api_keys limit 1;" 2>/dev/null)

echo "token: $TOKEN"

MX=$(docker exec $MYSQL_CONTAINER mysql --silent --skip-column-names -p$ROOT_PWD -D $MAIL_DB -e "select Comment from greylisting_whitelist where Source='SenderIP:$MAIL'" 2>/dev/null)

echo "mx_record: $MX"

CS="{\"DbConnection\":\"Server=$MYSQL;Database=$MAIL_DB;User ID=$MAIL_USR;Password=$MAIL_PWD;Pooling=True;Character Set=utf8\",\"Api\":{\"Protocol\":\"$PROTOCOL\",\"Server\":\"$MAIL\",\"Port\":8081,\"Version\":\"v1\",\"Token\":\"$TOKEN\"}}"

echo "connection string: $CS"

echo "start update mysql data"

docker exec $MYSQL_CONTAINER mysql --silent -p$ROOT_PWD -D $DB -e "update mail_server_server set mx_record='$MX';" 2>/dev/null

docker exec $MYSQL_CONTAINER mysql --silent -p$ROOT_PWD -D $DB -e "update mail_server_server set connection_string='$CS';" 2>/dev/null

docker exec $MYSQL_CONTAINER mysql --silent -p$ROOT_PWD -D $DB -e "update mail_server_server ms inner join mail_mailbox_server s on ms.smtp_settings_id = or ms.imap_settings_id = set s.hostname = '$MX';" 2>/dev/null

echo "end update mysql data"

echo "result:"

RES=$(docker exec $MYSQL_CONTAINER mysql --silent --skip-column-names -p$ROOT_PWD -D $DB -e "select * from mail_server_server" 2>/dev/null)

echo $RES

And restart monoserve in Community Server container
Posts: 1422
Joined: Tue Oct 11, 2016 2:34 pm

Re: Issues with MailSever

Postby 4tom » Thu Aug 31, 2017 2:19 pm

i encountered this problem also on a reboot, after configuring first mail domain on a clean installation without anything modified.
the script above works that i am able to access the mail server settings page.
but any mailbox that was created after this point cannot send and receive email, always end up with message delivery failure.
old mailbox that was created before the reboot still works fine.

I have tried multiple times even without configuring any domain, i just accessed the email page after a clean installation and rebooted without touching anything, and i still meet this error.
Also it seems the script did not survive a reboot as each reboot i need to run the script again, otherwise i'll meet the same error message on mail settings.
at this point i am at loss on what to do next.
Posts: 5
Joined: Wed Aug 16, 2017 10:20 am

Re: Issues with MailSever

Postby Maxim » Fri Sep 01, 2017 12:06 pm

Hello 4tom!
We have updated the script, please execute it again. This bug will be fixed next release. But you will have to execute it every time after reboot until next release.
Posts: 1422
Joined: Tue Oct 11, 2016 2:34 pm

Return to Docker Version

Who is online

Users browsing this forum: No registered users and 2 guests