summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2000-10-06 20:50:20 +0000
committerbwarsaw2000-10-06 20:50:20 +0000
commitbe46484eb70e31020751b43051e1738fb5817865 (patch)
treef77f4e913693f21a7534695f66022304d5275e49
parent2e6ee84f8f0128d3aaee55e7cfd6635f77dcda6b (diff)
downloadmailman-be46484eb70e31020751b43051e1738fb5817865.tar.gz
mailman-be46484eb70e31020751b43051e1738fb5817865.tar.zst
mailman-be46484eb70e31020751b43051e1738fb5817865.zip
HasExplicitDest(): It is possible that the address part of the tuple
returned by getaddrlist() will return None. This happens if the header value is simply not RFC822 compliant. In that case, ignore this element.
-rw-r--r--Mailman/MailList.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Mailman/MailList.py b/Mailman/MailList.py
index 6f3059a55..609c59d79 100644
--- a/Mailman/MailList.py
+++ b/Mailman/MailList.py
@@ -1205,6 +1205,11 @@ it will not be changed."""),
for header in ('to', 'cc', 'resent-to', 'resent-cc'):
to.extend(msg.getaddrlist(header))
for fullname, addr in to:
+ # It's possible that if the header doesn't have a valid
+ # (i.e. RFC822) value, we'll get None for the address. So skip
+ # it.
+ if addr is None:
+ continue
addr = string.lower(addr)
localpart = string.split(addr, '@')[0]
if (# TBD: backwards compatibility: deprecated