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
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: Run HeidiSQL
Go to the Windows machine where ONLYOFFICE Groups is installed and run HeidiSQL (if this tool is not installed, download and install it using the following link).
Step 4: Open a connection with the ONLYOFFICE Mail MySQL database
To do that, enter the following data:
- Hostname: {ONLYOFFICE Mail {Domain}/{PrivateIP}/{PublicIP}}
- User: mail_admin
- Password: Isadmin123
- Database: onlyoffice_mailserver
Then press Open.
If you cannot connect, please verify that the ONLYOFFICE Mail machine is accessible and the port 3306 (MySQL) is open.
Step 5: Open the api_keys table and save the access_token field value
In the Tools menu, select the Launch command line option and execute the command:
SELECT * FROM api_keys LIMIT 1;
This value will be necessary at Step 6 as {ApiAccessToken}
.
Step 6: Open a connection with the ONLYOFFICE Groups MySQL database
In HeidiSQL, open a connection with the ONLYOFFICE Groups MySQL database. To do that, enter the following data:
- Hostname: {ONLYOFFICE Groups {Domain}/{PrivateIP}/{PublicIP}}
- User: root
- Password: onlyoffice
- Database: onlyoffice
Then press Open.
Replace the {PrivateIP/PublicIP}
, {Domain}
, {ApiAccessToken}
values with actual data and execute the following script via the command line (Tools -> Launch command line):
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 7: Change the web.appsettings.config file
Go to the C:\Program Files (x86)\Ascensio System SIA\CommunityServer\WebStudio\
folder and open the web.appsettings.config file with the ONLYOFFICE Groups settings.
Find the web.hide-settings
string that contains disabled features list and remove the "AdministrationPage"
value, then save the changes.
Step 8: Restart the ONLYOFFICE Groups portal in IIS.
Go to Start -> Control Panel -> Administrative Tools and run the Internet Information Services (IIS) Manager. In the IIS Manager, drop-down the Sites section on the Connections panel. Right-click on the ONLYOFFICE Server website in the list and select the Manage Website -> Restart option.
Step 9: Sign in to the portal
Sign in to the portal using your administrator or owner account.
Step 10: 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.