[ mailman-Bugs-975768 ] senddigests doesn't handle consecutive unparseable messages

SourceForge.net noreply at sourceforge.net
Mon Sep 13 14:30:54 CEST 2004


Bugs item #975768, was opened at 2004-06-19 09:07
Message generated for change (Comment added) made by thomas_ah
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=100103&aid=975768&group_id=103

Category: mail delivery
Group: 2.1 (stable)
Status: Open
Resolution: None
Priority: 5
Submitted By: Andreas Voegele (voegelas)
Assigned to: Nobody/Anonymous (nobody)
Summary: senddigests doesn't handle consecutive unparseable messages

Initial Comment:
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
      [...]

----------------------------------------------------------------------

Comment By: Thomas Arendsen Hein (thomas_ah)
Date: 2004-09-13 14:30

Message:
Logged In: YES 
user_id=839582

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


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=100103&aid=975768&group_id=103


More information about the Mailman-coders mailing list