feat(postfix-pgsql): add Dockerfile with templated config and entrypoint

This commit is contained in:
Damien
2026-06-25 11:12:46 +02:00
parent 1af298f74e
commit 8143fff65f
5 changed files with 166 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
# =============================================================================
# Postfix main.cf template
#
# Rendered at container startup by docker-entrypoint.sh, with values
# substituted from environment variables. See README.md for the full list
# of supported variables.
# =============================================================================
myhostname = ${MYHOSTNAME}
mydomain = ${MAIL_DOMAIN}
myorigin = $mydomain
mydestination =
inet_interfaces = all
inet_protocols = ipv4
# Dynamic relay/transport decisions backed by PostgreSQL lookup maps.
relay_domains = pgsql:/etc/postfix/pgsql-relay-domains.cf
transport_maps = pgsql:/etc/postfix/pgsql-transport-maps.cf
# This instance only relays mail for the domains returned by relay_domains;
# it does not accept mail for arbitrary destinations.
smtpd_relay_restrictions = permit_mynetworks, reject_unauth_destination
mynetworks = 127.0.0.0/8, [::1]/128
# TLS
smtpd_tls_cert_file = ${SMTPD_TLS_CERT_FILE}
smtpd_tls_key_file = ${SMTPD_TLS_KEY_FILE}
smtpd_use_tls = yes
smtpd_tls_security_level = may
smtp_tls_security_level = may
# Log to stdout/stderr so `docker logs` captures Postfix activity directly,
# without needing a syslog daemon inside the container.
maillog_file = /dev/stdout
biff = no
append_dot_mydomain = no
readme_directory = no
compatibility_level = 3.6