aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman
diff options
context:
space:
mode:
authorMark Sapiro <msapiro@value.net>2007-11-18 12:01:26 -0800
committerMark Sapiro <msapiro@value.net>2007-11-18 12:01:26 -0800
commitfa0b0e8852a31d6aa59651c7c92460c607a7337e (patch)
tree1324b000c9ced25f59eb07026c7b34934efac724 /Mailman
parentf383c36db54e30c67f9bf22fc1498e9fed7b65d1 (diff)
downloadmailman2-fa0b0e8852a31d6aa59651c7c92460c607a7337e.tar.gz
mailman2-fa0b0e8852a31d6aa59651c7c92460c607a7337e.tar.xz
mailman2-fa0b0e8852a31d6aa59651c7c92460c607a7337e.zip
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.
Diffstat (limited to 'Mailman')
-rw-r--r--Mailman/Gui/GUIBase.py18
-rw-r--r--Mailman/Gui/Privacy.py33
-rw-r--r--Mailman/Handlers/Moderate.py15
3 files changed, 42 insertions, 24 deletions
diff --git a/Mailman/Gui/GUIBase.py b/Mailman/Gui/GUIBase.py
index 5f0f2c1e..b27542ed 100644
--- a/Mailman/Gui/GUIBase.py
+++ b/Mailman/Gui/GUIBase.py
@@ -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 @@ class GUIBase:
re.compile(addr)
except re.error:
raise ValueError
+ elif wtype == mm_cfg.EmailListEx and addr.startswith('@'):
+ # XXX Needs to be reviewed for list@domain names.
+ # check for existence of list?
+ pass
else:
raise
addrs.append(addr)
@@ -122,10 +127,6 @@ class GUIBase:
# Validate all the attributes for this category
pass
- def _escape(self, property, value):
- value = value.replace('<', '&lt;')
- 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 @@ class GUIBase:
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:
diff --git a/Mailman/Gui/Privacy.py b/Mailman/Gui/Privacy.py
index 5fe4a2d9..3ed995eb 100644
--- a/Mailman/Gui/Privacy.py
+++ b/Mailman/Gui/Privacy.py
@@ -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 @@ class Privacy(GUIBase):
_('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 @@ class Privacy(GUIBase):
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 @@ class Privacy(GUIBase):
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 @@ class Privacy(GUIBase):
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 @@ class Privacy(GUIBase):
_("""List of non-member addresses whose postings should be
automatically accepted."""),
+ # XXX Needs to be reviewed for list@domain 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 @@ class Privacy(GUIBase):
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 @@ class Privacy(GUIBase):
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
diff --git a/Mailman/Handlers/Moderate.py b/Mailman/Handlers/Moderate.py
index 97d998b2..84ff14e5 100644
--- a/Mailman/Handlers/Moderate.py
+++ b/Mailman/Handlers/Moderate.py
@@ -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 import Errors
from Mailman.i18n import _
from Mailman.Handlers import Hold
from Mailman.Logging.Syslog import syslog
+from Mailman.MailList import MailList
@@ -129,6 +131,15 @@ def matches_p(sender, nonmembers):
continue
if cre.search(sender):
return 1
+ elif are.startswith('@'):
+ # XXX Needs to be reviewed for list@domain 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