senddigests doesn't handle consecutive unparseable messages

Bug #266094 reported by Andreas Vögele
2
Affects Status Importance Assigned to Milestone
GNU Mailman
Fix Released
Medium
Unassigned

Bug Description

The following code fragment in send_i18n_digests in Mailman/
Handlers/ToDigest.py doesn't take into account that there could be
several consecutive messages that are unparseable:

    msg = mbox.next()
    while msg is not None:
        if msg == '':
            # It was an unparseable message
            msg = mbox.next()
        [...]
        # Get the next message in the digest mailbox
        msg = mbox.next()

I'm not that familiar with Python but I think that the following code
should fix the problem:

    while 1:
      msg = mbox.next()
      if msg is None:
           break
      if msg == '':
          # It was an unparseable message
          continue
      [...]

[http://sourceforge.net/tracker/index.php?func=detail&aid=975768&group_id=103&atid=100103]

Revision history for this message
Thomas-ah-users (thomas-ah-users) wrote :

This bug is still present and hit our mailman installation
last friday. The problem occurs if the unparseable message
is the last one, too.

Here is a patch against current CVS, effectively doing the
same as Andreas Voegele suggested, but with cleaner code.
Unfortunately this tracker doesn't allow me to attach it,
because I didn't submit this bug.

diff -u -r2.28 ToDigest.py
--- Mailman/Handlers/ToDigest.py 15 Aug 2003 21:06:28 -0000 2.28
+++ Mailman/Handlers/ToDigest.py 13 Sep 2004 12:22:03 -0000
@@ -210,6 +210,7 @@
         if msg == '':
             # It was an unparseable message
             msg = mbox.next()
+ continue
         msgcount += 1
         messages.append(msg)
         # Get the Subject header

Revision history for this message
Tokio Kikuchi (tkikuchi) wrote :

Fixed in CVS. Thank you!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.