[Mew-dist 12689] Re: NNTPauthuser

Tatsuya Kinoshita tatsuyak at example.com
2000年 3月 15日 (水) 05:49:41 JST


On Mon, 13 Mar 2000 15:52:48 +0900,
Tatsuya Kinoshita <tatsuyak at example.com> wrote:

> NNTPauthuser が queue に書き出されない不具合が、IM140でも残ってい
> ます。

とりあえず手元にあるパッチを投げておきます。adhoc な修正ですが。

-- 
木下達也 (Tatsuya Kinoshita)
E-mail: tats at example.com, tatsuyak at example.com
-------------- next part --------------
diff -u -r im-140.orig/IM/Config.pm.in im-140/IM/Config.pm.in
--- im-140.orig/IM/Config.pm.in	Mon Feb 28 12:54:20 2000
+++ im-140/IM/Config.pm.in	Wed Mar 15 05:37:19 2000
@@ -38,7 +38,7 @@
     address addresses_regex
     msgdbfile msgdbtype
     mbox_style
-    nntpservers nntphistoryfile nntpauthuser
+    nntpservers nntphistoryfile nntpauthuser set_nntpauthuser
     popaccount pophistoryfile imapaccount httpproxy noproxy
     usepwagent pwagentport usepwfiles pwfiles
     expand_path usetouchfile touchfile namazuv2
@@ -859,6 +859,10 @@
 
 sub nntpauthuser () {
     return $NNTPauthuser;
+}
+
+sub set_nntpauthuser($) {
+  $NNTPauthuser = shift;
 }
 
 sub popaccount () {
diff -u -r im-140.orig/IM/Nntp.pm im-140/IM/Nntp.pm
--- im-140.orig/IM/Nntp.pm	Mon Feb 28 12:54:21 2000
+++ im-140/IM/Nntp.pm	Wed Mar 15 05:37:39 2000
@@ -15,7 +15,8 @@
 require Exporter;
 
 use Fcntl;
-use IM::Config qw(nntphistoryfile nntpservers nntpauthuser nntp_timeout);
+use IM::Config qw(nntphistoryfile nntpservers nntpauthuser set_nntpauthuser 
+	nntp_timeout);
 use IM::TcpTransaction;
 use IM::Util;
 use integer;
@@ -45,7 +46,7 @@
 =head1 SYNOPSIS
 
 $return_code = &nntp_transaction(server_list, newsgroups,
-    part_current, part_total);
+    part_current, part_total, authuser);
 $return_code = &nntp_close;
 
 =head1 DESCRIPTION
@@ -105,22 +106,24 @@
 
 ##### NNTP TRANSACTION MANAGEMENT #####
 #
-# nntp_transaction(server_list, header, body, group, part, total)
+# nntp_transaction(server_list, header, body, group, part, total, authuser)
 #	server_list: list of NNTP servers
 #	group: news group to be posted in
 #	part: part number to be sent in partial message mode
 #	total: total number of partial messages
+#       authuser: User name for NNTP authentication
 #	return value:
 #		 0: success
 #		 1: recoverable error (should be retried)
 #		-1: unrecoverable error
 #
-sub nntp_transaction ($$$$$$) {
-    my ($servers, $Header, $Body, $group, $part, $total) = @_;
+sub nntp_transaction ($$$$$$$) {
+    my ($servers, $Header, $Body, $group, $part, $total, $authuser) = @_;
     my $rc;
 
     require IM::Log && import IM::Log;
 
+    &set_nntpauthuser($authuser);
     do {
 	$rc = &nntp_transact_sub($servers, $Header, $Body, $part, $total);
 	my (@resp) = &command_response;
Only in im-140.orig: im-140.tats
diff -u -r im-140.orig/imput.in im-140/imput.in
--- im-140.orig/imput.in	Mon Feb 28 12:54:20 2000
+++ im-140/imput.in	Wed Mar 15 05:35:55 2000
@@ -111,6 +111,8 @@
     'NNTPservers;s;localhost;Nntp_servers'
 	=> "List of NNTP servers (separated with ',').
 		Each element should be server[/remote_port][%local_port]",
+    'NNTPauthuser;s;;Nntp_authuser'
+	=> 'User name for NNTP authentication.',
     'ClientName;s;localhost;Client_name'
 	=> 'Name as a SMTP client (used for SMTP HELO).',
     'SSHServer;s;localhost;SSH_server'
@@ -941,12 +943,12 @@
 	    for ($i = 1; $i <= $split; $i++) {
 		sleep($Partial_sleep) if ($i > 1);
 		$rcode = &nntp_transaction(\@Nntp_servers, \@Header, \@Body,
-		  $Newsgroups, $i, $split);
+		  $Newsgroups, $i, $split, $Nntp_authuser);
 		return $rcode if ($rcode);
 	    }
 	} else {
 	    $rcode = &nntp_transaction(\@Nntp_servers, \@Header, \@Body,
-	      $Newsgroups, 0, 0);
+	      $Newsgroups, 0, 0, $Nntp_authuser);
 	    return $rcode if ($rcode);
 	}
 	# XXX should be controlable? --- yes, of course!
@@ -1775,6 +1777,7 @@
 	    if (/^S:(.*)/)   { $Sender = $1; next; }
 	    if (/^SSV:(.*)/) { @Smtp_servers = split(',', $1); next; }
 	    if (/^NSV:(.*)/) { @Nntp_servers = split(',', $1); next; }
+	    if (/^NAU:(.*)/) { $Nntp_authuser = $1; next; }
 	    if (/^SSH:(.*)/) { $SSH_server = $1; next; }
 	    if (/^R:(.*)/)   { @Recipients = split(',', $1); next; }
 	    if (/^RQ:(.*)/)  { $User_require = $1; next; }
@@ -1901,6 +1904,7 @@
     print QUEUE "RQ:$User_require\n";
     print QUEUE "SSV:$Smtp_servers\n";
     print QUEUE "NSV:$Nntp_servers\n";
+    print QUEUE "NAU:$Nntp_authuser\n";
     print QUEUE "SSH:$SSH_server\n";
     print QUEUE "R:".join(',', @Recipients)."\n";
     print QUEUE "\n";


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