summaryrefslogtreecommitdiff
path: root/fml/lib
diff options
context:
space:
mode:
Diffstat (limited to 'fml/lib')
-rw-r--r--fml/lib/FML/Filter/ErrorStatus.pm6
-rw-r--r--fml/lib/FML/Filter/External.pm25
-rw-r--r--fml/lib/FML/Filter/External/bogofilter.pm16
-rw-r--r--fml/lib/FML/Filter/External/spamc.pm18
4 files changed, 58 insertions, 7 deletions
diff --git a/fml/lib/FML/Filter/ErrorStatus.pm b/fml/lib/FML/Filter/ErrorStatus.pm
index 248cfd07..b5e329f6 100644
--- a/fml/lib/FML/Filter/ErrorStatus.pm
+++ b/fml/lib/FML/Filter/ErrorStatus.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$
+# $FML: ErrorStatus.pm,v 1.1 2005/05/27 01:47:04 fukachan Exp $
#
package FML::Filter::ErrorStatus;
@@ -74,7 +74,7 @@ return $message which is saved by C<error_set($msg)>.
# Descriptions: set the error message within $self object.
# Arguments: OBJ($self) STR($mesg)
-# Side Effects: update OBJ
+# Side Effects: update $self.
# Return Value: STR
sub error_set
{
@@ -107,7 +107,7 @@ sub errstr
# Descriptions: clear the error message buffer.
# Arguments: OBJ($self)
-# Side Effects: none
+# Side Effects: update $self.
# Return Value: STR (cleared message)
sub error_clear
{
diff --git a/fml/lib/FML/Filter/External.pm b/fml/lib/FML/Filter/External.pm
index d8594724..46c35542 100644
--- a/fml/lib/FML/Filter/External.pm
+++ b/fml/lib/FML/Filter/External.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: External.pm,v 1.5 2004/08/13 15:02:48 fukachan Exp $
+# $FML: External.pm,v 1.6 2005/05/27 01:47:04 fukachan Exp $
#
package FML::Filter::External;
@@ -19,11 +19,20 @@ FML::Filter::External - spawn external checker program.
=head1 SYNOPSIS
+use FML::Filter::External;
+$ext_filter = new FML::Filter::External;
+$ext_filter->spawn($curproc, $mesg, $driver);
+if ($ext_filter->error()) {
+ ... error handling ...
+}
+
=head1 DESCRIPTION
+This module spawns an specified external checker program.
+
=head1 METHODS
-=head2 C<new()>
+=head2 new()
constructor.
@@ -43,6 +52,18 @@ sub new
}
+=head2 spawn($curproc, $msg, $driver)
+
+spawn external driver e.g. virus checker, spam checker,
+which checks the specified message $msg.
+
+When somthing strange happens and the process not returns,
+this sub-routine timeouts and return temporary failure.
+The timeout is 120 seconds by default (not customizable now).
+
+=cut
+
+
# Descriptions: spawn external driver e.g. virus checker, spam checker.
# Arguments: OBJ($self) OBJ($curproc) OBJ($msg) STR($driver)
# Side Effects: none
diff --git a/fml/lib/FML/Filter/External/bogofilter.pm b/fml/lib/FML/Filter/External/bogofilter.pm
index 310dc15e..71c99040 100644
--- a/fml/lib/FML/Filter/External/bogofilter.pm
+++ b/fml/lib/FML/Filter/External/bogofilter.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: bogofilter.pm,v 1.3 2004/07/23 13:16:38 fukachan Exp $
+# $FML: bogofilter.pm,v 1.4 2004/07/23 15:59:06 fukachan Exp $
#
package FML::Filter::External::bogofilter;
@@ -18,8 +18,14 @@ FML::Filter::External::bogofilter - bogofilter interface.
=head1 SYNOPSIS
+use FML::Filter::External::bogofilter;
+my $ext_filter = new FML::Filter::External::bogofilter;
+$ext_filter->process($curproc, $msg);
+
=head1 DESCRIPTION
+This module checks the specified message $msg by bogofilter.
+
=head1 METHODS
=head2 new()
@@ -42,6 +48,14 @@ sub new
}
+=head2 process($curproc, $msg)
+
+top level dispather.
+It checks if the current message $msg looks a spam by bogofilter.
+
+=cut
+
+
# Descriptions: check if the current message looks a spam.
# Arguments: OBJ($self) OBJ($curproc) OBJ($msg)
# Side Effects: none
diff --git a/fml/lib/FML/Filter/External/spamc.pm b/fml/lib/FML/Filter/External/spamc.pm
index f8e02afd..db9d302b 100644
--- a/fml/lib/FML/Filter/External/spamc.pm
+++ b/fml/lib/FML/Filter/External/spamc.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: spamc.pm,v 1.3 2004/07/23 13:16:38 fukachan Exp $
+# $FML: spamc.pm,v 1.4 2004/07/23 15:59:06 fukachan Exp $
#
package FML::Filter::External::spamc;
@@ -18,8 +18,15 @@ FML::Filter::External::spamc - SpamAssassin interface.
=head1 SYNOPSIS
+use FML::Filter::External::spamc;
+my $ext_filter = new FML::Filter::External::spamc;
+$ext_filter->process($curproc, $msg);
+
=head1 DESCRIPTION
+This module checks the specified message $msg by spamc,
+which calls spamd (spamassassin).
+
=head1 METHODS
=head2 new()
@@ -42,6 +49,14 @@ sub new
}
+=head2 process($curproc, $msg)
+
+top level dispather.
+It checks if the current message $msg looks a spam by spamc (spamassasin).
+
+=cut
+
+
# Descriptions: check if the current message looks a spam.
# Arguments: OBJ($self) OBJ($curproc) OBJ($msg)
# Side Effects: none
@@ -52,6 +67,7 @@ sub process
my $config = $curproc->config();
my $program = $config->{ path_spamc } || '';
my $opts = $config->{ article_spam_filter_spamc_options } || '';
+
if ($program) {
if (-x $program) {
my $_program = sprintf("%s %s", $program, $opts);