[Mailman-Developers] Bug#61695: mailman: mail->news gw blows up on mails without subject (fwd)

Barry A. Warsaw bwarsaw@cnri.reston.va.us
Mon, 3 Apr 2000 23:38:59 -0400 (EDT)


>>>>> "GM" == Gergely Madarasz <gorgo@sztaki.hu> writes:

    GM> I just got this bugreport in the debian BTS. Comments ?

It's a valid bug that will crash anytime the message is missing a
Subject: header.  The easy workaround is to make sure the Subject:
header is present before the message gets posted to the list.

While this bug was still present in 2.0beta1, I've fixed it for
2.0beta2.  The code's changed too much to provide a Mailman 1.1 patch,
but here's the patch against 2.0beta1; it should be easy enough to
find in the 1.1 source tree.

Please feel free to forward this to the appropriate debian lists.

-Barry

-------------------- snip snip --------------------
Index: ToUsenet.py
===================================================================
RCS file: /projects/cvsroot/mailman/Mailman/Handlers/ToUsenet.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -c -r1.8 -r1.9
*** ToUsenet.py	2000/03/23 06:48:52	1.8
--- ToUsenet.py	2000/04/04 03:35:05	1.9
***************
*** 58,65 ****
      from Mailman.pythonlib import nntplib
      # Ok, munge headers, etc.
      subj = msg.getheader('subject')
      if subj:
-         subjpref = mlist.subject_prefix
          if not re.match('(re:? *)?' + re.escape(subjpref), subj, re.I):
              msg['Subject'] = subjpref + subj
      else:
--- 58,65 ----
      from Mailman.pythonlib import nntplib
      # Ok, munge headers, etc.
      subj = msg.getheader('subject')
+     subjpref = mlist.subject_prefix
      if subj:
          if not re.match('(re:? *)?' + re.escape(subjpref), subj, re.I):
              msg['Subject'] = subjpref + subj
      else: