diff options
| author | Barry Warsaw | 2009-02-09 22:47:11 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2009-02-09 22:47:11 -0500 |
| commit | 18d3ad0469aeb1c5d76136d460c8c900bcdc898e (patch) | |
| tree | 69f0d52b9398ec5f056679dbbd4b0f44b864c3b1 /src/mailman/pipeline/moderate.py | |
| parent | e2355e3c7057227d27fe385b907071fa6d9345a5 (diff) | |
| download | mailman-18d3ad0469aeb1c5d76136d460c8c900bcdc898e.tar.gz mailman-18d3ad0469aeb1c5d76136d460c8c900bcdc898e.tar.zst mailman-18d3ad0469aeb1c5d76136d460c8c900bcdc898e.zip | |
Diffstat (limited to 'src/mailman/pipeline/moderate.py')
| -rw-r--r-- | src/mailman/pipeline/moderate.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mailman/pipeline/moderate.py b/src/mailman/pipeline/moderate.py index b5bf38dc9..8d6fc7d65 100644 --- a/src/mailman/pipeline/moderate.py +++ b/src/mailman/pipeline/moderate.py @@ -122,21 +122,21 @@ 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('^')] - addrdict = Utils.List2Dict(plainaddrs, foldcase=1) - if addrdict.has_key(sender): - return 1 - # Now do the regular expression matches - for are in nonmembers: - if are.startswith('^'): + # First strip out all the regular expressions. + addresses = set(address.lower() for address in nonmembers + if not address.startswith('^')) + if sender in addresses: + return True + # Now do the regular expression matches. + for regexp in nonmembers: + if regexp.startswith('^'): try: - cre = re.compile(are, re.IGNORECASE) + cre = re.compile(regexp, re.IGNORECASE) except re.error: continue if cre.search(sender): - return 1 - return 0 + return True + return False |
