Resolve conflicts from sendmail 8.12.7 import

This commit is contained in:
Gregory Neil Shapiro 2003-02-08 20:35:51 +00:00
parent 9e80f49658
commit 2ef40764f0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=110563
9 changed files with 128 additions and 54 deletions

View File

@ -17,11 +17,11 @@
#####
##### SENDMAIL CONFIGURATION FILE
#####
ifdef(`unix', `dnl
ifdef(`__win32__', `dnl', `dnl
ifdef(`TEMPFILE', `dnl', `define(`TEMPFILE', maketemp(/tmp/cfXXXXXX))dnl
syscmd(sh _CF_DIR_`'sh/makeinfo.sh _CF_DIR_ > TEMPFILE)dnl
include(TEMPFILE)dnl
syscmd(rm -f TEMPFILE)dnl')', `dnl')
syscmd(rm -f TEMPFILE)dnl')')
#####
######################################################################
#####
@ -305,4 +305,4 @@ define(`confMILTER_MACROS_ENVRCPT', ``{rcpt_mailer}, {rcpt_host}, {rcpt_addr}'')
divert(0)dnl
VERSIONID(`$Id: cfhead.m4,v 8.108 2002/06/13 18:53:24 ca Exp $')
VERSIONID(`$Id: cfhead.m4,v 8.108.2.1 2002/08/27 20:19:08 gshapiro Exp $')

View File

@ -20,7 +20,7 @@ SM_IDSTR(copyright,
Copyright (c) 1990, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n")
SM_IDSTR(id, "@(#)$Id: mail.local.c,v 8.239 2002/05/24 20:56:32 gshapiro Exp $")
SM_IDSTR(id, "@(#)$Id: mail.local.c,v 8.239.2.2 2002/09/24 02:09:09 ca Exp $")
#include <stdlib.h>
#include <sm/errstring.h>
@ -670,6 +670,8 @@ store(from, inbody)
(void) sm_strlcpy(tmpbuf, _PATH_LOCTMP, sizeof tmpbuf);
if ((fd = mkstemp(tmpbuf)) < 0 || (fp = fdopen(fd, "w+")) == NULL)
{
if (fd >= 0)
(void) close(fd);
mailerr("451 4.3.0", "Unable to open temporary file");
return -1;
}
@ -1217,7 +1219,8 @@ deliver(fd, name)
#ifdef DEBUG
fprintf(stderr, "reset euid = %d\n", (int) geteuid());
#endif /* DEBUG */
(void) ftruncate(mbfd, curoff);
if (mbfd >= 0)
(void) ftruncate(mbfd, curoff);
err1: if (mbfd >= 0)
(void) close(mbfd);
err0: unlockmbox();
@ -1233,7 +1236,29 @@ err0: unlockmbox();
errcode = "552 5.2.2";
#endif /* EDQUOT */
mailerr(errcode, "%s: %s", path, sm_errstring(errno));
(void) truncate(path, curoff);
mbfd = open(path, O_WRONLY|EXTRA_MODE, 0);
if (mbfd < 0
|| fstat(mbfd, &sb) < 0 ||
sb.st_nlink != 1 ||
!S_ISREG(sb.st_mode) ||
sb.st_dev != fsb.st_dev ||
sb.st_ino != fsb.st_ino ||
# if HAS_ST_GEN && 0 /* AFS returns random values for st_gen */
sb.st_gen != fsb.st_gen ||
# endif /* HAS_ST_GEN && 0 */
sb.st_uid != fsb.st_uid
)
{
/* Don't use a bogus file */
if (mbfd >= 0)
{
(void) close(mbfd);
mbfd = -1;
}
}
/* Attempt to truncate back to pre-write size */
goto err3;
}
else if (!nobiff)
notifybiff(biffmsg);

View File

@ -22,7 +22,7 @@ SM_IDSTR(copyright,
Copyright (c) 1993\n\
The Regents of the University of California. All rights reserved.\n")
SM_IDSTR(id, "@(#)$Id: smrsh.c,v 8.58 2002/05/25 02:41:31 ca Exp $")
SM_IDSTR(id, "@(#)$Id: smrsh.c,v 8.58.2.2 2002/09/24 21:40:05 ca Exp $")
/*
** SMRSH -- sendmail restricted shell
@ -292,12 +292,12 @@ main(argc, argv)
{
/* too long */
(void) sm_io_fprintf(smioerr, SM_TIME_DEFAULT,
"%s: %s not available for sendmail programs (filename too long)\n",
"%s: \"%s\" not available for sendmail programs (filename too long)\n",
prg, cmd);
if (p != NULL)
*p = ' ';
#ifndef DEBUG
syslog(LOG_CRIT, "uid %d: attempt to use %s (filename too long)",
syslog(LOG_CRIT, "uid %d: attempt to use \"%s\" (filename too long)",
(int) getuid(), cmd);
#endif /* ! DEBUG */
exit(EX_UNAVAILABLE);
@ -311,12 +311,12 @@ main(argc, argv)
{
/* can't stat it */
(void) sm_io_fprintf(smioerr, SM_TIME_DEFAULT,
"%s: %s not available for sendmail programs (stat failed)\n",
"%s: \"%s\" not available for sendmail programs (stat failed)\n",
prg, cmd);
if (p != NULL)
*p = ' ';
#ifndef DEBUG
syslog(LOG_CRIT, "uid %d: attempt to use %s (stat failed)",
syslog(LOG_CRIT, "uid %d: attempt to use \"%s\" (stat failed)",
(int) getuid(), cmd);
#endif /* ! DEBUG */
exit(EX_UNAVAILABLE);
@ -329,12 +329,12 @@ main(argc, argv)
{
/* can't stat it */
(void) sm_io_fprintf(smioerr, SM_TIME_DEFAULT,
"%s: %s not available for sendmail programs (not a file)\n",
"%s: \"%s\" not available for sendmail programs (not a file)\n",
prg, cmd);
if (p != NULL)
*p = ' ';
#ifndef DEBUG
syslog(LOG_CRIT, "uid %d: attempt to use %s (not a file)",
syslog(LOG_CRIT, "uid %d: attempt to use \"%s\" (not a file)",
(int) getuid(), cmd);
#endif /* ! DEBUG */
exit(EX_UNAVAILABLE);
@ -343,12 +343,12 @@ main(argc, argv)
{
/* oops.... crack attack possiblity */
(void) sm_io_fprintf(smioerr, SM_TIME_DEFAULT,
"%s: %s not available for sendmail programs\n",
"%s: \"%s\" not available for sendmail programs\n",
prg, cmd);
if (p != NULL)
*p = ' ';
#ifndef DEBUG
syslog(LOG_CRIT, "uid %d: attempt to use %s",
syslog(LOG_CRIT, "uid %d: attempt to use \"%s\"",
(int) getuid(), cmd);
#endif /* ! DEBUG */
exit(EX_UNAVAILABLE);

View File

@ -15,7 +15,7 @@
#include <sendmail.h>
SM_RCSID("@(#)$Id: conf.c,v 8.972.2.5 2002/08/16 14:56:01 ca Exp $")
SM_RCSID("@(#)$Id: conf.c,v 8.972.2.25 2002/12/12 21:19:29 ca Exp $")
#include <sendmail/pathnames.h>
@ -30,7 +30,6 @@ SM_RCSID("@(#)$Id: conf.c,v 8.972.2.5 2002/08/16 14:56:01 ca Exp $")
# include <ulimit.h>
#endif /* HASULIMIT && defined(HPUX11) */
static void setupmaps __P((void));
static void setupmailers __P((void));
static void setupqueues __P((void));
@ -366,6 +365,12 @@ setdefaults(e)
#if MILTER
InputFilters[0] = NULL;
#endif /* MILTER */
#if _FFR_REJECT_LOG
RejectLogInterval = 3 HOURS;
#endif /* _FFR_REJECT_LOG */
#if _FFR_REQ_DIR_FSYNC_OPT
RequiresDirfsync = true;
#endif /* _FFR_REQ_DIR_FSYNC_OPT */
setupmaps();
setupqueues();
setupmailers();
@ -2172,6 +2177,10 @@ refuseconnections(name, e, d, active)
{
static time_t lastconn[MAXDAEMONS];
static int conncnt[MAXDAEMONS];
#if _FFR_REJECT_LOG
static time_t firstrejtime[MAXDAEMONS];
static time_t nextlogtime[MAXDAEMONS];
#endif /* _FFR_REJECT_LOG */
#if XLA
if (!xla_smtp_ok())
@ -2209,12 +2218,35 @@ refuseconnections(name, e, d, active)
sm_getla();
if (RefuseLA > 0 && CurrentLA >= RefuseLA)
{
# if _FFR_REJECT_LOG
time_t now;
# define R2_MSG_LA "have been rejecting connections on daemon %s for %s"
# endif /* _FFR_REJECT_LOG */
# define R_MSG_LA "rejecting connections on daemon %s: load average: %d"
sm_setproctitle(true, e, R_MSG_LA, name, CurrentLA);
if (LogLevel > 8)
sm_syslog(LOG_INFO, NOQID, R_MSG_LA, name, CurrentLA);
sm_syslog(LOG_NOTICE, NOQID, R_MSG_LA, name, CurrentLA);
#if _FFR_REJECT_LOG
now = curtime();
if (firstrejtime[d] == 0)
{
firstrejtime[d] = now;
nextlogtime[d] = now + RejectLogInterval;
}
else if (nextlogtime[d] < now)
{
sm_syslog(LOG_ERR, NOQID, R2_MSG_LA, name,
pintvl(now - firstrejtime[d], true));
nextlogtime[d] = now + RejectLogInterval;
}
#endif /* _FFR_REJECT_LOG */
return true;
}
#if _FFR_REJECT_LOG
else
firstrejtime[d] = 0;
#endif /* _FFR_REJECT_LOG */
if (DelayLA > 0 && CurrentLA >= DelayLA)
{
@ -3069,13 +3101,13 @@ static char *DefaultUserShells[] =
# ifdef sgi
"/sbin/sh", /* SGI's shells really live in /sbin */
"/usr/bin/sh",
"/sbin/bsh", /* classic borne shell */
"/sbin/bsh", /* classic Bourne shell */
"/bin/bsh",
"/usr/bin/bsh",
"/sbin/csh", /* standard csh */
"/bin/csh",
"/usr/bin/csh",
"/sbin/jsh", /* classic borne shell w/ job control*/
"/sbin/jsh", /* classic Bourne shell w/ job control*/
"/bin/jsh",
"/usr/bin/jsh",
"/bin/ksh", /* Korn shell */
@ -3681,9 +3713,6 @@ chownsafe(fd, safedir)
# endif /* RLIMIT_NEEDS_SYS_TIME_H */
# include <sys/resource.h>
#endif /* HASSETRLIMIT */
#ifndef FD_SETSIZE
# define FD_SETSIZE 256
#endif /* ! FD_SETSIZE */
void
resetlimits()
@ -5887,6 +5916,9 @@ char *FFRCompileOptions[] =
#if _FFR_DAEMON_NETUNIX
"_FFR_DAEMON_NETUNIX",
#endif /* _FFR_DAEMON_NETUNIX */
#if _FFR_DEAL_WITH_ERROR_SSL
"_FFR_DEAL_WITH_ERROR_SSL",
#endif /* _FFR_DEAL_WITH_ERROR_SSL */
#if _FFR_DEPRECATE_MAILER_FLAG_I
"_FFR_DEPRECATE_MAILER_FLAG_I",
#endif /* _FFR_DEPRECATE_MAILER_FLAG_I */
@ -5960,6 +5992,9 @@ char *FFRCompileOptions[] =
"_FFR_MAX_FORWARD_ENTRIES",
#endif /* _FFR_MAX_FORWARD_ENTRIES */
#if MILTER
# if _FFR_MILTER_421
"_FFR_MILTER_421",
# endif /* _FFR_MILTER_421 */
# if _FFR_MILTER_PERDAEMON
"_FFR_MILTER_PERDAEMON",
# endif /* _FFR_MILTER_PERDAEMON */
@ -5968,10 +6003,6 @@ char *FFRCompileOptions[] =
/* Steven Pitzl */
"_FFR_NODELAYDSN_ON_HOLD",
#endif /* _FFR_NODELAYDSN_ON_HOLD */
#if _FFR_NONSTOP_PERSISTENCE
/* Suggested by Jan Krueger of digitalanswers communications consulting gmbh. */
"_FFR_NONSTOP_PERSISTENCE",
#endif /* _FFR_NONSTOP_PERSISTENCE */
#if _FFR_NO_PIPE
"_FFR_NO_PIPE",
#endif /* _FFR_NO_PIPE */
@ -5997,6 +6028,12 @@ char *FFRCompileOptions[] =
#if _FFR_REDIRECTEMPTY
"_FFR_REDIRECTEMPTY",
#endif /* _FFR_REDIRECTEMPTY */
#if _FFR_REJECT_LOG
"_FFR_REJECT_LOG",
#endif /* _FFR_REJECT_LOG */
#if _FFR_REQ_DIR_FSYNC_OPT
"_FFR_REQ_DIR_FSYNC_OPT",
#endif /* _FFR_REQ_DIR_FSYNC_OPT */
#if _FFR_RESET_MACRO_GLOBALS
"_FFR_RESET_MACRO_GLOBALS",
#endif /* _FFR_RESET_MACRO_GLOBALS */
@ -6029,6 +6066,9 @@ char *FFRCompileOptions[] =
/* Chris Adams of HiWAAY Informations Services */
"_FFR_SPT_ALIGN",
#endif /* _FFR_SPT_ALIGN */
#if _FFR_STRIPBACKSL
"_FFR_STRIPBACKSL",
#endif /* _FFR_STRIPBACKSL */
#if _FFR_TIMERS
"_FFR_TIMERS",
#endif /* _FFR_TIMERS */

View File

@ -10,7 +10,7 @@
* the sendmail distribution.
*
*
* $Id: conf.h,v 8.563 2002/06/04 02:13:50 geir Exp $
* $Id: conf.h,v 8.563.2.3 2002/10/31 03:28:36 ca Exp $
*/
/*
@ -63,6 +63,9 @@ struct rusage; /* forward declaration to get gcc to shut up in wait.h */
#define MAXLINE 2048 /* max line length */
#define MAXNAME 256 /* max length of a name */
#ifndef MAXAUTHINFO
# define MAXAUTHINFO 100 /* max length of authinfo token */
#endif /* ! MAXAUTHINFO */
#define MAXPV 256 /* max # of parms to mailers */
#define MAXATOM 1000 /* max atoms per address */
#define MAXRWSETS 200 /* max # of sets of rewriting rules */

View File

@ -15,7 +15,7 @@
#include <sendmail.h>
SM_RCSID("@(#)$Id: headers.c,v 8.266.4.1 2002/08/16 14:56:01 ca Exp $")
SM_RCSID("@(#)$Id: headers.c,v 8.266.4.2 2002/09/23 23:42:02 ca Exp $")
static size_t fix_mime_header __P((char *));
static int priencode __P((char *));
@ -930,7 +930,7 @@ logsender(e, msgid)
", daemon=%.20s", p);
sbp += strlen(sbp);
}
sm_syslog(LOG_INFO, e->e_id, "%.850s, relay=%.100s", sbuf, name);
sm_syslog(LOG_INFO, e->e_id, "%.850s, relay=%s", sbuf, name);
#else /* (SYSLOG_BUFSIZE) >= 256 */
@ -962,7 +962,7 @@ logsender(e, msgid)
sbp += strlen(sbp);
}
sm_syslog(LOG_INFO, e->e_id,
"%.400srelay=%.100s", sbuf, name);
"%.400srelay=%s", sbuf, name);
#endif /* (SYSLOG_BUFSIZE) >= 256 */
}
/*

View File

@ -9,15 +9,16 @@
.\" the sendmail distribution.
.\"
.\"
.\" $Id: mailq.1,v 8.19 2002/04/12 05:07:58 gshapiro Exp $
.\" $Id: mailq.1,v 8.19.2.1 2002/09/26 23:03:39 gshapiro Exp $
.\"
.TH MAILQ 1 "$Date: 2000/12/23 19:37:48 $"
.TH MAILQ 1 "$Date: 2002/09/26 23:03:39 $"
.SH NAME
mailq
\- print the mail queue
.SH SYNOPSIS
.B mailq
.RB [ \-Ac ]
.RB [ \-q... ]
.RB [ \-v ]
.SH DESCRIPTION
.B Mailq
@ -54,6 +55,27 @@ Show the mail submission queue specified in
instead of the MTA queue specified in
.IR /etc/mail/sendmail.cf .
.TP
\fB\-q\fR[\fI!\fR]I substr
Limit processed jobs to those containing
.I substr
as a substring of the queue id or not when
.I !
is specified.
.TP
\fB\-q\fR[\fI!\fR]R substr
Limit processed jobs to those containing
.I substr
as a substring of one of the recipients or not when
.I !
is specified.
.TP
\fB\-q\fR[\fI!\fR]S substr
Limit processed jobs to those containing
.I substr
as a substring of the sender or not when
.I !
is specified.
.TP
.B \-v
Print verbose information.
This adds the priority of the message and

View File

@ -15,7 +15,7 @@
#include <sendmail.h>
SM_RCSID("@(#)$Id: mci.c,v 8.205 2002/05/24 18:53:48 gshapiro Exp $")
SM_RCSID("@(#)$Id: mci.c,v 8.205.2.2 2002/11/26 19:15:19 gshapiro Exp $")
#if NETINET || NETINET6
# include <arpa/inet.h>
@ -1246,8 +1246,10 @@ mci_print_persistent(pathname, hostname)
locked ? '*' : ' ', hostname,
pintvl(curtime() - mcib.mci_lastuse, true));
if (mcib.mci_rstatus != NULL)
{
(void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, "%.*s\n", width,
mcib.mci_rstatus);
}
else if (mcib.mci_exitstat == EX_TEMPFAIL && mcib.mci_errno != 0)
(void) sm_io_fprintf(smioout, SM_TIME_DEFAULT,
"Deferred: %.*s\n", width - 10,

View File

@ -15,7 +15,7 @@
#include <sendmail.h>
SM_RCSID("@(#)$Id: savemail.c,v 8.299 2002/05/24 20:50:17 gshapiro Exp $")
SM_RCSID("@(#)$Id: savemail.c,v 8.299.2.1 2002/10/23 15:08:47 ca Exp $")
static void errbody __P((MCI *, ENVELOPE *, char *));
static bool pruneroute __P((char *));
@ -547,25 +547,7 @@ returntosender(msg, returnq, flags, e)
macdefine(&ee->e_macro, A_PERM, 'r', "");
macdefine(&ee->e_macro, A_PERM, 's', "localhost");
macdefine(&ee->e_macro, A_PERM, '_', "localhost");
#if SASL
macdefine(&ee->e_macro, A_PERM, macid("{auth_type}"), "");
macdefine(&ee->e_macro, A_PERM, macid("{auth_authen}"), "");
macdefine(&ee->e_macro, A_PERM, macid("{auth_author}"), "");
macdefine(&ee->e_macro, A_PERM, macid("{auth_ssf}"), "");
#endif /* SASL */
#if STARTTLS
macdefine(&ee->e_macro, A_PERM, macid("{cert_issuer}"), "");
macdefine(&ee->e_macro, A_PERM, macid("{cert_subject}"), "");
macdefine(&ee->e_macro, A_PERM, macid("{cipher_bits}"), "");
macdefine(&ee->e_macro, A_PERM, macid("{cipher}"), "");
macdefine(&ee->e_macro, A_PERM, macid("{tls_version}"), "");
macdefine(&ee->e_macro, A_PERM, macid("{verify}"), "");
# if _FFR_TLS_1
macdefine(&ee->e_macro, A_PERM, macid("{alg_bits}"), "");
macdefine(&ee->e_macro, A_PERM, macid("{cn_issuer}"), "");
macdefine(&ee->e_macro, A_PERM, macid("{cn_subject}"), "");
# endif /* _FFR_TLS_1 */
#endif /* STARTTLS */
clrsessenvelope(ee);
ee->e_puthdr = putheader;
ee->e_putbody = errbody;