agentic.email/deploy/smtp/docker-compose.yml
2026-10-04 14:40:06 +05:30

43 lines
1.3 KiB
YAML

# Postfix — inbound (:25 from internet) + outbound (trusted Docker clients).
# Included by root docker-compose.yml on the same host as the app.
#
# Inbound: transport map → backend:2525
# Outbound: backend submits to smtp:25 (mynetworks)
services:
smtp:
build:
context: ../../smtp
container_name: agmail-smtp
restart: unless-stopped
hostname: ${MAIL_HOSTNAME:-mail.gentic.email}
environment:
MAIL_HOSTNAME: ${MAIL_HOSTNAME:-mail.gentic.email}
MAIL_DOMAIN: ${MAIL_DOMAIN:-gentic.email}
INBOUND_DOMAINS: ${INBOUND_DOMAINS:-gentic.email}
RELAY_DOMAINS_FILE: /data/relay_domains/domains.list
RELAY_DOMAINS_REFRESH: ${RELAY_DOMAINS_REFRESH:-60}
BACKEND_INGEST_HOST: ${BACKEND_INGEST_HOST:-backend}
BACKEND_INGEST_PORT: ${BACKEND_INGEST_PORT:-2525}
ports:
- "${SMTP_INBOUND_PORT:-25}:25"
volumes:
- smtp_queue:/var/spool/postfix
- relay_domains_data:/data/relay_domains
depends_on:
backend:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "postfix status >/dev/null 2>&1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "5"
volumes:
smtp_queue: