aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Handlers
diff options
context:
space:
mode:
authorTokio Kikuchi <tkikuchi@is.kochi-u.ac.jp>2007-11-19 09:06:10 +0900
committerTokio Kikuchi <tkikuchi@is.kochi-u.ac.jp>2007-11-19 09:06:10 +0900
commit2d7babef109e595bfa4e945cf31d63817408746e (patch)
tree024961e035bf84241e1cbf5ec09e0ea211953baa /Mailman/Handlers
parent4683bd064689820562fdd31d6522045c5be33c55 (diff)
parent588890f16d73b3497ee86ae2ed2176de1190da6c (diff)
downloadmailman2-2d7babef109e595bfa4e945cf31d63817408746e.tar.gz
mailman2-2d7babef109e595bfa4e945cf31d63817408746e.tar.xz
mailman2-2d7babef109e595bfa4e945cf31d63817408746e.zip
merge from launchpad
Diffstat (limited to 'Mailman/Handlers')
-rw-r--r--Mailman/Handlers/Moderate.py15
-rw-r--r--Mailman/Handlers/Scrubber.py4
2 files changed, 15 insertions, 4 deletions
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
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()