summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authoryyamashita <yyamashita@hetzner.yyamashita.com>2026-06-01 21:21:44 +0900
committeryyamashita <yyamashita@hetzner.yyamashita.com>2026-06-01 21:21:44 +0900
commit647d10c68785bc53453d5054d324a7f69ff3ee2b (patch)
tree62b3b94088ce9a6f27d14015a1adfc11376c6cd5 /mail
parented78863260dedd56152976ebc630229461e2b0a2 (diff)
Fix entrypoint: remove chmod on read-only mount, run opendkim as root
/etc/opendkim が :ro マウントのため chmod/chown が失敗していた問題を修正。 opendkim.conf で UserID root に変更しコンテナ内でルートとして実行する。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'mail')
-rwxr-xr-xmail/entrypoint.sh7
-rw-r--r--mail/opendkim/opendkim.conf2
2 files changed, 3 insertions, 6 deletions
diff --git a/mail/entrypoint.sh b/mail/entrypoint.sh
index 2dc8f26..267ea03 100755
--- a/mail/entrypoint.sh
+++ b/mail/entrypoint.sh
@@ -3,7 +3,7 @@ set -e
KEY_FILE=/etc/opendkim/keys/mail.private
-# Wait for DKIM key (mounted from host)
+# Wait for DKIM key (mounted read-only from host)
for i in $(seq 1 30); do
[[ -f "$KEY_FILE" ]] && break
echo "Waiting for DKIM key at $KEY_FILE ... (run mail/install.sh on host)"
@@ -14,13 +14,10 @@ if [[ ! -f "$KEY_FILE" ]]; then
exit 1
fi
-chmod 600 "$KEY_FILE"
-chown opendkim:opendkim "$KEY_FILE"
-
# Start rsyslog for Postfix logging
rsyslogd
-# Start OpenDKIM (inet socket on localhost:8891)
+# Start OpenDKIM (runs as root per opendkim.conf UserID)
opendkim -x /etc/opendkim.conf
sleep 2
diff --git a/mail/opendkim/opendkim.conf b/mail/opendkim/opendkim.conf
index 81335f4..90bcb6b 100644
--- a/mail/opendkim/opendkim.conf
+++ b/mail/opendkim/opendkim.conf
@@ -6,7 +6,7 @@ Canonicalization relaxed/simple
Mode sv
OversignHeaders From
-UserID opendkim
+UserID root
UMask 022
Socket inet:8891@localhost
PidFile /var/run/opendkim/opendkim.pid