summaryrefslogtreecommitdiff
path: root/gnu/usr.sbin/sendmail
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2006-08-13 13:01:49 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2006-08-13 13:01:49 +0000
commit1fa569aed1046cca6d11b168d73872d749c62e80 (patch)
treed9a3517b308e518f7e67df1622c751a46fa97d98 /gnu/usr.sbin/sendmail
parent20fe53e7cf065e1693fc6cd4bb5c49ff37b743c6 (diff)
Update to sendmail-8.13.8
Diffstat (limited to 'gnu/usr.sbin/sendmail')
-rw-r--r--gnu/usr.sbin/sendmail/RELEASE_NOTES74
-rw-r--r--gnu/usr.sbin/sendmail/cf/README43
-rw-r--r--gnu/usr.sbin/sendmail/cf/cf/submit.mc2
-rw-r--r--gnu/usr.sbin/sendmail/cf/feature/dnsbl.m48
-rw-r--r--gnu/usr.sbin/sendmail/cf/feature/enhdnsbl.m48
-rw-r--r--gnu/usr.sbin/sendmail/cf/m4/proto.m46
-rw-r--r--gnu/usr.sbin/sendmail/cf/m4/version.m44
-rw-r--r--gnu/usr.sbin/sendmail/contrib/cidrexpand19
-rw-r--r--gnu/usr.sbin/sendmail/include/libmilter/mfapi.h4
-rw-r--r--gnu/usr.sbin/sendmail/libmilter/docs/xxfi_header.html13
-rw-r--r--gnu/usr.sbin/sendmail/libmilter/engine.c12
-rw-r--r--gnu/usr.sbin/sendmail/libsm/t-memstat.c10
-rw-r--r--gnu/usr.sbin/sendmail/libsm/vfprintf.c12
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/README16
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/bf.c7
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/collect.c4
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/conf.c4
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/daemon.c27
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/deliver.c21
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/domain.c14
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/envelope.c9
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/headers.c8
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/helpfile18
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/main.c27
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/map.c6
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/mci.c10
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/mime.c6
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/parseaddr.c18
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/queue.c32
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/savemail.c10
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/sendmail.h4
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/sfsasl.c17
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/sfsasl.h8
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c44
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/tls.c45
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/util.c14
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/version.c4
37 files changed, 412 insertions, 176 deletions
diff --git a/gnu/usr.sbin/sendmail/RELEASE_NOTES b/gnu/usr.sbin/sendmail/RELEASE_NOTES
index 8d089fe61ac..99d5abddbe7 100644
--- a/gnu/usr.sbin/sendmail/RELEASE_NOTES
+++ b/gnu/usr.sbin/sendmail/RELEASE_NOTES
@@ -1,11 +1,81 @@
SENDMAIL RELEASE NOTES
- $Sendmail: RELEASE_NOTES,v 8.1765 2006/03/08 02:15:03 ca Exp $
+ $Sendmail: RELEASE_NOTES,v 8.1777.2.15 2006/08/07 17:22:09 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.13.8/8.13.8 2006/08/09
+ Fix a regression in 8.13.7: if shared memory is activated, then
+ the server can erroneously report that there is
+ insufficient disk space. Additionally make sure that
+ an internal variable is set properly to avoid those
+ misleading errors. Based on patch from Steve Hubert
+ of University of Washington.
+ Fix a regression in 8.13.7: the PidFile could be removed after
+ the process that forks the daemon exited, i.e., if
+ sendmail -bd is invoked. Problem reported by Kan Sasaki
+ of Fusion Communications Corp. and Werner Wiethege.
+ Avoid opening qf files if QueueSortOrder is "none". Patch from
+ David F. Skoll.
+ Avoid a crash when finishing due to referencing a freed variable.
+ Problem reported and diagnosed by Moritz Jodeit.
+ CONTRIB: cidrexpand now deals with /0 by issuing the entire IPv4
+ range (0..255).
+ LIBMILTER: The "hostname" argument of the xxfi_connect() callback
+ previously was the equivalent of {client_ptr}. However,
+ this did not match the documentation of the function, hence
+ it has been changed to {client_name}. See doc/op/op.*
+ about these macros.
+
+8.13.7/8.13.7 2006/06/14
+ A malformed MIME structure with many parts can cause sendmail to
+ crash while trying to send a mail due to a stack overflow,
+ e.g., if the stack size is limited (ulimit -s). This
+ happens because the recursion of the function mime8to7()
+ was not restricted. The function is called for MIME 8 to
+ 7 bit conversion and also to enforce MaxMimeHeaderLength.
+ To work around this problem, recursive calls are limited to
+ a depth of MAXMIMENESTING (20); message content after this
+ limit is treated as opaque and is not checked further.
+ Problem noted by Frank Sheiness.
+ The changes to the I/O layer in 8.13.6 caused a regression for
+ SASL mechanisms that use the security layer, e.g.,
+ DIGEST-MD5. Problem noted by Robert Stampfli.
+ If a timeout occurs while reading a message (during the DATA phase)
+ a df file might have been left behind in the queue.
+ This was another side effect of the changes to the I/O
+ layer made in 8.13.6.
+ Several minor problems have been fixed that were found by a
+ Coverity scan of sendmail 8 as part of the NetBSD
+ distribution. See http://scan.coverity.com/
+ Note: the scan generated also a lot of "false positives",
+ e.g., "error" reports about situations that cannot happen.
+ Most of those code places are marked with lint(1) comments
+ like NOTREACHED, but Coverity does not understand those.
+ Hence an explicit assertion has been added in some cases
+ to avoid those false positives.
+ If the start of the sendmail daemon fails due to a configuration
+ error then in some cases shared memory segments or pid
+ files were not removed.
+ If DSN support is disabled via access_db, then related ESMTP
+ parameters for MAIL and RCPT should be rejected. Problem
+ reported by Akihiro Sagawa.
+ Enabling zlib compression in OpenSSL 0.9.8[ab] breaks the padding
+ bug work-around. Hence if sendmail is linked against
+ either of these versions and compression is available,
+ the padding bug work-around is turned off. Based on
+ patch from Victor Duchovni of Morgan Stanley.
+ CONFIG: FEATURE(`dnsbl') and FEATURE(`enhdnsbl') used
+ blackholes.mail-abuse.org as default domain for lookups,
+ however, that list is no longer available. To avoid
+ further problems, no default value is available anymore,
+ but an argument must be specified.
+ Portability:
+ Fix compilation on OSF/1 for sfsasl.c. Patch from
+ Pieter Bowman of the University of Utah.
+
8.13.6/8.13.6 2006/03/22
SECURITY: Replace unsafe use of setjmp(3)/longjmp(3) in the server
and client side of sendmail with timeouts in the libsm I/O
@@ -127,7 +197,7 @@ summary of the changes in that release.
Make sure return parameters are initialized in getmxrr(). Problem
found by Gael Roualland using valgrind.
If shared memory is used and the RunAsUser option is set, then the
- owner and group of the shared memory segment is set to
+ owner and group of the shared memory segment is set to
the ids specified RunAsUser and the access mode is set
to 0660 to allow for updates by sendmail processes.
The number of queue entries that is (optionally) kept in shared
diff --git a/gnu/usr.sbin/sendmail/cf/README b/gnu/usr.sbin/sendmail/cf/README
index 1a2bc5b17bb..bb30698d9da 100644
--- a/gnu/usr.sbin/sendmail/cf/README
+++ b/gnu/usr.sbin/sendmail/cf/README
@@ -1242,13 +1242,10 @@ use_client_ptr If this feature is enabled then check_relay will override
about check_relay, {client_name}, and {client_ptr}.
dnsbl Turns on rejection of hosts found in an DNS based rejection
- list. If an argument is provided it is used as the domain
- in which blocked hosts are listed; otherwise it defaults to
- blackholes.mail-abuse.org. An explanation for an DNS based
- rejection list can be found at http://mail-abuse.org/rbl/.
- A second argument can be used to change the default error
- message. Without that second argument, the error message
- will be
+ list. The first is used as the domain in which blocked
+ hosts are listed. A second argument can be used to change
+ the default error message. Without that second argument,
+ the error message will be
Rejected: IP-ADDRESS listed at SERVER
where IP-ADDRESS and SERVER are replaced by the appropriate
information. By default, temporary lookup failures are
@@ -1279,13 +1276,6 @@ dnsbl Turns on rejection of hosts found in an DNS based rejection
See below (EDNSBL_TO) for an explanation.
- NOTE: The default DNS blacklist, blackholes.mail-abuse.org,
- is a service offered by the Mail Abuse Prevention System
- (MAPS). As of July 31, 2001, MAPS is a subscription
- service, so using that network address won't work if you
- haven't subscribed. Contact MAPS to subscribe
- (http://mail-abuse.org/).
-
enhdnsbl Enhanced version of dnsbl (see above). Further arguments
(up to 5) can be used to specify specific return values
from lookups. Temporary lookup failures are ignored unless
@@ -2631,22 +2621,16 @@ as value part in the access map. Taking the example from above:
Mail can't be sent to spammer@aol.com or anyone at cyberspammer.com.
That's why tagged entries should be used.
-There are several DNS based blacklists, the first of which was
-the RBL (``Realtime Blackhole List'') run by the MAPS project,
-see http://mail-abuse.org/. These are databases of spammers
+There are several DNS based blacklists which can be found by
+querying a search engine. These are databases of spammers
maintained in DNS. To use such a database, specify
- FEATURE(`dnsbl')
-
-This will cause sendmail to reject mail from any site in the original
-Realtime Blackhole List database. This default DNS blacklist,
-blackholes.mail-abuse.org, is a service offered by the Mail Abuse
-Prevention System (MAPS). As of July 31, 2001, MAPS is a subscription
-service, so using that network address won't work if you haven't
-subscribed. Contact MAPS to subscribe (http://mail-abuse.org/).
+ FEATURE(`dnsbl', `dnsbl.example.com')
-You can specify an alternative RBL server to check by specifying an
-argument to the FEATURE. The default error message is
+This will cause sendmail to reject mail from any site listed in the
+DNS based blacklist. You must select an DNSB based blacklist domain
+to check by specifying an argument to the FEATURE. The default
+error message is
Rejected: IP-ADDRESS listed at SERVER
@@ -2668,8 +2652,7 @@ where IP-ADDRESS and SERVER are replaced by the appropriate
information.
This FEATURE can be included several times to query different
-DNS based rejection lists, e.g., the dial-up user list (see
-http://mail-abuse.org/dul/).
+DNS based rejection lists.
Notice: to avoid checking your own local domains against those
blacklists, use the access_db feature and add:
@@ -4605,4 +4588,4 @@ M4 DIVERSIONS
8 DNS based blacklists
9 special local rulesets (1 and 2)
-$Revision: 1.24 $, Last updated $Date: 2006/03/22 18:43:52 $
+$Revision: 1.25 $, Last updated $Date: 2006/08/13 13:01:48 $
diff --git a/gnu/usr.sbin/sendmail/cf/cf/submit.mc b/gnu/usr.sbin/sendmail/cf/cf/submit.mc
index cb2774beea5..ea2bdee7f0d 100644
--- a/gnu/usr.sbin/sendmail/cf/cf/submit.mc
+++ b/gnu/usr.sbin/sendmail/cf/cf/submit.mc
@@ -15,7 +15,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`$Sendmail: submit.mc,v 8.13 2003/09/10 22:12:48 ca Exp $')
+VERSIONID(`$Sendmail: submit.mc,v 8.14 2006/04/05 05:54:41 ca Exp $')
define(`confCF_VERSION', `Submit')dnl
define(`__OSTYPE__',`')dnl dirty hack to keep proto.m4 from complaining
define(`_USE_DECNET_SYNTAX_', `1')dnl support DECnet
diff --git a/gnu/usr.sbin/sendmail/cf/feature/dnsbl.m4 b/gnu/usr.sbin/sendmail/cf/feature/dnsbl.m4
index 9d89d4c1ac6..d76727eae3e 100644
--- a/gnu/usr.sbin/sendmail/cf/feature/dnsbl.m4
+++ b/gnu/usr.sbin/sendmail/cf/feature/dnsbl.m4
@@ -1,6 +1,6 @@
divert(-1)
#
-# Copyright (c) 1998-2002, 2005 Sendmail, Inc. and its suppliers.
+# Copyright (c) 1998-2002, 2005, 2006 Sendmail, Inc. and its suppliers.
# All rights reserved.
#
# By using this file, you agree to the terms and conditions set
@@ -12,13 +12,15 @@ divert(-1)
ifdef(`DNSBL_MAP', `', `define(`DNSBL_MAP', `dns -R A')')
divert(0)
ifdef(`_DNSBL_R_',`dnl',`dnl
-VERSIONID(`$Sendmail: dnsbl.m4,v 8.30 2005/07/25 20:56:53 ca Exp $')
+VERSIONID(`$Sendmail: dnsbl.m4,v 8.32 2006/03/29 22:50:16 ca Exp $')
define(`_DNSBL_R_',`')
+ifelse(defn(`_ARG_'), `',
+ `errprint(`*** ERROR: missing argument for FEATURE(`dnsbl')')')
LOCAL_CONFIG
# map for DNS based blacklist lookups
Kdnsbl DNSBL_MAP -T<TMP>ifdef(`DNSBL_MAP_OPT',` DNSBL_MAP_OPT')')
divert(-1)
-define(`_DNSBL_SRV_', `ifelse(len(X`'_ARG_),`1',`blackholes.mail-abuse.org',_ARG_)')dnl
+define(`_DNSBL_SRV_', `_ARG_')dnl
define(`_DNSBL_MSG_', `ifelse(len(X`'_ARG2_),`1',`"550 Rejected: " $`'&{client_addr} " listed at '_DNSBL_SRV_`"',`_ARG2_')')dnl
define(`_DNSBL_MSG_TMP_', `ifelse(_ARG3_,`t',`"451 Temporary lookup failure of " $`'&{client_addr} " at '_DNSBL_SRV_`"',`_ARG3_')')dnl
divert(8)
diff --git a/gnu/usr.sbin/sendmail/cf/feature/enhdnsbl.m4 b/gnu/usr.sbin/sendmail/cf/feature/enhdnsbl.m4
index 3364d53a418..419a5ea669f 100644
--- a/gnu/usr.sbin/sendmail/cf/feature/enhdnsbl.m4
+++ b/gnu/usr.sbin/sendmail/cf/feature/enhdnsbl.m4
@@ -1,6 +1,6 @@
divert(-1)
#
-# Copyright (c) 2000-2002, 2005 Sendmail, Inc. and its suppliers.
+# Copyright (c) 2000-2002, 2005, 2006 Sendmail, Inc. and its suppliers.
# All rights reserved.
#
# By using this file, you agree to the terms and conditions set
@@ -9,16 +9,18 @@ divert(-1)
#
#
+ifelse(defn(`_ARG_'), `',
+ `errprint(`*** ERROR: missing argument for FEATURE(`enhdnsbl')')')
divert(0)
ifdef(`_EDNSBL_R_',`dnl',`dnl
-VERSIONID(`$Sendmail: enhdnsbl.m4,v 1.10 2005/07/25 20:56:53 ca Exp $')
+VERSIONID(`$Sendmail: enhdnsbl.m4,v 1.11 2006/03/31 19:56:16 ca Exp $')
LOCAL_CONFIG
define(`_EDNSBL_R_',`')dnl
# map for enhanced DNS based blacklist lookups
Kednsbl dns -R A -a. -T<TMP> -r`'ifdef(`EDNSBL_TO',`EDNSBL_TO',`5')
')
divert(-1)
-define(`_EDNSBL_SRV_', `ifelse(len(X`'_ARG_),`1',`blackholes.mail-abuse.org',_ARG_)')dnl
+define(`_EDNSBL_SRV_', `_ARG_')dnl
define(`_EDNSBL_MSG_', `ifelse(len(X`'_ARG2_),`1',`"550 Rejected: " $`'&{client_addr} " listed at '_EDNSBL_SRV_`"',`_ARG2_')')dnl
define(`_EDNSBL_MSG_TMP_', `ifelse(_ARG3_,`t',`"451 Temporary lookup failure of " $`'&{client_addr} " at '_EDNSBL_SRV_`"',`_ARG3_')')dnl
define(`_EDNSBL_MATCH_', `ifelse(len(X`'_ARG4_),`1',`$`'+',_ARG4_)')dnl
diff --git a/gnu/usr.sbin/sendmail/cf/m4/proto.m4 b/gnu/usr.sbin/sendmail/cf/m4/proto.m4
index 2837fb884fc..5aa0753d51e 100644
--- a/gnu/usr.sbin/sendmail/cf/m4/proto.m4
+++ b/gnu/usr.sbin/sendmail/cf/m4/proto.m4
@@ -1,6 +1,6 @@
divert(-1)
#
-# Copyright (c) 1998-2005 Sendmail, Inc. and its suppliers.
+# Copyright (c) 1998-2006 Sendmail, Inc. and its suppliers.
# All rights reserved.
# Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
@@ -13,7 +13,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`$Sendmail: proto.m4,v 8.718 2005/08/24 18:07:23 ca Exp $')
+VERSIONID(`$Sendmail: proto.m4,v 8.719 2006/03/30 20:50:13 ca Exp $')
# level CF_LEVEL config file format
V`'CF_LEVEL/ifdef(`VENDOR_NAME', `VENDOR_NAME', `Berkeley')
@@ -1959,7 +1959,7 @@ R<@> < $* @ $+ . $+ > $: < $1 @ $2 . $3 >
dnl prepend daemon_flags
R<@> $* $: $&{daemon_flags} $| <@> $1
dnl workspace: ${daemon_flags} $| <@> <address>
-dnl 'r'equire qual.rcpt: ok
+dnl _r_equire qual.rcpt: ok
R$* r $* $| <@> < $+ @ $+ > $: < $3 @ $4 >
dnl do not allow these at all or only from local systems?
R$* r $* $| <@> < $* > $: < ? $&{client_name} > < $3 >
diff --git a/gnu/usr.sbin/sendmail/cf/m4/version.m4 b/gnu/usr.sbin/sendmail/cf/m4/version.m4
index a4c4b740ecb..16ba024d2e0 100644
--- a/gnu/usr.sbin/sendmail/cf/m4/version.m4
+++ b/gnu/usr.sbin/sendmail/cf/m4/version.m4
@@ -11,8 +11,8 @@ divert(-1)
# the sendmail distribution.
#
#
-VERSIONID(`$Sendmail: version.m4,v 8.147 2006/03/08 19:21:23 ca Exp $')
+VERSIONID(`$Sendmail: version.m4,v 8.150.2.8 2006/07/26 17:24:02 ca Exp $')
#
divert(0)
# Configuration version number
-DZ8.13.6`'ifdef(`confCF_VERSION', `/confCF_VERSION')
+DZ8.13.8`'ifdef(`confCF_VERSION', `/confCF_VERSION')
diff --git a/gnu/usr.sbin/sendmail/contrib/cidrexpand b/gnu/usr.sbin/sendmail/contrib/cidrexpand
index b9ff9987e4a..c367d9f21be 100644
--- a/gnu/usr.sbin/sendmail/contrib/cidrexpand
+++ b/gnu/usr.sbin/sendmail/contrib/cidrexpand
@@ -1,13 +1,13 @@
#!/usr/bin/perl -w
-# $Sendmail: cidrexpand,v 8.4 2002/11/22 21:13:14 ca Exp $
+# $Sendmail: cidrexpand,v 8.4.2.1 2006/08/07 17:22:10 ca Exp $
#
# v 0.4
#
# 17 July 2000 Derek J. Balling (dredd@megacity.org)
-#
+#
# Acts as a preparser on /etc/mail/access_db to allow you to use address/bit
-# notation.
+# notation.
#
# If you have two overlapping CIDR blocks with conflicting actions
# e.g. 10.2.3.128/25 REJECT and 10.2.3.143 ACCEPT
@@ -25,10 +25,15 @@
# Added code to deal with the prefix tags that may now be included in
# the access_db
#
-# Added clarification in the notes for what to do if you have
+# Added clarification in the notes for what to do if you have
# exceptions to a larger CIDR block.
#
-# usage:
+# 3 August 2006
+#
+# Corrected a bug to have it handle the special case of "0.0.0.0/0"
+# since Net::CIDR doesn't handle it properly.
+#
+# usage:
# cidrexpand < /etc/mail/access | makemap -r hash /etc/mail/access
#
#
@@ -72,7 +77,7 @@ while (<>)
}
}
}
-
+
sub expand_network
{
my $left_input = shift;
@@ -80,6 +85,8 @@ sub expand_network
my ($network,$mask) = split /\//, $left_input;
if (defined $mask)
{
+ return (0..255) if $mask == 0;
+
my @parts = split /\./, $network;
while ($#parts < 3)
{
diff --git a/gnu/usr.sbin/sendmail/include/libmilter/mfapi.h b/gnu/usr.sbin/sendmail/include/libmilter/mfapi.h
index e22ba16645e..ce3b69bae67 100644
--- a/gnu/usr.sbin/sendmail/include/libmilter/mfapi.h
+++ b/gnu/usr.sbin/sendmail/include/libmilter/mfapi.h
@@ -7,7 +7,7 @@
* the sendmail distribution.
*
*
- * $Sendmail: mfapi.h,v 8.60 2004/08/20 21:24:14 ca Exp $
+ * $Sendmail: mfapi.h,v 8.61 2006/05/04 17:02:01 ca Exp $
*/
/*
@@ -134,7 +134,7 @@ struct smfiDesc
#endif /* SMFI_VERSION > 2 */
#if SMFI_VERSION > 3
- /* any unrecognized or unimplemented command filter */
+ /* SMTP DATA command filter */
sfsistat (*xxfi_data) SM__P((SMFICTX *));
#endif /* SMFI_VERSION > 3 */
};
diff --git a/gnu/usr.sbin/sendmail/libmilter/docs/xxfi_header.html b/gnu/usr.sbin/sendmail/libmilter/docs/xxfi_header.html
index 2e19e67f54b..174015755e8 100644
--- a/gnu/usr.sbin/sendmail/libmilter/docs/xxfi_header.html
+++ b/gnu/usr.sbin/sendmail/libmilter/docs/xxfi_header.html
@@ -2,7 +2,7 @@
<head><title>xxfi_header</title></head>
<body>
<!--
-$Sendmail: xxfi_header.html,v 1.10 2003/03/05 19:57:55 ca Exp $
+$Sendmail: xxfi_header.html,v 1.11 2006/04/05 17:10:43 ca Exp $
-->
<h1>xxfi_header</h1>
@@ -44,10 +44,11 @@ Handle a message header.
<td> Header field name.
</td></tr>
<tr valign="top"><td>headerv</td>
- <td>Header field value. The
- content of the header may include folded white space (i.e. multiple
- lines with following white space). The trailing line terminator (CR/LF)
- is removed.
+ <td>Header field value.
+ The content of the header may include folded white space,
+ i.e., multiple lines with following white space
+ where lines are separated by LF (not CR/LF).
+ The trailing line terminator (CR/LF) is removed.
</td></tr>
</table>
</td></tr>
@@ -67,7 +68,7 @@ RFC <a href="http://www.rfc-editor.org/rfc/rfc822.html">822</a>
<hr size="1">
<font size="-1">
-Copyright (c) 2000, 2003 Sendmail, Inc. and its suppliers.
+Copyright (c) 2000, 2003, 2006 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/engine.c b/gnu/usr.sbin/sendmail/libmilter/engine.c
index 88a564ae355..9ad98bc16c2 100644
--- a/gnu/usr.sbin/sendmail/libmilter/engine.c
+++ b/gnu/usr.sbin/sendmail/libmilter/engine.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2003 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2004, 2006 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: engine.c,v 8.120 2004/10/20 21:09:00 ca Exp $")
+SM_RCSID("@(#)$Sendmail: engine.c,v 8.121 2006/04/18 21:01:46 ca Exp $")
#include "libmilter.h"
@@ -166,6 +166,8 @@ static int next_states[] =
NX_UNKN
};
+#define SIZE_NEXT_STATES (sizeof(next_states) / sizeof(next_states[0]))
+
/* commands received by milter */
static cmdfct cmds[] =
{
@@ -1076,6 +1078,8 @@ trans_ok(old, new)
int s, n;
s = old;
+ if (s >= SIZE_NEXT_STATES)
+ return false;
do
{
/* is this state transition allowed? */
@@ -1089,6 +1093,8 @@ trans_ok(old, new)
*/
n = s + 1;
+ if (n >= SIZE_NEXT_STATES)
+ return false;
/*
** can we actually "skip" this state?
@@ -1100,7 +1106,7 @@ trans_ok(old, new)
s = n;
else
return false;
- } while (s <= ST_LAST);
+ } while (s < SIZE_NEXT_STATES);
return false;
}
/*
diff --git a/gnu/usr.sbin/sendmail/libsm/t-memstat.c b/gnu/usr.sbin/sendmail/libsm/t-memstat.c
index 78102fe0c7a..6a3a57192f8 100644
--- a/gnu/usr.sbin/sendmail/libsm/t-memstat.c
+++ b/gnu/usr.sbin/sendmail/libsm/t-memstat.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 2005, 2006 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -8,16 +8,20 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: t-memstat.c,v 1.5 2005/12/22 19:05:42 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: t-memstat.c,v 1.6 2006/03/27 22:34:47 ca Exp $")
/*
-** Simple test program for memstat
+** Simple test program for memstat
*/
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <strings.h>
+#include <string.h>
+
+extern char *optarg;
+extern int optind;
int
main(argc, argv)
diff --git a/gnu/usr.sbin/sendmail/libsm/vfprintf.c b/gnu/usr.sbin/sendmail/libsm/vfprintf.c
index 8e8193e9166..d9a289110b9 100644
--- a/gnu/usr.sbin/sendmail/libsm/vfprintf.c
+++ b/gnu/usr.sbin/sendmail/libsm/vfprintf.c
@@ -535,11 +535,19 @@ reswitch: switch (ch)
if (prec > 120)
prec = 120;
if (prec >= 0)
+#if HASSNPRINTF
snprintf(out, sizeof(out), fmt, width,
- prec, val);
+ prec, val);
+#else /* HASSNPRINTF */
+ sprintf(out, fmt, width, prec, val);
+#endif /* HASSNPRINTF */
else
+#if HASSNPRINTF
snprintf(out, sizeof(out), fmt, width,
- val);
+ val);
+#else /* HASSNPRINTF */
+ sprintf(out, fmt, width, val);
+#endif /* HASSNPRINTF */
len = strlen(out);
PRINT(out, len);
FLUSH();
diff --git a/gnu/usr.sbin/sendmail/sendmail/README b/gnu/usr.sbin/sendmail/sendmail/README
index 0fbc4b9901b..bf7be8363f2 100644
--- a/gnu/usr.sbin/sendmail/sendmail/README
+++ b/gnu/usr.sbin/sendmail/sendmail/README
@@ -9,7 +9,7 @@
# the sendmail distribution.
#
#
-# $Sendmail: README,v 8.388 2005/07/26 05:45:39 ca Exp $
+# $Sendmail: README,v 8.389 2006/05/02 16:58:50 ca Exp $
#
This directory contains the source files for sendmail(TM).
@@ -1716,6 +1716,18 @@ Regular Expressions (MAP_REGEX)
Make sure, your compiler reads regex.h from the distribution,
not from /usr/include, otherwise sendmail will dump a core.
+Fedora Core 5, 64 bit version
+ If the ld stage fails with undefined functions like
+ __res_querydomain, __dn_expand
+ then add these lines to devtools/Site/site.config.m4
+
+ APPENDDEF(`confLIBDIRS', `-L/usr/lib64')
+ APPENDDEF(`confINCDIRS', `-I/usr/include/bind9')
+
+ and rebuild (sh ./Build -c).
+
+ Problem noted by Daniel Krones, solution suggested by
+ Anthony Howe.
+--------------+
| MANUAL PAGES |
@@ -1832,4 +1844,4 @@ util.c Some general purpose routines used by sendmail.
version.c The version number and information about this
version of sendmail.
-(Version $Revision: 1.24 $, last update $Date: 2006/03/22 18:43:55 $ )
+(Version $Revision: 1.25 $, last update $Date: 2006/08/13 13:01:48 $ )
diff --git a/gnu/usr.sbin/sendmail/sendmail/bf.c b/gnu/usr.sbin/sendmail/sendmail/bf.c
index cc84f80cf49..bb63015c543 100644
--- a/gnu/usr.sbin/sendmail/sendmail/bf.c
+++ b/gnu/usr.sbin/sendmail/sendmail/bf.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2002, 2004 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2002, 2004, 2006 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -18,7 +18,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: bf.c,v 8.61 2004/08/03 23:59:02 ca Exp $")
+SM_RCSID("@(#)$Sendmail: bf.c,v 8.62 2006/03/31 18:45:56 ca Exp $")
#include <sys/types.h>
#include <sys/stat.h>
@@ -540,13 +540,16 @@ sm_bfwrite(fp, buf, nbytes)
if (!bfp->bf_ondisk)
{
MODE_T omask;
+ int save_errno;
/* Clear umask as bf_filemode are the true perms */
omask = umask(0);
retval = OPEN(bfp->bf_filename,
O_RDWR | O_CREAT | O_TRUNC | QF_O_EXTRA,
bfp->bf_filemode, bfp->bf_flags);
+ save_errno = errno;
(void) umask(omask);
+ errno = save_errno;
/* Couldn't create file: failure */
if (retval < 0)
diff --git a/gnu/usr.sbin/sendmail/sendmail/collect.c b/gnu/usr.sbin/sendmail/sendmail/collect.c
index fd1697f8a64..2d61198b3ab 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.272 2006/03/02 19:09:26 ca Exp $")
+SM_RCSID("@(#)$Sendmail: collect.c,v 8.273 2006/03/31 18:51:47 ca Exp $")
static void eatfrom __P((char *volatile, ENVELOPE *));
static void collect_doheader __P((ENVELOPE *));
@@ -857,6 +857,8 @@ readerr:
q->q_state = QS_FATALERR;
}
+ (void) sm_io_close(df, SM_TIME_DEFAULT);
+ df = NULL;
finis(true, true, ExitStat);
/* NOTREACHED */
}
diff --git a/gnu/usr.sbin/sendmail/sendmail/conf.c b/gnu/usr.sbin/sendmail/sendmail/conf.c
index 206aa8a07b3..3634cb74f6e 100644
--- a/gnu/usr.sbin/sendmail/sendmail/conf.c
+++ b/gnu/usr.sbin/sendmail/sendmail/conf.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: conf.c,v 8.1081 2006/02/24 02:21:53 ca Exp $")
+SM_RCSID("@(#)$Sendmail: conf.c,v 8.1082 2006/03/22 22:49:33 ca Exp $")
#include <sendmail/pathnames.h>
#if NEWDB
@@ -2197,7 +2197,7 @@ shouldqueue(pri, ct)
memfree < QueueLowMem)
{
if (tTd(3, 30))
- sm_dprintf("true (memfree=%ld < QueueLowMem)\n",
+ sm_dprintf("true (memfree=%ld < QueueLowMem=%ld)\n",
memfree, QueueLowMem);
return true;
}
diff --git a/gnu/usr.sbin/sendmail/sendmail/daemon.c b/gnu/usr.sbin/sendmail/sendmail/daemon.c
index ca593fb1dc0..7e45f05e05e 100644
--- a/gnu/usr.sbin/sendmail/sendmail/daemon.c
+++ b/gnu/usr.sbin/sendmail/sendmail/daemon.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: daemon.c,v 8.665 2006/03/02 19:12:00 ca Exp $")
+SM_RCSID("@(#)$Sendmail: daemon.c,v 8.666 2006/04/18 01:23:42 ca Exp $")
#if defined(SOCK_STREAM) || defined(__GNU_LIBRARY__)
# define USE_SOCK_STREAM 1
@@ -520,18 +520,22 @@ getrequests(e)
syserr("getrequests: accept");
- /* arrange to re-open the socket next time around */
- (void) close(Daemons[curdaemon].d_socket);
- Daemons[curdaemon].d_socket = -1;
+ if (curdaemon >= 0)
+ {
+ /* arrange to re-open socket next time around */
+ (void) close(Daemons[curdaemon].d_socket);
+ Daemons[curdaemon].d_socket = -1;
#if SO_REUSEADDR_IS_BROKEN
- /*
- ** Give time for bound socket to be released.
- ** This creates a denial-of-service if you can
- ** force accept() to fail on affected systems.
- */
+ /*
+ ** Give time for bound socket to be released.
+ ** This creates a denial-of-service if you can
+ ** force accept() to fail on affected systems.
+ */
- Daemons[curdaemon].d_refuse_connections_until = curtime() + 15;
+ Daemons[curdaemon].d_refuse_connections_until =
+ curtime() + 15;
#endif /* SO_REUSEADDR_IS_BROKEN */
+ }
continue;
}
@@ -2083,7 +2087,7 @@ makeconnection(host, port, mci, e, enough)
SOCKADDR clt_addr;
int save_errno = 0;
volatile SOCKADDR_LEN_T addrlen;
- volatile bool firstconnect;
+ volatile bool firstconnect = true;
SM_EVENT *volatile ev = NULL;
#if NETINET6
volatile bool v6found = false;
@@ -2486,7 +2490,6 @@ gothostent:
}
#endif /* XLA */
- firstconnect = true;
for (;;)
{
if (tTd(16, 1))
diff --git a/gnu/usr.sbin/sendmail/sendmail/deliver.c b/gnu/usr.sbin/sendmail/sendmail/deliver.c
index 5711f2d5dbf..6334500dffc 100644
--- a/gnu/usr.sbin/sendmail/sendmail/deliver.c
+++ b/gnu/usr.sbin/sendmail/sendmail/deliver.c
@@ -14,7 +14,7 @@
#include <sendmail.h>
#include <sm/time.h>
-SM_RCSID("@(#)$Sendmail: deliver.c,v 8.1000 2006/03/02 01:37:39 ca Exp $")
+SM_RCSID("@(#)$Sendmail: deliver.c,v 8.1003.2.1 2006/05/23 01:32:08 ca Exp $")
#if HASSETUSERCONTEXT
# include <login_cap.h>
@@ -3127,15 +3127,18 @@ reconnect: /* after switching to an encrypted connection */
if (result == SASL_OK && *ssf > 0)
{
+ int tmo;
+
/*
** Convert I/O layer to use SASL.
** If the call fails, the connection
** is aborted.
*/
+ tmo = DATA_PROGRESS_TIMEOUT * 1000;
if (sfdcsasl(&mci->mci_in,
&mci->mci_out,
- mci->mci_conn) == 0)
+ mci->mci_conn, tmo) == 0)
{
mci->mci_flags &= ~MCIF_EXTENS;
mci->mci_flags |= MCIF_AUTHACT|
@@ -3961,7 +3964,11 @@ giveresponse(status, dsn, m, mci, ctladdr, xstart, e, to)
char *exmsg;
if (e == NULL)
+ {
syserr("giveresponse: null envelope");
+ /* NOTREACHED */
+ SM_ASSERT(0);
+ }
/*
** Compute status message from code.
@@ -5217,8 +5224,14 @@ mailfile(filename, mailer, ctladdr, sfflags, e)
CurrentPid = getpid();
if (e->e_lockfp != NULL)
- (void) close(sm_io_getinfo(e->e_lockfp, SM_IO_WHAT_FD,
- NULL));
+ {
+ int fd;
+
+ fd = sm_io_getinfo(e->e_lockfp, SM_IO_WHAT_FD, NULL);
+ /* SM_ASSERT(fd >= 0); */
+ if (fd >= 0)
+ (void) close(fd);
+ }
(void) sm_signal(SIGINT, SIG_DFL);
(void) sm_signal(SIGHUP, SIG_DFL);
diff --git a/gnu/usr.sbin/sendmail/sendmail/domain.c b/gnu/usr.sbin/sendmail/sendmail/domain.c
index 8d0ccd036a9..7573da293bd 100644
--- a/gnu/usr.sbin/sendmail/sendmail/domain.c
+++ b/gnu/usr.sbin/sendmail/sendmail/domain.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2004, 2006 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1986, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -14,9 +14,9 @@
#include <sendmail.h>
#if NAMED_BIND
-SM_RCSID("@(#)$Sendmail: domain.c,v 8.197 2005/03/04 00:54:42 ca Exp $ (with name server)")
+SM_RCSID("@(#)$Sendmail: domain.c,v 8.199 2006/04/18 00:00:34 ca Exp $ (with name server)")
#else /* NAMED_BIND */
-SM_RCSID("@(#)$Sendmail: domain.c,v 8.197 2005/03/04 00:54:42 ca Exp $ (without name server)")
+SM_RCSID("@(#)$Sendmail: domain.c,v 8.199 2006/04/18 00:00:34 ca Exp $ (without name server)")
#endif /* NAMED_BIND */
#if NAMED_BIND
@@ -521,7 +521,7 @@ punt:
}
# if NETINET6
freehostent(h);
- hp = NULL;
+ h = NULL;
# endif /* NETINET6 */
}
if (strlen(host) >= sizeof MXHostBuf)
@@ -972,11 +972,7 @@ nexttype:
/* avoid problems after truncation in tcp packets */
if (ret > sizeof(answer))
ret = sizeof(answer);
- if (ret < 0)
- {
- *statp = EX_SOFTWARE;
- return false;
- }
+ SM_ASSERT(ret >= 0);
/*
** Appear to have a match. Confirm it by searching for A or
diff --git a/gnu/usr.sbin/sendmail/sendmail/envelope.c b/gnu/usr.sbin/sendmail/sendmail/envelope.c
index fd6cde9eac0..2d3f24111ec 100644
--- a/gnu/usr.sbin/sendmail/sendmail/envelope.c
+++ b/gnu/usr.sbin/sendmail/sendmail/envelope.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: envelope.c,v 8.295 2005/06/15 20:32:18 ca Exp $")
+SM_RCSID("@(#)$Sendmail: envelope.c,v 8.296 2006/03/31 18:53:50 ca Exp $")
/*
** CLRSESSENVELOPE -- clear session oriented data in an envelope
@@ -519,7 +519,14 @@ simpledrop:
printenvflags(e);
}
if (!panic)
+ {
+ if (e->e_dfp != NULL)
+ {
+ (void) sm_io_close(e->e_dfp, SM_TIME_DEFAULT);
+ e->e_dfp = NULL;
+ }
(void) xunlink(queuename(e, DATAFL_LETTER));
+ }
if (panic && QueueMode == QM_LOST)
{
/*
diff --git a/gnu/usr.sbin/sendmail/sendmail/headers.c b/gnu/usr.sbin/sendmail/sendmail/headers.c
index e940a040f0b..997bc85b96a 100644
--- a/gnu/usr.sbin/sendmail/sendmail/headers.c
+++ b/gnu/usr.sbin/sendmail/sendmail/headers.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: headers.c,v 8.290 2006/02/25 02:16:52 ca Exp $")
+SM_RCSID("@(#)$Sendmail: headers.c,v 8.291 2006/03/24 01:01:56 ca Exp $")
static HDR *allocheader __P((char *, char *, int, SM_RPOOL_T *));
static size_t fix_mime_header __P((HDR *, ENVELOPE *));
@@ -1542,7 +1542,7 @@ crackaddr(addr, e)
** flags -- MIME conversion flags.
**
** Returns:
-** success
+** true iff header part was written successfully
**
** Side Effects:
** none.
@@ -1810,7 +1810,7 @@ putheader(mci, hdr, e, flags)
** mci -- the connection info for output
**
** Returns:
-** success
+** true iff header was written successfully
*/
static bool
@@ -1871,7 +1871,7 @@ put_vanilla_header(h, v, mci)
** e -- the envelope containing the message.
**
** Returns:
-** success
+** true iff header field was written successfully
**
** Side Effects:
** outputs "p" to file "fp".
diff --git a/gnu/usr.sbin/sendmail/sendmail/helpfile b/gnu/usr.sbin/sendmail/sendmail/helpfile
index b84226a0a95..4aef2dff221 100644
--- a/gnu/usr.sbin/sendmail/sendmail/helpfile
+++ b/gnu/usr.sbin/sendmail/sendmail/helpfile
@@ -1,6 +1,6 @@
#vers 2
cpyr
-cpyr Copyright (c) 1998-2000, 2002, 2004, 2005 Sendmail, Inc. and its suppliers.
+cpyr Copyright (c) 1998-2000, 2002, 2004-2006 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 $$Sendmail: helpfile,v 8.45 2005/09/13 00:05:23 ca Exp $$
+cpyr $$Sendmail: helpfile,v 8.47 2006/04/26 18:22:54 ca Exp $$
cpyr
smtp This is sendmail version $v
smtp Topics:
@@ -20,8 +20,8 @@ smtp RSET NOOP QUIT HELP VRFY
smtp EXPN VERB ETRN DSN AUTH
smtp STARTTLS
smtp For more info use "HELP <topic>".
-smtp To report bugs in the implementation send email to
-smtp sendmail-bugs@sendmail.org.
+smtp To report bugs in the implementation see
+smtp http://www.sendmail.org/email-addresses.html
smtp For local information send email to Postmaster at your site.
help HELP [ <topic> ]
help The HELP command gives help info.
@@ -77,14 +77,14 @@ expn Expand an address. If the address indicates a mailing
expn list, return the contents of that list.
noop NOOP
noop Do nothing.
-send SEND FROM: <sender>
+send SEND FROM:<sender>
send replaces the MAIL command, and can be used to send
send directly to a users terminal. Not supported in this
send implementation.
-soml SOML FROM: <sender>
+soml SOML FROM:<sender>
soml Send or mail. If the user is logged in, send directly,
soml otherwise mail. Not supported in this implementation.
-saml SAML FROM: <sender>
+saml SAML FROM:<sender>
saml Send and mail. Send directly to the user's terminal,
saml and also mail a letter. Not supported in this
saml implementation.
@@ -95,8 +95,8 @@ etrn ETRN [ <hostname> | @<domain> | \#<queuename> ]
etrn Run the queue for the specified <hostname>, or
etrn all hosts within a given <domain>, or a specially-named
etrn <queuename> (implementation-specific).
-dsn MAIL FROM: <sender> [ RET={ FULL | HDRS} ] [ ENVID=<envid> ]
-dsn RCPT TO: <recipient> [ NOTIFY={NEVER,SUCCESS,FAILURE,DELAY} ]
+dsn MAIL From:<sender> [ RET={ FULL | HDRS} ] [ ENVID=<envid> ]
+dsn RCPT To:<recipient> [ NOTIFY={NEVER,SUCCESS,FAILURE,DELAY} ]
dsn [ ORCPT=<recipient> ]
dsn SMTP Delivery Status Notifications.
dsn Descriptions:
diff --git a/gnu/usr.sbin/sendmail/sendmail/main.c b/gnu/usr.sbin/sendmail/sendmail/main.c
index 4f707124eda..d0b1c2f9ea3 100644
--- a/gnu/usr.sbin/sendmail/sendmail/main.c
+++ b/gnu/usr.sbin/sendmail/sendmail/main.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2005 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2006 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -25,7 +25,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.942 2005/12/26 04:39:13 ca Exp $")
+SM_RCSID("@(#)$Sendmail: main.c,v 8.944.2.2 2006/08/03 22:05:03 ca Exp $")
#if NETINET || NETINET6
@@ -516,6 +516,8 @@ main(argc, argv, envp)
/* reset macro */
set_op_mode(OpMode);
+ if (OpMode == MD_DAEMON)
+ DaemonPid = CurrentPid; /* needed for finis() to work */
pw = sm_getpwuid(RealUid);
if (pw != NULL)
@@ -2287,6 +2289,8 @@ main(argc, argv, envp)
{
char dtype[200];
+ /* avoid cleanup in finis(), DaemonPid will be set below */
+ DaemonPid = 0;
if (!run_in_foreground && !tTd(99, 100))
{
/* put us in background */
@@ -2874,6 +2878,7 @@ finis(drop, cleanup, exitstat)
volatile int exitstat;
{
char pidpath[MAXPATHLEN];
+ pid_t pid;
/* Still want to process new timeouts added below */
sm_clear_events();
@@ -2903,6 +2908,8 @@ finis(drop, cleanup, exitstat)
dropenvelope(CurEnv, true, false);
sm_rpool_free(CurEnv->e_rpool);
CurEnv->e_rpool = NULL;
+
+ /* this may have pointed to the rpool */
CurEnv->e_to = NULL;
}
else
@@ -2943,14 +2950,15 @@ finis(drop, cleanup, exitstat)
/* XXX clean up queues and related data structures */
cleanup_queues();
+ pid = getpid();
#if SM_CONF_SHM
- cleanup_shm(DaemonPid == getpid());
+ cleanup_shm(DaemonPid == pid);
#endif /* SM_CONF_SHM */
/* close locked pid file */
close_sendmail_pid();
- if (DaemonPid == getpid() || PidFilePid == getpid())
+ if (DaemonPid == pid || PidFilePid == pid)
{
/* blow away the pid file */
expand(PidFile, pidpath, sizeof pidpath, CurEnv);
@@ -3276,13 +3284,18 @@ disconnect(droplev, e)
{
fd = open(SM_PATH_DEVNULL, O_WRONLY, 0666);
if (fd == -1)
+ {
sm_syslog(LOG_ERR, e->e_id,
"disconnect: open(\"%s\") failed: %s",
SM_PATH_DEVNULL, sm_errstring(errno));
+ }
(void) sm_io_flush(smioout, SM_TIME_DEFAULT);
- (void) dup2(fd, STDOUT_FILENO);
- (void) dup2(fd, STDERR_FILENO);
- (void) close(fd);
+ if (fd >= 0)
+ {
+ (void) dup2(fd, STDOUT_FILENO);
+ (void) dup2(fd, STDERR_FILENO);
+ (void) close(fd);
+ }
}
/* drop our controlling TTY completely if possible */
diff --git a/gnu/usr.sbin/sendmail/sendmail/map.c b/gnu/usr.sbin/sendmail/sendmail/map.c
index d4dcfb214af..1067e5751b6 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.671 2005/10/25 17:55:50 ca Exp $")
+SM_RCSID("@(#)$Sendmail: map.c,v 8.672 2006/04/18 01:26:41 ca Exp $")
#if LDAPMAP
# include <sm/ldap.h>
@@ -5992,6 +5992,10 @@ user_map_lookup(map, key, av, statp)
case 7:
rwval = user.mbdb_shell;
break;
+ default:
+ syserr("user_map %s: bogus field %d",
+ map->map_mname, map->map_valcolno);
+ return NULL;
}
return map_rewrite(map, rwval, strlen(rwval), av);
}
diff --git a/gnu/usr.sbin/sendmail/sendmail/mci.c b/gnu/usr.sbin/sendmail/sendmail/mci.c
index 6409a49e6d2..6d77c9c4132 100644
--- a/gnu/usr.sbin/sendmail/sendmail/mci.c
+++ b/gnu/usr.sbin/sendmail/sendmail/mci.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: mci.c,v 8.216 2005/07/12 22:27:44 ca Exp $")
+SM_RCSID("@(#)$Sendmail: mci.c,v 8.217 2006/04/18 01:27:36 ca Exp $")
#if NETINET || NETINET6
# include <arpa/inet.h>
@@ -922,9 +922,17 @@ mci_read_persistent(fp, mci)
char buf[MAXLINE];
if (fp == NULL)
+ {
syserr("mci_read_persistent: NULL fp");
+ /* NOTREACHED */
+ return -1;
+ }
if (mci == NULL)
+ {
syserr("mci_read_persistent: NULL mci");
+ /* NOTREACHED */
+ return -1;
+ }
if (tTd(56, 93))
{
sm_dprintf("mci_read_persistent: fp=%lx, mci=",
diff --git a/gnu/usr.sbin/sendmail/sendmail/mime.c b/gnu/usr.sbin/sendmail/sendmail/mime.c
index b16dc888ecf..940a7b398c1 100644
--- a/gnu/usr.sbin/sendmail/sendmail/mime.c
+++ b/gnu/usr.sbin/sendmail/sendmail/mime.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2003, 2006 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1994, 1996-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1994
@@ -14,7 +14,7 @@
#include <sendmail.h>
#include <string.h>
-SM_RCSID("@(#)$Sendmail: mime.c,v 8.139 2006/03/01 18:07:45 ca Exp $")
+SM_RCSID("@(#)$Sendmail: mime.c,v 8.142.2.1 2006/05/23 01:32:08 ca Exp $")
/*
** MIME support.
@@ -227,7 +227,7 @@ mime8to7(mci, header, e, boundaries, flags, level)
if (subtype == NULL)
subtype = "-none-";
- /* don't propogate some flags more than one level into the message */
+ /* don't propagate some flags more than one level into the message */
flags &= ~M87F_DIGEST;
/*
diff --git a/gnu/usr.sbin/sendmail/sendmail/parseaddr.c b/gnu/usr.sbin/sendmail/sendmail/parseaddr.c
index d708b45bfed..5e93dbdafee 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.383 2006/02/01 19:46:11 ca Exp $")
+SM_RCSID("@(#)$Sendmail: parseaddr.c,v 8.384 2006/04/18 01:28:47 ca Exp $")
static void allocaddr __P((ADDRESS *, int, char *, ENVELOPE *));
static int callsubr __P((char**, int, ENVELOPE *));
@@ -703,7 +703,7 @@ prescan(addr, delim, pvpbuf, pvpbsize, delimptr, toktab, ignore)
if (delimptr != NULL)
{
if (p > addr)
- p--;
+ --p;
*delimptr = p;
}
CurEnv->e_to = saveto;
@@ -1442,7 +1442,11 @@ rewrite(pvp, ruleset, reclevel, e, maxatom)
endtoken = LOOKUPEND;
mapname = *++rvp;
if (mapname == NULL)
+ {
syserr("554 5.3.0 rewrite: missing mapname");
+ /* NOTREACHED */
+ SM_ASSERT(0);
+ }
}
map = stab(mapname, ST_MAP, ST_FIND);
if (map == NULL)
@@ -1452,8 +1456,12 @@ rewrite(pvp, ruleset, reclevel, e, maxatom)
/* extract the match part */
key_rvp = ++rvp;
if (key_rvp == NULL)
+ {
syserr("554 5.3.0 rewrite: missing key for map %s",
mapname);
+ /* NOTREACHED */
+ SM_ASSERT(0);
+ }
default_rvp = NULL;
arg_rvp = argvect;
xpvp = NULL;
@@ -1522,7 +1530,8 @@ rewrite(pvp, ruleset, reclevel, e, maxatom)
if (replac == NULL && default_rvp != NULL)
{
/* create the default */
- cataddr(default_rvp, NULL, cbuf, sizeof cbuf, '\0');
+ cataddr(default_rvp, NULL, cbuf, sizeof cbuf,
+ '\0');
replac = cbuf;
}
@@ -3175,8 +3184,7 @@ rscap(rwset, p1, p2, e, pvp, pvpbuf, size)
sm_dprintf("rscap(%s, %s, %s)\n", rwset, p1,
p2 == NULL ? "(NULL)" : p2);
- if (pvp != NULL)
- *pvp = NULL;
+ SM_REQUIRE(pvp != NULL);
rsno = strtorwset(rwset, NULL, ST_FIND);
if (rsno < 0)
return EX_UNAVAILABLE;
diff --git a/gnu/usr.sbin/sendmail/sendmail/queue.c b/gnu/usr.sbin/sendmail/sendmail/queue.c
index 2ce21225807..7c38b5ab6f6 100644
--- a/gnu/usr.sbin/sendmail/sendmail/queue.c
+++ b/gnu/usr.sbin/sendmail/sendmail/queue.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2005 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2006 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.951 2006/03/02 19:13:38 ca Exp $")
+SM_RCSID("@(#)$Sendmail: queue.c,v 8.954.2.5 2006/07/31 21:44:18 ca Exp $")
#include <dirent.h>
@@ -2646,6 +2646,7 @@ gatherq(qgrp, qdir, doall, full, more)
/* avoid work if possible */
if ((QueueSortOrder == QSO_BYFILENAME ||
QueueSortOrder == QSO_BYMODTIME ||
+ QueueSortOrder == QSO_NONE ||
QueueSortOrder == QSO_RANDOM) &&
QueueLimitQuarantine == NULL &&
QueueLimitSender == NULL &&
@@ -3902,6 +3903,7 @@ readqf(e, openonly)
** Read and process the file.
*/
+ bp = NULL;
(void) sm_strlcpy(qf, queuename(e, ANYQFL_LETTER), sizeof qf);
qfp = sm_io_open(SmFtStdio, SM_TIME_DEFAULT, qf, SM_IO_RDWR_B, NULL);
if (qfp == NULL)
@@ -4033,6 +4035,7 @@ readqf(e, openonly)
}
if (delim != '\0')
*bp = delim;
+ bp = NULL;
}
if (!bogus)
bogus = bitset(qsafe, st.st_mode);
@@ -4468,7 +4471,10 @@ readqf(e, openonly)
}
if (bp != buf)
+ {
sm_free(bp); /* XXX */
+ bp = NULL;
+ }
}
/*
@@ -4541,6 +4547,11 @@ readqf(e, openonly)
** queueup() with bogus data.
*/
+ if (bp != NULL && bp != buf)
+ {
+ sm_free(bp); /* XXX */
+ bp = NULL;
+ }
if (qfp != NULL)
(void) sm_io_close(qfp, SM_TIME_DEFAULT);
e->e_lockfp = NULL;
@@ -5180,7 +5191,7 @@ queuename(e, type)
else
{
if (e->e_qgrp == NOQGRP || e->e_qdir == NOQDIR)
- setnewqueue(e);
+ (void) setnewqueue(e);
if (type == DATAFL_LETTER)
{
qd = e->e_dfqdir;
@@ -5194,7 +5205,7 @@ queuename(e, type)
}
/* xf files always have a valid qd and qg picked above */
- if (e->e_qdir == NOQDIR && type != XSCRPT_LETTER)
+ if ((qd == NOQDIR || qg == NOQGRP) && type != XSCRPT_LETTER)
(void) sm_strlcpyn(buf, sizeof buf, 2, pref, e->e_id);
else
{
@@ -6302,7 +6313,19 @@ filesys_find(name, path, add)
for (i = 0; i < NumFileSys; ++i)
{
if (FILE_SYS_DEV(i) == st.st_dev)
+ {
+ /*
+ ** Make sure the file system (FS) name is set:
+ ** even though the source code indicates that
+ ** FILE_SYS_DEV() is only set below, it could be
+ ** set via shared memory, hence we need to perform
+ ** this check/assignment here.
+ */
+
+ if (NULL == FILE_SYS_NAME(i))
+ FILE_SYS_NAME(i) = name;
return i;
+ }
}
if (i >= MAXFILESYS)
{
@@ -6396,7 +6419,6 @@ filesys_update()
static time_t nextupdate = 0;
#if SM_CONF_SHM
- /* only the daemon updates this structure */
if (ShmId != SM_SHM_NO_ID && DaemonPid != CurrentPid)
return;
#endif /* SM_CONF_SHM */
diff --git a/gnu/usr.sbin/sendmail/sendmail/savemail.c b/gnu/usr.sbin/sendmail/sendmail/savemail.c
index 0f85543d69b..3b80d57f1fe 100644
--- a/gnu/usr.sbin/sendmail/sendmail/savemail.c
+++ b/gnu/usr.sbin/sendmail/sendmail/savemail.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2003, 2006 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: savemail.c,v 8.306 2006/02/25 02:16:53 ca Exp $")
+SM_RCSID("@(#)$Sendmail: savemail.c,v 8.308 2006/04/18 01:31:33 ca Exp $")
static bool errbody __P((MCI *, ENVELOPE *, char *));
static bool pruneroute __P((char *));
@@ -733,7 +733,7 @@ returntosender(msg, returnq, flags, e)
** separator -- any possible MIME separator (unused).
**
** Returns:
-** success
+** true iff body was written successfully
**
** Side Effects:
** Outputs the body of an error message.
@@ -1264,8 +1264,8 @@ errbody(mci, e, separator)
/* Diagnostic-Code: -- actual result from other end */
if (q->q_rstatus != NULL)
{
- p = q->q_mailer->m_diagtype;
- if (p == NULL)
+ if (q->q_mailer == NULL ||
+ (p = q->q_mailer->m_diagtype) == NULL)
p = "smtp";
(void) sm_snprintf(buf, sizeof buf,
"Diagnostic-Code: %s; %.800s",
diff --git a/gnu/usr.sbin/sendmail/sendmail/sendmail.h b/gnu/usr.sbin/sendmail/sendmail/sendmail.h
index a0ddc182f5f..b55ccdc528e 100644
--- a/gnu/usr.sbin/sendmail/sendmail/sendmail.h
+++ b/gnu/usr.sbin/sendmail/sendmail/sendmail.h
@@ -52,7 +52,7 @@
#ifdef _DEFINE
# ifndef lint
-SM_UNUSED(static char SmailId[]) = "@(#)$Sendmail: sendmail.h,v 8.1006 2006/02/27 17:49:09 ca Exp $";
+SM_UNUSED(static char SmailId[]) = "@(#)$Sendmail: sendmail.h,v 8.1008.2.1 2006/05/23 01:32:07 ca Exp $";
# endif /* ! lint */
#endif /* _DEFINE */
@@ -2225,7 +2225,7 @@ EXTERN int MaxNOOPCommands; /* max "noise" commands before slowdown */
EXTERN int MaxRcptPerMsg; /* max recipients per SMTP message */
EXTERN int MaxRuleRecursion; /* maximum depth of ruleset recursion */
#if _FFR_MSG_ACCEPT
-EXTERN char *MessageAccept;
+EXTERN char *MessageAccept; /* "Message accepted for delivery" reply text */
#endif /* _FFR_MSG_ACCEPT */
EXTERN int MimeMode; /* MIME processing mode */
diff --git a/gnu/usr.sbin/sendmail/sendmail/sfsasl.c b/gnu/usr.sbin/sendmail/sendmail/sfsasl.c
index 6e0f30b81fd..5db1a5eef26 100644
--- a/gnu/usr.sbin/sendmail/sendmail/sfsasl.c
+++ b/gnu/usr.sbin/sendmail/sendmail/sfsasl.c
@@ -9,9 +9,10 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: sfsasl.c,v 8.113 2006/03/02 19:18:27 ca Exp $")
+SM_RCSID("@(#)$Sendmail: sfsasl.c,v 8.115 2006/04/18 21:34:07 ca Exp $")
#include <stdlib.h>
#include <sendmail.h>
+#include <sm/time.h>
#include <errno.h>
/* allow to disable error handling code just in case... */
@@ -326,6 +327,7 @@ sasl_write(fp, buf, size)
{
while (outlen > 0)
{
+ errno = 0;
/* XXX result == 0? */
ret = sm_io_write(so->fp, SM_TIME_DEFAULT,
&outbuf[total], outlen);
@@ -347,8 +349,9 @@ sasl_write(fp, buf, size)
**
** Parameters:
** fin -- the sm_io file encrypted data to be read from
-** fout -- the sm_io file encrypted data to be writen to
+** fout -- the sm_io file encrypted data to be written to
** conn -- the sasl connection pointer
+** tmo -- timeout
**
** Returns:
** -1 on error
@@ -360,15 +363,16 @@ sasl_write(fp, buf, size)
*/
int
-sfdcsasl(fin, fout, conn)
+sfdcsasl(fin, fout, conn, tmo)
SM_FILE_T **fin;
SM_FILE_T **fout;
sasl_conn_t *conn;
+ int tmo;
{
SM_FILE_T *newin, *newout;
SM_FILE_T SM_IO_SET_TYPE(sasl_vector, "sasl", sasl_open, sasl_close,
sasl_read, sasl_write, NULL, sasl_getinfo, NULL,
- SM_TIME_FOREVER);
+ SM_TIME_DEFAULT);
struct sasl_info info;
if (conn == NULL)
@@ -379,7 +383,7 @@ sfdcsasl(fin, fout, conn)
SM_IO_INIT_TYPE(sasl_vector, "sasl", sasl_open, sasl_close,
sasl_read, sasl_write, NULL, sasl_getinfo, NULL,
- SM_TIME_FOREVER);
+ SM_TIME_DEFAULT);
info.fp = *fin;
info.conn = conn;
newin = sm_io_open(&sasl_vector, SM_TIME_DEFAULT, &info,
@@ -400,6 +404,9 @@ sfdcsasl(fin, fout, conn)
}
sm_io_automode(newin, newout);
+ sm_io_setinfo(*fin, SM_IO_WHAT_TIMEOUT, &tmo);
+ sm_io_setinfo(*fout, SM_IO_WHAT_TIMEOUT, &tmo);
+
*fin = newin;
*fout = newout;
return 0;
diff --git a/gnu/usr.sbin/sendmail/sendmail/sfsasl.h b/gnu/usr.sbin/sendmail/sendmail/sfsasl.h
index 2a45c387d35..f9c5562218f 100644
--- a/gnu/usr.sbin/sendmail/sendmail/sfsasl.h
+++ b/gnu/usr.sbin/sendmail/sendmail/sfsasl.h
@@ -6,15 +6,15 @@
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
- * $Sendmail: sfsasl.h,v 8.19 2006/02/27 19:53:37 ca Exp $"
+ * $Sendmail: sfsasl.h,v 8.20 2006/03/27 21:31:00 ca Exp $"
*/
#ifndef SFSASL_H
# define SFSASL_H
-#if SASL
-extern int sfdcsasl __P((SM_FILE_T **, SM_FILE_T **, sasl_conn_t *));
-#endif /* SASL */
+# if SASL
+extern int sfdcsasl __P((SM_FILE_T **, SM_FILE_T **, sasl_conn_t *, int));
+# endif /* SASL */
# if STARTTLS
extern int tls_retry __P((SSL *, int, int, time_t, int, int,
diff --git a/gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c b/gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c
index d6a5266d525..3d94ebdb875 100644
--- a/gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c
+++ b/gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c
@@ -17,7 +17,7 @@
# include <libmilter/mfdef.h>
#endif /* MILTER */
-SM_RCSID("@(#)$Sendmail: srvrsmtp.c,v 8.922 2006/02/28 00:42:13 ca Exp $")
+SM_RCSID("@(#)$Sendmail: srvrsmtp.c,v 8.924.2.5 2006/07/07 16:29:39 ca Exp $")
#include <sm/time.h>
#include <sm/fdset.h>
@@ -70,9 +70,10 @@ static unsigned int srvfeatures __P((ENVELOPE *, char *, unsigned int));
#define STOP_ATTACK ((time_t) -1)
static time_t checksmtpattack __P((volatile unsigned int *, unsigned int,
bool, char *, ENVELOPE *));
-static void mail_esmtp_args __P((char *, char *, ENVELOPE *));
+static void mail_esmtp_args __P((char *, char *, ENVELOPE *, unsigned int));
static void printvrfyaddr __P((ADDRESS *, bool, bool));
-static void rcpt_esmtp_args __P((ADDRESS *, char *, char *, ENVELOPE *));
+static void rcpt_esmtp_args __P((ADDRESS *, char *, char *, ENVELOPE *,
+ unsigned int));
static char *skipword __P((char *volatile, char *));
static void setup_smtpd_io __P((void));
@@ -588,8 +589,8 @@ smtp(nullserver, d_flags, e)
: (SRV_OFFER_EXPN
| (bitset(PRIV_NOVERB, PrivacyFlags)
? SRV_NONE : SRV_OFFER_VERB)))
- | (bitset(PRIV_NORECEIPTS, PrivacyFlags) ? SRV_NONE
- : SRV_OFFER_DSN)
+ | ((bitset(PRIV_NORECEIPTS, PrivacyFlags) || !SendMIMEErrors)
+ ? SRV_NONE : SRV_OFFER_DSN)
#if SASL
| (bitnset(D_NOAUTH, d_flags) ? SRV_NONE : SRV_OFFER_AUTH)
| (bitset(SASL_SEC_NOPLAINTEXT, SASLOpts) ? SRV_REQ_SEC
@@ -850,8 +851,9 @@ smtp(nullserver, d_flags, e)
char state;
char *response;
- response = milter_connect(peerhostname, RealHostAddr,
- e, &state);
+ q = macvalue(macid("{client_name}"), e);
+ SM_ASSERT(q != NULL);
+ response = milter_connect(q, RealHostAddr, e, &state);
switch (state)
{
case SMFIR_REPLYCODE: /* REPLYCODE shouldn't happen */
@@ -1285,14 +1287,17 @@ smtp(nullserver, d_flags, e)
if (ssf != NULL && *ssf > 0)
{
+ int tmo;
+
/*
** Convert I/O layer to use SASL.
** If the call fails, the connection
** is aborted.
*/
+ tmo = TimeOuts.to_datablock * 1000;
if (sfdcsasl(&InChannel, &OutChannel,
- conn) == 0)
+ conn, tmo) == 0)
{
/* restart dialogue */
n_helo = 0;
@@ -2017,7 +2022,7 @@ smtp(nullserver, d_flags, e)
case SMFIR_SHUTDOWN:
if (MilterLogLevel > 3)
sm_syslog(LOG_INFO, e->e_id,
- "Milter: Milter: helo=%s, reject=421 4.7.0 %s closing connection",
+ "Milter: helo=%s, reject=421 4.7.0 %s closing connection",
p, MyHostName);
tempfail = true;
smtp.sm_milterize = false;
@@ -2296,7 +2301,7 @@ smtp(nullserver, d_flags, e)
sm_dprintf("MAIL: got arg %s=\"%s\"\n", kp,
vp == NULL ? "<null>" : vp);
- mail_esmtp_args(kp, vp, e);
+ mail_esmtp_args(kp, vp, e, features);
if (equal != NULL)
*equal = '=';
args[argno++] = kp;
@@ -2566,7 +2571,7 @@ smtp(nullserver, d_flags, e)
sm_dprintf("RCPT: got arg %s=\"%s\"\n", kp,
vp == NULL ? "<null>" : vp);
- rcpt_esmtp_args(a, kp, vp, e);
+ rcpt_esmtp_args(a, kp, vp, e, features);
if (equal != NULL)
*equal = '=';
args[argno++] = kp;
@@ -3848,6 +3853,7 @@ skipword(p, w)
return p;
}
+
/*
** MAIL_ESMTP_ARGS -- process ESMTP arguments from MAIL line
**
@@ -3855,16 +3861,18 @@ skipword(p, w)
** kp -- the parameter key.
** vp -- the value of that parameter.
** e -- the envelope.
+** features -- current server features
**
** Returns:
** none.
*/
static void
-mail_esmtp_args(kp, vp, e)
+mail_esmtp_args(kp, vp, e, features)
char *kp;
char *vp;
ENVELOPE *e;
+ unsigned int features;
{
if (sm_strcasecmp(kp, "size") == 0)
{
@@ -3911,7 +3919,7 @@ mail_esmtp_args(kp, vp, e)
}
else if (sm_strcasecmp(kp, "envid") == 0)
{
- if (bitset(PRIV_NORECEIPTS, PrivacyFlags))
+ if (!bitset(SRV_OFFER_DSN, features))
{
usrerr("504 5.7.0 Sorry, ENVID not supported, we do not allow DSN");
/* NOTREACHED */
@@ -3937,7 +3945,7 @@ mail_esmtp_args(kp, vp, e)
}
else if (sm_strcasecmp(kp, "ret") == 0)
{
- if (bitset(PRIV_NORECEIPTS, PrivacyFlags))
+ if (!bitset(SRV_OFFER_DSN, features))
{
usrerr("504 5.7.0 Sorry, RET not supported, we do not allow DSN");
/* NOTREACHED */
@@ -4130,23 +4138,25 @@ mail_esmtp_args(kp, vp, e)
** kp -- the parameter key.
** vp -- the value of that parameter.
** e -- the envelope.
+** features -- current server features
**
** Returns:
** none.
*/
static void
-rcpt_esmtp_args(a, kp, vp, e)
+rcpt_esmtp_args(a, kp, vp, e, features)
ADDRESS *a;
char *kp;
char *vp;
ENVELOPE *e;
+ unsigned int features;
{
if (sm_strcasecmp(kp, "notify") == 0)
{
char *p;
- if (bitset(PRIV_NORECEIPTS, PrivacyFlags))
+ if (!bitset(SRV_OFFER_DSN, features))
{
usrerr("504 5.7.0 Sorry, NOTIFY not supported, we do not allow DSN");
/* NOTREACHED */
@@ -4187,7 +4197,7 @@ rcpt_esmtp_args(a, kp, vp, e)
}
else if (sm_strcasecmp(kp, "orcpt") == 0)
{
- if (bitset(PRIV_NORECEIPTS, PrivacyFlags))
+ if (!bitset(SRV_OFFER_DSN, features))
{
usrerr("504 5.7.0 Sorry, ORCPT not supported, we do not allow DSN");
/* NOTREACHED */
diff --git a/gnu/usr.sbin/sendmail/sendmail/tls.c b/gnu/usr.sbin/sendmail/sendmail/tls.c
index 1395e247caa..f772bb09630 100644
--- a/gnu/usr.sbin/sendmail/sendmail/tls.c
+++ b/gnu/usr.sbin/sendmail/sendmail/tls.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000-2005 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 2000-2006 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("@(#)$Sendmail: tls.c,v 8.102 2006/03/02 19:18:27 ca Exp $")
+SM_RCSID("@(#)$Sendmail: tls.c,v 8.105 2006/05/11 22:59:31 ca Exp $")
#if STARTTLS
# include <openssl/err.h>
@@ -506,6 +506,13 @@ tls_safe_f(var, sff, srv)
static char server_session_id_context[] = "sendmail8";
+/* 0.9.8a and b have a problem with SSL_OP_TLS_BLOCK_PADDING_BUG */
+#if (OPENSSL_VERSION_NUMBER >= 0x0090800fL)
+# define SM_SSL_OP_TLS_BLOCK_PADDING_BUG 1
+#else
+# define SM_SSL_OP_TLS_BLOCK_PADDING_BUG 0
+#endif
+
bool
inittls(ctx, req, srv, certfile, keyfile, cacertpath, cacertfile, dhparam)
SSL_CTX **ctx;
@@ -518,7 +525,7 @@ inittls(ctx, req, srv, certfile, keyfile, cacertpath, cacertfile, dhparam)
# endif /* !NO_DH */
int r;
bool ok;
- long sff, status;
+ long sff, status, options;
char *who;
# if _FFR_TLS_1
char *cf2, *kf2;
@@ -531,11 +538,19 @@ inittls(ctx, req, srv, certfile, keyfile, cacertpath, cacertfile, dhparam)
X509_CRL *crl;
X509_STORE *store;
# endif /* OPENSSL_VERSION_NUMBER > 0x00907000L */
+#if SM_SSL_OP_TLS_BLOCK_PADDING_BUG
+ long rt_version;
+ STACK_OF(SSL_COMP) *comp_methods;
+#endif
status = TLS_S_NONE;
who = srv ? "server" : "client";
if (ctx == NULL)
+ {
syserr("STARTTLS=%s, inittls: ctx == NULL", who);
+ /* NOTREACHED */
+ SM_ASSERT(ctx != NULL);
+ }
/* already initialized? (we could re-init...) */
if (*ctx != NULL)
@@ -895,7 +910,29 @@ inittls(ctx, req, srv, certfile, keyfile, cacertpath, cacertfile, dhparam)
# endif /* _FFR_TLS_1 */
/* SSL_CTX_set_quiet_shutdown(*ctx, 1); violation of standard? */
- SSL_CTX_set_options(*ctx, SSL_OP_ALL); /* XXX bug compatibility? */
+
+ options = SSL_OP_ALL; /* bug compatibility? */
+#if SM_SSL_OP_TLS_BLOCK_PADDING_BUG
+
+ /*
+ ** In OpenSSL 0.9.8[ab], enabling zlib compression breaks the
+ ** padding bug work-around, leading to false positives and
+ ** failed connections. We may not interoperate with systems
+ ** with the bug, but this is better than breaking on all 0.9.8[ab]
+ ** systems that have zlib support enabled.
+ ** Note: this checks the runtime version of the library, not
+ ** just the compile time version.
+ */
+
+ rt_version = SSLeay();
+ if (rt_version >= 0x00908000L && rt_version <= 0x0090802fL)
+ {
+ comp_methods = SSL_COMP_get_compression_methods();
+ if (comp_methods != NULL && sk_SSL_COMP_num(comp_methods) > 0)
+ options &= ~SSL_OP_TLS_BLOCK_PADDING_BUG;
+ }
+#endif
+ SSL_CTX_set_options(*ctx, options);
# if !NO_DH
/* Diffie-Hellman initialization */
diff --git a/gnu/usr.sbin/sendmail/sendmail/util.c b/gnu/usr.sbin/sendmail/sendmail/util.c
index 17d9216616b..36e8f3fe51b 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.392 2006/03/09 19:49:35 ca Exp $")
+SM_RCSID("@(#)$Sendmail: util.c,v 8.394 2006/05/03 23:55:29 ca Exp $")
#include <sysexits.h>
#include <sm/xtrap.h>
@@ -2044,7 +2044,15 @@ prog_open(argv, pfd, e)
/* this process has no right to the queue file */
if (e->e_lockfp != NULL)
- (void) close(sm_io_getinfo(e->e_lockfp, SM_IO_WHAT_FD, NULL));
+ {
+ int fd;
+
+ fd = sm_io_getinfo(e->e_lockfp, SM_IO_WHAT_FD, NULL);
+ if (fd >= 0)
+ (void) close(fd);
+ else
+ syserr("%s: lockfp does not have a fd", argv[0]);
+ }
/* chroot to the program mailer directory, if defined */
if (ProgMailer != NULL && ProgMailer->m_rootdir != NULL)
@@ -2737,7 +2745,7 @@ proc_list_probe()
CurChildren = 0;
if (chldwasblocked == 0)
(void) sm_releasesignal(SIGCHLD);
- if (LogLevel > 10 && children != CurChildren)
+ if (LogLevel > 10 && children != CurChildren && CurrentPid == DaemonPid)
{
sm_syslog(LOG_ERR, NOQID,
"proc_list_probe: found %d children, expected %d",
diff --git a/gnu/usr.sbin/sendmail/sendmail/version.c b/gnu/usr.sbin/sendmail/sendmail/version.c
index f15a192ff66..e4b42dd859e 100644
--- a/gnu/usr.sbin/sendmail/sendmail/version.c
+++ b/gnu/usr.sbin/sendmail/sendmail/version.c
@@ -13,6 +13,6 @@
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: version.c,v 8.160 2006/03/08 19:21:21 ca Exp $")
+SM_RCSID("@(#)$Sendmail: version.c,v 8.163.2.8 2006/07/26 17:24:02 ca Exp $")
-char Version[] = "8.13.6";
+char Version[] = "8.13.8";