diff options
author | Mark Sapiro <mark@msapiro.net> | 2008-03-15 22:09:31 -0700 |
---|---|---|
committer | Mark Sapiro <mark@msapiro.net> | 2008-03-15 22:09:31 -0700 |
commit | 1be785a563753165ced2715619c2a795618e733f (patch) | |
tree | 9bd998d471bbd505ed28f98c1acc0e344bcb0f29 /Mailman/Handlers/CalcRecips.py | |
parent | 6664a56036748d4cd2290449a4bab7a4ab9d1eaa (diff) | |
download | mailman2-1be785a563753165ced2715619c2a795618e733f.tar.gz mailman2-1be785a563753165ced2715619c2a795618e733f.tar.xz mailman2-1be785a563753165ced2715619c2a795618e733f.zip |
Gui/GuiBase.py - Don't allow self references in *_these_nonmembers
or regular_(in|ex)clude_lists.
Handlers/CalcRecips.py - Log and skip any self reference lists in
regular_(in|ex)clude_lists.
Compare To: and Cc: addresses and
regular_(in|ex)clude_lists case insensitively.
Handlers/Moderate.py - Log and skip any self reference lists in
*_these_nonmembers.
Diffstat (limited to '')
-rw-r--r-- | Mailman/Handlers/CalcRecips.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Mailman/Handlers/CalcRecips.py b/Mailman/Handlers/CalcRecips.py index 66c16f86..db10c432 100644 --- a/Mailman/Handlers/CalcRecips.py +++ b/Mailman/Handlers/CalcRecips.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2007 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2008 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -159,11 +159,16 @@ def do_exclude(mlist, msg, msgdata, recips): recips = set(recips) destinations = email.Utils.getaddresses(msg.get_all('to', []) + msg.get_all('cc', [])) - destinations = [y for x,y in destinations] + destinations = [y.lower() for x,y in destinations] for listname in mlist.regular_exclude_lists: + listname = listname.lower() if listname not in destinations: continue listlhs, hostname = listname.split('@') + if listlhs == mlist.internal_name(): + syslog('error', 'Exclude list %s is a self reference.', + listname) + continue try: slist = MailList(listlhs, lock=False) except MMUnknownListError: @@ -190,11 +195,16 @@ def do_include(mlist, msg, msgdata, recips): recips = set(recips) destinations = email.Utils.getaddresses(msg.get_all('to', []) + msg.get_all('cc', [])) - destinations = [y for x,y in destinations] + destinations = [y.lower() for x,y in destinations] for listname in mlist.regular_include_lists: + listname = listname.lower() if listname in destinations: continue listlhs, hostname = listname.split('@') + if listlhs == mlist.internal_name(): + syslog('error', 'Include list %s is a self reference.', + listname) + continue try: slist = MailList(listlhs, lock=False) except MMUnknownListError: |