[Mailman-Developers] Mal Formed MIME post leakedthrough to list

Barry Warsaw barry at python.org
Mon Sep 19 05:26:13 CEST 2005


On Sun, 2005-09-18 at 17:34, Tokio Kikuchi wrote:

> I think we can write more intuitive and robust code like this:
> 
>      if mlist.max_message_size > 0:
>          bodylen = len(msg.as_string().split('\n\n',1)[1])

The only problem with that is that it's not very efficient to turn the
message back into a flattened string in order to calculate its size.

Here's an idea: Python's FeedParser (or a subclass of that in Mailman)
should keep a running count of the size of data fed to it, and it should
add that to the message as an attribute.  Even cooler would be if each
subpart could have an accurate .size attribute added to it as it was
being parsed.

Anybody care to work up a patch for that?

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/mailman-developers/attachments/20050918/74ea5429/attachment.pgp


More information about the Mailman-Developers mailing list