2019-11-05 20:58:51 +01:00
|
|
|
version: '3.7'
|
|
|
|
|
2022-12-10 18:16:50 +01:00
|
|
|
# https://hub.docker.com/r/mailserver/docker-mailserver
|
|
|
|
# https://docker-mailserver.github.io/docker-mailserver/edge/examples/tutorials/basic-installation/
|
|
|
|
# https://github.com/docker-mailserver/docker-mailserver
|
2022-12-11 00:10:46 +01:00
|
|
|
# https://github.com/docker-mailserver/docker-mailserver/blob/master/docs/content/config/advanced/mail-sieve.md
|
2022-12-10 18:16:50 +01:00
|
|
|
|
|
|
|
# create account: task srv:mail-setup -- email add <user>@<domain>
|
2020-02-04 19:05:07 +01:00
|
|
|
|
2019-11-05 20:58:51 +01:00
|
|
|
networks:
|
|
|
|
mail:
|
|
|
|
name: mail
|
|
|
|
|
|
|
|
services:
|
|
|
|
mail:
|
2023-08-09 21:51:27 +02:00
|
|
|
image: mailserver/docker-mailserver:12
|
2019-12-05 23:02:28 +01:00
|
|
|
container_name: mail
|
2019-12-04 22:00:35 +01:00
|
|
|
restart: "${RESTART:-no}"
|
2023-08-09 21:51:27 +02:00
|
|
|
hostname: post
|
2019-12-05 23:02:28 +01:00
|
|
|
domainname: ${BASE_DOMAIN}
|
2022-12-10 18:16:50 +01:00
|
|
|
environment:
|
|
|
|
- SSL_TYPE=letsencrypt
|
2022-12-22 18:11:48 +01:00
|
|
|
# You may want to enable this: https://docker-mailserver.github.io/docker-mailserver/edge/config/environment/#spoof_protection
|
|
|
|
# See step 8 below, which demonstrates setup with enabled/disabled SPOOF_PROTECTION:
|
|
|
|
- SPOOF_PROTECTION=0
|
2022-12-10 18:16:50 +01:00
|
|
|
# Allow sending emails from other docker containers
|
|
|
|
# Beware creating an Open Relay: https://docker-mailserver.github.io/docker-mailserver/edge/config/environment/#permit_docker
|
2022-12-17 19:20:46 +01:00
|
|
|
- PERMIT_DOCKER=connected-networks
|
2022-12-10 18:16:50 +01:00
|
|
|
- ONE_DIR=1
|
2022-12-22 18:11:48 +01:00
|
|
|
- ENABLE_AMAVIS=0
|
2022-12-10 18:16:50 +01:00
|
|
|
- ENABLE_POSTGREY=0
|
|
|
|
- ENABLE_CLAMAV=0
|
|
|
|
- ENABLE_SPAMASSASSIN=0
|
2023-08-09 21:51:27 +02:00
|
|
|
- ENABLE_MANAGESIEVE=0
|
2022-12-22 18:11:48 +01:00
|
|
|
- ENABLE_FAIL2BAN=0
|
2022-12-10 18:16:50 +01:00
|
|
|
- TZ=${TIMEZONE}
|
2022-12-22 18:11:48 +01:00
|
|
|
- POSTMASTER_ADDRESS=postmaster@${BASE_DOMAIN}
|
2019-11-05 20:58:51 +01:00
|
|
|
ports:
|
2023-08-09 21:51:27 +02:00
|
|
|
- "25:25" # SMTP (explicit TLS => STARTTLS)
|
|
|
|
- "143:143" # IMAP4 (explicit TLS => STARTTLS)
|
|
|
|
- "465:465" # ESMTP (implicit TLS)
|
|
|
|
- "587:587" # ESMTP (explicit TLS => STARTTLS)
|
|
|
|
- "993:993" # IMAP4 (implicit TLS)
|
2022-12-11 00:10:46 +01:00
|
|
|
- "4190:4190" # managesieve
|
2019-11-05 20:58:51 +01:00
|
|
|
volumes:
|
2022-12-10 18:16:50 +01:00
|
|
|
# config
|
|
|
|
- ${BASE_DIR:-/srv}/mail/config:/tmp/docker-mailserver/
|
|
|
|
# Mail data
|
|
|
|
- ${BASE_DIR:-/srv}/mail/mail-data:/var/mail/
|
|
|
|
- ${BASE_DIR:-/srv}/mail/mail-state:/var/mail-state/
|
|
|
|
- ${BASE_DIR:-/srv}/mail/mail-logs:/var/log/mail/
|
|
|
|
# certificates
|
2023-08-09 21:51:27 +02:00
|
|
|
- ${CERTS_DIR}/post.${BASE_DOMAIN}/post.${BASE_DOMAIN}.crt:/etc/letsencrypt/live/post.${BASE_DOMAIN}/fullchain.pem:ro
|
|
|
|
- ${CERTS_DIR}/post.${BASE_DOMAIN}/post.${BASE_DOMAIN}.key:/etc/letsencrypt/live/post.${BASE_DOMAIN}/privkey.pem:ro
|
2022-12-10 18:16:50 +01:00
|
|
|
# - ${CERTS_DIR}/mail.${BASE_DOMAIN}:/etc/letsencrypt/live/
|
2019-11-05 20:58:51 +01:00
|
|
|
networks:
|
|
|
|
- mail
|
2022-12-10 18:16:50 +01:00
|
|
|
# cap_add:
|
|
|
|
# - NET_ADMIN # For Fail2Ban to work
|