mirror of
https://github.com/coollabsio/coolify.git
synced 2026-03-11 08:55:47 +00:00
Merge 3488acff98 into 201998638a
This commit is contained in:
commit
deb7af466e
2 changed files with 94 additions and 0 deletions
1
svgs/docker-mailserver.svg
Normal file
1
svgs/docker-mailserver.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="26 299.2 502.41 369.8"><path fill="#f3ac47" d="M122 490h172l70-27a10 10 0 0 0 6-12l-55-146a10 10 0 0 0-13-5L90 380a10 10 0 0 0-6 12z"/><path fill="#f19a3d" d="m294 490 70-27a10 10 0 0 0 5-5l-149-54-46 86Z"/><path fill="#ffd15c" d="m84 387 150 53 75-140a10 10 0 0 0-7 0L90 380a10 10 0 0 0-6 6z"/><path fill="#303c42" d="M523 462c-1-1-31-20-59-15-7-29-33-47-35-48-4-3-9-2-13 1-2 3-20 23-16 69 1 3 0 7-2 9-1 2-4 3-7 3H36.6c-2.6 0-5.4 1-7.6 3-2 2-3 5-3 8 0 160 117 177 168 177 129 0 219-78 258-148 52-8 74-43 75-45 3-5 1-11-4-14"/><path fill="#42a5f5" d="M445 501c-4 1-7 3-8 6-35 65-120 142-243 142-54 0-142-20-147-147h344c9 0 17-4 23-10 6-7 9-16 8-25-2-21 1-35 4-43 8 7 19 20 19 36 0 4 1 7 5 9 3 2 6 2 10 1 12-7 30-1 42 4-9 10-27 24-57 27"/><path d="M445 491c-4 0-7 2-8 5-35 66-120 142-243 142-52 0-137-18-146-136h-1c5 127 93 147 147 147 123 0 208-77 243-142 1-3 4-5 8-6 30-3 48-17 57-27-3-1-5-2-8-3-10 8-26 17-49 20" opacity=".1"/><circle cx="132" cy="565" r="21" fill="#303c42"/><circle cx="141" cy="559" r="6.76" fill="#fff"/></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
93
templates/compose/docker-mailserver.yaml
Normal file
93
templates/compose/docker-mailserver.yaml
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
# documentation: https://docker-mailserver.github.io/docker-mailserver/latest/
|
||||
# slogan: A fullstack, production-ready, self-hosted mail server (SMTP, IMAP, DKIM, antispam, antivirus, etc.)
|
||||
# category: email
|
||||
# tags: email,mail,smtp,imap,postfix,dovecot,dkim,spf,dmarc,antispam
|
||||
# logo: svgs/docker-mailserver.svg
|
||||
# port: 25
|
||||
|
||||
services:
|
||||
docker-mailserver:
|
||||
image: docker.io/mailserver/docker-mailserver:14.0.0
|
||||
hostname: ${MAIL_HOSTNAME:?mail}
|
||||
domainname: ${MAIL_DOMAIN:?}
|
||||
ports:
|
||||
- "25:25"
|
||||
- "465:465"
|
||||
- "587:587"
|
||||
- "993:993"
|
||||
volumes:
|
||||
- mail-data:/var/mail
|
||||
- mail-state:/var/mail-state
|
||||
- mail-logs:/var/log/mail
|
||||
- mail-config:/tmp/docker-mailserver
|
||||
# Mount Traefik's ACME certificate store (read-only)
|
||||
# DMS natively reads acme.json and auto-reloads on cert renewal
|
||||
- /data/coolify/proxy/acme.json:/etc/letsencrypt/acme.json:ro
|
||||
environment:
|
||||
# Postmaster account — the initial admin mailbox created on first boot
|
||||
- POSTMASTER_ADDRESS=postmaster@${MAIL_DOMAIN:?}
|
||||
- POSTMASTER_PASSWORD=${SERVICE_PASSWORD_POSTMASTER}
|
||||
|
||||
# General configuration
|
||||
- OVERRIDE_HOSTNAME=${MAIL_HOSTNAME:?mail}.${MAIL_DOMAIN:?}
|
||||
- LOG_LEVEL=${LOG_LEVEL:-info}
|
||||
- SUPERVISOR_LOGLEVEL=${SUPERVISOR_LOGLEVEL:-warn}
|
||||
- TZ=${TZ:-UTC}
|
||||
- ONE_DIR=1
|
||||
- PERMIT_DOCKER=none
|
||||
|
||||
# TLS — pre-configured for Coolify's Traefik proxy
|
||||
# DMS reads Traefik's acme.json and extracts the matching certificate
|
||||
- SSL_TYPE=letsencrypt
|
||||
- SSL_DOMAIN=${MAIL_HOSTNAME:?mail}.${MAIL_DOMAIN:?}
|
||||
|
||||
# DKIM / SPF / DMARC
|
||||
- ENABLE_OPENDKIM=${ENABLE_OPENDKIM:-1}
|
||||
- ENABLE_OPENDMARC=${ENABLE_OPENDMARC:-1}
|
||||
- ENABLE_POLICYD_SPF=${ENABLE_POLICYD_SPF:-1}
|
||||
|
||||
# Optional features — disabled by default to save resources
|
||||
- ENABLE_CLAMAV=${ENABLE_CLAMAV:-0}
|
||||
- ENABLE_SPAMASSASSIN=${ENABLE_SPAMASSASSIN:-0}
|
||||
- SPAMASSASSIN_SPAM_TO_INBOX=${SPAMASSASSIN_SPAM_TO_INBOX:-1}
|
||||
- MOVE_SPAM_TO_JUNK=${MOVE_SPAM_TO_JUNK:-1}
|
||||
|
||||
# Fail2Ban — requires NET_ADMIN capability
|
||||
- ENABLE_FAIL2BAN=${ENABLE_FAIL2BAN:-1}
|
||||
|
||||
# Relay host — useful when ISP blocks port 25 outbound
|
||||
- DEFAULT_RELAY_HOST=${DEFAULT_RELAY_HOST:-}
|
||||
|
||||
# Rate limiting
|
||||
- POSTFIX_MESSAGE_SIZE_LIMIT=${POSTFIX_MESSAGE_SIZE_LIMIT:-25600000}
|
||||
- ENABLE_QUOTAS=${ENABLE_QUOTAS:-1}
|
||||
- POSTFIX_MAILBOX_SIZE_LIMIT=${POSTFIX_MAILBOX_SIZE_LIMIT:-0}
|
||||
|
||||
# Fetchmail — pull mail from external accounts
|
||||
- ENABLE_FETCHMAIL=${ENABLE_FETCHMAIL:-0}
|
||||
- FETCHMAIL_POLL=${FETCHMAIL_POLL:-300}
|
||||
|
||||
# ManageSieve — client-side mail filtering rules (Thunderbird, etc.)
|
||||
- ENABLE_MANAGESIEVE=${ENABLE_MANAGESIEVE:-0}
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- SYS_PTRACE
|
||||
entrypoint:
|
||||
- /bin/bash
|
||||
- -c
|
||||
- |
|
||||
# Create the postmaster account on first boot if it does not exist
|
||||
if [ ! -f /tmp/docker-mailserver/postfix-accounts.cf ] || \
|
||||
! grep -q "^postmaster@" /tmp/docker-mailserver/postfix-accounts.cf 2>/dev/null; then
|
||||
setup email add "postmaster@${MAIL_DOMAIN}" "${POSTMASTER_PASSWORD}"
|
||||
fi
|
||||
|
||||
# Start the mail server
|
||||
exec /usr/bin/dumb-init -- supervisord -c /etc/supervisor/supervisord.conf
|
||||
stop_grace_period: 1m
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "ss -tlnp | grep -q ':25 '"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 120s
|
||||
Loading…
Reference in a new issue