summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2001-02-28 00:19:57 +0000
committergshapiro <gshapiro@FreeBSD.org>2001-02-28 00:19:57 +0000
commite4882e48c06ee9963c8275992cd9767a29e01c05 (patch)
tree931d99d3910ebafc6a747029ff208f01292f5d8b /contrib/sendmail
parent2143eb84286d79cdfaa711372954774a827fee31 (diff)
parent8d82727087db5182be90a20f20175cc720c5d1e5 (diff)
downloadFreeBSD-src-e4882e48c06ee9963c8275992cd9767a29e01c05.zip
FreeBSD-src-e4882e48c06ee9963c8275992cd9767a29e01c05.tar.gz
This commit was generated by cvs2svn to compensate for changes in r73188,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/sendmail')
-rw-r--r--contrib/sendmail/LICENSE4
-rw-r--r--contrib/sendmail/RELEASE_NOTES81
-rw-r--r--contrib/sendmail/cf/README42
-rw-r--r--contrib/sendmail/cf/cf/knecht.mc16
-rw-r--r--contrib/sendmail/cf/m4/version.m46
-rwxr-xr-xcontrib/sendmail/contrib/buildvirtuser29
-rw-r--r--contrib/sendmail/doc/op/Makefile26
-rw-r--r--contrib/sendmail/doc/op/op.me52
-rw-r--r--contrib/sendmail/libmilter/Makefile.m44
-rw-r--r--contrib/sendmail/libmilter/README7
-rw-r--r--contrib/sendmail/libmilter/engine.c6
-rw-r--r--contrib/sendmail/libmilter/listener.c92
-rw-r--r--contrib/sendmail/libmilter/sm_gethost.c8
-rw-r--r--contrib/sendmail/libsmdb/smdb2.c9
-rw-r--r--contrib/sendmail/src/README38
-rw-r--r--contrib/sendmail/src/bf.h5
-rw-r--r--contrib/sendmail/src/bf_portable.c45
-rw-r--r--contrib/sendmail/src/bf_torek.c49
-rw-r--r--contrib/sendmail/src/collect.c37
-rw-r--r--contrib/sendmail/src/control.c4
-rw-r--r--contrib/sendmail/src/daemon.c82
-rw-r--r--contrib/sendmail/src/deliver.c75
-rw-r--r--contrib/sendmail/src/domain.c40
-rw-r--r--contrib/sendmail/src/macro.c6
-rw-r--r--contrib/sendmail/src/main.c26
-rw-r--r--contrib/sendmail/src/map.c60
-rw-r--r--contrib/sendmail/src/milter.c34
-rw-r--r--contrib/sendmail/src/parseaddr.c10
-rw-r--r--contrib/sendmail/src/queue.c11
-rw-r--r--contrib/sendmail/src/readcf.c19
-rw-r--r--contrib/sendmail/src/recipient.c4
-rw-r--r--contrib/sendmail/src/sendmail.h13
-rw-r--r--contrib/sendmail/src/srvrsmtp.c8
-rw-r--r--contrib/sendmail/src/stats.c4
-rw-r--r--contrib/sendmail/src/udb.c10
-rw-r--r--contrib/sendmail/src/usersmtp.c36
-rw-r--r--contrib/sendmail/src/util.c17
-rw-r--r--contrib/sendmail/src/version.c6
-rw-r--r--contrib/sendmail/vacation/vacation.c4
39 files changed, 772 insertions, 253 deletions
diff --git a/contrib/sendmail/LICENSE b/contrib/sendmail/LICENSE
index f707865..0101f48 100644
--- a/contrib/sendmail/LICENSE
+++ b/contrib/sendmail/LICENSE
@@ -33,7 +33,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-2000 Sendmail, Inc. All rights reserved."
+ "Copyright (c) 1998-2001 Sendmail, Inc. All rights reserved."
4. Neither the name of Sendmail, Inc. nor the University of California nor
the names of their contributors may be used to endorse or promote
@@ -76,4 +76,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: 8.9 $, Last updated $Date: 2000/03/03 19:24:11 $
+$Revision: 8.9.4.1 $, Last updated $Date: 2001/02/14 04:07:19 $
diff --git a/contrib/sendmail/RELEASE_NOTES b/contrib/sendmail/RELEASE_NOTES
index 0875150..77f0e08 100644
--- a/contrib/sendmail/RELEASE_NOTES
+++ b/contrib/sendmail/RELEASE_NOTES
@@ -1,11 +1,86 @@
SENDMAIL RELEASE NOTES
- $Id: RELEASE_NOTES,v 8.561.2.5.2.181 2000/12/28 23:56:46 gshapiro Exp $
+ $Id: RELEASE_NOTES,v 8.561.2.5.2.208 2001/02/26 21:24:54 gshapiro 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.11.3/8.11.3 2001/02/27
+ Prevent a segmentation fault when a bogus value was used in the
+ LDAPDefaultSpec option's -r, -s, or -M flags and if a bogus
+ option was used. Problem noted by Allan E Johannesen of
+ Worcester Polytechnic Institute.
+ Prevent "token too long" message by shortening {currHeader} which
+ could be too long if the last copied character was a quote.
+ Problem detected by Jan Krueger of digitalanswers
+ communications consulting gmbh.
+ Additional IPv6 check for unspecified addresses. Patch from
+ Jun-ichiro itojun Hagino of the KAME Project.
+ Do not ignore the ClientPortOptions setting if DaemonPortOptions
+ Modifier=b (bind to same interface) is set and the
+ connection came in from the command line.
+ Do not bind to the loopback address if DaemonPortOptions
+ Modifier=b (bind to same interface) is set. Patch from
+ John Beck of Sun Microsystems.
+ Properly deal with open failures on non-optional maps used in
+ check_* rulesets by returning a temporary failure.
+ Buffered file I/O files were not being properly fsync'ed to disk
+ when they were committed.
+ Properly encode '=' for the AUTH= parameter of the MAIL command.
+ Problem noted by Hadmut Danisch.
+ Under certain circumstances the macro {server_name} could be set
+ to the wrong hostname (of a previous connection), which may
+ cause some rulesets to return wrong results. This would
+ usually cause mail to be queued up and delivered later on.
+ Ignore F=z (LMTP) mailer flag if $u is given in the mailer A=
+ equate. Problem noted by Motonori Nakamura of Kyoto
+ University.
+ Work around broken accept() implementations which only partially
+ fill in the peer address if the socket is closed before
+ accept() completes.
+ Return an SMTP "421" temporary failure if the data file can't be
+ opened where the "354" reply would normally be given.
+ Prevent a CPU loop in trying to expand a macro which doesn't exist
+ in a queue run. Problem noted by Gordon Lack of Glaxo
+ Wellcome.
+ If delivering via a program and that program exits with EX_TEMPFAIL,
+ note that fact for the mailq display instead of just showing
+ "Deferred". Problem noted by Motonori Nakamura of Kyoto
+ University.
+ If doing canonification via /etc/hosts, try both the fully
+ qualified hostname as well as the first portion of the
+ hostname. Problem noted by David Bremner of the
+ University of New Brunswick.
+ Portability:
+ Fix a compilation problem for mail.local and rmail if SFIO
+ is in use. Problem noted by Auteria Wally
+ Winzer Jr. of Champion Nutrition.
+ IPv6 changes for platforms using KAME. Patch from
+ Jun-ichiro itojun Hagino of the KAME Project.
+ OpenBSD 2.7 and higher has srandomdev(3). OpenBSD 2.8 and
+ higher has BSDI-style login classes. Patch from
+ Todd C. Miller of Courtesan Consulting.
+ Unixware 7.1.1 doesn't allow h_errno to be set directly if
+ sendmail is being compiled with -kthread. Problem
+ noted by Orion Poplawski of CQG, Inc.
+ CONTRIB: buildvirtuser: Substitute current domain for $DOMAIN and
+ current left hand side for $LHS in virtuser files.
+ DEVTOOLS: Do not pass make targets to recursive Build invocations.
+ Problem noted by Jeff Bronson of J.D. Bronson, Inc.
+ MAIL.LOCAL: In LMTP mode, do not return errors regarding problems
+ storing the temporary message file until after the remote
+ side has sent the final DATA termination dot. Problem
+ noted by Allan E Johannesen of Worcester Polytechnic
+ Institute.
+ MAIL.LOCAL: If LMTP mode is set, give a temporary error if users
+ are also specified on the command line. Patch from
+ Motonori Nakamura of Kyoto University.
+ PRALIASES: Skip over AliasFile specifications which aren't based on
+ database files (i.e., only show dbm, hash, and btree).
+ Renamed Files:
+ devtools/OS/OSF1.V5.0 => devtools/OS/OSF1.V5.x
+
8.11.2/8.11.2 2000/12/29
Prevent a segmentation fault when trying to set a class in
address test mode due to a negative array index. Audit
@@ -89,7 +164,7 @@ summary of the changes in that release.
is used. Problem noted by Phil Homewood of Asia Online,
patch from Neil Rickert of Northern Illinois University.
CONFIG: Change the default DNS based blacklist server for
- FEATURE(`dnsbl') to blackholes.mail-abuse.org.
+ FEATURE(`dnsbl') to blackholes.mail-abuse.org.
CONFIG: Deal correctly with the 'C' flag in {daemon_flags}, i.e.,
implicitly assume canonical host names.
CONFIG: Deal with "::" in IPv6 addresses for access_db. Based on
@@ -107,7 +182,7 @@ summary of the changes in that release.
Roth of the University of Illinois at Urbana-Champaign.
DEVTOOLS: Change the internal devtools OS, REL, and ARCH m4
variables into bldOS, bldREL, and bldARCH to prevent
- namespace collisions. Problem noted by Motonori Nakamura
+ namespace collisions. Problem noted by Motonori Nakamura
of Kyoto University.
RMAIL: Undo the 8.11.1 change to use -G when calling sendmail. It
causes some changes in behavior and may break rmail for
diff --git a/contrib/sendmail/cf/README b/contrib/sendmail/cf/README
index c8ad901..1ac7907 100644
--- a/contrib/sendmail/cf/README
+++ b/contrib/sendmail/cf/README
@@ -54,7 +54,7 @@ Let's examine a typical .mc file:
divert(-1)
#
- # Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ # Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
# All rights reserved.
# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
@@ -254,12 +254,13 @@ HELP_FILE [/etc/mail/helpfile] The name of the file
QUEUE_DIR [/var/spool/mqueue] The directory containing
queue files. To use multiple queues, supply
a value ending with an asterisk. For
- example, /var/spool/mqueue/q* will use all of the
+ example, /var/spool/mqueue/qd* will use all of the
directories or symbolic links to directories
- beginning with 'q' in /var/spool/mqueue as queue
+ beginning with 'qd' in /var/spool/mqueue as queue
directories. The names 'qf', 'df', and 'xf' are
- used as specific subdirectories for the corresponding
- queue file types.
+ reserved as specific subdirectories for the
+ corresponding queue file types as explained in
+ doc/op/op.me.
STATUS_FILE [/etc/mail/statistics] The file containing status
information.
LOCAL_MAILER_PATH [/bin/mail] The program used to deliver local mail.
@@ -665,7 +666,7 @@ stickyhost This feature is sometimes used with LOCAL_RELAY,
although it can be used for a different effect with
MAIL_HUB.
- When used with without MAIL_HUB, email sent to
+ When used without MAIL_HUB, email sent to
"user@local.host" are marked as "sticky" -- that
is, the local addresses aren't matched against UDB,
don't go through ruleset 5, and are not forwarded to
@@ -1860,8 +1861,8 @@ for your purposes. There is now the option to tag entries in the
access map according to their type. Three tags are available:
Connect: connection information (${client_addr}, ${client_name})
- From: sender
- To: recipient
+ From: envelope sender
+ To: envelope recipient
If the required item is looked up in a map, it will be tried first
with the corresponding tag in front, then (as fallback to enable
@@ -1913,7 +1914,7 @@ avoid this problem you have to use tagged entries:
Connect:my.domain RELAY
if you need those entries at all (class {R} may take care of them).
-
+
FEATURE(`delay_checks') can take an optional argument:
FEATURE(`delay_checks', `friend')
@@ -1966,6 +1967,11 @@ defined for them can be given by:
H*: $>CheckHdr
+Notice: All rules act on tokens as explained in doc/op/op.{me,ps,txt}.
+That may cause problems with simple header checks due to the
+tokenization. It might be simpler to use a regex map and apply it
+to $&{currHeader}.
+
After all of the headers are read, the check_eoh ruleset will be called for
any final header-related checks. The ruleset is called with the number of
headers and the size of all of the headers in bytes separated by $|. One
@@ -2113,6 +2119,20 @@ should only be accepted if they have been authenticated.
TLS_Srv:secure.example.com ENCR:112
TLS_Clt:laptop.example.com PERM+VERIFY:112
+Notice: requiring that e-mail is sent to a server only encrypted,
+e.g., via
+
+TLS_Srv:secure.domain ENCR:112
+
+doesn't necessarily mean that e-mail sent to that domain is encrypted.
+If the domain has multiple MX servers, e.g.,
+
+secure.domain. IN MX 10 mail.secure.domain.
+secure.domain. IN MX 50 mail.other.domain.
+
+then mail to user@secure.domain may go unencrypted to mail.other.domain.
+
+
Received: Header
The Received: header reveals whether STARTTLS has been used. It contains an
@@ -2979,7 +2999,7 @@ confAUTH_MECHANISMS AuthMechanisms [GSSAPI KERBEROS_V4 DIGEST-MD5
intersection of this list and the list
of available mechanisms as determined
by the CYRUS SASL library.
-confDEF_AUTH_INFO DefaultAuthInfo [undefined] Filename that contains
+confDEF_AUTH_INFO DefaultAuthInfo [undefined] Name of file that contains
authentication information for
outgoing connections. This file
must contain the user id, the
@@ -3257,4 +3277,4 @@ M4 DIVERSIONS
8 DNS based blacklists
9 special local rulesets (1 and 2)
-$Revision: 8.383.2.1.2.35 $, Last updated $Date: 2000/12/17 17:19:11 $
+$Revision: 8.383.2.1.2.42 $, Last updated $Date: 2001/02/15 23:40:10 $
diff --git a/contrib/sendmail/cf/cf/knecht.mc b/contrib/sendmail/cf/cf/knecht.mc
index cd467f6..89f9c53 100644
--- a/contrib/sendmail/cf/cf/knecht.mc
+++ b/contrib/sendmail/cf/cf/knecht.mc
@@ -1,6 +1,6 @@
divert(-1)
#
-# Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
+# Copyright (c) 1998, 1999, 2001 Sendmail, Inc. and its suppliers.
# All rights reserved.
# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
@@ -17,8 +17,8 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`$Id: knecht.mc,v 8.37 1999/11/19 05:18:12 gshapiro Exp $')
-OSTYPE(bsdi)dnl
+VERSIONID(`$Id: knecht.mc,v 8.37.16.3 2001/02/22 22:38:39 ca Exp $')
+OSTYPE(bsd4.4)dnl
DOMAIN(generic)dnl
define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward+$h:$z/.forward')dnl
define(`confDEF_USER_ID', `mailnull')dnl
@@ -28,10 +28,16 @@ define(`confCOPY_ERRORS_TO', `Postmaster')dnl
define(`confTO_QUEUEWARN', `8h')dnl
define(`confTRUSTED_USERS', `www')dnl
define(`confPRIVACY_FLAGS', ``authwarnings,noexpn,novrfy'')dnl
+define(`CERT_DIR', `MAIL_SETTINGS_DIR`'certs')dnl
+define(`confCACERT_PATH', `CERT_DIR')dnl
+define(`confCACERT', `CERT_DIR/CAcert.pem')dnl
+define(`confSERVER_CERT', `CERT_DIR/MYcert.pem')dnl
+define(`confSERVER_KEY', `CERT_DIR/MYkey.pem')dnl
+define(`confCLIENT_CERT', `CERT_DIR/MYcert.pem')dnl
+define(`confCLIENT_KEY', `CERT_DIR/MYkey.pem')dnl
FEATURE(virtusertable)dnl
FEATURE(access_db)dnl
FEATURE(local_lmtp)dnl
-MODIFY_MAILER_FLAGS(`LOCAL', `+P')dnl
MAILER(local)dnl
MAILER(smtp)dnl
@@ -61,7 +67,7 @@ HMessage-Id: $>CheckMessageId
SCheckMessageId
R< $+ @ $+ > $@ OK
-R$* $#error $: "553 Header error"
+R$* $#error $: "554 Header error"
LOCAL_RULESETS
SLocal_check_mail
diff --git a/contrib/sendmail/cf/m4/version.m4 b/contrib/sendmail/cf/m4/version.m4
index a98a7e6..05f275b 100644
--- a/contrib/sendmail/cf/m4/version.m4
+++ b/contrib/sendmail/cf/m4/version.m4
@@ -1,6 +1,6 @@
divert(-1)
#
-# Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+# Copyright (c) 1998-2001 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(`$Id: version.m4,v 8.39.4.21 2000/12/29 18:22:15 gshapiro Exp $')
+VERSIONID(`$Id: version.m4,v 8.39.4.26 2001/02/27 19:22:29 gshapiro Exp $')
#
divert(0)
# Configuration version number
-DZ8.11.2`'ifdef(`confCF_VERSION', `/confCF_VERSION')
+DZ8.11.3`'ifdef(`confCF_VERSION', `/confCF_VERSION')
diff --git a/contrib/sendmail/contrib/buildvirtuser b/contrib/sendmail/contrib/buildvirtuser
index e544828..3ea2d66 100755
--- a/contrib/sendmail/contrib/buildvirtuser
+++ b/contrib/sendmail/contrib/buildvirtuser
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
-# Copyright (c) 1999-2000 Gregory Neil Shapiro. All Rights Reserved.
+# Copyright (c) 1999-2001 Gregory Neil Shapiro. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -27,7 +27,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
-# $Id: buildvirtuser,v 1.1.2.1 2000/10/26 22:51:03 gshapiro Exp $
+# $Id: buildvirtuser,v 1.1.2.3 2001/02/12 02:57:13 gshapiro Exp $
=head1 NAME
@@ -45,7 +45,10 @@ directory should contain one file per virtual domain with the filename
matching the virtual domain name and the contents containing a list of
usernames on the left and the actual address for that username on the
right. An empty left column translates to the default for that domain.
-Blank lines and lines beginning with '#' are ignored.
+Blank lines and lines beginning with '#' are ignored. Occurrences of
+$DOMAIN in the file are replaced by the current domain being processed.
+Occurrences of $LHS in the right hand side are replaced by the address on
+the left hand side.
=head1 CONFIGURATION
@@ -66,21 +69,21 @@ Here are some example files from the /etc/mail/virtusers/ directory:
=head2 /etc/mail/virtusers/bsdunix.org:
# Services
- MAILER-DAEMON gshapiro+MAILER-DAEMON.bsdunix.org@gshapiro.net
- postmaster gshapiro+postmaster.bsdunix.org@gshapiro.net
- webmaster gshapiro+webmaster.bsdunix.org@gshapiro.net
+ MAILER-DAEMON gshapiro+bounce.$DOMAIN@gshapiro.net
+ postmaster gshapiro+$LHS.$DOMAIN@gshapiro.net
+ webmaster gshapiro+$LHS.$DOMAIN@gshapiro.net
# Defaults
error:nouser No such user
# Users
- gshapiro gshapiro+bsdunix.org@gshapiro.net
+ gshapiro gshapiro+$DOMAIN@gshapiro.net
bob robert@smtp.org
=head2 /etc/mail/virtusers/smtp.org:
# Defaults
- gshapiro+smtp.org@gshapiro.net
+ gshapiro+$DOMAIN@gshapiro.net
# Users
john john@wookie.org
@@ -92,6 +95,8 @@ Gregory Neil Shapiro E<lt>F<gshapiro@gshapiro.net>E<gt>
=cut
+use strict;
+
my $makemap = "/usr/sbin/makemap";
my $dbtype = "hash";
my $maildir = "/etc/mail";
@@ -102,6 +107,7 @@ my $newvirt = "$maildir/virtusertable.new.db";
my $virt = "$maildir/virtusertable.db";
my %virt = ();
my $newest = 0;
+my ($lhs, $domain, $key, $value);
opendir(VIRTS, $virts) || die "Could not open directory $virts: $!\n";
my @virts = grep { -f "$virts/$_" } readdir(VIRTS);
@@ -126,10 +132,12 @@ LINE: while (<DOMAIN>)
{
if (defined($1))
{
+ $lhs = "$1";
$key = "$1\@$domain";
}
else
{
+ $lhs = "";
$key = "\@$domain";
}
$value = $2;
@@ -138,6 +146,11 @@ LINE: while (<DOMAIN>)
{
die "Bogus line $line in $virts/$domain\n";
}
+
+ # Variable subsitution
+ $key =~ s/\$DOMAIN/$domain/g;
+ $value =~ s/\$DOMAIN/$domain/g;
+ $value =~ s/\$LHS/$lhs/g;
$virt{$key} = $value;
}
close(DOMAIN) || die "Could not close $virts/$domain: $!\n";
diff --git a/contrib/sendmail/doc/op/Makefile b/contrib/sendmail/doc/op/Makefile
index 3819f18..4b3644d 100644
--- a/contrib/sendmail/doc/op/Makefile
+++ b/contrib/sendmail/doc/op/Makefile
@@ -1,23 +1,29 @@
-# $Id: Makefile,v 8.7 2000/02/01 08:21:47 gshapiro Exp $
+# $Id: Makefile,v 8.7.8.1 2001/01/04 18:55:46 gshapiro Exp $
-DIR= smm/08.sendmailop
-SRCS= op.me
-OBJS= op.ps
-MACROS= -me
+DIR= smm/08.sendmailop
+SRCS= op.me
+OBJS= op.ps
+MACROS= -me
ROFF_CMD= groff
PIC_CMD= pic
EQN_CMD= eqn
PIC= ${PIC_CMD} -C
-EQN= ${EQN_CMD} -C -Tps
-ROFF= ${ROFF_CMD} -Tps -mps ${MACROS}
+EQNASCII= ${EQN_CMD} -C -Tascii
+EQNPS= ${EQN_CMD} -C -Tps
+ROFFASCII= ${ROFF_CMD} -Tascii ${MACROS}
+ROFFPS= ${ROFF_CMD} -Tps -mps ${MACROS}
all: ${OBJS}
-${OBJS}: ${SRCS}
+op.ps: ${SRCS}
rm -f $@
- ${PIC} ${SRCS} | ${EQN} | ${ROFF} > $@
+ ${PIC} ${SRCS} | ${EQNPS} | ${ROFFPS} > $@
+
+op.txt: ${SRCS}
+ rm -f $@
+ ${PIC} ${SRCS} | ${EQNASCII} | ${ROFFASCII} > $@
clean:
- rm -f ${OBJS}
+ rm -f op.ps op.txt
install: ${OBJS}
diff --git a/contrib/sendmail/doc/op/op.me b/contrib/sendmail/doc/op/op.me
index 68fe3793..3c27ebd 100644
--- a/contrib/sendmail/doc/op/op.me
+++ b/contrib/sendmail/doc/op/op.me
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+.\" Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
.\" All rights reserved.
.\" Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
.\" Copyright (c) 1983, 1993
@@ -9,7 +9,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" $Id: op.me,v 8.317.4.47 2000/12/17 00:54:56 gshapiro Exp $
+.\" $Id: op.me,v 8.317.4.56 2001/02/15 23:38:16 ca Exp $
.\"
.\" eqn op.me | pic | troff -me
.eh 'SMM:08-%''Sendmail Installation and Operation Guide'
@@ -53,7 +53,7 @@ eric@Sendmail.COM
.de Ve
Version \\$2
..
-.Ve $Revision: 8.317.4.47 $
+.Ve $Revision: 8.317.4.56 $
.rm Ve
.sp
For Sendmail Version 8.11
@@ -99,7 +99,7 @@ RFC1652 (SMTP 8BITMIME Extension),
RFC1870 (SMTP SIZE Extension),
RFC1891 (SMTP Delivery Status Notifications),
RFC1892 (Multipart/Report),
-RFC1893 (Mail System Status Codes),
+RFC1893 (Enhanced Mail System Status Codes),
RFC1894 (Delivery Status Notifications),
RFC1985 (SMTP Service Extension for Remote Message Queue Starting),
RFC2033 (Local Message Transmission Protocol),
@@ -624,7 +624,7 @@ option is set.
.pp
This command is also a link to
.i sendmail .
-It flushes all information that is stored in the
+It flushes expired (Timeout.hoststatus) information that is stored in the
.b HostStatusDirectory
tree.
.sh 3 "/var/spool/mqueue"
@@ -644,9 +644,9 @@ file.
To use multiple queues,
supply a value ending with an asterisk.
For example,
-.i /var/spool/mqueue/q*
+.i /var/spool/mqueue/qd*
will use all of the directories or symbolic links to directories
-beginning with `q' in
+beginning with `qd' in
.i /var/spool/mqueue
as queue directories.
Do not change the queue directory structure
@@ -1141,6 +1141,9 @@ Removing this directory and its subdirectories has an effect similar to
the
.i purgestat
command and is completely safe.
+However,
+.i purgestat
+only removes expired (Timeout.hoststatus) data.
The information in these directories can
be perused with the
.i hoststat
@@ -1158,7 +1161,7 @@ the
.b Timeout.hoststatus
option.
.pp
-The connection information stored on disk may be purged at any time
+The connection information stored on disk may be expired at any time
with the
.i purgestat
command or by invoking sendmail with the
@@ -1174,7 +1177,8 @@ switch.
The implementation of certain system services
such as host and user name lookup
is controlled by the service switch.
-If the host operating system supports such a switch
+If the host operating system supports such a switch,
+and sendmail knows about it,
.i sendmail
will use the native version.
Ultrix, Solaris, and DEC OSF/1 are examples of such systems\**.
@@ -4262,7 +4266,9 @@ FAIL cert presented but could not be verified,
NONE STARTTLS has not been performed.
TEMP temporary error occurred.
PROTOCOL some protocol error occurred.
-SOFTWARE STARTTLS handshake failed.
+SOFTWARE STARTTLS handshake failed,
+ which is a fatal error for this session,
+ the e-mail will be queued.
.)b
.pp
There are three types of dates that can be used.
@@ -4504,6 +4510,9 @@ The syntax is:
.br
.b F \c
.i c\|file
+.br
+.b F \c
+.i c\||program
.)b
The first form defines the class
.i c
@@ -4530,11 +4539,13 @@ CHmonet
CHucbmonet
.)b
are equivalent.
-The ``F'' form
-reads the elements of the class
+The ``F'' forms
+read the elements of the class
.i c
from the named
-.i file .
+.i file
+or
+.i program .
Each element should be listed on a separate line.
To specify an optional file, use ``-o'' between the class
name and the file name, e.g.,
@@ -5382,7 +5393,7 @@ should be in the format
``\c
.i class \c
.b :
-.i file ''
+.i info ''
where
.i class \c
.b :
@@ -5397,6 +5408,10 @@ for back compatibility),
(if
.sm NEWDB
is specified),
+.q btree
+(if
+.sm NEWDB
+is specified),
.q dbm
(if
.sm NDBM
@@ -5404,6 +5419,13 @@ is specified),
.q stab
(internal symbol table \*- not normally used
unless you have no other database lookup),
+.q sequence
+(use a sequence of maps
+previously declared),
+.q ldap
+(if
+.sm LDAPMAP
+is specified),
or
.q nis
(if
@@ -9390,7 +9412,7 @@ replace it with a blank sheet for double-sided output.
.\".sz 10
.\"Eric Allman
.\".sp
-.\"Version $Revision: 8.317.4.47 $
+.\"Version $Revision: 8.317.4.56 $
.\".ce 0
.bp 3
.ce
diff --git a/contrib/sendmail/libmilter/Makefile.m4 b/contrib/sendmail/libmilter/Makefile.m4
index 4b92464..19381a4 100644
--- a/contrib/sendmail/libmilter/Makefile.m4
+++ b/contrib/sendmail/libmilter/Makefile.m4
@@ -16,9 +16,9 @@ APPENDDEF(`confENVDEF', `-DNOT_SENDMAIL')
divert(bldTARGETS_SECTION)
# Install the API header file
-MFAPI= ${SRCDIR}/include/libmilter/mfapi.h
+MFAPI= ${SRCDIR}/inc`'lude/libmilter/mfapi.h
install-mfapi: ${MFAPI}
- ${INSTALL} ${MFAPI} ${DESTDIR}${INCLUDEDIR}
+ ${INSTALL} -c -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} ${MFAPI} ${DESTDIR}${INCLUDEDIR}
divert(0)
bldFINISH
diff --git a/contrib/sendmail/libmilter/README b/contrib/sendmail/libmilter/README
index ffe09c4..7c052ca 100644
--- a/contrib/sendmail/libmilter/README
+++ b/contrib/sendmail/libmilter/README
@@ -44,6 +44,11 @@ threading support differs according to the compiler and linker used. Check
the Makefile in your appropriate obj.*/libmilter build subdirectory if you
are unsure of the local flag used.
+Note that since filters use threads, it may be necessary to alter per
+process limits in your filter. For example, you might look at using
+setrlimit() to increase the number of open file descriptors if your filter
+is going to be busy.
+
+----------------------------------------+
| SPECIFYING FILTERS IN SENDMAIL CONFIGS |
@@ -416,4 +421,4 @@ main(argc, argv)
/* eof */
-$Revision: 8.9.2.1.2.13 $, Last updated $Date: 2000/12/29 18:55:23 $
+$Revision: 8.9.2.1.2.14 $, Last updated $Date: 2001/02/21 23:08:19 $
diff --git a/contrib/sendmail/libmilter/engine.c b/contrib/sendmail/libmilter/engine.c
index 554631c..0fd48eb 100644
--- a/contrib/sendmail/libmilter/engine.c
+++ b/contrib/sendmail/libmilter/engine.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -9,7 +9,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: engine.c,v 8.67.4.15 2000/12/29 19:43:10 gshapiro Exp $";
+static char id[] = "@(#)$Id: engine.c,v 8.67.4.17 2001/01/22 19:00:16 gshapiro Exp $";
#endif /* ! lint */
#if _FFR_MILTER
@@ -122,7 +122,7 @@ static int dec_arg2 __P((char *, size_t, char **, char **));
#define NX_INIT (MASK(ST_OPTS))
#define NX_OPTS (MASK(ST_CONN))
#define NX_CONN (MASK(ST_HELO) | MASK(ST_MAIL))
-#define NX_HELO (MASK(ST_MAIL))
+#define NX_HELO (MASK(ST_HELO) | MASK(ST_MAIL))
#define NX_MAIL (MASK(ST_RCPT) | MASK(ST_ABRT))
#define NX_RCPT (MASK(ST_HDRS) | MASK(ST_EOHS) | MASK(ST_RCPT) | MASK(ST_ABRT))
#define NX_HDRS (MASK(ST_EOHS) | MASK(ST_HDRS) | MASK(ST_ABRT))
diff --git a/contrib/sendmail/libmilter/listener.c b/contrib/sendmail/libmilter/listener.c
index 8b1d952..6a1a801 100644
--- a/contrib/sendmail/libmilter/listener.c
+++ b/contrib/sendmail/libmilter/listener.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -9,7 +9,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: listener.c,v 8.38.2.1.2.18 2000/12/29 19:44:28 gshapiro Exp $";
+static char id[] = "@(#)$Id: listener.c,v 8.38.2.1.2.21 2001/02/14 02:20:40 gshapiro Exp $";
#endif /* ! lint */
#if _FFR_MILTER
@@ -30,16 +30,19 @@ static char id[] = "@(#)$Id: listener.c,v 8.38.2.1.2.18 2000/12/29 19:44:28 gsha
** conn -- connection description
** backlog -- listen backlog
** socksize -- socksize of created socket
+** family -- family of created socket
+** name -- name for logging
**
** Returns:
** socket upon success, error code otherwise.
*/
static socket_t
-mi_milteropen(conn, backlog, socksize, name)
+mi_milteropen(conn, backlog, socksize, family, name)
char *conn;
int backlog;
SOCKADDR_LEN_T *socksize;
+ int *family;
char *name;
{
socket_t sock;
@@ -393,7 +396,7 @@ mi_milteropen(conn, backlog, socksize, name)
(void) close(sock);
return INVALID_SOCKET;
}
-
+ *family = addr.sa.sa_family;
return sock;
}
/*
@@ -457,6 +460,46 @@ mi_closener()
** MI_FAILURE -- Network initialization failed.
*/
+# if BROKEN_PTHREAD_SLEEP
+
+/*
+** Solaris 2.6, perhaps others, gets an internal threads library panic
+** when sleep() is used:
+**
+** thread_create() failed, returned 11 (EINVAL)
+** co_enable, thr_create() returned error = 24
+** libthread panic: co_enable failed (PID: 17793 LWP 1)
+** stacktrace:
+** ef526b10
+** ef52646c
+** ef534cbc
+** 156a4
+** 14644
+** 1413c
+** 135e0
+** 0
+*/
+
+# define MI_SLEEP(s) \
+{ \
+ int rs = 0; \
+ struct timeval st; \
+ \
+ st.tv_sec = (s); \
+ st.tv_usec = 0; \
+ if (st.tv_sec > 0) \
+ rs = select(0, NULL, NULL, NULL, &st); \
+ if (rs != 0) \
+ { \
+ smi_log(SMI_LOG_ERR, \
+ "MI_SLEEP(): select() returned non-zero result %d, errno = %d", \
+ rs, errno); \
+ } \
+}
+# else /* BROKEN_PTHREAD_SLEEP */
+# define MI_SLEEP(s) sleep((s))
+# endif /* BROKEN_PTHREAD_SLEEP */
+
int
mi_listener(conn, dbg, smfi, timeout, backlog)
char *conn;
@@ -466,11 +509,12 @@ mi_listener(conn, dbg, smfi, timeout, backlog)
int backlog;
{
socket_t connfd = INVALID_SOCKET;
+ int family = AF_UNSPEC;
int sockopt = 1;
int r;
int ret = MI_SUCCESS;
- int cnt_m = 0;
- int cnt_t = 0;
+ int mcnt = 0;
+ int tcnt = 0;
sthread_t thread_id;
_SOCK_ADDR cliaddr;
SOCKADDR_LEN_T socksize;
@@ -485,7 +529,8 @@ mi_listener(conn, dbg, smfi, timeout, backlog)
smfi->xxfi_name, conn);
(void) smutex_init(&L_Mutex);
(void) smutex_lock(&L_Mutex);
- listenfd = mi_milteropen(conn, backlog, &socksize, smfi->xxfi_name);
+ listenfd = mi_milteropen(conn, backlog, &socksize, &family,
+ smfi->xxfi_name);
if (!ValidSocket(listenfd))
{
smi_log(SMI_LOG_FATAL,
@@ -545,10 +590,29 @@ mi_listener(conn, dbg, smfi, timeout, backlog)
break;
}
+ memset(&cliaddr, '\0', sizeof cliaddr);
connfd = accept(listenfd, (struct sockaddr *) &cliaddr,
&clilen);
(void) smutex_unlock(&L_Mutex);
+ /*
+ ** If remote side closes before
+ ** accept() finishes, sockaddr
+ ** might not be fully filled in.
+ */
+
+ if (ValidSocket(connfd) &&
+ (clilen == 0 ||
+# ifdef BSD4_4_SOCKADDR
+ cliaddr.sa.sa_len == 0 ||
+# endif /* BSD4_4_SOCKADDR */
+ cliaddr.sa.sa_family != family))
+ {
+ (void) close(connfd);
+ connfd = INVALID_SOCKET;
+ errno = EINVAL;
+ }
+
if (!ValidSocket(connfd))
{
smi_log(SMI_LOG_ERR,
@@ -569,15 +633,16 @@ mi_listener(conn, dbg, smfi, timeout, backlog)
(void) close(connfd);
smi_log(SMI_LOG_ERR, "%s: malloc(ctx) failed",
smfi->xxfi_name);
- sleep(++cnt_m);
- if (cnt_m >= MAX_FAILS_M)
+ mcnt++;
+ MI_SLEEP(mcnt);
+ if (mcnt >= MAX_FAILS_M)
{
ret = MI_FAILURE;
break;
}
continue;
}
- cnt_m = 0;
+ mcnt = 0;
memset(ctx, '\0', sizeof *ctx);
ctx->ctx_sd = connfd;
ctx->ctx_dbg = dbg;
@@ -611,17 +676,18 @@ mi_listener(conn, dbg, smfi, timeout, backlog)
smi_log(SMI_LOG_ERR,
"%s: thread_create() failed: %d",
smfi->xxfi_name, r);
- sleep(++cnt_t);
+ tcnt++;
+ MI_SLEEP(tcnt);
(void) close(connfd);
free(ctx);
- if (cnt_t >= MAX_FAILS_T)
+ if (tcnt >= MAX_FAILS_T)
{
ret = MI_FAILURE;
break;
}
continue;
}
- cnt_t = 0;
+ tcnt = 0;
}
if (ret != MI_SUCCESS)
mi_stop_milters(MILTER_ABRT);
diff --git a/contrib/sendmail/libmilter/sm_gethost.c b/contrib/sendmail/libmilter/sm_gethost.c
index 9541a93..32c8faf 100644
--- a/contrib/sendmail/libmilter/sm_gethost.c
+++ b/contrib/sendmail/libmilter/sm_gethost.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -9,7 +9,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: sm_gethost.c,v 8.7.8.4 2000/12/19 04:26:33 gshapiro Exp $";
+static char id[] = "@(#)$Id: sm_gethost.c,v 8.7.8.6 2001/02/14 04:07:23 gshapiro Exp $";
#endif /* ! lint */
#if _FFR_MILTER
@@ -54,7 +54,7 @@ getipnodebyname(name, family, flags, err)
resv6 = bitset(RES_USE_INET6, _res.options);
_res.options |= RES_USE_INET6;
}
- h_errno = 0;
+ SM_SET_H_ERRNO(0);
h = gethostbyname(name);
*err = h_errno;
if (family == AF_INET6 && !resv6)
@@ -102,7 +102,7 @@ mi_gethostbyname(name, family)
# if NETINET6
h = getipnodebyname(name, family, AI_V4MAPPED|AI_ALL, &err);
- h_errno = err;
+ SM_SET_H_ERRNO(err);
# else /* NETINET6 */
h = gethostbyname(name);
# endif /* NETINET6 */
diff --git a/contrib/sendmail/libsmdb/smdb2.c b/contrib/sendmail/libsmdb/smdb2.c
index e6f350a..af56fe9 100644
--- a/contrib/sendmail/libsmdb/smdb2.c
+++ b/contrib/sendmail/libsmdb/smdb2.c
@@ -1,5 +1,5 @@
/*
-** Copyright (c) 1999-2000 Sendmail, Inc. and its suppliers.
+** Copyright (c) 1999-2001 Sendmail, Inc. and its suppliers.
** All rights reserved.
**
** By using this file, you agree to the terms and conditions set
@@ -8,7 +8,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: smdb2.c,v 8.53.2.1.2.5 2000/10/26 00:39:56 geir Exp $";
+static char id[] = "@(#)$Id: smdb2.c,v 8.53.2.1.2.7 2001/02/14 04:07:24 gshapiro Exp $";
#endif /* ! lint */
#include <fcntl.h>
@@ -359,9 +359,12 @@ int
smdb2_cursor_close(cursor)
SMDB_CURSOR *cursor;
{
+ int ret;
DBC *dbc = (DBC *) cursor->smdbc_impl;
- return db2_error_to_smdb(dbc->c_close(dbc));
+ ret = db2_error_to_smdb(dbc->c_close(dbc));
+ free(cursor);
+ return ret;
}
int
diff --git a/contrib/sendmail/src/README b/contrib/sendmail/src/README
index e4e62a1..fc8917a 100644
--- a/contrib/sendmail/src/README
+++ b/contrib/sendmail/src/README
@@ -1,4 +1,4 @@
-# Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+# Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
# All rights reserved.
# Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
# Copyright (c) 1988
@@ -9,7 +9,7 @@
# the sendmail distribution.
#
#
-# $Id: README,v 8.263.2.1.2.27 2000/12/16 16:46:02 gshapiro Exp $
+# $Id: README,v 8.263.2.1.2.32 2001/01/29 23:45:22 gshapiro Exp $
#
This directory contains the source files for sendmail(TM).
@@ -631,9 +631,10 @@ YOU HEADACHES!
When attempting to canonify a hostname, some broken name servers will
return SERVFAIL (a temporary failure) on T_AAAA (IPv6) lookups. If you
want to excuse this behavior, compile sendmail with
--D_FFR_WORKAROUND_BROKEN_NAMESERVERS. However, instead, we recommend catching
-the problem and reporting it to the name server administrator so we can rid
-the world of broken name servers.
+-D_FFR_WORKAROUND_BROKEN_NAMESERVERS and add WorkAroundBrokenAAAA to your
+ResolverOptions setting. However, instead, we recommend catching the
+problem and reporting it to the name server administrator so we can rid the
+world of broken name servers.
+----------------------------------------+
| STARTTLS COMPILATION AND CONFIGURATION |
@@ -1038,6 +1039,12 @@ IRIX 6.x
If you are using XFS filesystem, avoid using the -32 ABI switch to
the cc compiler if possible.
+ Broken inet_aton and inet_ntoa on IRIX using gcc: There's
+ a problem with gcc on IRIX, i.e., gcc can't pass structs
+ less than 16 bits long unless they are 8 bits; IRIX 6.2 has
+ some other sized structs. See
+ http://www.bitmechanic.com/mail-archives/mysql/current/0418.html
+
IRIX 6.4
The IRIX 6.5.4 version of /bin/m4 does not work properly with
sendmail. Either install fw_m4.sw.m4 off the Freeware_May99 CD and
@@ -1096,8 +1103,10 @@ BSDI (BSD/386) 1.0, NetBSD 0.9, FreeBSD 1.0
determined to continue to use your old, buggy version (or as
a shortcut to get sendmail working -- I'm sure you have the
best intentions to port a modern version of BIND), you can
- copy ../contrib/oldbind.compat.c into sendmail and add
- oldbind.compat.o to OBJADD in the Makefile.
+ copy ../contrib/oldbind.compat.c into sendmail and add the
+ following to devtools/Site/site.config.m4:
+
+ APPENDDEF(`confOBJADD', `oldbind.compat.o')
A/UX
Date: Tue, 12 Oct 1993 18:28:28 -0400 (EDT)
@@ -1236,6 +1245,17 @@ Linux
"#include <syslog.h>" to the SFIO version of stdio.h as the very
first line.
+glibc
+ glibc 2.2.1 (and possibly other versions) changed the value of
+ __RES in resolv.h but failed to actually provide the IPv6 API
+ changes that the change implied. Therefore, compiling with
+ -DNETINET6 fails.
+
+ Workarounds:
+ 1) Compile without -DNETINET6
+ 2) Build against a real BIND 8.2.2 include/lib tree
+ 3) Wait for glibc to fix it
+
AIX 4.X
The AIX 4.X linker uses library paths specified during compilation
using -L for run-time shared library searches. Therefore, it is
@@ -1268,7 +1288,7 @@ AIX 4.3.3
Workarounds:
1) Compile without -DNETINET6
- 2) Build against a real Bind 8.2.2 include/lib tree
+ 2) Build against a real BIND 8.2.2 include/lib tree
3) Wait for IBM to fix it
AIX 4.X
@@ -1668,4 +1688,4 @@ util.c Some general purpose routines used by sendmail.
version.c The version number and information about this
version of sendmail.
-(Version $Revision: 8.263.2.1.2.27 $, last update $Date: 2000/12/16 16:46:02 $ )
+(Version $Revision: 8.263.2.1.2.32 $, last update $Date: 2001/01/29 23:45:22 $ )
diff --git a/contrib/sendmail/src/bf.h b/contrib/sendmail/src/bf.h
index d7d6303..8fc86ae 100644
--- a/contrib/sendmail/src/bf.h
+++ b/contrib/sendmail/src/bf.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 1999 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999, 2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
- * $Id: bf.h,v 8.5 1999/11/04 19:31:25 ca Exp $
+ * $Id: bf.h,v 8.5.16.2 2001/02/14 04:07:27 gshapiro Exp $
*
* Contributed by Exactis.com, Inc.
*
@@ -20,6 +20,7 @@ extern FILE *bfdup __P((FILE *));
extern int bfcommit __P((FILE *));
extern int bfrewind __P((FILE *));
extern int bftruncate __P((FILE *));
+extern int bffsync __P((FILE *));
extern int bfclose __P((FILE *));
extern bool bftest __P((FILE *));
diff --git a/contrib/sendmail/src/bf_portable.c b/contrib/sendmail/src/bf_portable.c
index 4de0af3..3c09cec 100644
--- a/contrib/sendmail/src/bf_portable.c
+++ b/contrib/sendmail/src/bf_portable.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: bf_portable.c,v 8.25.4.3 2000/06/29 21:21:58 gshapiro Exp $";
+static char id[] = "@(#)$Id: bf_portable.c,v 8.25.4.5 2001/02/14 04:07:27 gshapiro Exp $";
#endif /* ! lint */
#if SFIO
@@ -283,6 +283,47 @@ bftruncate(fp)
}
/*
+** BFFSYNC -- fsync the fd associated with the FILE *
+**
+** Parameters:
+** fp -- FILE * to fsync
+**
+** Returns:
+** 0 on success, -1 on error
+**
+** Sets errno:
+** EINVAL if FILE * not bfcommitted yet.
+** any value of errno specified by fsync()
+*/
+
+int
+bffsync(fp)
+ FILE *fp;
+{
+ int fd;
+ struct bf *bfp;
+
+ /* Get associated bf structure */
+ bfp = bflookup(fp);
+
+ /* If called on a normal FILE *, noop */
+ if (bfp != NULL && !bfp->bf_committed)
+ fd = -1;
+ else
+ fd = fileno(fp);
+
+ if (tTd(58, 10))
+ dprintf("bffsync: fd = %d\n", fd);
+
+ if (fd < 0)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ return fsync(fd);
+}
+
+ /*
** BFCLOSE -- close a buffered file
**
** Parameters:
diff --git a/contrib/sendmail/src/bf_torek.c b/contrib/sendmail/src/bf_torek.c
index ab129d4..d58abc9 100644
--- a/contrib/sendmail/src/bf_torek.c
+++ b/contrib/sendmail/src/bf_torek.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: bf_torek.c,v 8.19.18.2 2000/09/17 17:04:26 gshapiro Exp $";
+static char id[] = "@(#)$Id: bf_torek.c,v 8.19.18.4 2001/02/14 04:07:27 gshapiro Exp $";
#endif /* ! lint */
#if SFIO
@@ -381,6 +381,51 @@ bftruncate(fp)
}
/*
+** BFFSYNC -- fsync the fd associated with the FILE *
+**
+** Parameters:
+** fp -- FILE * to fsync
+**
+** Returns:
+** 0 on success, -1 on error
+**
+** Sets errno:
+** EINVAL if FILE * not bfcommitted yet.
+** any value of errno specified by fsync()
+*/
+
+int
+bffsync(fp)
+ FILE *fp;
+{
+ int fd;
+ struct bf *bfp;
+
+ if (bftest(fp))
+ {
+ /* Get bf structure */
+ bfp = (struct bf *)fp->_cookie;
+
+ if (bfp->bf_ondisk && bfp->bf_committed)
+ fd = bfp->bf_disk_fd;
+ else
+ fd = -1;
+ }
+ else
+ fd = fileno(fp);
+
+ if (tTd(58, 10))
+ dprintf("bffsync: fd = %d\n", fd);
+
+ if (fd < 0)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ return fsync(fd);
+}
+
+ /*
** BFCLOSE -- close a buffered file
**
** Parameters:
diff --git a/contrib/sendmail/src/collect.c b/contrib/sendmail/src/collect.c
index c6c5f78..d1c7f1c 100644
--- a/contrib/sendmail/src/collect.c
+++ b/contrib/sendmail/src/collect.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -12,7 +12,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: collect.c,v 8.136.4.8 2000/10/09 00:50:04 gshapiro Exp $";
+static char id[] = "@(#)$Id: collect.c,v 8.136.4.15 2001/02/21 01:05:59 gshapiro Exp $";
#endif /* ! lint */
#include <sendmail.h>
@@ -84,7 +84,6 @@ collect(fp, smtpmode, hdrp, e)
volatile int hdrslen = 0;
volatile int numhdrs = 0;
volatile int dfd;
- volatile int afd;
volatile int rstat = EX_OK;
u_char *volatile pbp;
u_char peekbuf[8];
@@ -102,6 +101,8 @@ collect(fp, smtpmode, hdrp, e)
if (!headeronly)
{
struct stat stbuf;
+ long sff = SFF_OPENASROOT;
+
(void) strlcpy(dfname, queuename(e, 'd'), sizeof dfname);
#if _FFR_QUEUE_FILE_MODE
@@ -110,18 +111,21 @@ collect(fp, smtpmode, hdrp, e)
if (bitset(S_IWGRP, QueueFileMode))
oldumask = umask(002);
- df = bfopen(dfname, QueueFileMode, DataFileBufferSize,
- SFF_OPENASROOT);
+ df = bfopen(dfname, QueueFileMode,
+ DataFileBufferSize, sff);
if (bitset(S_IWGRP, QueueFileMode))
(void) umask(oldumask);
}
#else /* _FFR_QUEUE_FILE_MODE */
- df = bfopen(dfname, FileMode, DataFileBufferSize,
- SFF_OPENASROOT);
+ df = bfopen(dfname, FileMode, DataFileBufferSize, sff);
#endif /* _FFR_QUEUE_FILE_MODE */
if (df == NULL)
{
- syserr("Cannot create %s", dfname);
+ HoldErrs = FALSE;
+ if (smtpmode)
+ syserr("421 4.3.5 Unable to create data file");
+ else
+ syserr("Cannot create %s", dfname);
e->e_flags |= EF_NO_BODY_RETN;
finis(TRUE, ExitStat);
/* NOTREACHED */
@@ -346,8 +350,9 @@ bufferchar:
else if (c != '\0')
{
*bp++ = c;
+ hdrslen++;
if (MaxHeadersLength > 0 &&
- ++hdrslen > MaxHeadersLength)
+ hdrslen > MaxHeadersLength)
{
sm_syslog(LOG_NOTICE, e->e_id,
"headers too large (%d max) from %s during message collect",
@@ -496,13 +501,6 @@ readerr:
/* skip next few clauses */
/* EMPTY */
}
- else if ((afd = fileno(df)) >= 0 && fsync(afd) < 0)
- {
- dferror(df, "fsync", e);
- flush_errors(TRUE);
- finis(TRUE, ExitStat);
- /* NOTREACHED */
- }
else if (bfcommit(df) < 0)
{
int save_errno = errno;
@@ -527,6 +525,13 @@ readerr:
flush_errors(TRUE);
finis(save_errno != EEXIST, ExitStat);
}
+ else if (bffsync(df) < 0)
+ {
+ dferror(df, "bffsync", e);
+ flush_errors(TRUE);
+ finis(TRUE, ExitStat);
+ /* NOTREACHED */
+ }
else if (bfclose(df) < 0)
{
dferror(df, "bfclose", e);
diff --git a/contrib/sendmail/src/control.c b/contrib/sendmail/src/control.c
index dda2761..95506ab 100644
--- a/contrib/sendmail/src/control.c
+++ b/contrib/sendmail/src/control.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -9,7 +9,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: control.c,v 8.44.14.13 2000/12/28 21:25:52 gshapiro Exp $";
+static char id[] = "@(#)$Id: control.c,v 8.44.14.15 2001/01/22 19:00:22 gshapiro Exp $";
#endif /* ! lint */
#include <sendmail.h>
diff --git a/contrib/sendmail/src/daemon.c b/contrib/sendmail/src/daemon.c
index e29d774..f4b07d4 100644
--- a/contrib/sendmail/src/daemon.c
+++ b/contrib/sendmail/src/daemon.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -16,9 +16,9 @@
#ifndef lint
# ifdef DAEMON
-static char id[] = "@(#)$Id: daemon.c,v 8.401.4.41 2000/12/28 23:46:43 gshapiro Exp $ (with daemon mode)";
+static char id[] = "@(#)$Id: daemon.c,v 8.401.4.51 2001/02/23 18:57:27 geir Exp $ (with daemon mode)";
# else /* DAEMON */
-static char id[] = "@(#)$Id: daemon.c,v 8.401.4.41 2000/12/28 23:46:43 gshapiro Exp $ (without daemon mode)";
+static char id[] = "@(#)$Id: daemon.c,v 8.401.4.51 2001/02/23 18:57:27 geir Exp $ (without daemon mode)";
# endif /* DAEMON */
#endif /* ! lint */
@@ -461,9 +461,29 @@ getrequests(e)
FD_ISSET(Daemons[idx].d_socket, &readfds))
{
lotherend = Daemons[idx].d_socksize;
+ memset(&RealHostAddr, '\0',
+ sizeof RealHostAddr);
t = accept(Daemons[idx].d_socket,
(struct sockaddr *)&RealHostAddr,
&lotherend);
+
+ /*
+ ** If remote side closes before
+ ** accept() finishes, sockaddr
+ ** might not be fully filled in.
+ */
+
+ if (t >= 0 &&
+ (lotherend == 0 ||
+# ifdef BSD4_4_SOCKADDR
+ RealHostAddr.sa.sa_len == 0 ||
+# endif /* BSD4_4_SOCKADDR */
+ RealHostAddr.sa.sa_family != Daemons[idx].d_addr.sa.sa_family))
+ {
+ (void) close(t);
+ t = -1;
+ errno = EINVAL;
+ }
olddaemon = curdaemon = idx;
break;
}
@@ -477,10 +497,30 @@ getrequests(e)
struct sockaddr_un sa_un;
lotherend = sizeof sa_un;
+ memset(&sa_un, '\0', sizeof sa_un);
t = accept(ControlSocket,
(struct sockaddr *)&sa_un,
&lotherend);
- control = TRUE;
+
+ /*
+ ** If remote side closes before
+ ** accept() finishes, sockaddr
+ ** might not be fully filled in.
+ */
+
+ if (t >= 0 &&
+ (lotherend == 0 ||
+# ifdef BSD4_4_SOCKADDR
+ sa_un.sun_len == 0 ||
+# endif /* BSD4_4_SOCKADDR */
+ sa_un.sun_family != AF_UNIX))
+ {
+ (void) close(t);
+ t = -1;
+ errno = EINVAL;
+ }
+ if (t >= 0)
+ control = TRUE;
}
# else /* NETUNIX */
if (curdaemon == -1)
@@ -1614,7 +1654,8 @@ makeconnection(host, port, mci, e)
/* Set up the address for outgoing connection. */
if (bitnset(D_BINDIF, d_flags) &&
- (p = macvalue(macid("{if_addr}", NULL), e)) != NULL)
+ (p = macvalue(macid("{if_addr}", NULL), e)) != NULL &&
+ *p != '\0')
{
# if NETINET6
char p6[INET6_ADDRSTRLEN];
@@ -1628,18 +1669,13 @@ makeconnection(host, port, mci, e)
{
# if NETINET
case AF_INET:
- if ((clt_addr.sin.sin_addr.s_addr = inet_addr(p))
- != INADDR_NONE)
+ clt_addr.sin.sin_addr.s_addr = inet_addr(p);
+ if (clt_addr.sin.sin_addr.s_addr != INADDR_NONE &&
+ clt_addr.sin.sin_addr.s_addr != INADDR_LOOPBACK)
{
clt_bind = TRUE;
socksize = sizeof (struct sockaddr_in);
}
- else if (clt_addr.sin.sin_port != 0)
- {
- clt_addr.sin.sin_addr.s_addr = INADDR_ANY;
- clt_bind = TRUE;
- socksize = sizeof (struct sockaddr_in);
- }
break;
# endif /* NETINET */
@@ -1650,15 +1686,9 @@ makeconnection(host, port, mci, e)
else
strlcpy(p6, p, sizeof p6);
if (inet_pton(AF_INET6, p6,
- &clt_addr.sin6.sin6_addr) == 1)
- {
- clt_bind = TRUE;
- socksize = sizeof (struct sockaddr_in6);
- }
- else if (clt_addr.sin6.sin6_port != 0)
+ &clt_addr.sin6.sin6_addr) == 1 &&
+ !IN6_IS_ADDR_LOOPBACK(&clt_addr.sin6.sin6_addr))
{
- if (IN6_IS_ADDR_UNSPECIFIED(&clt_addr.sin6.sin6_addr))
- clt_addr.sin6.sin6_addr = in6addr_any;
clt_bind = TRUE;
socksize = sizeof (struct sockaddr_in6);
}
@@ -1721,7 +1751,7 @@ makeconnection(host, port, mci, e)
*/
# if NAMED_BIND
- h_errno = 0;
+ SM_SET_H_ERRNO(0);
# endif /* NAMED_BIND */
errno = 0;
memset(&CurHostAddr, '\0', sizeof CurHostAddr);
@@ -2396,10 +2426,8 @@ myhostname(hostbuf, size)
{
register struct hostent *hp;
- if (gethostname(hostbuf, size) < 0)
- {
+ if (gethostname(hostbuf, size) < 0 || hostbuf[0] == '\0')
(void) strlcpy(hostbuf, "localhost", size);
- }
hp = sm_gethostbyname(hostbuf, InetMode);
if (hp == NULL)
return NULL;
@@ -3045,7 +3073,7 @@ host_map_lookup(map, name, av, statp)
: s->s_namecanon.nc_cname);
errno = s->s_namecanon.nc_errno;
# if NAMED_BIND
- h_errno = s->s_namecanon.nc_herrno;
+ SM_SET_H_ERRNO(s->s_namecanon.nc_herrno);
# endif /* NAMED_BIND */
*statp = s->s_namecanon.nc_stat;
if (*statp == EX_TEMPFAIL)
@@ -3221,6 +3249,8 @@ myhostname(hostbuf, size)
fixcrlf(hostbuf, TRUE);
(void) fclose(f);
}
+ if (hostbuf[0] == '\0')
+ (void) strlcpy(hostbuf, "localhost", size);
return NULL;
}
/*
diff --git a/contrib/sendmail/src/deliver.c b/contrib/sendmail/src/deliver.c
index 440b1db..689ceeb 100644
--- a/contrib/sendmail/src/deliver.c
+++ b/contrib/sendmail/src/deliver.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -12,7 +12,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: deliver.c,v 8.600.2.1.2.56 2000/12/19 01:16:12 gshapiro Exp $";
+static char id[] = "@(#)$Id: deliver.c,v 8.600.2.1.2.66 2001/02/25 23:30:35 gshapiro Exp $";
#endif /* ! lint */
#include <sendmail.h>
@@ -1132,7 +1132,7 @@ deliver(e, firstto)
if (*mvp == NULL)
{
- /* running SMTP */
+ /* running LMTP or SMTP */
#if SMTP
clever = TRUE;
*pvp = NULL;
@@ -1142,6 +1142,14 @@ deliver(e, firstto)
return EX_SOFTWARE;
#endif /* SMTP */
}
+ else if (bitnset(M_LMTP, m->m_flags))
+ {
+ /* not running LMTP */
+ sm_syslog(LOG_ERR, NULL,
+ "Warning: mailer %s: LMTP flag (F=z) turned off",
+ m->m_name);
+ clrbitn(M_LMTP, m->m_flags);
+ }
/*
** At this point *mvp points to the argument with $u. We
@@ -1235,7 +1243,7 @@ deliver(e, firstto)
continue;
}
#if NAMED_BIND
- h_errno = 0;
+ SM_SET_H_ERRNO(0);
#endif /* NAMED_BIND */
ovr = TRUE;
@@ -1498,7 +1506,7 @@ deliver(e, firstto)
}
errno = 0;
#if NAMED_BIND
- h_errno = 0;
+ SM_SET_H_ERRNO(0);
#endif /* NAMED_BIND */
CurHostName = NULL;
@@ -2267,7 +2275,7 @@ reconnect: /* after switching to an authenticated connection */
!DONE_STARTTLS(mci->mci_flags))
{
int olderrors;
- bool hasdot;
+ int dotpos;
bool usetls;
bool saveQuickAbort = QuickAbort;
bool saveSuprErrs = SuprErrs;
@@ -2275,6 +2283,7 @@ reconnect: /* after switching to an authenticated connection */
# if _FFR_TLS_CLT1
char *p;
# endif /* _FFR_TLS_CLT1 */
+ char *srvname;
extern SOCKADDR CurHostAddr;
rcode = EX_OK;
@@ -2296,11 +2305,25 @@ reconnect: /* after switching to an authenticated connection */
}
# endif /* _FFR_TLS_CLT1 */
- hasdot = CurHostName[strlen(CurHostName) - 1] == '.';
- if (hasdot)
- CurHostName[strlen(CurHostName) - 1] = '\0';
+ if (mci->mci_host != NULL)
+ {
+ srvname = mci->mci_host;
+ dotpos = strlen(srvname) - 1;
+ if (dotpos >= 0)
+ {
+ if (srvname[dotpos] == '.')
+ srvname[dotpos] = '\0';
+ else
+ dotpos = -1;
+ }
+ }
+ else
+ {
+ srvname = "";
+ dotpos = -1;
+ }
define(macid("{server_name}", NULL),
- newstr(CurHostName), e);
+ newstr(srvname), e);
if (CurHostAddr.sa.sa_family != 0)
define(macid("{server_addr}", NULL),
newstr(anynet_ntoa(&CurHostAddr)), e);
@@ -2314,7 +2337,7 @@ reconnect: /* after switching to an authenticated connection */
olderrors = Errors;
QuickAbort = FALSE;
SuprErrs = TRUE;
- if (rscheck("try_tls", CurHostName, NULL,
+ if (rscheck("try_tls", srvname, NULL,
e, TRUE, FALSE, 8, host) != EX_OK
|| Errors > olderrors)
usetls = FALSE;
@@ -2323,9 +2346,9 @@ reconnect: /* after switching to an authenticated connection */
# endif /* _FFR_TLS_O_T */
}
- /* undo change of CurHostName */
- if (hasdot)
- CurHostName[strlen(CurHostName)] = '.';
+ /* undo change of srvname */
+ if (dotpos >= 0)
+ srvname[dotpos] = '.';
if (usetls)
{
if ((rcode = starttls(m, mci, e)) == EX_OK)
@@ -2562,7 +2585,7 @@ do_transfer:
rcode = mci->mci_exitstat;
errno = mci->mci_errno;
#if NAMED_BIND
- h_errno = mci->mci_herrno;
+ SM_SET_H_ERRNO(mci->mci_herrno);
#endif /* NAMED_BIND */
if (rcode == EX_OK)
{
@@ -2593,6 +2616,18 @@ do_transfer:
/* get the exit status */
rcode = endmailer(mci, e, pv);
+ if (rcode == EX_TEMPFAIL &&
+ SmtpError[0] == '\0')
+ {
+ /*
+ ** Need an e_message for mailq display.
+ ** We set SmtpError as
+ */
+
+ snprintf(SmtpError, sizeof SmtpError,
+ "%s mailer (%s) exited with EX_TEMPFAIL",
+ m->m_name, m->m_mailer);
+ }
}
else
#if SMTP
@@ -3345,7 +3380,7 @@ giveresponse(status, dsn, m, mci, ctladdr, xstart, e)
}
errno = 0;
#if NAMED_BIND
- h_errno = 0;
+ SM_SET_H_ERRNO(0);
#endif /* NAMED_BIND */
}
/*
@@ -5228,6 +5263,8 @@ endtls(ssl, side)
SSL *ssl;
char *side;
{
+ int ret = EX_OK;
+
if (ssl != NULL)
{
int r;
@@ -5238,7 +5275,7 @@ endtls(ssl, side)
sm_syslog(LOG_WARNING, NOQID,
"SSL_shutdown %s failed: %d",
side, r);
- return EX_SOFTWARE;
+ ret = EX_SOFTWARE;
}
else if (r == 0)
{
@@ -5246,12 +5283,12 @@ endtls(ssl, side)
sm_syslog(LOG_WARNING, NOQID,
"SSL_shutdown %s not done",
side);
- return EX_SOFTWARE;
+ ret = EX_SOFTWARE;
}
SSL_free(ssl);
ssl = NULL;
}
- return EX_OK;
+ return ret;
}
# endif /* STARTTLS */
#endif /* SMTP */
diff --git a/contrib/sendmail/src/domain.c b/contrib/sendmail/src/domain.c
index 39126dd..18a092b 100644
--- a/contrib/sendmail/src/domain.c
+++ b/contrib/sendmail/src/domain.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1986, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -15,9 +15,9 @@
#ifndef lint
# if NAMED_BIND
-static char id[] = "@(#)$Id: domain.c,v 8.114.6.1.2.6 2000/12/19 02:50:33 gshapiro Exp $ (with name server)";
+static char id[] = "@(#)$Id: domain.c,v 8.114.6.1.2.8 2001/02/12 21:40:19 gshapiro Exp $ (with name server)";
# else /* NAMED_BIND */
-static char id[] = "@(#)$Id: domain.c,v 8.114.6.1.2.6 2000/12/19 02:50:33 gshapiro Exp $ (without name server)";
+static char id[] = "@(#)$Id: domain.c,v 8.114.6.1.2.8 2001/02/12 21:40:19 gshapiro Exp $ (without name server)";
# endif /* NAMED_BIND */
#endif /* ! lint */
@@ -356,7 +356,7 @@ punt:
if (TryNullMXList)
{
- h_errno = 0;
+ SM_SET_H_ERRNO(0);
errno = 0;
h = sm_gethostbyname(host, AF_INET);
if (h == NULL)
@@ -370,7 +370,7 @@ punt:
return -1;
}
# if NETINET6
- h_errno = 0;
+ SM_SET_H_ERRNO(0);
errno = 0;
h = sm_gethostbyname(host, AF_INET6);
if (h == NULL &&
@@ -752,7 +752,7 @@ cnameloop:
** broken.
*/
- h_errno = TRY_AGAIN;
+ SM_SET_H_ERRNO(TRY_AGAIN);
*statp = EX_TEMPFAIL;
/*
@@ -769,18 +769,22 @@ cnameloop:
*/
#if _FFR_WORKAROUND_BROKEN_NAMESERVERS
- /*
- ** Only return if not TRY_AGAIN as an
- ** attempt with a different qtype may
- ** succeed (res_querydomain() calls
- ** res_query() calls res_send() which
- ** sets errno to ETIMEDOUT if the
- ** nameservers could be contacted but
- ** didn't give an answer).
- */
+ if (WorkAroundBrokenAAAA)
+ {
+ /*
+ ** Only return if not TRY_AGAIN as an
+ ** attempt with a different qtype may
+ ** succeed (res_querydomain() calls
+ ** res_query() calls res_send() which
+ ** sets errno to ETIMEDOUT if the
+ ** nameservers could be contacted but
+ ** didn't give an answer).
+ */
- if (qtype != T_ANY && errno != ETIMEDOUT)
- return FALSE;
+ if (qtype != T_ANY &&
+ errno != ETIMEDOUT)
+ return FALSE;
+ }
#else /* _FFR_WORKAROUND_BROKEN_NAMESERVERS */
if (qtype != T_ANY)
return FALSE;
@@ -931,7 +935,7 @@ cnameloop:
host);
CurEnv->e_message = newstr(ebuf);
}
- h_errno = NO_RECOVERY;
+ SM_SET_H_ERRNO(NO_RECOVERY);
*statp = EX_CONFIG;
return FALSE;
}
diff --git a/contrib/sendmail/src/macro.c b/contrib/sendmail/src/macro.c
index 1a32182..70e18e4 100644
--- a/contrib/sendmail/src/macro.c
+++ b/contrib/sendmail/src/macro.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -12,7 +12,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: macro.c,v 8.40.16.7 2000/10/09 15:49:06 gshapiro Exp $";
+static char id[] = "@(#)$Id: macro.c,v 8.40.16.9 2001/02/22 01:16:55 gshapiro Exp $";
#endif /* ! lint */
#include <sendmail.h>
@@ -295,6 +295,8 @@ macvalue(n, e)
if (p != NULL)
return p;
+ if (e == e->e_parent)
+ break;
e = e->e_parent;
}
return NULL;
diff --git a/contrib/sendmail/src/main.c b/contrib/sendmail/src/main.c
index 5097b58..bf976e0 100644
--- a/contrib/sendmail/src/main.c
+++ b/contrib/sendmail/src/main.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 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 @@
#ifndef lint
static char copyright[] =
-"@(#) Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.\n\
+"@(#) Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.\n\
All rights reserved.\n\
Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.\n\
Copyright (c) 1988, 1993\n\
@@ -21,7 +21,7 @@ static char copyright[] =
#endif /* ! lint */
#ifndef lint
-static char id[] = "@(#)$Id: main.c,v 8.485.4.38 2000/12/19 02:50:33 gshapiro Exp $";
+static char id[] = "@(#)$Id: main.c,v 8.485.4.44 2001/02/08 14:06:55 ca Exp $";
#endif /* ! lint */
#define _DEFINE
@@ -1062,7 +1062,8 @@ main(argc, argv, envp)
/* set up the $=m class now, after .cf has a chance to redefine $m */
expand("\201m", jbuf, sizeof jbuf, CurEnv);
- setclass('m', jbuf);
+ if (jbuf[0] != '\0')
+ setclass('m', jbuf);
/* probe interfaces and locate any additional names */
if (!DontProbeInterfaces)
@@ -1231,8 +1232,10 @@ main(argc, argv, envp)
/* full names can't have newlines */
if (strchr(FullName, '\n') != NULL)
{
- FullName = full = newstr(denlstring(FullName, TRUE, TRUE));
+ full = newstr(denlstring(FullName, TRUE, TRUE));
+ FullName = full;
}
+
/* check for characters that may have to be quoted */
if (!rfc822_string(FullName))
{
@@ -1241,6 +1244,7 @@ main(argc, argv, envp)
** as a comment so crackaddr() doesn't destroy
** the name portion of the address.
*/
+
FullName = addquotes(FullName);
if (full != NULL)
free(full);
@@ -1295,10 +1299,13 @@ main(argc, argv, envp)
/* our name for SMTP codes */
expand("\201j", jbuf, sizeof jbuf, CurEnv);
- MyHostName = jbuf;
- if (strchr(jbuf, '.') == NULL)
+ if (jbuf[0] == '\0')
+ MyHostName = newstr("localhost");
+ else
+ MyHostName = jbuf;
+ if (strchr(MyHostName, '.') == NULL)
message("WARNING: local host name (%s) is not qualified; fix $j in config file",
- jbuf);
+ MyHostName);
/* make certain that this name is part of the $=w class */
setclass('w', MyHostName);
@@ -1855,7 +1862,7 @@ main(argc, argv, envp)
}
else
p = newstr(fv);
- CurEnv->e_auth_param = newstr(xtextify(p, NULL));
+ CurEnv->e_auth_param = newstr(xtextify(p, "="));
}
}
if (macvalue('s', CurEnv) == NULL)
@@ -1866,6 +1873,7 @@ main(argc, argv, envp)
CurEnv->e_to = NULL;
CurEnv->e_flags |= EF_GLOBALERRS;
HoldErrs = FALSE;
+ SuperSafe = FALSE;
usrerr("Recipient names must be specified");
/* collect body for UUCP return */
diff --git a/contrib/sendmail/src/map.c b/contrib/sendmail/src/map.c
index 8fb0cfd..4a10c81 100644
--- a/contrib/sendmail/src/map.c
+++ b/contrib/sendmail/src/map.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1992, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1992, 1993
@@ -12,7 +12,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: map.c,v 8.414.4.34 2000/12/18 18:00:43 ca Exp $";
+static char id[] = "@(#)$Id: map.c,v 8.414.4.39 2001/02/22 18:56:22 gshapiro Exp $";
#endif /* ! lint */
#include <sendmail.h>
@@ -52,7 +52,7 @@ static bool db_map_open __P((MAP *, int, char *, DBTYPE, DB_INFO *));
static bool db_map_open __P((MAP *, int, char *, DBTYPE, void **));
# endif /* DB_VERSION_MAJOR > 2 */
#endif /* NEWDB */
-static bool extract_canonname __P((char *, char *, char[], int));
+static bool extract_canonname __P((char *, char *, char *, char[], int));
#ifdef LDAPMAP
static void ldapmap_clear __P((LDAPMAP_STRUCT *));
static STAB *ldapmap_findconn __P((LDAPMAP_STRUCT *));
@@ -767,11 +767,10 @@ getcanonname(host, hbsize, trymx)
#if NAMED_BIND
if (got_tempfail)
- h_errno = TRY_AGAIN;
+ SM_SET_H_ERRNO(TRY_AGAIN);
else
- h_errno = HOST_NOT_FOUND;
+ SM_SET_H_ERRNO(HOST_NOT_FOUND);
#endif /* NAMED_BIND */
-
return FALSE;
}
/*
@@ -779,6 +778,7 @@ getcanonname(host, hbsize, trymx)
**
** Parameters:
** name -- the name against which to match.
+** dot -- where to reinsert '.' to get FQDN
** line -- the /etc/hosts line.
** cbuf -- the location to store the result.
** cbuflen -- the size of cbuf.
@@ -789,8 +789,9 @@ getcanonname(host, hbsize, trymx)
*/
static bool
-extract_canonname(name, line, cbuf, cbuflen)
+extract_canonname(name, dot, line, cbuf, cbuflen)
char *name;
+ char *dot;
char *line;
char cbuf[];
int cbuflen;
@@ -819,6 +820,14 @@ extract_canonname(name, line, cbuf, cbuflen)
}
if (strcasecmp(name, p) == 0)
found = TRUE;
+ else if (dot != NULL)
+ {
+ /* try looking for the FQDN as well */
+ *dot = '.';
+ if (strcasecmp(name, p) == 0)
+ found = TRUE;
+ *dot = '\0';
+ }
}
if (found && strchr(cbuf, '.') == NULL)
{
@@ -1623,6 +1632,10 @@ db_map_open(map, mode, mapclassname, dbtype, openinfo)
ret = db->open(db, buf, NULL, dbtype, flags, DBMMODE);
if (ret != 0)
{
+#ifdef DB_OLD_VERSION
+ if (ret == DB_OLD_VERSION)
+ ret = EINVAL;
+#endif /* DB_OLD_VERSION */
(void) db->close(db, 0);
db = NULL;
}
@@ -2258,7 +2271,7 @@ nis_getcanonname(name, hbsize, statp)
*statp = EX_UNAVAILABLE;
return FALSE;
}
- shorten_hostname(nbuf);
+ (void) shorten_hostname(nbuf);
keylen = strlen(nbuf);
if (yp_domain == NULL)
@@ -2302,13 +2315,13 @@ nis_getcanonname(name, hbsize, statp)
free(vp);
if (tTd(38, 44))
dprintf("got record `%s'\n", host_record);
- if (!extract_canonname(nbuf, host_record, cbuf, sizeof cbuf))
+ if (!extract_canonname(nbuf, NULL, host_record, cbuf, sizeof cbuf))
{
/* this should not happen, but.... */
*statp = EX_NOHOST;
return FALSE;
}
- if (hbsize < strlen(cbuf))
+ if (hbsize <= strlen(cbuf))
{
*statp = EX_UNAVAILABLE;
return FALSE;
@@ -2639,7 +2652,7 @@ nisplus_getcanonname(name, hbsize, statp)
return FALSE;
}
(void) strlcpy(nbuf, name, sizeof nbuf);
- shorten_hostname(nbuf);
+ (void) shorten_hostname(nbuf);
p = strchr(nbuf, '.');
if (p == NULL)
@@ -3937,7 +3950,7 @@ ldapmap_parseargs(map, args)
if ((ptr = strchr(p, ' ')) != NULL)
*ptr = '\0';
- syserr("Deref must be [never|always|search|find] not %s in map %s",
+ syserr("Deref must be [never|always|search|find] (not %s) in map %s",
p, map->map_mname);
if (ptr != NULL)
*ptr = ' ';
@@ -3972,7 +3985,7 @@ ldapmap_parseargs(map, args)
if ((ptr = strchr(p, ' ')) != NULL)
*ptr = '\0';
- syserr("Scope must be [base|one|sub] not %s in map %s",
+ syserr("Scope must be [base|one|sub] (not %s) in map %s",
p, map->map_mname);
if (ptr != NULL)
*ptr = ' ';
@@ -4044,7 +4057,7 @@ ldapmap_parseargs(map, args)
if ((ptr = strchr(p, ' ')) != NULL)
*ptr = '\0';
- syserr("Method for binding must be [none|simple|krbv4] not %s in map %s",
+ syserr("Method for binding must be [none|simple|krbv4] (not %s) in map %s",
p, map->map_mname);
if (ptr != NULL)
*ptr = ' ';
@@ -4312,6 +4325,7 @@ void
ldapmap_set_defaults(spec)
char *spec;
{
+ STAB *class;
MAP map;
/* Allocate and set the default values */
@@ -4320,7 +4334,17 @@ ldapmap_set_defaults(spec)
ldapmap_clear(LDAPDefaults);
memset(&map, '\0', sizeof map);
+
+ /* look up the class */
+ class = stab("ldap", ST_MAPCLASS, ST_FIND);
+ if (class == NULL)
+ {
+ syserr("readcf: LDAPDefaultSpec: class ldap not available");
+ return;
+ }
+ map.map_class = &class->s_mapclass;
map.map_db1 = (ARBPTR_T) LDAPDefaults;
+ map.map_mname = "O LDAPDefaultSpec";
(void) ldapmap_parseargs(&map, spec);
@@ -5412,7 +5436,7 @@ ni_getcanonname(name, hbsize, statp)
*statp = EX_UNAVAILABLE;
return FALSE;
}
- shorten_hostname(nbuf);
+ (void) shorten_hostname(nbuf);
/* we only accept single token search key */
if (strchr(nbuf, '.'))
@@ -5832,6 +5856,7 @@ text_getcanonname(name, hbsize, statp)
int *statp;
{
bool found;
+ char *dot;
FILE *f;
char linebuf[MAXLINE];
char cbuf[MAXNAME + 1];
@@ -5846,7 +5871,7 @@ text_getcanonname(name, hbsize, statp)
return FALSE;
}
(void) strlcpy(nbuf, name, sizeof nbuf);
- shorten_hostname(nbuf);
+ dot = shorten_hostname(nbuf);
f = fopen(HostsFile, "r");
if (f == NULL)
@@ -5862,7 +5887,8 @@ text_getcanonname(name, hbsize, statp)
if (p != NULL)
*p = '\0';
if (linebuf[0] != '\0')
- found = extract_canonname(nbuf, linebuf, cbuf, sizeof cbuf);
+ found = extract_canonname(nbuf, dot, linebuf,
+ cbuf, sizeof cbuf);
}
(void) fclose(f);
if (!found)
diff --git a/contrib/sendmail/src/milter.c b/contrib/sendmail/src/milter.c
index a248090..0698573 100644
--- a/contrib/sendmail/src/milter.c
+++ b/contrib/sendmail/src/milter.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -9,7 +9,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: milter.c,v 8.50.4.41 2000/12/27 21:35:32 gshapiro Exp $";
+static char id[] = "@(#)$Id: milter.c,v 8.50.4.44 2001/01/23 19:43:57 gshapiro Exp $";
#endif /* ! lint */
#if _FFR_MILTER
@@ -261,7 +261,7 @@ milter_sysread(m, buf, sz, to, e)
}
curl += len;
- if (len == 0 || len >= sz)
+ if (len == 0 || curl >= sz)
break;
}
@@ -1810,7 +1810,11 @@ milter_send_command(m, command, data, sz, e, state)
case SMFIR_ACCEPT:
/* this filter is done with message/connection */
- m->mf_state = SMFS_DONE;
+ if (command == SMFIC_HELO ||
+ command == SMFIC_CONNECT)
+ m->mf_state = SMFS_CLOSABLE;
+ else
+ m->mf_state = SMFS_DONE;
break;
case SMFIR_CONTINUE:
@@ -2092,7 +2096,7 @@ milter_per_connection_check(e)
{
struct milter *m = InputFilters[i];
- if (m->mf_state == SMFS_DONE)
+ if (m->mf_state == SMFS_CLOSABLE)
milter_quit_filter(m, e);
}
}
@@ -2936,11 +2940,31 @@ milter_helo(helo, e, state)
ENVELOPE *e;
char *state;
{
+ int i;
char *response;
if (tTd(64, 10))
dprintf("milter_helo(%s)\n", helo);
+ /* HELO/EHLO can come after encryption is negotiated */
+ for (i = 0; InputFilters[i] != NULL; i++)
+ {
+ struct milter *m = InputFilters[i];
+
+ switch (m->mf_state)
+ {
+ case SMFS_INMSG:
+ /* abort in message filters */
+ milter_abort_filter(m, e);
+ /* FALLTHROUGH */
+
+ case SMFS_DONE:
+ /* reset done filters */
+ m->mf_state = SMFS_OPEN;
+ break;
+ }
+ }
+
response = milter_command(SMFIC_HELO, helo, strlen(helo) + 1,
MilterHeloMacros, e, state);
milter_per_connection_check(e);
diff --git a/contrib/sendmail/src/parseaddr.c b/contrib/sendmail/src/parseaddr.c
index fd4f34b..0a2d8ad 100644
--- a/contrib/sendmail/src/parseaddr.c
+++ b/contrib/sendmail/src/parseaddr.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -12,7 +12,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: parseaddr.c,v 8.234.4.9 2000/10/09 03:14:48 gshapiro Exp $";
+static char id[] = "@(#)$Id: parseaddr.c,v 8.234.4.11 2001/02/14 04:07:27 gshapiro Exp $";
#endif /* ! lint */
#include <sendmail.h>
@@ -2727,7 +2727,11 @@ rscheck(rwset, p1, p2, e, rmcomm, cnt, logl, host)
MapOpenErr = FALSE;
(void) rewrite(pvp, rsno, 0, e);
if (MapOpenErr)
- usrerrenh("4.3.0", "451 Temporary failure");
+ {
+ usrerrenh("4.3.0", "451 Temporary failure");
+ rstat = EX_TEMPFAIL;
+ goto finis;
+ }
if (pvp[0] == NULL || (pvp[0][0] & 0377) != CANONNET ||
pvp[1] == NULL || (strcmp(pvp[1], "error") != 0 &&
diff --git a/contrib/sendmail/src/queue.c b/contrib/sendmail/src/queue.c
index 590aed9..f94498e 100644
--- a/contrib/sendmail/src/queue.c
+++ b/contrib/sendmail/src/queue.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -16,9 +16,9 @@
#ifndef lint
# if QUEUE
-static char id[] = "@(#)$Id: queue.c,v 8.343.4.38 2000/12/08 14:33:02 ca Exp $ (with queueing)";
+static char id[] = "@(#)$Id: queue.c,v 8.343.4.44 2001/02/22 00:55:35 ca Exp $ (with queueing)";
# else /* QUEUE */
-static char id[] = "@(#)$Id: queue.c,v 8.343.4.38 2000/12/08 14:33:02 ca Exp $ (without queueing)";
+static char id[] = "@(#)$Id: queue.c,v 8.343.4.44 2001/02/22 00:55:35 ca Exp $ (without queueing)";
# endif /* QUEUE */
#endif /* ! lint */
@@ -835,6 +835,7 @@ run_single_queue(queuedir, forkflag, verbose)
CurEnv = &QueueEnvelope;
e = newenvelope(&QueueEnvelope, CurEnv);
e->e_flags = BlankEnvelope.e_flags;
+ e->e_parent = NULL;
/* make sure we have disconnected from parent */
if (forkflag)
@@ -1558,7 +1559,7 @@ workcmpf1(a, b)
return b->w_lock - a->w_lock;
/* job priority */
- return a->w_pri - b->w_pri;
+ return workcmpf0(a, b);
}
/*
** WORKCMPF2 -- second compare function for ordering work based on host name.
@@ -1599,7 +1600,7 @@ workcmpf2(a, b)
return i;
/* job priority */
- return a->w_pri - b->w_pri;
+ return workcmpf0(a, b);
}
/*
** WORKCMPF3 -- simple submission-time-only compare function.
diff --git a/contrib/sendmail/src/readcf.c b/contrib/sendmail/src/readcf.c
index 942ca5b..fa99423 100644
--- a/contrib/sendmail/src/readcf.c
+++ b/contrib/sendmail/src/readcf.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -12,7 +12,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: readcf.c,v 8.382.4.31 2000/12/18 18:00:43 ca Exp $";
+static char id[] = "@(#)$Id: readcf.c,v 8.382.4.38 2001/02/17 00:05:12 geir Exp $";
#endif /* ! lint */
#include <sendmail.h>
@@ -844,6 +844,8 @@ fileclass(class, filename, fmt, safe, optional)
** T -- the mailer type (for DSNs)
** U -- the uid to run as
** W -- the time to wait at the end
+** m -- maximum messages per connection
+** / -- new root directory
** The first word is the canonical name of the mailer.
**
** Returns:
@@ -2059,7 +2061,9 @@ setoption(opt, val, safe, sticky, e)
if (val[0] == '\0')
HelpFile = "helpfile";
else
+ {
HelpFile = newstr(val);
+ }
break;
case 'h': /* maximum hop count */
@@ -2094,6 +2098,13 @@ setoption(opt, val, safe, sticky, e)
HasWildcardMX = !clearmode;
continue;
}
+#if _FFR_WORKAROUND_BROKEN_NAMESERVERS
+ if (sm_strcasecmp(q, "WorkAroundBrokenAAAA") == 0)
+ {
+ WorkAroundBrokenAAAA = !clearmode;
+ continue;
+ }
+#endif /* _FFR_WORKAROUND_BROKEN_NAMESERVERS */
for (rfp = ResolverFlags; rfp->rf_name != NULL; rfp++)
{
if (strcasecmp(q, rfp->rf_name) == 0)
@@ -2248,7 +2259,9 @@ setoption(opt, val, safe, sticky, e)
if (val[0] == '\0')
StatFile = "statistics";
else
+ {
StatFile = newstr(val);
+ }
break;
case 's': /* be super safe, even if expensive */
@@ -2549,7 +2562,9 @@ setoption(opt, val, safe, sticky, e)
case O_HSDIR: /* persistent host status directory */
if (val[0] != '\0')
+ {
HostStatDir = newstr(val);
+ }
break;
case O_SINGTHREAD: /* single thread deliveries (requires hsdir) */
diff --git a/contrib/sendmail/src/recipient.c b/contrib/sendmail/src/recipient.c
index d144792..258e7e2 100644
--- a/contrib/sendmail/src/recipient.c
+++ b/contrib/sendmail/src/recipient.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -12,7 +12,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: recipient.c,v 8.231.14.8 2000/09/14 23:32:27 gshapiro Exp $";
+static char id[] = "@(#)$Id: recipient.c,v 8.231.14.10 2001/02/14 04:07:30 gshapiro Exp $";
#endif /* ! lint */
#include <sendmail.h>
diff --git a/contrib/sendmail/src/sendmail.h b/contrib/sendmail/src/sendmail.h
index 9a6698a..ffb0b33 100644
--- a/contrib/sendmail/src/sendmail.h
+++ b/contrib/sendmail/src/sendmail.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -20,7 +20,7 @@
#ifdef _DEFINE
# define EXTERN
# ifndef lint
-static char SmailId[] = "@(#)$Id: sendmail.h,v 8.517.4.45 2000/12/28 23:46:44 gshapiro Exp $";
+static char SmailId[] = "@(#)$Id: sendmail.h,v 8.517.4.50 2001/02/22 18:56:24 gshapiro Exp $";
# endif /* ! lint */
#else /* _DEFINE */
# define EXTERN extern
@@ -152,6 +152,9 @@ static char SmailId[] = "@(#)$Id: sendmail.h,v 8.517.4.45 2000/12/28 23:46:44 gs
#ifndef INT32SZ
# define INT32SZ 4 /* size of a 32 bit integer in bytes */
#endif /* ! INT32SZ */
+#ifndef INADDR_LOOPBACK
+# define INADDR_LOOPBACK 0x7f000001 /* loopback address */
+#endif /* ! INADDR_LOOPBACK */
/*
** Error return from inet_addr(3), in case not defined in /usr/include.
@@ -1377,6 +1380,7 @@ struct milter
# define SMFS_OPEN 'O' /* connected to remote milter filter */
# define SMFS_INMSG 'M' /* currently servicing a message */
# define SMFS_DONE 'D' /* done with current message */
+# define SMFS_CLOSABLE 'Q' /* done with current connection */
# define SMFS_ERROR 'E' /* error state */
# define SMFS_READY 'R' /* ready for action */
@@ -1692,6 +1696,9 @@ EXTERN bool SingleThreadDelivery; /* single thread hosts on delivery */
EXTERN bool SuperSafe; /* be extra careful, even if expensive */
EXTERN bool SuprErrs; /* set if we are suppressing errors */
EXTERN bool TryNullMXList; /* if we are the best MX, try host directly */
+#if _FFR_WORKAROUND_BROKEN_NAMESERVERS
+EXTERN bool WorkAroundBrokenAAAA; /* some nameservers return SERVFAIL on AAAA queries */
+#endif /* _FFR_WORKAROUND_BROKEN_NAMESERVERS */
EXTERN bool UseErrorsTo; /* use Errors-To: header (back compat) */
EXTERN bool UseHesiod; /* using Hesiod -- interpret Hesiod errors */
EXTERN bool UseNameServer; /* using DNS -- interpret h_errno & MX RRs */
@@ -2063,7 +2070,7 @@ extern void setuserenv __P((const char *, const char *));
extern void settime __P((ENVELOPE *));
extern char *sfgets __P((char *, int, FILE *, time_t, char *));
extern char *shortenstring __P((const char *, int));
-extern void shorten_hostname __P((char []));
+extern char *shorten_hostname __P((char []));
extern bool shorten_rfc822_string __P((char *, size_t));
extern SIGFUNC_DECL sigusr1 __P((int));
extern SIGFUNC_DECL sighup __P((int));
diff --git a/contrib/sendmail/src/srvrsmtp.c b/contrib/sendmail/src/srvrsmtp.c
index 78443a8..72d22c0 100644
--- a/contrib/sendmail/src/srvrsmtp.c
+++ b/contrib/sendmail/src/srvrsmtp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -16,9 +16,9 @@
#ifndef lint
# if SMTP
-static char id[] = "@(#)$Id: srvrsmtp.c,v 8.471.2.2.2.66 2000/12/18 18:00:44 ca Exp $ (with SMTP)";
+static char id[] = "@(#)$Id: srvrsmtp.c,v 8.471.2.2.2.67 2001/01/07 19:31:05 gshapiro Exp $ (with SMTP)";
# else /* SMTP */
-static char id[] = "@(#)$Id: srvrsmtp.c,v 8.471.2.2.2.66 2000/12/18 18:00:44 ca Exp $ (without SMTP)";
+static char id[] = "@(#)$Id: srvrsmtp.c,v 8.471.2.2.2.67 2001/01/07 19:31:05 gshapiro Exp $ (without SMTP)";
# endif /* SMTP */
#endif /* ! lint */
@@ -1159,7 +1159,7 @@ smtp(nullserver, d_flags, e)
if (gothello)
{
usrerr("503 %s Duplicate HELO/EHLO",
- MyHostName);
+ MyHostName);
break;
}
diff --git a/contrib/sendmail/src/stats.c b/contrib/sendmail/src/stats.c
index 880f3d9..e03de5f 100644
--- a/contrib/sendmail/src/stats.c
+++ b/contrib/sendmail/src/stats.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -12,7 +12,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: stats.c,v 8.36.14.3 2000/09/17 17:04:27 gshapiro Exp $";
+static char id[] = "@(#)$Id: stats.c,v 8.36.14.5 2001/02/14 04:07:30 gshapiro Exp $";
#endif /* ! lint */
#include <sendmail.h>
diff --git a/contrib/sendmail/src/udb.c b/contrib/sendmail/src/udb.c
index 91d03f1..9b8ccd0 100644
--- a/contrib/sendmail/src/udb.c
+++ b/contrib/sendmail/src/udb.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-1999, 2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -15,9 +15,9 @@
#ifndef lint
# if USERDB
-static char id[] = "@(#)$Id: udb.c,v 8.111 1999/11/16 02:04:04 gshapiro Exp $ (with USERDB)";
+static char id[] = "@(#)$Id: udb.c,v 8.111.16.1 2001/01/04 18:18:37 gshapiro Exp $ (with USERDB)";
# else /* USERDB */
-static char id[] = "@(#)$Id: udb.c,v 8.111 1999/11/16 02:04:04 gshapiro Exp $ (without USERDB)";
+static char id[] = "@(#)$Id: udb.c,v 8.111.16.1 2001/01/04 18:18:37 gshapiro Exp $ (without USERDB)";
# endif /* USERDB */
#endif /* ! lint */
@@ -1011,6 +1011,10 @@ _udbx_init(e)
0644);
if (ret != 0)
{
+#ifdef DB_OLD_VERSION
+ if (ret == DB_OLD_VERSION)
+ ret = EINVAL;
+#endif /* DB_OLD_VERSION */
(void) up->udb_dbp->close(up->udb_dbp, 0);
up->udb_dbp = NULL;
}
diff --git a/contrib/sendmail/src/usersmtp.c b/contrib/sendmail/src/usersmtp.c
index bfce56a..83034dc 100644
--- a/contrib/sendmail/src/usersmtp.c
+++ b/contrib/sendmail/src/usersmtp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -15,9 +15,9 @@
#ifndef lint
# if SMTP
-static char id[] = "@(#)$Id: usersmtp.c,v 8.245.4.18 2000/12/20 16:36:11 ca Exp $ (with SMTP)";
+static char id[] = "@(#)$Id: usersmtp.c,v 8.245.4.24 2001/02/21 00:59:09 gshapiro Exp $ (with SMTP)";
# else /* SMTP */
-static char id[] = "@(#)$Id: usersmtp.c,v 8.245.4.18 2000/12/20 16:36:11 ca Exp $ (without SMTP)";
+static char id[] = "@(#)$Id: usersmtp.c,v 8.245.4.24 2001/02/21 00:59:09 gshapiro Exp $ (without SMTP)";
# endif /* SMTP */
#endif /* ! lint */
@@ -844,6 +844,7 @@ safesaslfile(context, file)
if (file == NULL || *file == '\0')
return SASL_OK;
+
sff = SFF_SAFEDIRPATH|SFF_NOWLINK|SFF_NOGWFILES|SFF_NOWWFILES|SFF_ROOTOK;
if ((p = strrchr(file, '/')) == NULL)
p = file;
@@ -873,12 +874,13 @@ safesaslfile(context, file)
}
# endif /* SASL <= 10515 */
- if ((r = safefile(file, RunAsUid, RunAsGid, RunAsUserName, sff,
+ p = file;
+ if ((r = safefile(p, RunAsUid, RunAsGid, RunAsUserName, sff,
S_IRUSR, NULL)) == 0)
return SASL_OK;
if (LogLevel >= 11 || (r != ENOENT && LogLevel >= 9))
sm_syslog(LOG_WARNING, NOQID, "error: safesasl(%s) failed: %s",
- file, errstring(r));
+ p, errstring(r));
return SASL_CONTINUE;
}
@@ -1528,7 +1530,7 @@ smtpmailfrom(m, mci, e)
else
{
smtpmessage("MAIL From:<@%s%c%s>%s", m, mci, MyHostName,
- *bufp == '@' ? ',' : ':', bufp, optbuf);
+ *bufp == '@' ? ',' : ':', bufp, optbuf);
}
SmtpPhase = mci->mci_phase = "client MAIL";
sm_setproctitle(TRUE, e, "%s %s: %s", qid_printname(e),
@@ -1943,6 +1945,8 @@ smtpdata(m, mci, e)
else
r = 4;
e->e_statmsg = newstr(&SmtpReplyBuffer[r]);
+ SmtpPhase = mci->mci_phase = "idle";
+ sm_setproctitle(TRUE, e, "%s: %s", CurHostName, mci->mci_phase);
if (rstat != EX_PROTOCOL)
return rstat;
if (LogLevel > 1)
@@ -2116,6 +2120,17 @@ smtpquit(m, mci, e)
}
/*
** SMTPRSET -- send a RSET (reset) command
+**
+** Parameters:
+** m -- a pointer to the mailer.
+** mci -- the mailer connection information.
+** e -- the current envelope.
+**
+** Returns:
+** none.
+**
+** Side Effects:
+** closes the connection if there is no reply to RSET.
*/
void
@@ -2154,6 +2169,15 @@ smtprset(m, mci, e)
}
/*
** SMTPPROBE -- check the connection state
+**
+** Parameters:
+** mci -- the mailer connection information.
+**
+** Returns:
+** none.
+**
+** Side Effects:
+** closes the connection if there is no reply to RSET.
*/
int
diff --git a/contrib/sendmail/src/util.c b/contrib/sendmail/src/util.c
index e71627f..6b301cb 100644
--- a/contrib/sendmail/src/util.c
+++ b/contrib/sendmail/src/util.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -12,7 +12,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: util.c,v 8.225.2.1.2.15 2000/10/18 23:46:07 ca Exp $";
+static char id[] = "@(#)$Id: util.c,v 8.225.2.1.2.19 2001/02/22 18:56:24 gshapiro Exp $";
#endif /* ! lint */
#include <sendmail.h>
@@ -497,7 +497,8 @@ log_sendmail_pid(e)
pidf = safefopen(pidpath, O_WRONLY|O_TRUNC, 0644, sff);
if (pidf == NULL)
{
- sm_syslog(LOG_ERR, NOQID, "unable to write %s", pidpath);
+ sm_syslog(LOG_ERR, NOQID, "unable to write %s: %s",
+ pidpath, errstring(errno));
}
else
{
@@ -1785,10 +1786,10 @@ printit:
** host -- the host to shorten (stripped in place).
**
** Returns:
-** none.
+** place where string was trunacted, NULL if not truncated.
*/
-void
+char *
shorten_hostname(host)
char host[];
{
@@ -1808,7 +1809,7 @@ shorten_hostname(host)
/* see if there is any domain at all -- if not, we are done */
p = strchr(host, '.');
if (p == NULL)
- return;
+ return NULL;
/* yes, we have a domain -- see if it looks like us */
mydom = macvalue('m', CurEnv);
@@ -1817,7 +1818,11 @@ shorten_hostname(host)
i = strlen(++p);
if ((canon ? strcasecmp(p, mydom) : strncasecmp(p, mydom, i)) == 0 &&
(mydom[i] == '.' || mydom[i] == '\0'))
+ {
*--p = '\0';
+ return p;
+ }
+ return NULL;
}
/*
** PROG_OPEN -- open a program for reading
diff --git a/contrib/sendmail/src/version.c b/contrib/sendmail/src/version.c
index 2499b10..60a42c6 100644
--- a/contrib/sendmail/src/version.c
+++ b/contrib/sendmail/src/version.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -12,7 +12,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: version.c,v 8.43.4.25 2000/12/29 18:22:18 gshapiro Exp $";
+static char id[] = "@(#)$Id: version.c,v 8.43.4.30 2001/02/27 19:22:31 gshapiro Exp $";
#endif /* ! lint */
-char Version[] = "8.11.2";
+char Version[] = "8.11.3";
diff --git a/contrib/sendmail/vacation/vacation.c b/contrib/sendmail/vacation/vacation.c
index 8b85c38..b58b87e 100644
--- a/contrib/sendmail/vacation/vacation.c
+++ b/contrib/sendmail/vacation/vacation.c
@@ -13,7 +13,7 @@
#ifndef lint
static char copyright[] =
-"@(#) Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.\n\
+"@(#) Copyright (c) 1999-2000 Sendmail, Inc. and its suppliers.\n\
All rights reserved.\n\
Copyright (c) 1983, 1987, 1993\n\
The Regents of the University of California. All rights reserved.\n\
@@ -21,7 +21,7 @@ static char copyright[] =
#endif /* ! lint */
#ifndef lint
-static char id[] = "@(#)$Id: vacation.c,v 8.68.4.15 2000/11/27 22:17:27 ca Exp $";
+static char id[] = "@(#)$Id: vacation.c,v 8.68.4.16 2001/02/14 05:02:21 gshapiro Exp $";
#endif /* ! lint */
#include <ctype.h>
OpenPOWER on IntegriCloud