------------------------------------------------------------ revno: 1008 committer: Mark Sapiro <[EMAIL PROTECTED]> branch nick: 2.1 timestamp: Sun 2007-11-18 12:01:26 -0800 message: Gui/GuiBase.py - Deleted the _escape() method - not needed since 2.1.9 Gui/GuiBase.py Gui/Privacy.py Handlers/Moderate.py - Patched with a slightly modified version of sf patch 1220144 - allow specifying another list in accept_these_nonmembers. modified: Mailman/Gui/GUIBase.py Mailman/Gui/Privacy.py Mailman/Handlers/Moderate.py
=== modified file 'Mailman/Gui/GUIBase.py' --- a/Mailman/Gui/GUIBase.py 2005-08-27 01:40:17 +0000 +++ b/Mailman/Gui/GUIBase.py 2007-11-18 20:01:26 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2004 by the Free Software Foundation, Inc. +# Copyright (C) 2002-2007 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 @@ -12,7 +12,8 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. """Base class for all web GUI components.""" @@ -77,6 +78,10 @@ re.compile(addr) except re.error: raise ValueError + elif wtype == mm_cfg.EmailListEx and addr.startswith('@'): + # XXX Needs to be reviewed for [EMAIL PROTECTED] names. + # check for existence of list? + pass else: raise addrs.append(addr) @@ -122,10 +127,6 @@ # Validate all the attributes for this category pass - def _escape(self, property, value): - value = value.replace('<', '<') - return value - def handleForm(self, mlist, category, subcat, cgidata, doc): for item in self.GetConfigInfo(mlist, category, subcat): # Skip descriptions and legacy non-attributes @@ -144,10 +145,9 @@ elif not cgidata.has_key(property): continue elif isinstance(cgidata[property], ListType): - val = [self._escape(property, x.value) - for x in cgidata[property]] + val = [x.value for x in cgidata[property]] else: - val = self._escape(property, cgidata[property].value) + val = cgidata[property].value # Coerce the value to the expected type, raising exceptions if the # value is invalid. try: === modified file 'Mailman/Gui/Privacy.py' --- a/Mailman/Gui/Privacy.py 2005-12-30 18:50:08 +0000 +++ b/Mailman/Gui/Privacy.py 2007-11-18 20:01:26 +0000 @@ -1,17 +1,17 @@ -# Copyright (C) 2001-2005 by the Free Software Foundation, Inc. +# Copyright (C) 2001-2007 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 # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software +# along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA. @@ -59,7 +59,7 @@ _('Confirm'), _('Require approval'), _('Confirm and approve')), - 0, + 0, _('What steps are required for subscription?<br>'), _('''None - no verification steps (<em>Not Recommended </em>)<br> @@ -67,7 +67,7 @@ Require approval - require list administrator Approval for subscriptions <br> Confirm and approve - both confirm and approve - + <p>(*) when someone requests a subscription, Mailman sends them a notice with a unique subscription request number that they must reply to @@ -88,7 +88,7 @@ Require approval - require list administrator approval for subscriptions <br> Confirm and approve - both confirm and approve - + <p>(*) when someone requests a subscription, Mailman sends them a notice with a unique subscription request number that they must reply to @@ -112,7 +112,7 @@ machine?''')), sub_cfentry, - + ('unsubscribe_policy', mm_cfg.Radio, (_('No'), _('Yes')), 0, _("""Is the list moderator's approval required for unsubscription requests? (<em>No</em> is recommended)"""), @@ -241,10 +241,17 @@ _("""List of non-member addresses whose postings should be automatically accepted."""), + # XXX Needs to be reviewed for [EMAIL PROTECTED] names. Also, the + # implementation allows the @listname to work in all + # *_these_nonmembers. It doesn't make much sense in the others, + # but it could be useful. Should we mention it? _("""Postings from any of these non-members will be automatically accepted with no further moderation applied. Add member addresses one per line; start the line with a ^ character to - designate a regular expression match.""")), + designate a regular expression match. A line consisting of + the @ character followed by a list name specifies another + Mailman list in this installation, all of whose member + addresses will be accepted for this list.""")), ('hold_these_nonmembers', mm_cfg.EmailListEx, (10, WIDTH), 1, _("""List of non-member addresses whose postings will be @@ -352,18 +359,18 @@ against every recipient address in the message. The matching is performed with Python's re.match() function, meaning they are anchored to the start of the string. - + <p>For backwards compatibility with Mailman 1.1, if the regexp does not contain an `@', then the pattern is matched against just the local part of the recipient address. If that match fails, or if the pattern does contain an `@', then the pattern is matched against the entire recipient address. - + <p>Matching against the local part is deprecated; in a future release, the pattern will always be matched against the entire recipient address.""")), - ('max_num_recipients', mm_cfg.Number, 5, 0, + ('max_num_recipients', mm_cfg.Number, 5, 0, _('Ceiling on acceptable number of recipients for a posting.'), _('''If a posting has this number, or more, of recipients, it is @@ -392,7 +399,7 @@ case, each rule is matched in turn, with processing stopped after the first match. - Note that headers are collected from all the attachments + Note that headers are collected from all the attachments (except for the mailman administrivia message) and matched against the regular expressions. With this feature, you can effectively sort out messages with dangerous file === modified file 'Mailman/Handlers/Moderate.py' --- a/Mailman/Handlers/Moderate.py 2005-08-27 01:40:17 +0000 +++ b/Mailman/Handlers/Moderate.py 2007-11-18 20:01:26 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2003 by the Free Software Foundation, Inc. +# Copyright (C) 2001-2007 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 @@ -12,7 +12,8 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. """Posting moderation filter. """ @@ -28,6 +29,7 @@ from Mailman.i18n import _ from Mailman.Handlers import Hold from Mailman.Logging.Syslog import syslog +from Mailman.MailList import MailList @@ -129,6 +131,15 @@ continue if cre.search(sender): return 1 + elif are.startswith('@'): + # XXX Needs to be reviewed for [EMAIL PROTECTED] names. + try: + mother = MailList(are[1:], lock=0) + if mother.isMember(sender): + return 1 + except Errors.MMUnknownListError: + syslog('error', 'filter references non-existent list %s', + are[1:]) return 0 -- https://code.launchpad.net/~mailman-coders/mailman/2.1 You are receiving this branch notification because you are subscribed to it. To unsubscribe from this branch go to https://code.launchpad.net/~mailman-coders/mailman/2.1/+subscription/mailman-checkins. _______________________________________________ Mailman-checkins mailing list Mailman-checkins@python.org Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org