在 Debian Stretch 上的 chroot 中运行时,Postfix 无法解析 IP 地址

在 Debian Stretch 上的 chroot 中运行时,Postfix 无法解析 IP 地址

我尝试设置自己的邮件服务器,但由于某种原因,postfix 在 chroot 中运行时无法解析名称或 IP 地址。我在 vanilla Debian Stretch/postfix 安装上对此进行了测试。

我的 postfix 配置:

# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
compatibility_level = 2
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
mydestination = $myhostname, mail.querco.org, localhost.querco.org, localhost
myhostname = mail.querco.org
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes

日志:

# /var/log/mail.log
Mar  8 01:34:58 netcup postfix/smtpd[3915]: connect from unknown[64.20.227.138]
Mar  8 01:34:58 netcup postfix/smtpd[3915]: match_list_match: unknown: no match
Mar  8 01:34:58 netcup postfix/smtpd[3915]: match_list_match: 64.20.227.138: no match
Mar  8 01:34:58 netcup postfix/smtpd[3915]: match_list_match: unknown: no match
Mar  8 01:34:58 netcup postfix/smtpd[3915]: match_list_match: 64.20.227.138: no match
Mar  8 01:34:58 netcup postfix/smtpd[3915]: smtp_stream_setup: maxtime=300 enable_deadline=0
Mar  8 01:34:58 netcup postfix/smtpd[3915]: match_hostname: smtpd_client_event_limit_exceptions: unknown ~? 127.0.0.0/8
Mar  8 01:34:58 netcup postfix/smtpd[3915]: match_hostaddr: smtpd_client_event_limit_exceptions: 64.20.227.138 ~? 127.0.0.0/8
Mar  8 01:34:58 netcup postfix/smtpd[3915]: match_hostname: smtpd_client_event_limit_exceptions: unknown ~? [::ffff:127.0.0.0]/104
Mar  8 01:34:58 netcup postfix/smtpd[3915]: match_hostaddr: smtpd_client_event_limit_exceptions: 64.20.227.138 ~? [::ffff:127.0.0.0]/104
Mar  8 01:34:58 netcup postfix/smtpd[3915]: match_hostname: smtpd_client_event_limit_exceptions: unknown ~? [::1]/128
Mar  8 01:34:58 netcup postfix/smtpd[3915]: match_hostaddr: smtpd_client_event_limit_exceptions: 64.20.227.138 ~? [::1]/128
Mar  8 01:34:58 netcup postfix/smtpd[3915]: match_list_match: unknown: no match
Mar  8 01:34:58 netcup postfix/smtpd[3915]: match_list_match: 64.20.227.138: no match

我在网上搜索了几个小时,但没有一个建议的解决方案起作用:

  • resolv.conf相同
  • lib_nss*存在
  • ...

禁用 chroot 后,我​​立即得到了想要的结果,但我想知道为什么它在内部不起作用chroot。我遗漏了什么?

相关内容