IREDDOCKER

This is the iRedMail docker image with included external ldap authentication and ability of usage an external mysql database.

Install

Clone git repository to local folder

git clone https://gitlab.resds.ru/temasky/ireddocker.git

Configure

Config on slave server

  1. If you need to enable replication of mysql server, you need to run preconfigured mysql slave container on slave server. To do this, create config file with parameters for mysql slave server:
cat <<EOF > slave.cnf

[mysqld]

server-id       = 102
log_bin = /var/log/mysql/mysql-bin.log
relay-log = /var/log/mysql/mysql-relay-bin.log
binlog_do_db = amavisd
binlog_do_db = iredadmin
binlog_do_db = iredapd
binlog_do_db = roundcubemail
bind-address    = 0.0.0.0

EOF

... and run container from this directory:

docker run --name slave-mariadb -v ./slave.cnf:/etc/mysql/conf.d/slave.cnf -e MYSQL_ROOT_PASSWORD=(the sama password as in master server) -d -p <external port>:3306 mariadb:latest

In most cases public port you need is set to 3306 too, but if you need to change this, set custom port in filed <external port>, and set this in envfiles/iredmail-env.conf in field MYSQL_SLAVE_PORT=

Config on master server

  1. add FQDN name in docker-compose.yml file(in filed hostname), and set non default mariadb port too<external port>:3306.

  2. create file envfiles/iredmail-env.conf for iredmail, like this:

cat <<EOF > envfiles/iredmail-env.conf
#USE OR NOT EXTERNAL DATABASE. Default: NO
LDAP_EXTERNAL_USE=YES
#ldap server address. Default: 127.0.0.1
LDAP_EXTERNAL_SERVER=
#bind password for ldap. Default: random
LDAP_EXTERNAL_BINDPW=
#bind user for ldap Default: vmail
LDAP_EXTERNAL_BINDUSER=
#base dn for mail users. Default cn=users,dc=example,dc=com 
LDAP_EXTERNAL_BASE=
#mail domain name. Default: example.com
FIRST_DOMAIN=
#usage existing databse. Default: NO
MYSQL_EXTERNAL=
#USE OR NOT EXTERNAL DATABASE REPLICATION. Default: NO
MYSQL_USE_REPLICTION=
#address of master server in case of replication. Default 127.0.0.1
MYSQL_MASTER_ADDRESS=
#port of master server in case of replication. Default: 3306
MYSQL_MASTER_PORT=
#address of slave server in case of replication. Default: 127.0.0.1
MYSQL_SLAVE_ADDRESS=
#port of slave server in case of replication. Default: 3306
MYSQL_SLAVE_PORT=
#MYSQL DATABASES FOR REPLICATION. Default: amavis iredadmin iredapd roundcubemail
MYSQL_DATABASES=amavis iredadmin iredapd roundcubemail
#name for admin(root) user of external database. Default: root
MYSQL_ROOT_USER=
#passwd for admin(root) user of external database. Default: random
MYSQL_ROOT_PASSWD=
#usage of external cert file. If Yes - place certfile in cert_dir directory, in global catalog. Default: NO
CUSTOM_CERT_USE=
#Name of external key file. Default: preivkey.pem
CUSTOM_CERT_KEYFILE=
#Name of external cert file. Default: fullchain.pem
CUSTOM_CERT_CERTFILE=
EOF
  1. create file envfiles/mariadb-env.conf for mariadb, like this:
cat <<EOF > envfiles/mariadb-env.conf
#root password for database(the same as MYSQL_ROOT_PASSWD in iredmail env file)
MYSQL_ROOT_PASSWORD=
EOF
  1. Create directory for mail and for certificates (default is mail_dir, cert_dir and conf_dir . For other location this filder need to be change in docker-compose.yml file )
mkdir conf_dir
mkdir mail_dir
mkdir cert_dir

RUN

docker-compose up -d

USAGE

At the first boot system spend mutch time to initialize, configure required components, load required files. When initialization is finished, you can see two file in conf_dir:

  1. config - file with all used passwords and configs in system

  2. access - file, with admin account - postmaster@

S
Description
No description provided
Readme
380 KiB
Languages
Shell 83.9%
Python 7.1%
PLpgSQL 6.1%
Go Template 1.9%
PHP 0.7%
Other 0.3%