[Mailman-Developers] [ mailman-Bugs-540978 ] List-* header multiline split bug

noreply@sourceforge.net noreply@sourceforge.net
Mon Dec 2 16:09:35 2002

Bugs item #540978, was opened at 2002-04-08 08:56
You can respond by visiting: 

Category: mail delivery
Group: 2.1 beta
>Status: Closed
>Resolution: Out of Date
Priority: 7
Submitted By: Markus Mandalka (mandalka)
Assigned to: Nobody/Anonymous (nobody)
Summary: List-* header multiline split bug

Initial Comment:
I have a list 
antiatomforum@lists.kommunikationssystem.de and others 
with long names.

It seems that mailman can not handle with such long 
names, because in the subscribe-mail (which you have 
to answer to be in the list) the first columns are 
some things from the header (unsubscribe: 
xxx@lists.xxx and so on).

Whith names like atest@lists.kommunikationssystem.de 
it works.


Comment By: Barry A. Warsaw (bwarsaw)
Date: 2002-08-23 17:38

Logged In: YES 

Changing the summary


Comment By: Nobody/Anonymous (nobody)
Date: 2002-08-15 00:37

Logged In: NO 

I just installed mailman and can confirm this bug as well.  
When the list address + hostname is too long (in my case 
the listname was north-texas-stovebolters-
club@stovebolt.stovebolt.com -- 52 characters total) the 
headers overflow into the body of the message.  The "break 
point" was at the List Subscribe line:
This is header:

(total of 94 characters before the split)
This is body


List-Help: <mailto:north-texas-stovebolters-club-
Sender: north-texas-stovebolters-club-
Errors-To: north-texas-stovebolters-club-
This is the initial text of the message that was posted.

I'm sure that I'll be there. :-)

It looks like there's a line break or line limit that's causing 
the problem.  Perhaps it's line 33:

The first line that breaks (in my case) is a line that has 94 
characters in the first part, none of which can be separated 
(no spaces or line breaks, just continuous text.)

The very next line drops to the body.

I believe giuans is correct that the problem is in the wrap 
section of the code, because the break occurs immediately 
after a comma, which, if I'm understanding the code 
correctly, is inserted by the program after an overlength 
line occurs, to split the line at 78 (or as close to that as it 
can get.)

I think the correct fix would be to add the "h" portion 
subsequent to the split so that each line in the header 
would have the required semi-colon to indicate that it's 
header.  If the MTA sees a line with no semicolon, it's going 
to think that it's body text, not header.

Present code:
if len(h) + 2 + len(v) > 78:
            v = CONTINUATION.join(v.split(', '))
        msg[h] = v

Possible fix
if len(h) + 2 + len(v) > 78:
            v=CONTINUATION.join(h + v.split(','))
        msg[h] = v

or something like that.  (I haven't worked with php, so I'm 
not familiar with its functions and syntax.)  The idea is to 
split a line like this:

Line exceeds 78 characters?
h+ rest of v



Comment By: Jean Millerat (drsigmund)
Date: 2002-07-04 04:13

Logged In: YES 

I have reached the same bug with mailing list adresses such as
<11 characters>@<30 characters> whereas <8 characters>@<30
characters> works properly. The effect of this bug is that
the headers of the subcription annoucement or any further
email from the list are "mangled" as was said on
[mailman-developers]. As an example when one of the List-*
header line is too long, it is broken in two parts (and the
second part is indented). Since then, Outlook (and I suppose
other email clients) think this second part of the broken
header line is the beginning of the body of the message.
Therefore the remaining headers are sent as part of the body
of the message !

I think this bug does not only occur with too long email
adresses but may occur with too long header lines whichever
line it is (even with the Subject line especially when this
subject line is very long because of quoted-printable
characters). See [mailman-developers] for the description of
maybe the same bug, in mails dealing with headers being

My current workarounds :
- using short mailing list names.
- and not sending quoted-printable characters within subject


Comment By: Giovanni Lopedote (giuans)
Date: 2002-05-02 10:27

Logged In: YES 

I've found it. A fast fix for is to comment lines 149-150 
in Mailman/Handlers:/CookHeaders.py:

--- CookHeaders.py      2002-05-02 14:51:36.000000000 +0200
+++ CookHeaders.py.new  2002-05-02 16:12:09.000000000 +0200
@@ -146,8 +146,8 @@
         # Wrap these lines if they are too long.  78 
character width probably
         # shouldn't be hardcoded, but is at least 
text-MUA friendly.  The
         # adding of 2 is for the colon-space separator.
-        if len(h) + 2 + len(v) > 78:
-            v = CONTINUATION.join(v.split(', '))
+#        if len(h) + 2 + len(v) > 78:
+#            v = CONTINUATION.join(v.split(', '))
         msg[h] = v
     # Always delete List-Archive header, but only add it 
back if the list is
     # actually archiving

Tested with Mailman 2.1b1, Source Mage GNU/Linux 2.4.18, 
Postfix 1.1.7.
I know there should be a better way, but I'm not a Python 
programmer at all. :)


Comment By: Barry A. Warsaw (bwarsaw)
Date: 2002-04-11 18:03

Logged In: YES 

I've confirmed this bug, but don't have a fix for it right now.


You can respond by visiting: 

More information about the Mailman-Developers mailing list