[Mimedefang] DoD finally bans HTML e-mail

David F. Skoll dfs at roaringpenguin.com
Mon Jan 8 10:11:53 EST 2007


WBrown at e1b.org wrote:

> If I were implementing it, I would simply strip any tags, possibly 
> replacing some of them with their intended action, ie spaces and line 
> breaks.

I think you'd be better off filtering the HTML part through lynx -dump.
You can even do it with some fairly simple MIMEDefang code in filter:

sub filter {
    my($entity, $fname, $ext, $type) = @_;

    if (lc($type) eq 'text/html') {
        action_external_filter($entity, 'lynx -dump < FILTERINPUT > FILTEROUTPUT');
	$entity->head->replace('content-type', 'text/plain');
	$entity->head->replace('content-transfer-encoding', '8bit');
    }
}

Be aware that this will consume quite a bit of CPU power, and very likely
annoy the h*ll out of your users. :-)

Regards,

David.



More information about the MIMEDefang mailing list