[Mailman-Developers] Modifying mailman to filter archived messages

Barry A. Warsaw barry@zope.com
Thu, 25 Jul 2002 23:38:16 -0400

>>>>> "LB" == Laurence Berland <laurence@digitalpulp.com> writes:

    LB> Ouch-I guess I missed this little detail. I'm trying to get an
    LB> idea of how best to do this.  Does this work? (easier in pcode
    LB> than english):

If all you care about is modifying text/plain parts, this should be
much simpler:

from email.Iterators import typed_subpart_iterator


def munge(msg):
    for part in typed_subpart_iterator(msg, 'text', 'plain'):
	body = part.get_payload()
	newbody = hack_body(body)