[Zope-dev] I have a dream!

Phillip J. Eby pje@telecommunity.com
Thu, 09 Dec 1999 12:46:09 -0500


At 10:32 AM 12/9/99 -0500, Michel Pelletier wrote:
>
>While were on the subject, I have a dream too, people not sending HTML 
>encoded mail to the list. ;)
>

Your dream is perhaps much nearer to realization than a JZope
implementation.  :)  Ty recently wrote a Python de-HTML/de-attachmentizer
which we use to sanitize incoming e-mail to IDS.  I am officially
authorizing the donation of the current version of that code for y'all to
use, especially if you'll turn it into a Mailman patch that can then
benefit other Mailman users.

The de-attachmentizer recursively converts all parts of a MIME message to
text, correctly handling all the various multipart/* variants.  It throws
away winmail.dat and other common MS yuckies, as well as leaving behind
text notations describing the binary attachments that were removed.  If it
finds an HTML part that has no plain text alternative, as a last resort it
uses Python's HTML-to-text functions to crudely format it.  No HTML which
is identified as such in any mail header will survive intact, and nothing
which is not text will survive at all.  :)