~ubuntu-branches/ubuntu/quantal/mailman/quantal

« back to all changes in this revision

Viewing changes to debian/patches/77_header_folding_in_attachments.patch

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Elie Mamane, Lionel Elie Mamane, Thijs Kinkhorst
  • Date: 2009-05-22 11:09:49 UTC
  • mfrom: (2.2.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090522110949-3zeqjzyh0k1e3pt8
Tags: 1:2.1.12-2
[ Lionel Elie Mamane ]
* README.Exim4.Debian: add debug_print statements
* apply fix from upstream to 77_header_folding_in_attachments
  to fix bug it introduces: messages with lines starting with
  "From" are split into several messages in the archive.
* Use autoconf >= 2.50, not 2.13
* Ensure Mailman locks directory exists before calling update
  (Closes: #513988).

[ Thijs Kinkhorst ]
* Apply patch from Tanguy Ortolo updating postfix-to-mailman
  instructions to avoid backscatter mail (Closes: #520040).
* Remove obsolete unicodify_archives for upgrading sarge->etch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Author: Lionel Elie Mamane <lionel@mamane.lu>
3
3
Don't fold headers into message/rfc822 attachments.
4
4
This avoids breaking signatures (Closes: #244673)
5
 
Index: mailman-2.1.12/Mailman/Generator.py
6
 
===================================================================
7
 
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
8
 
+++ mailman-2.1.12/Mailman/Generator.py 2009-03-02 20:50:23.000000000 +0100
9
 
@@ -0,0 +1,55 @@
10
 
+# Copyright (C) 1998-2003 by the Free Software Foundation, Inc.
 
5
=== added file 'Mailman/Generator.py'
 
6
--- mailman-${VERSION}/Mailman/Generator.py     1970-01-01 00:00:00 +0000
 
7
+++ mailman-${VERSION}/Mailman/Generator.py     2009-05-21 20:54:34 +0000
 
8
@@ -0,0 +1,57 @@
 
9
+# Copyright (C) 1998-2003,2009 by the Free Software Foundation, Inc.
11
10
+#                    2005 Lionel Elie Mamane <lionel@mamane.lu>
12
11
+#
13
12
+# This program is free software; you can redistribute it and/or
28
27
+# Changed by Lionel Elie Mamane December 2005 from version on
29
28
+# http://ftp.intevation.de/users/bernhard/mailman/mailman-2.1.4-avoid-headerfolding-python21.diff
30
29
+# to use clone/children_maxheaderlen trick instead of _write_headers/mangle_from_
 
30
+# Changed by Mark Sapiro May 2009 to fix bug: messages with lines beginning
 
31
+# with "From" are archived split into several messages.
31
32
+
32
33
+"""Standard Mailman generator object.
33
34
+
53
54
+
54
55
+       Headers will by default _not_ be folded in attachments.
55
56
+    """
56
 
+    def __init__(self, outfp, mangle_from_=False,
 
57
+    def __init__(self, outfp, mangle_from_=True,
57
58
+                 maxheaderlen=78, children_maxheaderlen=0):
58
59
+        email.Generator.Generator.__init__(self, outfp, mangle_from_=mangle_from_, maxheaderlen=maxheaderlen)
59
60
+        self.__children_maxheaderlen = children_maxheaderlen
62
63
+        """Clone this generator with maxheaderlen set for children"""
63
64
+        return self.__class__(fp, self._mangle_from_, self.__children_maxheaderlen, self.__children_maxheaderlen)
64
65
+
65
 
Index: mailman-2.1.12/Mailman/Mailbox.py
66
 
===================================================================
67
 
--- mailman-2.1.12.orig/Mailman/Mailbox.py      2009-03-02 20:41:45.000000000 +0100
68
 
+++ mailman-2.1.12/Mailman/Mailbox.py   2009-03-02 20:50:23.000000000 +0100
 
66
 
 
67
=== modified file 'Mailman/Handlers/SMTPDirect.py'
 
68
--- mailman-${VERSION}/Mailman/Handlers/SMTPDirect.py   2005-12-30 18:50:08 +0000
 
69
+++ mailman-${VERSION}/Mailman/Handlers/SMTPDirect.py   2009-05-21 20:55:38 +0000
 
70
@@ -360,7 +360,7 @@
 
71
     msg['Sender'] = envsender
 
72
     msg['Errors-To'] = envsender
 
73
     # Get the plain, flattened text of the message, sans unixfrom
 
74
-    msgtext = msg.as_string()
 
75
+    msgtext = msg.as_string(mangle_from_=False)
 
76
     refused = {}
 
77
     recips = msgdata['recips']
 
78
     msgid = msg['message-id']
 
79
 
 
80
=== modified file 'Mailman/Mailbox.py'
 
81
--- mailman-${VERSION}/Mailman/Mailbox.py       2005-08-27 01:40:17 +0000
 
82
+++ mailman-${VERSION}/Mailman/Mailbox.py       2009-05-21 23:25:58 +0000
69
83
@@ -22,10 +22,10 @@
70
84
 
71
85
 import email
87
101
         g.flatten(msg, unixfrom=True)
88
102
         # Add one more trailing newline for separation with the next message
89
103
         # to be appended to the mbox.
90
 
Index: mailman-2.1.12/Mailman/Message.py
91
 
===================================================================
92
 
--- mailman-2.1.12.orig/Mailman/Message.py      2009-03-02 20:41:45.000000000 +0100
93
 
+++ mailman-2.1.12/Mailman/Message.py   2009-03-02 20:50:23.000000000 +0100
 
104
 
 
105
=== modified file 'Mailman/Message.py'
 
106
--- mailman-${VERSION}/Mailman/Message.py       2006-03-06 18:21:52 +0000
 
107
+++ mailman-${VERSION}/Mailman/Message.py       2009-05-21 20:54:55 +0000
94
108
@@ -22,6 +22,8 @@
95
109
 """
96
110
 
108
122
 
109
123
 COMMASPACE = ', '
110
124
 
111
 
@@ -207,6 +210,16 @@
 
125
@@ -199,6 +202,16 @@
112
126
         except (UnicodeError, LookupError, ValueError):
113
127
             return failobj
114
128
 
115
 
+    def as_string(self, unixfrom=False):
 
129
+    def as_string(self, unixfrom=False, mangle_from_=True):
116
130
+        """Return entire formatted message as a string using Mailman.Generator.
117
131
+
118
132
+        Operates like email.Message.Message.as_string, only
119
133
+       using Mailman's Generator class. Only the top headers will get folded.
120
134
+        """
121
135
+        fp = StringIO()
122
 
+        g = Generator(fp)
 
136
+        g = Generator(fp, mangle_from_=mangle_from_)
123
137
+        g.flatten(self, unixfrom=unixfrom)
124
138
+        return fp.getvalue()
125
139
 
126
140
 
127
141
 class UserNotification(Message):
 
142