University of Washington IMAP4 server for NEWS-OS Release 6.x/4.x

���۴Ķ�:
 1. NEWS-OS Release 6.x
  NWS-5000TF
  NEWS-OS Release 6.1.2
  NEWS-C 1.010
  GNU make 3.77
 2. NEWS-OS Release 4.x
  NWS-3870
  NEWS-OS Release 4.2.1a+
  GNU C 2.7.2.3
  GNU make 3.77

���󥹥ȡ�����ˡ:
  # patch -p1 < ThisFile
  - NEWS-OS Release 4.x�ξ��
   # make bsd
   # install -c -o root -g wheel -m 750 imapd/imapd /usr/local/etc
   # install -c -o root -g wheel -m 750 ipopd/ipop?d /usr/local/etc
   # install -c -o root -g wheel -m 444 src/imapd/imapd.8c /usr/local/man/C/man8/imapd.8
   # install -c -o root -g wheel -m 444 src/ipopd/ipopd.8c /usr/local/man/C/man8/ipopd.8
  - NEWS-OS Release 6.x�ξ��
   # make nw6
   # bsdinst -c -o root -g root -m 750 imapd/imapd /usr/local/sbin
   # bsdinst -c -o root -g root -m 750 ipopd/ipop?d /usr/local/sbin
   # bsdinst -c -o root -g root -m 444 src/imapd/imapd.8c /usr/local/man/C/man8/imapd.8
   # bsdinst -c -o root -g root -m 444 src/ipopd/ipopd.8c /usr/local/man/C/man8/ipopd.8


hiraga@meis.sony.co.jp

diff -urP imap-4.4/Makefile imap-4.4-newsos46/Makefile
--- imap-4.4/Makefile	Sat Aug  8 11:31:16 1998
+++ imap-4.4-newsos46/Makefile	Wed Sep  9 12:55:21 1998
@@ -170,6 +170,7 @@
 # sun	SUN-OS 4.1 or better
 # sv2	SVR2 on AT&T PC-7300 (incomplete port)
 # sv4	generic SVR4
+# nw6	NEWS-OS Release 6
 # ult	RISC Ultrix (DEC-5000)
 # uw2	UnixWare SVR4.2
 # vul	VAX Ultrix
@@ -190,7 +191,7 @@
 # If so, you probably will want to delete the "-Dconst=" from the sv4 CFLAGS in
 # the c-client Makefile.
 
-aos art asv aux bsd cvx dpx dyn isc pyr s40 sv4 ult vul vu2: ua
+aos art asv aux bsd cvx dpx dyn isc pyr s40 sv4 nw6 ult vul vu2: ua
 	$(BUILD) OS=$@
 
 # SUN-OS makes you load libdl by hand...
diff -urP imap-4.4/src/osdep/unix/Makefile imap-4.4-newsos46/src/osdep/unix/Makefile
--- imap-4.4/src/osdep/unix/Makefile	Wed Sep  9 06:02:26 1998
+++ imap-4.4-newsos46/src/osdep/unix/Makefile	Wed Sep  9 16:20:09 1998
@@ -539,6 +539,15 @@
 	 BASELDFLAGS="-lsocket -lnsl -lgen" \
 	 RANLIB=true
 
+nw6:	# NEWS-OS Release 6
+	$(BUILD) OS=$@ SIGTYPE=sv4 CHECKPW=sv4 LOGINPW=sv4 \
+	 MAILSPOOL=/var/mail NEWSSPOOL=/var/spool/news \
+	 ACTIVEFILE=/var/news/etc/active \
+	 RSHPATH=/usr/bin/rsh \
+	 BASECFLAGS="-std -O -Olimit 2000" \
+	 BASELDFLAGS="-lsocket -lnsl -lgen" \
+	 RANLIB=true
+
 ult:	# Ultrix
 	$(BUILD) OS=$@ SIGTYPE=psx CHECKPW=ult \
 	 BASECFLAGS="-g3 -O2 -Olimit 1500 -Dconst= -DNFSKLUDGE" \
diff -urP imap-4.4/src/osdep/unix/os_bsd.c imap-4.4-newsos46/src/osdep/unix/os_bsd.c
--- imap-4.4/src/osdep/unix/os_bsd.c	Wed Dec  3 09:45:02 1997
+++ imap-4.4-newsos46/src/osdep/unix/os_bsd.c	Wed Sep  9 12:16:41 1998
@@ -63,8 +63,10 @@
 #define fork vfork
 #include "tcp_unix.c"
 #include "gr_wait.c"
+#ifndef __sony_news
 #include "memmove.c"
 #include "strerror.c"
 #include "strstr.c"
+#endif
 #include "strtoul.c"
 #include "tz_bsd.c"
diff -urP imap-4.4/src/osdep/unix/os_bsd.h imap-4.4-newsos46/src/osdep/unix/os_bsd.h
--- imap-4.4/src/osdep/unix/os_bsd.h	Tue Apr 30 13:49:49 1996
+++ imap-4.4-newsos46/src/osdep/unix/os_bsd.h	Wed Sep  9 16:43:01 1998
@@ -42,6 +42,7 @@
 #include <machine/endian.h>	/* needed for htons() prototypes */
 
 
+#ifndef __sony_news
 char *getenv (char *name);
 char *strstr (char *cs,char *ct);
 char *strerror (int n);
@@ -50,6 +51,7 @@
 void *malloc (size_t byteSize);
 void free (void *ptr);
 void *realloc (void *oldptr,size_t newsize);
+#endif
 
 #include "env_unix.h"
 #include "fs.h"
diff -urP imap-4.4/src/osdep/unix/os_nw6.c imap-4.4-newsos46/src/osdep/unix/os_nw6.c
--- imap-4.4/src/osdep/unix/os_nw6.c	Thu Jan  1 09:00:00 1970
+++ imap-4.4-newsos46/src/osdep/unix/os_nw6.c	Wed Sep  9 13:00:46 1998
@@ -0,0 +1,76 @@
+/*
+ * Program:	Operating-system dependent routines -- SVR4 version
+ *
+ * Author:	Mark Crispin
+ *		Networks and Distributed Computing
+ *		Computing & Communications
+ *		University of Washington
+ *		Administration Building, AG-44
+ *		Seattle, WA  98195
+ *		Internet: MRC@CAC.Washington.EDU
+ *
+ * Date:	10 April 1992
+ * Last Edited:	30 December 1997
+ *
+ * Copyright 1997 by the University of Washington
+ *
+ *  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 appears in all copies and that both the
+ * above copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the University of Washington not be
+ * used in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission.  This software is made
+ * available "as is", and
+ * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
+ * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
+ * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
+ * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#include "tcp_unix.h"		/* must be before osdep includes tcp.h */
+#include "mail.h"
+#include "osdep.h"
+#include <ctype.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/tiuser.h>
+#include <sys/stropts.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <errno.h>
+#include <pwd.h>
+#include <shadow.h>
+#include <sys/socket.h>
+#include <sys/select.h>
+#include "misc.h"
+
+extern int sys_nerr;
+extern char *sys_errlist[];
+
+#define DIR_SIZE(d) d->d_reclen
+
+#define toint(c)	((c)-'0')
+#define isodigit(c)	(((unsigned)(c)>=060)&((unsigned)(c)<=067))
+
+
+#include "fs_unix.c"
+#include "ftl_unix.c"
+#include "nl_unix.c"
+#include "env_unix.c"
+#include "tcp_unix.c"
+#include "gr_waitp.c"
+#undef flock
+#include "flock.c"
+#include "scandir.c"
+#include "tz_sv4.c"
+#include "gethstid.c"
+#undef setpgrp
+#include "setpgrp.c"
+#include "utime.c"
diff -urP imap-4.4/src/osdep/unix/os_nw6.h imap-4.4-newsos46/src/osdep/unix/os_nw6.h
--- imap-4.4/src/osdep/unix/os_nw6.h	Thu Jan  1 09:00:00 1970
+++ imap-4.4-newsos46/src/osdep/unix/os_nw6.h	Wed Sep  9 13:00:50 1998
@@ -0,0 +1,92 @@
+/*
+ * Program:	Operating-system dependent routines -- SVR4 version
+ *
+ * Author:	Mark Crispin
+ *		Networks and Distributed Computing
+ *		Computing & Communications
+ *		University of Washington
+ *		Administration Building, AG-44
+ *		Seattle, WA  98195
+ *		Internet: MRC@CAC.Washington.EDU
+ *
+ * Date:	10 April 1992
+ * Last Edited:	30 December 1997
+ *
+ * Copyright 1997 by the University of Washington
+ *
+ *  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 appears in all copies and that both the
+ * above copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the University of Washington not be
+ * used in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission.  This software is made
+ * available "as is", and
+ * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
+ * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
+ * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
+ * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#include <string.h>
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <time.h>
+#include <utime.h>
+#include <syslog.h>
+#include <sys/file.h>
+#include <ustat.h>
+
+
+/* Many versions of SysV get this wrong */
+
+#define setpgrp(a,b) Setpgrp(a,b)
+
+
+/* Different names, equivalent things in BSD and SysV */
+
+/* L_SET is defined for some strange reason in <sys/file.h> on SVR4. */
+#ifndef L_SET
+#define L_SET SEEK_SET
+#endif
+#define L_INCR SEEK_CUR
+#define L_XTND SEEK_END
+
+#define direct dirent
+#define random lrand48
+
+
+/* For flock() emulation */
+
+#define flock(x,y) bsd_flock((x),(y))
+
+#define LOCK_SH 1
+#define LOCK_EX 2
+#define LOCK_NB 4
+#define LOCK_UN 8
+
+#define utime portable_utime
+int portable_utime (char *file,time_t timep[2]);
+
+#include "env_unix.h"
+#include "fs.h"
+#include "ftl.h"
+#include "nl.h"
+#include "tcp.h"
+#include "lockfix.h"
+
+long gethostid (void);
+typedef int (*select_t) (struct direct *name);
+typedef int (*compar_t) (void *d1,void *d2);
+int scandir (char *dirname,struct direct ***namelist,select_t select,
+	     compar_t compar);
+int bsd_flock (int fd,int operation);
