Subject: pkg/9317: new pkg: mail/deliver
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jbernard@mines.edu>
List: netbsd-bugs
Date: 01/30/2000 08:13:04
>Number: 9317
>Category: pkg
>Synopsis: new pkg: mail/deliver
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: pkg-manager (NetBSD software packages system bug manager)
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sun Jan 30 08:12:00 2000
>Last-Modified:
>Originator: Jim Bernard
>Organization:
Speaking for myself
>Release: Jan. 30, 2000
>Environment:
System: NetBSD zoo 1.4P NetBSD 1.4P (ZOO) #0: Fri Dec 31 21:09:59 MST 1999 local@zoo:/home/local/compile/sys/arch/i386/compile/ZOO i386
>Description:
In the words of the author:
Deliver delivers E-Mail on the local system.
Deliver allows any user to write a shell script that processes all
incoming mail messages for that user. The system administrator may
also install scripts that process all messages.
>How-To-Repeat:
>Fix:
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# Makefile
# files
# files/md5
# files/patch-sum
# patches
# patches/patch-aa
# patches/patch-ab
# patches/patch-ac
# patches/patch-ad
# patches/patch-ae
# patches/patch-af
# patches/patch-ag
# pkg
# pkg/COMMENT
# pkg/DESCR
# pkg/PLIST
#
echo x - Makefile
sed 's/^X//' >Makefile << 'END-of-Makefile'
X# $NetBSD$
X
XDISTNAME= deliver-2.1.14
XCATEGORIES= mail
XMASTER_SITES= http://download.sourceforge.net/deliver/
X
XMAINTAINER= packages@netbsd.org
XHOMEPAGE= http://deliver.sourceforge.net/
X
X.include "../../mk/bsd.prefs.mk"
X
X# Deliver prefers to be installed suid root, but by default we don't do that.
XDELIVER_SUID?= NO
X
X# Use DELIVER_CONF_PREFIX from /etc/mk.conf, if defined.
X# If this specifies a directory that will contain files other than deliver's
X# delivery files, you may also want to add a suffix like "deliver.", to
X# identify the "sys", "post", and "err" delivery files as owned by deliver.
XDELIVER_CONF_PREFIX?= ${PREFIX}/etc/deliver/
X#DELIVER_CONF_PREFIX?= ${PREFIX}/etc/deliver.
X
Xpost-patch:
X cd ${WRKSRC}; \
X for FILE in config.h deliver.8; do \
X ${MV} $${FILE} $${FILE}.bak; \
X ${SED} -e 's#@DELIVER_CONF_PREFIX@#${DELIVER_CONF_PREFIX}#g' \
X < $${FILE}.bak > $${FILE}; \
X done
X
X
Xpost-install:
X cd ${WRKSRC}; \
X ${MV} deliver.8 deliver.1; \
X for FILE in deliver.1 header.1; do \
X CATFILE=`${BASENAME} $${FILE} .1`.0; \
X ${NROFF} -man $${FILE} > $${CATFILE}; \
X ${INSTALL_MAN} $${FILE} ${PREFIX}/man/man1; \
X ${INSTALL_MAN} $${CATFILE} ${PREFIX}/man/cat1; \
X done
X ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/deliver \
X ${PREFIX}/share/examples/deliver
X cd ${WRKSRC}; \
X ${INSTALL_DATA} INSTALL MMDF README SENDMAIL \
X ${PREFIX}/share/doc/deliver
X cd ${WRKSRC}/samples; \
X ${INSTALL_DATA} README p-aliases s-aliases u-chip u-notify u-vacation \
X ${PREFIX}/share/examples/deliver
X.if defined(DELIVER_SUID) && ${DELIVER_SUID} == YES
X ${CHOWN} root ${PREFIX}/bin/deliver
X ${CHMOD} u+s ${PREFIX}/bin/deliver
X.endif
X
X.include "../../mk/bsd.pkg.mk"
X.include <bsd.man.mk>
END-of-Makefile
echo c - files
mkdir -p files > /dev/null 2>&1
echo x - files/md5
sed 's/^X//' >files/md5 << 'END-of-files/md5'
X$NetBSD$
X
XMD5 (deliver-2.1.14.tar.gz) = 4a5852182b50824584e6edfc47bb06cb
END-of-files/md5
echo x - files/patch-sum
sed 's/^X//' >files/patch-sum << 'END-of-files/patch-sum'
X$NetBSD$
X
XMD5 (patch-aa) = 71387c43501d38d410d3d2fe3d4cee67
XMD5 (patch-ab) = 776cfc89f49ec2f2e2db7f650bb44240
XMD5 (patch-ac) = 1d6d3d4482a81d8f30a108bea382f9e6
XMD5 (patch-ad) = 69ebde1bfbd5bf9a08c3cf7bae11c7c0
XMD5 (patch-ae) = 6d837ddabafb6404617617611dbfd4ee
XMD5 (patch-af) = 590942d150289d1eb13a30526f2106a7
XMD5 (patch-ag) = 9cf69ce5042df6cc59f89e7cb72d408c
END-of-files/patch-sum
echo c - patches
mkdir -p patches > /dev/null 2>&1
echo x - patches/patch-aa
sed 's/^X//' >patches/patch-aa << 'END-of-patches/patch-aa'
X$NetBSD$
X
X+++ Makefile Sat Jan 29 15:21:49 2000
X@@ -74,13 +74,12 @@
X #DELHOME = /usr/deliver
X #HDEFS = -DDELHOME=\"$(DELHOME)\"
X UDEFS =
X-OSHEADER = os-dummy.h
X+OSHEADER = os-netbsd.h
X DEFS = -Iconf -DOSINCLUDE=\"$(OSHEADER)\" $(HDEFS) $(UDEFS)
X-CFLAGS = -O $(DEFS)
X-LDFLAGS =
X+CFLAGS += $(DEFS)
X LIBS =
X LINT = lint -x
X-BIN = /usr/bin
X+BIN = ${PREFIX}/bin
X #BIN = $(DELHOME)/bin
X GROUP = root
X
X@@ -154,16 +153,8 @@
X chmod 755 $$d ) || exit 1; \
X done ;; \
X esac
X- rm -f $(BIN)/deliver.O
X- -mv $(BIN)/deliver $(BIN)/deliver.O
X- $(COPY) deliver $(BIN)/deliver
X- chgrp $(GROUP) $(BIN)/deliver
X- chown root $(BIN)/deliver
X- chmod 4711 $(BIN)/deliver
X- rm -f $(BIN)/header.O
X- -mv $(BIN)/header $(BIN)/header.O
X- $(COPY) header $(BIN)/header
X- chmod 755 $(BIN)/header
X+ ${BSD_INSTALL_PROGRAM} -m 0511 deliver ${BIN}
X+ ${BSD_INSTALL_PROGRAM} header ${BIN}
X
X #
X # How to compile and link the program.
END-of-patches/patch-aa
echo x - patches/patch-ab
sed 's/^X//' >patches/patch-ab << 'END-of-patches/patch-ab'
X$NetBSD$
X
X+++ config.h Sat Jan 29 16:52:37 2000
X@@ -62,7 +62,7 @@
X * Define it here, or edit Makefile thus: "UDEFS = -DHAS_NFS".
X */
X
X-/* #define HAS_NFS */
X+#define HAS_NFS
X
X /*----------------------------------------------------------------------
X * Get operating system configuration.
X@@ -122,7 +122,7 @@
X #define UUX_ARGCOUNT 16
X #define UUX_ARGSIZE 512
X #define UUX_OPTS "-r"
X-#define UUX_DASH_A
X+#undef UUX_DASH_A
X
X /*----------------------------------------------------------------------
X * Default shell for executing delivery files and pipes.
X@@ -197,9 +197,9 @@
X #define POST_DELIVER "lib/post"
X #define ERR_DELIVER "lib/err"
X #else
X-#define SYS_DELIVER "/usr/local/lib/deliver.sys"
X-#define POST_DELIVER "/usr/local/lib/deliver.post"
X-#define ERR_DELIVER "/usr/local/lib/deliver.err"
X+#define SYS_DELIVER "@DELIVER_CONF_PREFIX@sys"
X+#define POST_DELIVER "@DELIVER_CONF_PREFIX@post"
X+#define ERR_DELIVER "@DELIVER_CONF_PREFIX@err"
X #endif
X
X #define USER_DELIVER ".deliver"
X@@ -228,8 +228,8 @@
X #define LOG "log/logfile"
X #define ERRLOG "log/errlog"
X #else
X-#define LOG "/usr/adm/deliver.log"
X-#define ERRLOG "/usr/adm/deliver.errlog"
X+#define LOG "/var/log/deliver.log"
X+#define ERRLOG "/var/log/deliver.errlog"
X #endif
X
X #define LOGLOCK "/tmp/dl.loglock"
END-of-patches/patch-ab
echo x - patches/patch-ac
sed 's/^X//' >patches/patch-ac << 'END-of-patches/patch-ac'
X$NetBSD$
X
X+++ misc.h Sat Jan 22 14:50:17 2000
X@@ -86,16 +86,6 @@
X * Declare library functions.
X */
X
X-extern char *ctime();
X-extern char *asctime();
X-extern char *getenv();
X-extern char *getlogin();
X-extern char *mktemp();
X-extern int putenv();
X-extern long lseek();
X-extern long time();
X-extern void exit();
X-
X #ifdef DECLARE_SIGNAL
X extern SIGTYPE(*signal()) ();
X #endif
END-of-patches/patch-ac
echo x - patches/patch-ad
sed 's/^X//' >patches/patch-ad << 'END-of-patches/patch-ad'
X$NetBSD$
X
X+++ unctime.y Sun Jan 30 08:41:53 2000
X@@ -80,6 +80,9 @@
X # define USE_FTIME
X # endif
X #endif
X+#ifdef HAS_MKTIME
X+# define USE_MKTIME
X+#endif
X
X #ifdef USE_GETTOD
X # include <sys/time.h>
X@@ -331,6 +334,7 @@
X /* Is y a leap year? */
X #define leap(y) (((y) % 4 == 0 && (y) % 100 != 0) || (y) % 400 == 0)
X
X+#ifndef USE_MKTIME
X /* Number of leap years from 1970 to y (not including y itself) */
X #define nleap(y) (((y) - 1969) / 4 - ((y) - 1901) / 100 + ((y) - 1601) / 400)
X
X@@ -484,6 +488,7 @@
X }
X
X #endif /* not USE_GETTOD */
X+#endif /* not USE_MKTIME */
X
X static short monthlens[] =
X {
X@@ -563,6 +568,15 @@
X return -1;
X }
X
X+#ifdef USE_MKTIME
X+ tm->tm_year = year - 1900;
X+ tm->tm_mon = month - 1;
X+ tm->tm_mday = day;
X+ tm->tm_hour = hour;
X+ tm->tm_min = minute;
X+ tm->tm_sec = second;
X+ return mktime(tm);
X+#else /* not USE_MKTIME */
X /* Mostly for convenience in sunday() macro, we use zero-origin days. */
X dayofyear = day - 1;
X if (month > 2 && leap(year))
X@@ -581,4 +595,5 @@
X - correction()
X #endif
X ;
X+#endif /* not USE_MKTIME */
X }
END-of-patches/patch-ad
echo x - patches/patch-ae
sed 's/^X//' >patches/patch-ae << 'END-of-patches/patch-ae'
X$NetBSD$
X
X+++ conf/finish-os.h Sat Jan 29 20:43:18 2000
X@@ -87,8 +87,8 @@
X * Validate time configuration.
X */
X
X-#if !defined(HAS_TIMEZONE) && !defined(HAS_GETTOD) && !defined(HAS_FTIME)
X-ACK! "Define either HAS_TIMEZONE, HAS_GETTOD or HAS_FTIME.";
X+#if !defined(HAS_TIMEZONE) && !defined(HAS_GETTOD) && !defined(HAS_MKTIME)
X+ACK! "Define one of HAS_TIMEZONE, HAS_GETTOD or HAS_MKTIME.";
X #endif
X
X /*----------------------------------------------------------------------
X@@ -328,6 +328,10 @@
X #define MBX_GROUP "mail"
X #else
X /* #define MBX_NAME "mbox" */
X+#ifndef MBX_DIR
X #define MBX_DIR "/usr/spool/mail"
X+#endif
X+#ifndef MBX_MODE
X #define MBX_MODE 0600
X+#endif
X #endif
END-of-patches/patch-ae
echo x - patches/patch-af
sed 's/^X//' >patches/patch-af << 'END-of-patches/patch-af'
X$NetBSD$
X
X+++ conf/os-netbsd.h Sat Jan 29 20:47:21 2000
X@@ -0,0 +1,28 @@
X+/* $Id$
X+ *
X+ * Deliver configuration for NetBSD.
X+ *
X+ */
X+
X+/* Mostly it's POSIX. */
X+
X+#include <base-posix.h>
X+
X+/* Then again... */
X+
X+#undef SAFEPATH
X+#define SAFEPATH "/bin:/usr/bin:/usr/pkg/bin" /* Safe dirs for PATH */
X+
X+#undef SYSV_USRMAIL /* Mailboxes in /usr/mail, as per SysV */
X+#define MBX_DIR "/var/mail"
X+
X+#undef HAS_TIMEZONE /* Has global variable timezone (SVID) */
X+#define HAS_MKTIME /* Has mktime() */
X+
X+#define HAS_BASENAME /* Has basename() */
X+#define HAS_LONGNAMES /* Long filenames (>14) supported */
X+
X+/* Note that we don't define HAS_USLEEP, since deliver wants to use it
X+ * for sleeping for more than one second, but the implementation limits
X+ * the sleep time to strictly less than one second.
X+ */
END-of-patches/patch-af
echo x - patches/patch-ag
sed 's/^X//' >patches/patch-ag << 'END-of-patches/patch-ag'
X$NetBSD$
X
X+++ deliver.8 Sat Jan 29 16:42:59 2000
X@@ -98,15 +98,15 @@
X .TP
X .BI \-s " system delivery file"
X Specify an alternate system delivery file. The default is
X-.I /usr/local/lib/deliver.sys.
X+.I @DELIVER_CONF_PREFIX@sys.
X .TP
X .BI \-p " post-user delivery file"
X Specify an alternate post-user delivery file. The default is
X-.I /usr/local/lib/deliver.post.
X+.I @DELIVER_CONF_PREFIX@post.
X .TP
X .BI \-e " error delivery file"
X Specify an alternate error delivery file. The default is
X-.I /usr/local/lib/deliver.err.
X+.I @DELIVER_CONF_PREFIX@err.
X .TP
X .BI \-u " user delivery file"
X Specify an alternate user delivery file. The default is
X@@ -229,7 +229,7 @@
X .TP
X .I "system delivery file"
X The system delivery file, if it exists, is created by the postmaster.
X-By default, it is named ``/usr/local/lib/deliver.sys''. It controls
X+By default, it is named ``@DELIVER_CONF_PREFIX@sys''. It controls
X the delivery of all messages on the system where it is installed. It
X is executed with arguments of the name(s) specified on the
X .I Deliver
X@@ -245,7 +245,7 @@
X .TP
X .I "post-user delivery file"
X The post-user delivery file, if it exists, is created by the
X-postmaster. By default, it is named ``/usr/local/lib/deliver.post''.
X+postmaster. By default, it is named ``@DELIVER_CONF_PREFIX@post''.
X It is executed after the system and user delivery files, but before
X any attempt at message delivery. Its arguments are those addresses
X which are about to receive the message, whether those addresses
X@@ -258,7 +258,7 @@
X .TP
X .I "error delivery file"
X The error delivery file, if it exists, is created by the postmaster.
X-By default, it is named ``/usr/local/lib/deliver.err''. After
X+By default, it is named ``@DELIVER_CONF_PREFIX@err''. After
X .I Deliver
X has attempted delivery to all requested destinations, and if delivery
X to one or more of those destinations failed,
X@@ -467,9 +467,9 @@
X .SH LOGGING
X .I Deliver
X records its activity in two files: the ``delivery log'', named
X-.IR /usr/adm/deliver.log,
X+.IR /var/log/deliver.log,
X and the ``error log'', named
X-.IR /usr/adm/deliver.errlog.
X+.IR /var/log/deliver.errlog.
X .PP
X The deliver log is a record of activity of each
X .I Deliver
X@@ -534,17 +534,17 @@
X Neither, one or both of ML_DOTLOCK and ML_DOTMLK may be specified.
X None or one of ML_LOCKF, ML_FCNTL or ML_LOCKING may be specified.
X .SH FILES
X-/usr/local/lib/deliver.sys system delivery file
X+@DELIVER_CONF_PREFIX@sys system delivery file
X .br
X-/usr/local/lib/deliver.post post-user delivery file
X+@DELIVER_CONF_PREFIX@post post-user delivery file
X .br
X-/usr/local/lib/deliver.err error delivery file
X+@DELIVER_CONF_PREFIX@err error delivery file
X .br
X ~user/.deliver user delivery file(s)
X .br
X-/usr/adm/deliver.log delivery log
X+/var/log/deliver.log delivery log
X .br
X-/usr/adm/deliver.errlog error log
X+/var/log/deliver.errlog error log
X .br
X /etc/systemid system name (Xenix only)
X .SH SUPPORT
END-of-patches/patch-ag
echo c - pkg
mkdir -p pkg > /dev/null 2>&1
echo x - pkg/COMMENT
sed 's/^X//' >pkg/COMMENT << 'END-of-pkg/COMMENT'
XLocal mail delivery agent with shell-script control
END-of-pkg/COMMENT
echo x - pkg/DESCR
sed 's/^X//' >pkg/DESCR << 'END-of-pkg/DESCR'
XDeliver delivers E-Mail on the local system.
X
XDeliver allows any user to write a shell script that processes all
Xincoming mail messages for that user. The system administrator may
Xalso install scripts that process all messages.
X
XThe output of a script is a list of mail addresses, files and programs
Xthat should receive the message. It has access to each message as it
Xis processed, so the action can be content dependent. The script may
Xalso generate automatic replies, like the "vacation" program, or pass
Xalong a modified version of the original message.
X
XDeliver can be used to construct mail-based services (e.g. automatic
Xmailing list maintenance). It can also be used to filter mail
Xautomatically in prearranged ways (e.g. encryption and decryption,
Xtossing junk mail, or vacation notices).
X
XAlthough deliver works best when installed set-user-id root, it can
Xperform many of its functions even when installed in the private bin
Xdirectory of a regular user.
END-of-pkg/DESCR
echo x - pkg/PLIST
sed 's/^X//' >pkg/PLIST << 'END-of-pkg/PLIST'
X@comment $NetBSD$
Xbin/deliver
Xbin/header
Xman/man1/deliver.1
Xman/man1/header.1
Xman/cat1/deliver.0
Xman/cat1/header.0
Xshare/doc/deliver/INSTALL
Xshare/doc/deliver/MMDF
Xshare/doc/deliver/README
Xshare/doc/deliver/SENDMAIL
Xshare/examples/deliver/README
Xshare/examples/deliver/p-aliases
Xshare/examples/deliver/s-aliases
Xshare/examples/deliver/u-chip
Xshare/examples/deliver/u-notify
Xshare/examples/deliver/u-vacation
X@dirrm share/doc/deliver
X@dirrm share/examples/deliver
END-of-pkg/PLIST
exit
>Audit-Trail:
>Unformatted: