diff options
author | bwarsaw <> | 2003-09-22 02:37:51 +0000 |
---|---|---|
committer | bwarsaw <> | 2003-09-22 02:37:51 +0000 |
commit | c43087be33f78a895b74869800a775c4a0cb9a27 (patch) | |
tree | 7f5418e8b5a8eb70d0639ef9d11f16d685f57517 | |
parent | d206e467d12f5e5a6e08f6ed11a559054f2e183f (diff) | |
download | mailman2-c43087be33f78a895b74869800a775c4a0cb9a27.tar.gz mailman2-c43087be33f78a895b74869800a775c4a0cb9a27.tar.xz mailman2-c43087be33f78a895b74869800a775c4a0cb9a27.zip |
Backporting from the HEAD -- updated handlers
-rw-r--r-- | Mailman/Handlers/CookHeaders.py | 2 | ||||
-rw-r--r-- | Mailman/Handlers/Moderate.py | 4 | ||||
-rw-r--r-- | Mailman/Handlers/Scrubber.py | 7 | ||||
-rw-r--r-- | Mailman/Handlers/ToDigest.py | 5 |
4 files changed, 11 insertions, 7 deletions
diff --git a/Mailman/Handlers/CookHeaders.py b/Mailman/Handlers/CookHeaders.py index 9ef5550c..2ec1f3f7 100644 --- a/Mailman/Handlers/CookHeaders.py +++ b/Mailman/Handlers/CookHeaders.py @@ -169,7 +169,7 @@ def process(mlist, msg, msgdata): if mlist.description: # Make sure description is properly i18n'd listid_h = uheader(mlist, mlist.description, 'List-Id') - listid_h.append(' ' + listid, 'us-ascii') + listid_h.append(listid, 'us-ascii') else: # For wrapping listid_h = Header(listid, 'us-ascii', header_name='List-Id') diff --git a/Mailman/Handlers/Moderate.py b/Mailman/Handlers/Moderate.py index d44cb89b..61e6cafc 100644 --- a/Mailman/Handlers/Moderate.py +++ b/Mailman/Handlers/Moderate.py @@ -1,4 +1,4 @@ -# Copyright (C) 2001,2002 by the Free Software Foundation, Inc. +# Copyright (C) 2001-2003 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 @@ -45,7 +45,7 @@ class ModeratedMemberPost(Hold.ModeratedPost): def process(mlist, msg, msgdata): - if msgdata.get('approved'): + if msgdata.get('approved') or msgdata.get('fromusenet'): return # First of all, is the poster a member or not? for sender in msg.get_senders(): diff --git a/Mailman/Handlers/Scrubber.py b/Mailman/Handlers/Scrubber.py index b5be73df..7bc5f510 100644 --- a/Mailman/Handlers/Scrubber.py +++ b/Mailman/Handlers/Scrubber.py @@ -301,8 +301,11 @@ Url : %(url)s try: t = unicode(t, partcharset, 'replace') except (UnicodeError, LookupError): - # Replace funny characters - t = unicode(t, 'ascii', 'replace').encode('ascii') + # Replace funny characters. We use errors='replace' for + # both calls since the first replace will leave U+FFFD, + # which isn't ASCII encodeable. + u = unicode(t, 'ascii', 'replace') + t = u.encode('ascii', 'replace') try: # Should use HTML-Escape, or try generalizing to UTF-8 t = t.encode(charset, 'replace') diff --git a/Mailman/Handlers/ToDigest.py b/Mailman/Handlers/ToDigest.py index b25b1f4f..5d354473 100644 --- a/Mailman/Handlers/ToDigest.py +++ b/Mailman/Handlers/ToDigest.py @@ -44,6 +44,7 @@ from Mailman import mm_cfg from Mailman import Utils from Mailman import Message from Mailman import i18n +from Mailman.Mailbox import Mailbox from Mailman.MemberAdaptor import ENABLED from Mailman.Handlers.Decorate import decorate from Mailman.Queue.sbcache import get_switchboard @@ -74,8 +75,8 @@ def process(mlist, msg, msgdata): mboxfp = open(mboxfile, 'a+') finally: os.umask(omask) - g = Generator(mboxfp) - g.flatten(msg, unixfrom=True) + mbox = Mailbox(mboxfp) + mbox.AppendMessage(msg) # Calculate the current size of the accumulation file. This will not tell # us exactly how big the MIME, rfc1153, or any other generated digest # message will be, but it's the most easily available metric to decide |