[Mimedefang] exclude anon-htmlcleaner on rejected messages
Lucas Albers
admin at cs.montana.edu
Wed Jan 7 10:56:25 EST 2004
I noticed anony-html spits out garbage on uninitialized variables for some
spam or virus messages.
(Actually it spits it out for any non valid html email.)
Upgrade your version to 1.24, this will clean up some messages.
So I added a trivial rule to not run anomy-html cleaner on email messages
that are already marked to be rejected.
No point to clean it if you are going to reject it anyways.
So in the beginning of mimedefang-filter, define
$exclude_htmlcleaner=0;
Anywhere you have action_bounce or action_discard or action_quarantine
you would set $exclude_htmlcleaner=1;
Then in filter_end check to not run cleaner on messages you are already
going to reject.
If their was a variable defined when a message was set to be rejected,
then it would be better to use that, but I was not aware of any such
variable.
if ($exclude_clean == 0){
#md_log('warning',$VirusName,"ANONY_HTML_CLEANER Skipped");
# Clean up HTML if Anomy::HTMLCleaner is installed.
if ($Features{"HTMLCleaner"}) {
if ($type eq "text/html") {
my $hash;
$hash = { };
$hash->{"Paranoid"} = 1;
$hash->{"NoWebBugs"} = 1;
return anomy_clean_html($entity,$hash);
}
}
}
You could use this same reasoning to exclude tests you do not need to run
on messages that are already marked to be rejected.
No point to run SA on messages you are already going to reject,etc.
This should clean up your logs signifigantly and speed up your mail
processing.
--Luke Computer Science System Administrator
More information about the MIMEDefang
mailing list