[Mew-dist 2467] Re: multiple nntpservers

Motonori Nakamura motonori at example.com
1997年 10月 14日 (火) 23:41:25 JST


>>>>> On Tue, 14 Oct 1997 16:52:33 +0900, "Takashi P.KATOH" <p-katoh at example.com> said:

p-katoh> 「まず foo につないで fj.rec.comics があるかどうか調べて、
p-katoh>   なければ bar.hoge.ac.jp につないで fj.rec.comics があるか
p-katoh>   どうか調べて、なければ error」

p-katoh> が正しい動作だと思っていたのですが違うのでしょうか?

何を根拠に「正しい」と判断すべきかわからないのですが、グループが
なかった場合に、コード 4xx が返ってくることから、SMTP 的なに照らして
考えると、確かにそのように動作するべきかもしれません。

p-katoh> # imcat には --nntpservers option がないんですね。

コマンドラインから指定できるべきですか?

以下のパッチで、次のサーバに進むようになると思います。このパッチには、
X-Dispatcher: ヘッダが BCC 等の時に付かなくなってしまっていることの
修正も含んでいます。

- motonori

diff -ur ../im-74-/IM.in/Address.pm.in ./IM.in/Address.pm.in
--- ../im-74-/IM.in/Address.pm.in	Tue Sep  9 12:14:27 1997
+++ ./IM.in/Address.pm.in	Tue Oct 14 08:32:55 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::Address.pm @im_version@";
+my $PM_VERSION = "IM::Address.pm @im_version@";
 
 package IM::Address;
 require 5.003;
diff -ur ../im-74-/IM.in/Alias.pm.in ./IM.in/Alias.pm.in
--- ../im-74-/IM.in/Alias.pm.in	Mon Sep 15 14:23:25 1997
+++ ./IM.in/Alias.pm.in	Tue Oct 14 08:32:58 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::Alias.pm @im_version@";
+my $PM_VERSION = "IM::Alias.pm @im_version@";
 
 package IM::Alias;
 require 5.003;
diff -ur ../im-74-/IM.in/Config.pm.in ./IM.in/Config.pm.in
--- ../im-74-/IM.in/Config.pm.in	Fri Oct 10 10:42:14 1997
+++ ./IM.in/Config.pm.in	Tue Oct 14 08:33:00 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::Config.pm @im_version@";
+my $PM_VERSION = "IM::Config.pm @im_version@";
 
 package IM::Config;
 require 5.003;
diff -ur ../im-74-/IM.in/EncDec.pm.in ./IM.in/EncDec.pm.in
--- ../im-74-/IM.in/EncDec.pm.in	Mon Sep 29 19:57:19 1997
+++ ./IM.in/EncDec.pm.in	Tue Oct 14 08:33:02 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::EncDec.pm @im_version@";
+my $PM_VERSION = "IM::EncDec.pm @im_version@";
 
 package IM::EncDec;
 require 5.003;
diff -ur ../im-74-/IM.in/File.pm.in ./IM.in/File.pm.in
--- ../im-74-/IM.in/File.pm.in	Tue Sep  9 12:14:53 1997
+++ ./IM.in/File.pm.in	Tue Oct 14 08:33:04 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::File.pm version @im_version@";
+my $PM_VERSION = "IM::File.pm version @im_version@";
 
 package IM::File;
 require 5.003;
diff -ur ../im-74-/IM.in/Folder.pm.in ./IM.in/Folder.pm.in
--- ../im-74-/IM.in/Folder.pm.in	Sat Sep 27 13:09:24 1997
+++ ./IM.in/Folder.pm.in	Tue Oct 14 08:33:07 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::Folder.pm @im_version@";
+my $PM_VERSION = "IM::Folder.pm @im_version@";
 
 package IM::Folder;
 require 5.003;
diff -ur ../im-74-/IM.in/GetPass.pm.in ./IM.in/GetPass.pm.in
--- ../im-74-/IM.in/GetPass.pm.in	Fri Oct 10 09:53:46 1997
+++ ./IM.in/GetPass.pm.in	Tue Oct 14 08:33:09 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::GetPass.pm @im_version@";
+my $PM_VERSION = "IM::GetPass.pm @im_version@";
 
 package IM::GetPass;
 require 5.003;
diff -ur ../im-74-/IM.in/Header.pm.in ./IM.in/Header.pm.in
--- ../im-74-/IM.in/Header.pm.in	Fri Oct 10 09:46:46 1997
+++ ./IM.in/Header.pm.in	Tue Oct 14 08:33:11 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::Header.pm @im_version@";
+my $PM_VERSION = "IM::Header.pm @im_version@";
 
 package IM::Header;
 require 5.003;
diff -ur ../im-74-/IM.in/History.pm.in ./IM.in/History.pm.in
--- ../im-74-/IM.in/History.pm.in	Tue Sep  9 12:15:11 1997
+++ ./IM.in/History.pm.in	Tue Oct 14 08:33:13 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::History.pm @im_version@";
+my $PM_VERSION = "IM::History.pm @im_version@";
 
 package IM::History;
 require 5.003;
diff -ur ../im-74-/IM.in/Http.pm.in ./IM.in/Http.pm.in
--- ../im-74-/IM.in/Http.pm.in	Mon Sep 15 11:10:04 1997
+++ ./IM.in/Http.pm.in	Tue Oct 14 08:33:15 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::Http.pm @im_version@";
+my $PM_VERSION = "IM::Http.pm @im_version@";
 
 package IM::Http;
 require 5.003;
diff -ur ../im-74-/IM.in/Imap.pm.in ./IM.in/Imap.pm.in
--- ../im-74-/IM.in/Imap.pm.in	Fri Oct 10 10:04:56 1997
+++ ./IM.in/Imap.pm.in	Tue Oct 14 08:33:17 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::Imap.pm @im_version@";
+my $PM_VERSION = "IM::Imap.pm @im_version@";
 
 package IM::Imap;
 require 5.003;
diff -ur ../im-74-/IM.in/Iso2022jp.pm.in ./IM.in/Iso2022jp.pm.in
--- ../im-74-/IM.in/Iso2022jp.pm.in	Fri Oct 10 09:46:46 1997
+++ ./IM.in/Iso2022jp.pm.in	Tue Oct 14 08:33:18 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::Iso2022jp.pm @im_version@";
+my $PM_VERSION = "IM::Iso2022jp.pm @im_version@";
 
 package IM::Iso2022jp;
 require 5.003;
diff -ur ../im-74-/IM.in/Japanese.pm.in ./IM.in/Japanese.pm.in
--- ../im-74-/IM.in/Japanese.pm.in	Tue Sep  9 12:15:30 1997
+++ ./IM.in/Japanese.pm.in	Tue Oct 14 08:33:20 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::Japanese.pm @im_version@";
+my $PM_VERSION = "IM::Japanese.pm @im_version@";
 
 package IM::Japanese;
 require 5.003;
diff -ur ../im-74-/IM.in/LocalMbox.pm.in ./IM.in/LocalMbox.pm.in
--- ../im-74-/IM.in/LocalMbox.pm.in	Fri Oct 10 09:46:46 1997
+++ ./IM.in/LocalMbox.pm.in	Tue Oct 14 08:33:22 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::LocalMbox.pm @im_version@";
+my $PM_VERSION = "IM::LocalMbox.pm @im_version@";
 
 package IM::LocalMbox;
 require 5.003;
diff -ur ../im-74-/IM.in/Log.pm.in ./IM.in/Log.pm.in
--- ../im-74-/IM.in/Log.pm.in	Tue Sep  9 12:15:39 1997
+++ ./IM.in/Log.pm.in	Tue Oct 14 08:33:24 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::Log.pm @im_version@";
+my $PM_VERSION = "IM::Log.pm @im_version@";
 
 package IM::Log;
 require 5.003;
diff -ur ../im-74-/IM.in/MD5.pm.in ./IM.in/MD5.pm.in
--- ../im-74-/IM.in/MD5.pm.in	Wed Sep 17 14:30:53 1997
+++ ./IM.in/MD5.pm.in	Tue Oct 14 08:33:26 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::MD5.pm @im_version@";
+my $PM_VERSION = "IM::MD5.pm @im_version@";
 
 package IM::MD5;
 require 5.003;
diff -ur ../im-74-/IM.in/Message.pm.in ./IM.in/Message.pm.in
--- ../im-74-/IM.in/Message.pm.in	Fri Oct 10 09:46:46 1997
+++ ./IM.in/Message.pm.in	Tue Oct 14 08:34:21 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::Message.pm @im_version@";
+my $PM_VERSION = "IM::Message.pm @im_version@";
 
 package IM::Message;
 require 5.003;
@@ -455,7 +455,7 @@
 
     return -1 unless (print CHAN "From: $main::Sender_line$crlf");
     print CHAN "To: blind-copy-recipients:;$crlf";
-    print CHAN "X-Dispatcher: $main::Version$crlf";
+    print CHAN "X-Dispatcher: $main::VERSION$crlf";
     if ($subj = &header_value($Header, 'Subject')) {
 	print CHAN "Subject: Bcc: $subj$crlf";
     } else {
@@ -557,7 +557,7 @@
 
     return -1 unless (print CHAN "To: $main::Sender_line$crlf");
     print CHAN "From: Imput-Error-Report$crlf";
-    print CHAN "X-Dispatcher: $main::Version$crlf";
+    print CHAN "X-Dispatcher: $main::VERSION$crlf";
     if ($subj = &header_value($Header, 'Subject')) {
 	print CHAN "Subject: Returned message: $subj$crlf";
     } else {
diff -ur ../im-74-/IM.in/MsgStore.pm.in ./IM.in/MsgStore.pm.in
--- ../im-74-/IM.in/MsgStore.pm.in	Fri Oct 10 09:46:46 1997
+++ ./IM.in/MsgStore.pm.in	Tue Oct 14 08:33:32 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::MsgStore.pm @im_version@";
+my $PM_VERSION = "IM::MsgStore.pm @im_version@";
 
 package IM::MsgStore;
 require 5.003;
diff -ur ../im-74-/IM.in/Nntp.pm.in ./IM.in/Nntp.pm.in
--- ../im-74-/IM.in/Nntp.pm.in	Mon Sep 15 14:00:38 1997
+++ ./IM.in/Nntp.pm.in	Tue Oct 14 22:42:40 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::Nntp.pm @im_version@";
+my $PM_VERSION = "IM::Nntp.pm @im_version@";
 
 package IM::Nntp;
 require 5.003;
@@ -457,12 +457,14 @@
 
     im_notice("accessing to $group at $servers.\n");
 
-    if ($rc = &nntp_open(\@servers, 0)) {
-	im_warn("Connection failed to $servers.\n");
-	return -1;
-    }
-
-    return -1 if ($rc = &nntp_command("GROUP $group"));
+    do {
+	if (($rc = &nntp_open(\@servers, 0)) < 0) {
+	    im_warn("Connection failed to $servers.\n");
+	    return -1;
+	}
+	return -1 if (($rc = &nntp_command("GROUP $group")) < 0);
+    } while (@servers > 0 && $rc > 0);
+    return -1 if ($rc);
 
     my (@resp) = &command_response;
     $error = 0;
diff -ur ../im-74-/IM.in/Pop.pm.in ./IM.in/Pop.pm.in
--- ../im-74-/IM.in/Pop.pm.in	Fri Oct 10 10:27:59 1997
+++ ./IM.in/Pop.pm.in	Tue Oct 14 08:33:36 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::Pop.pm @im_version@";
+my $PM_VERSION = "IM::Pop.pm @im_version@";
 
 package IM::Pop;
 require 5.003;
diff -ur ../im-74-/IM.in/Recipient.pm.in ./IM.in/Recipient.pm.in
--- ../im-74-/IM.in/Recipient.pm.in	Mon Sep 15 14:23:25 1997
+++ ./IM.in/Recipient.pm.in	Tue Oct 14 08:33:38 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::Recipient.pm @im_version@";
+my $PM_VERSION = "IM::Recipient.pm @im_version@";
 
 package IM::Recipient;
 require 5.003;
diff -ur ../im-74-/IM.in/Scan.pm.in ./IM.in/Scan.pm.in
--- ../im-74-/IM.in/Scan.pm.in	Fri Oct 10 10:42:14 1997
+++ ./IM.in/Scan.pm.in	Tue Oct 14 08:33:40 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::Scan.pm @im_version@";
+my $PM_VERSION = "IM::Scan.pm @im_version@";
 
 package IM::Scan;
 require 5.003;
diff -ur ../im-74-/IM.in/Smtp.pm.in ./IM.in/Smtp.pm.in
--- ../im-74-/IM.in/Smtp.pm.in	Tue Sep  9 12:16:19 1997
+++ ./IM.in/Smtp.pm.in	Tue Oct 14 08:33:41 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::Smtp.pm @im_version@";
+my $PM_VERSION = "IM::Smtp.pm @im_version@";
 
 package IM::Smtp;
 require 5.003;
diff -ur ../im-74-/IM.in/Stdio.pm.in ./IM.in/Stdio.pm.in
--- ../im-74-/IM.in/Stdio.pm.in	Tue Sep  9 12:16:23 1997
+++ ./IM.in/Stdio.pm.in	Tue Oct 14 08:33:43 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::Stdio.pm @im_version@";
+my $PM_VERSION = "IM::Stdio.pm @im_version@";
 
 package IM::Stdio;
 require 5.003;
diff -ur ../im-74-/IM.in/TcpTransaction.pm.in ./IM.in/TcpTransaction.pm.in
--- ../im-74-/IM.in/TcpTransaction.pm.in	Sat Sep 27 10:28:31 1997
+++ ./IM.in/TcpTransaction.pm.in	Tue Oct 14 08:33:45 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "IM::TcpTransaction.pm @im_version@";
+my $PM_VERSION = "IM::TcpTransaction.pm @im_version@";
 
 package IM::TcpTransaction;
 require 5.003;
diff -ur ../im-74-/imcat.in ./imcat.in
--- ../im-74-/imcat.in	Mon Sep 29 20:00:36 1997
+++ ./imcat.in	Tue Oct 14 22:47:58 1997
@@ -130,17 +130,21 @@
 } elsif ($opt_src =~ /^\-(.*)/) {
     # News spool (-group[@server])
     require IM::Nntp && import IM::Nntp;
+    my $rc;
 
     my ($group, $srvs) = nntp_spec($1);
     local @servers = split(',', $srvs);
     im_notice("accessing to $group on $srvs.\n");
-    if (&nntp_open(\@servers, 0)) {
-	im_die("can not connect $srvs.\n");
-    }
-    if (($group ne '') && &nntp_command("GROUP $group", 1)) {
-	im_die("can not access $group.\n");
-    }
-    my ($rc, $art) = &nntp_article($msg);
+    do {
+	if (($rc = &nntp_open(\@servers, 0)) < 0) {
+	    im_die("can not connect $srvs.\n");
+	}
+	if (($group ne '') && ($rc = &nntp_command("GROUP $group", 1)) < 0) {
+	    im_die("can not access $group.\n");
+	}
+    } while (@servers > 0 && $rc > 0);
+    im_die("can not access $group on $srvs.\n") if ($rc);
+    ($rc, my $art) = &nntp_article($msg);
     &nntp_close;
     if ($rc) {
 	im_die("no message $msg in -$group.\n");
diff -ur ../im-74-/imls.in ./imls.in
--- ../im-74-/imls.in	Fri Oct 10 10:42:14 1997
+++ ./imls.in	Tue Oct 14 22:46:58 1997
@@ -165,18 +165,20 @@
 
 sub nntp_messages ($@) {
     my ($newsgroup, @ranges) = @_;
-    my ($resp, $start, $end);
+    my ($resp, $start, $end, $rc);
 #   my ($num, $subj, $from, $date, $id, $ref, $num1, $num2);
 
     ($newsgroup, my $srvs) = &nntp_spec($newsgroup);
     local(@servers) = split(',', $srvs);
-    if (&nntp_open(\@servers, 0)) {
-	im_die("can not connect $srvs.\n");
-    }
-    if (&nntp_command("GROUP $newsgroup", 1)) {
-	im_die("can not access $newsgroup.\n");
-    }
-
+    do {
+	if (($rc = &nntp_open(\@servers, 0)) < 0) {
+	    im_die("can not connect $srvs.\n");
+	}
+	if (($rc = &nntp_command("GROUP $newsgroup", 1)) < 0) {
+	    im_die("can not access $newsgroup.\n");
+	}
+    } while (@servers > 0 && $rc > 0);
+    im_die("can not access $newsgroup on $srvs.\n") if ($rc);
     my (@resp) = &nntp_command_response;
     my $error = 0;
     my $i;
diff -ur ../im-74-/imput.in ./imput.in
--- ../im-74-/imput.in	Fri Oct 10 10:41:40 1997
+++ ./imput.in	Tue Oct 14 08:32:41 1997
@@ -14,7 +14,7 @@
 ### Revised: @im_revised@
 ###
 
-my $VERSION = "imput @im_version@";
+$VERSION = "imput @im_version@";
 
 $Prog = 'imput';
 



Mew-dist メーリングリストの案内