aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman
diff options
context:
space:
mode:
authorTokio Kikuchi <tkikuchi@is.kochi-u.ac.jp>2007-11-16 11:48:35 +0900
committerTokio Kikuchi <tkikuchi@is.kochi-u.ac.jp>2007-11-16 11:48:35 +0900
commit8f5d8d2eb9e8bf62a598f126419d18eb3163050e (patch)
treee9dd5c5e73bed1b75811ff7614ba6489c2cd48f1 /Mailman
parentba98caf52c18dea4ea244c092617677bdbb01015 (diff)
parent70689d7eb61f8c852a6a02be1d65c86cde06bde2 (diff)
downloadmailman2-8f5d8d2eb9e8bf62a598f126419d18eb3163050e.tar.gz
mailman2-8f5d8d2eb9e8bf62a598f126419d18eb3163050e.tar.xz
mailman2-8f5d8d2eb9e8bf62a598f126419d18eb3163050e.zip
merge and commit
Diffstat (limited to 'Mailman')
-rw-r--r--Mailman/Archiver/HyperArch.py6
-rw-r--r--Mailman/Cgi/options.py4
-rw-r--r--Mailman/Defaults.py.in12
-rw-r--r--Mailman/Handlers/CalcRecips.py9
-rw-r--r--Mailman/Handlers/CleanseDKIM.py8
-rw-r--r--Mailman/Handlers/Hold.py4
-rw-r--r--Mailman/Handlers/MimeDel.py4
-rw-r--r--Mailman/Handlers/Scrubber.py11
-rw-r--r--Mailman/MailList.py1
-rw-r--r--Mailman/Queue/CommandRunner.py4
-rwxr-xr-x[-rw-r--r--]Mailman/Queue/MaildirRunner.py20
-rw-r--r--Mailman/versions.py5
12 files changed, 58 insertions, 30 deletions
diff --git a/Mailman/Archiver/HyperArch.py b/Mailman/Archiver/HyperArch.py
index e5ed59a9..5a177309 100644
--- a/Mailman/Archiver/HyperArch.py
+++ b/Mailman/Archiver/HyperArch.py
@@ -460,8 +460,10 @@ class Article(pipermail.Article):
d["email_html"] = self.quote(self.email)
d["title"] = self.quote(self.subject)
d["subject_html"] = self.quote(self.subject)
- d["subject_url"] = url_quote(self.subject)
- d["in_reply_to_url"] = url_quote(self.in_reply_to)
+ # TK: _url variables are used to compose a response from the
+ # archive web page. So, ...
+ d["subject_url"] = 'Re: ' + url_quote(self.subject)
+ d["in_reply_to_url"] = url_quote(self._message_id)
if mm_cfg.ARCHIVER_OBSCURES_EMAILADDRS:
# Point the mailto url back to the list
author = re.sub('@', _(' at '), self.author)
diff --git a/Mailman/Cgi/options.py b/Mailman/Cgi/options.py
index d423f262..ab19e4e2 100644
--- a/Mailman/Cgi/options.py
+++ b/Mailman/Cgi/options.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2006 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-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
@@ -797,6 +797,8 @@ def options_page(mlist, doc, user, cpuser, userlang, message=''):
if mlist.topics:
table = Table(border="0")
for name, pattern, description, emptyflag in mlist.topics:
+ if emptyflag:
+ continue
quotedname = urllib.quote_plus(name)
details = Link(mlist.GetScriptURL('options') +
'/%s/?VARHELP=%s' % (user, quotedname),
diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in
index a18f3a93..8be182ac 100644
--- a/Mailman/Defaults.py.in
+++ b/Mailman/Defaults.py.in
@@ -217,11 +217,13 @@ DEFAULT_ARCHIVE_PRIVATE = 0
# ARCHIVE_TO_MBOX
#-1 - do not do any archiving
# 0 - do not archive to mbox, use builtin mailman html archiving only
-# 1 - archive to mbox to use an external archiving mechanism only
-# 2 - archive to both mbox and builtin mailman html archiving -
-# use this to make both external archiving mechanism work and
-# mailman's builtin html archiving. the flat mail file can be
-# useful for searching, external archivers, etc.
+# 1 - do not use builtin mailman html archiving, archive to mbox only
+# 2 - archive to both mbox and builtin mailman html archiving.
+# See the settings below for PUBLIC_EXTERNAL_ARCHIVER and
+# PRIVATE_EXTERNAL_ARCHIVER which can be used to replace mailman's
+# builtin html archiving with an external archiver. The flat mail
+# mbox file can be useful for searching, and is another way to
+# interface external archivers, etc.
ARCHIVE_TO_MBOX = 2
# 0 - yearly
diff --git a/Mailman/Handlers/CalcRecips.py b/Mailman/Handlers/CalcRecips.py
index e065ad68..75a8a457 100644
--- a/Mailman/Handlers/CalcRecips.py
+++ b/Mailman/Handlers/CalcRecips.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-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.
"""Calculate the regular (i.e. non-digest) recipients of the message.
@@ -91,6 +92,10 @@ delivery. The original message as received by Mailman is attached.
def do_topic_filters(mlist, msg, msgdata, recips):
+ if not mlist.topics_enabled:
+ # MAS: if topics are currently disabled for the list, send to all
+ # regardless of ReceiveNonmatchingTopics
+ return
hits = msgdata.get('topichits')
zaprecips = []
if hits:
diff --git a/Mailman/Handlers/CleanseDKIM.py b/Mailman/Handlers/CleanseDKIM.py
index 0c548a9a..c4b06613 100644
--- a/Mailman/Handlers/CleanseDKIM.py
+++ b/Mailman/Handlers/CleanseDKIM.py
@@ -29,8 +29,8 @@ from Mailman import mm_cfg
def process(mlist, msg, msgdata):
- if not mm_cfg.REMOVE_DKIM_HEADERS:
- return
- del msg['domainkey-signature']
- del msg['dkim-signature']
+ if mm_cfg.REMOVE_DKIM_HEADERS:
+ del msg['domainkey-signature']
+ del msg['dkim-signature']
+ del msg['authentication-results']
diff --git a/Mailman/Handlers/Hold.py b/Mailman/Handlers/Hold.py
index f6008d45..d4af8f9a 100644
--- a/Mailman/Handlers/Hold.py
+++ b/Mailman/Handlers/Hold.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2006 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-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
@@ -283,6 +283,8 @@ also appear in the first line of the body of the reply.""")),
dmsg['Subject'] = 'confirm ' + cookie
dmsg['Sender'] = requestaddr
dmsg['From'] = requestaddr
+ dmsg['Date'] = email.Utils.formatdate(localtime=True)
+ dmsg['Message-ID'] = Utils.unique_message_id(mlist)
nmsg.attach(text)
nmsg.attach(MIMEMessage(msg))
nmsg.attach(MIMEMessage(dmsg))
diff --git a/Mailman/Handlers/MimeDel.py b/Mailman/Handlers/MimeDel.py
index 906b12c3..523b3dfc 100644
--- a/Mailman/Handlers/MimeDel.py
+++ b/Mailman/Handlers/MimeDel.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2005 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
@@ -256,4 +256,4 @@ def get_file_ext(m):
fext = fext[1:]
else:
fext = ''
- return fext
+ return fext.lower()
diff --git a/Mailman/Handlers/Scrubber.py b/Mailman/Handlers/Scrubber.py
index 48660038..588dd9ac 100644
--- a/Mailman/Handlers/Scrubber.py
+++ b/Mailman/Handlers/Scrubber.py
@@ -45,7 +45,7 @@ from Mailman.Logging.Syslog import syslog
# Path characters for common platforms
pre = re.compile(r'[/\\:]')
# All other characters to strip out of Content-Disposition: filenames
-# (essentially anything that isn't an alphanum, dot, slash, or underscore.
+# (essentially anything that isn't an alphanum, dot, dash, or underscore).
sre = re.compile(r'[^-\w.]')
# Regexp to strip out leading dots
dre = re.compile(r'^\.*')
@@ -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 and not part.is_multipart():
+ elif part._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.
@@ -349,7 +349,8 @@ URL: %(url)s
text = []
for part in msg.walk():
# TK: bug-id 1099138 and multipart
- if not part or part.is_multipart():
+ # MAS test payload - if part may fail if there are no headers.
+ if not part._payload or part.is_multipart():
continue
# All parts should be scrubbed to text/plain by now.
partctype = part.get_content_type()
@@ -447,8 +448,6 @@ def save_attachment(mlist, msg, dir, filter_html=True):
ext = fnext or guess_extension(ctype, fnext)
else:
ext = guess_extension(ctype, fnext)
- # Allow only alphanumerics, dash, underscore, and dot
- ext = sre.sub('', ext)
if not ext:
# We don't know what it is, so assume it's just a shapeless
# application/octet-stream, unless the Content-Type: is
@@ -458,6 +457,8 @@ def save_attachment(mlist, msg, dir, filter_html=True):
ext = '.txt'
else:
ext = '.bin'
+ # Allow only alphanumerics, dash, underscore, and dot
+ ext = sre.sub('', ext)
path = None
# We need a lock to calculate the next attachment number
lockfile = os.path.join(fsdir, 'attachments.lock')
diff --git a/Mailman/MailList.py b/Mailman/MailList.py
index e07e23aa..b08b5973 100644
--- a/Mailman/MailList.py
+++ b/Mailman/MailList.py
@@ -470,6 +470,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin,
#
def Create(self, name, admin, crypted_password,
langs=None, emailhost=None):
+ assert name == name.lower(), 'List name must be all lower case.'
if Utils.list_exists(name):
raise Errors.MMListAlreadyExistsError, name
# Validate what will be the list's posting address. If that's
diff --git a/Mailman/Queue/CommandRunner.py b/Mailman/Queue/CommandRunner.py
index e08d02eb..5920b89f 100644
--- a/Mailman/Queue/CommandRunner.py
+++ b/Mailman/Queue/CommandRunner.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2004 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-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
@@ -93,7 +93,7 @@ class Results:
if part is None:
# E.g the outer Content-Type: was text/html
return
- body = part.get_payload()
+ body = part.get_payload(decode=True)
# text/plain parts better have string payloads
assert isinstance(body, StringType) or isinstance(body, UnicodeType)
lines = body.splitlines()
diff --git a/Mailman/Queue/MaildirRunner.py b/Mailman/Queue/MaildirRunner.py
index 39971ae2..d9fe02cb 100644..100755
--- a/Mailman/Queue/MaildirRunner.py
+++ b/Mailman/Queue/MaildirRunner.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002 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.
"""Maildir pre-queue runner.
@@ -66,11 +67,22 @@ from Mailman.Logging.Syslog import syslog
# listname-request@
lre = re.compile(r"""
^ # start of string
- (?P<listname>[^-@]+) # listname@ or listname-subq@
+ (?P<listname>[^+@]+?) # listname@ or listname-subq@ (non-greedy)
(?: # non-grouping
- # dash separator
- (?P<subq>[^-+@]+) # everything up to + or - or @
+ (?P<subq> # any known suffix
+ admin|
+ bounces|
+ confirm|
+ join|
+ leave|
+ owner|
+ request|
+ subscribe|
+ unsubscribe
+ )
)? # if it exists
+ [+@] # followed by + or @
""", re.VERBOSE | re.IGNORECASE)
diff --git a/Mailman/versions.py b/Mailman/versions.py
index eff8ffdb..cffe5c6a 100644
--- a/Mailman/versions.py
+++ b/Mailman/versions.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2005 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-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
@@ -483,10 +483,11 @@ def NewRequestsDatabase(l):
# blow away the original timestamp and request id. This means the
# request will live a little longer than it possibly should have,
# but that's no big deal.
+ import email
for p in v:
author, text = p[2]
reason = p[3]
- msg = Message.OutgoingMessage(text)
+ msg = email.message_from_string(text, Message.Message)
l.HoldMessage(msg, reason)
del r[k]
elif k == 'add_member':