From fa0b0e8852a31d6aa59651c7c92460c607a7337e Mon Sep 17 00:00:00 2001
From: Mark Sapiro <msapiro@value.net>
Date: Sun, 18 Nov 2007 12:01:26 -0800
Subject: 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.
---
 Mailman/Gui/GUIBase.py       | 18 +++++++++---------
 Mailman/Gui/Privacy.py       | 33 ++++++++++++++++++++-------------
 Mailman/Handlers/Moderate.py | 15 +++++++++++++--
 3 files changed, 42 insertions(+), 24 deletions(-)

(limited to 'Mailman')

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
 
 
-- 
cgit v1.2.3


From 7ace1799d7935bede9b4821d8f8f4a9ca243bf08 Mon Sep 17 00:00:00 2001
From: Mark Sapiro <msapiro@value.net>
Date: Sun, 18 Nov 2007 12:12:22 -0800
Subject: Scrubber.py - changed to use part.get_payload(), not part._payload.

---
 Mailman/Handlers/Scrubber.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'Mailman')

diff --git a/Mailman/Handlers/Scrubber.py b/Mailman/Handlers/Scrubber.py
index 588dd9ac..1d5aed92 100644
--- a/Mailman/Handlers/Scrubber.py
+++ b/Mailman/Handlers/Scrubber.py
@@ -298,7 +298,7 @@ URL: %(url)s
         # If the message isn't a multipart, then we'll strip it out as an
         # attachment that would have to be separately downloaded.  Pipermail
         # will transform the url into a hyperlink.
-        elif part._payload and not part.is_multipart():
+        elif part.get_payload() and not part.is_multipart():
             payload = part.get_payload(decode=True)
             ctype = part.get_type()
             # XXX Under email 2.5, it is possible that payload will be None.
@@ -350,7 +350,7 @@ URL: %(url)s
         for part in msg.walk():
             # TK: bug-id 1099138 and multipart
             # MAS test payload - if part may fail if there are no headers.
-            if not part._payload or part.is_multipart():
+            if not part.get_payload() or part.is_multipart():
                 continue
             # All parts should be scrubbed to text/plain by now.
             partctype = part.get_content_type()
-- 
cgit v1.2.3


From 35f3636e712f1580218809e6c74781287fb8cf92 Mon Sep 17 00:00:00 2001
From: Mark Sapiro <msapiro@value.net>
Date: Sun, 18 Nov 2007 13:25:16 -0800
Subject: Added Hebrew translation from Dov Zamir minus the apparently unused
 'direction' addition to the LC_DESCRIPTIONS dictionary.

---
 Mailman/Defaults.py.in | 1 +
 1 file changed, 1 insertion(+)

(limited to 'Mailman')

diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in
index 8be182ac..c456c4a3 100644
--- a/Mailman/Defaults.py.in
+++ b/Mailman/Defaults.py.in
@@ -1344,6 +1344,7 @@ add_language('et',    _('Estonian'),            'iso-8859-15')
 add_language('eu',    _('Euskara'),             'iso-8859-15') # Basque
 add_language('fi',    _('Finnish'),             'iso-8859-1')
 add_language('fr',    _('French'),              'iso-8859-1')
+add_language('he',    _('Hebrew'),              'utf-8')
 add_language('hr',    _('Croatian'),            'iso-8859-2')
 add_language('hu',    _('Hungarian'),           'iso-8859-2')
 add_language('ia',    _('Interlingua'),         'iso-8859-15')
-- 
cgit v1.2.3