🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #25532

Re: Help with NNTP-Posting-Host header

#25532
From: Paul Martin
Date: Sat, 24 Jan 1998 00:00
91 lines
3598 bytes
In article <34C91203.794B@digex.net>,
	Dale Ghent <daleg@digex.net> writes:
>>    I'm running INN 1.5.1 on a solaris 2.5.1 host. I have another system
>>    running hypernews (baghdad) as a mail to news gateway. The hypernews system
>>    connects to the INN system (pilsner) via nnrp.
>> 
>>    I am getting the following errors in news.notice, have checked the
>>    FAQ's and have not found an answer. Anybody have any clues?
> 
> Perhaps Hypermail is setting the NNTP-Posting-Host Header, when it
> shouldnt?

This following diff against nnrpd should allow you to specify individual
hosts as allowed to set their NNTP-Posting-Host header, by putting H in
the perm field of nnrp.access

We use it here to allow the NNTP-Posting-Host be set by the scripts that
post offline news for users.

--- nnrpd.c.orig	Mon Dec  8 23:48:50 1997
+++ nnrpd.c	Tue Dec 16 09:42:29 1997
@@ -326,6 +326,7 @@
 
     PERMcanread = FALSE;
     PERMcanpost = FALSE;
+    PERMpostinghost = FALSE;
     found = FALSE;
     accesslist[0] = '\0';
     while (fgets(buff, sizeof buff, F) != NULL) {
@@ -365,6 +366,7 @@
 
 	PERMcanread = strchr(fields[1], 'R') != NULL;
 	PERMcanpost = strchr(fields[1], 'P') != NULL;
+	PERMpostinghost = strchr(fields[1], 'H') != NULL;
 	(void)strcpy(PERMuser, user ? user : fields[2]);
 	(void)strcpy(PERMpass, pass ? pass : fields[3]);
 	(void)strcpy(accesslist, fields[4]);
@@ -650,10 +652,11 @@
     PerlFilter (TRUE) ;
 #endif /* defined(DO_PERL) */
 
-    Reply("%d %s InterNetNews NNRP server %s ready (%s).\r\n",
+    Reply("%d %s InterNetNews NNRP server %s ready (%s%s).\r\n",
 	   PERMcanpost ? NNTP_POSTOK_VAL : NNTP_NOPOSTOK_VAL,
 	   MyHostName, INNVersion(),
-	   PERMcanpost ? "posting ok" : "no posting");
+	   PERMcanpost ? "posting ok" : "no posting",
+	   PERMpostinghost ? ", host ok" : "");
 
     /* Main dispatch loop. */
     for (timeout = INITIAL_TIMEOUT, av = NULL; ; timeout = CLIENT_TIMEOUT) {
--- nnrpd.h.orig	Mon Dec  8 23:48:50 1997
+++ nnrpd.h	Tue Dec 16 09:42:37 1997
@@ -88,6 +88,7 @@
 EXTERN BOOL	PERMcanread;
 EXTERN BOOL	PERMneedauth;
 EXTERN BOOL	PERMspecified;
+EXTERN BOOL	PERMpostinghost;
 EXTERN BOOL	Tracing;
 EXTERN char	**PERMlist;
 EXTERN STRING	MyHostName;
--- post.c.orig	Mon Dec  8 23:48:50 1997
+++ post.c	Tue Dec 16 09:42:45 1997
@@ -482,7 +482,9 @@
     /* Supersedes; left alone. */
 
     /* NNTP-Posting host; set. */
-    HDR(_nntpposthost) = ClientHost;
+    if ((HDR(_nntpposthost) == NULL) || (!PERMpostinghost)) {
+	HDR(_nntpposthost) = ClientHost;
+    }
 
     /* Now make sure everything is there. */
     for (hp = Table; hp < ENDOF(Table); hp++)
@@ -837,6 +839,9 @@
 	hp->Size = strlen(hp->Name);
 	hp->Value = NULL;
     }
+
+    Table[_nntpposthost].CanSet=PERMpostinghost;
+
     if ((article = StripOffHeaders(article)) == NULL)
 	return Error;
     for (i = 0, p = article; p; i++, p = next + 1)


-- 
Paul Martin <pm@zetnet.net>

Technical Details
Message-ID: <6abdcq$n6g$1@roch.zetnet.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!not-for-mail
References: <6a6ehn$ddi$1@pilsner.software.com> <34C91203.794B@digex.net>

Show Full Headers
Complete Article Headers
Message-ID: <6abdcq$n6g$1@roch.zetnet.co.uk>
Subject: Re: Help with NNTP-Posting-Host header
Date: Sat, 24 Jan 1998 00:00:00 +0000
From: pm@zetnet.net (Paul Martin)
References: <6a6ehn$ddi$1@pilsner.software.com> <34C91203.794B@digex.net>
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!not-for-mail
X-Deja-AN: 318729319
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Newsgroups: news.software.nntp