diff options
| author | fukachan <fukachan> | 2003-02-03 12:25:58 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-02-03 12:25:58 +0000 |
| commit | 52905e4eb47df4e80ebf274af1824e1e5c1c8781 (patch) | |
| tree | 3fdb6603e94aac0fb300a5b9d9e461e150ac533c /fml/lib/FML/Process/Error.pm | |
| parent | 19afce81a05f1345815b8074cf438f438dce9bc4 (diff) | |
| download | fml8-52905e4eb47df4e80ebf274af1824e1e5c1c8781.tar.gz fml8-52905e4eb47df4e80ebf274af1824e1e5c1c8781.tar.bz2 fml8-52905e4eb47df4e80ebf274af1824e1e5c1c8781.zip | |
for hook, wrap main code by is_refused() condition such as:
unless ($curproc->is_refused()) { main code ...; }
Diffstat (limited to 'fml/lib/FML/Process/Error.pm')
| -rw-r--r-- | fml/lib/FML/Process/Error.pm | 68 |
1 files changed, 35 insertions, 33 deletions
diff --git a/fml/lib/FML/Process/Error.pm b/fml/lib/FML/Process/Error.pm index 2af4d3f9..47a2c63a 100644 --- a/fml/lib/FML/Process/Error.pm +++ b/fml/lib/FML/Process/Error.pm @@ -3,7 +3,7 @@ # Copyright (C) 2002 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Error.pm,v 1.24 2002/09/22 15:01:21 fukachan Exp $ +# $FML: Error.pm,v 1.25 2002/12/22 03:46:20 fukachan Exp $ # package FML::Process::Error; @@ -146,40 +146,42 @@ sub run my $eval = $config->get_hook( 'error_run_start_hook' ); if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; } - eval q{ - use Mail::Bounce; - my $bouncer = new Mail::Bounce; - $bouncer->analyze( $msg ); - - use FML::Error::Cache; - my $errorcache = new FML::Error::Cache $curproc; - - for my $address ( $bouncer->address_list ) { - my $status = $bouncer->status( $address ); - my $reason = $bouncer->reason( $address ); - - if ($address) { - Log("bounced: address=<$address>"); - Log("bounced: status=$status"); - Log("bounced: reason=\"$reason\""); - - $curproc->lock('errorcache'); - $errorcache->add({ - address => $address, - status => $status, - reason => $reason, - }); - $curproc->unlock('errorcache'); - - $found++; + unless ($curproc->is_refused()) { + eval q{ + use Mail::Bounce; + my $bouncer = new Mail::Bounce; + $bouncer->analyze( $msg ); + + use FML::Error::Cache; + my $errorcache = new FML::Error::Cache $curproc; + + for my $address ( $bouncer->address_list ) { + my $status = $bouncer->status( $address ); + my $reason = $bouncer->reason( $address ); + + if ($address) { + Log("bounced: address=<$address>"); + Log("bounced: status=$status"); + Log("bounced: reason=\"$reason\""); + + $curproc->lock('errorcache'); + $errorcache->add({ + address => $address, + status => $status, + reason => $reason, + }); + $curproc->unlock('errorcache'); + + $found++; + } } - } - }; - LogError($@) if $@; + }; + LogError($@) if $@; - if ($found) { - $pcb->set("error", "found", 1); - $curproc->_clean_up_bouncers($args); + if ($found) { + $pcb->set("error", "found", 1); + $curproc->_clean_up_bouncers($args); + } } $eval = $config->get_hook( 'error_run_end_hook' ); |
