Lightweight Mailserver in Docker
The server part is a docker image made of multiple services supervized by s6. It includes:
- Postfix
- Dovecot
- SpamAssassin
- OpenDKIM
- OpenDMARC
- Web-UI dashboard (optional)
Check out the example docker-compose.yml for a full setup behind Traefik
latest- for the latest versionbranch- for the latest version on that branchsha1short- exact commitv1.2.3- exact release version (stable)v1.2- major release version (stable)
For a variant with dashboard append "-dashboard" to one of the above.
POCKER_SUBDOMAIN- your mail subdomain - example:mailPOCKER_DOMAIN- your mail domain - example:example.comPOCKER_TRUSTED_PROXIES- space separated list of trusted proxy ips or hostnames (usually a container name of proxy container on the same docker network) - example:192.168.0.123 traefik haproxy
*-dashboard only:
POCKER_PAGE_TITLE- title of the optional dashboard - example:Pocker DashboardPOCKER_LOGO_URL- link to the logo image of your choice - example:https://some.website.com/image.png
Bind mount the following directories to your host or use a named volume if you preffer:
/etc/letsencrypt/live- letsencrypt directory (expects certbot-like format)/var/mail- location of actual mail/etc/userfiles- for persistent users (mount and don't touch)/etc/opendkim/keys- it makes sense to keep opendkim keys persistent across container restarts
For more information refer to the example docker-compose.yml.
If you chose to use the *-dashboard variant the image, there is a web-UI running on localhost:8080/dashboard.
If you don't want a dashboard, just use the basic tools to do the job. e.g.:
# Make sure the user is in the mail group
docker exec -it useradd -m -G mail john
# add password to the user
docker exec -it passwd john