summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/src
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2005-02-14 02:30:00 +0000
committergshapiro <gshapiro@FreeBSD.org>2005-02-14 02:30:00 +0000
commit59c6e3524b67debe90b8e7c57d4c84e7ea08a463 (patch)
tree43066d8dda87f5c4bb03cd123890866bdda87d3d /contrib/sendmail/src
parent142aa8a840a9a8f0bb93e21d623560b94228bb22 (diff)
parent9883351c45502bc6aec878ba11d8ef5fe1843397 (diff)
downloadFreeBSD-src-59c6e3524b67debe90b8e7c57d4c84e7ea08a463.zip
FreeBSD-src-59c6e3524b67debe90b8e7c57d4c84e7ea08a463.tar.gz
This commit was generated by cvs2svn to compensate for changes in r141858,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/sendmail/src')
-rw-r--r--contrib/sendmail/src/README6
-rw-r--r--contrib/sendmail/src/bf.c4
-rw-r--r--contrib/sendmail/src/collect.c15
-rw-r--r--contrib/sendmail/src/control.c7
-rw-r--r--contrib/sendmail/src/daemon.c19
-rw-r--r--contrib/sendmail/src/deliver.c25
-rw-r--r--contrib/sendmail/src/domain.c6
-rw-r--r--contrib/sendmail/src/helpfile4
-rw-r--r--contrib/sendmail/src/map.c8
-rw-r--r--contrib/sendmail/src/milter.c26
-rw-r--r--contrib/sendmail/src/mime.c8
-rw-r--r--contrib/sendmail/src/parseaddr.c4
-rw-r--r--contrib/sendmail/src/queue.c5
-rw-r--r--contrib/sendmail/src/readcf.c3
-rw-r--r--contrib/sendmail/src/recipient.c7
-rw-r--r--contrib/sendmail/src/sasl.c16
-rw-r--r--contrib/sendmail/src/sendmail.h13
-rw-r--r--contrib/sendmail/src/sfsasl.c41
-rw-r--r--contrib/sendmail/src/sm_resolve.c6
-rw-r--r--contrib/sendmail/src/srvrsmtp.c15
-rw-r--r--contrib/sendmail/src/tls.c5
-rw-r--r--contrib/sendmail/src/usersmtp.c41
-rw-r--r--contrib/sendmail/src/util.c5
-rw-r--r--contrib/sendmail/src/version.c6
24 files changed, 204 insertions, 91 deletions
diff --git a/contrib/sendmail/src/README b/contrib/sendmail/src/README
index b2e11c4..1d0b117 100644
--- a/contrib/sendmail/src/README
+++ b/contrib/sendmail/src/README
@@ -9,7 +9,7 @@
# the sendmail distribution.
#
#
-# $Id: README,v 8.384 2004/07/26 18:03:55 ca Exp $
+# $Id: README,v 8.385 2004/11/25 06:52:06 msk Exp $
#
This directory contains the source files for sendmail(TM).
@@ -624,7 +624,7 @@ STARTTLS Enables SMTP STARTTLS (RFC 2487). This requires OpenSSL
TLS_NO_RSA Turn off support for RSA algorithms in STARTTLS.
MILTER Turn on support for external filters using the Milter API;
this option is set by default, to turn it off use
- APPENDDEF(`conf_sendmail_ENVDEF', `-DMILTER')
+ APPENDDEF(`conf_sendmail_ENVDEF', `-DMILTER=0')
in devtools/Site/site.config.m4 (see devtools/README).
See libmilter/README for more information about milter.
REQUIRES_DIR_FSYNC Turn on support for file systems that require to
@@ -1823,4 +1823,4 @@ util.c Some general purpose routines used by sendmail.
version.c The version number and information about this
version of sendmail.
-(Version $Revision: 8.384 $, last update $Date: 2004/07/26 18:03:55 $ )
+(Version $Revision: 8.385 $, last update $Date: 2004/11/25 06:52:06 $ )
diff --git a/contrib/sendmail/src/bf.c b/contrib/sendmail/src/bf.c
index 211ed02..87bef77 100644
--- a/contrib/sendmail/src/bf.c
+++ b/contrib/sendmail/src/bf.c
@@ -18,7 +18,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: bf.c,v 8.60 2004/04/14 18:12:49 ca Exp $")
+SM_RCSID("@(#)$Id: bf.c,v 8.61 2004/08/03 23:59:02 ca Exp $")
#include <sys/types.h>
#include <sys/stat.h>
@@ -38,6 +38,8 @@ static ssize_t sm_bfread __P((SM_FILE_T *, char *, size_t));
static ssize_t sm_bfwrite __P((SM_FILE_T *, const char *, size_t));
static off_t sm_bfseek __P((SM_FILE_T *, off_t, int));
static int sm_bfclose __P((SM_FILE_T *));
+static int sm_bfcommit __P((SM_FILE_T *));
+static int sm_bftruncate __P((SM_FILE_T *));
static int sm_bfopen __P((SM_FILE_T *, const void *, int, const void *));
static int sm_bfsetinfo __P((SM_FILE_T *, int , void *));
diff --git a/contrib/sendmail/src/collect.c b/contrib/sendmail/src/collect.c
index 392941b..ac13007 100644
--- a/contrib/sendmail/src/collect.c
+++ b/contrib/sendmail/src/collect.c
@@ -13,9 +13,9 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: collect.c,v 8.254 2004/04/05 18:41:38 ca Exp $")
+SM_RCSID("@(#)$Id: collect.c,v 8.260 2004/11/30 23:29:15 ca Exp $")
-static void collecttimeout __P((time_t));
+static void collecttimeout __P((int));
static void eatfrom __P((char *volatile, ENVELOPE *));
static void collect_doheader __P((ENVELOPE *));
static SM_FILE_T *collect_dfopen __P((ENVELOPE *));
@@ -290,7 +290,7 @@ collect(fp, smtpmode, hdrp, e, rsetsize)
{
register SM_FILE_T *volatile df;
volatile bool ignrdot;
- volatile time_t dbto;
+ volatile int dbto;
register char *volatile bp;
volatile int c;
volatile bool inputerr;
@@ -308,7 +308,7 @@ collect(fp, smtpmode, hdrp, e, rsetsize)
df = NULL;
ignrdot = smtpmode ? false : IgnrDot;
- dbto = smtpmode ? TimeOuts.to_datablock : 0;
+ dbto = smtpmode ? (int) TimeOuts.to_datablock : 0;
c = SM_IO_EOF;
inputerr = false;
headeronly = hdrp != NULL;
@@ -525,14 +525,13 @@ bufferchar:
continue;
}
+ SM_ASSERT(mstate == MS_UFROM || mstate == MS_HEADER);
+
/* header -- buffer up */
if (bp >= &buf[buflen - 2])
{
char *obuf;
- if (mstate != MS_HEADER)
- break;
-
/* out of space for header */
obuf = buf;
if (buflen < MEMCHUNKSIZE)
@@ -909,7 +908,7 @@ readerr:
static void
collecttimeout(timeout)
- time_t timeout;
+ int timeout;
{
int save_errno = errno;
diff --git a/contrib/sendmail/src/control.c b/contrib/sendmail/src/control.c
index 60eab3c..0d7ee0b 100644
--- a/contrib/sendmail/src/control.c
+++ b/contrib/sendmail/src/control.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -10,7 +10,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: control.c,v 8.125 2003/06/24 17:46:06 ca Exp $")
+SM_RCSID("@(#)$Id: control.c,v 8.126 2004/08/04 20:54:00 ca Exp $")
#include <sm/fdset.h>
@@ -46,6 +46,7 @@ static struct cmd CmdTab[] =
+static void controltimeout __P((int));
int ControlSocket = -1;
/*
@@ -247,7 +248,7 @@ static jmp_buf CtxControlTimeout;
/* ARGSUSED0 */
static void
controltimeout(timeout)
- time_t timeout;
+ int timeout;
{
/*
** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD
diff --git a/contrib/sendmail/src/daemon.c b/contrib/sendmail/src/daemon.c
index c593901..0077e92 100644
--- a/contrib/sendmail/src/daemon.c
+++ b/contrib/sendmail/src/daemon.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: daemon.c,v 8.649 2004/07/14 21:57:52 ca Exp $")
+SM_RCSID("@(#)$Id: daemon.c,v 8.653 2004/11/18 23:45:01 ca Exp $")
#if defined(SOCK_STREAM) || defined(__GNU_LIBRARY__)
# define USE_SOCK_STREAM 1
@@ -81,10 +81,15 @@ struct daemon
typedef struct daemon DAEMON_T;
-static void connecttimeout __P((void));
+static void connecttimeout __P((int));
static int opendaemonsocket __P((DAEMON_T *, bool));
static unsigned short setupdaemon __P((SOCKADDR *));
static void getrequests_checkdiskspace __P((ENVELOPE *e));
+static void setsockaddroptions __P((char *, DAEMON_T *));
+static void printdaemonflags __P((DAEMON_T *));
+static int addr_family __P((char *));
+static int addrcmp __P((struct hostent *, char *, SOCKADDR *));
+static void authtimeout __P((int));
/*
** DAEMON.C -- routines to use when running as a daemon.
@@ -1414,7 +1419,7 @@ chkdaemonmodifiers(flag)
static void
setsockaddroptions(p, d)
- register char *p;
+ char *p;
DAEMON_T *d;
{
#if NETISO
@@ -2571,6 +2576,8 @@ gothostent:
break;
#endif /* NETINET6 */
}
+ if (tTd(16, 1))
+ sm_dprintf("Connecting to [%s]...\n", anynet_ntoa(&addr));
i = connect(s, (struct sockaddr *) &addr, addrlen);
save_errno = errno;
if (ev != NULL)
@@ -2774,7 +2781,8 @@ nextaddr:
}
static void
-connecttimeout()
+connecttimeout(ignore)
+ int ignore;
{
/*
** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD
@@ -3257,7 +3265,8 @@ addrcmp(hp, ha, sa)
static jmp_buf CtxAuthTimeout;
static void
-authtimeout()
+authtimeout(ignore)
+ int ignore;
{
/*
** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD
diff --git a/contrib/sendmail/src/deliver.c b/contrib/sendmail/src/deliver.c
index 5839cbe..96e16a3 100644
--- a/contrib/sendmail/src/deliver.c
+++ b/contrib/sendmail/src/deliver.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2005 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -14,7 +14,7 @@
#include <sendmail.h>
#include <sys/time.h>
-SM_RCSID("@(#)$Id: deliver.c,v 8.976 2004/07/23 20:45:01 gshapiro Exp $")
+SM_RCSID("@(#)$Id: deliver.c,v 8.983 2005/01/07 17:43:22 ca Exp $")
#if HASSETUSERCONTEXT
# include <login_cap.h>
@@ -28,10 +28,10 @@ SM_RCSID("@(#)$Id: deliver.c,v 8.976 2004/07/23 20:45:01 gshapiro Exp $")
# include "sfsasl.h"
#endif /* STARTTLS || SASL */
-void markfailure __P((ENVELOPE *, ADDRESS *, MCI *, int, bool));
static int deliver __P((ENVELOPE *, ADDRESS *));
static void dup_queue_file __P((ENVELOPE *, ENVELOPE *, int));
-static void mailfiletimeout __P((void));
+static void mailfiletimeout __P((int));
+static void endwaittimeout __P((int));
static int parse_hostsignature __P((char *, char **, MAILER *));
static void sendenvelope __P((ENVELOPE *, int));
extern MCI *mci_new __P((SM_RPOOL_T *));
@@ -1659,7 +1659,7 @@ deliver(e, firstto)
}
/*
- ** Strip one leading backslash if requested and the
+ ** Strip all leading backslashes if requested and the
** next character is alphanumerical (the latter can
** probably relaxed a bit, see RFC2821).
*/
@@ -3769,7 +3769,8 @@ markfailure(e, q, mci, rcode, ovr)
static jmp_buf EndWaitTimeout;
static void
-endwaittimeout()
+endwaittimeout(ignore)
+ int ignore;
{
/*
** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD
@@ -3797,7 +3798,10 @@ endmailer(mci, e, pv)
/* close output to mailer */
if (mci->mci_out != NULL)
+ {
(void) sm_io_close(mci->mci_out, SM_TIME_DEFAULT);
+ mci->mci_out = NULL;
+ }
/* copy any remaining input to transcript */
if (mci->mci_in != NULL && mci->mci_state != MCIS_ERROR &&
@@ -3824,8 +3828,10 @@ endmailer(mci, e, pv)
/* now close the input */
if (mci->mci_in != NULL)
+ {
(void) sm_io_close(mci->mci_in, SM_TIME_DEFAULT);
- mci->mci_in = mci->mci_out = NULL;
+ mci->mci_in = NULL;
+ }
mci->mci_state = MCIS_CLOSED;
errno = save_errno;
@@ -4001,7 +4007,7 @@ giveresponse(status, dsn, m, mci, ctladdr, xstart, e, to)
#ifdef EHOSTUNREACH
case EHOSTUNREACH: /* No route to host */
#endif /* EHOSTUNREACH */
- if (mci->mci_host != NULL)
+ if (mci != NULL && mci->mci_host != NULL)
{
(void) sm_strlcpyn(bp,
SPACELEFT(buf, bp),
@@ -5601,7 +5607,8 @@ mailfile(filename, mailer, ctladdr, sfflags, e)
}
static void
-mailfiletimeout()
+mailfiletimeout(ignore)
+ int ignore;
{
/*
** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD
diff --git a/contrib/sendmail/src/domain.c b/contrib/sendmail/src/domain.c
index dd24272..c215821 100644
--- a/contrib/sendmail/src/domain.c
+++ b/contrib/sendmail/src/domain.c
@@ -14,9 +14,9 @@
#include <sendmail.h>
#if NAMED_BIND
-SM_RCSID("@(#)$Id: domain.c,v 8.194 2004/01/14 01:47:34 ca Exp $ (with name server)")
+SM_RCSID("@(#)$Id: domain.c,v 8.195 2004/08/04 21:11:31 ca Exp $ (with name server)")
#else /* NAMED_BIND */
-SM_RCSID("@(#)$Id: domain.c,v 8.194 2004/01/14 01:47:34 ca Exp $ (without name server)")
+SM_RCSID("@(#)$Id: domain.c,v 8.195 2004/08/04 21:11:31 ca Exp $ (without name server)")
#endif /* NAMED_BIND */
#if NAMED_BIND
@@ -223,7 +223,7 @@ getmxrr(host, mxhosts, mxprefs, droplocalhost, rcode, tryfallback, pttl)
char *fallbackMX = FallbackMX;
bool trycanon = false;
unsigned short *prefs;
- int (*resfunc)();
+ int (*resfunc) __P((const char *, int, int, u_char *, int));
unsigned short prefer[MAXMXHOSTS];
int weight[MAXMXHOSTS];
int ttl = 0;
diff --git a/contrib/sendmail/src/helpfile b/contrib/sendmail/src/helpfile
index 931a06e..af8bd15 100644
--- a/contrib/sendmail/src/helpfile
+++ b/contrib/sendmail/src/helpfile
@@ -1,6 +1,6 @@
#vers 2
cpyr
-cpyr Copyright (c) 1998-2000, 2002 Sendmail, Inc. and its suppliers.
+cpyr Copyright (c) 1998-2000, 2002, 2004 Sendmail, Inc. and its suppliers.
cpyr All rights reserved.
cpyr Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
cpyr Copyright (c) 1988, 1993
@@ -11,7 +11,7 @@ cpyr By using this file, you agree to the terms and conditions set
cpyr forth in the LICENSE file which can be found at the top level of
cpyr the sendmail distribution.
cpyr
-cpyr $$Id: helpfile,v 8.40 2002/03/19 00:23:28 gshapiro Exp $$
+cpyr $$Id: helpfile,v 8.43 2004/10/29 18:05:39 ca Exp $$
cpyr
smtp This is sendmail version $v
smtp Topics:
diff --git a/contrib/sendmail/src/map.c b/contrib/sendmail/src/map.c
index ad9fa70..46bf15f 100644
--- a/contrib/sendmail/src/map.c
+++ b/contrib/sendmail/src/map.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: map.c,v 8.664 2004/06/28 17:46:13 ca Exp $")
+SM_RCSID("@(#)$Id: map.c,v 8.666 2004/08/17 16:50:19 gshapiro Exp $")
#if LDAPMAP
# include <sm/ldap.h>
@@ -4431,7 +4431,10 @@ ldapmap_parseargs(map, args)
}
}
lmap->ldap_attr[i] = NULL;
+
+ /* Set in case needed in future code */
attrssetup = true;
+
if (recurse && !normalseen)
{
syserr("LDAP recursion requested in %s but no returnable attribute given",
@@ -6470,6 +6473,9 @@ struct regex_map
char *regex_delim; /* move to type MAP */
};
+static int parse_fields __P((char *, int *, int, int));
+static char *regex_map_rewrite __P((MAP *, const char*, size_t, char **));
+
static int
parse_fields(s, ibuf, blen, nr_substrings)
char *s;
diff --git a/contrib/sendmail/src/milter.c b/contrib/sendmail/src/milter.c
index b89fac0..21374b8 100644
--- a/contrib/sendmail/src/milter.c
+++ b/contrib/sendmail/src/milter.c
@@ -10,7 +10,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: milter.c,v 8.225 2004/07/08 21:52:20 ca Exp $")
+SM_RCSID("@(#)$Id: milter.c,v 8.228 2004/11/09 18:54:55 ca Exp $")
#if MILTER
# include <libmilter/mfapi.h>
@@ -29,7 +29,7 @@ SM_RCSID("@(#)$Id: milter.c,v 8.225 2004/07/08 21:52:20 ca Exp $")
# include <sm/fdset.h>
-static void milter_connect_timeout __P((void));
+static void milter_connect_timeout __P((int));
static void milter_error __P((struct milter *, ENVELOPE *));
static int milter_open __P((struct milter *, bool, ENVELOPE *));
static void milter_parse_timeouts __P((char *, struct milter *));
@@ -75,6 +75,8 @@ static size_t MilterMaxDataSize = MILTER_MAX_DATA_SIZE;
} \
else if (bitnset(SMF_TEMPFAIL, m->mf_flags)) \
*state = SMFIR_TEMPFAIL; \
+ else if (bitnset(SMF_TEMPDROP, m->mf_flags)) \
+ *state = SMFIR_SHUTDOWN; \
else if (bitnset(SMF_REJECT, m->mf_flags)) \
*state = SMFIR_REJECT; \
else \
@@ -1127,7 +1129,8 @@ milter_open(m, parseonly, e)
}
static void
-milter_connect_timeout()
+milter_connect_timeout(ignore)
+ int ignore;
{
/*
** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD
@@ -2340,6 +2343,7 @@ milter_per_connection_check(e)
**
** Parameters:
** m -- the broken filter.
+** e -- current envelope.
**
** Returns:
** none
@@ -2351,10 +2355,8 @@ milter_error(m, e)
ENVELOPE *e;
{
/*
- ** We could send a quit here but
- ** we may have gotten here due to
- ** an I/O error so we don't want
- ** to try to make things worse.
+ ** We could send a quit here but we may have gotten here due to
+ ** an I/O error so we don't want to try to make things worse.
*/
if (m->mf_sock >= 0)
@@ -2832,13 +2834,21 @@ milter_changeheader(response, rlen, e)
if (*val == '\0')
{
if (tTd(64, 10))
- sm_dprintf("Delete (noop) %s:\n", field);
+ sm_dprintf("Delete (noop) %s\n", field);
+ if (MilterLogLevel > 8)
+ sm_syslog(LOG_INFO, e->e_id,
+ "Milter delete (noop): header: %s"
+ , field);
}
else
{
/* treat modify value with no existing header as add */
if (tTd(64, 10))
sm_dprintf("Add %s: %s\n", field, val);
+ if (MilterLogLevel > 8)
+ sm_syslog(LOG_INFO, e->e_id,
+ "Milter change (add): header: %s: %s"
+ , field, val);
addheader(newstr(field), val, H_USER, e);
}
return;
diff --git a/contrib/sendmail/src/mime.c b/contrib/sendmail/src/mime.c
index 6f4e782..fd3e65a 100644
--- a/contrib/sendmail/src/mime.c
+++ b/contrib/sendmail/src/mime.c
@@ -14,7 +14,7 @@
#include <sendmail.h>
#include <string.h>
-SM_RCSID("@(#)$Id: mime.c,v 8.136 2004/03/22 18:21:34 ca Exp $")
+SM_RCSID("@(#)$Id: mime.c,v 8.137 2004/09/02 21:37:26 ca Exp $")
/*
** MIME support.
@@ -848,7 +848,11 @@ mimeboundary(line, boundaries)
i--;
/* strip off trailing whitespace */
- while (i > 0 && (line[i - 1] == ' ' || line[i - 1] == '\t'))
+ while (i > 0 && (line[i - 1] == ' ' || line[i - 1] == '\t'
+#if _FFR_MIME_CR_OK
+ || line[i - 1] == '\r'
+#endif /* _FFR_MIME_CR_OK */
+ ))
i--;
savec = line[i];
line[i] = '\0';
diff --git a/contrib/sendmail/src/parseaddr.c b/contrib/sendmail/src/parseaddr.c
index e1c60c8..9050b97 100644
--- a/contrib/sendmail/src/parseaddr.c
+++ b/contrib/sendmail/src/parseaddr.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: parseaddr.c,v 8.378 2004/05/18 20:01:54 ca Exp $")
+SM_RCSID("@(#)$Id: parseaddr.c,v 8.379 2004/08/06 22:19:36 ca Exp $")
static void allocaddr __P((ADDRESS *, int, char *, ENVELOPE *));
static int callsubr __P((char**, int, ENVELOPE *));
@@ -2196,7 +2196,7 @@ cataddr(pvp, evp, buf, sz, spacesub)
/* Don't silently truncate long strings */
if (sz <= 0)
- syserr("cataddr: string too long");
+ usrerr("cataddr: string too long");
*p = '\0';
}
/*
diff --git a/contrib/sendmail/src/queue.c b/contrib/sendmail/src/queue.c
index f37a293..51d6b63 100644
--- a/contrib/sendmail/src/queue.c
+++ b/contrib/sendmail/src/queue.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: queue.c,v 8.938 2004/06/03 19:02:10 ca Exp $")
+SM_RCSID("@(#)$Id: queue.c,v 8.939 2004/08/03 19:57:23 ca Exp $")
#include <dirent.h>
@@ -2399,7 +2399,8 @@ doqueuerun()
*/
void
-runqueueevent()
+runqueueevent(ignore)
+ int ignore;
{
int save_errno = errno;
diff --git a/contrib/sendmail/src/readcf.c b/contrib/sendmail/src/readcf.c
index 49eb120..b362391 100644
--- a/contrib/sendmail/src/readcf.c
+++ b/contrib/sendmail/src/readcf.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: readcf.c,v 8.641 2004/07/23 20:45:02 gshapiro Exp $")
+SM_RCSID("@(#)$Id: readcf.c,v 8.642 2004/08/04 21:17:57 ca Exp $")
#if NETINET || NETINET6
# include <arpa/inet.h>
@@ -29,6 +29,7 @@ static char **makeargv __P((char *));
static void settimeout __P((char *, char *, bool));
static void toomany __P((int, int));
static char *extrquotstr __P((char *, char **, char *, bool *));
+static void parse_class_words __P((int, char *));
/*
** READCF -- read configuration file.
diff --git a/contrib/sendmail/src/recipient.c b/contrib/sendmail/src/recipient.c
index 02ef8d7..d952a8b 100644
--- a/contrib/sendmail/src/recipient.c
+++ b/contrib/sendmail/src/recipient.c
@@ -13,9 +13,9 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: recipient.c,v 8.336 2004/07/23 20:45:02 gshapiro Exp $")
+SM_RCSID("@(#)$Id: recipient.c,v 8.337 2004/08/03 19:57:23 ca Exp $")
-static void includetimeout __P((void));
+static void includetimeout __P((int));
static ADDRESS *self_reference __P((ADDRESS *));
static int sortexpensive __P((ADDRESS *, ADDRESS *));
static int sortbysignature __P((ADDRESS *, ADDRESS *));
@@ -1874,7 +1874,8 @@ resetuid:
}
static void
-includetimeout()
+includetimeout(ignore)
+ int ignore;
{
/*
** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD
diff --git a/contrib/sendmail/src/sasl.c b/contrib/sendmail/src/sasl.c
index e2bf415..9e368ff 100644
--- a/contrib/sendmail/src/sasl.c
+++ b/contrib/sendmail/src/sasl.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: sasl.c,v 8.20 2004/06/02 22:48:06 ca Exp $")
+SM_RCSID("@(#)$Id: sasl.c,v 8.21 2004/11/22 23:09:00 gshapiro Exp $")
#if SASL
# include <stdlib.h>
@@ -226,9 +226,6 @@ intersect(s1, s2, rpool)
# include <arpa/inet.h>
-# ifndef NI_WITHSCOPEID
-# define NI_WITHSCOPEID 0
-# endif
# ifndef NI_MAXHOST
# define NI_MAXHOST 1025
# endif
@@ -244,6 +241,9 @@ iptostring(addr, addrlen, out, outlen)
unsigned outlen;
{
char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV];
+# if NETINET6
+ int niflags;
+# endif /* NETINET6 */
if (addr == NULL || out == NULL)
{
@@ -252,9 +252,13 @@ iptostring(addr, addrlen, out, outlen)
}
# if NETINET6
+ niflags = (NI_NUMERICHOST | NI_NUMERICSERV);
+# ifdef NI_WITHSCOPEID
+ if (addr->sa.sa_family == AF_INET6)
+ niflags |= NI_WITHSCOPEID;
+# endif /* NI_WITHSCOPEID */
if (getnameinfo((struct sockaddr *) addr, addrlen,
- hbuf, sizeof hbuf, pbuf, sizeof pbuf,
- NI_NUMERICHOST | NI_WITHSCOPEID | NI_NUMERICSERV) != 0)
+ hbuf, sizeof hbuf, pbuf, sizeof pbuf, niflags) != 0)
return false;
# else /* NETINET6 */
if (addr->sa.sa_family != AF_INET)
diff --git a/contrib/sendmail/src/sendmail.h b/contrib/sendmail/src/sendmail.h
index 306605e..673cee5 100644
--- a/contrib/sendmail/src/sendmail.h
+++ b/contrib/sendmail/src/sendmail.h
@@ -52,7 +52,7 @@
#ifdef _DEFINE
# ifndef lint
-SM_UNUSED(static char SmailId[]) = "@(#)$Id: sendmail.h,v 8.984 2004/07/14 21:54:22 ca Exp $";
+SM_UNUSED(static char SmailId[]) = "@(#)$Id: sendmail.h,v 8.990 2004/11/09 19:45:46 ca Exp $";
# endif /* ! lint */
#endif /* _DEFINE */
@@ -400,7 +400,7 @@ struct mailer
#define M_ESMTP 'a' /* run Extended SMTP */
#define M_ALIASABLE 'A' /* user can be LHS of an alias */
#define M_BLANKEND 'b' /* ensure blank line at end of message */
-#define M_STRIPBACKSL 'B' /* strip leading backslash from user */
+#define M_STRIPBACKSL 'B' /* strip all leading backslashes from user */
#define M_NOCOMMENT 'c' /* don't include comment part of address */
#define M_CANONICAL 'C' /* make addresses canonical "u@dom" */
#define M_NOBRACKET 'd' /* never angle bracket envelope route-addrs */
@@ -463,7 +463,7 @@ struct mailer
extern void initerrmailers __P((void));
extern void makemailer __P((char *));
extern void makequeue __P((char *, bool));
-extern void runqueueevent __P((void));
+extern void runqueueevent __P((int));
#if _FFR_QUEUE_RUN_PARANOIA
extern bool checkqueuerunner __P((void));
#endif /* _FFR_QUEUE_RUN_PARANOIA */
@@ -1601,6 +1601,9 @@ extern void set_delivery_mode __P((int, ENVELOPE *));
#define PRIV_NOETRN 0x00080000 /* disallow ETRN command */
#define PRIV_NOBODYRETN 0x00100000 /* do not return bodies on bounces */
#define PRIV_NORECEIPTS 0x00200000 /* disallow return receipts */
+#if _FFR_PRIV_NOACTUALRECIPIENT
+# define PRIV_NOACTUALRECIPIENT 0x00400000 /* no X-Actual-Recipient in DSNs */
+#endif /* _FFR_PRIV_NOACTUALRECIPIENT */
/* don't give no info, anyway, anyhow */
#define PRIV_GOAWAY 0x0000ffff
@@ -1695,6 +1698,7 @@ struct milter
/* MTA flags */
# define SMF_REJECT 'R' /* Reject connection on filter fail */
# define SMF_TEMPFAIL 'T' /* tempfail connection on failure */
+# define SMF_TEMPDROP '4' /* 421 connection on failure */
/* states */
# define SMFS_CLOSED 'C' /* closed for all further actions */
@@ -2350,7 +2354,7 @@ extern void PRINTFLIKE(3, 4) sm_syslog __P((int, const char *, const char *, ...
/* SMTP */
extern void giveresponse __P((int, char *, MAILER *, MCI *, ADDRESS *, time_t, ENVELOPE *, ADDRESS *));
-extern int reply __P((MAILER *, MCI *, ENVELOPE *, time_t, void (*)(), char **, int));
+extern int reply __P((MAILER *, MCI *, ENVELOPE *, time_t, void (*)__P((char *, bool, MAILER *, MCI *, ENVELOPE *)), char **, int));
extern void smtp __P((char *volatile, BITMAP256, ENVELOPE *volatile));
#if SASL
extern int smtpauth __P((MAILER *, MCI *, ENVELOPE *));
@@ -2496,6 +2500,7 @@ extern void makelower __P((char *));
extern int makeconnection_ds __P((char *, MCI *));
extern int makeconnection __P((char *, volatile unsigned int, MCI *, ENVELOPE *, time_t));
extern void makeworkgroups __P((void));
+extern void markfailure __P((ENVELOPE *, ADDRESS *, MCI *, int, bool));
extern void mark_work_group_restart __P((int, int));
extern char * munchstring __P((char *, char **, int));
extern struct hostent *myhostname __P((char *, int));
diff --git a/contrib/sendmail/src/sfsasl.c b/contrib/sendmail/src/sfsasl.c
index ab8aca3..38eb7af 100644
--- a/contrib/sendmail/src/sfsasl.c
+++ b/contrib/sendmail/src/sfsasl.c
@@ -9,10 +9,16 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: sfsasl.c,v 8.98 2004/03/03 19:20:31 ca Exp $")
+SM_RCSID("@(#)$Id: sfsasl.c,v 8.101 2004/12/15 22:45:55 ca Exp $")
#include <stdlib.h>
#include <sendmail.h>
#include <errno.h>
+
+/* allow to disable error handling code just in case... */
+#ifndef DEAL_WITH_ERROR_SSL
+# define DEAL_WITH_ERROR_SSL 1
+#endif /* ! DEAL_WITH_ERROR_SSL */
+
#if SASL
# include "sfsasl.h"
@@ -279,10 +285,29 @@ sasl_write(fp, buf, size)
# else /* SASL >= 20000 */
char *outbuf;
# endif /* SASL >= 20000 */
- unsigned int outlen;
+ unsigned int outlen, *maxencode;
size_t ret = 0, total = 0;
struct sasl_obj *so = (struct sasl_obj *) fp->f_cookie;
+ /*
+ ** Fetch the maximum input buffer size for sasl_encode().
+ ** This can be less than the size set in attemptauth()
+ ** due to a negotation with the other side, e.g.,
+ ** Cyrus IMAP lmtp program sets maxbuf=4096,
+ ** digestmd5 substracts 25 and hence we'll get 4071
+ ** instead of 8192 (MAXOUTLEN).
+ ** Hack (for now): simply reduce the size, callers are (must be)
+ ** able to deal with that and invoke sasl_write() again with
+ ** the rest of the data.
+ ** Note: it would be better to store this value in the context
+ ** after the negotiation.
+ */
+
+ result = sasl_getprop(so->conn, SASL_MAXOUTBUF,
+ (const void **) &maxencode);
+ if (result == SASL_OK && size > *maxencode && *maxencode > 0)
+ size = *maxencode;
+
result = sasl_encode(so->conn, buf,
(unsigned int) size, &outbuf, &outlen);
@@ -580,19 +605,19 @@ tls_read(fp, buf, size)
*/
break;
case SSL_ERROR_SSL:
-#if _FFR_DEAL_WITH_ERROR_SSL
+#if DEAL_WITH_ERROR_SSL
if (r == 0 && errno == 0) /* out of protocol EOF found */
break;
-#endif /* _FFR_DEAL_WITH_ERROR_SSL */
+#endif /* DEAL_WITH_ERROR_SSL */
err = "generic SSL error";
if (LogLevel > 9)
tlslogerr("read");
-#if _FFR_DEAL_WITH_ERROR_SSL
+#if DEAL_WITH_ERROR_SSL
/* avoid repeated calls? */
if (r == 0)
r = -1;
-#endif /* _FFR_DEAL_WITH_ERROR_SSL */
+#endif /* DEAL_WITH_ERROR_SSL */
break;
}
if (err != NULL)
@@ -685,11 +710,11 @@ tls_write(fp, buf, size)
if (LogLevel > 9)
tlslogerr("write");
-#if _FFR_DEAL_WITH_ERROR_SSL
+#if DEAL_WITH_ERROR_SSL
/* avoid repeated calls? */
if (r == 0)
r = -1;
-#endif /* _FFR_DEAL_WITH_ERROR_SSL */
+#endif /* DEAL_WITH_ERROR_SSL */
break;
}
if (err != NULL)
diff --git a/contrib/sendmail/src/sm_resolve.c b/contrib/sendmail/src/sm_resolve.c
index d788d00..affd3e5 100644
--- a/contrib/sendmail/src/sm_resolve.c
+++ b/contrib/sendmail/src/sm_resolve.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000-2003 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 2000-2004 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -46,7 +46,7 @@
# if NAMED_BIND
# include "sm_resolve.h"
-SM_RCSID("$Id: sm_resolve.c,v 8.32 2003/03/22 22:57:26 ca Exp $")
+SM_RCSID("$Id: sm_resolve.c,v 8.33 2004/08/04 21:17:57 ca Exp $")
static struct stot
{
@@ -70,6 +70,8 @@ static struct stot
{ NULL, 0 }
};
+static DNS_REPLY_T *parse_dns_reply __P((unsigned char *, int));
+
/*
** DNS_STRING_TO_TYPE -- convert resource record name into type
**
diff --git a/contrib/sendmail/src/srvrsmtp.c b/contrib/sendmail/src/srvrsmtp.c
index cb0366e..ff06bf2 100644
--- a/contrib/sendmail/src/srvrsmtp.c
+++ b/contrib/sendmail/src/srvrsmtp.c
@@ -17,7 +17,7 @@
# include <libmilter/mfdef.h>
#endif /* MILTER */
-SM_RCSID("@(#)$Id: srvrsmtp.c,v 8.900 2004/07/08 23:29:33 ca Exp $")
+SM_RCSID("@(#)$Id: srvrsmtp.c,v 8.902 2004/11/18 21:46:01 ca Exp $")
#include <sys/time.h>
#include <sm/fdset.h>
@@ -1966,6 +1966,13 @@ tlsfail:
/* only complain if strict check */
ok = AllowBogusHELO;
+
+ /* allow trailing whitespace */
+ while (!ok && *++q != '\0' &&
+ isspace(*q))
+ ;
+ if (*q == '\0')
+ ok = true;
break;
}
if (strchr("[].-_#:", *q) == NULL)
@@ -4110,7 +4117,9 @@ rcpt_esmtp_args(a, kp, vp, e)
return;
for (p = vp; p != NULL; vp = p)
{
- p = strchr(p, ',');
+ char *s;
+
+ s = p = strchr(p, ',');
if (p != NULL)
*p++ = '\0';
if (sm_strcasecmp(vp, "success") == 0)
@@ -4125,6 +4134,8 @@ rcpt_esmtp_args(a, kp, vp, e)
vp);
/* NOTREACHED */
}
+ if (s != NULL)
+ *s = ',';
}
}
else if (sm_strcasecmp(kp, "orcpt") == 0)
diff --git a/contrib/sendmail/src/tls.c b/contrib/sendmail/src/tls.c
index 6a8e8a1..1867097 100644
--- a/contrib/sendmail/src/tls.c
+++ b/contrib/sendmail/src/tls.c
@@ -10,7 +10,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: tls.c,v 8.95 2004/07/13 21:37:33 ca Exp $")
+SM_RCSID("@(#)$Id: tls.c,v 8.96 2004/08/04 21:17:58 ca Exp $")
#if STARTTLS
# include <openssl/err.h>
@@ -39,6 +39,9 @@ static int x509_verify_cb __P((int, X509_STORE_CTX *));
# define CONST097 const
# endif /* !defined() || OPENSSL_VERSION_NUMBER < 0x00907000L */
static void apps_ssl_info_cb __P((CONST097 SSL *, int , int));
+static bool tls_ok_f __P((char *, char *, int));
+static bool tls_safe_f __P((char *, long, bool));
+static int tls_verify_log __P((int, X509_STORE_CTX *, char *));
# if !NO_DH
static DH *get_dh512 __P((void));
diff --git a/contrib/sendmail/src/usersmtp.c b/contrib/sendmail/src/usersmtp.c
index 5c2b8f8..0bcbcf5 100644
--- a/contrib/sendmail/src/usersmtp.c
+++ b/contrib/sendmail/src/usersmtp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2005 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -13,13 +13,12 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: usersmtp.c,v 8.451 2004/03/01 21:50:36 ca Exp $")
+SM_RCSID("@(#)$Id: usersmtp.c,v 8.460 2005/01/11 00:24:19 ca Exp $")
#include <sysexits.h>
-extern void markfailure __P((ENVELOPE *, ADDRESS *, MCI *, int, bool));
-static void datatimeout __P((void));
+static void datatimeout __P((int));
static void esmtp_check __P((char *, bool, MAILER *, MCI *, ENVELOPE *));
static void helo_options __P((char *, bool, MAILER *, MCI *, ENVELOPE *));
static int smtprcptstat __P((ADDRESS *, MAILER *, MCI *, ENVELOPE *));
@@ -2560,6 +2559,20 @@ smtpdata(m, mci, e, ctladdr, xstart)
mci->mci_nextaddr = mci->mci_nextaddr->q_pchain;
}
e->e_to = oldto;
+
+ /*
+ ** Connection might be closed in response to a RCPT command,
+ ** i.e., the server responded with 421. In that case (at
+ ** least) one RCPT has a temporary failure, hence we don't
+ ** need to check mci_okrcpts (as it is done below) to figure
+ ** out which error to return.
+ */
+
+ if (mci->mci_state == MCIS_CLOSED)
+ {
+ errno = mci->mci_errno;
+ return EX_TEMPFAIL;
+ }
}
#endif /* PIPELINING */
@@ -2724,7 +2737,8 @@ smtpdata(m, mci, e, ctladdr, xstart)
r = reply(m, mci, e, TimeOuts.to_datafinal, NULL, &enhsc, XS_DEFAULT);
if (r < 0)
return EX_TEMPFAIL;
- mci->mci_state = MCIS_OPEN;
+ if (mci->mci_state == MCIS_DATA)
+ mci->mci_state = MCIS_OPEN;
xstat = EX_NOTSTICKY;
if (r == 452)
rstat = EX_TEMPFAIL;
@@ -2761,7 +2775,8 @@ smtpdata(m, mci, e, ctladdr, xstart)
}
static void
-datatimeout()
+datatimeout(ignore)
+ int ignore;
{
int save_errno = errno;
@@ -2997,10 +3012,12 @@ smtprset(m, mci, e)
** to take when a value other than 250 is received.
**
** However, if 421 is returned for the RSET, leave
- ** mci_state as MCIS_SSD (set in reply()).
+ ** mci_state alone (MCIS_SSD can be set in reply()
+ ** and MCIS_CLOSED can be set in smtpquit() if
+ ** reply() gets a 421 and calls smtpquit()).
*/
- if (mci->mci_state != MCIS_SSD)
+ if (mci->mci_state != MCIS_SSD && mci->mci_state != MCIS_CLOSED)
mci->mci_state = MCIS_OPEN;
}
/*
@@ -3063,7 +3080,7 @@ reply(m, mci, e, timeout, pfunc, enhstat, rtype)
MCI *mci;
ENVELOPE *e;
time_t timeout;
- void (*pfunc)();
+ void (*pfunc) __P((char *, bool, MAILER *, MCI *, ENVELOPE *));
char **enhstat;
int rtype;
{
@@ -3106,7 +3123,7 @@ reply(m, mci, e, timeout, pfunc, enhstat, rtype)
if (mci->mci_state == MCIS_CLOSED)
return SMTPCLOSING;
- /* don't try to read from a non-existant fd */
+ /* don't try to read from a non-existent fd */
if (mci->mci_in == NULL)
{
if (mci->mci_errno == 0)
@@ -3116,6 +3133,7 @@ reply(m, mci, e, timeout, pfunc, enhstat, rtype)
if (strncmp(SmtpMsgBuffer, "QUIT", 4) == 0)
{
errno = mci->mci_errno;
+ mci->mci_state = MCIS_CLOSED;
return -1;
}
mci->mci_state = MCIS_ERROR;
@@ -3139,7 +3157,10 @@ reply(m, mci, e, timeout, pfunc, enhstat, rtype)
/* errors on QUIT should be ignored */
if (strncmp(SmtpMsgBuffer, "QUIT", 4) == 0)
+ {
+ mci->mci_state = MCIS_CLOSED;
return -1;
+ }
/* if the remote end closed early, fake an error */
errno = save_errno;
diff --git a/contrib/sendmail/src/util.c b/contrib/sendmail/src/util.c
index 6945e64..e7a3ff0 100644
--- a/contrib/sendmail/src/util.c
+++ b/contrib/sendmail/src/util.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: util.c,v 8.382 2004/03/26 19:01:10 ca Exp $")
+SM_RCSID("@(#)$Id: util.c,v 8.383 2004/08/02 18:50:59 ca Exp $")
#include <sysexits.h>
#include <sm/xtrap.h>
@@ -93,7 +93,8 @@ addquotes(s, rpool)
}
/*
-** STRIPBACKSLASH -- Strip leading backslash from a string.
+** STRIPBACKSLASH -- Strip all leading backslashes from a string, provided
+** the following character is alpha-numerical.
**
** This is done in place.
**
diff --git a/contrib/sendmail/src/version.c b/contrib/sendmail/src/version.c
index 6ea57aa..af2baa2 100644
--- a/contrib/sendmail/src/version.c
+++ b/contrib/sendmail/src/version.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2005 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -13,6 +13,6 @@
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: version.c,v 8.130 2004/07/30 18:03:07 ca Exp $")
+SM_RCSID("@(#)$Id: version.c,v 8.140 2005/01/12 04:32:32 ca Exp $")
-char Version[] = "8.13.1";
+char Version[] = "8.13.3";
OpenPOWER on IntegriCloud