aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Handlers
diff options
context:
space:
mode:
Diffstat (limited to 'Mailman/Handlers')
-rw-r--r--Mailman/Handlers/Decorate.py9
-rw-r--r--Mailman/Handlers/Scrubber.py13
-rw-r--r--Mailman/Handlers/ToArchive.py13
-rw-r--r--Mailman/Handlers/ToDigest.py17
4 files changed, 12 insertions, 40 deletions
diff --git a/Mailman/Handlers/Decorate.py b/Mailman/Handlers/Decorate.py
index a5df4010..41db3950 100644
--- a/Mailman/Handlers/Decorate.py
+++ b/Mailman/Handlers/Decorate.py
@@ -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 @@ def process(mlist, msg, msgdata):
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'
diff --git a/Mailman/Handlers/Scrubber.py b/Mailman/Handlers/Scrubber.py
index a0c4896c..807e8cd6 100644
--- a/Mailman/Handlers/Scrubber.py
+++ b/Mailman/Handlers/Scrubber.py
@@ -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 calculate_attachments_dir(mlist, msg, msgdata):
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 @@ Url : %(url)s
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
diff --git a/Mailman/Handlers/ToArchive.py b/Mailman/Handlers/ToArchive.py
index 6deb0958..533f2012 100644
--- a/Mailman/Handlers/ToArchive.py
+++ b/Mailman/Handlers/ToArchive.py
@@ -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 @@ def process(mlist, msg, msgdata):
# 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)
diff --git a/Mailman/Handlers/ToDigest.py b/Mailman/Handlers/ToDigest.py
index e796a874..d5f1622a 100644
--- a/Mailman/Handlers/ToDigest.py
+++ b/Mailman/Handlers/ToDigest.py
@@ -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 @@ import time
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 @@ def send_i18n_digests(mlist, mboxfp):
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 @@ def send_i18n_digests(mlist, mboxfp):
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(),