summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2002-08-29 17:26:16 +0000
committerbwarsaw2002-08-29 17:26:16 +0000
commite3586bb066233b06664bfaada731961978bc2b28 (patch)
tree662e711dff3b1b96536543af4f5690855e0c95ff
parent4579c83cbe931439a1501ca799ed0d3f82c25079 (diff)
downloadmailman-e3586bb066233b06664bfaada731961978bc2b28.tar.gz
mailman-e3586bb066233b06664bfaada731961978bc2b28.tar.zst
mailman-e3586bb066233b06664bfaada731961978bc2b28.zip
Some fixes for problems identified by Peer Heinlein. It is possible
that the digest may contain unparseable messages, e.g. with missing start boundaries. Instead of crashing, such messages should simply be ignored. If lax parsing can't grok it, it has a high likelihood of being spam. Specific changes here: send_i18n_digests(): The end case is now that "msg is None", not false, and if msg is the empty string, it was unparseable and we should skip it.
-rw-r--r--Mailman/Handlers/ToDigest.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/Mailman/Handlers/ToDigest.py b/Mailman/Handlers/ToDigest.py
index 02ce5d0c0..18e485364 100644
--- a/Mailman/Handlers/ToDigest.py
+++ b/Mailman/Handlers/ToDigest.py
@@ -4,14 +4,14 @@
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
+# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"""Add the message to the list's current digest and possibly send it.
@@ -199,7 +199,10 @@ def send_i18n_digests(mlist, mboxfp):
messages = []
msgcount = 0
msg = mbox.next()
- while msg:
+ while msg is not None:
+ if msg == '':
+ # It was an unparseable message
+ msg = mbox.next()
msgcount += 1
messages.append(msg)
# Get the Subject header