summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/mailstats
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2002-06-11 21:12:04 +0000
committergshapiro <gshapiro@FreeBSD.org>2002-06-11 21:12:04 +0000
commitfaacdfb2c2946459651449cedf08a1bc29aee731 (patch)
tree546131e3b171104de8ab1498603b992a6971ec6a /contrib/sendmail/mailstats
parente226f8e879ed5a8d2f5cc433067b698e07dce0b6 (diff)
downloadFreeBSD-src-faacdfb2c2946459651449cedf08a1bc29aee731.zip
FreeBSD-src-faacdfb2c2946459651449cedf08a1bc29aee731.tar.gz
Import sendmail 8.12.4
Diffstat (limited to 'contrib/sendmail/mailstats')
-rw-r--r--contrib/sendmail/mailstats/Makefile2
-rw-r--r--contrib/sendmail/mailstats/mailstats.811
-rw-r--r--contrib/sendmail/mailstats/mailstats.c31
3 files changed, 25 insertions, 19 deletions
diff --git a/contrib/sendmail/mailstats/Makefile b/contrib/sendmail/mailstats/Makefile
index 045394d..6dbcb62 100644
--- a/contrib/sendmail/mailstats/Makefile
+++ b/contrib/sendmail/mailstats/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.1.1.1 2000/08/12 21:55:31 gshapiro Exp $
+# $Id: Makefile,v 8.5 1999/09/23 22:36:36 ca Exp $
SHELL= /bin/sh
BUILD= ./Build
diff --git a/contrib/sendmail/mailstats/mailstats.8 b/contrib/sendmail/mailstats/mailstats.8
index c69dc2e..929875b 100644
--- a/contrib/sendmail/mailstats/mailstats.8
+++ b/contrib/sendmail/mailstats/mailstats.8
@@ -6,15 +6,15 @@
.\" the sendmail distribution.
.\"
.\"
-.\" $Id: mailstats.8,v 1.1.1.7 2002/04/10 03:04:54 gshapiro Exp $
+.\" $Id: mailstats.8,v 8.30 2002/04/12 00:42:33 ca Exp $
.\"
-.TH MAILSTATS 8 "$Date: 2002/04/10 03:04:54 $"
+.TH MAILSTATS 8 "$Date: 2002/04/12 00:42:33 $"
.SH NAME
mailstats
\- display mail statistics
.SH SYNOPSIS
.B mailstats
-.RB [ \-o "] [" \-p "] [" \-P ]
+.RB [ \-c "] [" \-o "] [" \-p "] [" \-P ]
.RB [ \-C
.IR cffile ]
.RB [ \-f
@@ -74,6 +74,11 @@ Read the specified file instead of the default
.B sendmail
configuration file.
.TP
+.B \-c
+Try to use submit.cf instead of the default
+.B sendmail
+configuration file.
+.TP
.B \-f
Read the specified statistics file instead of the statistics file
specified in the
diff --git a/contrib/sendmail/mailstats/mailstats.c b/contrib/sendmail/mailstats/mailstats.c
index 2f8e505..ec56e3a 100644
--- a/contrib/sendmail/mailstats/mailstats.c
+++ b/contrib/sendmail/mailstats/mailstats.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -20,7 +20,7 @@ SM_IDSTR(copyright,
Copyright (c) 1988, 1993\n\
The Regents of the University of California. All rights reserved.\n")
-SM_IDSTR(id, "@(#)$Id: mailstats.c,v 1.1.1.8 2002/02/17 21:56:43 gshapiro Exp $")
+SM_IDSTR(id, "@(#)$Id: mailstats.c,v 8.98 2002/05/24 23:10:15 gshapiro Exp $")
#include <unistd.h>
#include <stddef.h>
@@ -64,7 +64,7 @@ main(argc, argv)
#endif /* _FFR_QUARANTINE */
time_t now;
char mtable[MAXMAILERS][MNAMELEN + 1];
- char sfilebuf[MAXLINE];
+ char sfilebuf[MAXPATHLEN];
char buf[MAXLINE];
struct statistics stats;
extern char *ctime();
@@ -108,7 +108,7 @@ main(argc, argv)
default:
usage:
(void) sm_io_fputs(smioerr, SM_TIME_DEFAULT,
- "usage: mailstats [-C cffile] [-P] [-f stfile] [-o] [-p]\n");
+ "usage: mailstats [-C cffile] [-c] [-P] [-f stfile] [-o] [-p]\n");
exit(EX_USAGE);
}
}
@@ -139,6 +139,15 @@ main(argc, argv)
char *s;
register char *m;
+ b = strchr(buf, '#');
+ if (b == NULL)
+ b = strchr(buf, '\n');
+ if (b == NULL)
+ b = &buf[strlen(buf)];
+ while (isascii(*--b) && isspace(*b))
+ continue;
+ *++b = '\0';
+
b = buf;
switch (*b++)
{
@@ -171,14 +180,6 @@ main(argc, argv)
b);
exit(EX_CONFIG);
}
- b = strchr(sfilebuf, '#');
- if (b == NULL)
- b = strchr(sfilebuf, '\n');
- if (b == NULL)
- b = &sfilebuf[strlen(sfilebuf)];
- while (isascii(*--b) && isspace(*b))
- continue;
- *++b = '\0';
if (sfile == NULL)
sfile = sfilebuf;
@@ -215,10 +216,10 @@ main(argc, argv)
{
(void) sm_io_fprintf(smioerr, SM_TIME_DEFAULT,
"mailstats: no statistics file located\n");
- exit (EX_OSFILE);
+ exit(EX_OSFILE);
}
- fd = open(sfile, O_RDONLY);
+ fd = open(sfile, O_RDONLY, 0600);
if ((fd < 0) || (i = read(fd, &stats, sizeof stats)) < 0)
{
save_errno = errno;
@@ -350,7 +351,7 @@ main(argc, argv)
(void) close(fd);
if (trunc)
{
- fd = open(sfile, O_RDWR | O_TRUNC);
+ fd = open(sfile, O_RDWR | O_TRUNC, 0600);
if (fd >= 0)
(void) close(fd);
}
OpenPOWER on IntegriCloud