summaryrefslogtreecommitdiff
path: root/fml/lib/FML
diff options
context:
space:
mode:
authorfukachan <fukachan>2007-01-16 11:59:54 +0000
committerfukachan <fukachan>2007-01-16 11:59:54 +0000
commitd815bf5a72051cc40d86efb045fda8d4346193ac (patch)
treed36c392b27811a28b002a487c2301b6010e68c89 /fml/lib/FML
parent8f0c206327f36c824918684ce3f8f306325d9af7 (diff)
downloadfml8-d815bf5a72051cc40d86efb045fda8d4346193ac.tar.gz
fml8-d815bf5a72051cc40d86efb045fda8d4346193ac.tar.bz2
fml8-d815bf5a72051cc40d86efb045fda8d4346193ac.zip
align style to other FML::Filter::External module.
clean up logic. fix comments.
Diffstat (limited to 'fml/lib/FML')
-rw-r--r--fml/lib/FML/Filter/External/clamscan.pm25
1 files changed, 19 insertions, 6 deletions
diff --git a/fml/lib/FML/Filter/External/clamscan.pm b/fml/lib/FML/Filter/External/clamscan.pm
index 8b179f02..cdcf0d61 100644
--- a/fml/lib/FML/Filter/External/clamscan.pm
+++ b/fml/lib/FML/Filter/External/clamscan.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: clamscan.pm,v 1.5 2005/05/26 12:17:34 fukachan Exp $
+# $FML: clamscan.pm,v 1.6 2005/08/10 12:55:32 fukachan Exp $
#
package FML::Filter::External::clamscan;
@@ -18,8 +18,14 @@ FML::Filter::External::clamscan - clamav interface.
=head1 SYNOPSIS
+use FML::Filter::External::clamscan;
+my $ext_filter = new FML::Filter::External::clamscan;
+$ext_filter->process($curproc, $msg);
+
=head1 DESCRIPTION
+This module checks the specified message $msg by clamav.
+
=head1 METHODS
=head2 new()
@@ -42,13 +48,21 @@ sub new
}
+=head2 process($curproc, $msg)
+
+top level dispather.
+It checks if the current message $msg looks a virus by clamav.
+
+=cut
+
+
# Descriptions: check if the current message looks a virus.
-# Arguments: OBJ($self) OBJ($curproc)
+# Arguments: OBJ($self) OBJ($curproc) OBJ($msg)
# Side Effects: none
# Return Value: NUM(1 or 0) (1 if spam)
sub process
{
- my ($self, $curproc) = @_;
+ my ($self, $curproc, $msg) = @_;
my $config = $curproc->config();
my $program = $config->{ path_clamscan } || '';
my $_opts = "--quiet --mbox";
@@ -100,13 +114,12 @@ sub _check
my $r = "virus found by clamav";
$curproc->logerror($r);
$curproc->filter_state_virus_checker_set_error($r);
+ return 1;
}
else {
- $curproc->logerror("bogofilter error: code=$?");
+ $curproc->logerror("clamscan error: code=$?");
return 0;
}
-
- return 1;
}
}