🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #49928

Re: rpost question

#49928
From: Dan Glover
Date: Wed, 17 Jan 2001 16:31
93 lines
3890 bytes
In article <3a633a99$0$12076@reader2>, "steffie" 
<steffie@indoleeroord.penguinpowered.com> wrote:
>"Dan Glover" <news@dangl.demon.co.uk> wrote in message
>news:G77r75.E9q@dgsys.co.uk...

>> I remember looking at this a few months back for someone else.
[...]
>> The problem is that the server responds initially with "201 [blah] no
>> posting" but will accept posting after appropriate AUTHINFO commands.

>This seems to be the exact explanation of my problem

>if you can find a patch for this, or explain what to do, to overcome this
>problem it would be very welcome!

Patch (since it's reasonably small) is attached, BUT:

1. It might not apply cleanly against the latest sources (think it was
against suck-4.2.2);

2. It's probably more complicated than it needs to be - I added an extra
option ( -x) to allow the "normal" behaviour to continue.  In other words
"201 no posting" is still regarded as an error without adding -x to the
rpost command.

3. I wrote it, tested it once, and then forgot all about it.  It could
usefully be reviewed by someone familiar with the such sources.

So, sold as seen, with no warranties expressed or implied, here is the
patch so rpost will talk to Netcom's pubnews:

-cut here-
--- rpost.c.orig	Tue Sep 12 11:55:38 2000
+++ rpost.c	Tue Sep 12 11:55:47 2000
@@ -42,6 +42,7 @@
 	int deleteyn;
 	int do_modereader;
 	int debug;
+	int ignore_201;
 	struct nntp_auth auth;
 	FILE *status_fptr;
 	unsigned short int portnr;
@@ -105,6 +106,7 @@
 	myargs.host = getenv("NNTPSERVER");		/* the default */
 	myargs.phrases = NULL;
 	myargs.debug = FALSE;
+	myargs.ignore_201 = FALSE;
 #ifdef PERL_EMBED
 	myargs.perl_int = NULL;
 #endif
@@ -182,6 +184,7 @@
 			do_debug("TimeOut = %d\n", TimeOut);
 #endif
 			do_debug("myargs.debug = TRUE\n");
+			do_debug("myargs.ignore_201 = %s\n", (myargs.ignore_201) ? "TRUE" : "FALSE");
 		}
 
 		/* we processed args okay */
@@ -197,7 +200,7 @@
 			else {
 				fputs(inbuf, myargs.status_fptr );
 				number(inbuf, &response);
-				if(response == 480) {
+				if((response == 480) || (response == 201 && myargs.ignore_201 == TRUE)) {
 					retval = do_authenticate(sockfd, myargs.debug, &(myargs.auth));
 				}
 			}
@@ -209,7 +212,7 @@
 					number(inbuf, &response);
 				}
 			}
-			if(response != 200 && response != 480) {
+			if(response != 200 && response != 480 && response != 281) {
 				error_log(ERRLOG_REPORT, rpost_phrases[3], NULL);
 				retval = RETVAL_ERROR;
 			}
@@ -799,6 +802,9 @@
 				}
 				break;
 #endif
+			  case 'x':	/* ignore initial 201 response */
+				myargs->ignore_201 = TRUE;
+				break;
 			  default:
 				error_log(ERRLOG_REPORT, rpost_phrases[30], argv[loop],NULL);
 				break;
-and here-

Dan

-- 
Dan Glover (dan@dangl.demon.co.uk)
Technical Details
Message-ID: <G7BF98.E3C@dgsys.co.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!supernews.google.com!sn-xit-02!sn-xit-04!supernews.com!xfer13.netnews.com!netnews.com!diablo.theplanet.net!news.theplanet.net!newspost.theplanet.net!dangl.dgsys.co.uk!dan
References: <3a62eab0$0$18424@reader4> <G77r75.E9q@dgsys.co.uk> <3a633a99$0$12076@reader2>

Show Full Headers
Complete Article Headers
Message-ID: <G7BF98.E3C@dgsys.co.uk>
Subject: Re: rpost question
Date: Wed, 17 Jan 2001 16:31:56 GMT
From: Dan Glover <news@dangl.demon.co.uk>
References: <3a62eab0$0$18424@reader4> <G77r75.E9q@dgsys.co.uk> <3a633a99$0$12076@reader2>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!supernews.google.com!sn-xit-02!sn-xit-04!supernews.com!xfer13.netnews.com!netnews.com!diablo.theplanet.net!news.theplanet.net!newspost.theplanet.net!dangl.dgsys.co.uk!dan
Newsgroups: news.software.nntp
Organization: One day, maybe!
Lines: 92
Sender: dan@dgsys.co.uk (Dan Glover)
Reply-To: newsreply@dgsys.co.uk
NNTP-Posting-Host: modem-38.akallabeth.dialup.pol.co.uk
X-Trace: newsg1.svr.pol.co.uk 979750258 18379 62.136.100.166 (17 Jan 2001 16:50:58 GMT)
NNTP-Posting-Date: 17 Jan 2001 16:50:58 GMT
X-Complaints-To: abuse@theplanet.net
X-Newsreader: Brian's News Reader V0.10 [Linux]