aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2016-02-25 20:45:44 -0800
committerMark Sapiro <mark@msapiro.net>2016-02-25 20:45:44 -0800
commit12737ecf786a8d0315bc6a9a4448831cc19eead2 (patch)
tree5afd87c02fabc81bf00479a5555cd91cbcb8946a /Mailman
parent1736634b57aa1ba6864e255e088e64eeca9ca16a (diff)
downloadmailman2-12737ecf786a8d0315bc6a9a4448831cc19eead2.tar.gz
mailman2-12737ecf786a8d0315bc6a9a4448831cc19eead2.tar.xz
mailman2-12737ecf786a8d0315bc6a9a4448831cc19eead2.zip
Further refactoring of the Organizational Domain fix.
Diffstat (limited to 'Mailman')
-rwxr-xr-xMailman/Defaults.py.in7
-rw-r--r--Mailman/Utils.py3
2 files changed, 8 insertions, 2 deletions
diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in
index 8c5d9e7b..4881bbba 100755
--- a/Mailman/Defaults.py.in
+++ b/Mailman/Defaults.py.in
@@ -1130,6 +1130,13 @@ DMARC_RESOLVER_TIMEOUT = seconds(3)
# The total time to spend trying to get an answer to the question.
DMARC_RESOLVER_LIFETIME = seconds(5)
+# A URL from which to retrieve the data for the algorithm that computes
+# Organizational Domains for DMARC policy lookup purposes. This can be
+# anything handled by the Python urllib2.urlopen function. See
+# https://publicsuffix.org/list/ for info.
+DMARC_ORGANIZATIONAL_DOMAIN_DATA_URL = \
+'https://publicsuffix.org/list/public_suffix_list.dat'
+
# Should the list server auto-moderate members who post too frequently
# This is intended to stop people who join a list and then use a bot to
# send many spam messages in a short interval. These are default settings
diff --git a/Mailman/Utils.py b/Mailman/Utils.py
index 4a5dddef..8a54bfc5 100644
--- a/Mailman/Utils.py
+++ b/Mailman/Utils.py
@@ -1162,7 +1162,6 @@ def suspiciousHTML(html):
# algorithm at https://publicsuffix.org/list/ to find the "Organizational
# Domain corresponding to a From: domain.
-URL = 'https://publicsuffix.org/list/public_suffix_list.dat'
s_dict = {}
def get_suffixes(url):
@@ -1205,7 +1204,7 @@ def get_org_dom(domain):
Domain which may be the same as the input."""
global s_dict
if not s_dict:
- get_suffixes(URL)
+ get_suffixes(mm_cfg.DMARC_ORGANIZATIONAL_DOMAIN_DATA_URL)
hits = []
d = domain.split('.')
d.reverse()