diff options
| author | fukachan <fukachan> | 2006-05-13 11:45:40 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2006-05-13 11:45:40 +0000 |
| commit | e910a4f5d2e95a96b3fdac9b089fe32c3ebb0a16 (patch) | |
| tree | b9f853edb485c521d6cbc23058fd15e263c68549 /fml/lib/FML/Process/Kernel.pm | |
| parent | 4480917b1d0080b6d32dc6bd502945e596db0ba5 (diff) | |
| download | fml8-e910a4f5d2e95a96b3fdac9b089fe32c3ebb0a16.tar.gz fml8-e910a4f5d2e95a96b3fdac9b089fe32c3ebb0a16.tar.bz2 fml8-e910a4f5d2e95a96b3fdac9b089fe32c3ebb0a16.zip | |
enable body based loop check
Diffstat (limited to 'fml/lib/FML/Process/Kernel.pm')
| -rw-r--r-- | fml/lib/FML/Process/Kernel.pm | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/fml/lib/FML/Process/Kernel.pm b/fml/lib/FML/Process/Kernel.pm index 45d2f7d9..56553981 100644 --- a/fml/lib/FML/Process/Kernel.pm +++ b/fml/lib/FML/Process/Kernel.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: Kernel.pm,v 1.282 2006/05/04 05:21:29 fukachan Exp $ +# $FML: Kernel.pm,v 1.283 2006/05/12 13:50:11 fukachan Exp $ # package FML::Process::Kernel; @@ -668,6 +668,9 @@ sub simple_loop_check unless ($match) { $match = $curproc->_header_based_loop_check(); } + unless ($match) { + $match = $curproc->_body_based_loop_check(); + } # $match contains the first matched rule name (== reason). if ($match) { @@ -742,6 +745,38 @@ sub _header_based_loop_check } +# Descriptions: body based loop check. +# Arguments: OBJ($curproc) +# Side Effects: none +# Return Value: STR +sub _body_based_loop_check +{ + my ($curproc) = @_; + my $config = $curproc->config(); + my $match = undef; + my $var_rules = 'incoming_mail_body_loop_check_rules'; + + if ($config->yes('use_incoming_mail_body_loop_check')) { + use FML::Body; + my $body = new FML::Body $curproc; + + my $rules = $config->get_as_array_ref($var_rules); + RULE: + for my $rule (@$rules) { + if ($body->can($rule)) { + $match = $body->$rule($config) ? $rule : undef; + } + else { + $curproc->logwarn("body->${rule}() is undefined"); + } + last RULE if $match; + } + } + + return $match; +} + + # Descriptions: commit message-id cache update transaction. # Arguments: OBJ($curproc) # Side Effects: update cache. |
