summaryrefslogtreecommitdiff
path: root/mail/entrypoint.sh
diff options
context:
space:
mode:
authoryyamashita <yyamashita@hetzner.yyamashita.com>2026-06-01 21:42:57 +0900
committeryyamashita <yyamashita@hetzner.yyamashita.com>2026-06-01 21:42:57 +0900
commit1b3eded34ae693b8662487b9c54a21e4fec1b07f (patch)
tree382097b01569dce3b45d7a7fcb2a67968c7a5f64 /mail/entrypoint.sh
parent72799dd59da44269107fe3e651e7566042002709 (diff)
Configure Amazon SES relay for Postfix (port 25 blocked by Hetzner)
SES credentials are injected via .env file (not committed). entrypoint.sh creates sasl_passwd at runtime from SES_ACCESS_KEY_ID / SES_SMTP_PASSWORD. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'mail/entrypoint.sh')
-rwxr-xr-xmail/entrypoint.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/mail/entrypoint.sh b/mail/entrypoint.sh
index 9ba6655..45798fe 100755
--- a/mail/entrypoint.sh
+++ b/mail/entrypoint.sh
@@ -35,6 +35,13 @@ cp -f /etc/hosts /var/spool/postfix/etc/hosts 2>/dev/null || true
cp -f /etc/services /var/spool/postfix/etc/services 2>/dev/null || true
cp -f /etc/nsswitch.conf /var/spool/postfix/etc/nsswitch.conf 2>/dev/null || true
+# Create sasl_passwd for SES relay from environment variables
+if [[ -n "${SES_ACCESS_KEY_ID:-}" && -n "${SES_SMTP_PASSWORD:-}" ]]; then
+ echo "[email-smtp.us-east-1.amazonaws.com]:587 ${SES_ACCESS_KEY_ID}:${SES_SMTP_PASSWORD}" > /etc/postfix/sasl_passwd
+ chmod 600 /etc/postfix/sasl_passwd
+ postmap /etc/postfix/sasl_passwd
+fi
+
# Start Postfix
postfix start