Make Mailman 2.1.2 not split List-Id header lines (in normal situations). Fixes bug sf#665732 . I've also checked that it is okay to do this by RFC2822 as the linelength of 78 is only RECOMMENDED (SHOULD) and this is case we have a good reason to deviate from the rule of thumb. To stay below 1000 characters including CRLF is the MUST. I'm using 996 analogous to the default maxlinelen of email.Header.Header with is 76 also leaving four extra characters without other reasons. Bernhard Reiter diff -ru mailman-2.1.2/Mailman/Handlers/CookHeaders.py mailman-2.1.2-work/Mailman/Handlers/CookHeaders.py --- mailman-2.1.2/Mailman/Handlers/CookHeaders.py Tue Aug 5 18:43:04 2003 +++ mailman-2.1.2-work/Mailman/Handlers/CookHeaders.py Tue Aug 5 18:45:18 2003 @@ -33,13 +33,14 @@ CONTINUATION = ',\n\t' COMMASPACE = ', ' MAXLINELEN = 78 +MAXLISTIDLINELEN = 996 def _isunicode(s): return isinstance(s, UnicodeType) -def uheader(mlist, s, header_name=None, continuation_ws='\t'): +def uheader(mlist, s, header_name=None, continuation_ws='\t', maxlinelen=None): # Get the charset to encode the string in. If this is us-ascii, we'll use # iso-8859-1 instead, just to get a little extra coverage, and because the # Header class tries us-ascii first anyway. @@ -55,7 +56,7 @@ s = unicode(s, codec, 'replace') # We purposefully leave no space b/w prefix and subject! return Header(s, charset, header_name=header_name, - continuation_ws=continuation_ws) + continuation_ws=continuation_ws, maxlinelen=maxlinelen) @@ -168,11 +169,13 @@ listid = '<%s.%s>' % (mlist.internal_name(), mlist.host_name) if mlist.description: # Make sure description is properly i18n'd - listid_h = uheader(mlist, mlist.description, 'List-Id') + listid_h = uheader(mlist, mlist.description, 'List-Id', + maxlinelen=MAXLISTIDLINELEN) listid_h.append(' ' + listid, 'us-ascii') else: - # For wrapping - listid_h = Header(listid, 'us-ascii', header_name='List-Id') + # For non-wrapping, making sure we don't go over 1000 chars + listid_h = Header(listid, 'us-ascii', maxlinelen=MAXLISTIDLINELEN, + header_name='List-Id') # We always add a List-ID: header. del msg['list-id'] msg['List-Id'] = listid_h diff -ru mailman-2.1.2/Mailman/Version.py mailman-2.1.2-work/Mailman/Version.py --- mailman-2.1.2/Mailman/Version.py Tue Aug 5 18:26:45 2003 +++ mailman-2.1.2-work/Mailman/Version.py Tue Aug 5 18:45:39 2003 @@ -15,7 +15,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Mailman version -VERSION = "2.1.2.local1" +VERSION = "2.1.2" # And as a hex number in the manner of PY_VERSION_HEX ALPHA = 0xa