summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/sendmail')
-rw-r--r--contrib/sendmail/cf/m4/cfhead.m49
-rw-r--r--contrib/sendmail/cf/ostype/bsd4.4.m47
-rw-r--r--contrib/sendmail/cf/sh/makeinfo.sh4
-rw-r--r--contrib/sendmail/contrib/bitdomain.c2
-rw-r--r--contrib/sendmail/mail.local/mail.local.815
-rw-r--r--contrib/sendmail/mail.local/mail.local.c179
-rw-r--r--contrib/sendmail/mailstats/mailstats.c60
-rw-r--r--contrib/sendmail/makemap/makemap.c87
-rw-r--r--contrib/sendmail/praliases/praliases.c239
-rw-r--r--contrib/sendmail/rmail/rmail.c14
-rw-r--r--contrib/sendmail/smrsh/smrsh.817
-rw-r--r--contrib/sendmail/smrsh/smrsh.c12
-rw-r--r--contrib/sendmail/src/aliases.56
-rw-r--r--contrib/sendmail/src/conf.c267
-rw-r--r--contrib/sendmail/src/conf.h90
-rw-r--r--contrib/sendmail/src/err.c4
-rw-r--r--contrib/sendmail/src/headers.c127
-rw-r--r--contrib/sendmail/src/mailq.114
-rw-r--r--contrib/sendmail/src/mci.c16
-rw-r--r--contrib/sendmail/src/savemail.c11
-rw-r--r--contrib/sendmail/src/sendmail.815
21 files changed, 342 insertions, 853 deletions
diff --git a/contrib/sendmail/cf/m4/cfhead.m4 b/contrib/sendmail/cf/m4/cfhead.m4
index 9a5ccd2..d5778e8 100644
--- a/contrib/sendmail/cf/m4/cfhead.m4
+++ b/contrib/sendmail/cf/m4/cfhead.m4
@@ -105,7 +105,7 @@ define(`_OPTINS', `ifdef(`$1', `$2$1$3')')
m4wrap(`include(_CF_DIR_`m4/proto.m4')')
# set up default values for options
-define(`ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/aliases', `/etc/aliases'))
+define(`ALIAS_FILE', `/etc/aliases')
define(`confMAILER_NAME', ``MAILER-DAEMON'')
define(`confFROM_LINE', `From $g $d')
define(`confOPERATORS', `.:%@!^/[]+')
@@ -113,7 +113,8 @@ define(`confSMTP_LOGIN_MSG', `$j Sendmail $v/$Z; $b')
define(`confRECEIVED_HEADER', `$?sfrom $s $.$?_($?s$|from $.$_)
$.by $j ($v/$Z)$?r with $r$. id $i$?u
for $u; $|;
- $.$b')
+ $.$b$?g
+ (envelope-from $g)$.')')
define(`confSEVEN_BIT_INPUT', `False')
define(`confEIGHT_BIT_HANDLING', `pass8')
define(`confALIAS_WAIT', `10')
@@ -133,10 +134,10 @@ define(`confSAFE_QUEUE', `True')
define(`confTO_QUEUERETURN', `5d')
define(`confTO_QUEUEWARN', `4h')
define(`confTIME_ZONE', `USE_SYSTEM')
-define(`confCW_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/local-host-names', `/etc/sendmail.cw'))
+define(`confCW_FILE', `/etc/sendmail.cw')
define(`confMIME_FORMAT_ERRORS', `True')
define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward')
define(`confCR_FILE', `-o /etc/mail/relay-domains')
divert(0)dnl
-VERSIONID(`@(#)cfhead.m4 8.23 (Berkeley) 10/6/1998')
+VERSIONID(`@(#)cfhead.m4 8.22 (Berkeley) 5/19/98')
diff --git a/contrib/sendmail/cf/ostype/bsd4.4.m4 b/contrib/sendmail/cf/ostype/bsd4.4.m4
index 514bce8..711610c 100644
--- a/contrib/sendmail/cf/ostype/bsd4.4.m4
+++ b/contrib/sendmail/cf/ostype/bsd4.4.m4
@@ -13,8 +13,9 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)bsd4.4.m4 8.10 (Berkeley) 10/6/1998')
-ifdef(`HELP_FILE',, `define(`HELP_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/helpfile', `/usr/share/misc/sendmail.hf'))')dnl
-ifdef(`STATUS_FILE',, `define(`STATUS_FILE', ifdef(`_USE_ETC_MAIL_', `/etc/mail/statistics', `/var/log/sendmail.st'))')dnl
+VERSIONID(`@(#)bsd4.4.m4 8.9 (Berkeley) 5/19/98')
+ifdef(`HELP_FILE',, `define(`HELP_FILE', /usr/share/misc/sendmail.hf)')dnl
+ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /var/log/sendmail.st)')dnl
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /usr/libexec/mail.local)')dnl
+ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail $u')')dnl
ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -z -a$g $h!rmail ($u)')')dnl
diff --git a/contrib/sendmail/cf/sh/makeinfo.sh b/contrib/sendmail/cf/sh/makeinfo.sh
index c8621f4..0cbb335 100644
--- a/contrib/sendmail/cf/sh/makeinfo.sh
+++ b/contrib/sendmail/cf/sh/makeinfo.sh
@@ -10,7 +10,7 @@
# the sendmail distribution.
#
#
-# @(#)makeinfo.sh 8.11 (Berkeley) 5/19/1998
+# @(#)makeinfo.sh 8.11 (Berkeley) 5/19/98
#
usewhoami=0
@@ -51,7 +51,7 @@ then
else
host=`uname -n`
fi
-echo '#####' built by $user@$host on `date`
+echo '#####' built by $user@$host on `LC_TIME=C date`
echo '#####' in `pwd` | sed 's/\/tmp_mnt//'
echo '#####' using $1 as configuration include directory | sed 's/\/tmp_mnt//'
echo "define(\`__HOST__', $host)dnl"
diff --git a/contrib/sendmail/contrib/bitdomain.c b/contrib/sendmail/contrib/bitdomain.c
index 52d6d21..ec79b95 100644
--- a/contrib/sendmail/contrib/bitdomain.c
+++ b/contrib/sendmail/contrib/bitdomain.c
@@ -51,7 +51,7 @@ char **argv;
{
int opt;
- while ((opt = getopt(argc, argv, "o:")) != EOF) {
+ while ((opt = getopt(argc, argv, "o:")) != -1) {
switch (opt) {
case 'o':
if (!freopen(optarg, "w", stdout)) {
diff --git a/contrib/sendmail/mail.local/mail.local.8 b/contrib/sendmail/mail.local/mail.local.8
index 05f11ed..7aa7cdb 100644
--- a/contrib/sendmail/mail.local/mail.local.8
+++ b/contrib/sendmail/mail.local/mail.local.8
@@ -7,7 +7,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)mail.local.8 8.7 (Berkeley) 5/19/1998
+.\" @(#)mail.local.8 8.7 (Berkeley) 5/19/98
.\"
.Dd May 19, 1998
.Dt MAIL.LOCAL 8
@@ -18,6 +18,8 @@
.Sh SYNOPSIS
.Nm mail.local
.Op Fl f Ar from
+.Op Fl b
+.Op Fl s
.Ar user ...
.Sh DESCRIPTION
.Nm Mail.local
@@ -33,6 +35,16 @@ The options are as follows:
.Bl -tag -width xxxfrom
.It Fl f Ar from
Specify the sender's name.
+.It Fl b
+Turn off the attempts to notify the
+.Dq biff
+service.
+.It Fl s
+Turn off the
+.Xr fsync 2
+call that forces the mailbox to be committed to disk before returning a
+.Dq success
+status.
.El
.Pp
Individual mail messages in the mailbox are delimited by an empty
@@ -77,7 +89,6 @@ lock file for a user's mailbox
.El
.Sh SEE ALSO
.Xr mail 1 ,
-.Xr xsend 1 ,
.Xr flock 2 ,
.Xr getservbyname 3 ,
.Xr comsat 8 ,
diff --git a/contrib/sendmail/mail.local/mail.local.c b/contrib/sendmail/mail.local/mail.local.c
index abe1a19..2a3b072 100644
--- a/contrib/sendmail/mail.local/mail.local.c
+++ b/contrib/sendmail/mail.local/mail.local.c
@@ -1,4 +1,4 @@
-/*
+/*-
* Copyright (c) 1998 Sendmail, Inc. All rights reserved.
* Copyright (c) 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
@@ -16,7 +16,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)mail.local.c 8.83 (Berkeley) 12/17/1998";
+static char sccsid[] = "@(#)mail.local.c 8.78 (Berkeley) 5/19/98";
#endif /* not lint */
/*
@@ -102,7 +102,7 @@ static char sccsid[] = "@(#)mail.local.c 8.83 (Berkeley) 12/17/1998";
# define USE_VSYSLOG 0
#endif
-#if defined(NeXT) && !defined(__APPLE__)
+#if defined(NeXT)
# include <libc.h>
# define _PATH_MAILDIR "/usr/spool/mail"
# define __dead /* empty */
@@ -216,23 +216,22 @@ extern char *strerror __P((int));
# define S_ISREG(mode) (((mode) & _S_IFMT) == S_IFREG)
#endif
-#ifndef MAILER_DAEMON
-# define MAILER_DAEMON "MAILER-DAEMON"
-#endif
-
int eval = EX_OK; /* sysexits.h error value. */
int lmtpmode = 0;
u_char tTdvect[100];
-void deliver __P((int, char *));
+void deliver __P((int, char *, int, int));
void e_to_sys __P((int));
+void err __P((const char *, ...)) __dead2;
void notifybiff __P((char *));
int store __P((char *, int));
void usage __P((void));
void vwarn __P((const char *, _BSD_VA_LIST_));
+void warn __P((const char *, ...));
void lockmbox __P((char *));
void unlockmbox __P((void));
void mailerr __P((const char *, const char *, ...));
+void dolmtp __P((int, int));
int
main(argc, argv)
@@ -240,12 +239,11 @@ main(argc, argv)
char *argv[];
{
struct passwd *pw;
- int ch, fd;
+ int ch, fd, nobiff, nofsync;
uid_t uid;
char *from;
extern char *optarg;
extern int optind;
- extern void dolmtp __P((void));
/* make sure we have some open file descriptors */
for (fd = 10; fd < 30; fd++)
@@ -261,14 +259,19 @@ main(argc, argv)
#endif
from = NULL;
- while ((ch = getopt(argc, argv, "df:r:l")) != EOF)
+ nobiff = 0;
+ nofsync = 0;
+ while ((ch = getopt(argc, argv, "bdf:r:ls")) != -1)
switch(ch) {
+ case 'b':
+ nobiff++;
+ break;
case 'd': /* Backward compatible. */
break;
case 'f':
case 'r': /* Backward compatible. */
if (from != NULL) {
- mailerr(NULL, "multiple -f options");
+ warn("multiple -f options");
usage();
}
from = optarg;
@@ -276,6 +279,9 @@ main(argc, argv)
case 'l':
lmtpmode++;
break;
+ case 's':
+ nofsync++;
+ break;
case '?':
default:
usage();
@@ -284,7 +290,7 @@ main(argc, argv)
argv += optind;
if (lmtpmode)
- dolmtp();
+ dolmtp(nobiff, nofsync);
if (!*argv)
usage();
@@ -309,7 +315,7 @@ main(argc, argv)
* at the expense of repeated failures and multiple deliveries.
*/
for (fd = store(from, 0); *argv; ++argv)
- deliver(fd, *argv);
+ deliver(fd, *argv, nobiff, nofsync);
exit(eval);
}
@@ -338,7 +344,7 @@ parseaddr(s)
return NULL;
} else {
while ((isascii(*p) && isalnum(*p)) ||
- strchr(".-_", *p))
+ *p == '.' || *p == '-')
p++;
}
if (*p == ',' && p[1] == '@')
@@ -349,8 +355,6 @@ parseaddr(s)
return NULL;
}
- s = p;
-
/* local-part */
if (*p == '\"') {
p++;
@@ -390,7 +394,7 @@ parseaddr(s)
return NULL;
} else {
while ((isascii(*p) && isalnum(*p)) ||
- strchr(".-_", *p))
+ *p == '.' || *p == '-')
p++;
}
}
@@ -400,11 +404,6 @@ parseaddr(s)
if (*p && *p != ' ')
return NULL;
len = p - s - 1;
- if (*s == '\0' || len <= 0)
- {
- s = MAILER_DAEMON;
- len = strlen(s);
- }
p = malloc(len + 1);
if (p == NULL) {
@@ -432,7 +431,8 @@ process_recipient(addr)
#define RCPT_GROW 30
void
-dolmtp()
+dolmtp(nobiff, nofsync)
+ int nobiff, nofsync;
{
char *return_path = NULL;
char **rcpt_addr = NULL;
@@ -476,7 +476,8 @@ dolmtp()
p = strchr(rcpt_addr[i], '+');
if (p != NULL)
*p++ = '\0';
- deliver(msgfd, rcpt_addr[i]);
+ deliver(msgfd, rcpt_addr[i], nobiff,
+ nofsync);
}
close(msgfd);
goto rset;
@@ -590,7 +591,7 @@ store(from, lmtprcpts)
char *from;
int lmtprcpts;
{
- FILE *fp = NULL;
+ FILE *fp;
time_t tval;
int fd, eline;
char line[2048];
@@ -602,8 +603,8 @@ store(from, lmtprcpts)
printf("451 4.3.0 unable to open temporary file\r\n");
return -1;
} else {
- mailerr("451 4.3.0", "unable to open temporary file");
- exit(eval);
+ e_to_sys(errno);
+ err("unable to open temporary file");
}
}
(void)unlink(tmpbuf);
@@ -618,21 +619,13 @@ store(from, lmtprcpts)
line[0] = '\0';
for (eline = 1; fgets(line, sizeof(line), stdin);) {
- size_t line_len = strlen(line);
-
- if (line_len >= 2 &&
- line[line_len - 2] == '\r' &&
- line[line_len - 1] == '\n') {
- strcpy(line + line_len - 2, "\n");
+ if (line[strlen(line)-2] == '\r') {
+ strcpy(line+strlen(line)-2, "\n");
}
if (lmtprcpts && line[0] == '.') {
- char *src = line + 1, *dest = line;
-
if (line[1] == '\n')
goto lmtpdot;
- while (*src != '\0')
- *dest++ = *src++;
- *dest = '\0';
+ strcpy(line, line+1);
}
if (line[0] == '\n')
eline = 1;
@@ -651,10 +644,8 @@ store(from, lmtprcpts)
fclose(fp);
return -1;
} else {
- mailerr("451 4.3.0",
- "temporary file write error");
- fclose(fp);
- exit(eval);
+ e_to_sys(errno);
+ err("temporary file write error");
}
}
}
@@ -681,18 +672,18 @@ store(from, lmtprcpts)
fclose(fp);
return -1;
} else {
- mailerr("451 4.3.0", "temporary file write error");
- fclose(fp);
- exit(eval);
+ e_to_sys(errno);
+ err("temporary file write error");
}
}
return (fd);
}
void
-deliver(fd, name)
+deliver(fd, name, nobiff, nofsync)
int fd;
char *name;
+ int nobiff, nofsync;
{
struct stat fsb, sb;
struct passwd *pw;
@@ -717,13 +708,7 @@ deliver(fd, name)
}
}
else {
- char *errcode = NULL;
-
- if (eval == EX_TEMPFAIL)
- errcode = "451 4.3.0";
- else
- errcode = "550 5.1.1";
- mailerr(errcode, "unknown name: %s", name);
+ warn("unknown name: %s", name);
}
return;
}
@@ -778,8 +763,7 @@ tryagain:
if (lstat(path, &sb) < 0)
{
eval = EX_CANTCREAT;
- mailerr("550 5.2.0",
- "%s: lstat: file changed after open", path);
+ warn("%s: lstat: file changed after open", path);
goto err1;
}
else
@@ -818,8 +802,7 @@ tryagain:
#endif
sb.st_uid != fsb.st_uid) {
eval = EX_TEMPFAIL;
- mailerr("550 5.2.0", "%s: fstat: file changed after open",
- path);
+ warn("%s: fstat: file changed after open", path);
goto err1;
}
@@ -829,14 +812,16 @@ tryagain:
goto err1;
}
- /* Get the starting offset of the new message for biff. */
- curoff = lseek(mbfd, (off_t)0, SEEK_END);
- if (sizeof curoff > sizeof(long))
- (void)snprintf(biffmsg, sizeof(biffmsg), "%s@%s\n",
- name, quad_to_string(curoff));
- else
- (void)snprintf(biffmsg, sizeof(biffmsg), "%s@%ld\n",
- name, curoff);
+ if (!nobiff) {
+ /* Get the starting offset of the new message for biff. */
+ curoff = lseek(mbfd, (off_t)0, SEEK_END);
+ if (sizeof curoff > sizeof(long))
+ (void)snprintf(biffmsg, sizeof(biffmsg), "%s@%s\n",
+ name, quad_to_string(curoff));
+ else
+ (void)snprintf(biffmsg, sizeof(biffmsg), "%s@%ld\n",
+ name, curoff);
+ }
/* Copy the message into the file. */
if (lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) {
@@ -866,16 +851,13 @@ tryagain:
}
/* Flush to disk, don't wait for update. */
- if (fsync(mbfd)) {
+ if (!nofsync && fsync(mbfd)) {
mailerr("450 4.2.0", "%s: %s", path, strerror(errno));
err3:
if (setreuid(0, 0) < 0) {
-#if 0
- /* already printed an error above for this recipient */
e_to_sys(errno);
mailerr("450 4.2.0", "setreuid(0, 0): %s",
strerror(errno));
-#endif
}
#ifdef DEBUG
printf("reset euid = %d\n", geteuid());
@@ -890,7 +872,7 @@ err0: unlockmbox();
if (close(mbfd)) {
mailerr("450 4.2.0", "%s: %s", path, strerror(errno));
truncate(path, curoff);
- } else
+ } else if (!nobiff)
notifybiff(biffmsg);
if (setreuid(0, 0) < 0) {
@@ -978,6 +960,7 @@ notifybiff(msg)
if ((sp = getservbyname("biff", "udp")) == NULL)
return;
if ((hp = gethostbyname("localhost")) == NULL) {
+ warn("localhost: %s", strerror(errno));
return;
}
addr.sin_family = hp->h_addrtype;
@@ -985,18 +968,20 @@ notifybiff(msg)
addr.sin_port = sp->s_port;
}
if (f < 0 && (f = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
+ warn("socket: %s", strerror(errno));
return;
}
len = strlen(msg) + 1;
- (void) sendto(f, msg, len, 0, (struct sockaddr *)&addr, sizeof(addr));
+ if (sendto(f, msg, len, 0, (struct sockaddr *)&addr, sizeof(addr))
+ != len)
+ warn("sendto biff: %s", strerror(errno));
}
void
usage()
{
eval = EX_USAGE;
- mailerr(NULL, "usage: mail.local [-l] [-f from] user ...");
- exit(eval);
+ err("usage: mail.local [-b] [-l] [-f from] [-s] user ...");
}
void
@@ -1018,8 +1003,7 @@ mailerr(hdr, fmt, va_alist)
#endif
if (lmtpmode)
{
- if (hdr != NULL)
- printf("%s ", hdr);
+ printf("%s ", hdr);
vprintf(fmt, ap);
printf("\r\n");
}
@@ -1030,6 +1014,49 @@ mailerr(hdr, fmt, va_alist)
}
}
+#ifdef __STDC__
+void
+err(const char *fmt, ...)
+#else
+void
+err(fmt, va_alist)
+ const char *fmt;
+ va_dcl
+#endif
+{
+ va_list ap;
+
+#ifdef __STDC__
+ va_start(ap, fmt);
+#else
+ va_start(ap);
+#endif
+ vwarn(fmt, ap);
+ va_end(ap);
+
+ exit(eval);
+}
+
+void
+#ifdef __STDC__
+warn(const char *fmt, ...)
+#else
+warn(fmt, va_alist)
+ const char *fmt;
+ va_dcl
+#endif
+{
+ va_list ap;
+
+#ifdef __STDC__
+ va_start(ap, fmt);
+#else
+ va_start(ap);
+#endif
+ vwarn(fmt, ap);
+ va_end(ap);
+}
+
void
vwarn(fmt, ap)
const char *fmt;
diff --git a/contrib/sendmail/mailstats/mailstats.c b/contrib/sendmail/mailstats/mailstats.c
index 5df3b95..2ad489f 100644
--- a/contrib/sendmail/mailstats/mailstats.c
+++ b/contrib/sendmail/mailstats/mailstats.c
@@ -18,7 +18,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)mailstats.c 8.28 (Berkeley) 9/14/1998";
+static char sccsid[] = "@(#)mailstats.c 8.26 (Berkeley) 7/2/98";
#endif /* not lint */
#ifndef NOT_SENDMAIL
@@ -45,20 +45,17 @@ main(argc, argv)
char *cfile;
FILE *cfp;
bool mnames;
- bool progmode;
long frmsgs = 0, frbytes = 0, tomsgs = 0, tobytes = 0, rejmsgs = 0;
long dismsgs = 0;
char mtable[MAXMAILERS][MNAMELEN+1];
char sfilebuf[MAXLINE];
char buf[MAXLINE];
- time_t now;
extern char *ctime();
cfile = _PATH_SENDMAILCF;
sfile = NULL;
mnames = TRUE;
- progmode = FALSE;
- while ((ch = getopt(argc, argv, "C:f:op")) != EOF)
+ while ((ch = getopt(argc, argv, "C:f:o")) != -1)
{
switch (ch)
{
@@ -74,22 +71,11 @@ main(argc, argv)
mnames = FALSE;
break;
-#if _FFR_MAILSTATS_PROGMODE
- case 'p':
- progmode = TRUE;
- break;
-#endif
-
case '?':
default:
usage:
-#if _FFR_MAILSTATS_PROGMODE
- fputs("usage: mailstats [-C cffile] [-f stfile] -o -p\n",
- stderr);
-#else
- fputs("usage: mailstats [-C cffile] [-f stfile] -o \n",
+ fputs("usage: mailstats [-o] [-C cffile] [-f stfile]\n",
stderr);
-#endif
exit(EX_USAGE);
}
}
@@ -240,29 +226,15 @@ main(argc, argv)
}
}
- if (progmode)
- {
- time(&now);
- printf("%ld %ld\n", (long) stat.stat_itime, (long) now);
- }
- else
- {
- printf("Statistics from %s", ctime(&stat.stat_itime));
- printf(" M msgsfr bytes_from msgsto bytes_to msgsrej msgsdis%s\n",
- mnames ? " Mailer" : "");
- }
+ printf("Statistics from %s", ctime(&stat.stat_itime));
+ printf(" M msgsfr bytes_from msgsto bytes_to msgsrej msgsdis%s\n",
+ mnames ? " Mailer" : "");
for (i = 0; i < MAXMAILERS; i++)
{
if (stat.stat_nf[i] || stat.stat_nt[i] ||
stat.stat_nr[i] || stat.stat_nd[i])
{
- char *format;
-
- if (progmode)
- format = "%2d %8ld %10ld %8ld %10ld %6ld %6ld";
- else
- format = "%2d %8ld %10ldK %8ld %10ldK %6ld %6ld";
- printf(format, i,
+ printf("%2d %8ld %10ldK %8ld %10ldK %6ld %6ld", i,
stat.stat_nf[i], stat.stat_bf[i],
stat.stat_nt[i], stat.stat_bt[i],
stat.stat_nr[i], stat.stat_nd[i]);
@@ -277,20 +249,8 @@ main(argc, argv)
dismsgs += stat.stat_nd[i];
}
}
- if (progmode)
- {
- printf(" T %8ld %10ld %8ld %10ld %6ld %6ld\n",
- frmsgs, frbytes, tomsgs, tobytes, rejmsgs, dismsgs);
- close(fd);
- fd = open(sfile, O_RDWR | O_TRUNC);
- if (fd > 0)
- close(fd);
- }
- else
- {
- printf("=============================================================\n");
- printf(" T %8ld %10ldK %8ld %10ldK %6ld %6ld\n",
- frmsgs, frbytes, tomsgs, tobytes, rejmsgs, dismsgs);
- }
+ printf("=============================================================\n");
+ printf(" T %8ld %10ldK %8ld %10ldK %6ld %6ld\n",
+ frmsgs, frbytes, tomsgs, tobytes, rejmsgs, dismsgs);
exit(EX_OK);
}
diff --git a/contrib/sendmail/makemap/makemap.c b/contrib/sendmail/makemap/makemap.c
index aaaba32..5891d75 100644
--- a/contrib/sendmail/makemap/makemap.c
+++ b/contrib/sendmail/makemap/makemap.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)makemap.c 8.71 (Berkeley) 11/29/1998";
+static char sccsid[] = "@(#)makemap.c 8.62 (Berkeley) 6/24/98";
#endif /* not lint */
#include <sys/types.h>
@@ -57,10 +57,10 @@ uid_t RunAsUid;
uid_t RunAsGid;
char *RunAsUserName;
int Verbose = 2;
-bool DontInitGroups = FALSE;
+bool DontInitGroups = TRUE;
long DontBlameSendmail = DBS_SAFE;
u_char tTdvect[100];
-uid_t TrustedUid = 0;
+uid_t TrustedFileUid = 0;
#define BUFSIZE 1024
@@ -79,20 +79,16 @@ main(argc, argv)
bool foldcase = TRUE;
int exitstat;
int opt;
- char *typename = NULL;
- char *mapname = NULL;
- char *ext = NULL;
+ char *typename;
+ char *mapname;
+ char *ext;
int lineno;
int st;
int mode;
- int putflags = 0;
-#ifdef NEWDB
+ int putflags;
long dbcachesize = 1024 * 1024;
-#endif
enum type type;
-#if !O_EXLOCK
int fd;
-#endif
int sff = SFF_ROOTOK|SFF_REGONLY;
struct passwd *pw;
union
@@ -120,7 +116,7 @@ main(argc, argv)
#ifdef NDBM
char pbuf[MAXNAME];
#endif
-#if _FFR_TRUSTED_USER
+#if _FFR_TRUSTED_FILE_OWNER
FILE *cfp;
char buf[MAXLINE];
#endif
@@ -149,11 +145,11 @@ main(argc, argv)
RunAsUserName = RealUserName = rnamebuf;
#if _FFR_NEW_MAKEMAP_FLAGS
-#define OPTIONS "C:Nc:dflorsv"
+#define OPTIONS "C:Nc:dforsv"
#else
#define OPTIONS "C:Ndforsv"
#endif
- while ((opt = getopt(argc, argv, OPTIONS)) != EOF)
+ while ((opt = getopt(argc, argv, OPTIONS)) != -1)
{
switch (opt)
{
@@ -167,9 +163,7 @@ main(argc, argv)
#if _FFR_NEW_MAKEMAP_FLAGS
case 'c':
-# ifdef NEWDB
dbcachesize = atol(optarg);
-# endif
break;
#endif
@@ -181,19 +175,6 @@ main(argc, argv)
foldcase = FALSE;
break;
-#if _FFR_NEW_MAKEMAP_FLAGS
- case 'l':
-# ifdef NDBM
- printf("dbm\n");
-# endif
-# ifdef NEWDB
- printf("hash\n");
- printf("btree\n");
-# endif
- exit(EX_OK);
- break;
-#endif
-
case 'o':
notrunc = TRUE;
break;
@@ -251,7 +232,7 @@ main(argc, argv)
type = T_UNKNOWN;
}
-#if _FFR_TRUSTED_USER
+#if _FFR_TRUSTED_FILE_OWNER
if ((cfp = fopen(cfile, "r")) == NULL)
{
fprintf(stderr, "mailstats: ");
@@ -269,8 +250,8 @@ main(argc, argv)
switch (*b++)
{
case 'O': /* option */
- if (strncasecmp(b, " TrustedUser", 12) == 0 &&
- !(isascii(b[12]) && isalnum(b[12])))
+ if (strncasecmp(b, " TrustedFileOwner", 17) == 0 &&
+ !(isascii(b[17]) && isalnum(b[17])))
{
b = strchr(b, '=');
if (b == NULL)
@@ -278,26 +259,26 @@ main(argc, argv)
while (isascii(*++b) && isspace(*b))
continue;
if (isascii(*b) && isdigit(*b))
- TrustedUid = atoi(b);
+ TrustedFileUid = atoi(b);
else
{
register struct passwd *pw;
- TrustedUid = 0;
+ TrustedFileUid = 0;
pw = getpwnam(b);
if (pw == NULL)
fprintf(stderr,
- "TrustedUser: unknown user %s\n", b);
+ "TrustedFileOwner: unknown user %s", b);
else
- TrustedUid = pw->pw_uid;
+ TrustedFileUid = pw->pw_uid;
}
# ifdef UID_MAX
- if (TrustedUid > UID_MAX)
+ if (TrustedFileUid > UID_MAX)
{
- syserr("TrustedUser: uid value (%ld) > UID_MAX (%ld)",
- TrustedUid, UID_MAX);
- TrustedUid = 0;
+ syserr("TrustedFileOwner: uid value (%ld) > UID_MAX (%ld)",
+ TrustedFileUid, UID_MAX);
+ TrustedFileUid = 0;
}
# endif
break;
@@ -315,7 +296,7 @@ main(argc, argv)
case T_ERR:
#if _FFR_NEW_MAKEMAP_FLAGS
fprintf(stderr,
- "Usage: %s [-N] [-c cachesize] [-d] [-f] [-l] [-o] [-r] [-s] [-v] type mapname\n",
+ "Usage: %s [-N] [-c cachesize] [-d] [-f] [-o] [-r] [-s] [-v] type mapname\n",
progname);
#else
fprintf(stderr, "Usage: %s [-N] [-d] [-f] [-o] [-r] [-s] [-v] type mapname\n", progname);
@@ -524,18 +505,16 @@ main(argc, argv)
dbm_close(dbp.dbm);
exit(EX_CANTCREAT);
}
-#if _FFR_TRUSTED_USER
- if (geteuid() == 0 && TrustedUid != 0)
+ if (geteuid() == 0 && TrustedFileUid != 0)
{
- if (fchown(dbm_dirfno(dbp.dbm), TrustedUid, -1) < 0 ||
- fchown(dbm_pagfno(dbp.dbm), TrustedUid, -1) < 0)
+ if (fchown(dbm_dirfno(dbp.dbm), TrustedFileUid, -1) < 0 ||
+ fchown(dbm_pagfno(dbp.dbm), TrustedFileUid, -1) < 0)
{
fprintf(stderr,
"WARNING: ownership change on %s failed: %s",
mapname, errstring(errno));
}
}
-#endif
break;
#endif
@@ -590,17 +569,15 @@ main(argc, argv)
exit(EX_CANTCREAT);
}
(void) (*dbp.db->sync)(dbp.db, 0);
-#if _FFR_TRUSTED_USER
- if (geteuid() == 0 && TrustedUid != 0)
+ if (geteuid() == 0 && TrustedFileUid != 0)
{
- if (fchown(fd, TrustedUid, -1) < 0)
+ if (fchown(fd, TrustedFileUid, -1) < 0)
{
fprintf(stderr,
"WARNING: ownership change on %s failed: %s",
mapname, errstring(errno));
}
}
-#endif
}
break;
@@ -651,17 +628,15 @@ main(argc, argv)
exit(EX_CANTCREAT);
}
(void) (*dbp.db->sync)(dbp.db, 0);
-#if _FFR_TRUSTED_USER
- if (geteuid() == 0 && TrustedUid != 0)
+ if (geteuid() == 0 && TrustedFileUid != 0)
{
- if (fchown(fd, TrustedUid, -1) < 0)
+ if (fchown(fd, TrustedFileUid, -1) < 0)
{
fprintf(stderr,
"WARNING: ownership change on %s failed: %s",
mapname, errstring(errno));
}
}
-#endif
}
break;
#endif
@@ -961,12 +936,10 @@ const char *
errstring(err)
int err;
{
-#if !HASSTRERROR
static char errstr[64];
-# if !defined(ERRLIST_PREDEFINED)
+#if !HASSTRERROR && !defined(ERRLIST_PREDEFINED)
extern char *sys_errlist[];
extern int sys_nerr;
-# endif
#endif
/* handle pseudo-errors internal to sendmail */
diff --git a/contrib/sendmail/praliases/praliases.c b/contrib/sendmail/praliases/praliases.c
index 3935191..db7aa68 100644
--- a/contrib/sendmail/praliases/praliases.c
+++ b/contrib/sendmail/praliases/praliases.c
@@ -17,7 +17,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)praliases.c 8.21 (Berkeley) 12/27/1998";
+static char sccsid[] = "@(#)praliases.c 8.17 (Berkeley) 6/25/98";
#endif /* not lint */
#if !defined(NDBM) && !defined(NEWDB)
@@ -32,7 +32,6 @@ static char sccsid[] = "@(#)praliases.c 8.21 (Berkeley) 12/27/1998";
# define NOT_SENDMAIL
#endif
#include <sendmail.h>
-#include <pathnames.h>
#ifdef NEWDB
# include <db.h>
# ifndef DB_VERSION_MAJOR
@@ -51,11 +50,6 @@ static char sccsid[] = "@(#)praliases.c 8.21 (Berkeley) 12/27/1998";
extern char *strerror __P((int));
#endif
-static void praliases __P((char *, int, char **));
-#ifdef NDBM
-static void praliases_dbm __P((char *, int, char **));
-#endif
-
int
main(argc, argv)
int argc;
@@ -63,148 +57,32 @@ main(argc, argv)
{
extern char *optarg;
extern int optind;
- char *cfile;
-#if _FFR_GRAB_ALIASFILE_OPTION
- char *filename = NULL;
-#else
- char *filename = "/etc/aliases";
+#ifdef NDBM
+ DBM *dbp;
+ datum content, key;
#endif
- FILE *cfp;
+ char *filename;
int ch;
- char afilebuf[MAXLINE];
- char buf[MAXLINE];
-
- cfile = _PATH_SENDMAILCF;
-#if _FFR_GRAB_ALIASFILE_OPTION
- while ((ch = getopt(argc, argv, "C:f:")) != EOF)
-#else
- while ((ch = getopt(argc, argv, "f:")) != EOF)
+#ifdef NEWDB
+ DB *db;
+ DBT newdbkey, newdbcontent;
+ char buf[MAXNAME];
#endif
- {
- switch ((char)ch) {
- case 'C':
- cfile = optarg;
- break;
+
+ filename = "/etc/aliases";
+ while ((ch = getopt(argc, argv, "f:")) != -1)
+ switch((char)ch) {
case 'f':
filename = optarg;
break;
case '?':
default:
- (void)fprintf(stderr,
-#if _FFR_GRAB_ALIASFILE_OPTION
- "usage: praliases [-C cffile] [-f aliasfile]\n");
-#else
- "usage: praliases [-f aliasfile]\n");
-#endif
+ (void)fprintf(stderr, "usage: praliases [-f file]\n");
exit(EX_USAGE);
}
- }
argc -= optind;
argv += optind;
- if (filename != NULL)
- {
- praliases(filename, argc, argv);
- exit(EX_OK);
- }
-
- if ((cfp = fopen(cfile, "r")) == NULL)
- {
- fprintf(stderr, "praliases: ");
- perror(cfile);
- exit(EX_NOINPUT);
- }
-
- while (fgets(buf, sizeof(buf), cfp) != NULL)
- {
- register char *b, *p;
-
- b = buf;
- switch (*b++)
- {
- case 'O': /* option -- see if alias file */
- if (strncasecmp(b, " AliasFile", 10) == 0 &&
- !(isascii(b[10]) && isalnum(b[10])))
- {
- /* new form -- find value */
- b = strchr(b, '=');
- if (b == NULL)
- continue;
- while (isascii(*++b) && isspace(*b))
- continue;
- }
- else if (*b++ != 'A')
- {
- /* something else boring */
- continue;
- }
-
- /* this is the A or AliasFile option -- save it */
- if (strlen(b) >= sizeof afilebuf)
- {
- fprintf(stderr,
- "AliasFile filename too long: %.30s...\n",
- b);
- (void) fclose(cfp);
- exit(EX_CONFIG);
- }
- strcpy(afilebuf, b);
- b = afilebuf;
-
- for (p = b; p != NULL; )
- {
- while (isascii(*p) && isspace(*p))
- p++;
- if (*p == '\0')
- break;
- b = p;
-
- p = strpbrk(p, " ,/");
- /* find end of spec */
- if (p != NULL)
- p = strpbrk(p, ",\n");
- if (p != NULL)
- *p++ = '\0';
-
- praliases(b, argc, argv);
- }
-
- default:
- continue;
- }
- }
- (void) fclose(cfp);
- exit(EX_OK);
-}
-
-static void
-praliases(filename, argc, argv)
- char *filename;
- int argc;
- char **argv;
-{
-#ifdef NEWDB
- DB *db;
- DBT newdbkey, newdbcontent;
- char buf[MAXNAME];
-#endif
- char *class;
-
- class = strchr(filename, ':');
- if (class != NULL)
- {
- if (strncasecmp(filename, "dbm:", 4) == 0)
- {
-#ifdef NDBM
- praliases_dbm(class + 1, argc, argv);
- return;
-#else
- fprintf(stderr, "class dbm not available\n");
- exit(EX_DATAERR);
-#endif
- }
- filename = class + 1;
- }
#ifdef NEWDB
if (strlen(filename) + 4 >= sizeof buf)
{
@@ -221,8 +99,7 @@ praliases(filename, argc, argv)
# endif
if (db != NULL)
{
- if (!argc)
- {
+ if (!argc) {
# if DB_VERSION_MAJOR > 1
DBC *dbc;
# endif
@@ -232,11 +109,7 @@ praliases(filename, argc, argv)
# if DB_VERSION_MAJOR < 2
while(!db->seq(db, &newdbkey, &newdbcontent, R_NEXT))
# else
-# if DB_VERSION_MAJOR > 2 || DB_VERSION_MINOR >=6
- if ((errno = db->cursor(db, NULL, &dbc, 0)) == 0)
-# else
if ((errno = db->cursor(db, NULL, &dbc)) == 0)
-# endif
{
while ((errno = dbc->c_get(dbc, &newdbkey,
&newdbcontent,
@@ -255,13 +128,11 @@ praliases(filename, argc, argv)
fprintf(stderr,
"praliases: %s: Could not set cursor: %s\n",
buf, strerror(errno));
- errno = db->close(db, 0);
exit(EX_DATAERR);
}
# endif
}
- else for (; *argv; ++argv)
- {
+ else for (; *argv; ++argv) {
bzero(&newdbkey, sizeof newdbkey);
bzero(&newdbcontent, sizeof newdbcontent);
newdbkey.data = *argv;
@@ -285,71 +156,39 @@ praliases(filename, argc, argv)
errno = db->close(db, 0);
# endif
}
- else
- {
-#endif
-#ifdef NDBM
- praliases_dbm(filename, argc, argv);
-#endif
-#ifdef NEWDB
- }
+ else {
#endif
-}
-
#ifdef NDBM
-static void
-praliases_dbm(filename, argc, argv)
- char *filename;
- int argc;
- char **argv;
-{
- DBM *dbp;
- datum content, key;
-
- if ((dbp = dbm_open(filename, O_RDONLY, 0)) == NULL)
- {
- (void)fprintf(stderr,
- "praliases: %s: %s\n", filename, strerror(errno));
- exit(EX_OSFILE);
- }
- if (!argc)
- {
- for (key = dbm_firstkey(dbp);
- key.dptr != NULL; key = dbm_nextkey(dbp))
- {
- content = dbm_fetch(dbp, key);
- (void)printf("%.*s:%.*s\n",
- (int) key.dsize, key.dptr,
- (int) content.dsize, content.dptr);
+ if ((dbp = dbm_open(filename, O_RDONLY, 0)) == NULL) {
+ (void)fprintf(stderr,
+ "praliases: %s: %s\n", filename, strerror(errno));
+ exit(EX_OSFILE);
}
- }
- else
- {
- for (; *argv; ++argv)
- {
- /*
- ** Use the sendmail adaptive algorithm of trying
- ** the key first without, then if needed with,
- ** the terminating NULL byte.
- */
- key.dptr = *argv;
- key.dsize = strlen(*argv);
- content = dbm_fetch(dbp, key);
- if (content.dptr == NULL)
- {
- key.dsize++;
+ if (!argc)
+ for (key = dbm_firstkey(dbp);
+ key.dptr != NULL; key = dbm_nextkey(dbp)) {
content = dbm_fetch(dbp, key);
+ (void)printf("%.*s:%.*s\n",
+ (int) key.dsize, key.dptr,
+ (int) content.dsize, content.dptr);
}
- if (content.dptr != NULL)
+ else for (; *argv; ++argv) {
+ key.dptr = *argv;
+ key.dsize = strlen(*argv) + 1;
+ content = dbm_fetch(dbp, key);
+ if (!content.dptr)
+ (void)printf("%s: No such key\n", key.dptr);
+ else
(void)printf("%s:%.*s\n", key.dptr,
(int) content.dsize, content.dptr);
- else
- (void)printf("%s: No such key\n", key.dptr);
}
+ dbm_close(dbp);
+#endif
+#ifdef NEWDB
}
- dbm_close(dbp);
-}
#endif
+ exit(EX_OK);
+}
#if !HASSTRERROR
diff --git a/contrib/sendmail/rmail/rmail.c b/contrib/sendmail/rmail/rmail.c
index f3f5cf6..ff3fcef 100644
--- a/contrib/sendmail/rmail/rmail.c
+++ b/contrib/sendmail/rmail/rmail.c
@@ -16,7 +16,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)rmail.c 8.18 (Berkeley) 10/23/1998";
+static char sccsid[] = "@(#)rmail.c 8.17 (Berkeley) 5/19/98";
#endif /* not lint */
/*
@@ -136,16 +136,16 @@ main(argc, argv)
extern int errno, optind;
FILE *fp;
struct stat sb;
- size_t fplen = 0, fptlen = 0, len;
+ size_t fplen, fptlen, len;
off_t offset;
int ch, debug, i, pdes[2], pid, status;
- char *addrp = NULL, *domain, *p, *t;
+ char *addrp, *domain, *p, *t;
char *from_path, *from_sys, *from_user;
char *args[100], buf[2048], lbuf[2048];
debug = 0;
domain = "UUCP"; /* Default "domain". */
- while ((ch = getopt(argc, argv, "D:T")) != EOF)
+ while ((ch = getopt(argc, argv, "D:T")) != -1)
switch (ch) {
case 'T':
debug = 1;
@@ -163,6 +163,8 @@ main(argc, argv)
if (argc < 1)
usage();
+ fplen = fptlen = 0;
+ addrp = "";
from_path = from_sys = from_user = NULL;
for (offset = 0;;) {
@@ -273,7 +275,11 @@ main(argc, argv)
i = 0;
args[i++] = _PATH_SENDMAIL; /* Build sendmail's argument list. */
args[i++] = "-oee"; /* No errors, just status. */
+#ifdef QUEUE_ONLY
args[i++] = "-odq"; /* Queue it, don't try to deliver. */
+#else
+ args[i++] = "-odi"; /* Deliver in foreground. */
+#endif
args[i++] = "-oi"; /* Ignore '.' on a line by itself. */
/* set from system and protocol used */
diff --git a/contrib/sendmail/smrsh/smrsh.8 b/contrib/sendmail/smrsh/smrsh.8
index af08fc4..2e76f7e 100644
--- a/contrib/sendmail/smrsh/smrsh.8
+++ b/contrib/sendmail/smrsh/smrsh.8
@@ -8,7 +8,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)smrsh.8 8.7 (Berkeley) 5/19/1998
+.\" @(#)smrsh.8 8.7 (Berkeley) 5/19/98
.\"
.TH SMRSH 8 11/02/93
.SH NAME
@@ -37,7 +37,7 @@ limits the set of programs that he or she can execute.
Briefly,
.I smrsh
limits programs to be in the directory
-/usr/adm/sm.bin,
+/usr/libexec/sm.bin,
allowing the system administrator to choose the set of acceptable commands.
It also rejects any commands with the characters
`\`', `<', `>', `|', `;', `&', `$', `(', `)', `\er' (carriage return),
@@ -45,16 +45,15 @@ or `\en' (newline)
on the command line to prevent ``end run'' attacks.
.PP
Initial pathnames on programs are stripped,
-so forwarding to ``/usr/ucb/vacation'',
-``/usr/bin/vacation'',
+so forwarding to ``/usr/bin/vacation'',
``/home/server/mydir/bin/vacation'',
and
``vacation''
all actually forward to
-``/usr/adm/sm.bin/vacation''.
+``/usr/libexec/sm.bin/vacation''.
.PP
System administrators should be conservative about populating
-/usr/adm/sm.bin.
+/usr/libexec/sm.bin.
Reasonable additions are
.IR vacation (1),
.IR procmail (1),
@@ -73,11 +72,11 @@ it simply disallows execution of arbitrary programs.
Compilation should be trivial on most systems.
You may need to use \-DPATH=\e"\fIpath\fP\e"
to adjust the default search path
-(defaults to ``/bin:/usr/bin:/usr/ucb'')
+(defaults to ``/bin:/usr/bin'')
and/or \-DCMDBIN=\e"\fIdir\fP\e"
to change the default program directory
-(defaults to ``/usr/adm/sm.bin'').
+(defaults to ``/usr/libexec/sm.bin'').
.SH FILES
-/usr/adm/sm.bin \- directory for restricted programs
+/usr/libexec/sm.bin \- directory for restricted programs
.SH SEE ALSO
sendmail(8)
diff --git a/contrib/sendmail/smrsh/smrsh.c b/contrib/sendmail/smrsh/smrsh.c
index d4af285..ff90733 100644
--- a/contrib/sendmail/smrsh/smrsh.c
+++ b/contrib/sendmail/smrsh/smrsh.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)smrsh.c 8.11 (Berkeley) 5/19/1998";
+static char sccsid[] = "@(#)smrsh.c 8.11 (Berkeley) 5/19/98";
#endif /* not lint */
/*
@@ -29,15 +29,15 @@ static char sccsid[] = "@(#)smrsh.c 8.11 (Berkeley) 5/19/1998";
**
** Leading pathnames are stripped from program names so that
** existing .forward files that reference things like
-** "/usr/ucb/vacation" will continue to work.
+** "/usr/bin/vacation" will continue to work.
**
** The following characters are completely illegal:
** < > | ^ ; & $ ` ( ) \n \r
** This is more restrictive than strictly necessary.
**
** To use this, edit /etc/sendmail.cf, search for ^Mprog, and
-** change P=/bin/sh to P=/usr/local/etc/smrsh, where this compiled
-** binary is installed /usr/local/etc/smrsh.
+** change P=/bin/sh to P=/usr/libexec/smrsh, where this compiled
+** binary is installed /usr/libexec/smrsh.
**
** This can be used on any version of sendmail.
**
@@ -58,7 +58,7 @@ static char sccsid[] = "@(#)smrsh.c 8.11 (Berkeley) 5/19/1998";
/* directory in which all commands must reside */
#ifndef CMDDIR
-# define CMDDIR "/usr/adm/sm.bin"
+# define CMDDIR "/usr/libexec/sm.bin"
#endif
/* characters disallowed in the shell "-c" argument */
@@ -66,7 +66,7 @@ static char sccsid[] = "@(#)smrsh.c 8.11 (Berkeley) 5/19/1998";
/* default search path */
#ifndef PATH
-# define PATH "/bin:/usr/bin:/usr/ucb"
+# define PATH "/bin:/usr/bin"
#endif
int
diff --git a/contrib/sendmail/src/aliases.5 b/contrib/sendmail/src/aliases.5
index bf45838..3fa4d6e 100644
--- a/contrib/sendmail/src/aliases.5
+++ b/contrib/sendmail/src/aliases.5
@@ -8,7 +8,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)aliases.5 8.8 (Berkeley) 5/19/1998
+.\" @(#)aliases.5 8.8 (Berkeley) 5/19/98
.\"
.Dd May 19, 1998
.Dt ALIASES 5
@@ -28,7 +28,7 @@ The file resides in
and
is formatted as a series of lines of the form
.Bd -filled -offset indent
-name: name_1, name2, name_3, . . .
+name: name_1, name_2, name_3, . . .
.Ed
.Pp
The
@@ -60,8 +60,8 @@ command should be executed each time the aliases file is changed for the
change to take effect.
.Sh SEE ALSO
.Xr newaliases 1 ,
-.Xr dbopen 3 ,
.Xr dbm 3 ,
+.Xr dbopen 3 ,
.Xr sendmail 8
.Rs
.%T "SENDMAIL Installation and Operation Guide"
diff --git a/contrib/sendmail/src/conf.c b/contrib/sendmail/src/conf.c
index 2668f9f..538ade4 100644
--- a/contrib/sendmail/src/conf.c
+++ b/contrib/sendmail/src/conf.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)conf.c 8.450 (Berkeley) 12/17/1998";
+static char sccsid[] = "@(#)conf.c 8.431 (Berkeley) 6/25/98";
#endif /* not lint */
# include "sendmail.h"
@@ -217,6 +217,7 @@ setdefaults(e)
int i;
struct passwd *pw;
char buf[MAXNAME];
+ extern void inittimeouts __P((char *));
extern void setdefuser __P((void));
extern void setupmaps __P((void));
extern void setupmailers __P((void));
@@ -246,7 +247,7 @@ setdefaults(e)
DefGid = 1; /* option g */
setdefuser();
}
- TrustedUid = 0;
+ TrustedFileUid = 0;
if (tTd(37, 4))
printf("setdefaults: DefUser=%s, DefUid=%d, DefGid=%d\n",
DefUser != NULL ? DefUser : "<1:1>",
@@ -291,7 +292,6 @@ setdefaults(e)
#ifdef HESIOD_INIT
HesiodContext = NULL;
#endif
- ControlSocketName = NULL;
setupmaps();
setupmailers();
setupheaders();
@@ -324,6 +324,7 @@ void
setupmailers()
{
char buf[100];
+ extern void makemailer __P((char *));
strcpy(buf, "prog, P=/bin/sh, F=lsoDq9, T=DNS/RFC822/X-Unix, A=sh -c \201u");
makemailer(buf);
@@ -837,14 +838,6 @@ switch_map_find(service, maptype, mapreturn)
*p++ = '\0';
if (buf[0] == '\0')
continue;
- if (p == NULL)
- {
- sm_syslog(LOG_ERR, NOQID,
- "Bad line on %.100s: %.100s",
- ServiceSwitchFile,
- buf);
- continue;
- }
while (isspace(*p))
p++;
if (*p == '\0')
@@ -1287,10 +1280,10 @@ init_md(argc, argv)
#endif
#ifdef __QNX__
/*
- ** Due to QNX's network distributed nature, you can target a tcpip
- ** stack on a different node in the qnx network; this patch lets
- ** this feature work. The __sock_locate() must be done before the
- ** environment is clear.
+ ** Due to QNX's network distributed nature, you can target a tcpip
+ ** stack on a different node in the qnx network; this patch lets
+ ** this feature work. The __sock_locate() must be done before the
+ ** environment is clear.
*/
__sock_locate();
#endif
@@ -2054,7 +2047,7 @@ refuseconnections(port)
else if (conncnt++ > ConnRateThrottle && ConnRateThrottle > 0)
{
/* sleep to flatten out connection load */
- sm_setproctitle(TRUE, "deferring connections on port %d: %d per second",
+ setproctitle("deferring connections on port %d: %d per second",
port, ConnRateThrottle);
if (LogLevel >= 14)
sm_syslog(LOG_INFO, NOQID,
@@ -2066,7 +2059,7 @@ refuseconnections(port)
CurrentLA = getla();
if (CurrentLA >= refusela)
{
- sm_setproctitle(TRUE, "rejecting connections on port %d: load average: %d",
+ setproctitle("rejecting connections on port %d: load average: %d",
port, CurrentLA);
if (LogLevel >= 14)
sm_syslog(LOG_INFO, NOQID,
@@ -2077,7 +2070,7 @@ refuseconnections(port)
if (!enoughdiskspace(MinBlocksFree + 1))
{
- sm_setproctitle(TRUE, "rejecting connections on port %d: min free: %d",
+ setproctitle("rejecting connections on port %d: min free: %d",
port, MinBlocksFree);
if (LogLevel >= 14)
sm_syslog(LOG_INFO, NOQID,
@@ -2088,10 +2081,12 @@ refuseconnections(port)
if (MaxChildren > 0 && CurChildren >= MaxChildren)
{
+ extern void proc_list_probe __P((void));
+
proc_list_probe();
if (CurChildren >= MaxChildren)
{
- sm_setproctitle(TRUE, "rejecting connections on port %d: %d children, max %d",
+ setproctitle("rejecting connections on port %d: %d children, max %d",
port, CurChildren, MaxChildren);
if (LogLevel >= 14)
sm_syslog(LOG_INFO, NOQID,
@@ -2175,12 +2170,12 @@ typedef unsigned int *pt_entry_t;
# define SPT_PADCHAR ' '
# endif
-#endif /* SPT_TYPE != SPT_NONE && SPT_TYPE != SPT_BUILTIN */
-
# ifndef SPT_BUFSIZE
# define SPT_BUFSIZE MAXLINE
# endif
+#endif /* SPT_TYPE != SPT_NONE && SPT_TYPE != SPT_BUILTIN */
+
/*
** Pointers for setproctitle.
** This allows "ps" listings to give more useful information.
@@ -2325,44 +2320,6 @@ setproctitle(fmt, va_alist)
#endif /* SPT_TYPE != SPT_BUILTIN */
/*
-** SM_SETPROCTITLE -- set process task and set process title for ps
-**
-** Possibly set process status and call setproctitle() to
-** change the ps display.
-**
-** Parameters:
-** status -- whether or not to store as process status
-** fmt -- a printf style format string.
-** a, b, c -- possible parameters to fmt.
-**
-** Returns:
-** none.
-*/
-
-/*VARARGS2*/
-void
-# ifdef __STDC__
-sm_setproctitle(bool status, const char *fmt, ...)
-# else
-sm_setproctitle(status, fmt, va_alist)
- bool status;
- const char *fmt;
- va_dcl
-#endif
-{
- char buf[SPT_BUFSIZE];
-
- VA_LOCAL_DECL
- /* print the argument string */
- VA_START(fmt);
- (void) vsnprintf(buf, SPT_BUFSIZE, fmt, ap);
- VA_END;
-
- if (status)
- proc_list_set(getpid(), buf);
- setproctitle("%s", buf);
-}
- /*
** WAITFOR -- wait for a particular process id.
**
** Parameters:
@@ -2832,8 +2789,8 @@ dgux_inet_addr(host)
/*
-** this version hacked to add `atend' flag to allow state machine
-** to reset if invoked by the program to scan args for a 2nd time
+** this version hacked to add `atend' flag to allow state machine
+** to reset if invoked by the program to scan args for a 2nd time
*/
#if defined(LIBC_SCCS) && !defined(lint)
@@ -3005,7 +2962,7 @@ char *DefaultUserShells[] =
"/bin/bsh", /* Bourne shell */
"/usr/bin/bsh",
#endif
-#if defined(__svr4__) || defined(__svr5__)
+#ifdef __svr4__
"/bin/ksh", /* Korn shell */
"/usr/bin/ksh",
#endif
@@ -3708,63 +3665,9 @@ setvendor(vendor)
}
#endif
-#if defined(VENDOR_NAME) && defined(VENDOR_CODE)
- if (strcasecmp(vendor, VENDOR_NAME) == 0)
- {
- VendorCode = VENDOR_CODE;
- return TRUE;
- }
-#endif
-
return FALSE;
}
/*
-** GETVENDOR -- return vendor name based on vendor code
-**
-** Parameters:
-** vendorcode -- numeric representation of vendor.
-**
-** Returns:
-** string containing vendor name.
-*/
-
-char *
-getvendor(vendorcode)
- int vendorcode;
-{
-#if defined(VENDOR_NAME) && defined(VENDOR_CODE)
- /*
- ** Can't have the same switch case twice so need to
- ** handle VENDOR_CODE outside of switch. It might
- ** match one of the existing VENDOR_* codes.
- */
-
- if (vendorcode == VENDOR_CODE)
- return VENDOR_NAME;
-#endif
-
- switch (vendorcode)
- {
- case VENDOR_BERKELEY:
- return "Berkeley";
-
- case VENDOR_SUN:
- return "Sun";
-
- case VENDOR_HP:
- return "HP";
-
- case VENDOR_IBM:
- return "IBM";
-
- case VENDOR_SENDMAIL:
- return "Sendmail";
-
- default:
- return "Unknown";
- }
-}
- /*
** VENDOR_PRE_DEFAULTS, VENDOR_POST_DEFAULTS -- set vendor-specific defaults
**
** Vendor_pre_defaults is called before reading the configuration
@@ -3827,7 +3730,7 @@ vendor_daemon_setup(e)
if (getluid() != -1)
{
usrerr("Daemon cannot have LUID");
- finis(FALSE, EX_USAGE);
+ exit(EX_USAGE);
}
#endif /* SECUREWARE */
}
@@ -4270,88 +4173,11 @@ secureware_setup_secure(uid)
rc, uid);
break;
}
- finis(FALSE, EX_NOPERM);
+ exit(EX_NOPERM);
}
}
#endif /* SECUREWARE */
/*
-** ADD_LOCAL_HOST_NAMES -- Add a hostname to class 'w' based on IP address
-**
-** Add hostnames to class 'w' based on the IP address read from
-** the network interface.
-**
-** Parameters:
-** sa -- a pointer to a SOCKADDR containing the address
-**
-** Returns:
-** 0 if successful, -1 if host lookup fails.
-*/
-
-int
-add_hostnames(sa)
- SOCKADDR *sa;
-{
- struct hostent *hp;
-
- /* lookup name with IP address */
- switch (sa->sa.sa_family)
- {
- case AF_INET:
- hp = sm_gethostbyaddr((char *) &sa->sin.sin_addr,
- sizeof(sa->sin.sin_addr), sa->sa.sa_family);
- break;
-
- default:
-#if _FFR_LOG_UNSUPPORTED_FAMILIES
- /* XXX: Give warning about unsupported family */
- if (LogLevel > 3)
- sm_syslog(LOG_WARNING, NOQID,
- "Unsupported address family %d: %.100s",
- sa->sa.sa_family, anynet_ntoa(sa));
-#endif
- return -1;
- }
-
- if (hp == NULL)
- {
- int save_errno = errno;
-
- if (LogLevel > 3)
- sm_syslog(LOG_WARNING, NOQID,
- "gethostbyaddr(%.100s) failed: %d\n",
- anynet_ntoa(sa),
-#if NAMED_BIND
- h_errno
-#else
- -1
-#endif
- );
- errno = save_errno;
- return -1;
- }
-
- /* save its cname */
- if (!wordinclass((char *) hp->h_name, 'w'))
- {
- setclass('w', (char *) hp->h_name);
- if (tTd(0, 4))
- printf("\ta.k.a.: %s\n", hp->h_name);
- }
-
- /* save all it aliases name */
- while (*hp->h_aliases)
- {
- if (!wordinclass(*hp->h_aliases, 'w'))
- {
- setclass('w', *hp->h_aliases);
- if (tTd(0, 4))
- printf("\ta.k.a.: %s\n", *hp->h_aliases);
- }
- hp->h_aliases++;
- }
- return 0;
-}
- /*
** LOAD_IF_NAMES -- load interface-specific names into $=w
**
** Parameters:
@@ -4428,8 +4254,9 @@ load_if_names()
for (i = 0; i < ifc.ifc_len; )
{
struct ifreq *ifr = (struct ifreq *) &ifc.ifc_buf[i];
- SOCKADDR *sa = (SOCKADDR *) &ifr->ifr_addr;
+ struct sockaddr *sa = &ifr->ifr_addr;
struct in_addr ia;
+ struct hostent *hp;
#ifdef SIOCGIFFLAGS
struct ifreq ifrf;
#endif
@@ -4437,14 +4264,14 @@ load_if_names()
extern char *inet_ntoa();
#ifdef BSD4_4_SOCKADDR
- if (sa->sa.sa_len > sizeof ifr->ifr_addr)
- i += sizeof ifr->ifr_name + sa->sa.sa_len;
+ if (sa->sa_len > sizeof ifr->ifr_addr)
+ i += sizeof ifr->ifr_name + sa->sa_len;
else
#endif
i += sizeof *ifr;
if (tTd(0, 20))
- printf("%s\n", anynet_ntoa(sa));
+ printf("%s\n", anynet_ntoa((SOCKADDR *) sa));
if (ifr->ifr_addr.sa_family != AF_INET)
continue;
@@ -4463,7 +4290,7 @@ load_if_names()
continue;
/* extract IP address from the list*/
- ia = sa->sin.sin_addr;
+ ia = (((struct sockaddr_in *) sa)->sin_addr);
if (ia.s_addr == INADDR_ANY || ia.s_addr == INADDR_NONE)
{
message("WARNING: interface %s is UP with %s address",
@@ -4473,7 +4300,7 @@ load_if_names()
/* save IP address in text from */
(void) snprintf(ip_addr, sizeof ip_addr, "[%.*s]",
- sizeof ip_addr - 3,
+ (int)sizeof ip_addr - 3,
inet_ntoa(ia));
if (!wordinclass(ip_addr, 'w'))
{
@@ -4486,7 +4313,41 @@ load_if_names()
if (bitset(IFF_LOOPBACK, IFRFREF.ifr_flags))
continue;
- (void) add_hostnames(sa);
+ /* lookup name with IP address */
+ hp = sm_gethostbyaddr((char *) &ia, sizeof(ia), AF_INET);
+ if (hp == NULL)
+ {
+ if (LogLevel > 3)
+ sm_syslog(LOG_WARNING, NOQID,
+ "gethostbyaddr(%.100s) failed: %d\n",
+ inet_ntoa(ia),
+#if NAMED_BIND
+ h_errno);
+#else
+ -1);
+#endif
+ continue;
+ }
+
+ /* save its cname */
+ if (!wordinclass((char *) hp->h_name, 'w'))
+ {
+ setclass('w', (char *) hp->h_name);
+ if (tTd(0, 4))
+ printf("\ta.k.a.: %s\n", hp->h_name);
+ }
+
+ /* save all it aliases name */
+ while (*hp->h_aliases)
+ {
+ if (!wordinclass(*hp->h_aliases, 'w'))
+ {
+ setclass('w', *hp->h_aliases);
+ if (tTd(0, 4))
+ printf("\ta.k.a.: %s\n", *hp->h_aliases);
+ }
+ hp->h_aliases++;
+ }
}
free(ifc.ifc_buf);
close(s);
@@ -4551,7 +4412,7 @@ sm_syslog(level, id, fmt, va_alist)
extern int SyslogErrno;
extern char *DoprEnd;
VA_LOCAL_DECL
- extern void sm_dopr __P((char *, const char *, va_list));
+ extern void sm_dopr __P((char *, const char *, ...));
SyslogErrno = errno;
if (id == NULL)
diff --git a/contrib/sendmail/src/conf.h b/contrib/sendmail/src/conf.h
index b9cdc68..a8ad46e 100644
--- a/contrib/sendmail/src/conf.h
+++ b/contrib/sendmail/src/conf.h
@@ -9,7 +9,7 @@
* the sendmail distribution.
*
*
- * @(#)conf.h 8.380 (Berkeley) 11/9/1998
+ * @(#)conf.h 8.372 (Berkeley) 6/4/98
*/
/*
@@ -64,11 +64,6 @@ struct rusage; /* forward declaration to get gcc to shut up in wait.h */
# define MACBUFSIZE 4096 /* max expanded macro buffer size */
# define TOBUFSIZE 512 /* max buffer to hold address list */
# define MAXSHORTSTR 203 /* max short string length */
-# if _FFR_MAX_MIME_HEADER_LENGTH
-# define MAXMACNAMELEN 25 /* max macro name length */
-# else
-# define MAXMACNAMELEN 20 /* max macro name length */
-# endif
/**********************************************************************
** Compilation options.
@@ -349,12 +344,12 @@ typedef int pid_t;
# define GIDSET_T gid_t
# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
# define SFS_BAVAIL f_bfree /* alternate field name */
-# define SYSLOG_BUFSIZE 512
# ifdef IRIX6
# define STAT64 1
# define QUAD_T unsigned long long
# define LA_TYPE LA_IRIX6 /* figure out at run time */
# define SAFENFSPATHCONF 0 /* pathconf(2) lies on NFS filesystems */
+# define SYSLOG_BUFSIZE 512
# else
# define LA_TYPE LA_INT
@@ -679,41 +674,6 @@ typedef int pid_t;
#endif
-/*
-** Apple Rhapsody
-** Contributed by Wilfredo Sanchez <wsanchez@apple.com>
-*/
-
-#ifdef __APPLE__
-# define HASFCHMOD 1 /* has fchmod(2) syscall */
-# define HASFLOCK 1 /* has flock(2) syscall */
-# define HASUNAME 1 /* has uname(2) syscall */
-# define HASUNSETENV 1
-# define HASSETSID 1 /* has the setsid(2) POSIX syscall */
-# define HASINITGROUPS 1
-# define HASSETVBUF 1
-# define HASSETREUID 1
-# define USESETEUID 1 /* has useable seteuid(2) call */
-# define HASLSTAT 1
-# define HASSETRLIMIT 1
-# define HASWAITPID 1
-# define HASSTRERROR 1 /* has strerror(3) */
-# define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */
-# define USESTRERROR 1 /* has strerror(3) */
-# define HASGETDTABLESIZE 1
-# define HASGETUSERSHELL 1
-# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
-# define BSD4_4_SOCKADDR /* has sa_len */
-# define NETLINK 1 /* supports AF_LINK */
-# define HAS_ST_GEN 1 /* has st_gen field in stat struct */
-# define GIDSET_T gid_t
-# define LA_TYPE LA_SUBR /* use getloadavg(3) */
-# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
-# define SPT_TYPE SPT_PSSTRINGS
-# define SPT_PADCHAR '\0' /* pad process title with nulls */
-# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
-#endif
-
/*
** 4.4 BSD
@@ -861,7 +821,7 @@ typedef int pid_t;
# define SPT_TYPE SPT_BUILTIN
# endif
# if __FreeBSD_version >= 222000 /* 2.2.2-release and later */
-# define HASSETUSERCONTEXT 1 /* BSDI-style login classes */
+# define HASSETUSERCONTEXT 1 /* BSDI-style login classes */
# endif
# endif
# ifndef SPT_TYPE
@@ -1259,9 +1219,9 @@ extern void *malloc();
** Florian La Roche <rzsfl@rz.uni-sb.de>
** Karl London <karl@borg.demon.co.uk>
**
-** Last compiled against: [07/21/98 @ 11:47:34 AM (Tuesday)]
-** sendmail 8.9.1 bind-8.1.2 db-2.4.14
-** gcc-2.8.1 glibc-2.0.94 linux-2.1.109
+** Last compiled against: [06/10/96 @ 09:21:40 PM (Monday)]
+** sendmail 8.8-a4 named bind-4.9.4-T4B db-1.85
+** gcc 2.7.2 libc-5.3.12 linux 2.0.0
**
** NOTE: Override HASFLOCK as you will but, as of 1.99.6, mixed-style
** file locking is no longer allowed. In particular, make sure
@@ -1271,7 +1231,6 @@ extern void *malloc();
#ifdef __linux__
# define BSD 1 /* include BSD defines */
-# define USESETEUID 0 /* Have it due to POSIX, but doesn't work */
# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
# define HASUNAME 1 /* use System V uname(2) system call */
# define HASUNSETENV 1 /* has unsetenv(3) call */
@@ -1299,7 +1258,7 @@ extern void *malloc();
# ifndef _PATH_SENDMAILPID
# define _PATH_SENDMAILPID "/var/run/sendmail.pid"
# endif
-# define TZ_TYPE TZ_TZNAME
+# define TZ_TYPE TZ_TNAME
# include <sys/sysmacros.h>
# undef atol /* wounded in <stdlib.h> */
#endif
@@ -1528,37 +1487,6 @@ typedef int pid_t;
# endif
#endif
-/*
-** System V Rel 5.x (a.k.a Unixware7 w/o BSD-Compatiblity Libs ie. native)
-**
-** Contributed by Paul Gampe <paulg@apnic.net>
-*/
-
-#ifdef __svr5__
-# include <sys/mkdev.h>
-# define __svr4__
-# define SYS5SIGNALS 1
-# define HASSETSID 1
-# define HASSETREUID 1
-# define HASWAITPID 1
-# define HASGETDTABLESIZE 1
-# define GIDSET_T gid_t
-# define SOCKADDR_LEN_T size_t
-# define SOCKOPT_LEN_T size_t
-# ifndef _PATH_UNIX
-# define _PATH_UNIX "/stand/unix"
-# endif
-# define SPT_PADCHAR '\0' /* pad process title with nulls */
-# define SYSLOG_BUFSIZE 1024 /* unsure */
-# ifndef _PATH_VENDOR_CF
-# define _PATH_VENDOR_CF "/etc/sendmail.cf"
-# endif
-# ifndef _PATH_SENDMAILPID
-# define _PATH_SENDMAILPID "/etc/sendmail.pid"
-# endif
-#endif
-
-/* ###################################################################### */
/*
** UnixWare 2.x
@@ -1591,9 +1519,7 @@ typedef int pid_t;
# define LA_TYPE LA_ZERO
# undef WIFEXITED
# undef WEXITSTATUS
-# ifndef _PATH_UNIX
-# define _PATH_UNIX "/unix"
-# endif
+# define _PATH_UNIX "/unix"
# ifndef _PATH_VENDOR_CF
# define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf"
# endif
diff --git a/contrib/sendmail/src/err.c b/contrib/sendmail/src/err.c
index 1a875a2..a07d62d 100644
--- a/contrib/sendmail/src/err.c
+++ b/contrib/sendmail/src/err.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)err.c 8.74 (Berkeley) 6/4/1998";
+static char sccsid[] = "@(#)err.c 8.74 (Berkeley) 6/4/98";
#endif /* not lint */
# include "sendmail.h"
@@ -216,7 +216,7 @@ usrerr(fmt, va_alist)
char buf[MAXLINE];
snprintf(buf, sizeof buf, "Postmaster warning: %.*s",
- sizeof buf - 22, MsgBuf + 4);
+ (int)sizeof buf - 22, MsgBuf + 4);
CurEnv->e_message = newstr(buf);
}
else
diff --git a/contrib/sendmail/src/headers.c b/contrib/sendmail/src/headers.c
index fcf1d9c..91a4261 100644
--- a/contrib/sendmail/src/headers.c
+++ b/contrib/sendmail/src/headers.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)headers.c 8.134 (Berkeley) 11/29/1998";
+static char sccsid[] = "@(#)headers.c 8.127 (Berkeley) 6/4/98";
#endif /* not lint */
# include <errno.h>
@@ -521,8 +521,8 @@ eatheader(e, full)
#if 0
/*
- ** Change functionality so a fatal error on an
- ** address doesn't affect the entire envelope.
+ ** Change functionality so a fatal error on an
+ ** address doesn't affect the entire envelope.
*/
/* delete fatal errors generated by this address */
@@ -1198,59 +1198,6 @@ putheader(mci, hdr, e)
xputs(p);
}
-#if _FFR_MAX_MIME_HEADER_LENGTH
- /* heuristic shortening of MIME fields to avoid MUA overflows */
- if (MaxMimeFieldLength > 0 &&
- wordinclass(h->h_field,
- macid("{checkMIMEFieldHeaders}", NULL)))
- {
- extern bool fix_mime_header __P((char *));
-
- if (fix_mime_header(h->h_value))
- {
- sm_syslog(LOG_ALERT, e->e_id,
- "Truncated MIME %s header due to field size (possible attack)",
- h->h_field);
- if (tTd(34, 11))
- printf(" truncated MIME %s header due to field size (possible attack)\n",
- h->h_field);
- }
- }
-
- if (MaxMimeHeaderLength > 0 &&
- wordinclass(h->h_field,
- macid("{checkMIMETextHeaders}", NULL)))
- {
- if (strlen(h->h_value) > MaxMimeHeaderLength)
- {
- h->h_value[MaxMimeHeaderLength - 1] = '\0';
- sm_syslog(LOG_ALERT, e->e_id,
- "Truncated long MIME %s header (possible attack)",
- h->h_field);
- if (tTd(34, 11))
- printf(" truncated long MIME %s header (possible attack)\n",
- h->h_field);
- }
- }
-
- if (MaxMimeHeaderLength > 0 &&
- wordinclass(h->h_field,
- macid("{checkMIMEHeaders}", NULL)))
- {
- extern bool shorten_rfc822_string __P((char *, int));
-
- if (shorten_rfc822_string(h->h_value, MaxMimeHeaderLength))
- {
- sm_syslog(LOG_ALERT, e->e_id,
- "Truncated long MIME %s header (possible attack)",
- h->h_field);
- if (tTd(34, 11))
- printf(" truncated long MIME %s header (possible attack)\n",
- h->h_field);
- }
- }
-#endif
-
/* suppress Content-Transfer-Encoding: if we are MIMEing */
if (bitset(H_CTE, h->h_flags) &&
bitset(MCIF_CVT8TO7|MCIF_CVT7TO8|MCIF_INMIME, mci->mci_flags))
@@ -1418,7 +1365,7 @@ put_vanilla_header(h, v, mci)
*obp++ = ' ';
}
snprintf(obp, SPACELEFT(obuf, obp), "%.*s",
- sizeof obuf - (obp - obuf) - 1, v);
+ (int)(sizeof obuf - (obp - obuf) - 1), v);
putxline(obuf, strlen(obuf), mci, putflags);
}
/*
@@ -1621,69 +1568,3 @@ copyheader(header)
return ret;
}
- /*
-** FIX_MIME_HEADER -- possibly truncate/rebalance parameters in a MIME header
-**
-** Run through all of the parameters of a MIME header and
-** possibly truncate and rebalance the parameter according
-** to MaxMimeFieldLength.
-**
-** Parameters:
-** string -- the full header
-**
-** Returns:
-** TRUE if the header was modified, FALSE otherwise
-**
-** Side Effects:
-** string modified in place
-*/
-
-bool
-fix_mime_header(string)
- char *string;
-{
- bool modified = FALSE;
- char *begin = string;
- char *end;
- extern char *find_character __P((char *, char));
- extern bool shorten_rfc822_string __P((char *, int));
-
- if (string == NULL || *string == '\0')
- return FALSE;
-
- /* Split on each ';' */
- while ((end = find_character(begin, ';')) != NULL)
- {
- char save = *end;
- char *bp;
-
- *end = '\0';
-
- /* Shorten individual parameter */
- if (shorten_rfc822_string(begin, MaxMimeFieldLength))
- modified = TRUE;
-
- /* Collapse the possibly shortened string with rest */
- bp = begin + strlen(begin);
- if (bp != end)
- {
- char *ep = end;
-
- *end = save;
- end = bp;
-
- /* copy character by character due to overlap */
- while (*ep != '\0')
- *bp++ = *ep++;
- *bp = '\0';
- }
- else
- *end = save;
- if (*end == '\0')
- break;
-
- /* Move past ';' */
- begin = end + 1;
- }
- return modified;
-}
diff --git a/contrib/sendmail/src/mailq.1 b/contrib/sendmail/src/mailq.1
index 8b6e63a..ed6c0f6 100644
--- a/contrib/sendmail/src/mailq.1
+++ b/contrib/sendmail/src/mailq.1
@@ -8,7 +8,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)mailq.1 8.10 (Berkeley) 5/19/1998
+.\" @(#)mailq.1 8.10 (Berkeley) 5/19/98
.\"
.Dd May 19, 1998
.Dt MAILQ 1
@@ -36,10 +36,6 @@ for the first time.
The following lines show message recipients,
one per line.
.Pp
-.Nm Mailq
-is identical to
-.Dq Li "sendmail -bp" .
-.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl v
@@ -58,6 +54,14 @@ and the name of the alias this command expanded from, if any.
The
.Nm mailq
utility exits 0 on success, and >0 if an error occurs.
+.Sh NOTES
+.Nm Mailq
+is identical to
+.Dq Li "sendmail -bp" .
+Most of the options which apply to
+.Xr sendmail 8
+also apply to
+.Nm mailq .
.Sh SEE ALSO
.Xr sendmail 8
.Sh HISTORY
diff --git a/contrib/sendmail/src/mci.c b/contrib/sendmail/src/mci.c
index 41649a2..9e1e3b6 100644
--- a/contrib/sendmail/src/mci.c
+++ b/contrib/sendmail/src/mci.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)mci.c 8.83 (Berkeley) 10/13/1998";
+static char sccsid[] = "@(#)mci.c 8.82 (Berkeley) 6/15/98";
#endif /* not lint */
#include "sendmail.h"
@@ -428,7 +428,9 @@ mci_dump(mci, logit)
sep = logit ? " " : "\n\t";
p = buf;
- snprintf(p, SPACELEFT(buf, p), "MCI@%x: ", mci);
+ snprintf(p, SPACELEFT(buf, p), "MCI@%lx: ",
+ sizeof(void *) == sizeof(u_long) ?
+ (u_long)(void *)mci : (u_long)(u_int)(void *)mci);
p += strlen(p);
if (mci == NULL)
{
@@ -503,7 +505,7 @@ mci_dump_all(logit)
mci_dump(MciCache[i], logit);
}
/*
-** MCI_LOCK_HOST -- Lock host while sending.
+** MCI_LOCK_HOST -- Lock host while sending.
**
** If we are contacting a host, we'll need to
** update the status information in the host status
@@ -643,7 +645,7 @@ mci_unlock_host(mci)
errno = saveErrno;
}
/*
-** MCI_LOAD_PERSISTENT -- load persistent host info
+** MCI_LOAD_PERSISTENT -- load persistent host info
**
** Load information about host that is kept
** in common for all running sendmails.
@@ -1016,8 +1018,8 @@ mci_traverse_persistent(action, pathname)
*hostptr = '\0';
/*
- ** Do something with the file containing the persistent
- ** information.
+ ** Do something with the file containing the persistent
+ ** information.
*/
ret = (*action)(pathname, host);
}
@@ -1167,7 +1169,7 @@ mci_purge_persistent(pathname, hostname)
return 0;
}
/*
-** MCI_GENERATE_PERSISTENT_PATH -- generate path from hostname
+** MCI_GENERATE_PERSISTENT_PATH -- generate path from hostname
**
** Given `host', convert from a.b.c to $QueueDir/.hoststat/c./b./a,
** putting the result into `path'. if `createflag' is set, intervening
diff --git a/contrib/sendmail/src/savemail.c b/contrib/sendmail/src/savemail.c
index f15c8de..c7ae3d9 100644
--- a/contrib/sendmail/src/savemail.c
+++ b/contrib/sendmail/src/savemail.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)savemail.c 8.139 (Berkeley) 8/5/1998";
+static char sccsid[] = "@(#)savemail.c 8.138 (Berkeley) 6/17/98";
#endif /* not lint */
# include "sendmail.h"
@@ -91,7 +91,8 @@ savemail(e, sendbody)
RF_COPYPARSE|RF_SENDERADDR, '\0', NULL, e) == NULL)
{
syserr("553 Cannot parse Postmaster!");
- finis(TRUE, EX_SOFTWARE);
+ ExitStat = EX_SOFTWARE;
+ finis();
}
}
e->e_to = NULL;
@@ -550,7 +551,7 @@ returntosender(msg, returnq, flags, e)
addheader("MIME-Version", "1.0", &ee->e_header);
(void) snprintf(buf, sizeof buf, "%s.%ld/%.100s",
- ee->e_id, curtime(), MyHostName);
+ ee->e_id, (long)curtime(), MyHostName);
ee->e_msgboundary = newstr(buf);
(void) snprintf(buf, sizeof buf,
#if DSN
@@ -587,14 +588,14 @@ returntosender(msg, returnq, flags, e)
else if (bitset(RTSF_PM_BOUNCE, flags))
{
snprintf(buf, sizeof buf, "Postmaster notify: %.*s",
- sizeof buf - 20, msg);
+ (int)sizeof buf - 20, msg);
addheader("Subject", buf, &ee->e_header);
p = "postmaster-notification";
}
else
{
snprintf(buf, sizeof buf, "Returned mail: %.*s",
- sizeof buf - 20, msg);
+ (int)sizeof buf - 20, msg);
addheader("Subject", buf, &ee->e_header);
p = "failure";
}
diff --git a/contrib/sendmail/src/sendmail.8 b/contrib/sendmail/src/sendmail.8
index 093b6e6..7738e12 100644
--- a/contrib/sendmail/src/sendmail.8
+++ b/contrib/sendmail/src/sendmail.8
@@ -8,9 +8,9 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)sendmail.8 8.20 (Berkeley) 8/2/1998
+.\" @(#)sendmail.8 8.19 (Berkeley) 5/19/98
.\"
-.Dd August 2, 1998
+.Dd May 19, 1998
.Dt SENDMAIL 8
.Os BSD 4
.Sh NAME
@@ -277,9 +277,6 @@ Log all traffic in and out of mailers in the indicated log file.
This should only be used as a last resort
for debugging mailer bugs.
It will log a lot of data very quickly.
-.It Fl -
-Stop processing command flags and use the rest of the arguments
-as addresses.
.El
.Ss Options
There are also a number of processing options that may be set.
@@ -542,7 +539,7 @@ raw data for alias names
data base of alias names
.It Pa /etc/sendmail.cf
configuration file
-.It Pa /etc/sendmail.hf
+.It Pa /usr/share/misc/sendmail.hf
help file
.It Pa /var/log/sendmail.st
collected statistics
@@ -550,13 +547,13 @@ collected statistics
temp files
.El
.Sh SEE ALSO
-.Xr binmail 1 ,
.Xr mail 1 ,
-.Xr rmail 1 ,
.Xr syslog 3 ,
.Xr aliases 5 ,
.Xr mailaddr 7 ,
-.Xr rc 8 ;
+.Xr mail.local 8 ,
+.Xr rc 8 ,
+.Xr rmail 8 ;
.Pp
DARPA
Internet Request For Comments
OpenPOWER on IntegriCloud