[Mimedefang] Re: html to text (Matt Kozloski)
David F. Skoll
dfs at roaringpenguin.com
Tue Mar 12 10:54:33 EST 2002
On Tue, 12 Mar 2002, Kozloski, Matthew wrote:
> I am just dropping the text/html part of the message. It has worked well,
> and we haven't lost anything.
That's somewhat dangerous. Many mailers use multipart/alternative to
include both plain-text and HTML versions of the same message, but
some do not.
If you want to convert HTML to text and are not on a busy mail server,
something like this should work:
if ($type eq "text/html") {
action_external_filter($entity,
"lynx -nobold -nolist -dump FILTERINPUT > FILTEROUTPUT");
$entity->head->mime_attr("content-type" => "text/plain");
}
If you are on a busy mail server, forking and execing lynx might be too
expensive.
Regards,
David.
More information about the MIMEDefang
mailing list