handle DiscardMessage in ToDigest handler

Bug #558099 reported by mbp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Mailman
Fix Released
Undecided
Unassigned

Bug Description

Our scrubber was raising DiscardMessage exceptions when
trying to scrub messages from the digest. This
situation may have arisen because of a configuration
change that allowed some messages to get into the
digest mailbox when they would previously have been
scrubbed out.

In any case, it was causing exceptions like this:

Traceback (most recent call last):
  File "/usr/local/mailman/cron/senddigests", line 94, in ?
    main()
  File "/usr/local/mailman/cron/senddigests", line 86,
in main
    mlist.send_digest_now()
  File "/usr/local/mailman/Mailman/Digester.py", line
60, in send_digest_now
    ToDigest.send_digests(self, mboxfp)
  File
"/usr/local/mailman/Mailman/Handlers/ToDigest.py", line
131, in send_digests
    send_i18n_digests(mlist, mboxfp)
  File
"/usr/local/mailman/Mailman/Handlers/ToDigest.py", line
304, in send_i18n_digests
    msg = scrubber(mlist, msg)
  File
"/usr/local/mailman/Mailman/Handlers/Scrubber.py", line
178, in process
    raise DiscardMessage
Mailman.Errors.DiscardMessage

It seems reasonable to have the ToDigest handler
respond to these exceptions by discarding the message,
per this patch

--- ToDigest.py.orig Mon Dec 15 02:21:51 2003
+++ ToDigest.py Mon Dec 15 02:23:19 2003
@@ -44,6 +44,7 @@
 from Mailman import Utils
 from Mailman import Message
 from Mailman import i18n
+from Mailman import Errors
 from Mailman.Mailbox import Mailbox
 from Mailman.MemberAdaptor import ENABLED
 from Mailman.Handlers.Decorate import decorate
@@ -301,7 +302,10 @@
             print >> plainmsg, separator30
             print >> plainmsg
         # Use Mailman.Handlers.Scrubber.process() to
get plain text
- msg = scrubber(mlist, msg)
+ try:
+ msg = scrubber(mlist, msg)
+ except (Errors.DiscardMessage):
+ continue
         # Honor the default setting
         for h in mm_cfg.PLAIN_DIGEST_KEEP_HEADERS:
             if msg[h]:

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.