Changing domain used with ONLYOFFICE Mail

Introduction

If you decide to change the domain used with ONLYOFFICE Mail, you will need to update the relevant information in your system. Follow the steps below to ensure the process completes without errors.

Step 1: Stop ONLYOFFICE Mail container and remove it

First, you will need to stop the container with ONLYOFFICE Mail. On the server where ONLYOFFICE Mail installed,run the following command:

docker stop onlyoffice-mail-server

Then remove this container:

docker rm onlyoffice-mail-server

Step 2: Reinstall ONLYOFFICE Mail with the new domain address

Reinstall ONLYOFFICE Mail using the new domain address, which will be used for ONLYOFFICE Mail:

bash workspace-enterprise-install.sh -ics false -ids false -icp false -ims true -md {NEW-MX-DOMAIN} -es true

Where {NEW-MX-DOMAIN} is the new domain address used for ONLYOFFICE Mail (typically in the format mx.yourdomain.com).

Step 3: Update the domain information

Next, update the domain information in the database. Run the following commands:

docker exec -it onlyoffice-mysql-server mysql -pmy-secret-pw --silent -e "use onlyoffice; update mail_server_server SET mx_record  = '{NEW-MX-DOMAIN}';"
docker exec -it onlyoffice-mysql-server mysql -pmy-secret-pw --silent -e "use onlyoffice; update mail_server_server ms inner join mail_mailbox_server s on ms.smtp_settings_id = s.id or ms.imap_settings_id = s.id SET s.hostname = '{NEW-MX-DOMAIN}';"

Where {NEW-MX-DOMAIN} is the new domain address for ONLYOFFICE Mail as defined in Step 2.

Step 4: Start ONLYOFFICE Mail

Verify that ONLYOFFICE Mail is running:

docker logs -f onlyoffice-mail-server

The output should look like this:

...
Starting fail2ban:                                         [  OK  ]
Starting server
Article with the tag:
Browse all tags