1

I was trying to setup my own mailserver and for some reason or another postfix is unable to resolve names or IP addresses when running in chroot. I tested this on a vanilla Debian Stretch/postfix installation.

My postfix conf:

# 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

The logs:

# /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

I searched the Internet for hours but none of the suggested solutions work:

  • resolv.conf is identical
  • lib_nss* exist
  • ...

Disabling chroot immediately gives me the desired result but I would like to know why it is not working inside chroot. What am I missing?

TylerDurden
  • 191
  • 1
  • 3
  • 14
  • Are you sure that issue in dns resolving? Because from the log - it's not clear and it seems not related to dns issues – ALex_hha Mar 08 '18 at 08:03
  • @ALex_hha I'm pretty sure it is DNS resolving. I also receive this error: `Mar 8 01:04:02 netcup postfix/smtpd[16545]: NOQUEUE: reject: RCPT from unknown[64.20.227.131]: 450 4.7.1 Client host rejected: cannot find your reverse hostname, [64.20.227.131]; from= to= proto=ESMTP helo=` – TylerDurden Mar 08 '18 at 08:58

0 Answers0