From ccd53bc99e5aa7bf6cc2565f6dca8762351767ec Mon Sep 17 00:00:00 2001 From: tkikuchi <> Date: Sat, 12 Feb 2005 14:31:45 +0000 Subject: Request from Brad Knowles. We need subject prefix stripped from the posts from mailling list for gatewaying to nntp. --- Mailman/Handlers/CookHeaders.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Mailman/Handlers') diff --git a/Mailman/Handlers/CookHeaders.py b/Mailman/Handlers/CookHeaders.py index c76fe498..fce88c44 100644 --- a/Mailman/Handlers/CookHeaders.py +++ b/Mailman/Handlers/CookHeaders.py @@ -300,8 +300,16 @@ def prefix_subject(mlist, msg, msgdata): h = h.encode('us-ascii') else: h = unicode(h, 'us-ascii').encode('us-ascii') + h = uheader(mlist, h, 'Subject', continuation_ws=ws) del msg['subject'] msg['Subject'] = h + ss = ' '.join([recolon, subject]) + if _isunicode(ss): + ss = ss.encode('us-ascii') + else: + ss = unicode(ss, 'us-ascii').encode('us-ascii') + ss = uheader(mlist, ss, 'Subject', continuation_ws=ws) + msgdata['stripped_subject'] = ss return except UnicodeError: pass @@ -324,6 +332,9 @@ def prefix_subject(mlist, msg, msgdata): h.append(subject, cset) del msg['subject'] msg['Subject'] = h + ss = uheader(mlist, recolon, 'Subject', continuation_ws=ws) + ss.append(subject, cset) + msgdata['stripped_subject'] = ss def ch_oneline(s): -- cgit v1.2.3