diff options
| author | fukachan <fukachan> | 2003-03-05 13:54:26 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-03-05 13:54:26 +0000 |
| commit | 71686c4e0f29b8f87a346a226a3b83777dedc895 (patch) | |
| tree | a7fc8e30aa138be1b8476d9d7427d935eec1903b | |
| parent | 2413280597e08927f28a31727f65d8dd9a44a27a (diff) | |
| download | fml8-71686c4e0f29b8f87a346a226a3b83777dedc895.tar.gz fml8-71686c4e0f29b8f87a346a226a3b83777dedc895.tar.bz2 fml8-71686c4e0f29b8f87a346a226a3b83777dedc895.zip | |
experimental implementation of rejection notice of filter.
| -rw-r--r-- | fml/lib/FML/Filter.pm | 39 | ||||
| -rw-r--r-- | fml/lib/FML/Process/Distribute.pm | 7 |
2 files changed, 44 insertions, 2 deletions
diff --git a/fml/lib/FML/Filter.pm b/fml/lib/FML/Filter.pm index bcb76d67..c7eb5a82 100644 --- a/fml/lib/FML/Filter.pm +++ b/fml/lib/FML/Filter.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: Filter.pm,v 1.19 2003/01/11 06:58:44 fukachan Exp $ +# $FML: Filter.pm,v 1.20 2003/02/18 15:55:33 fukachan Exp $ # package FML::Filter; @@ -228,6 +228,43 @@ sub _apply_article_mime_component_filter } +=head1 REJECT NOTIFICATION + +=head2 article_filter_reject_notice($curproc, $msg_args) + +send back message on rejection, with reason if could. + +=cut + + +# Descriptions: +# Arguments: OBJ($self) OBJ($curproc) HASH_REF($msg_args) +# Side Effects: update reply message queue +# Return Value: none +sub article_filter_reject_notice +{ + my ($obj, $curproc, $msg_args) = @_; + my $msg = $curproc->incoming_message(); + my $r = $msg_args->{ _arg_reason } || 'unknown'; + + $curproc->reply_message_nl("error.reject_post", + "your post is rejected.", + $msg_args); + $curproc->reply_message_nl("error.reject_post_reason", + "reason(s) for rejection: $r", + $msg_args); + + # add header info + my $tag = ' '; + my $hdr = $curproc->incoming_message_header(); + my $hdr_str = sprintf("\n%s\n", $hdr->as_string()); + $hdr_str =~ s/\n/\n$tag/g; + $curproc->reply_message($hdr_str); + + $curproc->reply_message($msg, $msg_args); +} + + =head1 CODING STYLE See C<http://www.fml.org/software/FNF/> on fml coding style guide. diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm index 733079dc..5fc886e8 100644 --- a/fml/lib/FML/Process/Distribute.pm +++ b/fml/lib/FML/Process/Distribute.pm @@ -3,7 +3,7 @@ # Copyright (C) 2000,2001,2002,2003 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Distribute.pm,v 1.104 2003/01/25 12:02:41 fukachan Exp $ +# $FML: Distribute.pm,v 1.105 2003/02/16 08:33:09 fukachan Exp $ # package FML::Process::Distribute; @@ -150,6 +150,11 @@ sub _check_filter # filter traps this message. if ($r = $filter->error()) { + my $msg_args = { + _arg_reason => $r, + }; + $filter->article_filter_reject_notice($curproc, $msg_args); + # we should stop this process ASAP. $curproc->stop_this_process(); Log("rejected by filter due to $r"); |
