I was recently modifying a Postfix config to do some debug logging of transactions for a specific IP addresses. To do this, I modified the smtp
and smtps
services in master.cf
to get the most verbose logging possible.
However, I'd failed to remember to encapsulate the IPv6 address with brackets. And so, I got this in the log after restarting Postfix:
Feb 5 18:28:29 l03 postfix/smtpd[21037]: warning: 1111:2222::7777:8888 is unavailable. unsupported dictionary type: 2a04 Feb 5 18:28:29 l03 postfix/smtpd[21037]: warning: 1111:2222::7777:8888: table lookup problem
(To confuse me, that address was also the one listed in a client_checks.cidr
file I'd put together which was also part of my investigation).
And when that client was attempting to connect to send an email, I was seeing this:
Feb 5 18:28:22 l03 postfix/smtpd[20846]: Anonymous TLS connection established from unknown[1111:2222::7777:8888]: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits) Feb 5 18:28:22 l03 postfix/smtpd[20846]: NOQUEUE: reject: RCPT from unknown[1111:2222::7777:8888]: 554 5.7.1 Client host rejected: cannot find your reverse hostname, [1111:2222::7777:8888]; from=<chrisw@example.com> to=<testaddress@example2.com> proto=ESMTP helo=<webmail.example.com> Feb 5 18:28:22 l03 postfix/smtpd[20846]: disconnect from unknown[1111:2222::7777:8888] Feb 5 18:28:29 l03 postfix/smtpd[21037]: error: unsupported dictionary type: 1111 Feb 5 18:28:29 l03 postfix/smtpd[21037]: warning: 1111:2222::7777:8888 is unavailable. unsupported dictionary type: 1111 Feb 5 18:28:29 l03 postfix/smtpd[21037]: warning: 1111:2222::7777:8888: table lookup problem
However, this was actually because of a stupidly simple omission in master.cf
, the non-wrapped IPv6 address. Postfix needs IPv6 addresses to be wrapped in square brackets in master.cf. Oops.
Once I wrapped square brackets around the variables in the smtp
and smtps
services, it looked like this (and the error totally disappeared):
smtp inet n - n - - smtpd -o smtpd_sasl_auth_enable=yes -o debug_peer_level=10 -o debug_peer_list=[1111:2222::7777:8888]
smtps inet n - n - - smtpd
-o debug_peer_level=10 -o debug_peer_list=[1111:2222::7777:8888]
It's always worth checking how to include IPv6 addresses in Postfix. Most cases, it doesn't care, but for master.cf
it's incredibly strict about syntax.