Update of /cvsroot/mailman/mailman/Mailman/Handlers
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14027/Handlers
Modified Files:
Tag: Release_2_1-maint
Decorate.py Scrubber.py ToArchive.py ToDigest.py
Log Message:
Back out Revision 2.18.2.19 patch for email.Message.set_payload() bug
because it is overwrapped in Mailman.Message.
Index: Decorate.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Handlers/Decorate.py,v
retrieving revision 2.21.2.11
retrieving revision 2.21.2.12
diff -u -d -r2.21.2.11 -r2.21.2.12
--- Decorate.py 30 Dec 2005 18:50:08 -0000 2.21.2.11
+++ Decorate.py 29 Jan 2006 05:12:26 -0000 2.21.2.12
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2005 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2006 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
@@ -98,12 +98,7 @@
uheader = unicode(header, lcset)
ufooter = unicode(footer, lcset)
try:
- # First, check if the message was Scrubber-munged
- if msg.get('x-mailman-scrubbed'):
- decode = False
- else:
- decode = True
- oldpayload = unicode(msg.get_payload(decode=decode), mcset)
+ oldpayload = unicode(msg.get_payload(decode=True), mcset)
frontsep = endsep = u''
if header and not header.endswith('\n'):
frontsep = u'\n'
Index: Scrubber.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Handlers/Scrubber.py,v
retrieving revision 2.18.2.20
retrieving revision 2.18.2.21
diff -u -d -r2.18.2.20 -r2.18.2.21
--- Scrubber.py 30 Dec 2005 18:50:08 -0000 2.18.2.20
+++ Scrubber.py 29 Jan 2006 05:12:26 -0000 2.18.2.21
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2005 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2006 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
@@ -164,12 +164,10 @@
def replace_payload_by_text(msg, text, charset):
# TK: This is a common function in replacing the attachment and the main
- # message by a text (scrubbing). Also, add a flag indicating it has been
- # scrubbed.
+ # message by a text (scrubbing).
del msg['content-type']
del msg['content-transfer-encoding']
msg.set_payload(text, charset)
- msg['X-Mailman-Scrubbed'] = 'Yes'
@@ -344,12 +342,7 @@
text.append(_('Skipped content of type %(partctype)s\n'))
continue
try:
- # Check if the part is replaced.
- if part.get('x-mailman-scrubbed'):
- decode = False
- else:
- decode = True
- t = part.get_payload(decode=decode)
+ t = part.get_payload(decode=True)
except binascii.Error:
t = part.get_payload()
# TK: get_content_charset() returns 'iso-2022-jp' for internally
Index: ToArchive.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Handlers/ToArchive.py,v
retrieving revision 2.6.2.3
retrieving revision 2.6.2.4
diff -u -d -r2.6.2.3 -r2.6.2.4
--- ToArchive.py 30 Dec 2005 18:50:08 -0000 2.6.2.3
+++ ToArchive.py 29 Jan 2006 05:12:26 -0000 2.6.2.4
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2005 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2006 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
@@ -20,10 +20,7 @@
import time
from cStringIO import StringIO
-from email import message_from_string
-
from Mailman import mm_cfg
-from Mailman import Message
from Mailman.Queue.sbcache import get_switchboard
@@ -40,10 +37,4 @@
# Send the message to the archiver queue
archq = get_switchboard(mm_cfg.ARCHQUEUE_DIR)
# Send the message to the queue
- if msg.get('x-mailman-scrubbed'):
- # Clean Scrubber-munged message.
- archmsg = message_from_string(msg.as_string(), Message.Message)
- del archmsg['x-mailman-scrubbed']
- archq.enqueue(archmsg, msgdata)
- else:
- archq.enqueue(msg, msgdata)
+ archq.enqueue(msg, msgdata)
Index: ToDigest.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Handlers/ToDigest.py,v
retrieving revision 2.22.2.16
retrieving revision 2.22.2.17
diff -u -d -r2.22.2.16 -r2.22.2.17
--- ToDigest.py 30 Dec 2005 18:50:08 -0000 2.22.2.16
+++ ToDigest.py 29 Jan 2006 05:12:26 -0000 2.22.2.17
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2005 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2006 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
@@ -32,7 +32,6 @@
from types import ListType
from cStringIO import StringIO
-from email import message_from_string
from email.Parser import Parser
from email.Generator import Generator
from email.MIMEBase import MIMEBase
@@ -333,14 +332,10 @@
uh = '\n\t'.join(uh.split('\n'))
print >> plainmsg, uh
print >> plainmsg
- if msg.get('x-mailman-scrubbed'):
- # It has successfully been scrubbed, so this should be string.
- payload = msg.get_payload()
- else:
- # If decoded payload is empty, this may be multipart message.
- # -- just stringfy it.
- payload = msg.get_payload(decode=True) \
- or msg.as_string().split('\n\n',1)[1]
+ # If decoded payload is empty, this may be multipart message.
+ # -- just stringfy it.
+ payload = msg.get_payload(decode=True) \
+ or msg.as_string().split('\n\n',1)[1]
mcset = msg.get_content_charset('')
if mcset and mcset <> lcset and mcset <> lcset_out:
try:
@@ -412,8 +407,6 @@
isdigest=True)
# RFC 1153
rfc1153msg.set_payload(plainmsg.getvalue(), lcset)
- # Re-generate it because set_payload() doesn't encode. :-(
- rfc1153msg = message_from_string(rfc1153msg.as_string(), Message.Message)
virginq.enqueue(rfc1153msg,
recips=plainrecips,
listname=mlist.internal_name(),
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org