Update of /cvsroot/mailman/mailman/Mailman/Handlers
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3403

Modified Files:
      Tag: Release_2_1-maint
        Hold.py 
Log Message:
process(): Patch by Mark Sapiro (slightly modified by Barry) to take preambles
and epilogues in the calculation of messages sizes.


Index: Hold.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Handlers/Hold.py,v
retrieving revision 2.33.2.5
retrieving revision 2.33.2.6
diff -u -d -r2.33.2.5 -r2.33.2.6
--- Hold.py     27 Aug 2005 01:40:16 -0000      2.33.2.5
+++ Hold.py     19 Sep 2005 03:08:57 -0000      2.33.2.6
@@ -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

Reply via email to