From e7bea1efd0b4c221886cace8a49adbd99f6b1a8b Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Tue, 9 Oct 2001 23:14:22 +0000 Subject: HasExplicitDest(), hasMatchingHeader(): Pass a failobj of [] to the get_all() call so that even if the field is missing, we get a valid list object. --- Mailman/MailList.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mailman/MailList.py b/Mailman/MailList.py index 1149ef51d..e975f7414 100644 --- a/Mailman/MailList.py +++ b/Mailman/MailList.py @@ -936,7 +936,7 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, # specifically To: Cc: and Resent-to: to = [] for header in ('to', 'cc', 'resent-to', 'resent-cc'): - to.extend(getaddresses(msg.get_all(header))) + to.extend(getaddresses(msg.get_all(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 @@ -1024,7 +1024,7 @@ bad regexp in bounce_matching_header line: %s matches. """ for header, cre, line in self.parse_matching_header_opt(): - for value in msg.get_all(header): + for value in msg.get_all(header, []): if cre.search(value): return line return 0 -- cgit v1.3.1