--- debathena-nmh-1.0+athena9.4.34.orig/uip/mhstoresbr.c
+++ debathena-nmh-1.0+athena9.4.34/uip/mhstoresbr.c
@@ -681,6 +681,8 @@
 	    return NOTOK;
 	if (!strcmp (file, ct->c_storage)) {
 	    (*ct->c_ceclosefnx) (ct);
+	    fclose (ct->c_fp);
+	    ct->c_fp = NULL;
 	    return OK;
 	}
 
--- debathena-nmh-1.0+athena9.4.34.orig/debian/copyright
+++ debathena-nmh-1.0+athena9.4.34/debian/copyright
@@ -0,0 +1,23 @@
+This package was debianized as part of the Debathena Project
+<http://debathena.mit.edu/> of the MIT Student Information Processing
+Board.
+
+The Athena source code was obtained from the Athena SVN repository at
+<svn://debathena.mit.edu/athena/trunk>, and is licensed as follows:
+
+  Copyright © 1996 by the Massachusetts Institute of Technology.
+
+  Permission to use, copy, modify, and distribute this
+  software and its documentation for any purpose and without
+  fee is hereby granted, provided that the above copyright
+  notice appear in all copies and that both that copyright
+  notice and this permission notice appear in supporting
+  documentation, and that the name of M.I.T. not be used in
+  advertising or publicity pertaining to distribution of the
+  software without specific, written prior permission.
+  M.I.T. makes no representations about the suitability of
+  this software for any purpose.  It is provided "as is"
+  without express or implied warranty.
+
+The Debian packaging is Copyright © 2007-2008 Tim Abbott and Anders
+Kaseorg, and has the same license as the original software.
--- debathena-nmh-1.0+athena9.4.34.orig/debian/changelog
+++ debathena-nmh-1.0+athena9.4.34/debian/changelog
@@ -0,0 +1,35 @@
+debathena-nmh (1.0+athena9.4.34-0debathena4) unstable; urgency=low
+
+  * Remove DEB_AUTO_UPDATE_DEBIAN_CONTROL.
+  * Change "Debian-Athena Project" to "Debathena Project".
+  * Remove debian/control from version control.
+  * Clean up debian/copyright.
+  * Remove comment #DEB_AUTO_UPDATE_AUTOCONF = 2.13 from rules file.
+
+ -- Tim Abbott <tabbott@mit.edu>  Sat, 24 Jan 2009 15:36:12 -0500
+
+debathena-nmh (1.0+athena9.4.34-0debathena3) unstable; urgency=low
+
+  * Prefer debathena-msmtp-mta rather than nullmailer for
+    mail-transport-agent.
+
+ -- Tim Abbott <tabbott@mit.edu>  Tue, 22 Apr 2008 15:40:09 -0400
+
+debathena-nmh (1.0+athena9.4.34-0debathena2) unstable; urgency=low
+
+  [ Tim Abbott ]
+  * Fix configure issues: make sure /usr/lib/sendmail exists on build
+    machine by Build-Depends: mail-transport-agent.
+  * Add dependency on metamail.
+
+  [ Anders Kaseorg ]
+  * Set DEB_OPT_FLAG = -O0, to work around a segfault at uip/mhlsbr.c:904
+    reported by mitchb.
+
+ -- Tim Abbott <tabbott@mit.edu>  Mon, 14 Apr 2008 15:56:17 -0400
+
+debathena-nmh (1.0+athena9.4.34-0debathena1) unstable; urgency=low
+
+  * Initial release.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Thu, 16 Aug 2007 02:49:01 -0400
--- debathena-nmh-1.0+athena9.4.34.orig/debian/compat
+++ debathena-nmh-1.0+athena9.4.34/debian/compat
@@ -0,0 +1 @@
+4
--- debathena-nmh-1.0+athena9.4.34.orig/debian/rules
+++ debathena-nmh-1.0+athena9.4.34/debian/rules
@@ -0,0 +1,12 @@
+#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/autotools.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk
+
+DEB_OPT_FLAG = -O0  # Work around a segfault at uip/mhlsbr.c:904.
+
+CPPFLAGS += -DLINUX_STDIO
+CFLAGS += -DLINUX_STDIO  # Sarge cdbs doesn't support CPPFLAGS.
+DEB_CONFIGURE_EXTRA_FLAGS += --enable-nmh-pop --enable-nmh-debug --with-krb4=$(shell krb5-config --prefix krb4) --with-hesiod --with-mts=sendmail --with-editor=emacs --with-editor=/usr/bin/sensible-editor --with-pager=/usr/bin/sensible-pager
+DEB_MAKE_INVOKE += etcdir=/etc/nmh
--- debathena-nmh-1.0+athena9.4.34.orig/debian/control
+++ debathena-nmh-1.0+athena9.4.34/debian/control
@@ -0,0 +1,13 @@
+Source: debathena-nmh
+Section: debathena/mail
+Priority: extra
+Maintainer: Debathena Project <debathena@mit.edu>
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.2.0), quilt, patchutils (>= 0.2.25), cdbs (>= 0.4.27), libkrb5-dev, libhesiod-dev, libncurses-dev, libdb-dev, debathena-msmtp-mta | nullmailer | mail-transport-agent
+Standards-Version: 3.7.2
+
+Package: debathena-nmh
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, debathena-attachandrun, debianutils, metamail
+Conflicts: nmh
+Description: The NMH mail handling system
+ NMH used to be the standard mail handling system on Athena.
--- debathena-nmh-1.0+athena9.4.34.orig/debian/control.in
+++ debathena-nmh-1.0+athena9.4.34/debian/control.in
@@ -0,0 +1,13 @@
+Source: debathena-nmh
+Section: debathena/mail
+Priority: extra
+Maintainer: Debathena Project <debathena@mit.edu>
+Build-Depends: @cdbs@, libkrb5-dev, libhesiod-dev, libncurses-dev, libdb-dev, debathena-msmtp-mta | nullmailer | mail-transport-agent
+Standards-Version: 3.7.2
+
+Package: debathena-nmh
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, debathena-attachandrun, debianutils, metamail
+Conflicts: nmh
+Description: The NMH mail handling system
+ NMH used to be the standard mail handling system on Athena.
--- debathena-nmh-1.0+athena9.4.34.orig/debian/patches/nmh-links.patch
+++ debathena-nmh-1.0+athena9.4.34/debian/patches/nmh-links.patch
@@ -0,0 +1,34 @@
+Index: debathena-nmh-1.0+athena9.4.34/uip/Makefile.in
+===================================================================
+--- debathena-nmh-1.0+athena9.4.34.orig/uip/Makefile.in	2007-08-17 00:28:21.000000000 -0400
++++ debathena-nmh-1.0+athena9.4.34/uip/Makefile.in	2007-08-17 00:34:42.000000000 -0400
+@@ -250,25 +250,10 @@
+ # install links
+ install-lcmds:
+ 	$(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
++	ln -s flist  $(DESTDIR)$(bindir)/flists
++	ln -s folder $(DESTDIR)$(bindir)/folders
++	ln -s show   $(DESTDIR)$(bindir)/prev
++	ln -s show   $(DESTDIR)$(bindir)/next
+ 
+ # install misc support binaries
+ install-misc:
--- debathena-nmh-1.0+athena9.4.34.orig/debian/patches/nmh-paths.patch
+++ debathena-nmh-1.0+athena9.4.34/debian/patches/nmh-paths.patch
@@ -0,0 +1,58 @@
+Index: debathena-nmh-1.0+athena9.4.34/etc/mhn.defaults
+===================================================================
+--- debathena-nmh-1.0+athena9.4.34.orig/etc/mhn.defaults	2007-08-17 00:43:52.000000000 -0400
++++ debathena-nmh-1.0+athena9.4.34/etc/mhn.defaults	2007-08-17 00:45:24.000000000 -0400
+@@ -1,37 +1,37 @@
+ mhshow-show-text/plain: %ecat '%f'
+-mhshow-show-text: %e/usr/athena/libexec/show-text '%s' '%f'
++mhshow-show-text: %e/bin/attachandrun mimeutils show-text 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'
++mhshow-show-image: %l/bin/attachandrun mimeutils show-image show-image '%s' '%F'
+ mhstore-store-image/x-sgi-image: %m%P.sgi
+-mhshow-show-video: %l/usr/athena/libexec/show-video '%s' '%F'
++mhshow-show-video: %l/bin/attachandrun mimeutils show-video show-video '%s' '%F'
+ mhstore-store-video/mpeg: %m%P.mpg
+-mhshow-show-audio: %l/usr/athena/libexec/show-audio '%s' '%F'
++mhshow-show-audio: %l/bin/attachandrun mimeutils show-audio 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'
++mhshow-show-application/msword: %l%e/bin/attachandrun mimeutils show-msword show-msword '%f'
++mhshow-show-application/x-msword: %l%e/bin/attachandrun mimeutils show-msword 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'
++mhshow-show-application/postscript: %l/bin/attachandrun mimeutils show-postscript 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'
++mhshow-show-application/pdf: %l/bin/attachandrun mimeutils show-pdf show-pdf '%f'
++mhshow-show-application/mac-binhex40: %l/bin/attachandrun mimeutils show-binhex show-binhex '%f'
++mhstore-store-application/mac-binhex40: | /bin/attachandrun mimeutils store-binhex store-binhex %m%P
++mhshow-show-application: %l/bin/attachandrun mimeutils show-application 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'
++mhshow-show-application/excel: %l%e/bin/attachandrun mimeutils show-excel show-excel '%f'
++mhshow-show-application/x-excel: %l%e/bin/attachandrun mimeutils show-excel show-excel '%f'
++mhshow-show-application/msexcel: %l%e/bin/attachandrun mimeutils show-excel show-excel '%f'
++mhshow-show-application/x-msexcel: %l%e/bin/attachandrun mimeutils show-excel show-excel '%f'
++mhshow-show-application/vnd.ms-excel: %l%e/bin/attachandrun mimeutils show-excel 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
--- debathena-nmh-1.0+athena9.4.34.orig/debian/patches/series
+++ debathena-nmh-1.0+athena9.4.34/debian/patches/series
@@ -0,0 +1,2 @@
+nmh-paths.patch
+nmh-links.patch
