diff options
| author | fukachan <fukachan> | 2006-03-25 04:07:26 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2006-03-25 04:07:26 +0000 |
| commit | dc3acdadcfb6ebc58df6ca4531f2db1ced25dfa6 (patch) | |
| tree | eb97810dd5d2960a7ded11cfebef6545b9c39772 /fml/lib/FML/Process | |
| parent | a54a4d0893c4f64fab7c38747b2237ed722c9779 (diff) | |
| download | fml8-dc3acdadcfb6ebc58df6ca4531f2db1ced25dfa6.tar.gz fml8-dc3acdadcfb6ebc58df6ca4531f2db1ced25dfa6.tar.bz2 fml8-dc3acdadcfb6ebc58df6ca4531f2db1ced25dfa6.zip | |
rewritten to use access methods to sync w/ Mail::Delivery overhaul.
Diffstat (limited to 'fml/lib/FML/Process')
| -rw-r--r-- | fml/lib/FML/Process/Distribute.pm | 24 | ||||
| -rw-r--r-- | fml/lib/FML/Process/QueueManager.pm | 10 |
2 files changed, 19 insertions, 15 deletions
diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm index 082748da..87c7362e 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,2004,2005,2006 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Distribute.pm,v 1.170 2006/03/19 08:06:05 fukachan Exp $ +# $FML: Distribute.pm,v 1.171 2006/03/21 07:04:07 fukachan Exp $ # package FML::Process::Distribute; @@ -360,7 +360,7 @@ sub finish $curproc->queue_flush(); } else { - $curproc->logwarn("not queue flush due to MTA fatal error."); + $curproc->logwarn("queue remains due to MTA fatal error."); } $eval = $config->get_hook( 'distribute_finish_end_hook' ); @@ -598,15 +598,18 @@ sub _deliver_article } # 2. distribute article - my $fp = sub { $curproc->logdebug(@_);}; # pointer to the log function - my $sfp = sub { my ($s) = @_; print $s; print "\n" if $s !~ /\n$/o;}; + my $fp_log_info = sub { $curproc->logdebug(@_);}; + my $fp_log_error = sub { $curproc->logerror(@_);}; + my $fp_smtplog = sub { + my ($s) = @_; print $s; print "\n" if $s !~ /\n$/o; + }; my $handle = undef; - # overload $sfp log function pointer. + # overload $fp_smtplog log function pointer. if ($config->yes('use_smtp_log')) { my $wh = $curproc->outgoing_message_cache_open(); if (defined $wh) { - $sfp = sub { print $wh @_;}; + $fp_smtplog = sub { print $wh @_;}; $handle = undef; # $wh; } else { @@ -614,7 +617,7 @@ sub _deliver_article } } else { - $sfp = sub {}; + $fp_smtplog = sub {}; } # address validater @@ -630,9 +633,10 @@ sub _deliver_article eval q{ use Mail::Delivery; $service = new Mail::Delivery { - log_function => $fp, - smtp_log_function => $sfp, - smtp_log_handle => $handle, + log_info_function => $fp_log_info, + log_error_function => $fp_log_error, + smtp_log_function => $fp_smtplog, + smtp_log_handle => $handle, address_validate_function => $validater, }; }; diff --git a/fml/lib/FML/Process/QueueManager.pm b/fml/lib/FML/Process/QueueManager.pm index c2c8dcad..7923f142 100644 --- a/fml/lib/FML/Process/QueueManager.pm +++ b/fml/lib/FML/Process/QueueManager.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: QueueManager.pm,v 1.36 2005/06/04 01:35:25 fukachan Exp $ +# $FML: QueueManager.pm,v 1.37 2005/11/30 23:30:38 fukachan Exp $ # package FML::Process::QueueManager; @@ -90,7 +90,7 @@ sub send my $queue = new Mail::Delivery::Queue { directory => $queue_dir }; my $ra = []; - $queue->set_log_function($fp); + $queue->set_log_debug_function($fp); if (defined $id) { $ra = [ $id ]; @@ -114,7 +114,7 @@ sub send id => $qid, directory => $queue_dir, }; - $q->set_log_function($fp); + $q->set_log_debug_function($fp); if ( $q->lock() ) { my $is_locked = 1; @@ -223,7 +223,7 @@ sub cleanup use Mail::Delivery::Queue; my $queue = new Mail::Delivery::Queue { directory => $queue_dir }; - $queue->set_log_function($fp); + $queue->set_log_debug_function($fp); # XXX-TODO: customizable. $mail_queue_max_lifetime = 5d ? my $list = $queue->list_all() || []; @@ -235,7 +235,7 @@ sub cleanup id => $qid, directory => $queue_dir, }; - $q->set_log_function($fp); + $q->set_log_debug_function($fp); unless ( $q->is_valid_active_queue() ) { my $mtime = $q->last_modified_time(); |
