postfix-tlspol 1.11.0: DANE policy lookup fails when one MX target has no A/AAAA, causing client TLS configuration problem
Contribution guidelines
- I've read the contribution guidelines and wholeheartedly agree
Checklist prior issue creation
- I understand that failure to follow below instructions may cause this issue to be closed.
- I understand that vague, incomplete or inaccurate information may cause this issue to be closed.
- I understand that this form is intended solely for reporting software bugs and not for support-related inquiries.
- I understand that all responses are voluntary and community-driven, and do not constitute commercial support.
- I confirm that I have reviewed previous issues to ensure this matter has not already been addressed.
- I confirm that my environment meets all prerequisite requirements as specified in the official documentation.
Description
After updating/running mailcow with postfix-tlspol 1.11.0, outgoing mail to some recipient domains is deferred with:
socketmap:inet:postfix-tlspol:8642:QUERYwithTLSRPT socketmap server temporary error smtp_tls_policy_maps, next-hop destination "...": policy table lookup error TLS policy lookup ...: client TLS configuration problem
The corresponding postfix-tlspol logs show:
DNS error during DANE lookup error="DNS error during MX address lookup" Evaluating policy failed temporarily
The issue seems to occur when the recipient domain publishes multiple MX records and at least one MX target has no A or AAAA address, even though another valid MX with a better preference exists and is fully resolvable.
Three reproducible examples:
- vipel.ind.br
MX: 5 mail.vipel.ind.br. 999 ms44749518.msv1.invalid.
mail.vipel.ind.br resolves correctly: 189.42.0.5
ms44749518.msv1.invalid has no A/AAAA.
postfix-tlspol repeatedly reports: DNS error during DANE lookup domain=vipel.ind.br error="DNS error during MX address lookup"
The policy evaluation then fails temporarily and Postfix defers the message with DSN 4.7.5.
- bertco.com.br
The domain has normal working Google Workspace MX records:
1 aspmx.l.google.com. 5 alt1.aspmx.l.google.com. 5 alt2.aspmx.l.google.com. 10 alt3.aspmx.l.google.com. 10 alt4.aspmx.l.google.com.
All those hosts resolve correctly.
However, it also publishes:
15 etuobsol4rmswlobummm6h6lw7nodmv6hypjira6uo4ab3jvowwq.mx-verification.google.com.
That verification MX has no A/AAAA.
postfix-tlspol reports the same: DNS error during DANE lookup error="DNS error during MX address lookup"
Postfix then returns: client TLS configuration problem
- forbo-siegling.com.br
MX: 0 forbosiegling-com-br01c.mail.protection.outlook.com. 10 mail.forbo-siegling.com.br.
The Exchange Online MX resolves correctly to IPv4 and IPv6 addresses.
mail.forbo-siegling.com.br has no A or AAAA.
Again postfix-tlspol reports: DNS error during DANE lookup error="DNS error during MX address lookup"
and the complete TLS policy evaluation fails temporarily.
Direct DNS queries against mailcow's unbound container return the MX sets correctly, and the valid MX hosts resolve normally.
Other domains such as gmail.com are evaluated successfully by postfix-tlspol at the same time, so this does not appear to be a general DNS resolver failure.
Expected behavior:
If a domain has multiple MX records and one MX target cannot be resolved to A/AAAA, postfix-tlspol should still be able to evaluate and return a policy for the remaining usable MX hosts.
An unusable secondary/verification MX should not cause the complete destination policy lookup to return a temporary error when a valid MX exists.
Actual behavior:
A single MX target without A/AAAA appears to cause the DANE MX address lookup to fail for the whole domain, resulting in:
smtp_tls_policy_maps policy table lookup error client TLS configuration problem DSN 4.7.5
and the message remains deferred.
Steps to reproduce:
- Use mailcow with postfix-tlspol 1.11.0:
ghcr.io/mailcow/postfix-tlspol:1.11.0
- Send an email to a domain having multiple MX records where:
- at least one MX resolves normally to A/AAAA;
- another MX target has no A/AAAA.
Example: vipel.ind.br
- Check postfix logs.
Observed:
warning: socketmap:inet:postfix-tlspol:8642:QUERYwithTLSRPT socketmap server temporary error warning: smtp_tls_policy_maps, next-hop destination "VIPEL.IND.BR": policy table lookup error warning: TLS policy lookup for VIPEL.IND.BR/mail.VIPEL.IND.BR: client TLS configuration problem
status=deferred dsn=4.7.5
- Check postfix-tlspol logs.
Observed:
DNS error during DANE lookup domain=vipel.ind.br error="DNS error during MX address lookup"
Evaluating policy failed temporarily
- Query the same domain directly through the mailcow Unbound container.
The domain MX lookup succeeds and the preferred MX mail.vipel.ind.br resolves normally to 189.42.0.5.
The secondary MX ms44749518.msv1.invalid does not resolve to A/AAAA.
Logs:
Postfix:
warning: socketmap:inet:postfix-tlspol:8642:QUERYwithTLSRPT socketmap server temporary error
warning: socketmap:inet:postfix-tlspol:8642:QUERYwithTLSRPT lookup error for "VIPEL.IND.BR"
warning: smtp_tls_policy_maps, next-hop destination "VIPEL.IND.BR": policy table lookup error
warning: TLS policy lookup for VIPEL.IND.BR/mail.VIPEL.IND.BR: client TLS configuration problem
F009DA01FE: to=<[email protected]>, relay=none, dsn=4.7.5,
status=deferred (client TLS configuration problem)
postfix-tlspol:
level=WARN msg="DNS error during DANE lookup"
domain=vipel.ind.br
error="DNS error during MX address lookup"
attempts=3
level=WARN msg="Evaluating policy failed temporarily"
origin=network
domain=vipel.ind.br
ttl=0Which branch are you using?
master (stable)
Which architecture are you using?
x86_64
Operating System:
Debian GNU/Linux 12 (bookworm)
Server/VM specifications:
8 CPU cores, 8 GB RAM
Is Apparmor, SELinux or similar active?
AppArmor: active
Virtualization technology:
KVM
Docker version:
29.8.1
docker-compose version or docker compose version:
v5.5.1
mailcow version:
2026-09
Reverse proxy:
nginx (external reverse proxy)
Logs of git diff:
Logs of iptables -L -vn:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
61M 66G MAILCOW 0 -- * * 0.0.0.0/0 0.0.0.0/0 /* mailcow */
92M 100G DOCKER-USER 0 -- * * 0.0.0.0/0 0.0.0.0/0
92M 100G DOCKER-FORWARD 0 -- * * 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain DOCKER (2 references)
pkts bytes target prot opt in out source destination
2714 143K ACCEPT 6 -- !br-mailcow br-mailcow 0.0.0.0/0 172.22.1.253 tcp dpt:587
1841 105K ACCEPT 6 -- !br-mailcow br-mailcow 0.0.0.0/0 172.22.1.253 tcp dpt:465
2744 161K ACCEPT 6 -- !br-mailcow br-mailcow 0.0.0.0/0 172.22.1.253 tcp dpt:25
43338 2596K ACCEPT 6 -- !br-mailcow br-mailcow 0.0.0.0/0 172.22.1.11 tcp dpt:443
11879 709K ACCEPT 6 -- !br-mailcow br-mailcow 0.0.0.0/0 172.22.1.11 tcp dpt:80
0 0 ACCEPT 6 -- !br-mailcow br-mailcow 0.0.0.0/0 172.22.1.250 tcp dpt:12345
0 0 ACCEPT 6 -- !br-mailcow br-mailcow 0.0.0.0/0 172.22.1.250 tcp dpt:4190
19864 1034K ACCEPT 6 -- !br-mailcow br-mailcow 0.0.0.0/0 172.22.1.250 tcp dpt:995
51433 3179K ACCEPT 6 -- !br-mailcow br-mailcow 0.0.0.0/0 172.22.1.250 tcp dpt:993
0 0 ACCEPT 6 -- !br-mailcow br-mailcow 0.0.0.0/0 172.22.1.250 tcp dpt:143
0 0 ACCEPT 6 -- !br-mailcow br-mailcow 0.0.0.0/0 172.22.1.250 tcp dpt:110
0 0 ACCEPT 6 -- !br-mailcow br-mailcow 0.0.0.0/0 172.22.1.5 tcp dpt:3306
0 0 ACCEPT 6 -- !br-mailcow br-mailcow 0.0.0.0/0 172.22.1.249 tcp dpt:6379
0 0 DROP 0 -- !docker0 docker0 0.0.0.0/0 0.0.0.0/0
0 0 DROP 0 -- !br-mailcow br-mailcow 0.0.0.0/0 0.0.0.0/0
Chain DOCKER-BRIDGE (1 references)
pkts bytes target prot opt in out source destination
0 0 DOCKER 0 -- * docker0 0.0.0.0/0 0.0.0.0/0
134K 7926K DOCKER 0 -- * br-mailcow 0.0.0.0/0 0.0.0.0/0
Chain DOCKER-CT (1 references)
pkts bytes target prot opt in out source destination
0 0 ACCEPT 0 -- * docker0 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
36M 5719M ACCEPT 0 -- * br-mailcow 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
Chain DOCKER-FORWARD (1 references)
pkts bytes target prot opt in out source destination
92M 100G DOCKER-CT 0 -- * * 0.0.0.0/0 0.0.0.0/0
36M 91G DOCKER-INTERNAL 0 -- * * 0.0.0.0/0 0.0.0.0/0
36M 91G DOCKER-BRIDGE 0 -- * * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT 0 -- docker0 * 0.0.0.0/0 0.0.0.0/0
25M 60G ACCEPT 0 -- br-mailcow * 0.0.0.0/0 0.0.0.0/0
Chain DOCKER-INTERNAL (1 references)
pkts bytes target prot opt in out source destination
Chain DOCKER-USER (1 references)
pkts bytes target prot opt in out source destination
Chain MAILCOW (1 references)
pkts bytes target prot opt in out source destination
23 1199 DROP 0 -- * * 38.60.209.145 0.0.0.0/0
0 0 DROP 6 -- !br-mailcow br-mailcow 0.0.0.0/0 0.0.0.0/0 /* mailcow isolation */Logs of ip6tables -L -vn:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 MAILCOW 0 -- * * ::/0 ::/0 /* mailcow */
0 0 DOCKER-USER 0 -- * * ::/0 ::/0
0 0 DOCKER-FORWARD 0 -- * * ::/0 ::/0
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain DOCKER (0 references)
pkts bytes target prot opt in out source destination
Chain DOCKER-BRIDGE (1 references)
pkts bytes target prot opt in out source destination
Chain DOCKER-CT (1 references)
pkts bytes target prot opt in out source destination
Chain DOCKER-FORWARD (1 references)
pkts bytes target prot opt in out source destination
0 0 DOCKER-CT 0 -- * * ::/0 ::/0
0 0 DOCKER-INTERNAL 0 -- * * ::/0 ::/0
0 0 DOCKER-BRIDGE 0 -- * * ::/0 ::/0
Chain DOCKER-INTERNAL (1 references)
pkts bytes target prot opt in out source destination
Chain DOCKER-USER (1 references)
pkts bytes target prot opt in out source destination
Chain MAILCOW (1 references)
pkts bytes target prot opt in out source destinationLogs of iptables -L -vn -t nat:
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
202K 12M DOCKER 0 -- * * 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type LOCAL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 DOCKER 0 -- * * 0.0.0.0/0 !127.0.0.0/8 ADDRTYPE match dst-type LOCAL
Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
735K 62M MASQUERADE 0 -- * !br-mailcow 172.22.1.0/24 0.0.0.0/0
0 0 MASQUERADE 0 -- * !docker0 172.17.0.0/16 0.0.0.0/0
Chain DOCKER (2 references)
pkts bytes target prot opt in out source destination
0 0 DNAT 6 -- !br-mailcow * 0.0.0.0/0 127.0.0.1 tcp dpt:7654 to:172.22.1.249:6379
0 0 DNAT 6 -- !br-mailcow * 0.0.0.0/0 127.0.0.1 tcp dpt:13306 to:172.22.1.5:3306
0 0 DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:110 to:172.22.1.250:110
0 0 DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:143 to:172.22.1.250:143
51374 3174K DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:993 to:172.22.1.250:993
19857 1034K DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:995 to:172.22.1.250:995
0 0 DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:4190 to:172.22.1.250:4190
0 0 DNAT 6 -- !br-mailcow * 0.0.0.0/0 127.0.0.1 tcp dpt:19991 to:172.22.1.250:12345
11865 708K DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 to:172.22.1.11:80
43318 2594K DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443 to:172.22.1.11:443
2739 160K DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:25 to:172.22.1.253:25
1826 105K DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:465 to:172.22.1.253:465
2719 143K DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:587 to:172.22.1.253:587Logs of ip6tables -L -vn -t nat:
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
202K 12M DOCKER 0 -- * * 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type LOCAL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 DOCKER 0 -- * * 0.0.0.0/0 !127.0.0.0/8 ADDRTYPE match dst-type LOCAL
Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
735K 62M MASQUERADE 0 -- * !br-mailcow 172.22.1.0/24 0.0.0.0/0
0 0 MASQUERADE 0 -- * !docker0 172.17.0.0/16 0.0.0.0/0
Chain DOCKER (2 references)
pkts bytes target prot opt in out source destination
0 0 DNAT 6 -- !br-mailcow * 0.0.0.0/0 127.0.0.1 tcp dpt:7654 to:172.22.1.249:6379
0 0 DNAT 6 -- !br-mailcow * 0.0.0.0/0 127.0.0.1 tcp dpt:13306 to:172.22.1.5:3306
0 0 DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:110 to:172.22.1.250:110
0 0 DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:143 to:172.22.1.250:143
51365 3173K DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:993 to:172.22.1.250:993
19849 1033K DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:995 to:172.22.1.250:995
0 0 DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:4190 to:172.22.1.250:4190
0 0 DNAT 6 -- !br-mailcow * 0.0.0.0/0 127.0.0.1 tcp dpt:19991 to:172.22.1.250:12345
11862 708K DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 to:172.22.1.11:80
43311 2594K DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443 to:172.22.1.11:443
2739 160K DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:25 to:172.22.1.253:25
1826 105K DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:465 to:172.22.1.253:465
2719 143K DNAT 6 -- !br-mailcow * 0.0.0.0/0 0.0.0.0/0 tcp dpt:587 to:172.22.1.253:587DNS check:
198.252.206.1Source: mailcow/mailcow-dockerized