diff options
| author | fukachan <fukachan> | 2005-08-23 12:32:06 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2005-08-23 12:32:06 +0000 |
| commit | 059b035b7ed38cb87d0a21bb9f18e9622a8e8664 (patch) | |
| tree | ef9e7b8c08ba693cd69b7c4a05cdbabc44c8e3e4 /fml/lib/FML/Process | |
| parent | 0646f9cb955d05343814d07cc12070c952011856 (diff) | |
| download | fml8-059b035b7ed38cb87d0a21bb9f18e9622a8e8664.tar.gz fml8-059b035b7ed38cb87d0a21bb9f18e9622a8e8664.tar.bz2 fml8-059b035b7ed38cb87d0a21bb9f18e9622a8e8664.zip | |
handle $fetchfml_pop_servers
Diffstat (limited to 'fml/lib/FML/Process')
| -rw-r--r-- | fml/lib/FML/Process/FetchFML.pm | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/fml/lib/FML/Process/FetchFML.pm b/fml/lib/FML/Process/FetchFML.pm index c12114e2..3b8b8739 100644 --- a/fml/lib/FML/Process/FetchFML.pm +++ b/fml/lib/FML/Process/FetchFML.pm @@ -3,7 +3,7 @@ # Copyright (C) 2005 Ken'ichi Fukamachi # All rights reserved. # -# $FML: FetchFML.pm,v 1.3 2005/08/10 15:03:28 fukachan Exp $ +# $FML: FetchFML.pm,v 1.4 2005/08/19 12:08:17 fukachan Exp $ # package FML::Process::FetchFML; @@ -258,37 +258,45 @@ sub _fetchfml_retrieve my $class = $ff_args->{ class } || "article_post"; my $username = $config->{ "fetchfml_${class}_user" }; my $password = $config->{ "fetchfml_${class}_password" }; - my $server = $config->{ fetchfml_pop_server }; + my $servers = $config->get_as_array_ref('fetchfml_pop_servers') || []; use FML::MUA::POP3; my $mua = new FML::MUA::POP3 $curproc; - if (defined $mua) { - $mua->login({ - server => $server, - username => $username, - password => $password, - }); - - if ($mua->error()) { - $curproc->logerror($mua->error()); - $curproc->stop_this_process(); - return; + MUA: + for my $server (@$servers) { + if (defined $mua) { + $mua->login({ + server => $server, + username => $username, + password => $password, + }); } - - $mua->retrieve( { class => $class } ); - if ($mua->error()) { - $curproc->logerror($mua->error()); - $curproc->stop_this_process(); - return; + else { + $curproc->logerror("object undefined."); } - $mua->quit(); - if ($mua->error()) { + if ($mua->error()) { $curproc->logerror($mua->error()); + next MUA; } } - else { - $curproc->logerror("object undefined."); + + if ($mua->error()) { + $curproc->logerror($mua->error()); + $curproc->stop_this_process(); + return; + } + + $mua->retrieve( { class => $class } ); + if ($mua->error()) { + $curproc->logerror($mua->error()); + $curproc->stop_this_process(); + return; + } + + $mua->quit(); + if ($mua->error()) { + $curproc->logerror($mua->error()); } } |
