Docker-Mailserver

Docker-Mailserver

Application Docker from Kulisch's Repository

Vue d'ensemble

A production-ready fullstack but simple mail server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.). Only configuration files, no SQL database. Keep it simple and versioned. Easy to deploy and upgrade.

h3 Preperations /h3
This short guide will help you to set up a mailserver.

To keep the mailserver running, there are some important points to consider, like at least one configured mail account, SSL type, hostname, etc.

If these points are missing, they will be mentioned in the Docker logs to simplify troubleshooting.

Make sure, you got an domain and a static IP adress to setup your mailserver.
MX and A DNS entries are needed. After that, portforward the mentioned ports in your router.
h3 Initial steps: /h3

The following placeholders will be used:

b user /b is the mail account you create.

b example.com /b is the domain you are using.

b mail.example.com /bis the FQDN of the mailserver.

b password /bis the password for your mail account./b

  1. At first, setup the b environment variables /b and change b--hostname mail.example.com /b in the b Extra Parameters (advanced view)/b as needed.

Choose custom b Network Type /b and set an fixed IP Adress. (didn't tested other options)

  1. Create an e-mail account by starting the container with bPost arguments /b (advanced view):

bsetup email add user@example.com 'password'/b

bsetup email add admin@company.org 'Ch33rs#M8!' /b (for example)

  1. b Remove the post arguments. /b

  2. Start container and check the logs.

Optional and recommended: Open Container Console and type in...

bsetup config dkim/b

  1. Try to connect to the server with an e-mail client.

  2. Test sending and recieving mails

Optional: If everything works, you can enable bFail2Ban/b in the environment variables

For further informations, visit the extended documention:

https://docker-mailserver.github.io/docker-mailserver/edge/

Arguments d'exécution

Réseau
bridge
Coquille
bash
Privilégié
false
Paramètres supplémentaires
--hostname mail.example.com --restart=unless-stopped --cap-add=NET_ADMIN --cap-add=SYS_PTRACE

Configuration du modèle

Port: SMTPPorttcp

SMTP (explicit TLS => STARTTLS) Port

Cible
25
Défaut
25
Valeur
25
Port: IMAP4Porttcp

IMAP4 (explicit TLS => STARTTLS) Port

Cible
143
Défaut
143
Valeur
143
Port: ESMTPPorttcp

ESMTP (implicit TLS) Port

Cible
465
Défaut
465
Valeur
465
Port: ESMTP (SSL)Porttcp

ESMTP (explicit TLS => STARTTLS) Port

Cible
587
Défaut
587
Valeur
587
Port: IMAP4 (SSL)Porttcp

IMAP4 (implicit TLS) Port

Cible
993
Défaut
993
Valeur
993
MailsPathrw

/var/mail/

Cible
/var/mail/
Défaut
/mnt/user/appdata/dms/mail-data/
Valeur
/mnt/user/appdata/dms/mail-data/
Mail statePathrw

/var/mail-state/

Cible
/var/mail-state/
Défaut
/mnt/user/appdata/dms/mail-state/
Valeur
/mnt/user/appdata/dms/mail-state/
Log filesPathrw

/var/log/mail/

Cible
/var/log/mail/
Défaut
/mnt/user/appdata/dms/mail-log/
Valeur
/mnt/user/appdata/dms/mail-log/
ConfigPathrw

/tmp/docker-mailserver/

Cible
/tmp/docker-mailserver/
Défaut
/mnt/user/appdata/dms/config/
Valeur
/mnt/user/appdata/dms/config/
SSL TypeVariable

bempty/b = SSL disabled b (NOT recommended)/b bletsencrypt/b = Enables Let's Encrypt certificates b (/etc/letsencrypt/live/example.com/) /b bcustom/b = Enables custom certificates bmanual/b = Let's you manually specify locations of your SSL certificates for non-standard cases bself-signed/b= Enables self-signed certificates If bemtpy/b is b not /b choosen, go to = Show more settings...

Cible
SSL_TYPE
Mount SSL PathPathrw

bMounting path/b where certs are stored If bletsencrypt/b is choosen as bSSL Type/b, then path structure bmust/b look like this: Host: /mnt/user/appdata/.../letsencrypt/ Container: /etc/letsencrypt/

Cible
/etc/letsencrypt/
Key pathVariable

This is only supported with b`SSL_TYPE=manual`/b. Provide the path to your bkey/b file that you've mounted access to within the container. Example: /etc/letsencrypt/live/example.com/privkey.pem

Cible
SSL_KEY_PATH
Cert PathVariable

This is only supported with b`SSL_TYPE=manual`/b. Provide the path to your bcert/b file that you've mounted access to within the container. Example: /etc/letsencrypt/live/example.com/fullchain.pem

Cible
SSL_CERT_PATH
PostgreyVariable

Greylist <br> 1 = Enable <br> 0 = Disable

Cible
ENABLE_POSTGREY
Défaut
0
Valeur
1
Fail2BanVariable

Fail2Ban <br> 1 = Enable <br> 0 = Disable

Cible
ENABLE_FAIL2BAN
Défaut
0
Valeur
0
ClamAVVariable

ClamAV <br> 1 = Enable <br> 0 = Disable

Cible
ENABLE_CLAMAV
Défaut
1
Valeur
1
Max mail sizeVariable

empty => 10240000 (~10 MB)

Cible
POSTFIX_MESSAGE_SIZE_LIMIT
Défaut
10240000
Valeur
10240000
LocaltimePathro

Localtime

Cible
/etc/localtime
Défaut
/etc/localtime
Valeur
/etc/localtime
SPAMASSASSINVariable

Spamassassin <br> 1 = Enable <br> 0 = Disable

Cible
ENABLE_SPAMASSASSIN
Défaut
1
Valeur
1
Single state directoryVariable

0 => mail state in default directories <br> 1 => consolidate all states into a single directory (`/var/mail-state`) to allow persistence using docker volumes

Cible
ONE_DIR
Défaut
1
Valeur
1
Spam to inboxVariable

deliver spam messages in the inbox <br> 1 = Enable <br> 0 = Disable

Cible
SPAMASSASSIN_SPAM_TO_INBOX
Défaut
0
Valeur
1
Port: ManagesievePorttcp

Managesieve

Cible
4190
Défaut
4190
Valeur
4190
ManagesieveVariable

Managesieve <br> 1 = Enable <br> 0 = Disable

Cible
ENABLE_MANAGESIEVE
Défaut
0
Valeur
1

Catégories

Télécharger les statistiques

11,755,491
Total des téléchargements
102,653
Ce mois-ci
117,284
Moyenne / Mois

Total des téléchargements au fil du temps

Chargement du graphique...

Détails

Référentiel
mailserver/docker-mailserver:latest
Dernière mise à jour2026-05-08
Première vue2022-04-27

Exécutez Docker-Mailserver sur Unraid.

Docker-Mailserver est listé dans Community Apps pour Unraid OS. Explorez Unraid pour créer un serveur domestique flexible, un NAS ou un laboratoire domestique.