[net.news.b] bug in header.c

rees@apollo.uucp (Jim Rees) (11/23/85)

If you gateway articles from your mail system into your news system,
and the mail is in rfc822 format, you may have this problem.

The code in header.c still recognizes pre-2.10 "Received:" header lines,
and reads them into the "recdate" field of the header struct.  But
"Received:" lines from rfc822 messages are usually longer than the 64
bytes allocated in the header struct.  The result, on my system, was
that the "Expires:" field was getting over-written.  Depending on what
part of the "Received:" line writes over it, the article will either get
rejected or it will get installed with an expiration time equal to the
received time (due to bizarreness in cgtdate()), and it will get expired
the same day it came in.

The fix I recommend is to take out the pre-2.9 compatibility code, or at
least #ifdef it on OLD (and then #undef OLD).  The other thing you could
try is to make the recdate field bigger (much bigger).

***************
*** 388,394
  		return PATH;
  	if (its("Newsgroups: "))
  		return NEWSGROUP;
! 	if (its("Subject: ") || its("Title: "))
  		return TITLE;
  	if (its("Posted: ") || its("Date: "))
  		return SUBMIT;

--- 388,394 -----
  		return PATH;
  	if (its("Newsgroups: "))
  		return NEWSGROUP;
! 	if (its("Subject: "))
  		return TITLE;
  	if (its("Date: "))
  		return SUBMIT;
***************
*** 390,396
  		return NEWSGROUP;
  	if (its("Subject: ") || its("Title: "))
  		return TITLE;
! 	if (its("Posted: ") || its("Date: "))
  		return SUBMIT;
  	if (its("Date-Received: ") || its("Received: "))
  		return RECEIVE;

--- 390,396 -----
  		return NEWSGROUP;
  	if (its("Subject: "))
  		return TITLE;
! 	if (its("Date: "))
  		return SUBMIT;
  	if (its("Date-Received: "))
  		return RECEIVE;
***************
*** 392,398
  		return TITLE;
  	if (its("Posted: ") || its("Date: "))
  		return SUBMIT;
! 	if (its("Date-Received: ") || its("Received: "))
  		return RECEIVE;
  	if (its("Expires: "))
  		return EXPIRE;

--- 392,398 -----
  		return TITLE;
  	if (its("Date: "))
  		return SUBMIT;
! 	if (its("Date-Received: "))
  		return RECEIVE;
  	if (its("Expires: "))
  		return EXPIRE;