https://github.com/iredmail/dockerized
mkdir /iredmail # Create a new directory
cd /iredmail touch iredmail-docker.conf
echo HOSTNAME=mail.mydomain.com >> iredmail-docker.conf
echo FIRST_MAIL_DOMAIN=mydomain.com >> iredmail-docker.conf
echo FIRST_MAIL_DOMAIN_ADMIN_PASSWORD=my-secret-password >> iredmail-docker.conf
echo MLMMJADMIN_API_TOKEN=$(openssl rand -base64 32) >> iredmail-docker.conf
echo ROUNDCUBE_DES_KEY=$(openssl rand -base64 24) >> iredmail-docker.conf
cd /iredmail
mkdir -p data/{backup-mysql,clamav,custom,imapsieve_copy,mailboxes,mlmmj,mlmmj-archive,mysql,sa_rules,ssl,postfix_queue}
docker run
--rm
--name iredmail
--env-file iredmail-docker.conf
--hostname mail.mydomain.com \
-p 80:80
-p 443:443
-p 110:110
-p 995:995
-p 143:143
-p 993:993
-p 25:25
-p 465:465
-p 587:587
-v /iredmail/data/backup-mysql:/var/vmail/backup/mysql
-v /iredmail/data/mailboxes:/var/vmail/vmail1
-v /iredmail/data/mlmmj:/var/vmail/mlmmj
-v /iredmail/data/mlmmj-archive:/var/vmail/mlmmj-archive
-v /iredmail/data/imapsieve_copy:/var/vmail/imapsieve_copy
-v /iredmail/data/custom:/opt/iredmail/custom
-v /iredmail/data/ssl:/opt/iredmail/ssl
-v /iredmail/data/mysql:/var/lib/mysql
-v /iredmail/data/clamav:/var/lib/clamav
-v /iredmail/data/sa_rules:/var/lib/spamassassin
-v /iredmail/data/postfix_queue:/var/spool/postfix
iredmail/mariadb:stable
On first run, it will generate a self-signed ssl cert, this may take a long time, please be patient.
Each time you run the container, few tasks will be ran:
Update SpamAssassin rules.
Update ClamAV virus signature database.
FIRST_MAIL_DOMAIN_ADMIN_PASSWORD is only set/reset on first run, not each run.
All SQL passwords are randomly set/reset by default each time you launch or relaunch the container. If you don't like this, please set fixed passwords in iredmail-docker.conf, e.g. MYSQL_ROOT_PASSWORD=.
Do not forget to setup DNS records for your server hostname and email domain names.
If you're running Docker on Windows and macOS, container will fail to launch and you must switch to docker volumes as described below.
Server hostname. Must be a FQDN. For example, mail.mydomain.com
HOSTNAME=
First mail domain name. For example, mydomain.com.
FIRST_MAIL_DOMAIN=
(Plain) password of mail user postmaster@<FIRST_MAIL_DOMAIN>.
FIRST_MAIL_DOMAIN_ADMIN_PASSWORD=
A secret token used for accessing mlmmjadmin API.
MLMMJADMIN_API_TOKEN=
The secret string used to encrypt/decrypt Roundcube session data.
Required if you need to run Roundcube webmail.
You can generate random string with command openssl rand -base64 24 as the
des key.
Every time this key changed, all Roundcube session data becomes invalid and users will be forced to re-login.
ROUNDCUBE_DES_KEY=
Content type
Image
Digest
Size
198.8 MB
Last updated
about 5 years ago
docker pull 26011998/mailserver