summaryrefslogtreecommitdiff
path: root/usr.sbin/sendmail/mailstats
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1996-12-14 21:17:55 +0000
committerJason Downs <downsj@cvs.openbsd.org>1996-12-14 21:17:55 +0000
commit608a01ad15ff5ab89386edfd559332580581c47d (patch)
tree0247c82ab4d95ed523c3f3ecf6cf792a84cb635e /usr.sbin/sendmail/mailstats
parent454743c06055e0f6c7c4532bdc9b81aeab85126c (diff)
Update to Sendmail 8.8.4, plus recent patches, plus OpenBSD support.
Also include entire example configuration subset. Includes smrsh (using /usr/libexec/sm.bin). Of the top of my head, the only things I removed from the distribution were contrib/mail.local.linux, src/Makefiles, all the *.0 and *.ps files. Our praliases man page replaces the distributed one, ours is better.
Diffstat (limited to 'usr.sbin/sendmail/mailstats')
-rw-r--r--usr.sbin/sendmail/mailstats/Makefile5
-rw-r--r--usr.sbin/sendmail/mailstats/Makefile.dist78
-rw-r--r--usr.sbin/sendmail/mailstats/mailstats.c23
3 files changed, 99 insertions, 7 deletions
diff --git a/usr.sbin/sendmail/mailstats/Makefile b/usr.sbin/sendmail/mailstats/Makefile
index d6a04f0bdc1..350cf5a2327 100644
--- a/usr.sbin/sendmail/mailstats/Makefile
+++ b/usr.sbin/sendmail/mailstats/Makefile
@@ -1,8 +1,9 @@
-# @(#)Makefile 8.1 (Berkeley) 6/7/93
+# $OpenBSD: Makefile,v 1.2 1996/12/14 21:16:45 downsj Exp $
+# @(#)Makefile 8.2 (Berkeley) 9/21/96
PROG= mailstats
+MAN= mailstats.8
CFLAGS+=-I${.CURDIR}/../src
-NOMAN= noman
.include "../../Makefile.inc"
.include <bsd.prog.mk>
diff --git a/usr.sbin/sendmail/mailstats/Makefile.dist b/usr.sbin/sendmail/mailstats/Makefile.dist
new file mode 100644
index 00000000000..5bf0f2048d8
--- /dev/null
+++ b/usr.sbin/sendmail/mailstats/Makefile.dist
@@ -0,0 +1,78 @@
+#
+# This Makefile is designed to work on the old "make" program. It does
+# not use the obj subdirectory. It also does not install documentation
+# automatically -- think of it as a quick start for sites that have the
+# old make program (I recommend that you get and port the new make if you
+# are going to be doing any signficant work on sendmail).
+#
+# @(#)Makefile.dist 8.2 (Berkeley) 9/21/96
+#
+
+# use O=-O (usual) or O=-g (debugging)
+O= -O
+
+# location of sendmail source directory
+SRCDIR= ../src
+
+# environment definitions (e.g., -D_AIX3)
+ENVDEF=
+
+# see also conf.h for additional compilation flags
+
+# include directories
+INCDIRS=-I${SRCDIR} -I/usr/sww/include
+
+# loader options
+LDOPTS=
+
+# library directories
+LIBDIRS=-L/usr/sww/lib
+
+# libraries required on your system
+LIBS=
+
+# location of mailstats binary (usually /usr/sbin or /usr/etc)
+BINDIR= ${DESTDIR}/usr/sbin
+
+# additional .o files needed
+OBJADD=
+
+################### end of user configuration flags ######################
+
+CFLAGS= -I. $O ${INCDIRS} ${ENVDEF}
+
+OBJS= mailstats.o ${OBJADD}
+
+LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
+BINOWN= bin
+BINGRP= bin
+BINMODE=555
+
+ALL= mailstats mailstats.0
+
+all: ${ALL}
+
+mailstats: ${BEFORE} ${OBJS}
+ ${CC} -o mailstats ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
+
+#NROFF= nroff -h
+NROFF= groff -Tascii
+MANDOC= -mandoc
+
+mailstats.0: mailstats.8
+ ${NROFF} ${MANDOC} mailstats.8 > mailstats.0
+
+install: install-mailstats install-docs
+
+install-mailstats: mailstats
+ install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} mailstats ${BINDIR}
+
+# doesn't actually install them -- you may want to install pre-nroff versions
+install-docs: mailstats.0
+
+clean:
+ rm -f ${OBJS} mailstats mailstats.0
+
+# dependencies
+# gross overkill, and yet still not quite enough....
+${OBJS}: ${SRCDIR}/sendmail.h ${SRCDIR}/mailstats.h ${SRCDIR}/conf.h
diff --git a/usr.sbin/sendmail/mailstats/mailstats.c b/usr.sbin/sendmail/mailstats/mailstats.c
index 97ec33be7e9..83082bacb75 100644
--- a/usr.sbin/sendmail/mailstats/mailstats.c
+++ b/usr.sbin/sendmail/mailstats/mailstats.c
@@ -40,9 +40,10 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)mailstats.c 8.4 (Berkeley) 8/14/94";
+static char sccsid[] = "@(#)mailstats.c 8.8 (Berkeley) 9/25/96";
#endif /* not lint */
+#define NOT_SENDMAIL
#include <sendmail.h>
#include <mailstats.h>
#include <pathnames.h>
@@ -91,7 +92,8 @@ main(argc, argv)
case '?':
default:
usage:
- fputs("usage: mailstats [-C cffile] [-f stfile]\n", stderr);
+ fputs("usage: mailstats [-C cffile] [-f stfile] -o\n",
+ stderr);
exit(EX_USAGE);
}
}
@@ -189,13 +191,24 @@ main(argc, argv)
exit (EX_OSFILE);
}
- if ((fd = open(sfile, O_RDONLY)) < 0) {
+ if ((fd = open(sfile, O_RDONLY)) < 0 ||
+ (i = read(fd, &stat, sizeof stat)) < 0)
+ {
fputs("mailstats: ", stderr);
perror(sfile);
exit(EX_NOINPUT);
}
- if (read(fd, &stat, sizeof(stat)) != sizeof(stat) ||
- stat.stat_size != sizeof(stat))
+ if (i == 0)
+ {
+ sleep(1);
+ i = read(fd, &stat, sizeof stat);
+ if (i == 0)
+ {
+ bzero((ARBPTR_T) &stat, sizeof stat);
+ (void) time(&stat.stat_itime);
+ }
+ }
+ else if (i != sizeof stat || stat.stat_size != sizeof(stat))
{
fputs("mailstats: file size changed.\n", stderr);
exit(EX_OSERR);