[Mimedefang] mimedefang-filter and v2.40
Aaron Paetznick
aaronp at critd.com
Mon Feb 23 10:03:54 EST 2004
The new beta says: "The previous example filter defined functions called
message_contains_virus and entity_contains_virus. These are now defined
in mimedefang.pl itself; you should remove the definitions from your
filter!". I initially thought this might be a problem for me as I use a
custom message_contains_virus() and entity_contains_virus() to support
using multiple virus scanners. When I look at the code in the new
mimedefang.pl, it seems to be already setup to run cascading virus
scanners (and coded far more elegantly than my original hack). Can
somebody confirm this so that I can remove my custom
message_contains_virus() and entity_contains_virus() subs from my
filter? Here is the code I'm using in my filter:
sub message_contains_virus () {
my($code, $cat, $act);
($code, $cat, $act) = message_contains_virus_clamd();
return (wantarray ? ($code, $cat, $act) : $code) if ($act ne "ok");
($code, $cat, $act) = message_contains_virus_filescan();
return (wantarray ? ($code, $cat, $act) : $code) if ($act ne "ok");
return (wantarray ? (0, 'ok', 'ok') : 0);
}
sub entity_contains_virus ($) {
my($e) = @_;
my($code, $cat, $act);
($code, $cat, $act) = entity_contains_virus_clamd($e);
return (wantarray ? ($code, $cat, $act) : $code) if ($act ne "ok");
($code, $cat, $act) = entity_contains_virus_filescan($e);
return (wantarray ? ($code, $cat, $act) : $code) if ($act ne "ok");
return (wantarray ? (0, 'ok', 'ok') : 0);
}
...thanks!
--Aaron
More information about the MIMEDefang
mailing list