Fix AttributeError in CheckPrivateNetworkMixin (#6076)

This commit is contained in:
pajowu
2026-04-10 12:47:53 +02:00
committed by GitHub
parent 6c7163406e
commit 3473fa738d
2 changed files with 6 additions and 6 deletions

View File

@@ -251,7 +251,7 @@ def create_connection(address, timeout=socket.getdefaulttimeout(),
for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
af, socktype, proto, canonname, sa = res
if not settings.get("MAIL_CUSTOM_SMTP_ALLOW_PRIVATE_NETWORKS", False):
if not getattr(settings, "MAIL_CUSTOM_SMTP_ALLOW_PRIVATE_NETWORKS", False):
ip_addr = ipaddress.ip_address(sa[0])
if ip_addr.is_multicast:
raise socket.error(f"Request to multicast address {sa[0]} blocked")