[news.software.nntp] Important! 14Sep89 C News and NNTP!

flee@shire.cs.psu.edu (Felix Lee) (09/19/89)

Due to the change in the way Message-IDs are handled in the 14 Sep 89
version of C News, NNTP now accepts an ungodly number of duplicates.
The fix is to have nntpd lowercase Message-IDs following C News's
(RFC-822 compliant) rules.  Patch to nntp1.5.6/server/misc.c follows.
--
Felix Lee	flee@shire.cs.psu.edu	*!psuvax1!flee

diff -c2 -r1.1 server/misc.c
*** /tmp/,RCSt1a05318	Tue Sep 19 06:26:01 1989
--- server/misc.c	Tue Sep 19 06:24:00 1989
***************
*** 77,85 ****
   *			containing the full pathname of the
   *			article, or NULL if the message-id is not
!  *			in thef history file.
   *
   *	Side effects:	opens dbm database
   *			(only once, keeps it open after that).
!  *			Converts "msg_id" to lower case if not running Cnews.
   */
  
--- 77,86 ----
   *			containing the full pathname of the
   *			article, or NULL if the message-id is not
!  *			in the history file.
   *
   *	Side effects:	opens dbm database
   *			(only once, keeps it open after that).
!  *			Converts "msg_id" to RFC-822 rules if running
!  *			C News, otherwise lowercases "msg_id".
   */
  
***************
*** 115,123 ****
  	static FILE	*hfp = NULL;	/* history file, text version */
  
! #ifndef CNEWS
  	for (cp = msg_id; *cp != '\0'; ++cp)
  		if (isupper(*cp))
  			*cp = tolower(*cp);
- 
  #endif
  
--- 116,127 ----
  	static FILE	*hfp = NULL;	/* history file, text version */
  
! #ifdef CNEWS
! 	extern char	*rfc822ize();
! 
! 	(void) rfc822ize(msg_id);
! #else
  	for (cp = msg_id; *cp != '\0'; ++cp)
  		if (isupper(*cp))
  			*cp = tolower(*cp);
  #endif
  
***************
*** 899,900 ****
--- 903,930 ----
  #endif
  #endif LOAD
+ 
+ /* Code ripped from 16 Sep 89 C News, libcnews/case.c. */
+ /*
+  - rfc822ize - do the bizarre case conversion needed for rfc822 message-ids
+  */
+ char *				/* returns the argument */
+ rfc822ize(s)
+ char *s;
+ {
+ 	register char *p;
+ 	static char post[] = "postmaster";
+ 	static int postlen = sizeof(post)-1;
+ 
+ 	p = rindex(s, '@');
+ 	if (p == NULL)			/* no local/domain split */
+ 		p = "";			/* assume all local */
+ 	else if	(p - (s+1) == postlen && strncasecmp(s+1, post, postlen)) {
+ 		/* crazy special case -- "postmaster" is case-insensitive */
+ 		p = s;
+ 	}
+ 	for (; *p != '\0'; p++)
+ 		if (isupper(*p))
+ 			*p = tolower(*p);
+ 
+ 	return(s);
+ }

-----end of patch-----

henry@utzoo.uucp (Henry Spencer) (09/20/89)

In article <FLEE.89Sep19062737@shire.cs.psu.edu> flee@shire.cs.psu.edu (Felix Lee) writes:
>Due to the change in the way Message-IDs are handled in the 14 Sep 89
>version of C News, NNTP now accepts an ungodly number of duplicates.
>The fix is to have nntpd lowercase Message-IDs following C News's
>(RFC-822 compliant) rules.  Patch to nntp1.5.6/server/misc.c follows...

**SIGH**  This does not seem to be our month for patches.  Suitable mods
for nntp were supposed to be included in our patch, but somehow they got
lost.  (We are actually out of the NNTP patch business as far as possible,
since it's not our code, but this seemed worth making an exception.)  Our
thanks to Felix for supplying a fix.
-- 
"Where is D.D. Harriman now,   |     Henry Spencer at U of Toronto Zoology
when we really *need* him?"    | uunet!attcan!utzoo!henry henry@zoo.toronto.edu

tale@pawl.rpi.edu (David C Lawrence) (09/20/89)

How are the effects of this noticeable?  We are running NNTP 1.5.5
with C News patches and current C News (just made the switch starting
Sunday night, due to load crunching on rpi.edu).  I have not seen
duplicates appearing in groups, although log is mentioning a lot of
duplicates (which it is presumably tossing).  Are these the result of
the recent C News patch?  If so, how do I patch 1.5.5 since
Jean-Francois intoned that 1.5.6 had a couple of broken things in it
when it appeared?

Speaking of log, what knows about log and where it is located?  Since
I also keep logfiles of nntpsend and NNTP syslog activity, I prefer to
have a $NEWSCTL/logs/ where I can put them.  What do I have to change
to get C News to log and errlog there?  (Note that the xmit and syslog
reporting is already done there.)

Dave
--
 (setq mail '("tale@pawl.rpi.edu" "tale@itsgw.rpi.edu" "tale@rpitsmts.bitnet"))

henry@utzoo.uucp (Henry Spencer) (09/22/89)

In article <1989Sep20.044249.2043@rpi.edu> tale@pawl.rpi.edu (David C Lawrence) writes:
>How are the effects of this noticeable?  We are running NNTP 1.5.5
>with C News patches and current C News (just made the switch starting
>Sunday night, due to load crunching on rpi.edu).  I have not seen
>duplicates appearing in groups, although log is mentioning a lot of
>duplicates (which it is presumably tossing).  Are these the result of
>the recent C News patch?

Yes.  The problem is that RFC822 compatibility broke NNTP's duplicate
checking, so it is pulling lots of duplicates over the network.  Relaynews
then rejects them, but it's still wasteful.

>Speaking of log, what knows about log and where it is located?  Since
>I also keep logfiles of nntpsend and NNTP syslog activity, I prefer to
>have a $NEWSCTL/logs/ where I can put them.  What do I have to change
>to get C News to log and errlog there?  ...

In the current versions, at least, egrep 'log"' relay/relaynews.c will
show you where these filenames are being determined.  Just changing
those strings suitably, and recompiling, will make the desired change.
-- 
"Where is D.D. Harriman now,   |     Henry Spencer at U of Toronto Zoology
when we really *need* him?"    | uunet!attcan!utzoo!henry henry@zoo.toronto.edu