summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2012-12-26 11:44:13 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2012-12-26 11:44:13 +0000
commit4d612c66ca38bf450cb5d46f161adc606563072d (patch)
tree717862651d705cd071d2d0c6747bd2d99589d420 /gnu
parentae0e4711503c4a37fccc12e6cfd74c0cc3108d0a (diff)
Update to sendmail 8.14.6
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.sbin/sendmail/LICENSE4
-rw-r--r--gnu/usr.sbin/sendmail/RELEASE_NOTES51
-rw-r--r--gnu/usr.sbin/sendmail/cf/README8
-rw-r--r--gnu/usr.sbin/sendmail/cf/feature/ldap_routing.m42
-rw-r--r--gnu/usr.sbin/sendmail/cf/m4/proto.m47
-rw-r--r--gnu/usr.sbin/sendmail/cf/m4/version.m46
-rw-r--r--gnu/usr.sbin/sendmail/doc/op/op.me12
-rw-r--r--gnu/usr.sbin/sendmail/include/libmilter/mfapi.h7
-rw-r--r--gnu/usr.sbin/sendmail/include/sm/clock.h4
-rw-r--r--gnu/usr.sbin/sendmail/include/sm/tailq.h8
-rw-r--r--gnu/usr.sbin/sendmail/libmilter/docs/api.html3
-rw-r--r--gnu/usr.sbin/sendmail/libmilter/docs/smfi_setsymlist.html10
-rw-r--r--gnu/usr.sbin/sendmail/libmilter/docs/smfi_settimeout.html17
-rw-r--r--gnu/usr.sbin/sendmail/libmilter/worker.c37
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/TRACEFLAGS15
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/collect.c5
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/conf.c30
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/daemon.c5
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/deliver.c19
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/headers.c6
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/main.c8
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/map.c14
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/milter.c224
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/parseaddr.c3
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/queue.c25
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/sasl.c24
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/savemail.c34
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/sendmail.h28
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c22
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/stab.c8
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/util.c17
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/version.c6
32 files changed, 425 insertions, 244 deletions
diff --git a/gnu/usr.sbin/sendmail/LICENSE b/gnu/usr.sbin/sendmail/LICENSE
index b0e2c0ed84b..ddaec6b1b38 100644
--- a/gnu/usr.sbin/sendmail/LICENSE
+++ b/gnu/usr.sbin/sendmail/LICENSE
@@ -35,7 +35,7 @@ each of the following conditions is met:
forth as paragraph 6 below, in the documentation and/or other materials
provided with the distribution. For the purposes of binary distribution
the "Copyright Notice" refers to the following language:
- "Copyright (c) 1998-2010 Sendmail, Inc. All rights reserved."
+ "Copyright (c) 1998-2012 Sendmail, Inc. All rights reserved."
4. Neither the name of Sendmail, Inc. nor the University of California nor
names of their contributors may be used to endorse or promote
@@ -78,4 +78,4 @@ each of the following conditions is met:
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-$Revision: 1.9 $, Last updated $Date: 2011/05/17 15:54:23 $, Document 139848.1
+$Revision: 1.10 $, Last updated $Date: 2012/12/26 11:44:11 $, Document 139848.1
diff --git a/gnu/usr.sbin/sendmail/RELEASE_NOTES b/gnu/usr.sbin/sendmail/RELEASE_NOTES
index fbbf4ca7b86..c6e625a5876 100644
--- a/gnu/usr.sbin/sendmail/RELEASE_NOTES
+++ b/gnu/usr.sbin/sendmail/RELEASE_NOTES
@@ -1,11 +1,60 @@
SENDMAIL RELEASE NOTES
- $Sendmail: RELEASE_NOTES,v 8.1991 2011/05/15 04:28:16 ca Exp $
+ $Sendmail: RELEASE_NOTES,v 8.2011 2012/12/21 18:42:16 ca Exp $
This listing shows the version of the sendmail binary, the version
of the sendmail configuration files, the date of release, and a
summary of the changes in that release.
+8.14.6/8.14.6 2012/12/23
+ Fix a regression introduced in 8.14.5: if a server offers
+ two AUTH lines, the MTA would not read them after
+ STARTTLS has been used and hence SMTP AUTH for
+ the client side would fail. Problem noted by Lena.
+ Do not cache hostnames internally in a non case sensitive way
+ as that may cause addresses to change from lower case
+ to upper case or vice versa. These header modifications
+ can cause problems with milters that rely on receiving
+ headers in the same way as they are being sent out such
+ as a DKIM signing milter.
+ If MaxQueueChildren is set then it was possible that new queue
+ runners could not be started anymore because an
+ internal counter was subject to a race condition.
+ If a milter decreases the timeout it waits for a communication
+ with the MTA, the MTA might experience a write() timeout.
+ In some situations, the resulting error might have been
+ ignored. Problem noted by Werner Wiethege.
+ Note: decreasing the communication timeout in a milter
+ should not be done without considering the potential
+ problems.
+ smfi_setsymlist() now properly sets the list of macros for
+ the milter which invoked it, instead of a global
+ list for all milters. Problem reported by
+ David Shrimpton of the University of Queensland.
+ If Timeout.resolver.retrans is set to a value larger than 20,
+ then resolver.retry was temporarily set to 0 for
+ gethostbyaddr() lookups. Now it is set to 1 instead.
+ Patch from Peter.
+ If sendmail could not lock the statistics file due to a system
+ error, and sendmail later sends a DSN for a mail that
+ triggered such an error, then sendmail tried to access
+ memory that was freed before (causing a crash on some
+ systems). Problem reported by Ryan Stone.
+ Do not log negative values for size= nor pri= to avoid confusing
+ log parsers, instead limit the values to LONG_MAX.
+ Account for an API change in newer versions of Cyrus-SASL.
+ Patch from Hajimu UMEMOTO from FreeBSD.
+ Do not try to resolve link-local addresses for IPv4 (just as it
+ is done for IPv6). Patch from John Beck of Oracle.
+ Improve logging of client and server STARTTLS connection failures
+ that may be due to incompatible cipher lists by including
+ the reason for the failure in a single log line. Suggested
+ by James Carey of Boeing.
+ Portability:
+ Add support for Darwin 11.x and 12.x (Mac OS X 10.7 and 10.8).
+ Add support for SunOS 5.12 (aka Solaris 12). Patch from
+ John Beck of Oracle.
+
8.14.5/8.14.5 2011/05/17
Do not cache SMTP extensions across connections as the cache
is based on hostname which may not be a unique identifier
diff --git a/gnu/usr.sbin/sendmail/cf/README b/gnu/usr.sbin/sendmail/cf/README
index 46b4d1da046..a2a3e61eaf1 100644
--- a/gnu/usr.sbin/sendmail/cf/README
+++ b/gnu/usr.sbin/sendmail/cf/README
@@ -1144,7 +1144,7 @@ relay_hosts_only
For example, if you specify ``foo.com'', then mail to or
from foo.com, abc.foo.com, or a.very.deep.domain.foo.com
will all be accepted for relaying. This feature changes
- the behaviour to lookup individual host names only.
+ the behaviour to look up individual host names only.
relay_based_on_MX
Turns on the ability to allow relaying based on the MX
@@ -2230,9 +2230,9 @@ command:
FEATURE(`ldap_routing', <mailHost>, <mailRoutingAddress>, <bounce>,
<detail>, <nodomain>, <tempfail>)
-where <mailHost> is a map definition describing how to lookup an alternative
+where <mailHost> is a map definition describing how to look up an alternative
mail host for a particular address; <mailRoutingAddress> is a map definition
-describing how to lookup an alternative address for a particular address;
+describing how to look up an alternative address for a particular address;
the <bounce> argument, if present and not the word "passthru", dictates
that mail should be bounced if neither a mailHost nor mailRoutingAddress
is found, if set to "sendertoo", the sender will be rejected if not
@@ -4701,4 +4701,4 @@ M4 DIVERSIONS
8 DNS based blacklists
9 special local rulesets (1 and 2)
-$Revision: 1.29 $, Last updated $Date: 2011/05/17 15:54:23 $
+$Revision: 1.30 $, Last updated $Date: 2012/12/26 11:44:11 $
diff --git a/gnu/usr.sbin/sendmail/cf/feature/ldap_routing.m4 b/gnu/usr.sbin/sendmail/cf/feature/ldap_routing.m4
index 2351bde2628..18f510a5146 100644
--- a/gnu/usr.sbin/sendmail/cf/feature/ldap_routing.m4
+++ b/gnu/usr.sbin/sendmail/cf/feature/ldap_routing.m4
@@ -10,7 +10,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`$Sendmail: ldap_routing.m4,v 8.18 2010/01/05 00:57:27 ca Exp $')
+VERSIONID(`$Sendmail: ldap_routing.m4,v 8.20 2012/01/18 22:27:06 ca Exp $')
divert(-1)
# Check first two arguments. If they aren't set, may need to warn in proto.m4
diff --git a/gnu/usr.sbin/sendmail/cf/m4/proto.m4 b/gnu/usr.sbin/sendmail/cf/m4/proto.m4
index 12884694eec..ffd997f12ca 100644
--- a/gnu/usr.sbin/sendmail/cf/m4/proto.m4
+++ b/gnu/usr.sbin/sendmail/cf/m4/proto.m4
@@ -13,7 +13,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`$Sendmail: proto.m4,v 8.744 2010/11/23 20:29:47 guenther Exp $')
+VERSIONID(`$Sendmail: proto.m4,v 8.760 2012/09/07 16:30:15 ca Exp $')
# level CF_LEVEL config file format
V`'CF_LEVEL`'ifdef(`NO_VENDOR',`', `/ifdef(`VENDOR_NAME', `VENDOR_NAME', `Berkeley')')
@@ -1532,8 +1532,9 @@ R<?> <e s> <$+> $#error $@ nouser $: "550 User unknown"')
R<?> <$*> <$+> $@ $2',
`dnl
# return the original address
-R<> <> <$+> <@ $+> <$*> $@ $1')',
-`dnl')
+R<> <> <$+> <@ $+> <$*> $@ $1')
+')
+
ifelse(substr(confDELIVERY_MODE,0,1), `d', `errprint(`WARNING: Antispam rules not available in deferred delivery mode.
')')
diff --git a/gnu/usr.sbin/sendmail/cf/m4/version.m4 b/gnu/usr.sbin/sendmail/cf/m4/version.m4
index 262cd0e69d1..94b1e97db82 100644
--- a/gnu/usr.sbin/sendmail/cf/m4/version.m4
+++ b/gnu/usr.sbin/sendmail/cf/m4/version.m4
@@ -1,6 +1,6 @@
divert(-1)
#
-# Copyright (c) 1998-2011 Sendmail, Inc. and its suppliers.
+# Copyright (c) 1998-2012 Sendmail, Inc. and its suppliers.
# All rights reserved.
# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
@@ -11,8 +11,8 @@ divert(-1)
# the sendmail distribution.
#
#
-VERSIONID(`$Sendmail: version.m4,v 8.214 2011/04/26 23:02:36 ca Exp $')
+VERSIONID(`$Sendmail: version.m4,v 8.222 2012/12/19 05:11:43 ca Exp $')
#
divert(0)
# Configuration version number
-DZ8.14.5`'ifdef(`confCF_VERSION', `/confCF_VERSION')
+DZ8.14.6`'ifdef(`confCF_VERSION', `/confCF_VERSION')
diff --git a/gnu/usr.sbin/sendmail/doc/op/op.me b/gnu/usr.sbin/sendmail/doc/op/op.me
index d4c495cb646..585428ec882 100644
--- a/gnu/usr.sbin/sendmail/doc/op/op.me
+++ b/gnu/usr.sbin/sendmail/doc/op/op.me
@@ -9,7 +9,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" $Sendmail: op.me,v 8.747 2010/05/08 04:18:27 ca Exp $
+.\" $Sendmail: op.me,v 8.749 2012/03/02 22:37:11 ca Exp $
.\"
.\" eqn op.me | pic | troff -me
.\"
@@ -90,7 +90,7 @@ Sendmail, Inc.
.de Ve
Version \\$2
..
-.Ve $Revision: 1.28 $
+.Ve $Revision: 1.29 $
.rm Ve
.sp
For Sendmail Version 8.14
@@ -5999,7 +5999,7 @@ mailer.
.ip @
Look up addresses in the user database.
.ip %
-Do not attempt delivery on initial recipient of a message
+Do not attempt delivery on initial receipt of a message
or on queue runs
unless the queued message is selected
using one of the -qI/-qR/-qS queue run modifiers
@@ -7540,6 +7540,10 @@ This is intended to allow you to get responsiveness
by processing the queue fairly frequently
without thrashing your system by trying jobs too often.
The default units are minutes.
+Note:
+This option is ignored for queue runs that select a subset
+of the queue, i.e.,
+.q \-q[!][I|R|S|Q][string]
.ip MustQuoteChars=\fIs\fP
[no short name]
Sets the list of characters that must be quoted if used in a full name
@@ -11467,7 +11471,7 @@ replace it with a blank sheet for double-sided output.
.\".sz 10
.\"Eric Allman
.\".sp
-.\"Version $Revision: 1.28 $
+.\"Version $Revision: 1.29 $
.\".ce 0
.bp 3
.ce
diff --git a/gnu/usr.sbin/sendmail/include/libmilter/mfapi.h b/gnu/usr.sbin/sendmail/include/libmilter/mfapi.h
index aa71cfa7e8a..3ff56050679 100644
--- a/gnu/usr.sbin/sendmail/include/libmilter/mfapi.h
+++ b/gnu/usr.sbin/sendmail/include/libmilter/mfapi.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2004, 2006, 2008 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2004, 2006, 2008, 2012 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -7,7 +7,7 @@
* the sendmail distribution.
*
*
- * $Sendmail: mfapi.h,v 8.80 2009/11/06 00:57:08 ca Exp $
+ * $Sendmail: mfapi.h,v 8.82 2012/11/16 20:25:04 ca Exp $
*/
/*
@@ -96,6 +96,8 @@ typedef int sfsistat;
# ifndef bool
# ifndef __bool_true_false_are_defined
typedef int bool;
+# define false 0
+# define true 1
# define __bool_true_false_are_defined 1
# endif /* ! __bool_true_false_are_defined */
# endif /* bool */
@@ -204,6 +206,7 @@ LIBMILTER_API int smfi_version __P((unsigned int *, unsigned int *, unsigned int
** (hence the list is not sorted by the SMT protocol steps).
*/
+#define SMFIM_NOMACROS (-1) /* Do NOT use, internal only */
#define SMFIM_FIRST 0 /* Do NOT use, internal marker only */
#define SMFIM_CONNECT 0 /* connect */
#define SMFIM_HELO 1 /* HELO/EHLO */
diff --git a/gnu/usr.sbin/sendmail/include/sm/clock.h b/gnu/usr.sbin/sendmail/include/sm/clock.h
index a54262c6d7c..2e0ef3581f5 100644
--- a/gnu/usr.sbin/sendmail/include/sm/clock.h
+++ b/gnu/usr.sbin/sendmail/include/sm/clock.h
@@ -9,7 +9,7 @@
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
- * $Sendmail: clock.h,v 1.12 2004/08/03 19:57:21 ca Exp $
+ * $Sendmail: clock.h,v 1.13 2011/11/03 03:13:24 ca Exp $
*/
/*
@@ -59,7 +59,7 @@ extern SIGFUNC_DECL sm_tick __P((int));
/*
** SM_SETEVENT -- set an event to happen at a specific time in seconds.
**
-** Translates the seconds into millseconds and calls sm_seteventm()
+** Translates the seconds into milliseconds and calls sm_seteventm()
** to get a specific event to happen in the future at a specific time.
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/include/sm/tailq.h b/gnu/usr.sbin/sendmail/include/sm/tailq.h
index cd1af7c56a3..d71a3b6230a 100644
--- a/gnu/usr.sbin/sendmail/include/sm/tailq.h
+++ b/gnu/usr.sbin/sendmail/include/sm/tailq.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tailq.h,v 1.2 2008/05/04 18:34:04 millert Exp $ */
+/* $OpenBSD: tailq.h,v 1.3 2012/12/26 11:44:12 millert Exp $ */
/* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */
/*
@@ -36,7 +36,7 @@
#define SM_TAILQ_H_
/*
- * $Sendmail: tailq.h,v 1.2 2007/06/29 23:09:57 ca Exp $
+ * $Sendmail: tailq.h,v 1.3 2012/01/21 00:12:14 ashish Exp $
*
* This file is a modified copy of queue.h from a BSD system:
* we only need tail queues here.
@@ -69,8 +69,8 @@ struct { \
struct type **tqe_prev; /* address of previous next element */ \
}
-/*
- * tail queue access methods
+/*
+ * tail queue access methods
*/
#define SM_TAILQ_FIRST(head) ((head)->tqh_first)
#define SM_TAILQ_END(head) NULL
diff --git a/gnu/usr.sbin/sendmail/libmilter/docs/api.html b/gnu/usr.sbin/sendmail/libmilter/docs/api.html
index 529abd6c271..c7e8bb069a3 100644
--- a/gnu/usr.sbin/sendmail/libmilter/docs/api.html
+++ b/gnu/usr.sbin/sendmail/libmilter/docs/api.html
@@ -2,7 +2,7 @@
<HEAD><TITLE>Milter API</TITLE></HEAD>
<BODY>
<!--
-$Sendmail: api.html,v 1.37 2009/05/19 00:40:52 ca Exp $
+$Sendmail: api.html,v 1.38 2012/03/29 03:18:37 ca Exp $
-->
<H1>Milter API</H1>
@@ -214,7 +214,6 @@ other callbacks are message-oriented.
<TD>SMFIS_REJECT</TD>
<TD>For a connection-oriented routine, reject this connection; call <A HREF="xxfi_close.html">xxfi_close</A>.<BR>
For a message-oriented routine (except
- <A HREF="xxfi_eom.html">xxfi_eom</A> or
<A HREF="xxfi_abort.html">xxfi_abort</A>), reject this message.<BR>
For a recipient-oriented routine, reject the current recipient (but continue processing the current message).
</TD>
diff --git a/gnu/usr.sbin/sendmail/libmilter/docs/smfi_setsymlist.html b/gnu/usr.sbin/sendmail/libmilter/docs/smfi_setsymlist.html
index 275d43016fe..2d6d232af9b 100644
--- a/gnu/usr.sbin/sendmail/libmilter/docs/smfi_setsymlist.html
+++ b/gnu/usr.sbin/sendmail/libmilter/docs/smfi_setsymlist.html
@@ -2,7 +2,7 @@
<HEAD><TITLE>smfi_setsymlist</TITLE></HEAD>
<BODY>
<!--
-$Sendmail: smfi_setsymlist.html,v 1.5 2006/12/21 18:30:35 ca Exp $
+$Sendmail: smfi_setsymlist.html,v 1.6 2012/05/11 17:34:23 ca Exp $
-->
<H1>smfi_setsymlist</H1>
@@ -86,8 +86,10 @@ Otherwise MI_SUCCESS is returned.
<!----------- Notes ---------->
<TR align="left" valign=top>
<TH>NOTES</TH>
-<TD>There is an internal limit on the number of macros that can be
-set (currently 5),
+<TD>There is an internal limit on the number of macros
+that can be set
+<!-- XREF: MAXFILTERMACROS -->
+(currently 50),
however, this limit is not enforced by libmilter, only by the MTA,
but a possible violation of this restriction is not communicated back to
the milter.</TD>
@@ -97,7 +99,7 @@ the milter.</TD>
<HR size="1">
<FONT size="-1">
-Copyright (c) 2006 Sendmail, Inc. and its suppliers.
+Copyright (c) 2006, 2012 Sendmail, Inc. and its suppliers.
All rights reserved.
<BR>
By using this file, you agree to the terms and conditions set
diff --git a/gnu/usr.sbin/sendmail/libmilter/docs/smfi_settimeout.html b/gnu/usr.sbin/sendmail/libmilter/docs/smfi_settimeout.html
index 633efa9fa12..68614efc28e 100644
--- a/gnu/usr.sbin/sendmail/libmilter/docs/smfi_settimeout.html
+++ b/gnu/usr.sbin/sendmail/libmilter/docs/smfi_settimeout.html
@@ -2,7 +2,7 @@
<HEAD><TITLE>smfi_settimeout</TITLE></HEAD>
<BODY>
<!--
-$Sendmail: smfi_settimeout.html,v 1.14 2006/12/21 18:30:35 ca Exp $
+$Sendmail: smfi_settimeout.html,v 1.15 2011/10/03 16:21:33 ca Exp $
-->
<H1>smfi_settimeout</H1>
@@ -52,11 +52,24 @@ If smfi_settimeout is not called, a default timeout of 7210 seconds is used.
<TD>smfi_settimeout always returns MI_SUCCESS.</TD>
</TR>
+<!----------- Notes ---------->
+<TR>
+<TH valign="top" align=left>NOTES</TH>
+<TD>
+Decreasing the timeout is strongly discouraged
+and may break the communication with the MTA.
+Do <EM>not</EM> decrease this value without making sure that
+the MTA also uses lower timeouts for communication
+(with the milter and with the SMTP client).
+</TR>
+</TABLE>
+
+
</TABLE>
<HR size="1">
<FONT size="-1">
-Copyright (c) 2000, 2002-2003, 2006 Sendmail, Inc. and its suppliers.
+Copyright (c) 2000, 2002-2003, 2006, 2011 Sendmail, Inc. and its suppliers.
All rights reserved.
<BR>
By using this file, you agree to the terms and conditions set
diff --git a/gnu/usr.sbin/sendmail/libmilter/worker.c b/gnu/usr.sbin/sendmail/libmilter/worker.c
index ce47cc9e38b..ab1d3081a03 100644
--- a/gnu/usr.sbin/sendmail/libmilter/worker.c
+++ b/gnu/usr.sbin/sendmail/libmilter/worker.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2004, 2007, 2009-2011 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 2003-2004, 2007, 2009-2012 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -11,7 +11,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: worker.c,v 8.19 2011/02/14 23:33:48 ca Exp $")
+SM_RCSID("@(#)$Sendmail: worker.c,v 8.24 2012/03/13 15:37:46 ca Exp $")
#include "libmilter.h"
@@ -141,7 +141,8 @@ static int mi_list_del_ctx __P((SMFICTX_PTR));
#if POOL_DEBUG
# define POOL_LEV_DPRINTF(lev, x) \
- do { \
+ do \
+ { \
if ((lev) < ctx->ctx_dbg) \
sm_dprintf x; \
} while (0)
@@ -377,7 +378,7 @@ mi_pool_controller(arg)
for (;;)
{
SMFICTX_PTR ctx;
- int nfd, rfd, i;
+ int nfd, r, i;
time_t now;
POOL_LEV_DPRINTF(4, ("Let's %s again...", WAITFN));
@@ -498,19 +499,19 @@ mi_pool_controller(arg)
TASKMGR_UNLOCK();
/* Everything is ready, let's wait for an event */
- rfd = poll(pfd, nfd, POLL_TIMEOUT);
+ r = poll(pfd, nfd, POLL_TIMEOUT);
POOL_LEV_DPRINTF(4, ("%s returned: at epoch %d value %d",
WAITFN, now, nfd));
/* timeout */
- if (rfd == 0)
+ if (r == 0)
continue;
rebuild_set = true;
/* error */
- if (rfd < 0)
+ if (r < 0)
{
if (errno == EINTR)
continue;
@@ -522,6 +523,7 @@ mi_pool_controller(arg)
if (pcnt >= MAX_FAILS_S)
goto err;
+ continue;
}
pcnt = 0;
@@ -535,7 +537,7 @@ mi_pool_controller(arg)
WAITFN, i, nfd,
WAIT_FD(i)));
- /* has a worker signaled an end of task ? */
+ /* has a worker signaled an end of task? */
if (WAIT_FD(i) == RD_PIPE)
{
char evts[256];
@@ -563,7 +565,12 @@ mi_pool_controller(arg)
continue;
}
- /* no ! sendmail wants to send a command */
+ /*
+ ** Not the pipe for workers waking us,
+ ** so must be something on an MTA connection.
+ */
+
+ TASKMGR_LOCK();
SM_TAILQ_FOREACH(ctx, &WRK_CTX_HEAD, ctx_link)
{
if (ctx->ctx_wstate != WKST_WAITING)
@@ -575,7 +582,6 @@ mi_pool_controller(arg)
if (ctx->ctx_sd == pfd[i].fd)
{
- TASKMGR_LOCK();
POOL_LEV_DPRINTF(4,
("TASK: found %d for fd[%d]=%d",
@@ -591,10 +597,10 @@ mi_pool_controller(arg)
ctx->ctx_wstate = WKST_RUNNING;
LAUNCH_WORKER(ctx);
}
- TASKMGR_UNLOCK();
break;
}
}
+ TASKMGR_UNLOCK();
POOL_LEV_DPRINTF(4,
("TASK %s FOUND - Checking PIPE for fd[%d]",
@@ -607,6 +613,14 @@ mi_pool_controller(arg)
free(pfd);
Tskmgr.tm_signature = 0;
+#if 0
+ /*
+ ** Do not clean up ctx -- it can cause double-free()s.
+ ** The program is shutting down anyway, so it's not worth the trouble.
+ ** There is a more complex solution that prevents race conditions
+ ** while accessing ctx, but that's maybe for a later version.
+ */
+
for (;;)
{
SMFICTX_PTR ctx;
@@ -616,6 +630,7 @@ mi_pool_controller(arg)
break;
mi_close_session(ctx);
}
+#endif
(void) smutex_destroy(&Tskmgr.tm_w_mutex);
(void) scond_destroy(&Tskmgr.tm_w_cond);
diff --git a/gnu/usr.sbin/sendmail/sendmail/TRACEFLAGS b/gnu/usr.sbin/sendmail/sendmail/TRACEFLAGS
index 4beafc27fa0..e4e49157645 100644
--- a/gnu/usr.sbin/sendmail/sendmail/TRACEFLAGS
+++ b/gnu/usr.sbin/sendmail/sendmail/TRACEFLAGS
@@ -1,4 +1,4 @@
-# $Sendmail: TRACEFLAGS,v 8.48 2008/11/03 21:09:26 gshapiro Exp $
+# $Sendmail: TRACEFLAGS,v 8.52 2012/03/03 00:10:42 ca Exp $
0, 4 main.c main canonical name, UUCP node name, a.k.a.s
0, 15 main.c main print configuration
0, 44 util.c printav print address of each string
@@ -77,12 +77,12 @@
63 queue.c runqueue process watching
64 multiple Milter
65 main.c permission checks
-#if _FFR_ADAPTIVE_EOL
-66 srvrsmtp.c conformance checks
-#endif /* _FFR_ADAPTIVE_EOL */
-#if _FFR_QUEUE_SCHED_DBG
-69 queue.c scheduling
-#endif /* _FFR_QUEUE_SCHED_DBG */
+#if _FFR_ADAPTIVE_EOL
+66 srvrsmtp.c conformance checks
+#endif /* _FFR_ADAPTIVE_EOL */
+#if _FFR_QUEUE_SCHED_DBG
+69 queue.c scheduling
+#endif /* _FFR_QUEUE_SCHED_DBG */
70 queue.c quarantining
71,>99 milter.c quarantine on errors
73 queue.c shared memory updates
@@ -92,6 +92,7 @@
83 collect.c timeout
84 deliver.c timeout
85 map.c dprintf map
+89 conf.c >=8 use sm_dprintf() instead of syslog()
91 mci.c syslogging of MCI cache information
93,>99 * Prevent daemon connection fork for profiling/debugging
94,>99 srvrsmtp.c cause commands to fail (for protocol testing)
diff --git a/gnu/usr.sbin/sendmail/sendmail/collect.c b/gnu/usr.sbin/sendmail/sendmail/collect.c
index 659932cd1ef..266cd55e1ca 100644
--- a/gnu/usr.sbin/sendmail/sendmail/collect.c
+++ b/gnu/usr.sbin/sendmail/sendmail/collect.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: collect.c,v 8.284 2008/08/06 05:26:24 ca Exp $")
+SM_RCSID("@(#)$Sendmail: collect.c,v 8.285 2012/06/14 23:54:02 ca Exp $")
static void eatfrom __P((char *volatile, ENVELOPE *));
static void collect_doheader __P((ENVELOPE *));
@@ -869,7 +869,8 @@ readerr:
if (LogLevel > 6)
sm_syslog(LOG_NOTICE, e->e_id,
"message size (%ld) exceeds maximum (%ld)",
- e->e_msgsize, MaxMessageSize);
+ PRT_NONNEGL(e->e_msgsize),
+ MaxMessageSize);
}
}
diff --git a/gnu/usr.sbin/sendmail/sendmail/conf.c b/gnu/usr.sbin/sendmail/sendmail/conf.c
index 6f3c3cdcae8..e0611f37cf4 100644
--- a/gnu/usr.sbin/sendmail/sendmail/conf.c
+++ b/gnu/usr.sbin/sendmail/sendmail/conf.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2010 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2012 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: conf.c,v 8.1168 2011/01/25 18:31:30 ca Exp $")
+SM_RCSID("@(#)$Sendmail: conf.c,v 8.1176 2012/12/07 03:59:54 ca Exp $")
#include <sm/sendmail.h>
#include <sendmail/pathnames.h>
@@ -53,7 +53,7 @@ static int add_hostnames __P((SOCKADDR *));
static struct hostent *sm_getipnodebyname __P((const char *, int, int, int *));
static struct hostent *sm_getipnodebyaddr __P((const void *, size_t, int, int *));
#else /* NETINET6 && NEEDSGETIPNODE */
-#define sm_getipnodebyname getipnodebyname
+#define sm_getipnodebyname getipnodebyname
#define sm_getipnodebyaddr getipnodebyaddr
#endif /* NETINET6 && NEEDSGETIPNODE */
@@ -4604,6 +4604,10 @@ add_hostnames(sa)
int save_errno = errno;
if (LogLevel > 3 &&
+#if NETINET && defined(IN_LINKLOCAL)
+ !(sa->sa.sa_family == AF_INET &&
+ IN_LINKLOCAL(ntohl(sa->sin.sin_addr.s_addr))) &&
+#endif /* NETINET && defined(IN_LINKLOCAL) */
#if NETINET6
!(sa->sa.sa_family == AF_INET6 &&
IN6_IS_ADDR_LINKLOCAL(&sa->sin6.sin6_addr)) &&
@@ -5376,14 +5380,30 @@ sm_syslog(level, id, fmt, va_alist)
#if LOG
if (*id == '\0')
{
- if (tTd(89, 8))
+ if (tTd(89, 10))
+ {
+ struct timeval tv;
+
+ gettimeofday(&tv, NULL);
+ sm_dprintf("%ld.%06ld %s\n", (long) tv.tv_sec,
+ (long) tv.tv_usec, newstring);
+ }
+ else if (tTd(89, 8))
sm_dprintf("%s\n", newstring);
else
syslog(level, "%s", newstring);
}
else
{
- if (tTd(89, 8))
+ if (tTd(89, 10))
+ {
+ struct timeval tv;
+
+ gettimeofday(&tv, NULL);
+ sm_dprintf("%ld.%06ld %s: %s\n", (long) tv.tv_sec,
+ (long) tv.tv_usec, id, newstring);
+ }
+ else if (tTd(89, 8))
sm_dprintf("%s: %s\n", id, newstring);
else
syslog(level, "%s: %s", id, newstring);
diff --git a/gnu/usr.sbin/sendmail/sendmail/daemon.c b/gnu/usr.sbin/sendmail/sendmail/daemon.c
index e035a30883c..fd16be1b8a4 100644
--- a/gnu/usr.sbin/sendmail/sendmail/daemon.c
+++ b/gnu/usr.sbin/sendmail/sendmail/daemon.c
@@ -14,7 +14,7 @@
#include <sendmail.h>
#include "map.h"
-SM_RCSID("@(#)$Sendmail: daemon.c,v 8.691 2011/01/25 18:31:30 ca Exp $")
+SM_RCSID("@(#)$Sendmail: daemon.c,v 8.694 2012/03/03 00:10:42 ca Exp $")
#if defined(SOCK_STREAM) || defined(__GNU_LIBRARY__)
# define USE_SOCK_STREAM 1
@@ -827,6 +827,7 @@ getrequests(e)
OutChannel = outchannel;
DisConnected = false;
+
#if XLA
if (!xla_host_ok(RealHostName))
{
@@ -4405,6 +4406,8 @@ hostnamebyanyaddr(sap)
saveretry = _res.retry;
if (_res.retry * _res.retrans > 20)
_res.retry = 20 / _res.retrans;
+ if (_res.retry == 0)
+ _res.retry = 1;
# endif /* NAMED_BIND */
switch (sap->sa.sa_family)
diff --git a/gnu/usr.sbin/sendmail/sendmail/deliver.c b/gnu/usr.sbin/sendmail/sendmail/deliver.c
index 6e2cec07304..dbc954a223f 100644
--- a/gnu/usr.sbin/sendmail/sendmail/deliver.c
+++ b/gnu/usr.sbin/sendmail/sendmail/deliver.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2010 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2010, 2012 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 <sm/time.h>
-SM_RCSID("@(#)$Sendmail: deliver.c,v 8.1024 2011/01/12 23:52:59 ca Exp $")
+SM_RCSID("@(#)$Sendmail: deliver.c,v 8.1027 2012/12/19 02:49:21 ca Exp $")
#if HASSETUSERCONTEXT
# include <login_cap.h>
@@ -37,6 +37,7 @@ static void sendenvelope __P((ENVELOPE *, int));
static int coloncmp __P((const char *, const char *));
#if STARTTLS
+# include <openssl/err.h>
static int starttls __P((MAILER *, MCI *, ENVELOPE *));
static int endtlsclt __P((MCI *));
#endif /* STARTTLS */
@@ -4271,7 +4272,7 @@ logdelivery(m, mci, dsn, status, ctladdr, xstart, e)
/* pri: changes with each delivery attempt */
(void) sm_snprintf(bp, SPACELEFT(buf, bp), ", pri=%ld",
- e->e_msgpriority);
+ PRT_NONNEGL(e->e_msgpriority));
bp += strlen(bp);
/* relay: max 66 bytes for IPv4 addresses */
@@ -6191,10 +6192,16 @@ ssl_retry:
if (LogLevel > 5)
{
+ unsigned long l;
+ const char *sr;
+
+ l = ERR_peek_error();
+ sr = ERR_reason_error_string(l);
sm_syslog(LOG_WARNING, NOQID,
- "STARTTLS=client, error: connect failed=%d, SSL_error=%d, errno=%d, retry=%d",
- result, ssl_err, errno, i);
- if (LogLevel > 8)
+ "STARTTLS=client, error: connect failed=%d, reason=%s, SSL_error=%d, errno=%d, retry=%d",
+ result, sr == NULL ? "unknown" : sr, ssl_err,
+ errno, i);
+ if (LogLevel > 9)
tlslogerr("client");
}
diff --git a/gnu/usr.sbin/sendmail/sendmail/headers.c b/gnu/usr.sbin/sendmail/sendmail/headers.c
index dd5659aded2..dd421f78acc 100644
--- a/gnu/usr.sbin/sendmail/sendmail/headers.c
+++ b/gnu/usr.sbin/sendmail/sendmail/headers.c
@@ -14,7 +14,7 @@
#include <sendmail.h>
#include <sm/sendmail.h>
-SM_RCSID("@(#)$Sendmail: headers.c,v 8.317 2008/08/27 20:11:55 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: headers.c,v 8.318 2012/06/14 23:54:02 ca Exp $")
static HDR *allocheader __P((char *, char *, int, SM_RPOOL_T *, bool));
static size_t fix_mime_header __P((HDR *, ENVELOPE *));
@@ -1152,7 +1152,7 @@ logsender(e, msgid)
(void) sm_snprintf(sbp, SPACELEFT(sbuf, sbp),
"from=%.200s, size=%ld, class=%d, nrcpts=%d",
e->e_from.q_paddr == NULL ? "<NONE>" : e->e_from.q_paddr,
- e->e_msgsize, e->e_class, e->e_nrcpts);
+ PRT_NONNEGL(e->e_msgsize), e->e_class, e->e_nrcpts);
sbp += strlen(sbp);
if (msgid != NULL)
{
@@ -1191,7 +1191,7 @@ logsender(e, msgid)
83));
sm_syslog(LOG_INFO, e->e_id,
"size=%ld, class=%ld, nrcpts=%d",
- e->e_msgsize, e->e_class, e->e_nrcpts);
+ PRT_NONNEGL(e->e_msgsize), e->e_class, e->e_nrcpts);
if (msgid != NULL)
sm_syslog(LOG_INFO, e->e_id,
"msgid=%s",
diff --git a/gnu/usr.sbin/sendmail/sendmail/main.c b/gnu/usr.sbin/sendmail/sendmail/main.c
index 652ac7d3d76..fe70fcea980 100644
--- a/gnu/usr.sbin/sendmail/sendmail/main.c
+++ b/gnu/usr.sbin/sendmail/sendmail/main.c
@@ -26,7 +26,7 @@ SM_UNUSED(static char copyright[]) =
The Regents of the University of California. All rights reserved.\n";
#endif /* ! lint */
-SM_RCSID("@(#)$Sendmail: main.c,v 8.976 2011/03/15 23:14:36 ca Exp $")
+SM_RCSID("@(#)$Sendmail: main.c,v 8.981 2012/06/14 23:54:02 ca Exp $")
#if NETINET || NETINET6
@@ -2561,6 +2561,10 @@ main(argc, argv, envp)
authinfo = getauthinfo(sm_io_getinfo(InChannel, SM_IO_WHAT_FD,
NULL), &forged);
macdefine(&BlankEnvelope.e_macro, A_TEMP, '_', authinfo);
+ if (tTd(75, 9))
+ sm_syslog(LOG_INFO, NOQID,
+ "main: where=after_getauthinfo, RealHostAddr=%s",
+ anynet_ntoa(&RealHostAddr));
/* at this point we are in a child: reset state */
sm_rpool_free(MainEnvelope.e_rpool);
@@ -2827,7 +2831,7 @@ main(argc, argv, envp)
/* set message size */
(void) sm_snprintf(buf, sizeof(buf), "%ld",
- MainEnvelope.e_msgsize);
+ PRT_NONNEGL(MainEnvelope.e_msgsize));
macdefine(&MainEnvelope.e_macro, A_TEMP,
macid("{msg_size}"), buf);
diff --git a/gnu/usr.sbin/sendmail/sendmail/map.c b/gnu/usr.sbin/sendmail/sendmail/map.c
index 05c59bcf743..529a2aa0ef8 100644
--- a/gnu/usr.sbin/sendmail/sendmail/map.c
+++ b/gnu/usr.sbin/sendmail/sendmail/map.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: map.c,v 8.706 2010/07/27 03:35:42 ca Exp $")
+SM_RCSID("@(#)$Sendmail: map.c,v 8.709 2012/04/20 18:47:09 ca Exp $")
#if LDAPMAP
# include <sm/ldap.h>
@@ -3434,7 +3434,7 @@ ldapmap_open(map, mode)
{
if (LogLevel > 1)
sm_syslog(LOG_NOTICE, CurEnv->e_id,
- "timeout conning to LDAP server %.100s",
+ "timeout connecting to LDAP server %.100s",
id);
}
@@ -3763,11 +3763,11 @@ ldapmap_lookup(map, name, av, statp)
if (!bitset(MF_OPTIONAL, map->map_mflags))
{
if (bitset(MF_NODEFER, map->map_mflags))
- syserr("Error getting LDAP results in map %s",
- map->map_mname);
+ syserr("Error getting LDAP results, map=%s, name=%s",
+ map->map_mname, name);
else
- syserr("451 4.3.5 Error getting LDAP results in map %s",
- map->map_mname);
+ syserr("451 4.3.5 Error getting LDAP results, map=%s, name=%s",
+ map->map_mname, name);
}
errno = save_errno;
return NULL;
@@ -3781,7 +3781,7 @@ ldapmap_lookup(map, name, av, statp)
{
if (LogLevel > 9)
sm_syslog(LOG_INFO, CurEnv->e_id,
- "ldap %.100s => %s", name,
+ "ldap=%s, %.100s=>%s", map->map_mname, name,
vp == NULL ? "<NULL>" : vp);
if (bitset(MF_MATCHONLY, map->map_mflags))
result = map_rewrite(map, name, strlen(name), NULL);
diff --git a/gnu/usr.sbin/sendmail/sendmail/milter.c b/gnu/usr.sbin/sendmail/sendmail/milter.c
index 4beac6b5190..0fe3ea1c9ba 100644
--- a/gnu/usr.sbin/sendmail/sendmail/milter.c
+++ b/gnu/usr.sbin/sendmail/sendmail/milter.c
@@ -10,7 +10,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: milter.c,v 8.277 2009/11/06 00:57:06 ca Exp $")
+SM_RCSID("@(#)$Sendmail: milter.c,v 8.279 2012/11/16 20:25:03 ca Exp $")
#if MILTER
# include <sm/sendmail.h>
@@ -42,7 +42,7 @@ static char *milter_write __P((struct milter *, int, char *, ssize_t,
time_t, ENVELOPE *, const char *));
static char *milter_send_command __P((struct milter *, int, void *,
ssize_t, ENVELOPE *, char *, const char *));
-static char *milter_command __P((int, void *, ssize_t, char **,
+static char *milter_command __P((int, void *, ssize_t, int,
ENVELOPE *, char *, const char *, bool));
static char *milter_body __P((struct milter *, ENVELOPE *, char *));
static int milter_reopen_df __P((ENVELOPE *));
@@ -79,13 +79,13 @@ static int milter_set_macros __P((char *, char **, char *, int));
# define SMFS_READY 'R' /* ready for action */
# define SMFS_SKIP 'S' /* skip body */
-static char *MilterConnectMacros[MAXFILTERMACROS + 1];
-static char *MilterHeloMacros[MAXFILTERMACROS + 1];
-static char *MilterEnvFromMacros[MAXFILTERMACROS + 1];
-static char *MilterEnvRcptMacros[MAXFILTERMACROS + 1];
-static char *MilterDataMacros[MAXFILTERMACROS + 1];
-static char *MilterEOMMacros[MAXFILTERMACROS + 1];
-static char *MilterEOHMacros[MAXFILTERMACROS + 1];
+/*
+** MilterMacros contains the milter macros for each milter and each stage.
+** indices are (in order): stages, milter-index, macro
+** milter-index == 0: "global" macros (not for a specific milter).
+*/
+
+static char *MilterMacros[SMFIM_LAST + 1][MAXFILTERS + 1][MAXFILTERMACROS + 1];
static size_t MilterMaxDataSize = MILTER_MAX_DATA_SIZE;
# define MILTER_CHECK_DONE_MSG() \
@@ -98,6 +98,16 @@ static size_t MilterMaxDataSize = MILTER_MAX_DATA_SIZE;
milter_abort(e); \
}
+/* set state in case of an error */
+# define MILTER_SET_STATE \
+ 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
+
+/* flow through code maybe using continue; don't wrap in do {} while */
# define MILTER_CHECK_ERROR(initial, action) \
if (!initial && tTd(71, 100)) \
{ \
@@ -119,12 +129,7 @@ static size_t MilterMaxDataSize = MILTER_MAX_DATA_SIZE;
e->e_quarmsg); \
} \
} \
- 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 MILTER_SET_STATE; \
else \
action;
@@ -1221,6 +1226,7 @@ milter_setup(line)
char *p;
struct milter *m;
STAB *s;
+ static int idx = 0;
/* collect the filter name */
for (p = line;
@@ -1323,7 +1329,10 @@ milter_setup(line)
if (s->s_milter != NULL)
syserr("X%s: duplicate filter definition", m->mf_name);
else
+ {
s->s_milter = m;
+ m->mf_idx = ++idx;
+ }
}
/*
@@ -1555,20 +1564,13 @@ static struct milteropt
unsigned char mo_code; /* code for option */
} MilterOptTab[] =
{
-# define MO_MACROS_CONNECT SMFIM_CONNECT
- { "macros.connect", MO_MACROS_CONNECT },
-# define MO_MACROS_HELO SMFIM_HELO
- { "macros.helo", MO_MACROS_HELO },
-# define MO_MACROS_ENVFROM SMFIM_ENVFROM
- { "macros.envfrom", MO_MACROS_ENVFROM },
-# define MO_MACROS_ENVRCPT SMFIM_ENVRCPT
- { "macros.envrcpt", MO_MACROS_ENVRCPT },
-# define MO_MACROS_DATA SMFIM_DATA
- { "macros.data", MO_MACROS_DATA },
-# define MO_MACROS_EOM SMFIM_EOM
- { "macros.eom", MO_MACROS_EOM },
-# define MO_MACROS_EOH SMFIM_EOH
- { "macros.eoh", MO_MACROS_EOH },
+ { "macros.connect", SMFIM_CONNECT },
+ { "macros.helo", SMFIM_HELO },
+ { "macros.envfrom", SMFIM_ENVFROM },
+ { "macros.envrcpt", SMFIM_ENVRCPT },
+ { "macros.data", SMFIM_DATA },
+ { "macros.eom", SMFIM_EOM },
+ { "macros.eoh", SMFIM_EOH },
# define MO_LOGLEVEL 0x07
{ "loglevel", MO_LOGLEVEL },
@@ -1655,39 +1657,14 @@ milter_set_option(name, val, sticky)
break;
# endif /* _FFR_MAXDATASIZE || _FFR_MDS_NEGOTIATE */
- case MO_MACROS_CONNECT:
- if (macros == NULL)
- macros = MilterConnectMacros;
- /* FALLTHROUGH */
-
- case MO_MACROS_HELO:
- if (macros == NULL)
- macros = MilterHeloMacros;
- /* FALLTHROUGH */
-
- case MO_MACROS_ENVFROM:
- if (macros == NULL)
- macros = MilterEnvFromMacros;
- /* FALLTHROUGH */
-
- case MO_MACROS_ENVRCPT:
- if (macros == NULL)
- macros = MilterEnvRcptMacros;
- /* FALLTHROUGH */
-
- case MO_MACROS_EOH:
- if (macros == NULL)
- macros = MilterEOHMacros;
- /* FALLTHROUGH */
-
- case MO_MACROS_EOM:
- if (macros == NULL)
- macros = MilterEOMMacros;
- /* FALLTHROUGH */
-
- case MO_MACROS_DATA:
- if (macros == NULL)
- macros = MilterDataMacros;
+ case SMFIM_CONNECT:
+ case SMFIM_HELO:
+ case SMFIM_ENVFROM:
+ case SMFIM_ENVRCPT:
+ case SMFIM_EOH:
+ case SMFIM_EOM:
+ case SMFIM_DATA:
+ macros = MilterMacros[mo->mo_code][0];
r = milter_set_macros(name, macros, val, nummac);
if (r >= 0)
@@ -2188,7 +2165,7 @@ milter_send_command(m, cmd, data, sz, e, state, where)
sm_syslog(LOG_ERR, e->e_id,
"milter_send_command(%s): action=%s returned bogus response %c",
m->mf_name, action, rcmd);
- milter_error(m, e);
+ milter_error(m, e); /* NO ERROR CHECK? */
break;
}
@@ -2218,11 +2195,11 @@ milter_send_command(m, cmd, data, sz, e, state, where)
*/
static char *
-milter_command(cmd, data, sz, macros, e, state, where, cmd_error)
+milter_command(cmd, data, sz, stage, e, state, where, cmd_error)
int cmd;
void *data;
ssize_t sz;
- char **macros;
+ int stage;
ENVELOPE *e;
char *state;
const char *where;
@@ -2254,14 +2231,27 @@ milter_command(cmd, data, sz, macros, e, state, where, cmd_error)
(m->mf_state != SMFS_OPEN && m->mf_state != SMFS_INMSG))
continue;
- /* send macros (regardless of whether we send command) */
- if (macros != NULL && macros[0] != NULL)
+ if (stage >= SMFIM_FIRST && stage <= SMFIM_LAST)
{
- milter_send_macros(m, macros, command, e);
- if (m->mf_state == SMFS_ERROR)
+ int idx;
+ char **macros;
+
+ if ((m->mf_lflags & MI_LFLAGS_SYM(stage)) != 0)
+ idx = m->mf_idx;
+ else
+ idx = 0;
+ SM_ASSERT(idx >= 0 && idx <= MAXFILTERS);
+ macros = MilterMacros[stage][idx];
+
+ /* send macros (regardless of whether we send cmd) */
+ if (macros != NULL && macros[0] != NULL)
{
- MILTER_CHECK_ERROR(false, continue);
- break;
+ milter_send_macros(m, macros, command, e);
+ if (m->mf_state == SMFS_ERROR)
+ {
+ MILTER_CHECK_ERROR(false, continue);
+ break;
+ }
}
}
@@ -2329,40 +2319,17 @@ milter_getsymlist(m, buf, rlen, offset)
switch (i)
{
- case MO_MACROS_CONNECT:
- if (macros == NULL)
- macros = MilterConnectMacros;
- /* FALLTHROUGH */
-
- case MO_MACROS_HELO:
- if (macros == NULL)
- macros = MilterHeloMacros;
- /* FALLTHROUGH */
-
- case MO_MACROS_ENVFROM:
- if (macros == NULL)
- macros = MilterEnvFromMacros;
- /* FALLTHROUGH */
-
- case MO_MACROS_ENVRCPT:
- if (macros == NULL)
- macros = MilterEnvRcptMacros;
- /* FALLTHROUGH */
-
- case MO_MACROS_EOM:
- if (macros == NULL)
- macros = MilterEOMMacros;
- /* FALLTHROUGH */
-
- case MO_MACROS_EOH:
- if (macros == NULL)
- macros = MilterEOHMacros;
- /* FALLTHROUGH */
-
- case MO_MACROS_DATA:
- if (macros == NULL)
- macros = MilterDataMacros;
-
+ case SMFIM_CONNECT:
+ case SMFIM_HELO:
+ case SMFIM_ENVFROM:
+ case SMFIM_ENVRCPT:
+ case SMFIM_EOH:
+ case SMFIM_EOM:
+ case SMFIM_DATA:
+ SM_ASSERT(m->mf_idx > 0 && m->mf_idx < MAXFILTERS);
+ macros = MilterMacros[i][m->mf_idx];
+
+ m->mf_lflags |= MI_LFLAGS_SYM(i);
len = strlen(buf + offset);
if (len > 0)
{
@@ -2370,6 +2337,9 @@ milter_getsymlist(m, buf, rlen, offset)
buf + offset, nummac);
if (r >= 0)
nummac = r;
+ if (tTd(64, 5))
+ sm_dprintf("milter_getsymlist(%s, %s)=%d\n",
+ m->mf_name, buf + offset, r);
}
break;
@@ -3989,7 +3959,7 @@ milter_connect(hostname, addr, e, state)
(void) memcpy(bp, sockinfo, strlen(sockinfo) + 1);
}
- response = milter_command(SMFIC_CONNECT, buf, s, MilterConnectMacros,
+ response = milter_command(SMFIC_CONNECT, buf, s, SMFIM_CONNECT,
e, state, "connect", false);
sm_free(buf); /* XXX */
@@ -4078,7 +4048,7 @@ milter_helo(helo, e, state)
}
response = milter_command(SMFIC_HELO, helo, strlen(helo) + 1,
- MilterHeloMacros, e, state, "helo", false);
+ SMFIM_EOH, e, state, "helo", false);
milter_per_connection_check(e);
return response;
}
@@ -4166,7 +4136,7 @@ milter_envfrom(args, e, state)
sm_syslog(LOG_INFO, e->e_id, "Milter: sender: %s", buf);
/* send it over */
- response = milter_command(SMFIC_MAIL, buf, s, MilterEnvFromMacros,
+ response = milter_command(SMFIC_MAIL, buf, s, SMFIM_ENVFROM,
e, state, "mail", false);
sm_free(buf); /* XXX */
@@ -4247,7 +4217,7 @@ milter_envrcpt(args, e, state, rcpt_error)
sm_syslog(LOG_INFO, e->e_id, "Milter: rcpts: %s", buf);
/* send it over */
- response = milter_command(SMFIC_RCPT, buf, s, MilterEnvRcptMacros,
+ response = milter_command(SMFIC_RCPT, buf, s, SMFIM_ENVRCPT,
e, state, "rcpt", rcpt_error);
sm_free(buf); /* XXX */
return response;
@@ -4273,8 +4243,8 @@ milter_data_cmd(e, state)
sm_dprintf("milter_data_cmd\n");
/* send it over */
- return milter_command(SMFIC_DATA, NULL, 0, MilterDataMacros, e, state,
- "data", false);
+ return milter_command(SMFIC_DATA, NULL, 0, SMFIM_DATA,
+ e, state, "data", false);
}
/*
@@ -4293,7 +4263,12 @@ milter_data_cmd(e, state)
** modify the envelope or message.
*/
+/* flow through code using continue; don't wrap in do {} while */
# define MILTER_CHECK_RESULTS() \
+ if (m->mf_state == SMFS_ERROR && *state == SMFIR_CONTINUE) \
+ { \
+ MILTER_SET_STATE; \
+ } \
if (*state == SMFIR_ACCEPT || \
m->mf_state == SMFS_DONE || \
m->mf_state == SMFS_ERROR) \
@@ -4339,6 +4314,8 @@ milter_data(e, state)
for (i = 0; InputFilters[i] != NULL; i++)
{
+ int idx;
+ char **macros;
struct milter *m = InputFilters[i];
if (*state != SMFIR_CONTINUE &&
@@ -4383,10 +4360,16 @@ milter_data(e, state)
if (tTd(64, 10))
sm_dprintf("milter_data: eoh\n");
- if (MilterEOHMacros[0] != NULL)
+ if ((m->mf_lflags & MI_LFLAGS_SYM(SMFIM_EOH)) != 0)
+ idx = m->mf_idx;
+ else
+ idx = 0;
+ SM_ASSERT(idx >= 0 && idx <= MAXFILTERS);
+ macros = MilterMacros[SMFIM_EOH][idx];
+
+ if (macros != NULL)
{
- milter_send_macros(m, MilterEOHMacros,
- SMFIC_EOH, e);
+ milter_send_macros(m, macros, SMFIC_EOH, e);
MILTER_CHECK_RESULTS();
}
@@ -4405,10 +4388,15 @@ milter_data(e, state)
MILTER_CHECK_RESULTS();
}
- if (MilterEOMMacros[0] != NULL)
+ if ((m->mf_lflags & MI_LFLAGS_SYM(SMFIM_EOH)) != 0)
+ idx = m->mf_idx;
+ else
+ idx = 0;
+ SM_ASSERT(idx >= 0 && idx <= MAXFILTERS);
+ macros = MilterMacros[SMFIM_EOM][idx];
+ if (macros != NULL)
{
- milter_send_macros(m, MilterEOMMacros,
- SMFIC_BODYEOB, e);
+ milter_send_macros(m, macros, SMFIC_BODYEOB, e);
MILTER_CHECK_RESULTS();
}
@@ -4734,7 +4722,7 @@ milter_unknown(smtpcmd, e, state)
sm_dprintf("milter_unknown(%s)\n", smtpcmd);
return milter_command(SMFIC_UNKNOWN, smtpcmd, strlen(smtpcmd) + 1,
- NULL, e, state, "unknown", false);
+ SMFIM_NOMACROS, e, state, "unknown", false);
}
/*
diff --git a/gnu/usr.sbin/sendmail/sendmail/parseaddr.c b/gnu/usr.sbin/sendmail/sendmail/parseaddr.c
index cb35b37f2a9..6e9f0a25171 100644
--- a/gnu/usr.sbin/sendmail/sendmail/parseaddr.c
+++ b/gnu/usr.sbin/sendmail/sendmail/parseaddr.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: parseaddr.c,v 8.404 2010/07/27 03:35:42 ca Exp $")
+SM_RCSID("@(#)$Sendmail: parseaddr.c,v 8.405 2012/02/27 22:49:08 ca Exp $")
#include <sm/sendmail.h>
#include "map.h"
@@ -242,6 +242,7 @@ parseaddr(addr, a, flags, delim, delimptr, e, isrcpt)
**
** Parameters:
** addr -- the address to check.
+** note: this is the complete address (including display part)
** delimptr -- if non-NULL: end of address to check, i.e.,
** a pointer in the address string.
** isrcpt -- true iff the address is for a recipient.
diff --git a/gnu/usr.sbin/sendmail/sendmail/queue.c b/gnu/usr.sbin/sendmail/sendmail/queue.c
index 53ca18d2f3e..cf7301ef657 100644
--- a/gnu/usr.sbin/sendmail/sendmail/queue.c
+++ b/gnu/usr.sbin/sendmail/sendmail/queue.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2009, 2011 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2009, 2011, 2012 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 <sm/sem.h>
-SM_RCSID("@(#)$Sendmail: queue.c,v 8.991 2011/03/15 23:14:36 ca Exp $")
+SM_RCSID("@(#)$Sendmail: queue.c,v 8.997 2012/06/14 23:54:03 ca Exp $")
#include <dirent.h>
@@ -1493,6 +1493,7 @@ runqueue(forkflag, verbose, persistent, runall)
for (i = 0; i < NumWorkGroups && !NoMoreRunners; i++)
{
int rwgflags = RWG_NONE;
+ int wasblocked;
/*
** If MaxQueueChildren active then test whether the start
@@ -1529,7 +1530,11 @@ runqueue(forkflag, verbose, persistent, runall)
** increase if some queue runners "hang" for a long time.
*/
+ /* don't let proc_list_drop() change CurRunners */
+ wasblocked = sm_blocksignal(SIGCHLD);
CurRunners += WorkGrp[curnum].wg_maxact;
+ if (wasblocked == 0)
+ (void) sm_releasesignal(SIGCHLD);
if (forkflag)
rwgflags |= RWG_FORK;
if (verbose)
@@ -1549,7 +1554,13 @@ runqueue(forkflag, verbose, persistent, runall)
if (!ret)
{
+ /* don't let proc_list_drop() change CurRunners */
+ wasblocked = sm_blocksignal(SIGCHLD);
CurRunners -= WorkGrp[curnum].wg_maxact;
+ CHK_CUR_RUNNERS("runqueue", curnum,
+ WorkGrp[curnum].wg_maxact);
+ if (wasblocked == 0)
+ (void) sm_releasesignal(SIGCHLD);
break;
}
@@ -2031,6 +2042,9 @@ run_work_group(wgrp, flags)
{
IgnoreHostStatus = true;
MinQueueAge = 0;
+#if _FFR_EXPDELAY
+ MaxQueueAge = 0;
+#endif /* _FFR_EXPDELAY */
}
/*
@@ -2300,7 +2314,7 @@ run_work_group(wgrp, flags)
if (bitset(RWG_PERSISTENT, flags))
{
sequenceno = 1;
- sm_setproctitle(true, CurEnv, "running queue: %s",
+ sm_setproctitle(true, NULL, "running queue: %s",
qid_printqueue(qgrp, qdir));
/*
@@ -2860,7 +2874,7 @@ gatherq(qgrp, qdir, doall, full, more, pnentries)
#if _FFR_EXPDELAY
if (MaxQueueAge > 0)
{
- time_t lasttry, delay;
+ time_t lasttry, delay;
lasttry = (time_t) atol(&lbuf[1]);
delay = MIN(lasttry - w->w_ctime,
@@ -3704,6 +3718,7 @@ dowork(qgrp, qdir, id, forkflag, requeueflag, e)
(void) dropenvelope(e, true, false);
sm_rpool_free(rpool);
e->e_rpool = NULL;
+ e->e_message = NULL;
}
}
e->e_id = NULL;
@@ -4577,7 +4592,7 @@ readqf(e, openonly)
e->e_dfdev = st.st_dev;
e->e_dfino = ST_INODE(st);
(void) sm_snprintf(buf, sizeof(buf), "%ld",
- e->e_msgsize);
+ PRT_NONNEGL(e->e_msgsize));
macdefine(&e->e_macro, A_TEMP, macid("{msg_size}"),
buf);
}
diff --git a/gnu/usr.sbin/sendmail/sendmail/sasl.c b/gnu/usr.sbin/sendmail/sendmail/sasl.c
index e00740d32b1..84c5482831f 100644
--- a/gnu/usr.sbin/sendmail/sendmail/sasl.c
+++ b/gnu/usr.sbin/sendmail/sendmail/sasl.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: sasl.c,v 8.22 2006/08/15 23:24:57 ca Exp $")
+SM_RCSID("@(#)$Sendmail: sasl.c,v 8.23 2012/11/27 18:53:13 gshapiro Exp $")
#if SASL
# include <stdlib.h>
@@ -20,13 +20,19 @@ SM_RCSID("@(#)$Sendmail: sasl.c,v 8.22 2006/08/15 23:24:57 ca Exp $")
** In order to ensure that storage leaks are tracked, and to prevent
** conflicts between the sm_heap package and sasl, we tell sasl to
** use the following heap allocation functions. Unfortunately,
-** the sasl package incorrectly specifies the size of a block
+** older sasl packages incorrectly specifies the size of a block
** using unsigned long: for portability, it should be size_t.
*/
-void *sm_sasl_malloc __P((unsigned long));
-static void *sm_sasl_calloc __P((unsigned long, unsigned long));
-static void *sm_sasl_realloc __P((void *, unsigned long));
+# if defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a
+# define SM_SASL_SIZE_T size_t
+# else /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */
+# define SM_SASL_SIZE_T unsigned long
+# endif /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */
+
+void *sm_sasl_malloc __P((SM_SASL_SIZE_T));
+static void *sm_sasl_calloc __P((SM_SASL_SIZE_T, SM_SASL_SIZE_T));
+static void *sm_sasl_realloc __P((void *, SM_SASL_SIZE_T));
void sm_sasl_free __P((void *));
/*
@@ -50,7 +56,7 @@ void sm_sasl_free __P((void *));
void *
sm_sasl_malloc(size)
- unsigned long size;
+ SM_SASL_SIZE_T size;
{
return sm_malloc((size_t) size);
}
@@ -71,8 +77,8 @@ sm_sasl_malloc(size)
static void *
sm_sasl_calloc(nelem, elemsize)
- unsigned long nelem;
- unsigned long elemsize;
+ SM_SASL_SIZE_T nelem;
+ SM_SASL_SIZE_T elemsize;
{
size_t size;
void *p;
@@ -99,7 +105,7 @@ sm_sasl_calloc(nelem, elemsize)
static void *
sm_sasl_realloc(o, size)
void *o;
- unsigned long size;
+ SM_SASL_SIZE_T size;
{
return sm_realloc(o, (size_t) size);
}
diff --git a/gnu/usr.sbin/sendmail/sendmail/savemail.c b/gnu/usr.sbin/sendmail/sendmail/savemail.c
index d39d1621183..52f422947de 100644
--- a/gnu/usr.sbin/sendmail/sendmail/savemail.c
+++ b/gnu/usr.sbin/sendmail/sendmail/savemail.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: savemail.c,v 8.314 2009/12/18 17:08:01 ca Exp $")
+SM_RCSID("@(#)$Sendmail: savemail.c,v 8.315 2012/02/27 17:43:03 gshapiro Exp $")
static bool errbody __P((MCI *, ENVELOPE *, char *));
static bool pruneroute __P((char *));
@@ -506,6 +506,7 @@ returntosender(msg, returnq, flags, e)
int flags;
register ENVELOPE *e;
{
+ int ret;
register ENVELOPE *ee;
ENVELOPE *oldcur = CurEnv;
ENVELOPE errenvelope;
@@ -703,24 +704,35 @@ returntosender(msg, returnq, flags, e)
/* actually deliver the error message */
sendall(ee, SM_DELIVER);
-
- /* restore state */
(void) dropenvelope(ee, true, false);
- sm_rpool_free(ee->e_rpool);
- CurEnv = oldcur;
- returndepth--;
/* check for delivery errors */
+ ret = -1;
if (ee->e_parent == NULL ||
!bitset(EF_RESPONSE, ee->e_parent->e_flags))
- return 0;
- for (q = ee->e_sendqueue; q != NULL; q = q->q_next)
{
- if (QS_IS_ATTEMPTED(q->q_state))
- return 0;
+ ret = 0;
}
- return -1;
+ else
+ {
+ for (q = ee->e_sendqueue; q != NULL; q = q->q_next)
+ {
+ if (QS_IS_ATTEMPTED(q->q_state))
+ {
+ ret = 0;
+ break;
+ }
+ }
+ }
+
+ /* restore state */
+ sm_rpool_free(ee->e_rpool);
+ CurEnv = oldcur;
+ returndepth--;
+
+ return ret;
}
+
/*
** ERRBODY -- output the body of an error message.
**
diff --git a/gnu/usr.sbin/sendmail/sendmail/sendmail.h b/gnu/usr.sbin/sendmail/sendmail/sendmail.h
index 121c7e2c738..e3f63928638 100644
--- a/gnu/usr.sbin/sendmail/sendmail/sendmail.h
+++ b/gnu/usr.sbin/sendmail/sendmail/sendmail.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2011 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2012 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -52,7 +52,7 @@
#ifdef _DEFINE
# ifndef lint
-SM_UNUSED(static char SmailId[]) = "@(#)$Sendmail: sendmail.h,v 8.1089 2011/03/15 23:14:36 ca Exp $";
+SM_UNUSED(static char SmailId[]) = "@(#)$Sendmail: sendmail.h,v 8.1096 2012/11/16 20:25:03 ca Exp $";
# endif /* ! lint */
#endif /* _DEFINE */
@@ -941,6 +941,8 @@ struct envelope
#endif /* _FFR_MILTER_ENHSC */
};
+#define PRT_NONNEGL(v) ((v) < 0 ? LONG_MAX : (v))
+
/* values for e_flags */
#define EF_OLDSTYLE 0x00000001L /* use spaces (not commas) in hdrs */
#define EF_INQUEUE 0x00000002L /* this message is fully queued */
@@ -1481,7 +1483,6 @@ struct symtab
union
{
BITMAP256 sv_class; /* bit-map of word classes */
- ADDRESS *sv_addr; /* pointer to address header */
MAILER *sv_mailer; /* pointer to mailer */
char *sv_alias; /* alias */
MAPCLASS sv_mapclass; /* mapping function class */
@@ -1511,7 +1512,7 @@ typedef struct symtab STAB;
/* symbol types */
#define ST_UNDEF 0 /* undefined type */
#define ST_CLASS 1 /* class map */
-#define ST_ADDRESS 2 /* an address in parsed format */
+/* #define ST_unused 2 UNUSED */
#define ST_MAILER 3 /* a mailer header */
#define ST_ALIAS 4 /* an alias */
#define ST_MAPCLASS 5 /* mapping function class */
@@ -1538,7 +1539,6 @@ typedef struct symtab STAB;
#define ST_MCI 17 /* mailer connection info (offset) */
#define s_class s_value.sv_class
-#define s_address s_value.sv_addr
#define s_mailer s_value.sv_mailer
#define s_alias s_value.sv_alias
#define s_mci s_value.sv_mci
@@ -1780,6 +1780,8 @@ struct milter
char *mf_conn; /* connection info */
int mf_sock; /* connected socket */
char mf_state; /* state of filter */
+ char mf_lflags; /* "local" flags */
+ int mf_idx; /* milter number (index) */
time_t mf_timeout[SMFTO_NUM_TO]; /* timeouts */
#if _FFR_MILTER_CHECK
/* for testing only */
@@ -1789,6 +1791,9 @@ struct milter
#endif /* _FFR_MILTER_CHECK */
};
+#define MI_LFL_NONE 0x00000000
+#define MI_LFLAGS_SYM(st) (1 << (st)) /* has its own symlist for stage st */
+
struct milters
{
mi_int32 mis_flags; /* filter flags */
@@ -2236,6 +2241,19 @@ extern unsigned char tTdvect[100]; /* trace vector */
# define CHECK_RESTART _CHECK_RESTART
+#define CHK_CUR_RUNNERS(fct, idx, count) \
+ do \
+ { \
+ if (CurRunners < 0) \
+ { \
+ if (LogLevel > 3) \
+ sm_syslog(LOG_ERR, NOQID, \
+ "%s: CurRunners=%d, i=%d, count=%d, status=should not happen", \
+ fct, CurRunners, idx, count); \
+ CurRunners = 0; \
+ } \
+ } while (0)
+
/* reply types (text in SmtpMsgBuffer) */
#define XS_DEFAULT 0
#define XS_STARTTLS 1
diff --git a/gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c b/gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c
index 49c39303741..6e3d62656ea 100644
--- a/gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c
+++ b/gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2010 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2010, 2012 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -17,7 +17,7 @@
# include <libmilter/mfdef.h>
#endif /* MILTER */
-SM_RCSID("@(#)$Sendmail: srvrsmtp.c,v 8.1008 2011/01/12 23:52:59 ca Exp $")
+SM_RCSID("@(#)$Sendmail: srvrsmtp.c,v 8.1011 2012/12/19 02:49:21 ca Exp $")
#include <sm/time.h>
#include <sm/fdset.h>
@@ -30,6 +30,7 @@ SM_RCSID("@(#)$Sendmail: srvrsmtp.c,v 8.1008 2011/01/12 23:52:59 ca Exp $")
static int saslmechs __P((sasl_conn_t *, char **));
#endif /* SASL */
#if STARTTLS
+# include <openssl/err.h>
# include <sysexits.h>
static SSL_CTX *srv_ctx = NULL; /* TLS server context */
@@ -1914,11 +1915,18 @@ smtp(nullserver, d_flags, e)
if (LogLevel > 5)
{
+ unsigned long l;
+ const char *sr;
+
+ l = ERR_peek_error();
+ sr = ERR_reason_error_string(l);
sm_syslog(LOG_WARNING, NOQID,
- "STARTTLS=server, error: accept failed=%d, SSL_error=%d, errno=%d, retry=%d, relay=%.100s",
- r, ssl_err, errno, i,
+ "STARTTLS=server, error: accept failed=%d, reason=%s, SSL_error=%d, errno=%d, retry=%d, relay=%.100s",
+ r, sr == NULL ? "unknown"
+ : sr,
+ ssl_err, errno, i,
CurSmtpClient);
- if (LogLevel > 8)
+ if (LogLevel > 9)
tlslogerr("server");
}
tls_ok_srv = false;
@@ -3481,7 +3489,7 @@ smtp_data(smtp, e)
collect(InChannel, true, NULL, e, true);
/* redefine message size */
- (void) sm_snprintf(buf, sizeof(buf), "%ld", e->e_msgsize);
+ (void) sm_snprintf(buf, sizeof(buf), "%ld", PRT_NONNEGL(e->e_msgsize));
macdefine(&e->e_macro, A_TEMP, macid("{msg_size}"), buf);
/* rscheck() will set Errors or EF_DISCARD if it trips */
@@ -3559,7 +3567,7 @@ smtp_data(smtp, e)
}
/* Milter may have changed message size */
- (void) sm_snprintf(buf, sizeof(buf), "%ld", e->e_msgsize);
+ (void) sm_snprintf(buf, sizeof(buf), "%ld", PRT_NONNEGL(e->e_msgsize));
macdefine(&e->e_macro, A_TEMP, macid("{msg_size}"), buf);
/* abort message filters that didn't get the body & log msg is OK */
diff --git a/gnu/usr.sbin/sendmail/sendmail/stab.c b/gnu/usr.sbin/sendmail/sendmail/stab.c
index 4977803c68f..c1b58e3c6cb 100644
--- a/gnu/usr.sbin/sendmail/sendmail/stab.c
+++ b/gnu/usr.sbin/sendmail/sendmail/stab.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: stab.c,v 8.89 2006/08/15 23:24:58 ca Exp $")
+SM_RCSID("@(#)$Sendmail: stab.c,v 8.91 2011/08/08 17:33:34 ca Exp $")
/*
** STAB -- manage the symbol table
@@ -65,7 +65,7 @@ stab(name, type, op)
sm_dprintf("(hfunc=%d) ", hfunc);
ps = &SymTab[hfunc];
- if (type == ST_MACRO || type == ST_RULESET)
+ if (type == ST_MACRO || type == ST_RULESET || type == ST_NAMECANON)
{
while ((s = *ps) != NULL &&
(s->s_symtype != type || strcmp(name, s->s_name)))
@@ -113,10 +113,6 @@ stab(name, type, op)
len = sizeof(s->s_class);
break;
- case ST_ADDRESS:
- len = sizeof(s->s_address);
- break;
-
case ST_MAILER:
len = sizeof(s->s_mailer);
break;
diff --git a/gnu/usr.sbin/sendmail/sendmail/util.c b/gnu/usr.sbin/sendmail/sendmail/util.c
index e0161cccefe..72653ba3f3b 100644
--- a/gnu/usr.sbin/sendmail/sendmail/util.c
+++ b/gnu/usr.sbin/sendmail/sendmail/util.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: util.c,v 8.416 2009/12/18 17:05:26 ca Exp $")
+SM_RCSID("@(#)$Sendmail: util.c,v 8.425 2012/03/03 00:10:43 ca Exp $")
#include <sm/sendmail.h>
#include <sysexits.h>
@@ -2638,7 +2638,13 @@ proc_list_drop(pid, st, other)
mark_work_group_restart(ProcListVec[i].proc_other, st);
}
else if (type == PROC_QUEUE)
+ {
CurRunners -= ProcListVec[i].proc_count;
+
+ /* CHK_CUR_RUNNERS() can't be used here: uses syslog() */
+ if (CurRunners < 0)
+ CurRunners = 0;
+ }
}
/*
@@ -2702,6 +2708,14 @@ proc_list_probe()
(int) ProcListVec[i].proc_pid);
ProcListVec[i].proc_pid = NO_PID;
SM_FREE_CLR(ProcListVec[i].proc_task);
+
+ if (ProcListVec[i].proc_type == PROC_QUEUE)
+ {
+ CurRunners -= ProcListVec[i].proc_count;
+ CHK_CUR_RUNNERS("proc_list_probe", i,
+ ProcListVec[i].proc_count);
+ }
+
CurChildren--;
}
else
@@ -2852,3 +2866,4 @@ count_open_connections(hostaddr)
}
return n;
}
+
diff --git a/gnu/usr.sbin/sendmail/sendmail/version.c b/gnu/usr.sbin/sendmail/sendmail/version.c
index 7b9e3fbc308..aada0a9e0e2 100644
--- a/gnu/usr.sbin/sendmail/sendmail/version.c
+++ b/gnu/usr.sbin/sendmail/sendmail/version.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2011 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2012 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("@(#)$Sendmail: version.c,v 8.227 2011/04/26 23:02:35 ca Exp $")
+SM_RCSID("@(#)$Sendmail: version.c,v 8.235 2012/12/19 05:11:44 ca Exp $")
-char Version[] = "8.14.5";
+char Version[] = "8.14.6";