From c55ae2d5daf229b12556d6283ba4e5e8161a5eb5 Mon Sep 17 00:00:00 2001 From: yyamashita Date: Mon, 1 Jun 2026 21:14:58 +0900 Subject: Add Postfix+OpenDKIM MTA with txt-based domain management MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - mail/ ディレクトリ追加: Postfix + OpenDKIM の Docker コンテナ - mail/domains.txt で送信ドメインを管理(現在: golive.yyamashita.com) - install.sh が domains.txt から KeyTable/SigningTable を動的生成 - setup-route53.py で SPF/DKIM/DMARC を Route 53 に一括設定 - post-receive フックに mail/deploy.sh を追加 Co-Authored-By: Claude Sonnet 4.6 --- mail/postfix/main.cf | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 mail/postfix/main.cf (limited to 'mail/postfix/main.cf') diff --git a/mail/postfix/main.cf b/mail/postfix/main.cf new file mode 100644 index 0000000..4098668 --- /dev/null +++ b/mail/postfix/main.cf @@ -0,0 +1,34 @@ +# Identity +myhostname = hetzner.yyamashita.com +mydomain = yyamashita.com +myorigin = $myhostname +append_dot_mydomain = no +compatibility_level = 3.6 + +# Accept connections from Docker internal networks only +inet_interfaces = all +inet_protocols = ipv4 +mynetworks = 127.0.0.0/8, 172.16.0.0/12, 10.0.0.0/8 + +# No local delivery — relay only +mydestination = +local_recipient_maps = +local_transport = error:local delivery disabled + +# Relay restrictions: only forward mail from internal networks +smtpd_relay_restrictions = permit_mynetworks, reject +smtpd_recipient_restrictions = permit_mynetworks, reject + +# Opportunistic TLS on outbound SMTP +smtp_tls_security_level = may +smtp_tls_loglevel = 1 + +# DKIM signing via OpenDKIM milter on localhost:8891 +milter_default_action = accept +milter_protocol = 6 +smtpd_milters = inet:localhost:8891 +non_smtpd_milters = inet:localhost:8891 + +# Queue timeouts +maximal_queue_lifetime = 1d +bounce_queue_lifetime = 1d -- cgit v1.2.3