From 9ac7210487ec2bce4caca42ee4f8a17303aaabf5 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Tue, 19 Feb 2008 20:26:57 -0800 Subject: cmd_confirm.py - Modified to catch a UnicodeError that may occur under obscure circumstances when scanning the message body for "unprocessed" commands. Moderate.py - Modified to not try to match "@listname" directly against the sender address. --- Mailman/Commands/cmd_confirm.py | 7 +++++-- Mailman/Handlers/Moderate.py | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Mailman/Commands/cmd_confirm.py b/Mailman/Commands/cmd_confirm.py index efa405e3..9d568df2 100644 --- a/Mailman/Commands/cmd_confirm.py +++ b/Mailman/Commands/cmd_confirm.py @@ -90,8 +90,11 @@ Bad approval password given. Held message is still being held.""")) match = 'confirm ' + cookie unprocessed = [] for line in res.commands: - if line.lstrip() == match: - continue + try: + if line.lstrip() == match: + continue + except UnicodeError: + pass unprocessed.append(line) res.commands = unprocessed # Process just one confirmation string per message diff --git a/Mailman/Handlers/Moderate.py b/Mailman/Handlers/Moderate.py index 346437e8..ff99c8fd 100644 --- a/Mailman/Handlers/Moderate.py +++ b/Mailman/Handlers/Moderate.py @@ -117,8 +117,9 @@ def process(mlist, msg, msgdata): def matches_p(sender, nonmembers): - # First strip out all the regular expressions - plainaddrs = [addr for addr in nonmembers if not addr.startswith('^')] + # First strip out all the regular expressions and listnames + plainaddrs = [addr for addr in nonmembers if not (addr.startswith('^') + or addr.startswith('@'))] addrdict = Utils.List2Dict(plainaddrs, foldcase=1) if addrdict.has_key(sender): return 1 -- cgit v1.2.3