diff options
| author | fukachan <fukachan> | 2003-05-14 12:01:59 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-05-14 12:01:59 +0000 |
| commit | 0ef19fdfe7f44f18de5876b3be270b5759782113 (patch) | |
| tree | 61b124a0f40f20c9531d2a25f305f561c82874ca /fml/lib/FML/Process/Command.pm | |
| parent | 38758e30bce59cc88ab714fc88c2dc8459dd08c4 (diff) | |
| download | fml8-0ef19fdfe7f44f18de5876b3be270b5759782113.tar.gz fml8-0ef19fdfe7f44f18de5876b3be270b5759782113.tar.bz2 fml8-0ef19fdfe7f44f18de5876b3be270b5759782113.zip | |
implement size limit filter for both article and command mail.
Diffstat (limited to 'fml/lib/FML/Process/Command.pm')
| -rw-r--r-- | fml/lib/FML/Process/Command.pm | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/fml/lib/FML/Process/Command.pm b/fml/lib/FML/Process/Command.pm index a378d2e8..6f9e9385 100644 --- a/fml/lib/FML/Process/Command.pm +++ b/fml/lib/FML/Process/Command.pm @@ -3,7 +3,7 @@ # Copyright (C) 2000,2001,2002,2003 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Command.pm,v 1.84 2003/03/05 15:07:31 fukachan Exp $ +# $FML: Command.pm,v 1.85 2003/03/15 09:03:52 fukachan Exp $ # package FML::Process::Command; @@ -119,11 +119,52 @@ sub verify_request $curproc->verify_sender_credential(); + unless ($curproc->is_refused()) { + $curproc->_check_filter($args); + } + $eval = $config->get_hook( 'command_verify_request_end_hook' ); if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; } } +# Descriptions: filter +# Arguments: OBJ($curproc) HASH_REF($args) +# Side Effects: set flag to ignore this process if it should be filtered. +# Return Value: none +sub _check_filter +{ + my ($curproc, $args) = @_; + my $config = $curproc->config(); + + eval q{ + use FML::Filter; + my $filter = new FML::Filter; + my $r = $filter->command_mail_filter($curproc, $args); + + # filter traps this message. + if ($r = $filter->error()) { + if ($config->yes('use_command_mail_filter_reject_notice')) { + my $msg_args = { + _arg_reason => $r, + }; + + Log("(debug) filter: inform rejection"); + $filter->command_mail_filter_reject_notice($curproc,$msg_args); + } + else { + Log("filter: not inform rejection"); + } + + # we should stop this process ASAP. + $curproc->stop_this_process(); + Log("rejected by filter due to $r"); + } + }; + Log($@) if $@; +} + + =head2 C<run($args)> dispatcher to run correspondig C<FML::Command::command> for |
