What's the recommended clean way to tell which scanner found a virus
for use in mimedefang-filter?  I'm interested in being able to log it
for troubleshooting purposes.

After looking through the example filter, mimedefang.pl, I had in
mind to define my own message_contains_virus that would return it,
but I'd prefer to use the built-in routines whenever possible.
I would make a feature request for message_contains_virus() to
return the scanner as well:

--- /usr/local/bin/mimedefang.pl        Fri Apr 16 15:02:59 2004
+++ mimedefang.pl.scanner-name  Fri May  7 11:34:20 2004
@@ -6048,7 +6048,7 @@
     foreach $scanner (@VirusScannerMessageRoutines) {
        ($scode, $scat, $sact) = &$scanner();
        if ($scat eq "virus") {
-           return (wantarray ? ($scode, $scat, $sact) : $scode);
+           return (wantarray ? ($scode, $scat, $sact, $scanner) : $scode);
        }
        if ($scat ne "ok") {
            $code = $scode;
@@ -6084,7 +6084,7 @@
     foreach $scanner (@VirusScannerEntityRoutines) {
        ($scode, $scat, $sact) = &$scanner($e);
        if ($scat eq "virus") {
-           return (wantarray ? ($scode, $scat, $sact) : $scode);
+           return (wantarray ? ($scode, $scat, $sact, $scanner) : $scode);
        }
        if ($scat ne "ok") {
            $code = $scode;


... but I'm not sure that I understand all of the ramifications of doing so. I assume that the prototyping would break some people's filters if they're defining their own *_contains_virus() routines. I know that I'd have to chop off "[message|entity]_contains_virus_" from the returned value, but that's something that would belong in the filter anyway, IMO.

-royce

--
------------------------------------------------------------------------
Royce D. Williams                                    IP Engineering, ACS
work: [EMAIL PROTECTED]                  PGP: 3FC087DB/1776A531
personal: [EMAIL PROTECTED]                 http://www.tycho.org/royce/
_______________________________________________
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to