aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbwarsaw <>2005-09-19 03:08:57 +0000
committerbwarsaw <>2005-09-19 03:08:57 +0000
commit64278cc8ac6897565d72788e24a4e4bb4f0fae14 (patch)
treebe4313e8a8598f7c7865921981b2551879919cc8
parent65ad32933ca946464551cb734ef18be4997af594 (diff)
downloadmailman2-64278cc8ac6897565d72788e24a4e4bb4f0fae14.tar.gz
mailman2-64278cc8ac6897565d72788e24a4e4bb4f0fae14.tar.xz
mailman2-64278cc8ac6897565d72788e24a4e4bb4f0fae14.zip
process(): Patch by Mark Sapiro (slightly modified by Barry) to take preambles
and epilogues in the calculation of messages sizes.
-rw-r--r--Mailman/Handlers/Hold.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Mailman/Handlers/Hold.py b/Mailman/Handlers/Hold.py
index ffc0839b..fdfaa09d 100644
--- a/Mailman/Handlers/Hold.py
+++ b/Mailman/Handlers/Hold.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2004 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2005 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -25,7 +25,6 @@ we do nothing. If the message must be held for approval, then the hold
database is updated and any administrator notification messages are sent.
Finally an exception is raised to let the pipeline machinery know that further
message handling should stop.
-
"""
import email
@@ -176,6 +175,11 @@ def process(mlist, msg, msgdata):
bodylen = 0
for line in email.Iterators.body_line_iterator(msg):
bodylen += len(line)
+ for part in msg.walk():
+ if part.preamble:
+ bodylen += len(part.preamble)
+ if part.epilogue:
+ bodylen += len(part.epilogue)
if bodylen/1024.0 > mlist.max_message_size:
hold_for_approval(mlist, msg, msgdata,
MessageTooBig(bodylen, mlist.max_message_size))