Step 1: Download the script for installing ONLYOFFICE Mail on a Linux machine
wget https://download.onlyoffice.com/install/workspace-enterprise-install.sh
Step 2: Install ONLYOFFICE Mail in a Docker container
Replace "{Domain}" with your own domain and execute the command:
bash workspace-enterprise-install.sh -md "{Domain}" -ids false -ics false -icp false -es true
Your domain that will be used for maintaining correspondence must be valid and configured for this machine (i.e. it should have the appropriate A record in the DNS settings that points your domain name to the IP address of the machine where ONLYOFFICE Mail is installed).
In the command above, the "{Domain}"
parameter must be understood as a service domain for mail server. It is usually specified in the MX record of the domain that will be used for maintaining correspondence. As a rule, the "{Domain}"
looks like mx1.onlyoffice.com
Step 3: Enter into the running ONLYOFFICE Mail Docker container
Execute the following command:
sudo docker exec -it onlyoffice-mail-server bash
Step 4: Connect to the MySQL Server
To do that, enter the following command:
mysql -u mail_admin -p
Step 5: Enter the password
Enter the Isadmin123
password. After that you should see the SQL prompt:
mysql>
This means that you have successfully logged in to the SQL database.
Step 6: Select a database for use
Enter the following command (without omitting semicolon):
use onlyoffice_mailserver;
Step 7: Open the api_keys table and save the access_token field value
SELECT * FROM api_keys LIMIT 1;
This value will be necessary at Step 13 as {ApiAccessToken}
.
Step 8: Close the connection with MySQL and exit from the Docker container
mysql> exit
exit
Step 9: Go to the machine where ONLYOFFICE Groups is installed
If ONLYOFFICE Groups is installed as a Docker container, all the following operations must be performed within the Docker container. To enter the running ONLYOFFICE Community Server container, execute the following command:
sudo docker exec -it onlyoffice-community-server bash
Step 10: Connect to the MySQL Server
To do that, enter the following command:
sudo mysql -u root -p
Step 11: Enter the password
Enter the password you have specified during the MySQL installation. For the Docker version, just press Enter. After that you should see the SQL prompt:
mysql>
This means that you have successfully logged in to the SQL database.
Step 12: Select a database for use
Enter the following command (without omitting semicolon):
use onlyoffice;
Step 13: Execute the SQL script in the ONLYOFFICE Groups database
Replace the {PrivateIP/PublicIP}
, {Domain}
, {ApiAccessToken}
values with actual data and execute the following script:
SET @DOMAIN = '{Domain}';
SET @IP = '{PrivateIP/PublicIP}';
SET @DB_PASS = 'Isadmin123';
SET @API_TOKEN = '{ApiAccessToken}';
INSERT INTO `mail_mailbox_provider` (`id`, `name`, `display_name`, `display_short_name`, `documentation`) VALUES (0, @DOMAIN, NULL, NULL, NULL);
SET @id_provider = LAST_INSERT_ID();
INSERT INTO `mail_mailbox_server` (`id`, `id_provider`, `type`, `hostname`, `port`, `socket_type`, `username`, `authentication`, `is_user_data`) VALUES (0, @id_provider, 'smtp', @DOMAIN, 587, 'STARTTLS', '%EMAILADDRESS%', '', 0);
SET @id_smtp = LAST_INSERT_ID();
INSERT INTO `mail_mailbox_server` (`id`, `id_provider`, `type`, `hostname`, `port`, `socket_type`, `username`, `authentication`, `is_user_data`) VALUES (0, @id_provider, 'imap', @DOMAIN, 143, 'STARTTLS', '%EMAILADDRESS%', '', 0);
SET @id_imap = LAST_INSERT_ID();
SET @CONNECTION_STRING = CONCAT('{"DbConnection" : "Server=', @IP, ';Database=onlyoffice_mailserver;User ID=mail_admin;Password=', @DB_PASS, ';Pooling=True;Character Set=utf8", "Api":{"Protocol":"http", "Server":"', @IP, '", "Port":"8081", "Version":"v1","Token":"', @API_TOKEN, '"}}');
INSERT INTO `mail_server_server` (`id`, `mx_record`, `connection_string`, `server_type`, `smtp_settings_id`, `imap_settings_id`) VALUES (0, @DOMAIN, @CONNECTION_STRING, 2, @id_smtp, @id_imap);
Step 14: Close the connection with MySQL
mysql> exit
Step 15: Open the web.appsettings.config file
Now you need to change the web.appsettings.config that can be found in the /var/www/onlyoffice/WebStudio/
folder. Open this file using a text editor (e.g. nano):
sudo nano /var/www/onlyoffice/WebStudio/web.appsettings.config
Step 16: Remove the "AdministrationPage" string
Go to the web.hide-settings
string that contains disabled features list and remove the "AdministrationPage"
value, then save the changes.
Step 17: Restart the ONLYOFFICE Groups monoserve services
Execute the following command:
sudo service monoserve restart
Step 18: Sign in to the portal
Sign in to the portal using your administrator or owner account.
Step 19: Check ONLYOFFICE Mail for correct work
On the portal start page, make sure that the Mail link is now displayed as the ONLYOFFICE Mail one and go to this module. Follow the instructions provided here to connect your mail domain, create a new mailbox and check if the ONLYOFFICE Mail works correctly.