[news.software.b] Minor hacks to rn

hyc@umix.cc.umich.edu (Howard Chu) (09/15/87)

These context diffs for scripts and source code for rn provide the following
changes:
  a) Allow specifying an Internet domain name to replace the ".UUCP" in
     the "Reply-To:" header.
  b) Allow specifying a preferred UUCP path to one's machine in the header.

  The combination of these should be enough to eliminate the need for any
  email routing info in one's signature. It'll also make sure that everyone
  posting news from a single site will present the same route to the rest
  the world... (Of course it can be overridden with the proper environment
  variable, but most people are too lazy to munge their own headers...)
  Note that (b) is only intended as a convenience for human readers; the
  transfer programs will still generate and use "From:" and "Path:" headers.

  c) For systems with the SIGWINCH signal, window resizing will be caught
     and recognized by rn's pager.

Everyting is based on rn of patchlevel 39. The Configure script also has
the patches for rrn applied, and the code has been run on both local and
remote configurations of rn. (local on Vax 750 w/BSD4.3, remote on Sun 3/50
w/Sun3.2-Sun3.4.) If you have problems getting this stuff to run, well...
"Gee, it worked for me..."   }-)

[Now go to your rn source directory and feed this to patch, or junk this article...]

*** /tmp/,RCSt1009424	Tue Sep 15 10:28:40 1987
--- Configure	Tue Sep 15 10:27:45 1987
***************
*** 3,44 ****
  # If these # comments don't work, trim them.  Don't worry about the other
  # shell scripts, Configure will trim # comments from them for you.
  #
! # $Header: Configure,v 1.1 87/05/13 00:54:48 hyc Exp $
  #
  # $Log:	Configure,v $
! # Revision 1.1  87/05/13  00:54:48  hyc
! # Initial revision
  # 
! # Revision 4.9  86/03/19  00:58:05  rsk
! # Patch from Spaf allows determination of news 2.10.3 when configuring;
! # should help to decide whether or not Relay-Version lines will be used.
  # 
! # Revision 4.8  85/11/04  00:23:28  rsk
! # Now forces inews location to be /usr/local/lib/news/inews in
! # preparation for news 2.10.3.  This won't work with PUCC's
! # 2.10.1 or 2.10.2 installations.
! # Rsk
  # 
! # Revision 4.7  85/08/14  20:29:33  rsk
! # Fixed a typo and removed message about reading "README.PUCC",
! # since if they've gotten this far, they've already seen it.
  # 
! # Revision 4.6  85/08/14  18:30:35  rsk
! # Changed to do automatic mangling of inews location in
! # order to keep from trying /usr/lib/news/inews on
! # 2.10.1 news machine.  See README.PUCC for details.
  # 
! # Revision 4.5  85/08/14  11:31:54  rsk
! # Added message at conclusion pointing the reader to
! # the README.PUCC file with important local installation
! # instructions.
  # 
! # Revision 4.4  85/08/13  17:42:56  rsk
! # Results of patches 1 through 25
  # 
! # Revision 4.3  85/05/01  11:31:23  lwall
! # Release 4.3 of rn
  # 
  # Revision 4.3  85/05/01  11:31:23  lwall
  # Baseline for release with 4.3bsd.
  # 
--- 3,48 ----
  # If these # comments don't work, trim them.  Don't worry about the other
  # shell scripts, Configure will trim # comments from them for you.
  #
! # $Header: Configure,v 1.5 87/09/15 10:26:45 hyc Exp $
  #
  # $Log:	Configure,v $
! # Revision 1.5  87/09/15  10:26:45  hyc
! # Forgot to initialize dflt to null for uucppath...
  # 
! # Revision 1.4  87/09/12  11:50:33  hyc
! # Added stuff for UUCPPATH and associated header, fixed rrn portion
! # to accept previous default for server name.
  # 
! # Revision 1.3  87/08/26  23:49:42  hyc
! # Playing with the domain name...
  # 
! # Revision 1.2  87/08/09  15:14:19  hyc
! # From jeckle's Configure script... Has rrn stuff merged in, and also
! # asks for Internet domain.
  # 
! # Revision 1.2  87/08/06  16:30:38  hyc
! # Added stufff for MYDOMAIN definition, to replace the fixed string ".UUCP"
! # which is so painful in Reply-To fields...
  # 
! # Revision 1.1  87/04/29  23:00:14  hyc
! # Initial revision
  # 
! # Revision 4.3.1.5  85/05/23  11:23:22  lwall
! # filexp flubs sed command.
  # 
! # Revision 4.3.1.4  85/05/20  17:13:11  lwall
! # Makes sure -lcurses is really a terminfo library.
! # Puts single instead of double quotes around defs in config.sh.
  # 
+ # Revision 4.3.1.3  85/05/16  16:48:48  lwall
+ # Took space from end of filexp output.
+ # 
+ # Revision 4.3.1.2  85/05/13  15:54:35  lwall
+ # Libraries in /usr/local/lib shouldn't use -l switch.
+ # 
+ # Revision 4.3.1.1  85/05/10  11:29:20  lwall
+ # Branch for patches.
+ # 
  # Revision 4.3  85/05/01  11:31:23  lwall
  # Baseline for release with 4.3bsd.
  # 
***************
*** 91,96 ****
--- 95,102 ----
  Log=''
  Header=''
  sitename=''
+ mydomain=''
+ uucppath=''
  orgname=''
  isadmin=''
  newsadmin=''
***************
*** 131,136 ****
--- 137,145 ----
  phostname=''
  hostcmd=''
  norelay=''
+ isrrn=''
+ rrnserver=''
+ NNTPSRC=''
  CONFIG=''
  
  echo "Beginning of configuration questions for rn kit."
***************
*** 695,700 ****
--- 704,748 ----
      hostcmd=''
  done
  
+ : get UUCP path to this site
+ case "$uucppath" in
+ '') dflt='';;
+ *)  dflt="$uucppath";;
+ esac
+ $cat << 'EOH'
+ 
+ If your site can be reached by a pure UUCP path, enter that path here,
+ excluding your own site name. e.g., if your path is "uunet!host!user",
+ just enter "uunet!" as the path. Otherwise leave this blank.
+ 
+ EOH
+ 	$echo $n "UUCP path: [$dflt] $c"
+ 	. myread
+ 	case "$ans" in
+ 	'')	uucppath="$dflt";;
+ 	*)	uucppath="$ans";;
+ 	esac
+ 
+ : get Internet domain name
+ case "$mydomain" in
+ '') dflt='.UUCP';;
+ *)  dflt="$mydomain";;
+ esac
+ $cat << 'EOH'
+ 
+ If your site is on the Internet, please enter your domain here, otherwise
+ just use ".UUCP" as your domain. Be sure to include the leading ".", e.g.
+ 	.css.gov
+ 	.edu
+ 
+ EOH
+     $echo $n "Domain: [$dflt] $c"
+     . myread
+     case "$ans" in
+     '') mydomain="$dflt";;
+     *)  mydomain="$ans" ;;
+     esac
+ 
  : get organizaton name
  longshots='/usr/src/new /usr/src/local /usr/local/src'
  case "$orgname" in
***************
*** 1295,1301 ****
      fi
  fi
  
! : locate spool directory
  case "$spool" in
  '')
      dflt=/usr/spool/news
--- 1343,1421 ----
      fi
  fi
  
! : locate spool directory and check if rrn
! case "$isrrn" in
! define)
!     dflt="y";;
! *)
!     dflt="n";;
! esac
! isrrn=''
! while test -z "$isrrn" ; do
!     $echo " "
!     $echo $n "Do you want this built as remote rn (rrn)? [$dflt] $c"
!     . myread
!     case "$ans" in
!     '') ans="$dflt";;
!     esac
!     case "$ans" in
!     n*)
! 	isrrn=undef;;
!     y*)
! 	isrrn=define
! 	spool=/tmp
! 	$echo "net.foobar 00001 00001 y" > .falseactive
! 
! 	case "$rrnserver" in
! 	'')  dflt="none defined";;
! 	*)   dflt="$rrnserver";;
! 	esac
! 
! 	ans=''
! 	while test -z "$ans" ; do
! 	$echo $n "Enter the name of the news server host: [$dflt] $c"
! 	. myread
! 	case "$ans" in
! 	'')  if test "$dflt" != "none defined"; then
! 		ans="$dflt"
! 	     fi;;
! 	esac
! 	done
! 	rrnserver="$ans"
! 
! 	case "$NNTPSRC" in
! 	'') dflt="no default";;
! 	*)  dflt="$NNTPSRC";;
! 	esac
! 
! 	ans='blurfl/dyick'
! 	while $test ! -d "$ans"; do
! 	    $echo $n "Enter the pathname of the NNTP source directory: [$dflt] $c"
! 	    . myread
! 	    case "$ans" in
! 	    '') ans="$dflt";;
! 	    esac
! 	    ans=`filexp "$ans"`
! 	    if test ! -r $ans/common/response_codes.h ; then
! 		ans='blurfl/dyick'
! 	    fi
! 	done
! 	NNTPSRC="$ans"
! cat > server.h <<EOF_SERVE
! #ifdef SERVER
! 
! EXT	int	server_init();
! EXT	void	put_server();
! EXT	int	get_server();
! 
! #include "$NNTPSRC/common/response_codes.h"
! #endif
! EOF_SERVE
! 
!     esac
! 
! done
! 
  case "$spool" in
  '')
      dflt=/usr/spool/news
***************
*** 1302,1309 ****
      ;;
  *)  dflt="$spool";;
  esac
! ans='blurfl/dyick'
! while $test ! -d $ans; do
      $echo " "
      case "$ans" in
      blurfl*);;
--- 1422,1432 ----
      ;;
  *)  dflt="$spool";;
  esac
! case "$isrrn" in
! define)  ans=/tmp;;
! *) ans='blurfl/dyick';;
! esac
! while $test ! -d "$ans"; do
      $echo " "
      case "$ans" in
      blurfl*);;
***************
*** 1336,1342 ****
      ;;
  *)  dflt="$active";;
  esac
! myactive='blurfl/dyick'
  while $test ! -f "$myactive"; do
      $echo " "
      case "$myactive" in
--- 1459,1468 ----
      ;;
  *)  dflt="$active";;
  esac
! case "$isrrn" in
! define) myactive=.falseactive;;
! *) myactive='blurfl/dyick'
! esac
  while $test ! -f "$myactive"; do
      $echo " "
      case "$myactive" in
***************
*** 1382,1388 ****
      case "$ans" in
      n*)
  	norelay='undef'
!     echo "Looks like you are running at least 2.10.2 news."
  	;;
      *)  norelay='define' ;;
      esac
--- 1508,1514 ----
      case "$ans" in
      n*)
  	norelay='undef'
! 	echo "Looks like you are running at least 2.10.2 news."
  	;;
      *)  norelay='define' ;;
      esac
***************
*** 1813,1818 ****
--- 1939,1946 ----
  Log='$Log'
  Header='$Header'
  sitename='$sitename'
+ uucppath='$uucppath'
+ mydomain='$mydomain'
  orgname='$orgname'
  isadmin='$isadmin'
  newsadmin='$newsadmin'
***************
*** 1853,1858 ****
--- 1981,1989 ----
  phostname='$phostname'
  hostcmd='$hostcmd'
  norelay='$norelay'
+ isrrn='$isrrn'
+ rrnserver='$rrnserver'
+ NNTPSRC='$NNTPSRC'
  CONFIG=true
  EOT
  
***************
*** 1868,1873 ****
--- 1999,2010 ----
  /* name of the site.  May be overridden by gethostname, uname, etc. */
  #define SITENAME "$sitename"
  
+ /* uucp path to this site. Leave blank if none. */
+ #define UUCPPATH "$uucppath"
+ 
+ /* Internet domain of site. Use ".UUCP" if not registered on Internet. */
+ #define MYDOMAIN "$mydomain"
+ 
  /* name of the organization, may be a file name */
  #define ORGNAME "$orgname"
  
***************
*** 1940,1945 ****
--- 2077,2084 ----
  #$douname	DOUNAME		/* do we have a uname function? */
  #$phostname	PHOSTNAME "$hostcmd"	/* how to get host name with popen */
  #$norelay	NORELAY		/* 2.10.3 doesn't have Relay-Version line */
+ #$isrrn		SERVER		/* rrn server code */
+ #define	SERVER_HOST	"$rrnserver"
  EOT
  
  CONFIG=true
***************
*** 1951,1965 ****
  echo " "
  set `$grep <MANIFEST '\.SH' | awk '{print $1}'`
  for file in $*; do
      . $file
  done
- echo "Fixing stuff for PUCC localisms..."
- echo "Substituting /usr/local/lib/news/inews for /usr/lib/news/inews in Pnews and config.h"
- echo
- $sed -e "s/\/usr\/lib\/news\/inews/\/usr\/local\/lib\/news\/inews/" < Pnews > Pnews.pucc
- mv Pnews.pucc Pnews
- $sed -e "s/\/usr\/lib\/news\/inews/\/usr\/local\/lib\/news\/inews/" < config.h > config.h.pucc
- mv config.h.pucc config.h
  
  echo " "
  echo 'Now you need to generate make dependencies by running "makedepend".'
--- 2090,2105 ----
  echo " "
  set `$grep <MANIFEST '\.SH' | awk '{print $1}'`
  for file in $*; do
+ if $test "$isrrn" = define ; then
+     if $test -r ${file}.rrn ; then
+ 	. ${file}.rrn
+     else
+         . $file
+     fi
+ else
      . $file
+ fi
  done
  
  echo " "
  echo 'Now you need to generate make dependencies by running "makedepend".'
*** /tmp/,RCSt1009429	Tue Sep 15 10:29:04 1987
--- Makefile.SH	Mon Sep 14 23:04:48 1987
***************
*** 3,14 ****
  esac
  echo "Extracting Makefile {with variable substitutions}"
  cat >Makefile <<!GROK!THIS!
! # $Header: Makefile.SH,v 1.1 87/08/27 01:29:38 hyc Exp $
  #
  # $Log:	Makefile.SH,v $
  # Revision 1.1  87/08/27  01:29:38  hyc
  # Initial revision
! # 
  # Revision 4.19  86/08/22  23:37:14  rsk
  # Now runs config.sh regardless of root's path.
  # 
--- 3,17 ----
  esac
  echo "Extracting Makefile {with variable substitutions}"
  cat >Makefile <<!GROK!THIS!
! # $Header: Makefile.SH,v 1.2 87/08/27 01:49:59 hyc Exp $
  #
  # $Log:	Makefile.SH,v $
+ # Revision 1.2  87/08/27  01:49:59  hyc
+ # Various minor fixes, got rid of Purdue'isms... 
+ # 
  # Revision 1.1  87/08/27  01:29:38  hyc
  # Initial revision
! #
  # Revision 4.19  86/08/22  23:37:14  rsk
  # Now runs config.sh regardless of root's path.
  # 
***************
*** 97,105 ****
  CC = $cc
  BINDEST = $rnbin
  LIBDEST = $rnlib
- ETCDEST = /usr/local/etc
  DEFS = -DDOXREFS
! CFLAGS = $iandd -O ${DEFS}
  LDFLAGS = $iandd
  NDIRC = $ndirc
  NDIRO = $ndiro
--- 100,107 ----
  CC = $cc
  BINDEST = $rnbin
  LIBDEST = $rnlib
  DEFS = -DDOXREFS
! CFLAGS = $iandd -O \${DEFS}
  LDFLAGS = $iandd
  NDIRC = $ndirc
  NDIRO = $ndiro
***************
*** 106,113 ****
  MODE = 751
  SHMODE = 755
  TXTMODE = 644
! OWNER = binary
! GROUP = system
  
  libs = $ndirlib $termlib $jobslib
  !GROK!THIS!
--- 108,115 ----
  MODE = 751
  SHMODE = 755
  TXTMODE = 644
! OWNER = $newsadmin
! GROUP = daemon
  
  libs = $ndirlib $termlib $jobslib
  !GROK!THIS!
***************
*** 219,226 ****
  	-install -c -m ${SHMODE} -o ${OWNER} -g ${GROUP} newsetup ${BINDEST}
  	-install -c -m ${SHMODE} -o ${OWNER} -g ${GROUP} newsgroups ${BINDEST}
  	-install -c -m ${SHMODE} -o ${OWNER} -g ${GROUP} Pnews ${BINDEST}
- 	-rm -f ${ETCDEST}/Plog
- 	-ln ${BINDEST}/Pnews ${ETCDEST}/Plog
  	-install -c -m ${SHMODE} -o ${OWNER} -g ${GROUP} Rnmail ${BINDEST}
  	-install -c -m ${SHMODE} -o ${OWNER} -g ${GROUP} INIT ${LIBDEST}
  	-install -c -m ${SHMODE} -o ${OWNER} -g ${GROUP} newsnews ${LIBDEST}
--- 221,226 ----
*** /tmp/,RCSt1009434	Tue Sep 15 10:29:13 1987
--- Pnews.SH	Mon Sep 14 23:04:52 1987
***************
*** 4,15 ****
  echo "Extracting Pnews (with variable substitutions)"
  $spitshell >Pnews <<!GROK!THIS!
  $startsh
! # $Header: Pnews.SH,v 1.1 87/08/27 00:35:56 hyc Exp $
  #
  # $Log:	Pnews.SH,v $
! # Revision 1.1  87/08/27  00:35:56  hyc
! # Initial revision
  # 
  # Revision 4.14  86/10/30  17:56:42  rsk
  # Removed .UUCP from sitename suffix in Pnews and Pnews.header iin
  # order to enable local replying to news articles.
--- 4,20 ----
  echo "Extracting Pnews (with variable substitutions)"
  $spitshell >Pnews <<!GROK!THIS!
  $startsh
! # $Header: Pnews.SH,v 1.3 87/09/12 11:53:59 hyc Exp $
  #
  # $Log:	Pnews.SH,v $
! # Revision 1.3  87/09/12  11:53:59  hyc
! # added stuff for UUCP-Path: header
  # 
+ # Revision 1.2  87/08/27  00:36:56  hyc
+ # Changed '$sitename' to '$sitename$domain' in 'Reply-To:' field of
+ # the header. $domain is defined in the Configure script now, and
+ # defaults to .UUCP but may be any domain or a null string, if desired.
+ # 
  # Revision 4.14  86/10/30  17:56:42  rsk
  # Removed .UUCP from sitename suffix in Pnews and Pnews.header iin
  # order to enable local replying to news articles.
***************
*** 86,91 ****
--- 91,101 ----
  ;;
  esac
  
+ #your domain name
+ mydomain="$mydomain"
+ #your preferred UUCP routing
+ uucppath="$uucppath"
+ 
  # your organization name
  orgname="$orgname"
  # what pager you use--if you have kernal paging use cat
***************
*** 707,712 ****
--- 717,724 ----
  /*) orgname=`$cat $orgname` ;;
  esac
  
+ case $uucppath in
+ '')	
  $cat > $tmpart <<EOHeader
  Newsgroups: $ng
  Subject: $title
***************
*** 713,719 ****
  Expires: 
  References: 
  Sender: 
! Reply-To: $logname@$sitename ($fullname)
  Followup-To: $follow
  Distribution: $dist
  Organization: $orgname
--- 725,731 ----
  Expires: 
  References: 
  Sender: 
! Reply-To: $logname@$sitename$mydomain ($fullname)
  Followup-To: $follow
  Distribution: $dist
  Organization: $orgname
***************
*** 720,725 ****
--- 732,755 ----
  Keywords: 
  
  EOHeader
+ ;;
+ *)
+ $cat > $tmpart <<EOHeader
+ Newsgroups: $ng
+ Subject: $title
+ Expires: 
+ References: 
+ Sender: 
+ Reply-To: $logname@$sitename$mydomain ($fullname)
+ UUCP-Path: $uucppath$sitename!$logname
+ Followup-To: $follow
+ Distribution: $dist
+ Organization: $orgname
+ Keywords: 
+ 
+ EOHeader
+ ;;
+ esac
  
  !NO!SUBS!
  $eunicefix Pnews.header
*** /tmp/,RCSt1009439	Tue Sep 15 10:29:23 1987
--- Rnmail.SH	Mon Sep 14 23:08:40 1987
***************
*** 4,15 ****
  echo "Extracting Rnmail (with variable substitutions)"
  $spitshell >Rnmail <<!GROK!THIS!
  $startsh
! # $Header: Rnmail.SH,v 1.1 87/09/12 16:40:02 hyc Exp $
  # 
  # $Log:	Rnmail.SH,v $
  # Revision 1.1  87/09/12  16:40:02  hyc
  # Initial revision
! # 
  # Revision 4.6  86/08/22  23:37:38  rsk
  # Now runs config.sh regardless of root's path.
  # 
--- 4,22 ----
  echo "Extracting Rnmail (with variable substitutions)"
  $spitshell >Rnmail <<!GROK!THIS!
  $startsh
! # $Header: Rnmail.SH,v 1.3 87/09/14 23:08:08 hyc Exp $
  # 
  # $Log:	Rnmail.SH,v $
+ # Revision 1.3  87/09/14  23:08:08  hyc
+ # Ooops. Fixed UUCP-Path header.
+ # 
+ # Revision 1.2  87/09/12  16:46:15  hyc
+ # Added UUCP-Path: to mail header. I dunno if I really wanted to do
+ # this or not... Does it make a difference?
+ # 
  # Revision 1.1  87/09/12  16:40:02  hyc
  # Initial revision
! #
  # Revision 4.6  86/08/22  23:37:38  rsk
  # Now runs config.sh regardless of root's path.
  # 
***************
*** 42,47 ****
--- 49,56 ----
  define) sitename=\`$hostcmd\` ;;
  undef) sitename="$sitename" ;;
  esac
+ # your preferred uucp path
+ uucppath="$uucppath"
  # your organization name
  orgname="$orgname"
  # what pager you use--if you have kernal paging use cat
***************
*** 131,137 ****
      /*) orgname=`$cat $orgname` ;;
      esac
  
!     $cat > $tmpart <<EOHeader
  To: $to
  Subject: $title
  Organization: $orgname
--- 140,147 ----
      /*) orgname=`$cat $orgname` ;;
      esac
  
!     case $uucppath in
!     '')	$cat > $tmpart << EOHeader
  To: $to
  Subject: $title
  Organization: $orgname
***************
*** 139,145 ****
--- 149,166 ----
  Bcc:
  
  EOHeader
+ 	;;
+     *) $cat > $tmpart << EOHeader
+ To: $to
+ Subject: $title
+ Organization: $orgname
+ UUCP-Path: $uucppath$sitename!$USER
+ Cc:
+ Bcc:
  
+ EOHeader
+ 	;;
+     esac
      ;;
  *)
      $cat < $headerfile  > $tmpart
*** /tmp/,RCSt1009444	Tue Sep 15 10:29:38 1987
--- common.h	Mon Sep 14 23:08:44 1987
***************
*** 1,6 ****
! /* $Header: common.h,v 1.1 87/08/27 02:29:00 hyc Exp $
   * 
   * $Log:	common.h,v $
   * Revision 1.1  87/08/27  02:29:00  hyc
   * Initial revision
   * 
--- 1,16 ----
! /* $Header: common.h,v 1.4 87/09/14 23:07:06 hyc Exp $
   * 
   * $Log:	common.h,v $
+  * Revision 1.4  87/09/14  23:07:06  hyc
+  * Added UUCP-Path: header to mail header in Rnmail...
+  * 
+  * Revision 1.3  87/09/12  11:53:11  hyc
+  * added stuff for UUCP-Path: header
+  * 
+  * Revision 1.2  87/08/27  02:31:23  hyc
+  * Fixes for Internet domain name as defined by Configure, instead of
+  * '.UUCP' in 'Reply-To:' fields...
+  * 
   * Revision 1.1  87/08/27  02:29:00  hyc
   * Initial revision
   * 
***************
*** 147,152 ****
--- 157,164 ----
   *	%U	Number of unread articles disregarding current article
   *	%x	News library directory, usually /usr/lib/news
   *	%X	Rn library directory, usually %x/rn
+  *	%y	UUCP path to site
+  *  %Y  Internet domain name of site (or .UUCP if not on Internet)
   *	%z	Size of current article in bytes.
   *	%~	Home directory
   *	%.	Directory containing . files
***************
*** 529,537 ****
  #ifdef INTERNET
  #   ifndef MAILHEADER		/* % */
  #	ifdef CONDSUB
! #	    define MAILHEADER "To: %t\nSubject: Re: %S\nNewsgroups: %n\nIn-Reply-To: %i\n%(%[references]!=^$?References\\: %[references]\n)Organization: %o\nCc: \nBcc: \n\n"
  #	else
! #	    define MAILHEADER "To: %t\nSubject: Re: %S\nNewsgroups: %n\nIn-Reply-To: %i\nReferences: %[references]\nCc: \nBcc: \n\n"
  #	endif
  #   endif
  #else
--- 541,557 ----
  #ifdef INTERNET
  #   ifndef MAILHEADER		/* % */
  #	ifdef CONDSUB
! #	    ifdef UUCPPATH
! #		define MAILHEADER "To: %t\nSubject: Re: %S\nNewsgroups: %n\nIn-Reply-To: %i\n%(%[references]!=^$?References\\: %[references]\n)UUCP-Path: %y%H!%L\nOrganization: %o\nCc: \nBcc: \n\n"
! #	    else
! #		define MAILHEADER "To: %t\nSubject: Re: %S\nNewsgroups: %n\nIn-Reply-To: %i\n%(%[references]!=^$?References\\: %[references]\n)Organization: %o\nCc: \nBcc: \n\n"
! #	    endif
  #	else
! #	    ifdef UUCPPATH
! #		define MAILHEADER "To: %t\nSubject: Re: %S\nNewsgroups: %n\nIn-Reply-To: %i\nReferences: %[references]\nUUCP-Path:%y%H!%L\nCc: \nBcc: \n\n"
! #	    else
! #		define MAILHEADER "To: %t\nSubject: Re: %S\nNewsgroups: %n\nIn-Reply-To: %i\nReferences: %[references]\nCc: \nBcc: \n\n"
! #	    endif
  #	endif
  #   endif
  #else
***************
*** 554,564 ****
  #endif
  
  #ifndef NEWSHEADER		/* % */
! #   ifdef CONDSUB
! #	define NEWSHEADER "Newsgroups: %(%F=^$?%C:%F)\nSubject: %(%S=^$?%\"\n\nSubject: \":Re: %S)\nSummary: \nExpires: \n%(%R=^$?:References: %R\n)Sender: \nReply-To: %L@%H.UUCP (%N)\nFollowup-To: \nDistribution: %(%i=^$?%\"Distribution: \":%D)\nOrganization: %o\nKeywords: %[keywords]\n\n"
! #   else
! #	define NEWSHEADER "Newsgroups: %F\nSubject: Re: %S\nSummary: \nExpires: \nReferences: %R\nSender: \nReply-To: %L@%H.UUCP (%N)\nFollowup-To: \nDistribution: %D\nOrganization: %o\nKeywords: %[keywords]\n\n"
! #   endif
  #endif
  
  #ifndef ATTRIBUTION		/* % */
--- 574,592 ----
  #endif
  
  #ifndef NEWSHEADER		/* % */
! #    ifdef CONDSUB
! #	ifdef UUCPPATH
! #	    define NEWSHEADER "Newsgroups: %(%F=^$?%C:%F)\nSubject: %(%S=^$?%\"\n\nSubject: \":Re: %S)\nSummary: \nExpires: \n%(%R=^$?:References: %R\n)Sender: \nUUCP-Path: %y%H!%L\nReply-To: %L@%H%Y (%N)\nFollowup-To: \nDistribution: %(%i=^$?%\"Distribution: \":%D)\nOrganization: %o\nKeywords: %[keywords]\n\n"
! #	else
! #	    define NEWSHEADER "Newsgroups: %(%F=^$?%C:%F)\nSubject: %(%S=^$?%\"\n\nSubject: \":Re: %S)\nSummary: \nExpires: \n%(%R=^$?:References: %R\n)Sender: \nReply-To: %L@%H%Y (%N)\nFollowup-To: \nDistribution: %(%i=^$?%\"Distribution: \":%D)\nOrganization: %o\nKeywords: %[keywords]\n\n"
! #	endif
! #    else
! #	ifdef UUCPPATH
! #	    define NEWSHEADER "Newsgroups: %F\nSubject: Re: %S\nSummary: \nExpires: \nReferences: %R\nSender: \nUUCP-Path: %y%H!%L\nReply-To: %L@%H%Y (%N)\nFollowup-To: \nDistribution: %D\nOrganization: %o\nKeywords: %[keywords]\n\n"
! #	else
! #	    define NEWSHEADER "Newsgroups: %F\nSubject: Re: %S\nSummary: \nExpires: \nReferences: %R\nSender: \nReply-To: %L@%H%Y (%N)\nFollowup-To: \nDistribution: %D\nOrganization: %o\nKeywords: %[keywords]\n\n"
! #	endif
! #    endif
  #endif
  
  #ifndef ATTRIBUTION		/* % */
***************
*** 629,635 ****
  
  /* how to cancel an article, continued */
  #ifndef CANCELHEADER
! #   define CANCELHEADER "Newsgroups: %n\nSubject: cmsg cancel %i\nReferences: %R\nReply-To: %L@%H.UUCP (%N)\nDistribution: %D\nOrganization: %o\n"
  #endif
  
  /* where to find the mail file */
--- 657,663 ----
  
  /* how to cancel an article, continued */
  #ifndef CANCELHEADER
! #   define CANCELHEADER "Newsgroups: %n\nSubject: cmsg cancel %i\nReferences: %R\nReply-To: %L@%H%Y (%N)\nDistribution: %D\nOrganization: %o\n"
  #endif
  
  /* where to find the mail file */
*** /tmp/,RCSt1009459	Tue Sep 15 10:30:01 1987
--- intrp.c	Mon Sep 14 23:05:04 1987
***************
*** 1,7 ****
! /* $Header: intrp.c,v 1.1 87/08/09 15:16:14 hyc Exp $
   *
   * $Log:	intrp.c,v $
!  * Revision 1.1  87/08/09  15:16:14  hyc
   * Initial revision
   * 
   * Revision 4.4  85/08/13  17:41:57  rsk
--- 1,21 ----
! /* $Header: intrp.c,v 1.4 87/09/12 11:54:31 hyc Exp $
   *
   * $Log:	intrp.c,v $
!  * Revision 1.4  87/09/12  11:54:31  hyc
!  * added stuff for UUCP-Path: header
!  * 
!  * Revision 1.3  87/08/27  00:20:08  hyc
!  * Makes sure domain name is truncated from the hostname in case the
!  * hostname() returns a fully qualified name... (As with umix!)
!  * 
!  * Revision 1.2  87/08/09  15:16:34  hyc
!  * Changed to use domain name as defined during Configure...
!  * 
!  * Revision 1.2  87/08/06  16:29:11  hyc
!  * Changed fixed string '.UUCP' in Reply-To field to variable string MYDOMAIN,
!  * which is defined in the Configure script.
!  * 
!  * Revision 1.1  87/06/15  14:09:39  hyc
   * Initial revision
   * 
   * Revision 4.4  85/08/13  17:41:57  rsk
***************
*** 79,85 ****
  intrp_init(tcbuf)
  char *tcbuf;
  {
!     char *getlogin();
  
      spool = savestr(filexp(SPOOL));	/* usually /usr/spool/news */
      
--- 93,99 ----
  intrp_init(tcbuf)
  char *tcbuf;
  {
!     char *getlogin(), *i, *index();
  
      spool = savestr(filexp(SPOOL));	/* usually /usr/spool/news */
      
***************
*** 145,150 ****
--- 159,166 ----
  #endif
  #endif
  #endif
+     if (i=index(SITENAME,'.'))
+ 	*i=0;
      sitename = savestr(SITENAME);
  }
  
***************
*** 788,793 ****
--- 804,815 ----
  		case 'X':			/* rn library */
  		    s = rnlib;
  		    break;
+ 		case 'y':			/* UUCP path to site */
+ 		    s = UUCPPATH;
+ 		    break;
+ 		case 'Y':			/* Internet domain name */
+ 		    s = MYDOMAIN;
+ 		    break;
  		case 'z':
  #ifdef LINKART
  		    s = linkartname;	/* so Eunice people get right file */
***************
*** 964,970 ****
  		int len;
  
  		*dest = *dot++ = '\0';
! 		sprintf(tmpbuf,"%s@%s.UUCP",dot,beg);
  		len = strlen(tmpbuf);
  		if (destsize > len) {
  		    strcpy(dest,tmpbuf);
--- 986,992 ----
  		int len;
  
  		*dest = *dot++ = '\0';
! 		sprintf(tmpbuf,"%s@%s.%s",dot,beg,MYDOMAIN);
  		len = strlen(tmpbuf);
  		if (destsize > len) {
  		    strcpy(dest,tmpbuf);
*** /tmp/,RCSt1009467	Tue Sep 15 10:30:12 1987
--- newsetup.SH	Mon Sep 14 23:05:07 1987
***************
*** 4,15 ****
  echo "Extracting newsetup (with variable substitutions)"
  $spitshell >newsetup <<!GROK!THIS!
  $startsh
! # $Header: newsetup.SH,v 1.1 87/08/25 19:29:01 hyc Exp $
  # 
  # $Log:	newsetup.SH,v $
  # Revision 1.1  87/08/25  19:29:01  hyc
  # Initial revision
! # 
  # Revision 4.5  86/10/30  17:55:45  rsk
  # Results of patch #29 (which had already been applied via a fix from Spaf)
  # and patch #30.
--- 4,18 ----
  echo "Extracting newsetup (with variable substitutions)"
  $spitshell >newsetup <<!GROK!THIS!
  $startsh
! # $Header: newsetup.SH,v 1.2 87/08/25 20:26:14 hyc Exp $
  # 
  # $Log:	newsetup.SH,v $
+ # Revision 1.2  87/08/25  20:26:14  hyc
+ # removed old newsgroups.
+ # 
  # Revision 1.1  87/08/25  19:29:01  hyc
  # Initial revision
! #
  # Revision 4.5  86/10/30  17:55:45  rsk
  # Results of patch #29 (which had already been applied via a fix from Spaf)
  # and patch #30.
***************
*** 69,78 ****
  	-e "  w /tmp/n.net\$\$"		\\
  	-e '  d'			\\
  	-e '}'				\\
- 	-e "/^mod\./{"			\\
- 	-e "  w /tmp/n.mod\$\$"		\\
- 	-e '  d'			\\
- 	-e '}'				\\
  	-e "/^\$locorg\./{"		\\
  	-e "  w /tmp/n.\$locorg\$\$"	\\
  	-e '  d'			\\
--- 72,77 ----
***************
*** 89,104 ****
  	-e "  w /tmp/n.\$state\$\$"	\\
  	-e '  d'			\\
  	-e '}'				\\
! 	-e "/^fa\./{"			\\
! 	-e "  w /tmp/n.fa\$\$"		\\
  	-e '  d'			\\
  	-e '}'
  
  $sed </tmp/n.tmp\$\$ >/tmp/n.local\$\$	\\
- 	-e "/^\$cntry\./{" 		\\
- 	-e "  w /tmp/n.\$cntry\$\$"	\\
- 	-e '  d'			\\
- 	-e '}'				\\
  	-e "/^\$cont\./{" 		\\
  	-e "  w /tmp/n.\$cont\$\$"	\\
  	-e '  d'			\\
--- 88,99 ----
  	-e "  w /tmp/n.\$state\$\$"	\\
  	-e '  d'			\\
  	-e '}'				\\
! 	-e "/^\$cntry\./{" 		\\
! 	-e "  w /tmp/n.\$cntry\$\$"	\\
  	-e '  d'			\\
  	-e '}'
  
  $sed </tmp/n.tmp\$\$ >/tmp/n.local\$\$	\\
  	-e "/^\$cont\./{" 		\\
  	-e "  w /tmp/n.\$cont\$\$"	\\
  	-e '  d'			\\
***************
*** 151,157 ****
      /tmp/n.\$state\$\$ \\
      /tmp/n.\$cntry\$\$ \\
      /tmp/n.\$cont\$\$ \\
-     /tmp/n.mod\$\$ \\
      /tmp/n.news\$\$ \\
      /tmp/n.comp\$\$ \\
      /tmp/n.sci\$\$ \\
--- 146,151 ----
***************
*** 160,189 ****
      /tmp/n.misc\$\$ \\
      /tmp/n.talk\$\$ \\
      /tmp/n.net\$\$ \\
-     /tmp/n.fa\$\$ \\
      /tmp/n.test\$\$ \\
  | $uniq >\$dotdir/.newsrc
  
! $rm -f	/tmp/n.to\$\$ \\
! 	/tmp/n.tmp\$\$ \\
! 	/tmp/n.local\$\$ \\
! 	/tmp/n.\$locorg\$\$ \\
! 	/tmp/n.\$organization\$\$ \\
! 	/tmp/n.\$city\$\$ \\
! 	/tmp/n.\$state\$\$ \\
! 	/tmp/n.\$cntry\$\$ \\
! 	/tmp/n.\$cont\$\$ \\
! 	/tmp/n.mod\$\$ \\
! 	/tmp/n.news\$\$ \\
! 	/tmp/n.comp\$\$ \\
! 	/tmp/n.sci\$\$ \\
! 	/tmp/n.soc\$\$ \\
! 	/tmp/n.rec\$\$ \\
! 	/tmp/n.talk\$\$ \\
! 	/tmp/n.net\$\$ \\
! 	/tmp/n.fa\$\$ \\
! 	/tmp/n.misc\$\$ \\
! 	/tmp/n.test\$\$
  
  $cat <<'EOH'
  Done.
--- 154,163 ----
      /tmp/n.misc\$\$ \\
      /tmp/n.talk\$\$ \\
      /tmp/n.net\$\$ \\
      /tmp/n.test\$\$ \\
  | $uniq >\$dotdir/.newsrc
  
! $rm -f	/tmp/n.*\$\$
  
  $cat <<'EOH'
  Done.
*** /tmp/,RCSt1009472	Tue Sep 15 10:30:21 1987
--- term.c	Mon Sep 14 23:06:21 1987
***************
*** 1,6 ****
! /* $Header: term.c,v 1.1 87/08/26 20:34:55 hyc Exp $
   *
   * $Log:	term.c,v $
   * Revision 1.1  87/08/26  20:34:55  hyc
   * Initial revision
   * 
--- 1,14 ----
! /* $Header: term.c,v 1.3 87/09/14 23:05:40 hyc Exp $
   *
   * $Log:	term.c,v $
+  * Revision 1.3  87/09/14  23:05:40  hyc
+  * OOps. forgot to set initlines as well upon SIGWINCH...
+  * 
+  * Revision 1.2  87/08/27  00:21:36  hyc
+  * Added support for SIGWINCH to dynamically change screen size, as well
+  * as for setting screen size by ioctl of /dev/tty instead of just using
+  * the TERMCAP entry...
+  * 
   * Revision 1.1  87/08/26  20:34:55  hyc
   * Initial revision
   * 
***************
*** 67,73 ****
--- 75,98 ----
  
  /* terminal initialization */
  
+ #ifdef SIGWINCH
  void
+ winch_catcher(code)
+     int code;
+ {
+     int fd;
+     struct winsize winstruct;
+     fd = open("/dev/tty",0);
+     ioctl(fd,TIOCGWINSZ,&winstruct);
+     close(fd);
+     LINES = winstruct.ws_row;
+     initlines=LINES;
+     COLS = winstruct.ws_col;
+ }
+ #endif
+ 
+     
+ void
  term_init()
  {
      savetty();				/* remember current tty state */
***************
*** 82,87 ****
--- 107,116 ----
      KILLCH = _tty.sg_kill;		/* for finish_command() */
  #endif
  
+ #ifdef SIGWINCH
+     sigset(SIGWINCH, winch_catcher);	/* setup handler for window size changes */
+ #endif
+ 
      /* The following could be a table but I can't be sure that there isn't */
      /* some degree of sparsity out there in the world. */
  
***************
*** 123,128 ****
--- 152,161 ----
      char *tgetstr();
      char *s;
      int status;
+ #ifdef TIOCGWINSZ
+     struct winsize winstruct;		/* Use this for screen size if available */
+     int fd;
+ #endif
  
  #ifdef PENDING
  #ifndef FIONREAD
***************
*** 190,197 ****
  	UE = SE;
  	UG = SG;
      }
!     LINES = tgetnum("li");		/* lines per page */
!     COLS = tgetnum("co");		/* columns on page */
      AM = tgetflag("am");		/* terminal wraps automatically? */
      XN = tgetflag("xn");		/* then eats next newline? */
      VB = Tgetstr("vb");
--- 223,242 ----
  	UE = SE;
  	UG = SG;
      }
! #ifdef TIOCGWINSZ
!     fd = open("/dev/tty",0);
!     ioctl(fd,TIOCGWINSZ,&winstruct);
!     close(fd);
!     if (winstruct.ws_col) {
! 	LINES = winstruct.ws_row;
! 	COLS = winstruct.ws_col;
!     }
!     else
! #endif
!     {
! 	LINES = tgetnum("li");		/* lines per page */
! 	COLS = tgetnum("co");		/* columns on page */
!     }
      AM = tgetflag("am");		/* terminal wraps automatically? */
      XN = tgetflag("xn");		/* then eats next newline? */
      VB = Tgetstr("vb");
-- 
  -- Howard Chu
	"Of *course* it's portable. It's written in C, isn't it?"