[news.sysadmin] Stoping mistaken crossposted followups

cranor@udel.EDU (Chuck Cranor) (06/02/88)

Recently there has been a lot of discussion on the misuse of cross-posting
on the net.  The problem is that people "followup" to a crossposted
article without thinking about what newsgroups their article is going to
(and editing the Newsgroup line to fix it).   The following patch
will solve this problem by forcing a "Followup-To" line if the posted
article is crossposted.

Also, as an added bonus (for more radical sysadmins), if 
you #define FIX_XPOST, inews will also automagically add a 
"Followup-To" to news articles comming in from other sites.  That will 
keep you from forwarding articles that are cross-posted with
out a "Followup-To".   [Note: inews will choose the first group
in the "newsgroup" line as the target for followup.  This may
or may not be the correct group (9 times out of 10 it is), but I
think it is better than not having a "Followup-To:" line at all!!].
Also, note that you can always redirect followups to more 
than one newsgroup, if you wish to keep the stream crossposted.

BTW, I've been running inews with the patch applied for several days
now with no problems.  (news2.11, patchlevel #13).

					Chuck

[now all we need is a something that will insert a virus in all binary
postings.... :-)  .... ]

Directions:
  Goto your news2.11 source directory and apply the following patch
by hand (yuck) or with Larry Wall's patch program.  It only effects
"inews.c".  Then #define FIX_XPOST (in Makefile) if you want, and then
"make inews" and re-install inews.


*** oldinews.c	Sun May 29 17:06:35 1988
--- inews.c	Sun May 29 17:06:41 1988
***************
*** 942,947 ****
--- 942,958 ----
  		goto writeout;
  	}
  
+ #ifdef FIX_XPOST
+ 	if (index(header.nbuf,',') != NULL && strlen(header.followto) == 0) {
+ 		register char *ptr2 = header.followto;
+ 		ptr = header.nbuf;
+ 		while (*ptr != '\0' && *ptr != ',') 
+ 			*ptr2++ = *ptr++;
+ 		*ptr2 = '\0';
+ 		logerr("Xpost_Fixed: ngs %s, fup_to %s",header.nbuf, 
+ 			header.followto);
+ 	}
+ #endif
  #ifdef ZAPNOTES
  	if (STRNCMP(header.title, "Re: Orphaned Response", 21) == 0) {
  		logerr("Orphaned Response, moved to junk");
***************
*** 1219,1224 ****
--- 1230,1241 ----
  	}
  	if (*filename)
  		(void) fclose(infp);
+ 	if (mode != PROC &&
+ 		index(header.nbuf,',') != NULL && 
+ 			strlen(header.followto) == 0)
+ 		error("Article rejected: Cross-posted to ng %s,\n\t but %s.",
+ 			header.nbuf, "there was no Followup-To line");
+ 
  	if (mode != PROC &&
  		linecount > LNCNT && linserted > (linecount-linserted))
  		error("Article rejected: %s included more text than new text",
-- 
Chuck Cranor
University of Delaware  PHONE: (302)-451-6660 (UDel), (302)-737-5852 (home)
ARPA: cranor@udel.EDU,  UUCP: ...!<your_favorite_arpa_gateway>!udel.edu!cranor
"I'd like to see John the Baptist's impersonation of Graham Hill." - R.J. Gumby