🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nn
1 messages
1 total messages Started by Tony Ambardar Mon, 26 Jul 1993 21:41
Fix: nnpost's "Duplicate ``Path:'' in header" error
#4564
Author: Tony Ambardar
Date: Mon, 26 Jul 1993 21:41
150 lines
5098 bytes
Someone previously mentioned being unable to post because of this problem.
The same thing happened to me, too. Here is an explanation and some possible
fixes. Hope this helps.

nnpost passes your message on to the mini-inews to be shot off to the nntp
server. Before sending it, inews checks to see if the message has a complete
header. Essentially, if inews can't find a "From:" line, then it adds its
own "From:" line AND a "Path:" line. If nnpost has already included a "Path:"
line then there will be two of them. This is probably why your messages
are rejected.

To get around this you could try tweaking the config file a bit. I played
with it some but didn't fix the problem.

If you can't alter the program, you could try adding your own line to the
top of the header: "From: user@hostname.domain" .

Finally, you could apply the following patch to the inews.c source file in
the inews subdir. Basically, it makes inews check for "From:" and "Path:"
lines independently. Works for me.

I should mention I'm using nn6.4.18 with the included mini-inews.

Tony Ambardar

==============================CUT HERE===================================
*** inews.c.orig	Thu Jul 22 15:38:41 1993
--- inews.c	Thu Jul 22 16:31:54 1993
***************
*** 39,45 ****
  char	*argv[];
  {
  	char	line[NNTP_STRLEN], s[NNTP_STRLEN];
! 	int	seen_fromline, in_header, seen_header;
  	int	response;
  	char	*server;
  	char	*getserverbyfile();
--- 39,45 ----
  char	*argv[];
  {
  	char	line[NNTP_STRLEN], s[NNTP_STRLEN];
! 	int	seen_fromline, seen_pathline, in_header, seen_header;
  	int	response;
  	char	*server;
  	char	*getserverbyfile();
***************
*** 103,121 ****
  	in_header = 1;
  	seen_header = 0;
  	seen_fromline = 0;
  
  	while (gets(s) != NULL) {
  		if (s[0] == '.')    /* Single . is eof, so put in extra one */
  			(void) fputc('.', ser_wr_fp);
! 		if (in_header && strneql(s, "From:", sizeof("From:")-1)) {
! 	                seen_header = 1;
! 			seen_fromline = 1;
  		}
  		if (in_header && s[0] == '\0') {
  	                if (seen_header) {
  		                in_header = 0;
! 			        if (!seen_fromline)
! 				        gen_frompath();
  			} else {
  			        continue;
  			}
--- 103,126 ----
  	in_header = 1;
  	seen_header = 0;
  	seen_fromline = 0;
+         seen_pathline = 0;
  
  	while (gets(s) != NULL) {
  		if (s[0] == '.')    /* Single . is eof, so put in extra one */
  			(void) fputc('.', ser_wr_fp);
! 		if (in_header) {
!                         seen_header = 1;
!                         if (strneql(s, "From:", sizeof("From:")-1))
! 			        seen_fromline = 1;
!                         if (strneql(s, "Path:", sizeof("Path:")-1))
! 			        seen_pathline = 1;
  		}
  		if (in_header && s[0] == '\0') {
  	                if (seen_header) {
  		                in_header = 0;
! 			        if (!seen_fromline || !seen_pathline)
! 				        gen_frompath(seen_fromline,
!                                                      seen_pathline);
  			} else {
  			        continue;
  			}
***************
*** 240,252 ****
   * a From: line in it.
   */
  
! gen_frompath()
  {
  	char	*full_name;
  	char	*cp;
  	struct	passwd *passwd;
  	char	*index(), *getenv();
! 
  	passwd = getpwuid(getuid());
  
  	full_name = getenv("NAME");
--- 245,259 ----
   * a From: line in it.
   */
  
! gen_frompath(seen_fromline, seen_pathline)
! int seen_fromline,seen_pathline;
! 
  {
  	char	*full_name;
  	char	*cp;
  	struct	passwd *passwd;
  	char	*index(), *getenv();
!         if (!seen_fromline) {
  	passwd = getpwuid(getuid());
  
  	full_name = getenv("NAME");
***************
*** 291,297 ****
  		}
  
  	fprintf(ser_wr_fp, ")\r\n");
! 
  #ifdef HIDDENNET
  	/* Only the login name - nntp server will add uucp name */
  	fprintf(ser_wr_fp, "Path: %s\r\n", passwd->pw_name);
--- 298,305 ----
  		}
  
  	fprintf(ser_wr_fp, ")\r\n");
!       }
!         if (!seen_pathline) {
  #ifdef HIDDENNET
  	/* Only the login name - nntp server will add uucp name */
  	fprintf(ser_wr_fp, "Path: %s\r\n", passwd->pw_name);
***************
*** 298,303 ****
--- 306,312 ----
  #else /* HIDDENNET */
  	fprintf(ser_wr_fp, "Path: %s!%s\r\n", host_name, passwd->pw_name);
  #endif /* HIDDENNET */
+       }
  }
  
  
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads