Update of /cvsroot/mailman/mailman/Mailman/Handlers
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6099/Mailman/Handlers
Modified Files:
Hold.py
Log Message:
Port Mark Sapiro's patch for including the preamble and epilogue sizes in
message size calculations (and a few others) from the 2.1 maintenance
release.
Index: Hold.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Handlers/Hold.py,v
retrieving revision 2.37
retrieving revision 2.38
diff -u -d -r2.37 -r2.38
--- Hold.py 28 Aug 2005 05:31:27 -0000 2.37
+++ Hold.py 19 Sep 2005 03:23:11 -0000 2.38
@@ -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 @@
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 @@
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))
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org