diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/acconfig.h nmh-1.0+athena9.4.34/acconfig.h
--- nmh-1.0/acconfig.h	1999-01-23 21:27:41.000000002 -0500
+++ nmh-1.0+athena9.4.34/acconfig.h	1999-04-15 20:23:48.000000002 -0400
@@ -9,6 +9,9 @@
  * wish to change the features that are compiled into nmh.
  */
 
+/* Athena note: changes to the "user configuration" section will
+   require changes to configure.athena. */
+
 /*
  *  Solaris 2.x
  *  Irix
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/config/config.c nmh-1.0+athena9.4.34/config/config.c
--- nmh-1.0/config/config.c	1998-12-08 18:49:59.000000002 -0500
+++ nmh-1.0+athena9.4.34/config/config.c	1999-06-07 11:55:26.000000002 -0400
@@ -265,7 +265,7 @@
  * deliver mail to users.  This is the interface to the MTS.
  */
 
-char *postproc = nmhlibdir (/post);
+char *postproc = nmhlibdir (/spost);
 
 /*
  * This is program is called by slocal to handle
@@ -308,7 +308,7 @@
  * that such message not be filtered in any way.
  */
 
-char *showproc = nmhlibdir (/mhl);
+char *showproc = DEFAULT_PAGER;
 
 /* 
  * This program is called by vmh as the back-end to the window management
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/config.h.in nmh-1.0+athena9.4.34/config.h.in
--- nmh-1.0/config.h.in	1999-01-23 21:27:49.000000002 -0500
+++ nmh-1.0+athena9.4.34/config.h.in	1999-11-12 15:42:56.000000002 -0500
@@ -104,7 +104,7 @@
  * to local addresses.  You must also define DUMB.  You probably
  * dont' need this unless you are behind a firewall.
  */
-/* #define REALLYDUMB  1 */
+#define REALLYDUMB  1
 
 /*
  * Directs inc/slocal to extract the envelope sender from "From "
@@ -142,7 +142,7 @@
  * are using KPOP, you will probably need to change this
  * to "kpop".
  */
-#define POPSERVICE "pop3"
+#define POPSERVICE "kpop"
 
 /*
  * Define the default creation modes for folders and messages.
@@ -154,7 +154,7 @@
  * The prefix which is prepended to the name of messages when they
  * are "removed" by rmm.  This should typically be `,' or `#'
  */
-#define BACKUP_PREFIX ","
+#define BACKUP_PREFIX ".#"
 
 /*
  * Name of link to file to which you are replying.
@@ -421,6 +421,12 @@
 /* Define if you have the <unistd.h> header file.  */
 #undef HAVE_UNISTD_H
 
+/* Define if you have the <db.h> header file. */
+#undef HAVE_DB_H
+
+/* Define if you have the <ndbm.h> header file. */
+#undef HAVE_NDBM_H
+
 /* Define if you have the ndbm library (-lndbm).  */
 #undef HAVE_LIBNDBM
 
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/configure.athena nmh-1.0+athena9.4.34/configure.athena
--- nmh-1.0/configure.athena	1969-12-31 19:00:00.000000000 -0500
+++ nmh-1.0+athena9.4.34/configure.athena	2003-03-22 20:16:04.000000002 -0500
@@ -0,0 +1,27 @@
+# $Id: configure.athena,v 1.7 2003-03-23 01:16:04 ghudson Exp $
+
+./configure --enable-nmh-pop --enable-nmh-debug \
+	--with-krb4=/usr/athena \
+	--with-hesiod=/usr/athena \
+	--with-mts=sendmail --with-editor=emacs
+
+# nmh requires that one edit the config.h by hand.  argh.  so do that
+# here.
+
+rm -f configtmp
+cp config.h configtmp
+
+case $ATHENA_HOSTTYPE in
+"sun4" | "sgi")
+	sed -e 's/\/\*.*SYS5.*/#define SYS5	1/' \
+	    -e 's/\/\*.*SVR4.*/#define SVR4	1/' \
+	    < configtmp > config.h
+	;;
+"linux")
+	sed -e 's/\/\*.*LINUX_STDIO.*/#define LINUX_STDIO	1/' \
+	    < configtmp > config.h
+	;;
+esac
+
+rm -f configtmp
+	
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/configure.in nmh-1.0+athena9.4.34/configure.in
--- nmh-1.0/configure.in	1998-08-27 00:59:39.000000002 -0400
+++ nmh-1.0+athena9.4.34/configure.in	2003-03-22 20:16:24.000000002 -0500
@@ -228,7 +228,7 @@
 AC_CHECK_HEADERS(string.h memory.h stdlib.h unistd.h errno.h fcntl.h \
                  limits.h crypt.h termcap.h termio.h termios.h locale.h \
                  sys/param.h sys/time.h sys/utsname.h arpa/inet.h \
-                 arpa/ftp.h)
+                 arpa/ftp.h ndbm.h db.h)
 
 AC_CACHE_CHECK(POSIX termios, nmh_cv_sys_posix_termios,
 [AC_TRY_LINK([#include <sys/types.h>
@@ -297,7 +297,8 @@
 dnl Checks for ndbm
 AC_CHECK_FUNC(dbm_open, ,
   AC_CHECK_LIB(ndbm, dbm_open, ,
-    AC_CHECK_LIB(dbm, dbm_open)))
+    AC_CHECK_LIB(dbm, dbm_open, ,
+      AC_CHECK_LIB(db, __db_ndbm_open))))
 
 dnl ----------------
 dnl CHECK FOR HESIOD
@@ -329,12 +330,12 @@
     KRB4_INCLUDES="-I/usr/include/kerberosIV"
   fi
   AC_CHECK_LIB(krb4, krb_rd_req,
-    [KRB4_LIBS="$KRB4_LIBS -lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err"],
+    [KRB4_LIBS="$KRB4_LIBS -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"],
     [AC_CHECK_LIB(krb, krb_rd_req,
       [KRB4_LIBS="-lkrb -ldes"],
       [AC_MSG_ERROR(Kerberos 4 libraries not found)],
       $KRB4_LIBS -ldes)],
-    $KRB4_LIBS -ldes425 -lkrb5 -lcrypto -lcom_err)
+    $KRB4_LIBS -ldes425 -lkrb5 -lk5crypto -lcom_err)
 fi
 AC_SUBST(KRB4_INCLUDES)dnl
 AC_SUBST(KRB4_LIBS)dnl
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/etc/Makefile.in nmh-1.0+athena9.4.34/etc/Makefile.in
--- nmh-1.0/etc/Makefile.in	1998-10-02 23:38:38.000000002 -0400
+++ nmh-1.0+athena9.4.34/etc/Makefile.in	1999-06-01 20:20:47.000000002 -0400
@@ -38,10 +38,11 @@
 DIST_FILES = mhl.body mhl.digest mhl.format mhl.forward mhl.headers \
              mhl.reply scan.default scan.mailx scan.nomime scan.size scan.time \
              scan.timely scan.unseen components digestcomps distcomps \
-             forwcomps rcvdistcomps replcomps replgroupcomps MailAliases
+             forwcomps rcvdistcomps replcomps replgroupcomps MailAliases \
+             mhn.defaults
 
 # format and configuration files to generate
-GEN_FILES = mhn.defaults mts.conf
+GEN_FILES = mts.conf
 
 # data files we need to install
 FILES = $(DIST_FILES) $(GEN_FILES)
@@ -59,10 +60,6 @@
 
 all: $(GEN_FILES)
 
-mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG)
-	rm -f $@
-	$(srcdir)/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@
-
 mts.conf: $(srcdir)/mts.conf.in
 	rm -f $@
 	$(SED) -e 's,%mailspool%,$(mailspool),' \
@@ -71,36 +68,30 @@
 install: install-files install-scripts
 
 install-files:
-	$(top_srcdir)/mkinstalldirs $(etcdir)
+	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(etcdir)
 	for file in $(DIST_FILES); do \
-	  if [ -f $(etcdir)/$$file ]; then \
-	    mv $(etcdir)/$$file $(etcdir)/$$file.old; \
-	  fi; \
-	  $(INSTALL_DATA) $(srcdir)/$$file $(etcdir)/$$file; \
+	  $(INSTALL_DATA) $(srcdir)/$$file $(DESTDIR)$(etcdir)/$$file; \
 	done
 	for file in $(GEN_FILES); do \
-	  if [ -f $(etcdir)/$$file ]; then \
-	    mv $(etcdir)/$$file $(etcdir)/$$file.old; \
-	  fi; \
-	  $(INSTALL_DATA) $$file $(etcdir)/$$file; \
+	  $(INSTALL_DATA) $$file $(DESTDIR)$(etcdir)/$$file; \
 	done
 
 install-scripts:
-	$(top_srcdir)/mkinstalldirs $(libdir)
+	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(libdir)
 	for script in $(SCRIPTS); do \
-	  $(INSTALL_PROGRAM) $(srcdir)/$$script $(libdir)/$$script; \
+	  $(INSTALL_PROGRAM) $(srcdir)/$$script $(DESTDIR)$(libdir)/$$script; \
 	done
 
 uninstall: uninstall-files uninstall-scripts
 
 uninstall-files:
 	for file in $(FILES); do \
-	  rm -f $(etcdir)/$$file; \
+	  rm -f $(DESTDIR)$(etcdir)/$$file; \
 	done
 
 uninstall-scripts:
 	for script in $(SCRIPTS); do \
-	  rm -f $(libdir)/$$script; \
+	  rm -f $(DESTDIR)$(libdir)/$$script; \
 	done
 
 # ========== DEPENDENCIES FOR CLEANUP ==========
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/etc/mhl.digest nmh-1.0+athena9.4.34/etc/mhl.digest
--- nmh-1.0/etc/mhl.digest	1993-11-30 23:01:31.000000002 -0500
+++ nmh-1.0+athena9.4.34/etc/mhl.digest	1999-05-05 12:59:02.000000002 -0400
@@ -1,7 +1,6 @@
-width=80,overflowoffset=10
-leftadjust,compress,compwidth=9
+width=0,leftadjust
 Date:formatfield="%<(nodate{text})%{text}%|%(tws{text})%>"
 From:
 Subject:
 :
-body:nocomponent,overflowoffset=0,noleftadjust,nocompress
+body:nocomponent,noleftadjust
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/etc/mhl.format nmh-1.0+athena9.4.34/etc/mhl.format
--- nmh-1.0/etc/mhl.format	1998-02-09 19:22:23.000000002 -0500
+++ nmh-1.0+athena9.4.34/etc/mhl.format	1999-05-05 12:59:03.000000002 -0400
@@ -3,9 +3,8 @@
 ; default message filter for `show'
 ;
 :
-overflowtext="***",overflowoffset=5
-leftadjust,compwidth=9
-ignores=msgid,message-id,received,content-type,content-transfer-encoding,content-id
+width=0,leftadjust
+ignores=msgid,message-id,received,content-transfer-encoding,content-id
 Date:formatfield="%<(nodate{text})%{text}%|%(pretty{text})%>"
 To:
 cc:
@@ -14,4 +13,4 @@
 :
 extras:nocomponent
 :
-body:nocomponent,overflowtext=,overflowoffset=0,noleftadjust
+body:nocomponent,noleftadjust
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/etc/mhl.forward nmh-1.0+athena9.4.34/etc/mhl.forward
--- nmh-1.0/etc/mhl.forward	1997-12-30 17:40:58.000000002 -0500
+++ nmh-1.0+athena9.4.34/etc/mhl.forward	1999-05-05 12:59:04.000000002 -0400
@@ -2,12 +2,11 @@
 ;
 ; default message filter for `forw' (forw -format)
 ;
-width=80,overflowtext=,overflowoffset=10
-leftadjust,compress,compwidth=9
+width=0,leftadjust
 Date:formatfield="%<(nodate{text})%{text}%|%(tws{text})%>"
 From:
 To:
 cc:
 Subject:
 :
-body:nocomponent,overflowoffset=0,noleftadjust,nocompress
+body:nocomponent,noleftadjust
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/etc/mhl.headers nmh-1.0+athena9.4.34/etc/mhl.headers
--- nmh-1.0/etc/mhl.headers	1998-02-02 00:59:38.000000002 -0500
+++ nmh-1.0+athena9.4.34/etc/mhl.headers	1999-05-05 12:59:04.000000002 -0400
@@ -4,9 +4,8 @@
 ; MIME messages.  mhn calls the mhlproc with this
 ; filter to display message header.
 ;
-overflowtext="***",overflowoffset=5
-leftadjust,compwidth=9
-ignores=msgid,message-id,received,content-type,content-transfer-encoding,content-id
+width=0,leftadjust
+ignores=msgid,message-id,received,content-transfer-encoding,content-id
 Date:formatfield="%<(nodate{text})%{text}%|%(pretty{text})%>"
 To:
 cc:
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/etc/mhn.defaults nmh-1.0+athena9.4.34/etc/mhn.defaults
--- nmh-1.0/etc/mhn.defaults	1969-12-31 19:00:00.000000000 -0500
+++ nmh-1.0+athena9.4.34/etc/mhn.defaults	2006-10-04 11:02:33.000000002 -0400
@@ -0,0 +1,40 @@
+mhshow-show-text/plain: %ecat '%f'
+mhshow-show-text: %e/usr/athena/libexec/show-text '%s' '%f'
+mhstore-store-text/html: %m%P.%s
+mhstore-store-text/richtext: %m%P.rt
+mhstore-store-text: %m%P.txt
+mhshow-show-image: %l/usr/athena/libexec/show-image '%s' '%F'
+mhstore-store-image/x-sgi-image: %m%P.sgi
+mhshow-show-video: %l/usr/athena/libexec/show-video '%s' '%F'
+mhstore-store-video/mpeg: %m%P.mpg
+mhshow-show-audio: %l/usr/athena/libexec/show-audio '%s' '%F'
+mhstore-store-audio/x-aifc: %m%P.aifc
+mhstore-store-audio/x-aiff: %m%P.aiff
+mhstore-store-audio/x-next: %m%P.nexta
+mhstore-store-audio/x-wav: %m%P.wav
+mhstore-store-audio/x-mpeg: %m%P.mpeg
+mhstore-store-audio/basic: %m%P.raw
+mhshow-show-application/msword: %l%e/usr/athena/libexec/show-msword '%f'
+mhshow-show-application/x-msword: %l%e/usr/athena/libexec/show-msword '%f'
+mhstore-store-application/x-msword: %m%P.doc
+mhstore-store-application/msword: %m%P.doc
+mhshow-show-application/postscript: %l/usr/athena/libexec/show-postscript '%f'
+mhstore-store-application/postscript: %m%P.ps
+mhshow-show-application/pdf: %l/usr/athena/libexec/show-pdf '%f'
+mhshow-show-application/mac-binhex40: %l/usr/athena/libexec/show-binhex '%f'
+mhstore-store-application/mac-binhex40: | /usr/athena/libexec/store-binhex %m%P
+mhshow-show-application: %l/usr/athena/libexec/show-application '%s' '%F' '%a'
+mhstore-store-application/x-framemaker: %m%P.doc
+mhstore-store-application/x-ez: %m%P.ez
+mhstore-store-application/x-dvi: %m%P.dvi
+mhshow-show-application/excel: %l%e/usr/athena/libexec/show-excel '%f'
+mhshow-show-application/x-excel: %l%e/usr/athena/libexec/show-excel '%f'
+mhshow-show-application/msexcel: %l%e/usr/athena/libexec/show-excel '%f'
+mhshow-show-application/x-msexcel: %l%e/usr/athena/libexec/show-excel '%f'
+mhshow-show-application/vnd.ms-excel: %l%e/usr/athena/libexec/show-excel '%f'
+mhstore-store-application/excel: %m%P.xls
+mhstore-store-application/x-excel: %m%P.xls
+mhstore-store-application/msexcel: %m%P.xls
+mhstore-store-application/x-msexcel: %m%P.xls
+mhstore-store-application/vnd.ms-excel: %m%P.xls
+mhshow-show-message/delivery-status: %ecat '%f'
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/etc/replcomps nmh-1.0+athena9.4.34/etc/replcomps
--- nmh-1.0/etc/replcomps	1998-01-03 18:05:36.000000002 -0500
+++ nmh-1.0+athena9.4.34/etc/replcomps	1999-05-19 10:17:35.000000002 -0400
@@ -13,6 +13,8 @@
 %;
 %(lit)%(formataddr %<{mail-reply-to}%?{reply-to}%?{from}%?{sender}%?{return-path}%>)\
 %<(nonnull)%(void(width))%(putaddr To: )\n%>\
+%(lit)%(formataddr{to})%(formataddr{cc})%(formataddr(me))\
+%<(nonnull)%(void(width))%(putaddr cc: )\n%>\
 %<{fcc}Fcc: %{fcc}\n%>\
 %<{subject}Subject: Re: %{subject}\n%>\
 %<{date}In-Reply-To: Your message of "\
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/Makefile.in nmh-1.0+athena9.4.34/Makefile.in
--- nmh-1.0/Makefile.in	1998-05-16 23:06:08.000000002 -0400
+++ nmh-1.0+athena9.4.34/Makefile.in	1999-12-01 11:31:01.000000002 -0500
@@ -26,10 +26,10 @@
 bindir      = @bindir@
 
 # location of support binaries and scripts
-libdir      = @libdir@
+libdir      = @libexecdir@
 
 # location of nmh configuration and formats files
-etcdir      = @sysconfdir@
+etcdir      = /usr/athena/etc
 
 # location of man pages
 mandir      = @mandir@
@@ -57,7 +57,7 @@
 
 # flags passed to recursive makes in subdirectories
 MAKEDEFS = CC='$(CC)' CPPFLAGS='$(CPPFLAGS)' DEFS='$(DEFS)' \
-CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' LIBS='$(LIBS)' \
+CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' LIBS='$(LIBS)' DESTDIR='$(DESTDIR)' \
 prefix='$(prefix)' exec_prefix='$(exec_prefix)' bindir='$(bindir)' \
 etcdir='$(etcdir)' libdir='$(libdir)' mandir='$(mandir)' \
 mailspool='$(mailspool)' sendmailpath='$(sendmailpath)' \
@@ -128,18 +128,10 @@
 config.status: configure VERSION
 	./config.status --recheck
 
-configure: configure.in aclocal.m4
-	cd $(srcdir) && autoconf
-
 config.h: stamp-h
 stamp-h: config.h.in config.status
 	CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
 
-config.h.in: stamp-h.in
-stamp-h.in: configure.in acconfig.h aclocal.m4
-	cd $(srcdir) && autoheader
-	echo > $@
-
 # rebuild all autoconf files
 reset:
 	cd $(srcdir) && autoheader
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/man/Makefile.in nmh-1.0+athena9.4.34/man/Makefile.in
--- nmh-1.0/man/Makefile.in	1998-08-01 15:23:45.000000002 -0400
+++ nmh-1.0+athena9.4.34/man/Makefile.in	1999-02-12 19:41:06.000000002 -0500
@@ -129,28 +129,28 @@
 
 # install the include file for man pages
 install-hdr:
-	$(top_srcdir)/mkinstalldirs $(etcdir)
-	$(INSTALL_DATA) tmac.h $(etcdir)/tmac.h
+	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(etcdir)
+	$(INSTALL_DATA) tmac.h $(DESTDIR)$(etcdir)/tmac.h
 
 # install the man pages in man1
 install-man1:
-	$(top_srcdir)/mkinstalldirs $(mandir)/man$(manext1)
+	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext1)
 	for file in $(MAN1); do \
-	  $(INSTALL_DATA) $$file $(mandir)/man$(manext1) ; \
+	  $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext1) ; \
 	done
 
 # install the man pages in man5
 install-man5:
-	$(top_srcdir)/mkinstalldirs $(mandir)/man$(manext5)
+	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext5)
 	for file in $(MAN5); do \
-	  $(INSTALL_DATA) $$file $(mandir)/man$(manext5) ; \
+	  $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext5) ; \
 	done
 
 # install the man pages in man8
 install-man8:
-	$(top_srcdir)/mkinstalldirs $(mandir)/man$(manext8)
+	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext8)
 	for file in $(MAN8); do \
-	  $(INSTALL_DATA) $$file $(mandir)/man$(manext8) ; \
+	  $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext8) ; \
 	done
 
 # ========= UNINSTALL TARGETS =========
@@ -159,24 +159,24 @@
 
 # uninstall the include file for man pages
 uninstall-hdr:
-	rm -f $(etcdir)/tmac.h
+	rm -f $(DESTDIR)$(etcdir)/tmac.h
 
 # uninstall the man pages in man1
 uninstall-man1:
 	for file in $(MAN1); do \
-	  rm -f $(mandir)/man$(manext1)/$$file; \
+	  rm -f $(DESTDIR)$(mandir)/man$(manext1)/$$file; \
 	done
 
 # uninstall the man pages in man5
 uninstall-man5:
 	for file in $(MAN5); do \
-	  rm -f $(mandir)/man$(manext5)/$$file; \
+	  rm -f $(DESTDIR)$(mandir)/man$(manext5)/$$file; \
 	done
 
 # uninstall the man pages in man8
 uninstall-man8:
 	for file in $(MAN8); do \
-	  rm -f $(mandir)/man$(manext8)/$$file; \
+	  rm -f $(DESTDIR)$(mandir)/man$(manext8)/$$file; \
 	done
 
 # ========== DEPENDENCIES FOR CLEANUP ==========
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/man/repl.man nmh-1.0+athena9.4.34/man/repl.man
--- nmh-1.0/man/repl.man	1999-01-14 15:42:16.000000002 -0500
+++ nmh-1.0+athena9.4.34/man/repl.man	2000-05-08 13:37:31.000000002 -0400
@@ -80,7 +80,8 @@
 standard forms file \*(lqreplgroupcomps\*(rq.  This will construct a
 draft message that is intended as a group or followup reply.  If a file
 named \*(lqreplgroupcomps\*(rq exists in the user's nmh directory, it
-will be used instead of this default forms file.
+will be used instead of this default forms file.  `\-group' also implies
+`\-cc all'.
 
 The default group reply template \*(lqreplgroupcomps\*(rq will direct
 \fIrepl\fR to construct the reply message draft as follows:
@@ -122,7 +123,8 @@
 the \*(lqTo:\*(rq and \*(lqcc:\*(rq list should actually be sent a copy.
 This is useful for special\-purpose replies.  Note that the position of
 the `\-cc' and `\-nocc' switches, like all other switches which take a
-positive and negative form, is important.
+positive and negative form, is important.  A `\-cc' switch implies
+`\-group'.
 
 Lines beginning with the fields \*(lqTo:\*(rq, \*(lqcc:\*(rq, and
 \*(rqBcc:\*(rq will be standardized and have duplicate addresses removed.
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/man/show.man nmh-1.0+athena9.4.34/man/show.man
--- nmh-1.0/man/show.man	1999-01-17 16:19:57.000000002 -0500
+++ nmh-1.0+athena9.4.34/man/show.man	1999-06-07 11:57:24.000000002 -0400
@@ -30,7 +30,9 @@
 \fIShow\fR lists each of the specified messages to the standard output
 (typically, the terminal).
 
-By default, text (non-MIME) messages are filtered and displayed by
+By default on Athena, text (non-MIME) messages are piped to
+\fImore\fR(1). In the default nmh configuration, text messages are
+filtered and displayed by
 the \fInmh\fR command \fImhl\fR.  This command will display text
 messages in a nice, uniform format.  It also allows you to configure
 the format of the displayed messages and which headers fields are
@@ -39,8 +41,8 @@
 profile component.  Any switches not recognized by \fIshow\fR are
 passed along to that program.  To override the default and the
 \fIshowproc\fR profile component, use the `\-showproc\ program'
-switch.  For example, `\-showproc\ more' will cause the \fImore\fR(1)
-program to list the messages with no reformatting.  Normally, this
+switch.  For example, `\-showproc\ mhl will cause the \fImhl\fR
+program to list the messages nicely formatted.  Normally, this
 program is specified as the \fIshowproc\fR in the user's
 \&.mh\(ruprofile, rather than using a command line switch.
 
@@ -68,7 +70,9 @@
 \fIshowmimeproc\fR, else they are displayed by the program
 \fIshowproc\fR.  The option `-nocheckmime' disables this test and
 instructs \fIshow\fR to use \fIshowproc\fR, regardless of whether
-any of the messages are non-text (MIME) messages.
+any of the messages are non-text (MIME) messages. `\-nocheckmime' is
+the default when showing multiple messages in a single invocation, to
+prevent formatting problems.
 
 The `\-noshowproc' switch will disable any formatting or paging of
 messages.  It is equivalent to `-nocheckmime\ -showproc\ cat'.  It
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/mts/Makefile.in nmh-1.0+athena9.4.34/mts/Makefile.in
--- nmh-1.0/mts/Makefile.in	1998-05-08 16:42:57.000000002 -0400
+++ nmh-1.0+athena9.4.34/mts/Makefile.in	1999-02-12 19:41:08.000000002 -0500
@@ -11,7 +11,7 @@
 
 # flags passed to recursive makes in subdirectories
 MAKEDEFS = CC='$(CC)' CPPFLAGS='$(CPPFLAGS)' DEFS='$(DEFS)' \
-CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' LIBS='$(LIBS)' \
+CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' LIBS='$(LIBS)' DESTDIR='$(DESTDIR)' \
 prefix='$(prefix)' exec_prefix='$(exec_prefix)' bindir='$(bindir)' \
 etcdir='$(etcdir)' libdir='$(libdir)' mandir='$(mandir)' \
 mailspool='$(mailspool)' sendmailpath='$(sendmailpath)' \
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/mts/sendmail/Makefile.in nmh-1.0+athena9.4.34/mts/sendmail/Makefile.in
--- nmh-1.0/mts/sendmail/Makefile.in	1998-05-08 16:52:02.000000002 -0400
+++ nmh-1.0+athena9.4.34/mts/sendmail/Makefile.in	1999-02-23 12:00:27.000000002 -0500
@@ -25,7 +25,7 @@
 TSORT   = @TSORT@
 RANLIB  = @RANLIB@
 
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS)
+COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS)
 
 .SUFFIXES:
 .SUFFIXES: .c .o
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/mts/smtp/Makefile.in nmh-1.0+athena9.4.34/mts/smtp/Makefile.in
--- nmh-1.0/mts/smtp/Makefile.in	1998-05-08 16:51:35.000000002 -0400
+++ nmh-1.0+athena9.4.34/mts/smtp/Makefile.in	1999-02-23 12:00:42.000000002 -0500
@@ -25,7 +25,7 @@
 TSORT   = @TSORT@
 RANLIB  = @RANLIB@
 
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS)
+COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS)
 
 .SUFFIXES:
 .SUFFIXES: .c .o
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/sbr/error.c nmh-1.0+athena9.4.34/sbr/error.c
--- nmh-1.0/sbr/error.c	1998-07-09 16:26:57.000000002 -0400
+++ nmh-1.0+athena9.4.34/sbr/error.c	2003-03-20 12:19:30.000000002 -0500
@@ -12,7 +12,7 @@
 # include <sys/uio.h>
 #endif
 
-extern int errno;
+#include <errno.h>
 
 
 /*
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/sbr/fmt_scan.c nmh-1.0+athena9.4.34/sbr/fmt_scan.c
--- nmh-1.0/sbr/fmt_scan.c	1998-12-11 19:40:11.000000002 -0500
+++ nmh-1.0+athena9.4.34/sbr/fmt_scan.c	2000-05-08 13:38:01.000000002 -0400
@@ -729,7 +729,7 @@
 		*cp++ = c;
 	    while (len > wid) {
 		/* try to break at a comma; failing that, break at a
-		 * space, failing that, just split the line.
+		 * space, failing that, print the whole address
 		 */
 		lastb = 0; sp = lp + wid;
 		while (sp > lp && (c = *--sp) != ',') {
@@ -737,8 +737,19 @@
 			lastb = sp - 1;
 		}
 		if (sp == lp)
-		    if (! (sp = lastb))
+		    if (! (sp = lastb)) {	/* If no ',' or ' ', */
 			sp = lp + wid - 1;
+			while (c = *++sp) {	/* then search forward. */
+			    if (c == ',')
+				break;
+			    if (isspace(c)) {
+				--sp;
+				break;
+			    }
+			}
+			if (! *sp)	/* If we didn't find comma or space */
+			  break;	/* then PUTS the whole str now */
+		    }
 		len -= sp - lp + 1;
 		while (cp < ep && lp <= sp)
 		    *cp++ = *lp++;
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/sbr/Makefile.in nmh-1.0+athena9.4.34/sbr/Makefile.in
--- nmh-1.0/sbr/Makefile.in	1998-12-10 15:36:49.000000002 -0500
+++ nmh-1.0+athena9.4.34/sbr/Makefile.in	1999-02-23 12:00:43.000000002 -0500
@@ -22,7 +22,7 @@
 
 LIBOBJS = @LIBOBJS@
 
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS)
+COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS)
 
 .SUFFIXES:
 .SUFFIXES: .c .o
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/sbr/m_getfld.c nmh-1.0+athena9.4.34/sbr/m_getfld.c
--- nmh-1.0/sbr/m_getfld.c	1998-07-31 18:48:37.000000002 -0400
+++ nmh-1.0+athena9.4.34/sbr/m_getfld.c	2000-09-21 15:14:15.000000002 -0400
@@ -259,7 +259,7 @@
 		bp = sp = (unsigned char *) iob->_ptr - 1;
 		j = (cnt = iob->_cnt+1) < i ? cnt : i;
 #endif
-		while ((c = *bp++) != ':' && c != '\n' && --j >= 0)
+		while (--j >= 0 && (c = *bp++) != ':' && c != '\n')
 		    *cp++ = c;
 
 		j = bp - sp;
@@ -390,7 +390,8 @@
 		*cp++ = j = *(iob->_ptr + c);
 		c = _filbuf(iob);
 #endif
-		if ((j == '\0' || j == '\n') && c != ' ' && c != '\t') {
+                if (c == EOF || 
+		  ((j == '\0' || j == '\n') && c != ' ' && c != '\t')) {
 		    if (c != EOF) {
 #ifdef LINUX_STDIO
 			--iob->_IO_read_ptr;
@@ -538,7 +539,7 @@
 	    ;
 #else /* RPATHS */
 	cp = unixbuf;
-	while ((c = getc (iob)) != '\n')
+	while ((c = getc (iob)) != '\n' && cp - unixbuf < BUFSIZ - 1)
 	    *cp++ = c;
 	*cp = 0;
 #endif /* RPATHS */
@@ -571,7 +572,7 @@
     pat_map = (unsigned char **) calloc (256, sizeof(unsigned char *));
 
     for (cp = (char *) fdelim + 1; cp < (char *) delimend; cp++ )
-	pat_map[*cp] = (unsigned char *) cp;
+	pat_map[(unsigned char)*cp] = (unsigned char *) cp;
 
     if (msg_style == MS_MMDF) {
 	/* flush extra msg hdrs */
@@ -639,7 +640,7 @@
 		break;
 #else /* RPATHS */
 	cp = unixbuf;
-	while ((c = getc (iob)) != '\n' && c >= 0)
+	while ((c = getc (iob)) != '\n' && c >= 0 && cp - unixbuf < BUFSIZ - 1)
 	    *cp++ = c;
 	*cp = 0;
 #endif /* RPATHS */
@@ -723,7 +724,8 @@
 		while (pc != *str++)
 			if (str > es)
 				return 0;
-
+		if (str > es+1)
+			return 0;
 		sp = str; pp = pat;
 		while (pp < ep && *sp++ == *pp)
 			pp++;
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/sbr/pidwait.c nmh-1.0+athena9.4.34/sbr/pidwait.c
--- nmh-1.0/sbr/pidwait.c	1998-01-04 13:21:14.000000002 -0500
+++ nmh-1.0+athena9.4.34/sbr/pidwait.c	1999-05-11 14:10:58.000000002 -0400
@@ -18,6 +18,7 @@
 {
     pid_t pid;
     sigset_t set, oset;
+    SIGNAL_HANDLER istat, qstat;
 
 #ifdef WAITINT
     int status;
@@ -26,11 +27,9 @@
 #endif
 
     if (sigsok == -1) {
-	/* block a couple of signals */
-	sigemptyset (&set);
-	sigaddset (&set, SIGINT);
-	sigaddset (&set, SIGQUIT);
-	SIGPROCMASK (SIG_BLOCK, &set, &oset);
+	/* ignore a couple of signals */
+	istat = SIGNAL (SIGINT, SIG_IGN);
+	qstat = SIGNAL (SIGQUIT, SIG_IGN);
     }
 
 #ifdef HAVE_WAITPID
@@ -41,8 +40,9 @@
 #endif
 
     if (sigsok == -1) {
-	/* reset the signal mask */
-	SIGPROCMASK (SIG_SETMASK, &oset, &set);
+	/* reset the signal handlers */
+	SIGNAL (SIGINT, istat);
+	SIGNAL (SIGQUIT, qstat);
     }
 
 #ifdef WAITINT
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/uip/dropsbr.c nmh-1.0+athena9.4.34/uip/dropsbr.c
--- nmh-1.0/uip/dropsbr.c	1999-02-06 18:13:18.000000002 -0500
+++ nmh-1.0+athena9.4.34/uip/dropsbr.c	2000-01-06 23:43:57.000000002 -0500
@@ -479,8 +479,7 @@
 int
 mbx_close (char *mailbox, int md)
 {
-    lkclose (md, mailbox);
-    return OK;
+    return (lkclose (md, mailbox) == 0 ? OK : NOTOK);
 }
 
 
@@ -645,7 +644,8 @@
 	return NOTOK;
     }
 
-    mbx_close (file, fd);
+    if (mbx_close (file, fd) == NOTOK)
+	return NOTOK;
 
     return OK;
 }
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/uip/ftpsbr.c nmh-1.0+athena9.4.34/uip/ftpsbr.c
--- nmh-1.0/uip/ftpsbr.c	1998-09-09 16:58:04.000000002 -0400
+++ nmh-1.0+athena9.4.34/uip/ftpsbr.c	2003-03-20 12:19:30.000000002 -0500
@@ -35,7 +35,7 @@
 #define	inaddr_copy(hp,sin) \
     memcpy((char *) &((sin)->sin_addr), (hp)->h_addr, (hp)->h_length)
 
-extern int errno;
+#include <errno.h>
 
 #define	start_tcp_client(sock,priv) \
     	socket (AF_INET, SOCK_STREAM, 0)
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/uip/inc.c nmh-1.0+athena9.4.34/uip/inc.c
--- nmh-1.0/uip/inc.c	1998-08-26 14:17:29.000000002 -0400
+++ nmh-1.0+athena9.4.34/uip/inc.c	2000-01-06 23:43:58.000000002 -0500
@@ -376,7 +376,7 @@
     /*
      * Where are we getting the new mail?
      */
-    if (from)
+    if (from || getenv("MAILDROP"))
 	inc_type = INC_FILE;
 #ifdef POP
     else if (host)
@@ -672,9 +672,13 @@
 	if (pop_quit () == NOTOK)
 	    adios (NULL, "%s", response);
 	if (packfile) {
-	    mbx_close (packfile, pd);
+	    if (mbx_close (packfile, pd) == NOTOK)
+		adios (packfile, "error writing to file");
 	    pd = NOTOK;
 	}
+
+	if (p < 0)
+	    adios (NULL, "failed");
     }
 #endif /* POP */
 
@@ -752,29 +756,25 @@
 	    }
 	    break;
 	}
-    }
 
-#ifdef POP
-    if (p < 0) {		/* error */
-#else
-    if (i < 0) {		/* error */
-#endif
-	if (locked) {
+	if (i < 0) {		/* error */
+	    if (locked) {
 #ifdef MAILGROUP
-	    /* Be sure we can unlock mail file */
-	    setgid(return_gid);
+		/* Be sure we can unlock mail file */
+		setgid(return_gid);
 #endif /* MAILGROUP */
 
-	    lkfclose (in, newmail);
+		lkfclose (in, newmail);
 
 #ifdef MAILGROUP
-	    /* And then return us to normal privileges */
-	    setgid(getgid());
+		/* And then return us to normal privileges */
+		setgid(getgid());
 #endif /* MAILGROUP */
-	} else {
-	    fclose (in);
+	    } else {
+		fclose (in);
+	    }
+	    adios (NULL, "failed");
 	}
-	adios (NULL, "failed");
     }
 
     if (aud)
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/uip/Makefile.in nmh-1.0+athena9.4.34/uip/Makefile.in
--- nmh-1.0/uip/Makefile.in	1999-02-06 16:44:09.000000002 -0500
+++ nmh-1.0+athena9.4.34/uip/Makefile.in	1999-09-02 10:42:21.000000002 -0400
@@ -34,7 +34,7 @@
 LEXLIB  = @LEXLIB@
 POPLIB  = @POPLIB@
 
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS)
+COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS)
 LINK    = $(CC) $(LDFLAGS) -o $@
 LN = ln
 
@@ -242,38 +242,50 @@
 
 # install commands
 install-cmds:
-	$(top_srcdir)/mkinstalldirs $(bindir)
+	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir)
 	for cmd in $(CMDS); do \
-	  $(INSTALL_PROGRAM) $$cmd $(bindir)/$$cmd; \
+	  $(INSTALL_PROGRAM) $$cmd $(DESTDIR)$(bindir)/$$cmd; \
 	done
 
 # install links
 install-lcmds:
-	rm -f $(bindir)/flists
-	rm -f $(bindir)/folders
-	rm -f $(bindir)/prev
-	rm -f $(bindir)/next
-	$(LN) $(bindir)/flist  $(bindir)/flists
-	$(LN) $(bindir)/folder $(bindir)/folders
-	$(LN) $(bindir)/show   $(bindir)/prev
-	$(LN) $(bindir)/show   $(bindir)/next
+	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir)
+	$(top_srcdir)/mkinstalldirs $(DESTDIR)/usr/athena/etc
+	rm -f $(DESTDIR)$(bindir)/flists
+	rm -f $(DESTDIR)$(bindir)/folders
+	rm -f $(DESTDIR)$(bindir)/prev
+	rm -f $(DESTDIR)$(bindir)/next
+	$(LN) $(DESTDIR)$(bindir)/flist  $(DESTDIR)$(bindir)/flists
+	$(LN) $(DESTDIR)$(bindir)/folder $(DESTDIR)$(bindir)/folders
+	$(LN) $(DESTDIR)$(bindir)/show   $(DESTDIR)$(bindir)/prev
+	$(LN) $(DESTDIR)$(bindir)/show   $(DESTDIR)$(bindir)/next
+	rm -f $(DESTDIR)/usr/athena/etc/rcvdist
+	rm -f $(DESTDIR)/usr/athena/etc/rcvpack
+	rm -f $(DESTDIR)/usr/athena/etc/rcvstore
+	rm -f $(DESTDIR)/usr/athena/etc/rcvtty
+	rm -f $(DESTDIR)/usr/athena/etc/slocal
+	ln -s ../libexec/rcvdist $(DESTDIR)/usr/athena/etc/rcvdist
+	ln -s ../libexec/rcvpack $(DESTDIR)/usr/athena/etc/rcvpack
+	ln -s ../libexec/rcvstore $(DESTDIR)/usr/athena/etc/rcvstore
+	ln -s ../libexec/rcvtty $(DESTDIR)/usr/athena/etc/rcvtty
+	ln -s ../libexec/slocal $(DESTDIR)/usr/athena/etc/slocal
 
 # install misc support binaries
 install-misc:
-	$(top_srcdir)/mkinstalldirs $(libdir)
+	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(libdir)
 	for misc in $(MISC); do \
-	  $(INSTALL_PROGRAM) $$misc $(libdir)/$$misc; \
+	  $(INSTALL_PROGRAM) $$misc $(DESTDIR)$(libdir)/$$misc; \
 	done
 
 uninstall:
 	for cmd in $(CMDS); do \
-	  rm -f $(bindir)/$$cmd; \
+	  rm -f $(DESTDIR)$(bindir)/$$cmd; \
 	done
 	for lcmd in $(LCMDS); do \
-	  rm -f $(bindir)/$$lcmd; \
+	  rm -f $(DESTDIR)$(bindir)/$$lcmd; \
 	done
 	for misc in $(MISC); do \
-	  rm -f $(libdir)/$$misc; \
+	  rm -f $(DESTDIR)$(libdir)/$$misc; \
 	done
 
 # ========== DEPENDENCIES FOR CLEANUP ==========
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/uip/mhbuildsbr.c nmh-1.0+athena9.4.34/uip/mhbuildsbr.c
--- nmh-1.0/uip/mhbuildsbr.c	1998-10-15 00:05:02.000000002 -0400
+++ nmh-1.0+athena9.4.34/uip/mhbuildsbr.c	2002-05-17 17:32:05.000000002 -0400
@@ -1433,9 +1433,9 @@
     struct k2v *kv;
     CI ci = &ct->c_ctinfo;
 
-    if (ct->c_encoding != CE_7BIT) {
+    if ((ct->c_encoding != CE_7BIT) && (ct->c_encoding != CE_8BIT)) {
 	admonish (NULL,
-		  "\"%s/%s\" type in message %s should be encoded in 7bit",
+		  "\"%s/%s\" type in message %s should be encoded in 7bit or 8bit",
 		  ci->ci_type, ci->ci_subtype, ct->c_file);
 	return NOTOK;
     }
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/uip/mhlsbr.c nmh-1.0+athena9.4.34/uip/mhlsbr.c
--- nmh-1.0/uip/mhlsbr.c	1998-08-02 16:56:01.000000002 -0400
+++ nmh-1.0+athena9.4.34/uip/mhlsbr.c	1999-04-20 16:03:28.000000002 -0400
@@ -434,6 +434,7 @@
 		SIGNAL (SIGINT, SIG_IGN);
 		SIGNAL2 (SIGQUIT, quitser);
 	    }
+	    SIGNAL2 (SIGPIPE, pipeser);
 	    m_popen (moreproc);
 	    ontty = PITTY;
 	} else {
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/uip/mhparse.c nmh-1.0+athena9.4.34/uip/mhparse.c
--- nmh-1.0/uip/mhparse.c	1998-10-15 00:04:57.000000002 -0400
+++ nmh-1.0+athena9.4.34/uip/mhparse.c	2002-05-17 17:32:05.000000002 -0400
@@ -1194,9 +1194,9 @@
     struct k2v *kv;
     CI ci = &ct->c_ctinfo;
 
-    if (ct->c_encoding != CE_7BIT) {
+    if ((ct->c_encoding != CE_7BIT) && (ct->c_encoding != CE_8BIT)) {
 	admonish (NULL,
-		  "\"%s/%s\" type in message %s should be encoded in 7bit",
+		  "\"%s/%s\" type in message %s should be encoded in 7bit or 8bit",
 		  ci->ci_type, ci->ci_subtype, ct->c_file);
 	return NOTOK;
     }
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/uip/mhshowsbr.c nmh-1.0+athena9.4.34/uip/mhshowsbr.c
--- nmh-1.0/uip/mhshowsbr.c	1998-09-09 16:59:17.000000002 -0400
+++ nmh-1.0+athena9.4.34/uip/mhshowsbr.c	2000-01-04 16:47:01.000000002 -0500
@@ -44,7 +44,7 @@
 int nomore   = 0;
 char *formsw = NULL;
 
-pid_t xpid = 0;
+pid_t xpid = 0, m_pid = 0, intrpid = 0;
 
 static sigjmp_buf intrenv;
 
@@ -87,6 +87,9 @@
 static int show_partial (CT, int, int);
 static int show_external (CT, int, int);
 static RETSIGTYPE intrser (int);
+static RETSIGTYPE intrser2 (int);
+static void m_popen (char *);
+static void m_pclose (void);
 
 
 /*
@@ -138,6 +141,9 @@
 
     umask (ct->c_umask);
 
+    if (!nomore && isatty (fileno (stdout)))
+	m_popen (progsw ? progsw : moreproc);
+
     /*
      * If you have a format file, then display
      * the message headers.
@@ -165,6 +171,8 @@
     sigaddset (&set, SIGTERM);
     SIGPROCMASK (SIG_BLOCK, &set, &oset);
 
+    m_pclose ();
+
     while (wait (&status) != NOTOK) {
 #ifdef WAITINT
 	pidcheck (status);
@@ -198,18 +206,8 @@
     vec[vecp++] = "-form";
     vec[vecp++] = form;
     vec[vecp++] = "-nobody";
+    vec[vecp++] = "-nomoreproc";
     vec[vecp++] = ct->c_file;
-
-    /*
-     * If we've specified -(no)moreproc,
-     * then just pass that along.
-     */
-    if (nomore) {
-	vec[vecp++] = "-nomoreproc";
-    } else if (progsw) {
-	vec[vecp++] = "-moreproc";
-	vec[vecp++] = progsw;
-    }
     vec[vecp] = NULL;
 
     fflush (stdout);
@@ -325,9 +323,9 @@
 int
 show_content_aux (CT ct, int serial, int alternate, char *cp, char *cracked)
 {
-    int fd, len, buflen;
+    int fd, len, buflen, sawquote;
     int	xstdin, xlist, xpause, xtty;
-    char *bp, *file, buffer[BUFSIZ];
+    char *bp, *pp, *file, buffer[BUFSIZ];
     CI ci = &ct->c_ctinfo;
 
     if (!ct->c_ceopenfnx) {
@@ -355,12 +353,16 @@
 
     /* get buffer ready to go */
     bp = buffer;
-    bp[0] = '\0';
-    buflen = sizeof(buffer);
+    bp[0] = bp[sizeof(buffer) - 1] = '\0';
+    buflen = sizeof(buffer) - 1;
+
+    sawquote = 0;
 
     /* Now parse display string */
-    for ( ; *cp; cp++) {
+    for ( ; *cp && buflen > 0; cp++) {
 	if (*cp == '%') {
+	    pp = bp;
+
 	    switch (*++cp) {
 	    case 'a':
 		/* insert parameters from Content-Type field */
@@ -433,14 +435,42 @@
 	    len = strlen (bp);
 	    bp += len;
 	    buflen -= len;
+
+	    if (sawquote) {
+		while ((pp = strchr (pp, '\'')) && buflen > 3) {
+		    len = strlen (pp++);
+		    memmove (pp + 3, pp, len);
+		    *pp++ = '\\';
+		    *pp++ = '\'';
+		    *pp++ = '\'';
+		    buflen -= 3;
+		    bp += 3;
+		}
+		/* If pp is set, that means we ran out of space. */
+		if (pp)
+		    buflen = 0;
+	    }
+
+	    sawquote = 0;
 	} else {
 raw:
 	*bp++ = *cp;
 	*bp = '\0';
 	buflen--;
+	sawquote = *cp == '\'';
 	}
     }
 
+    if (buflen == 0 ||
+	(ct->c_termproc && buflen < strlen(ct->c_termproc))) {
+	/* content_error would provide a more useful error message
+	 * here, except that if we got overrun, it probably would
+	 * too.
+	 */
+	fprintf(stderr, "Buffer overflow constructing show command!\n");
+	return NOTOK;
+    }
+
     /* use charset string to modify display method */
     if (ct->c_termproc) {
 	char term[BUFSIZ];
@@ -466,6 +496,8 @@
     pid_t child_id;
     int i;
     char *vec[4], exec[BUFSIZ + sizeof "exec "];
+    int	intr;
+    SIGNAL_HANDLER istat;
     
     if (debugsw || cracked) {
 	fflush (stdout);
@@ -487,6 +519,9 @@
 	xpid = 0;
     }
 
+    if (xstdin && m_pid)
+	m_pclose ();
+
     if (xlist) {
 	char prompt[BUFSIZ];
 
@@ -499,9 +534,6 @@
 	    printf ("Press <return> to show content...");
 
 	if (xpause) {
-	    int	intr;
-	    SIGNAL_HANDLER istat;
-
 	    istat = SIGNAL (SIGINT, intrser);
 	    if ((intr = sigsetjmp (intrenv, 1)) == OK) {
 		fflush (stdout);
@@ -525,10 +557,12 @@
 
     fflush (stdout);
 
-    for (i = 0; (child_id = vfork ()) == NOTOK && i < 5; i++)
+    istat = SIGNAL (SIGINT, intrser2);
+    for (i = 0; (intrpid = child_id = vfork ()) == NOTOK && i < 5; i++)
 	sleep (5);
     switch (child_id) {
 	case NOTOK:
+	    SIGNAL (SIGINT, istat);
 	    advise ("fork", "unable to");
 	    (*ct->c_ceclosefnx) (ct);
 	    return NOTOK;
@@ -556,6 +590,7 @@
 
 	    if (fd != NOTOK)
 		(*ct->c_ceclosefnx) (ct);
+	    SIGNAL (SIGINT, istat);
 	    return (alternate ? DONE : OK);
     }
 }
@@ -587,8 +622,7 @@
      * if it is not a text part of a multipart/alternative
      */
     if (!alternate || ct->c_subtype == TEXT_PLAIN) {
-	snprintf (buffer, sizeof(buffer), "%%p%s '%%F'", progsw ? progsw :
-		moreproc && *moreproc ? moreproc : "more");
+	snprintf (buffer, sizeof(buffer), "%%ecat '%%f'");
 	cp = (ct->c_showproc = add (buffer, NULL));
 	return show_content_aux (ct, serial, alternate, cp, NULL);
     }
@@ -780,9 +814,9 @@
 static int
 show_multi_aux (CT ct, int serial, int alternate, char *cp)
 {
-    int len, buflen;
+    int len, buflen, sawquote;
     int xlist, xpause, xtty;
-    char *bp, *file, buffer[BUFSIZ];
+    char *bp, *pp, *file, buffer[BUFSIZ];
     struct multipart *m = (struct multipart *) ct->c_ctparams;
     struct part *part;
     CI ci = &ct->c_ctinfo;
@@ -817,12 +851,16 @@
 
     /* get buffer ready to go */
     bp = buffer;
-    bp[0] = '\0';
-    buflen = sizeof(buffer);
+    bp[0] = bp[sizeof(buffer) - 1] = '\0';
+    buflen = sizeof(buffer) - 1;
+
+    sawquote = 0;
 
     /* Now parse display string */
-    for ( ; *cp; cp++) {
+    for ( ; *cp && buflen > 0; cp++) {
 	if (*cp == '%') {
+	    pp = bp;
+
 	    switch (*++cp) {
 	    case 'a':
 		/* insert parameters from Content-Type field */
@@ -906,14 +944,42 @@
 	    len = strlen (bp);
 	    bp += len;
 	    buflen -= len;
+
+	    if (sawquote) {
+		while ((pp = strchr (pp, '\'')) && buflen > 3) {
+		    len = strlen (pp++);
+		    memmove (pp + 3, pp, len);
+		    *pp++ = '\\';
+		    *pp++ = '\'';
+		    *pp++ = '\'';
+		    buflen -= 3;
+		    bp += 3;
+		}
+		/* If pp is set, that means we ran out of space. */
+		if (pp)
+		    buflen = 0;
+	    }
+
+	    sawquote = 0;
 	} else {
 raw:
 	*bp++ = *cp;
 	*bp = '\0';
 	buflen--;
+	sawquote = *cp == '\'';
 	}
     }
 
+    if (buflen == 0 ||
+	(ct->c_termproc && buflen < strlen(ct->c_termproc))) {
+	/* content_error would provide a more useful error message
+	 * here, except that if we got overrun, it probably would
+	 * too.
+	 */
+	fprintf(stderr, "Buffer overflow constructing show command!\n");
+	return NOTOK;
+    }
+
     /* use charset string to modify display method */
     if (ct->c_termproc) {
 	char term[BUFSIZ];
@@ -1012,3 +1078,74 @@
     putchar ('\n');
     siglongjmp (intrenv, DONE);
 }
+
+static RETSIGTYPE
+intrser2 (int i)
+{
+#ifndef RELIABLE_SIGNALS
+    SIGNAL (SIGINT, intrser2);
+#endif
+    kill (intrpid, SIGKILL);
+}
+
+static  int sd = NOTOK;
+
+static void
+m_popen (char *name)
+{
+    int pd[2];
+
+    if ((sd = dup (fileno (stdout))) == NOTOK)
+	adios ("standard output", "unable to dup()");
+
+    if (pipe (pd) == NOTOK)
+	adios ("pipe", "unable to");
+
+    switch (m_pid = vfork ()) {
+	case NOTOK: 
+	    adios ("fork", "unable to");
+
+	case OK: 
+	    SIGNAL (SIGINT, SIG_DFL);
+	    SIGNAL (SIGQUIT, SIG_DFL);
+
+	    close (pd[1]);
+	    if (pd[0] != fileno (stdin)) {
+		dup2 (pd[0], fileno (stdin));
+		close (pd[0]);
+	    }
+	    execlp (name, r1bindex (name, '/'), NULL);
+	    fprintf (stderr, "unable to exec ");
+	    perror (name);
+	    _exit (-1);
+
+	default: 
+	    close (pd[0]);
+	    if (pd[1] != fileno (stdout)) {
+		dup2 (pd[1], fileno (stdout));
+		close (pd[1]);
+	    }
+    }
+}
+
+
+void
+m_pclose (void)
+{
+    if (!m_pid)
+	return;
+
+    if (sd != NOTOK) {
+	if (dup2 (sd, fileno (stdout)) == NOTOK)
+	    adios ("standard output", "unable to dup2()");
+
+	clearerr (stdout);
+	close (sd);
+	sd = NOTOK;
+    }
+    else
+	fclose (stdout);
+
+    pidwait (m_pid, OK);
+    m_pid = 0;
+}
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/uip/msgchk.c nmh-1.0+athena9.4.34/uip/msgchk.c
--- nmh-1.0/uip/msgchk.c	1998-08-26 14:19:47.000000002 -0400
+++ nmh-1.0+athena9.4.34/uip/msgchk.c	1999-02-12 19:39:50.000000002 -0500
@@ -217,7 +217,7 @@
     /*
      * If -host is not specified by user
      */
-    if (!host || !*host) {
+    if ((!host || !*host) && !getenv("MAILDROP")) {
 # ifdef HESIOD
 	/*
 	 * Scheme is:
@@ -322,15 +322,19 @@
 checkmail (char *user, char *home, int datesw, int notifysw, int personal)
 {
     int mf, status;
-    char buffer[BUFSIZ];
+    char buffer[BUFSIZ], *maildrop;
     struct stat st;
 
-    snprintf (buffer, sizeof(buffer), "%s/%s", mmdfldir[0] ? mmdfldir : home, mmdflfil[0] ? mmdflfil : user);
+    maildrop = getenv("MAILDROP");
+    if (!maildrop) {
+	snprintf (buffer, sizeof(buffer), "%s/%s", mmdfldir[0] ? mmdfldir : home, mmdflfil[0] ? mmdflfil : user);
+	maildrop = buffer;
+    }
     if (datesw) {
 	st.st_size = 0;
 	st.st_atime = st.st_mtime = 0;
     }
-    mf = (stat (buffer, &st) == NOTOK || st.st_size == 0) ? NONEOK
+    mf = (stat (maildrop, &st) == NOTOK || st.st_size == 0) ? NONEOK
 	: st.st_atime <= st.st_mtime ? MMDFNEW : MMDFOLD;
 
     if ((mf & UUCPOK) || (mf & MMDFOK)) {
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/uip/packf.c nmh-1.0+athena9.4.34/uip/packf.c
--- nmh-1.0/uip/packf.c	1998-12-23 03:07:37.000000002 -0500
+++ nmh-1.0+athena9.4.34/uip/packf.c	2000-01-06 23:43:58.000000002 -0500
@@ -189,7 +189,8 @@
 	}
 
     /* close and unlock maildrop file */
-    mbx_close (file, md);
+    if (mbx_close (file, md) == NOTOK)
+	adios (file, "error writing to file");
 
     context_replace (pfolder, folder);	/* update current folder         */
     if (mp->hghsel != mp->curmsg)
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/uip/popsbr.c nmh-1.0+athena9.4.34/uip/popsbr.c
--- nmh-1.0/uip/popsbr.c	1998-08-27 00:57:44.000000002 -0400
+++ nmh-1.0+athena9.4.34/uip/popsbr.c	2003-03-20 12:19:30.000000002 -0500
@@ -26,7 +26,7 @@
 #define	TRM	"."
 #define	TRMLEN	(sizeof TRM - 1)
 
-extern int errno;
+#include <errno.h>
 
 static int poprint = 0;
 static int pophack = 0;
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/uip/repl.c nmh-1.0+athena9.4.34/uip/repl.c
--- nmh-1.0/uip/repl.c	1998-12-03 18:18:54.000000002 -0500
+++ nmh-1.0+athena9.4.34/uip/repl.c	1999-05-14 09:51:51.000000002 -0400
@@ -108,9 +108,9 @@
     { NULL, 0 }
 };
 
-short ccto = 1;		/* global for replsbr */
-short cccc = 1;
-short ccme = 1;
+short ccto = 0;		/* global for replsbr */
+short cccc = 0;
+short ccme = 0;
 short querysw = 0;
 
 short outputlinelen = OUTPUTLINELEN;
@@ -177,6 +177,7 @@
 
 		case GROUPSW:
 		    groupreply++;
+		    ccto = cccc = ccme = 1;
 		    continue;
 		case NGROUPSW:
 		    groupreply = 0;
@@ -193,6 +194,7 @@
 		    if (!(cp = *argp++) || *cp == '-')
 			adios (NULL, "missing argument to %s", argp[-2]);
 		    docc (cp, 1);
+		    groupreply = 1;
 		    continue;
 		case NCCSW: 
 		    if (!(cp = *argp++) || *cp == '-')
@@ -417,9 +419,6 @@
 
     /* find form (components) file */
     if (!form) {
-	if (groupreply)
-	    form = etcpath (replgroupcomps);
-	else
 	    form = etcpath (replcomps);
     }
 
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/uip/replsbr.c nmh-1.0+athena9.4.34/uip/replsbr.c
--- nmh-1.0/uip/replsbr.c	1998-12-11 21:58:14.000000002 -0500
+++ nmh-1.0+athena9.4.34/uip/replsbr.c	2000-03-15 15:52:38.000000002 -0500
@@ -201,6 +201,7 @@
 
     /*
      * if there's a "Subject" component, strip any "Re:"s off it
+     * and remove a trailing newline if present
      */
     FINDCOMP (cptr, "subject")
     if (cptr && (cp = cptr->c_text)) {
@@ -220,6 +221,9 @@
 	    cptr->c_text = getcpy (sp);
 	    free (cp);
 	}
+	cp = cptr->c_text + strlen(cptr->c_text);
+	if (cp > cptr->c_text && *(cp - 1) == '\n')
+	    *(cp - 1) = '\0';
     }
     i = format_len + char_read + 256;
     scanl = malloc ((size_t) i + 2);
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/uip/show.c nmh-1.0+athena9.4.34/uip/show.c
--- nmh-1.0/uip/show.c	1998-12-03 18:22:07.000000002 -0500
+++ nmh-1.0+athena9.4.34/uip/show.c	1999-10-08 18:14:32.000000002 -0400
@@ -181,6 +181,13 @@
     }
     procp = vecp;
 
+    /* If showing multiple messages, default to -nocheckmime.
+     * (But just decrement it rather than setting to 0, so user
+     * can specify -checkmime to override.
+     */
+    if (msgp > 1)
+      checkmime--;
+
     if (!context_find ("path"))
 	free (path ("./", TFOLDER));
 
@@ -315,6 +322,14 @@
 	vec[vecp] = NULL;
     }
 
+    /* If the "proc" is "mhshow", add "-file" if showing file or draft.
+     */
+    if (strcmp (r1bindex (proc, '/'), "mhshow") == 0 && (draftsw || file) ) {
+       vec[vecp] = vec[vecp - 1];
+       vec[vecp - 1] = "-file";
+       vec[++vecp] = NULL;
+    }
+
     /*
      * If "proc" is mhl, then run it internally
      * rather than exec'ing it.
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/uip/slocal.c nmh-1.0+athena9.4.34/uip/slocal.c
--- nmh-1.0/uip/slocal.c	1999-01-03 07:09:27.000000002 -0500
+++ nmh-1.0+athena9.4.34/uip/slocal.c	2000-01-06 23:43:58.000000002 -0500
@@ -27,9 +27,17 @@
 #include <pwd.h>
 #include <signal.h>
 #include <sys/ioctl.h>
-#include <ndbm.h>
 #include <fcntl.h>
 
+#if defined (HAVE_DB_H) && !defined (HAVE_NDBM_H)
+#define DB_DBM_HSEARCH 1
+#include <db.h>
+#elif defined (HAVE_NDBM_H)
+#include <ndbm.h>
+#else
+#error Cannot find a suitable database header
+#endif
+
 #include <utmp.h>
 
 #ifndef UTMP_FILE
@@ -994,7 +1002,11 @@
     }
 
     /* close and unlock file */
-    mbx_close (mailbox, md);
+    if (mbx_close (mailbox, md) == NOTOK) {
+	if (verbose)
+	    adorn ("", "error writing to:");
+	return -1;
+    }
 
     if (verbose)
 	verbose_printf (", success.\n");
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/uip/spost.c nmh-1.0+athena9.4.34/uip/spost.c
--- nmh-1.0/uip/spost.c	1998-07-19 19:56:49.000000002 -0400
+++ nmh-1.0+athena9.4.34/uip/spost.c	2000-05-08 11:47:28.000000002 -0400
@@ -311,8 +311,15 @@
 		    continue;
 
 		case LIBSW:
+		    if (!(cp = *argp++) || *cp == '-')
+			adios (NULL, "missing argument to %s", argp[-2]);
+		    /* create a minimal context */
+		    if (context_foil (cp) == -1)
+			done(1);
+		    continue;
+
 		case ANNOSW:
-		    /* -library & -idanno switch ignored */
+		    /* -idanno switch ignored */
 		    if (!(cp = *argp++) || *cp == '-')
 			adios (NULL, "missing argument to %s", argp[-2]);
 		    continue;
@@ -506,6 +513,8 @@
 
 	    while ((cp = getname(str))) {
 		mp = getm( cp, NULL, 0, AD_HOST, NULL);
+		if (mp == NULL)
+		    continue;
 		if (f == 0) {
 		    f = mp;
 		    mp->m_next = mp;
@@ -625,6 +634,8 @@
 			    linepos = namelen;
 		    }
 		    mp2 = getm( cp, NULL, 0, AD_HOST, NULL);
+		    if (mp2 == NULL)
+			continue;
 		    if (akvisible()) {
 			mp2->m_pers = getcpy(mp->m_mbox);
 			linepos = putone( adrformat(mp2), linepos, namelen );
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/uip/vmhsbr.c nmh-1.0+athena9.4.34/uip/vmhsbr.c
--- nmh-1.0/uip/vmhsbr.c	1998-07-30 17:09:14.000000002 -0400
+++ nmh-1.0+athena9.4.34/uip/vmhsbr.c	2003-03-20 12:19:30.000000002 -0500
@@ -24,7 +24,7 @@
 static int PEERrfd = NOTOK;
 static int PEERwfd = NOTOK;
 
-extern int  errno;
+#include <errno.h>
 
 /*
  * static prototypes
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/zotnet/bboards/Makefile.in nmh-1.0+athena9.4.34/zotnet/bboards/Makefile.in
--- nmh-1.0/zotnet/bboards/Makefile.in	1997-01-06 03:52:21.000000002 -0500
+++ nmh-1.0+athena9.4.34/zotnet/bboards/Makefile.in	1999-02-23 12:00:46.000000002 -0500
@@ -15,7 +15,7 @@
 DEFS       = @DEFS@
 INCLUDES   = -I../.. -I$(srcdir) -I$(top_srcdir)
 
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS)
+COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS)
 
 .SUFFIXES:
 .SUFFIXES: .c .o
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/zotnet/Makefile.in nmh-1.0+athena9.4.34/zotnet/Makefile.in
--- nmh-1.0/zotnet/Makefile.in	1997-12-31 11:27:52.000000002 -0500
+++ nmh-1.0+athena9.4.34/zotnet/Makefile.in	1999-02-12 19:41:10.000000002 -0500
@@ -15,7 +15,7 @@
 
 # flags passed to recursive makes in subdirectories
 MAKEDEFS = CC='$(CC)' CPPFLAGS='$(CPPFLAGS)' DEFS='$(DEFS)' \
-CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' LIBS='$(LIBS)' \
+CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' LIBS='$(LIBS)' DESTDIR='$(DESTDIR)' \
 prefix='$(prefix)' exec_prefix='$(exec_prefix)' bindir='$(bindir)' \
 etcdir='$(etcdir)' libdir='$(libdir)' mandir='$(mandir)' \
 mailspool='$(mailspool)' sendmailpath='$(sendmailpath)' \
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/zotnet/mf/Makefile.in nmh-1.0+athena9.4.34/zotnet/mf/Makefile.in
--- nmh-1.0/zotnet/mf/Makefile.in	1997-01-06 03:52:42.000000002 -0500
+++ nmh-1.0+athena9.4.34/zotnet/mf/Makefile.in	1999-02-23 12:00:47.000000002 -0500
@@ -15,7 +15,7 @@
 DEFS     = @DEFS@
 INCLUDES = -I../.. -I$(srcdir) -I$(top_srcdir)
 
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS)
+COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS)
 
 .SUFFIXES:
 .SUFFIXES: .c .o
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/zotnet/mf/mf.c nmh-1.0+athena9.4.34/zotnet/mf/mf.c
--- nmh-1.0/zotnet/mf/mf.c	1997-01-27 00:38:34.000000002 -0500
+++ nmh-1.0+athena9.4.34/zotnet/mf/mf.c	1999-11-04 15:00:22.000000002 -0500
@@ -31,7 +31,11 @@
     register char *p;
 
     if (!s) {
+#ifdef __linux__
+      fcloseall ();
+#else
 	_cleanup();
+#endif
 	abort();
 	for(;;)
 	    pause();
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/zotnet/mts/Makefile.in nmh-1.0+athena9.4.34/zotnet/mts/Makefile.in
--- nmh-1.0/zotnet/mts/Makefile.in	1998-08-22 19:39:55.000000002 -0400
+++ nmh-1.0+athena9.4.34/zotnet/mts/Makefile.in	1999-02-23 12:00:48.000000002 -0500
@@ -27,8 +27,8 @@
 INCLUDES   = -I../.. -I$(srcdir) -I$(top_srcdir) $(KRB4_INCLUDES) $(HESIOD_INCLUDES)
 CONFIGDEFS = -DNMHETCDIR='"$(etcdir)"' -DMAILSPOOL='"$(mailspool)"' -DSENDMAILPATH='"$(sendmailpath)"'
 
-COMPILE  = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS)
-COMPILE2 = $(CC) -c $(DEFS) $(CONFIGDEFS) $(INCLUDES) $(CFLAGS)
+COMPILE  = $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS)
+COMPILE2 = $(CC) -c $(CPPFLAGS) $(DEFS) $(CONFIGDEFS) $(INCLUDES) $(CFLAGS)
 
 SED = sed
 
diff -urN --ignore-matching-lines='\$\(Id\|Revision\|Date\).*\$' -ur nmh-1.0/zotnet/tws/Makefile.in nmh-1.0+athena9.4.34/zotnet/tws/Makefile.in
--- nmh-1.0/zotnet/tws/Makefile.in	1997-06-04 17:45:01.000000002 -0400
+++ nmh-1.0+athena9.4.34/zotnet/tws/Makefile.in	1999-02-23 12:00:50.000000002 -0500
@@ -15,7 +15,7 @@
 DEFS       = @DEFS@
 INCLUDES   = -I../.. -I$(srcdir) -I$(top_srcdir)
 
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS)
+COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS)
 
 AWK = @AWK@
 # LEX = @LEX@
