diff options
| author | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-06-01 21:33:02 +0900 |
|---|---|---|
| committer | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-06-01 21:33:02 +0900 |
| commit | 72799dd59da44269107fe3e651e7566042002709 (patch) | |
| tree | c032cc5758e79920c8c4a5a65e3e3302b77f1fd8 | |
| parent | 15e286a5a8490960d0f94a0c22bba67912f1cdb6 (diff) | |
entrypoint: copy resolv.conf etc into Postfix chroot before start
smtp プロセスは chroot 環境で動くため /etc/resolv.conf が見えず
MX ルックアップが失敗していた。chroot (/var/spool/postfix/etc/) に
resolv.conf / hosts / services / nsswitch.conf をコピーして解決。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| -rwxr-xr-x | mail/entrypoint.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mail/entrypoint.sh b/mail/entrypoint.sh index 8bd6ea1..9ba6655 100755 --- a/mail/entrypoint.sh +++ b/mail/entrypoint.sh @@ -27,6 +27,14 @@ rsyslogd opendkim -x /etc/opendkim.conf sleep 2 +# Postfix の smtp プロセスは chroot で動くため /var/spool/postfix/etc/ に +# resolv.conf 等を配置しないと DNS 名前解決ができない +mkdir -p /var/spool/postfix/etc +cat /etc/resolv.conf > /var/spool/postfix/etc/resolv.conf +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 + # Start Postfix postfix start |
