From 9d78d653a0e8dd7d762b520bdd311fbbf483e2c5 Mon Sep 17 00:00:00 2001 From: bwarsaw <> Date: Tue, 16 Dec 2003 05:11:07 +0000 Subject: send_i18n_digests(): Configurations can change between the time a message is originally received and the time the digest is sent. If the configuration changes by setting ARCHIVE_HTML_SANITIZER to 0, a DiscardMessage exception can occur during the scrubbing. Catch this error. Closes SF #860135 with basic solution by Martin Pool. --- Mailman/Handlers/ToDigest.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Mailman/Handlers/ToDigest.py b/Mailman/Handlers/ToDigest.py index 5d354473..525cafd0 100644 --- a/Mailman/Handlers/ToDigest.py +++ b/Mailman/Handlers/ToDigest.py @@ -44,6 +44,7 @@ from Mailman import mm_cfg 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,11 @@ def send_i18n_digests(mlist, mboxfp): 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: + print >> plainmsg, _('[Message discarded by content filter]') + continue # Honor the default setting for h in mm_cfg.PLAIN_DIGEST_KEEP_HEADERS: if msg[h]: -- cgit v1.2.3