[Mimedefang] multipart/alternate

David F. Skoll dfs at roaringpenguin.com
Fri Dec 14 13:37:28 EST 2001

On Fri, 14 Dec 2001, Ashley M. Kirchner wrote:

> If a message containing both text/html, and it's text/plain
> alternate in it, is it possible to strip away the text/html part, and
> pass the msg along as just text/plain?

It's somewhat tricky because of the way MIMEDefang is designed.  filter()
is called once for each part, and you have to remember that you've
seen a text/plain part to safely strip out the text/html part.  If the HTML
part comes first, it's not possible to strip it out from filter() once you
realize you have a plain text part also.

Something like this requires a "global" view of the message, and would
most likely have to be done with custom code in filter_end().  filter_end()
gets passed the entire rebuilt MIME message, and you can perform further
surgery on it then.  You need to be intimately familiar with the internals
of mimedefang.pl and the MIME::Tools module, though.

> Can it be stripped out and dumped as an attachment (through
> action_replace_with_url() )?

Sure.  Or you can filter it through "lynx -dump" to convert it to
plain text.


More information about the MIMEDefang mailing list