mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-11-11 08:46:00 +01:00
Fix IPv6 Spamhaus lookup to use nibble-reversed format (#2617)
IPv6 Spamhaus check always reports "not blacklisted" The IPv6 blocklist check in `management/status_checks.py` builds the DNSBL query name by reversing the 16-bit groups of the address instead of reversing individual nibbles. The malformed name returns NXDOMAIN, which evaluate_spamhaus_lookup()` treats as "not blacklisted," so the IPv6 check always passes regardless of actual listing status. DNSBLs (including Spamhaus) expect nibble-reversed format. This fix presents it in the correct nibble-reversed format.
This commit is contained in:
1 file changed
+1
-1
@@ -325,7 +325,7 @@ def run_network_checks(env, output):
|
||||
|
||||
from ipaddress import IPv6Address
|
||||
|
||||
rev_ip6 = ".".join(reversed(IPv6Address(env['PUBLIC_IPV6']).exploded.split(':')))
|
||||
rev_ip6 = ".".join(reversed(IPv6Address(env['PUBLIC_IPV6']).exploded.replace(':', '')))
|
||||
zen = query_dns(rev_ip6+'.zen.spamhaus.org', 'A', nxdomain=None)
|
||||
evaluate_spamhaus_lookup(env['PUBLIC_IPV6'], 'IPv6', rev_ip6, output, zen)
|
||||
|
||||
|
||||
Reference in new issue
Block a user