Update of /cvsroot/mailman/mailman/Mailman/Handlers
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14562/Handlers
Modified Files:
Decorate.py Scrubber.py ToArchive.py ToDigest.py
Log Message:
Back out Revision 2.30 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.26
retrieving revision 2.27
diff -u -d -r2.26 -r2.27
--- Decorate.py 30 Dec 2005 18:56:46 -0000 2.26
+++ Decorate.py 29 Jan 2006 05:13:57 -0000 2.27
@@ -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.31
retrieving revision 2.32
diff -u -d -r2.31 -r2.32
--- Scrubber.py 30 Dec 2005 18:56:46 -0000 2.31
+++ Scrubber.py 29 Jan 2006 05:13:57 -0000 2.32
@@ -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.9
retrieving revision 2.10
diff -u -d -r2.9 -r2.10
--- ToArchive.py 30 Dec 2005 18:56:46 -0000 2.9
+++ ToArchive.py 29 Jan 2006 05:13:57 -0000 2.10
@@ -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.33
retrieving revision 2.34
diff -u -d -r2.33 -r2.34
--- ToDigest.py 30 Dec 2005 18:56:46 -0000 2.33
+++ ToDigest.py 29 Jan 2006 05:13:57 -0000 2.34
@@ -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