Artículos con :
Cerrar
Changelog
Cerrar
Centro de ayuda
Mail Server for Docker

Updating Mail Server integrated with Community Server

Mail Serverv.1.5 - Mail Serverv.1.6 Mail Server changelog

Version 1.6.25

Release date: 07/03/2017

Runtime

  • Updated OpenSSL to the latest version (1.0.2).

Version 1.6.21

Release date: 04/26/2017

Runtime

  • Fixed the issue when the amavisd-new interface could not start without the properly configured IPv6.

Version 1.6.20

Release date: 12/13/2016

Connection Settings

  • Added page to the Settings for the integration of Community Server (Windows version) with Mail Server.

Installation Script

  • Fixed the error shown if the mail domain is not specified, now Mail Server will not be installed if this is the case.

Version 1.6.7

Release date: 06/22/2016

Refactoring

  • Removed version from the iRedMail folder;
  • iRedMail completed with commits from v.0.9.2;
  • Deleted unused packages from iRedMail;
  • Added the SpamAssassin setup with initial bayes_tokens.

Runtime

  • Fixed the incorrect MySQL server name in the config;
  • Fixed the issue with the config section duplication when starting the Docker container;
  • Fixed the issue with sending mail to a group/alias address;
  • Fixed the startup API issue.

Logging

  • Fixed logging during the installation.

Networking

  • Fixed the fail2ban and iptables issue when starting Docker in a network mode;
  • Fixed the issue with Mail Server on an external physical server.

Version 1.6.0

Release date: 03/09/2016

Settings

  • Redesigned Mail Server settings page.

Version 1.5.0

Release date: 04/20/2015

Mail Server

  • Mail Server for Docker first release.

Introduction

Mail Server for Docker files can be found here:
https://hub.docker.com/r/onlyoffice/mailserver/

Starting from version 9.1, Community Server uses MySQL v. 5.7 instead of MySQL v. 5.5 that had been used in earlier versions. Besides, a different installation scheme is used when MySQL is running in a separate container. If your current portal version has been installed using the old installation scheme, the Mail Server database is located within the Mail Server container and the Community Server database is in the Community Server container. According to the new installation scheme, the MySQL container contains both the Community Server database (named 'onlyoffice') and the Mail Server database (named 'onlyoffice_mailserver').

The first section of this article describes the update procedure for old versions that have been installed using the old installation scheme with MySQL databases located within the Mail Server/Community Server containers.

If you want to update your Mail Server integrated with an old Community Server version (lower than 9.1) to the latest available version that uses MySQL v. 5.7 running in a separate container, please refer to the second section.

Updating to versions that use MySQL 5.5 within the Mail Server/Community Server containers

Step 1: Check if all the external data storage folders are mounted

Make sure that all the container volumes used to store Mail Server data are mounted using the following command:

sudo docker inspect --format='{{range $p,$conf:=.HostConfig.Binds}}{{$conf}};{{end}}' {{MAIL_SERVER_ID}}

where {{MAIL_SERVER_ID}} stands for the Mail Server container name or ID.

You can easily find out the current Mail Server container name or ID using the Docker command which will list all the existing containers:
docker ps -a

You can backup the mounted folders located on the host machine, as a precaution:

  • /app/onlyoffice/MailServer/logs
  • /app/onlyoffice/MailServer/mysql
  • /app/onlyoffice/MailServer/data
  • /app/onlyoffice/MailServer/data/certs

In case you have not mounted the folders during the Mail Server installation, you will need to perform the backup of the following folders within the Docker container:

  • /var/log that contains Mail Server logs
  • /var/lib/mysql that contains MySQL database data
  • /var/vmail that contains mail storage
  • /etc/pki/tls/mailserver that contains certificates

You can copy these data folders from the Docker container to a folder on your host machine:

sudo docker cp {{MAIL_SERVER_ID}}:var/log /home/user/Backup/MailServer/log
sudo docker cp {{MAIL_SERVER_ID}}:var/lib/mysql /home/user/Backup/MailServer/mysql
sudo docker cp {{MAIL_SERVER_ID}}:var/vmail /home/user/Backup/MailServer/vmail
sudo docker cp {{MAIL_SERVER_ID}}:etc/pki/tls/mailserver /home/user/Backup/MailServer/mailserver

Where {{MAIL_SERVER_ID}} stands for the Mail Server container name or ID and /home/user/Backup/MailServer stands for a path to any folder on your host machine.

Step 2: Remove the current container
sudo docker rm -f {{MAIL_SERVER_ID}}

where {{MAIL_SERVER_ID}} stands for the Mail Server container name or ID.

Step 3: Remove the current image

The image used to install Mail Server also needs to be removed, otherwise it will be used to install it anew and no upgrade will happen:

sudo docker rmi -f $(sudo docker images | grep onlyoffice/mailserver | awk '{ print $3 }')
Step 4: Run the new Mail Server image with the same map paths

Create a network for Docker containers if it had not been created for the previous version:

docker network create --driver bridge onlyoffice

Run the new Mail Server image:

sudo docker run --net onlyoffice --privileged -i -t -d --restart=always --name onlyoffice-mail-server \
    -p 25:25 -p 143:143 -p 587:587 \
    -v /app/onlyoffice/MailServer/data:/var/vmail \
    -v /app/onlyoffice/MailServer/data/certs:/etc/pki/tls/mailserver \
    -v /app/onlyoffice/MailServer/logs:/var/log \
    -v /app/onlyoffice/MailServer/mysql:/var/lib/mysql \
    -h yourdomain.com \
    onlyoffice/mailserver

Where yourdomain.com is your mail server hostname.

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 Mail Server is installed).
In the command above, the "yourdomain.com" 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 "yourdomain.com" looks like mx1.onlyoffice.com

Make sure that you run the new image with the folder paths mapped exactly as they had been mounted before you deleted Mail Server image, otherwise the data stored in these folders will not be picked up automatically.

If you have not mounted the folders during the previous version installation, you will need to restore data manually before installing the Mail Server new version. To do that you can copy the backup data from the folders on your host machine to the new folders on the host that will be mounted during the further installation:

sudo mkdir -p /app/onlyoffice/MailServer/logs && sudo cp -a /home/user/Backup/MailServer/log/. $_
sudo mkdir -p /app/onlyoffice/MailServer/mysql && sudo cp -a /home/user/Backup/MailServer/mysql/. $_
sudo mkdir -p /app/onlyoffice/MailServer/data && sudo cp -a /home/user/Backup/MailServer/vmail/. $_
sudo mkdir -p /app/onlyoffice/MailServer/data/certs && sudo cp -a /home/user/Backup/MailServer/mailserver/. $_

Where /home/user/Backup/MailServer stands for a path to any folder on your host machine. When the backup is restored, install Mail Server as described above.

Step 5: Run the Document Server & Community Server images with the same map paths

Run a new Document Server container and then the Community Server container connecting them as described here. When running the containers, you will also need to mount data folders exactly as they had been mounted in the previous version.

Now you can run the portal and check the data for consistency and correct work.

Updating to the latest version that uses MySQL 5.7 within a separate container

To update your Mail Server integrated with an old Community Server version (lower than 9.1) to the newest version you'll need to make a dump for both the Mail Server and Community Server MySQL databases and then restore them in the corresponding databases within a new MySQL container. Restoring the Mail Server backup data should be performed before installing the new version of Mail Server.

Instructions on how to update Community Server are available here.

Step 1: Backup data

Enter the Mail Server container:

sudo docker exec -it onlyoffice-mail-server bash

Create the 'onlyoffice_mailserver' database dump:

mysqldump -u root -pIsadmin123 onlyoffice_mailserver > dump_mailserver.sql

Exit from the container:

exit

Copy the dump file to the host computer:

sudo docker cp onlyoffice-mail-server:/dump_mailserver.sql /home/user/

Additionally, you can backup the /var/log, /var/vmail, /etc/pki/tls/mailserver folders as it is described in the previous section of this guide (step 1).

Step 2: Remove the current Mail Server container and image
sudo docker rm -f onlyoffice-mail-server
sudo docker rmi -f $(sudo docker images | grep onlyoffice/mailserver | awk '{ print $3 }')
Step 3: Restore data folders

If necessary, restore the /var/log, /var/vmail, /etc/pki/tls/mailserver data folders as it is described in the previous section of this guide (step 4).

You can skip this step if you've mapped data folders during the previous version installation.

Step 4: Install prerequisites

Install prerequisites following these instructions.

Step 5: Install MySQL

Install MySQL following these instructions.

Step 6: Restore the 'onlyoffice_mailserver' database dump.

Copy the dump file into the MySQL container:

sudo docker cp /home/user/dump_mailserver.sql onlyoffice-mysql-server:/dump_mailserver.sql

Enter the MySQL container:

sudo docker exec -it onlyoffice-mysql-server bash

Create the 'onlyoffice_mailserver' database:

mysql -u root -pmy-secret-pw -e "CREATE DATABASE onlyoffice_mailserver"

Restore the dump:

mysql -u root -pmy-secret-pw onlyoffice_mailserver < dump_mailserver.sql

Exit from the container:

exit
Step 7: Install new ONLYOFFICE version

Install new versions of Document Server, Mail Server, Community Server following these instructions.

Download Host on your own server Available for Docker,
Windows, Linux and virtual machines
También le podría gustar:
Cerrar