summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1998-07-12 19:41:06 +0000
committermillert <millert@openbsd.org>1998-07-12 19:41:06 +0000
commita185d0f6e73eb0d714c904f6f97ec323dea98dd1 (patch)
treed504f0df433ec65897f43d77cb916c01aedee5cc
parentFix for the new fast PII-400 machines. This makes them work, and does not (diff)
downloadwireguard-openbsd-a185d0f6e73eb0d714c904f6f97ec323dea98dd1.tar.xz
wireguard-openbsd-a185d0f6e73eb0d714c904f6f97ec323dea98dd1.zip
something hosed the sendmail import; fix up by hand
-rw-r--r--usr.sbin/sendmail/FAQ13
-rw-r--r--usr.sbin/sendmail/KNOWNBUGS50
-rw-r--r--usr.sbin/sendmail/RELEASE_NOTES663
-rw-r--r--usr.sbin/sendmail/cf/README493
-rw-r--r--usr.sbin/sendmail/cf/cf/Makefile154
-rw-r--r--usr.sbin/sendmail/cf/cf/Makefile.dist41
-rw-r--r--usr.sbin/sendmail/cf/cf/chez.cs.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/clientproto.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/cs-hpux10.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/cs-hpux9.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/cs-osf1.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/cs-solaris2.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/cs-sunos4.1.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/cs-ultrix4.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/generic-bsd4.4.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/generic-hpux10.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/generic-hpux9.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/generic-nextstep3.3.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/generic-osf1.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/generic-solaris2.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/generic-sunos4.1.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/generic-ultrix4.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/huginn.cs.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/knecht.mc147
-rw-r--r--usr.sbin/sendmail/cf/cf/mail.cs.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/mail.eecs.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/mailspool.cs.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/python.cs.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/s2k-osf1.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/s2k-ultrix4.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/tcpproto.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/ucbarpa.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/ucbvax.mc34
-rw-r--r--usr.sbin/sendmail/cf/cf/uucpproto.mc37
-rw-r--r--usr.sbin/sendmail/cf/cf/vangogh.cs.mc34
-rw-r--r--usr.sbin/sendmail/cf/domain/Berkeley.EDU.m434
-rw-r--r--usr.sbin/sendmail/cf/domain/CS.Berkeley.EDU.m434
-rw-r--r--usr.sbin/sendmail/cf/domain/EECS.Berkeley.EDU.m434
-rw-r--r--usr.sbin/sendmail/cf/domain/S2K.Berkeley.EDU.m434
-rw-r--r--usr.sbin/sendmail/cf/domain/berkeley-only.m434
-rw-r--r--usr.sbin/sendmail/cf/domain/generic.m436
-rw-r--r--usr.sbin/sendmail/cf/feature/bestmx_is_local.m448
-rw-r--r--usr.sbin/sendmail/cf/feature/genericstable.m436
-rw-r--r--usr.sbin/sendmail/cf/feature/limited_masquerade.m434
-rw-r--r--usr.sbin/sendmail/cf/feature/local_procmail.m434
-rw-r--r--usr.sbin/sendmail/cf/feature/masquerade_entire_domain.m434
-rw-r--r--usr.sbin/sendmail/cf/feature/masquerade_envelope.m434
-rw-r--r--usr.sbin/sendmail/cf/feature/notsticky.m434
-rw-r--r--usr.sbin/sendmail/cf/feature/nullclient.m434
-rw-r--r--usr.sbin/sendmail/cf/feature/redirect.m434
-rw-r--r--usr.sbin/sendmail/cf/feature/smrsh.m439
-rw-r--r--usr.sbin/sendmail/cf/feature/stickyhost.m434
-rw-r--r--usr.sbin/sendmail/cf/feature/use_ct_file.m434
-rw-r--r--usr.sbin/sendmail/cf/feature/virtusertable.m436
-rw-r--r--usr.sbin/sendmail/cf/m4/cf.m434
-rw-r--r--usr.sbin/sendmail/cf/m4/cfhead.m440
-rw-r--r--usr.sbin/sendmail/cf/m4/nullrelay.m436
-rw-r--r--usr.sbin/sendmail/cf/m4/proto.m4594
-rw-r--r--usr.sbin/sendmail/cf/m4/version.m436
-rw-r--r--usr.sbin/sendmail/cf/mailer/cyrus.m415
-rw-r--r--usr.sbin/sendmail/cf/mailer/fax.m438
-rw-r--r--usr.sbin/sendmail/cf/mailer/local.m446
-rw-r--r--usr.sbin/sendmail/cf/mailer/mail11.m49
-rw-r--r--usr.sbin/sendmail/cf/mailer/phquery.m434
-rw-r--r--usr.sbin/sendmail/cf/mailer/pop.m434
-rw-r--r--usr.sbin/sendmail/cf/mailer/procmail.m434
-rw-r--r--usr.sbin/sendmail/cf/mailer/smtp.m436
-rw-r--r--usr.sbin/sendmail/cf/mailer/usenet.m434
-rw-r--r--usr.sbin/sendmail/cf/mailer/uucp.m434
-rw-r--r--usr.sbin/sendmail/cf/ostype/aix2.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/aix3.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/aix4.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/altos.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/amdahl-uts.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/aux.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/bsd4.3.m434
-rw-r--r--usr.sbin/sendmail/cf/ostype/bsd4.4.m434
-rw-r--r--usr.sbin/sendmail/cf/ostype/bsdi1.0.m434
-rw-r--r--usr.sbin/sendmail/cf/ostype/bsdi2.0.m434
-rw-r--r--usr.sbin/sendmail/cf/ostype/dgux.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/domainos.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/dynix3.2.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/gnuhurd.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/hpux10.m434
-rw-r--r--usr.sbin/sendmail/cf/ostype/hpux9.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/irix4.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/irix5.m437
-rw-r--r--usr.sbin/sendmail/cf/ostype/irix6.m437
-rw-r--r--usr.sbin/sendmail/cf/ostype/isc4.1.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/linux.m434
-rw-r--r--usr.sbin/sendmail/cf/ostype/maxion.m436
-rw-r--r--usr.sbin/sendmail/cf/ostype/mklinux.m434
-rw-r--r--usr.sbin/sendmail/cf/ostype/nextstep.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/osf1.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/powerux.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/ptx2.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/riscos4.5.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/sco-uw-2.1.m411
-rw-r--r--usr.sbin/sendmail/cf/ostype/sco3.2.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/sinix.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/solaris2.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/solaris2.ml.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/sunos3.5.m436
-rw-r--r--usr.sbin/sendmail/cf/ostype/sunos4.1.m436
-rw-r--r--usr.sbin/sendmail/cf/ostype/svr4.m435
-rw-r--r--usr.sbin/sendmail/cf/ostype/ultrix4.m436
-rw-r--r--usr.sbin/sendmail/cf/ostype/unknown.m434
-rw-r--r--usr.sbin/sendmail/cf/ostype/uxpds.m435
-rw-r--r--usr.sbin/sendmail/cf/sh/makeinfo.sh36
-rw-r--r--usr.sbin/sendmail/contrib/bitdomain.c2
-rw-r--r--usr.sbin/sendmail/contrib/bsdi.mc2
-rw-r--r--usr.sbin/sendmail/contrib/etrn.pl2
-rw-r--r--usr.sbin/sendmail/contrib/expn.pl8
-rw-r--r--usr.sbin/sendmail/contrib/re-mqueue.pl2
-rw-r--r--usr.sbin/sendmail/doc/changes/changes.me34
-rw-r--r--usr.sbin/sendmail/doc/op/op.me1505
-rw-r--r--usr.sbin/sendmail/mailstats/mailstats.810
-rw-r--r--usr.sbin/sendmail/mailstats/mailstats.c105
-rw-r--r--usr.sbin/sendmail/makemap/makemap.843
-rw-r--r--usr.sbin/sendmail/makemap/makemap.c364
-rw-r--r--usr.sbin/sendmail/praliases/praliases.173
-rw-r--r--usr.sbin/sendmail/praliases/praliases.c155
-rw-r--r--usr.sbin/sendmail/smrsh/smrsh.858
-rw-r--r--usr.sbin/sendmail/smrsh/smrsh.c35
-rw-r--r--usr.sbin/sendmail/src/Makefile14
-rw-r--r--usr.sbin/sendmail/src/TRACEFLAGS2
-rw-r--r--usr.sbin/sendmail/src/alias.c109
-rw-r--r--usr.sbin/sendmail/src/aliases.546
-rw-r--r--usr.sbin/sendmail/src/arpadate.c34
-rw-r--r--usr.sbin/sendmail/src/clock.c46
-rw-r--r--usr.sbin/sendmail/src/collect.c97
-rw-r--r--usr.sbin/sendmail/src/conf.c825
-rw-r--r--usr.sbin/sendmail/src/conf.h219
-rw-r--r--usr.sbin/sendmail/src/convtime.c34
-rw-r--r--usr.sbin/sendmail/src/daemon.c155
-rw-r--r--usr.sbin/sendmail/src/deliver.c460
-rw-r--r--usr.sbin/sendmail/src/domain.c76
-rw-r--r--usr.sbin/sendmail/src/envelope.c49
-rw-r--r--usr.sbin/sendmail/src/err.c59
-rw-r--r--usr.sbin/sendmail/src/headers.c75
-rw-r--r--usr.sbin/sendmail/src/ldap_map.h13
-rw-r--r--usr.sbin/sendmail/src/macro.c38
-rw-r--r--usr.sbin/sendmail/src/mailq.136
-rw-r--r--usr.sbin/sendmail/src/main.c299
-rw-r--r--usr.sbin/sendmail/src/makesendmail448
-rw-r--r--usr.sbin/sendmail/src/map.c942
-rw-r--r--usr.sbin/sendmail/src/mci.c111
-rw-r--r--usr.sbin/sendmail/src/mime.c56
-rw-r--r--usr.sbin/sendmail/src/newaliases.136
-rw-r--r--usr.sbin/sendmail/src/parseaddr.c197
-rw-r--r--usr.sbin/sendmail/src/pathnames.h32
-rw-r--r--usr.sbin/sendmail/src/queue.c216
-rw-r--r--usr.sbin/sendmail/src/readcf.c277
-rw-r--r--usr.sbin/sendmail/src/recipient.c158
-rw-r--r--usr.sbin/sendmail/src/safefile.c173
-rw-r--r--usr.sbin/sendmail/src/savemail.c73
-rw-r--r--usr.sbin/sendmail/src/sendmail.845
-rw-r--r--usr.sbin/sendmail/src/sendmail.h176
-rw-r--r--usr.sbin/sendmail/src/sendmail.hf10
-rw-r--r--usr.sbin/sendmail/src/snprintf.c2
-rw-r--r--usr.sbin/sendmail/src/srvrsmtp.c116
-rw-r--r--usr.sbin/sendmail/src/stab.c36
-rw-r--r--usr.sbin/sendmail/src/stats.c68
-rw-r--r--usr.sbin/sendmail/src/sysexits.c36
-rw-r--r--usr.sbin/sendmail/src/trace.c40
-rw-r--r--usr.sbin/sendmail/src/udb.c196
-rw-r--r--usr.sbin/sendmail/src/useful.h34
-rw-r--r--usr.sbin/sendmail/src/usersmtp.c103
-rw-r--r--usr.sbin/sendmail/src/util.c273
-rw-r--r--usr.sbin/sendmail/src/version.c36
170 files changed, 7659 insertions, 6933 deletions
diff --git a/usr.sbin/sendmail/FAQ b/usr.sbin/sendmail/FAQ
index 522e7c87ae1..b4cb2e6d177 100644
--- a/usr.sbin/sendmail/FAQ
+++ b/usr.sbin/sendmail/FAQ
@@ -1,11 +1,6 @@
The FAQ is no longer maintained with the sendmail release. It is
-posted regularly to comp.mail.sendmail, comp.mail.misc, comp.mail.smail,
-comp.answers, and news.answers, and can be obtained via anonymous FTP
-from ftp://rtfm.mit.edu/pub/usenet/news.answers/mail/sendmail-faq/.
-If you do not have access to anonymous FTP, you can retrieve it by
-sending email to mail-server@rtfm.mit.edu with the command "send
-usenet/news.answers/mail/sendmail-faq" in the message.
+available at http://www.sendmail.org/faq/ .
-An HTML version is also available at http://www.sendmail.org/faq/.
-
- --Eric Allman 19 June 1997
+A plain-text version of the questions only, with URLs referring to
+the answers, is posted to comp.mail.sendmail on the 10th and 25th
+of each month.
diff --git a/usr.sbin/sendmail/KNOWNBUGS b/usr.sbin/sendmail/KNOWNBUGS
index c334fa4bd0c..cd62b20eb12 100644
--- a/usr.sbin/sendmail/KNOWNBUGS
+++ b/usr.sbin/sendmail/KNOWNBUGS
@@ -1,7 +1,7 @@
K N O W N B U G S I N S E N D M A I L
- (for 8.8.6)
+ (for 8.9.0)
The following are bugs or deficiencies in sendmail that I am aware of
@@ -37,7 +37,7 @@ This list is not guaranteed to be complete.
* If you EXPN a list or user that has a program mailer, the output of
EXPN will include ``@local.host.name''. You can't actually mail to
- this address. It's not clear what the right behaviour is in this
+ this address. It's not clear what the right behavior is in this
circumstance.
* \231 considered harmful.
@@ -48,7 +48,7 @@ This list is not guaranteed to be complete.
* accept() problem on SVR4.
Apparently, the sendmail daemon loop (doing accept()s on the network)
- can get into a wierd state on SVR4; it starts logging ``SYSERR:
+ can get into a weird state on SVR4; it starts logging ``SYSERR:
getrequests: accept: Protocol Error''. The workaround is to kill
and restart the sendmail daemon. We don't have an SVR4 system at
Berkeley that carries more than token mail load, so I can't validate
@@ -73,7 +73,11 @@ This list is not guaranteed to be complete.
getrequests: accept: Connection timed out
"Connection timed out" is not documented as a valid return from
- accept(2) and this is believed to be a bug in the Linux kernel.
+ accept(2) and this was believed to be a bug in the Linux kernel.
+ Later information from the Linux kernel group states that Linux
+ 2.0 kernels follow RFC1122 while sendmail follows the original BSD
+ (now POSIX 1003.1g draft) specification. The 2.1.X and later kernels
+ will follow the POSIX draft.
* Excessive mailing list nesting can run out of file descriptors.
@@ -103,5 +107,41 @@ This list is not guaranteed to be complete.
account for the SMTP on-the-wire \r\n expansion. It probably doesn't
allow for 8->7 bit MIME conversions either.
+* Paths to programs being executed and the mode of program files are
+ not checked. Essentially, the RunProgramInUnsafeDirPath and
+ RunWritableProgram bits in the DontBlameSendmail option are always
+ set. This is not a problem if your system is well managed (that is,
+ if binaries and system directories are mode 755 instead of something
+ foolish like 777).
-(Version 8.25, last updated 6/13/97)
+* 8-bit data in GECOS field
+
+ If the GECOS (personal name) information in the passwd file contains
+ 8-bit characters, those characters can be included in the message
+ header, which can cause problems when sending SMTP to hosts that
+ only accept 7-bit characters.
+
+* 8->7 bit MIME conversion
+
+ When sendmail is doing 8->7 bit MIME conversions, and the message
+ contains certain MIME body types that cannot be converted to 7-bit,
+ sendmail will strip the message to 7-bit.
+
+* 7->8 bit MIME conversion
+
+ If a message that is encoded as 7-bit MIME is converted to 8-bit and
+ that message when decoded is illegal (e.g., because of long lines or
+ illegal characters), sendmail can produce an illegal message.
+
+* MIME encoded full name phrases in the From: header
+
+ If a full name phrase includes characters from MustQuoteChars, sendmail
+ will quote the entire full name phrase. If MustQuoteChars includes
+ characters which are not special characters according to STD 11 (RFC
+ 822), this quotation can interfere with MIME encoded full name phrases.
+ By default, sendmail includes the single quote character (') in
+ MustQuoteChars even though it is not listed as a special character in
+ STD 11.
+
+
+(Version 8.32, last updated 6/30/98)
diff --git a/usr.sbin/sendmail/RELEASE_NOTES b/usr.sbin/sendmail/RELEASE_NOTES
index b3e1a8b33d3..2b3475ffbcc 100644
--- a/usr.sbin/sendmail/RELEASE_NOTES
+++ b/usr.sbin/sendmail/RELEASE_NOTES
@@ -1,11 +1,616 @@
SENDMAIL RELEASE NOTES
- @(#)RELEASE_NOTES 8.8.8.4 (Berkeley) 10/24/97
+ @(#)RELEASE_NOTES 8.9.1.1 (Berkeley) 7/2/98
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.9.1/8.9.1 98/07/02
+ If both an OS specific site configuration file and a generic
+ site.config.m4 file existed, only the latter was used
+ instead of both. Problem noted by Geir Johannessen of
+ the Norwegian University of Science and Technology.
+ Fix segmentation fault while converting 8 bit to 7 bit MIME
+ multipart messages by trying to write to an unopened
+ file descriptor. Fix from Kari Hurtta of the Finnish
+ Meteorological Institute.
+ Do not assume Message: and Text: headers indicate the end of
+ the header area when parsing MIME headers. Problem noted
+ by Kari Hurtta of the Finnish Meteorological Institute.
+ Setting the confMAN#SRC Build variable would only effect the
+ installation commands. The man pages would still be
+ built with .0 extensions. Problem noted by Bryan
+ Costales of InfoBeat, Inc.
+ Installation of manual pages didn't honor the DESTDIR environment
+ variable. Problem noted by Bryan Costales of InfoBeat, Inc.
+ If the check_relay ruleset resolved to the discard mailer, messages
+ were still delivered. Problem noted by Mirek Luc of NASK.
+ Mail delivery to files would fail with an Operating System Error
+ if sendmail was not running as root, i.e. RunAsUser was set.
+ Problem noted by Leonard N. Zubkoff of Dandelion Digital.
+ Prevent MinQueueAge from interfering from queued items created
+ in the future, i.e. if the system clock was set ahead
+ and then back. Problem noted by Michael Miller of the
+ University of Natal, Pietermaritzburg.
+ Do not advertise ETRN support in ESTMP EHLO reply if noetrn is
+ set in the PrivacyFlags option. Fix from Ted Rule of
+ Flextech TV.
+ Log invalid persistent host status file lines instead of
+ bouncing the message. Problem noted by David Lindes of
+ DaveLtd Enterprises.
+ Move creation of empty sendmail.st file from installation to
+ compilation. Installation may be done from a read-only
+ mount. Fix from Bryan Costales of InfoBeat, Inc. and Ric
+ Anderson of the Oasis Research Center, Inc.
+ Enforce the maximum number of User Database entries limit. Problem
+ noted by Gary Buchanan of Credence Systems Inc.
+ Allow dead.letter files in root's home directory. Problem noted
+ by Anna Ullman of Sun Microsystems.
+ Program deliveries in forward files could be marked unsafe if
+ any directory listed in the ForwardPath option did not
+ exist. Problem noted by Jorg Bielak of Coastal Web Online.
+ Do not trust the length of the address structure returned by
+ gethostbyname(). Problem noted by Chris Evans of Oxford
+ University.
+ If the SIZE= MAIL From: ESMTP parameter is too large, use the
+ 5.3.4 DSN status code instead of 5.2.2. Similarly, for
+ non-local deliveries, if the message is larger than the
+ mailer maximum message size, use 5.3.4 instead of 5.2.3.
+ Suggested by Antony Bowesman of
+ Fujitsu/TeaWARE Mail/MIME System.
+ Portability:
+ Fix the check for an IP address reverse lookup for
+ use in $&{client_name} on 64 bit platforms.
+ From Gilles Gallot of Institut for Development
+ and Resources in Intensive Scientific computing.
+ BSD-OS uses .0 for man page extensions. From Jeff Polk
+ of BSDI.
+ DomainOS detection for Build. Also, version 10.4 and later
+ ship a unistd.h. Fixes from Takanobu Ishimura of
+ PICT Inc.
+ NeXT 4.x uses /usr/lib/man/cat for its man pages. From
+ J. P. McCann of E I A.
+ SCO 4.X and 5.X include NDBM support. From Vlado Potisk
+ of TEMPEST, Ltd.
+ CONFIG: Do not pass spoofed PTR results through resolver for
+ qualification. Problem noted by Michiel Boland of
+ Digital Valley Internet Professionals; fix from
+ Kari Hurtta of the Finnish Meteorological Institute.
+ CONFIG: Do not try to resolve non-DNS hostnames such as UUCP,
+ BITNET, and DECNET addresses for resolvable senders.
+ Problem noted by Alexander Litvin of Lucky Net Ltd.
+ CONFIG: Work around Sun's broken configuration which sends bounce
+ messages as coming from @@hostname instead of <>. LMTP
+ would not accept @@hostname.
+ OP.ME: Corrections to complex sendmail startup script from Rick
+ Troxel of the National Institutes of Health.
+ RMAIL: Do not install rmail by default, require 'make force-install'
+ as this rmail isn't the same as others. Suggested by
+ Kari Hurtta of the Finnish Meteorological Institute.
+
+8.9.0/8.9.0 98/05/19
+ SECURITY: To prevent users from reading files not normally
+ readable, sendmail will no longer open forward, :include:,
+ class, ErrorHeader, or HelpFile files located in unsafe
+ (i.e. group or world writable) directory paths. Sites
+ which need the ability to override security can use the
+ DontBlameSendmail option. See the README file for more
+ information.
+ SECURITY: Problems can occur on poorly managed systems, specifically,
+ if maps or alias files are in world writable directories.
+ This fixes the change added to 8.8.6 to prevent links in these
+ world writable directories.
+ SECURITY: Make sure ServiceSwitchFile option file is not a link if
+ it is in a world writable directory.
+ SECURITY: Never pass a tty to a mailer -- if a mailer can get at the
+ tty it may be able to push bytes back to the senders input.
+ Unfortunately this breaks -v mode. Problem noted by
+ Wietse Venema of the Global Security Analysis Lab at
+ IBM T.J. Watson Research.
+ SECURITY: Empty group list if DontInitGroups is set to true to
+ prevent program deliveries from picking up extra group
+ privileges. Problem reported by Wolfgang Ley of DFN-CERT.
+ SECURITY: The default value for DefaultUser is now set to the uid and
+ gid of the first existing user mailnull, sendmail, or daemon
+ that has a non-zero uid. If none of these exist, sendmail
+ reverts back to the old behavior of using uid 1 and gid 1.
+ This is a security problem for Linux which has chosen that
+ uid and gid for user bin instead of daemon. If DefaultUser
+ is set in the configuration file, that value overrides this
+ default.
+ SECURITY: Since 8.8.7, the check for non-setuid binaries
+ interfered with setting an alternate group id for the
+ RunAsUser option. Problem noted by Randall Winchester of
+ the University of Maryland.
+ Add support for Berkeley DB 2.X. Based on patch from John Kennedy
+ of Cal State University, Chico.
+ Remove support for OLD_NEWDB (pre-1.5 version of Berkeley DB). Users
+ which previously defined OLD_NEWDB=1 must now upgrade to the
+ current version of Berkeley DB.
+ Added support for regular expressions using the new map class regex.
+ From Jan Krueger of Unix-AG of University of Hannover.
+ Support for BIND 8.1.1's hesiod for hesiod maps and hesiod
+ UserDatabases from Randall Winchester of the University
+ of Maryland.
+ Allow any shell for user shell on program deliveries on V1
+ configurations for backwards compatibility on machines which
+ do not have getusershell(). Fix from John Beck of Sun
+ Microsystems.
+ On operating systems which change the process title by reusing the
+ argument vector memory, sendmail could corrupt memory if the
+ last argument was either "-q" or "-d". Problem noted by
+ Frank Langbein of the University of Stuttgart.
+ Support Local Mail Transfer Protocol (LMTP) between sendmail and
+ mail.local on the F=z flag.
+ Macro-expand the contents of the ErrMsgFile. Previously this was
+ only done if you had magic characters (0x81) to indicate
+ macro expansion. Now $x will be expanded. This means that
+ real dollar signs have to be backslash escaped.
+ TCP Wrappers expects "unknown" in the hostname argument if the
+ reverse DNS lookup for the incoming connection fails.
+ Problem noted by Randy Grimshaw of Syracuse University and
+ Wietse Venema of the Global Security Analysis Lab at
+ IBM T.J. Watson Research.
+ DSN success bounces generated from an invocation of sendmail -t
+ would be sent to both the sender and MAILER-DAEMON.
+ Problem noted by Claus Assmann of
+ Christian-Albrechts-University of Kiel.
+ Avoid "Error 0" messages on delivery mailers which exit with a
+ valid exit value such as EX_NOPERM. Fix from Andreas Luik
+ of ISA Informationssysteme GmbH.
+ Tokenize $&x expansions on right hand side of rules. This eliminates
+ the need to use tricks like $(dequote "" $&{client_name} $)
+ to cause the ${client_name} macro to be properly tokenized.
+ Add the MaxRecipientsPerMessage option: this limits the number of
+ recipients that will be accepted in a single SMTP
+ transaction. After this number is reached, sendmail
+ starts returning "452 Too many recipients" to all RCPT
+ commands. This can be used to limit the number of recipients
+ per envelope (in particular, to discourage use of the server
+ for spamming). Note: a better approach is to restrict
+ relaying entirely.
+ Fixed pointer initialization for LDAP lmap struct, fixed -s option
+ to ldapx map and added timeout for ldap_open call to
+ avoid hanging sendmail in the event of hung LDAP servers.
+ Patch from Booker Bense of Stanford University.
+ Allow multiple -qI, -qR, or -qS queue run limiters. For example,
+ '-qRfoo -qRbar' would deliver mail to recipients with foo or
+ bar in their address. Patch from Allan E Johannesen of
+ Worcester Polytechnic Institute.
+ The bestmx map will now return a list of the MX servers for a host if
+ passed a column delimiter via the -z map flag. This can be
+ used to check if the server is an MX server for the recipient
+ of a message. This can be used to help prevent relaying.
+ Patch from Mitchell Blank Jr of Exec-PC.
+ Mark failures for the *file* mailer and return bounce messages to the
+ sender for those failures.
+ Prevent bogus syslog timestamps on errors in sendmail.cf by
+ preserving the TZ environment variable until TimeZoneSpec
+ has been determined. Problem noted by Ralf Hildebrandt of
+ Technical University of Braunschweig. Patch from Per Hedeland
+ of Ericsson.
+ Print test input in address test mode when input is not from the tty
+ when the -v flag is given (i.e. sendmail -bt -v) to make
+ output easier to decipher. Problem noted by Aidan Nichol
+ of Procter & Gamble.
+ The LDAP map -s flag was not properly parsed and the error message
+ given included the remainder of the arguments instead of
+ solely the argument in error. Problem noted by Aidan Nichol
+ of Procter & Gamble.
+ New DontBlameSendmail option. This option allows administrators to
+ bypass some of sendmail's file security checks at the expense
+ of system security. This should only be used if you are
+ absolutely sure you know the consequences. The available
+ DontBlameSendmail options are:
+ Safe
+ AssumeSafeChown
+ ClassFileInUnsafeDirPath
+ ErrorHeaderInUnsafeDirPath
+ GroupWritableDirPathSafe
+ GroupWritableForwardFileSafe
+ GroupWritableIncludeFileSafe
+ GroupWritableAliasFile
+ HelpFileinUnsafeDirPath
+ WorldWritableAliasFile
+ ForwardFileInGroupWritableDirPath
+ IncludeFileInGroupWritableDirPath
+ ForwardFileInUnsafeDirPath
+ IncludeFileInUnsafeDirPath
+ ForwardFileInUnsafeDirPathSafe
+ IncludeFileInUnsafeDirPathSafe
+ MapInUnsafeDirPath
+ LinkedAliasFileInWritableDir
+ LinkedClassFileInWritableDir
+ LinkedForwardFileInWritableDir
+ LinkedIncludeFileInWritableDir
+ LinkedMapInWritableDir
+ LinkedServiceSwitchFileInWritableDir
+ FileDeliveryToHardLink
+ FileDeliveryToSymLink
+ WriteMapToHardLink
+ WriteMapToSymLink
+ WriteStatsToHardLink
+ WriteStatsToSymLink
+ RunProgramInUnsafeDirPath
+ RunWritableProgram
+ New DontProbeInterfaces option to turn off the inclusion of all the
+ interface names in $=w on startup. In particular, if you
+ have lots of virtual interfaces, this option will speed up
+ startup. However, unless you make other arrangements, mail
+ sent to those addresses will be bounced.
+ Automatically create alias databases if they don't exist and
+ AutoRebuildAliases is set.
+ Add PrivacyOptions=noetrn flag to disable the SMTP ETRN command.
+ Suggested by Christophe Wolfhugel of the Institut Pasteur.
+ Add PrivacyOptions=noverb flag to disable the SMTP VERB command.
+ When determining the client host name ($&{client_name} macro), do
+ a forward (A) DNS lookup on the result of the PTR lookup
+ and compare results. If they differ or if the PTR lookup
+ fails, &{client_name} will contain the IP address
+ surrounded by square brackets (e.g. [127.0.0.1]).
+ New map flag: -Tx appends "x" to lookups that return temporary failure
+ (i.e, it is like -ax for the temporary failure case, in
+ contrast to the success case).
+ New syntax to do limited checking of header syntax. A config line
+ of the form:
+ HHeader: $>Ruleset
+ causes the indicated Ruleset to be invoked on the Header
+ when read. This ruleset works like the check_* rulesets --
+ that is, it can reject mail on the basis of the contents.
+ Limit the size of the HELO/EHLO parameter to prevent spammers
+ from hiding their connection information in Received:
+ headers.
+ When SingleThreadDelivery is active, deliveries to locked hosts
+ are skipped. This will cause the delivering process to
+ try the next MX host or queue the message if no other MX
+ hosts are available. Suggested by Alexander Litvin.
+ The [FILE] mailer type now delivers to the file specified in the
+ A= equate of the mailer definition instead of $u. It also
+ obeys all of the F= mailer flags such as the MIME
+ 7/8 bit conversion flags. This is useful for defining
+ a mailer which delivers to the same file regardless of the
+ recipient (e.g. 'A=FILE /dev/null' to discard unwanted mail).
+ Do not assume the identity of a remote connection is root@localhost
+ if the remote connection closes the socket before the
+ remote identity can be queried.
+ Change semantics of the F=S mailer flag back to 8.7.5 behavior.
+ Some mailers, including procmail, require that the real
+ uid is left unchanged by sendmail. Problem noted by Per
+ Hedeland of Ericsson.
+ No longer is the src/obj*/Makefile selected from a large list -- it
+ is now generated using the information in BuildTools/OS/ --
+ some of the details are determined dynamically via
+ BuildTools/bin/configure.sh.
+ The other programs in the sendmail distribution -- mail.local,
+ mailstats, makemap, praliases, rmail, and smrsh -- now use
+ the new Build method which creates an operating system
+ specific Makefile using the information in BuildTools.
+ Make 4xx reply codes to the SMTP MAIL command be non-sticky (i.e.,
+ a failure on one message won't affect future messages to the
+ same host). This is necessary if the remote host sends
+ a 451 error if the domain of the sender does not resolve
+ as is common in anti-spam configurations. Problem noted
+ by Mitchell Blank Jr of Exec-PC.
+ New "discard" mailer for check_* rulesets and header checking
+ rulesets. If one of the above rulesets resolves to the
+ $#discard mailer, the commands will be accepted but the
+ message will be completely discarded after it is accepting.
+ This means that even if only one of the recipients
+ resolves to the $#discard mailer, none of the recipients
+ will receive the mail. Suggested by Brian Kantor.
+ All but the last cloned envelope of a split envelope were queued
+ instead of being delivered. Problem noted by John Caruso
+ of CNET: The Computer Network.
+ Fix deadlock situation in persistent host status file locking.
+ Syslog an error if a user forward file could not be read due to
+ an error. Patch from John Beck of Sun Microsystems.
+ Use the first name returned on machine lookups when canonifying a
+ hostname via NetInfo. Patch from Timm Wetzel of GWDG.
+ Clear the $&{client_addr}, $&{client_name}, and $&{client_port}
+ macros when delivering a bounce message to prevent
+ rejection by a check_compat ruleset which uses these macros.
+ Problem noted by Jens Hamisch of AgiX Internetservices GmbH.
+ If the check_relay ruleset resolves to the the error mailer, the
+ error in the $: portion of the resolved triplet is used
+ in the rejection message given to the remote machine.
+ Suggested by Scott Gifford of The Internet Ramp.
+ Set the $&{client_addr}, $&{client_name}, and $&{client_port} macros
+ before calling the check_relay ruleset. Suggested by Scott
+ Gifford of The Internet Ramp.
+ Sendmail would get a segmentation fault if a mailer exited with an
+ exit code of 79. Problem noted by Aaron Schrab of ExecPC
+ Internet. Fix from Christophe Wolfhugel of the Pasteur
+ Institute.
+ Separate snprintf/vsnprintf routines into separate file for use by
+ mail.local.
+ Allow multiple map lookups on right hand side, e.g.,
+ R$* $( host $1 $) $| $( passwd $1 $). Patch from
+ Christophe Wolfhugel of the Pasteur Institute.
+ Properly generate success DSN messages if requested for aliases
+ which have owner- aliases. Problem noted by Kari Hurtta
+ of the Finnish Meteorological Institute.
+ Properly display delayed-expansion macros ($&{macroname}) in
+ address test mode (-bt). Problem noted by Bryan Costales
+ of InfoBeat, Inc.
+ -qR could sometimes match names incorrectly. Problem noted by
+ Lutz Euler of Lavielle EDV Systemberatung GmbH & Co.
+ Include a magic number and version in the StatusFile for the
+ mailstats command.
+ Record the number of rejected and discarded messages in the
+ StatusFile for display by the mailstats command. Patch
+ from Randall Winchester of the University of Maryland.
+ IDENT returns where the OSTYPE field equals "OTHER" now list the
+ user portion as IDENT:username@site instead of
+ username@site to differentiate the two. Suggested by
+ Kari Hurtta of the Finnish Meteorological Institute.
+ Enforce timeout for LDAP queries. Patch from Per Hedeland of
+ Ericsson.
+ Change persistent host status filename substitution so '/' is
+ replaced by ':' instead of '|' to avoid clashes. Also
+ avoid clashes with hostnames with leading dots. Fix from
+ Mitchell Blank Jr. of Exec-PC.
+ If the system lock table is full, only attempt to create a new
+ queue entry five times before giving up. Previously, it
+ was attempted indefinitely which could cause the partition
+ to run out of inodes. Problem noted by Suzie Weigand of
+ Stratus Computer, Inc.
+ In verbose mode, warn if the sendmail.cf version is less than the
+ currently supported version.
+ Sorting for QueueSortOrder=host is now case insensitive. Patch
+ from Randall S. Winchester of the University of Maryland.
+ Properly quote a full name passed via the -F command line option,
+ the Full-Name: header, or the NAME environment variable if
+ it contains characters which must be quoted. Problem noted
+ by Kari Hurtta of the Finnish Meteorological Institute.
+ Avoid possible race condition that unlocked a mail job before
+ releasing the transcript file on systems that use flock(2).
+ In some cases, this might result in a "Transcript Unavailable"
+ message in error bounces.
+ Accept SMTP replies which contain only a reply code and no
+ accompanying text. Problem noted by Fernando Fraticelli of
+ Digital Equipment Corporation.
+ Portability:
+ AIX 4.1 uses int for SOCKADDR_LEN_T from Motonori Nakamura
+ of Kyoto University.
+ AIX 4.2 requires <userpw.h> before <usersec.h>. Patch from
+ Randall S. Winchester of the University of
+ Maryland.
+ AIX 4.3 from Valdis Kletnieks of Virginia Tech CNS.
+ CRAY T3E from Manu Mahonen of Center for Scientific Computing
+ in Finland.
+ Digital UNIX now uses statvfs for determining free
+ disk space. Patch from Randall S. Winchester of
+ the University of Maryland.
+ HP-UX 11.x from Richard Allen of Opin Kerfi HF and
+ Regis McEwen of Progress Software Corporation.
+ IRIX 64 bit fixes from Kari Hurtta of the Finnish
+ Meteorological Institute.
+ IRIX 6.2 configuration fix for mail.local from Michael Kyle
+ of CIC/Advanced Computing Laboratory.
+ IRIX 6.5 from Thomas H Jones II of SGI.
+ IRIX 6.X load average code from Bob Mende of SGI.
+ QNX from Glen McCready <glen@qnx.com>.
+ SCO 4.2 and 5.x use /usr/bin instead of /usr/ucb for links
+ to sendmail. Install with group bin instead of kmem
+ as kmem does not exist. From Guillermo Freige of
+ Gobernacion de la Pcia de Buenos Aires and Paul
+ Fischer of BTG, Inc.
+ SunOS 4.X does not include memmove(). Patch from
+ Per Hedeland of Ericsson.
+ SunOS 5.7 includes getloadavg() function for determining
+ load average. Patch from John Beck of Sun
+ Microsystems.
+ CONFIG: Increment version number of config file.
+ CONFIG: add DATABASE_MAP_TYPE to set the default type of database
+ map for the various maps. The default is hash. Patch from
+ Robert Harker of Harker Systems.
+ CONFIG: new confEBINDIR m4 variable for defining the executable
+ directory for certain programs.
+ CONFIG: new FEATURE(local_lmtp) to use the new LMTP support for
+ local mail delivery. By the default, /usr/libexec/mail.local
+ is used. This is expected to be the mail.local shipped
+ with 8.9 which is LMTP capable. The path is based on the
+ new confEBINDIR m4 variable.
+ CONFIG: Use confEBINDIR in determining path to smrsh for
+ FEATURE(smrsh). Note that this changes the default from
+ /usr/local/etc/smrsh to /usr/libexec/smrsh. To obtain the
+ old path for smrsh, use FEATURE(smrsh, /usr/local/etc/smrsh).
+ CONFIG: DOMAIN(generic) changes the default confFORWARD_PATH to
+ include $z/.forward.$w+$h and $z/.forward+$h which allow
+ the user to setup different .forward files for
+ user+detail addressing.
+ CONFIG: add confMAX_RCPTS_PER_MESSAGE, confDONT_PROBE_INTERFACES,
+ and confDONT_BLAME_SENDMAIL to set MaxRecipientsPerMessage,
+ DontProbeInterfaces, and DontBlameSendmail options.
+ CONFIG: by default do not allow relaying (that is, accepting mail
+ from outside your domain and sending it to another host
+ outside your domain).
+ CONFIG: new FEATURE(promiscuous_relay) to allow mail relaying from
+ any site to any site.
+ CONFIG: new FEATURE(relay_entire_domain) allows any host in your
+ domain as defined by the 'm' class ($=m) to relay.
+ CONFIG: new FEATURE(relay_based_on_MX) to allow relaying based on
+ the MX records of the host portion of an incoming recipient.
+ CONFIG: new FEATURE(access_db) which turns on the access database
+ feature. This database give you the ability to allow
+ or refuse to accept mail from specified domains for
+ administrative reasons. By default, names that are listed
+ as "OK" in the access db are domain names, not host names.
+ CONFIG: new confCR_FILE m4 variable for defining the name of the file
+ used for class 'R'. Defaults to /etc/mail/relay-domains.
+ CONFIG: new command RELAY_DOMAIN(domain) and RELAY_DOMAIN_FILE(file)
+ to add items to class 'R' ($=R) for hosts allowed to relay.
+ CONFIG: new FEATURE(relay_hosts_only) to change the behavior
+ of FEATURE(access_db) and class 'R' to lookup individual
+ host names only.
+ CONFIG: new FEATURE(loose_relay_check). Normally, if a recipient
+ using % addressing is used, e.g. user%site@othersite,
+ and othersite is in class 'R', the check_rcpt ruleset
+ will strip @othersite and recheck user@site for relaying.
+ This feature changes that behavior. It should not be
+ needed for most installations.
+ CONFIG: new FEATURE(relay_local_from) to allow relaying if the
+ domain portion of the mail sender is a local host. This
+ should only be used if absolutely necessary as it opens
+ a window for spammers. Patch from Randall S. Winchester of
+ the University of Maryland.
+ CONFIG: new FEATURE(blacklist_recipients) turns on the ability to
+ block incoming mail destined for certain recipient
+ usernames, hostnames, or addresses.
+ CONFIG: By default, MAIL FROM: commands in the SMTP session will be
+ refused if the host part of the argument to MAIL FROM: cannot
+ be located in the host name service (e.g., DNS).
+ CONFIG: new FEATURE(accept_unresolvable_domains) accepts
+ unresolvable hostnames in MAIL FROM: SMTP commands.
+ CONFIG: new FEATURE(accept_unqualified_senders) accepts
+ MAIL FROM: senders which do not include a domain.
+ CONFIG: new FEATURE(rbl) Turns on rejection of hosts found in the
+ Realtime Blackhole List. You can specify the RBL name
+ server to contact by specifying it as an optional argument.
+ The default is rbl.maps.vix.com. For details, see
+ http://maps.vix.com/rbl/.
+ CONFIG: Call Local_check_relay, Local_check_mail, and
+ Local_check_rcpt from check_relay, check_mail, and
+ check_rcpt. Users with local rulesets should place the
+ rules using LOCAL_RULESETS. If a Local_check_* ruleset
+ returns $#OK, the message is accepted. If the ruleset
+ returns a mailer, the appropriate action is taken, else
+ the return of the ruleset is ignored.
+ CONFIG: CYRUS_MAILER_FLAGS now includes the /:| mailer flags by
+ default to support file, :include:, and program deliveries.
+ CONFIG: Remove the default for confDEF_USER_ID so the binary can
+ pick the proper default value. See the SECURITY note
+ above for more information.
+ CONFIG: FEATURE(nodns) now warns the user that the feature is a
+ no-op. Patch from Kari Hurtta of the Finnish
+ Meteorological Institute.
+ CONFIG: OSTYPE(osf1) now sets DefaultUserID (confDEF_USER_ID) to
+ daemon since DEC's /bin/mail will drop the envelope
+ sender if run as mailnull. See the Digital UNIX section
+ of src/README for more information. Problem noted by
+ Kari Hurtta of the Finnish Meteorological Institute.
+ CONFIG: .cf files are now stored in the same directory with the
+ .mc files instead of in the obj directory.
+ CONFIG: New options confSINGLE_LINE_FROM_HEADER,
+ confALLOW_BOGUS_HELO, and confMUST_QUOTE_CHARS for
+ setting SingleLineFromHeader, AllowBogusHELO, and
+ MustQuoteChars respectively.
+ MAIL.LOCAL: support -l flag to run LMTP on stdin/stdout. This
+ SMTP-like protocol allows detailed reporting of delivery
+ status on a per-user basis. Code donated by John Myers of
+ CMU (now of Netscape).
+ MAIL.LOCAL: HP-UX support from Randall S. Winchester of the
+ University of Maryland. NOTE: mail.local is not
+ compatible with the stock HP-UX mail format. Be sure to
+ read mail.local/README.
+ MAIL.LOCAL: Prevent other mail delivery agents from stealing a
+ mailbox lock. Patch from Randall S. Winchester of the
+ University of Maryland.
+ MAIL.LOCAL: glibc portability from John Kennedy of Cal State
+ University, Chico.
+ MAIL.LOCAL: IRIX portability from Kari Hurtta of the Finnish
+ Meteorological Institute.
+ MAILSTATS: Display the number of rejected and discarded messages
+ in the StatusFile. Patch from Randall Winchester of the
+ University of Maryland.
+ MAKEMAP: New -s flag to ignore safety checks on database map files
+ such as linked files in world writable directories.
+ MAKEMAP: Add support for Berkeley DB 2.X. Remove OLD_NEWDB support.
+ PRALIASES: Add support for Berkeley DB 2.X.
+ PRALIASES: Do not automatically include NDBM support. Problem
+ noted by Ralf Hildebrandt of the Technical University of
+ Braunschweig.
+ RMAIL: Improve portability for other platforms. Patches from
+ Randall S. Winchester of the University of Maryland and
+ Kari Hurtta of the Finnish Meteorological Institute.
+ Changed Files:
+ src/Makefiles/Makefile.* files have been modified to use
+ the new build mechanism and are now BuildTools/OS/*.
+ src/makesendmail changed to symbolic link to src/Build.
+ New Files:
+ BuildTools/M4/header.m4
+ BuildTools/M4/depend/BSD.m4
+ BuildTools/M4/depend/CC-M.m4
+ BuildTools/M4/depend/NCR.m4
+ BuildTools/M4/depend/Solaris.m4
+ BuildTools/M4/depend/X11.m4
+ BuildTools/M4/depend/generic.m4
+ BuildTools/OS/AIX.4.2
+ BuildTools/OS/AIX.4.x
+ BuildTools/OS/CRAYT3E.2.0.x
+ BuildTools/OS/HP-UX.11.x
+ BuildTools/OS/IRIX.6.5
+ BuildTools/OS/NEXTSTEP.4.x
+ BuildTools/OS/NeXT.4.x
+ BuildTools/OS/NetBSD.8.3
+ BuildTools/OS/QNX
+ BuildTools/OS/SunOS.5.7
+ BuildTools/OS/dcosx.1.x.NILE
+ BuildTools/README
+ BuildTools/Site/README
+ BuildTools/bin/Build
+ BuildTools/bin/configure.sh
+ BuildTools/bin/find_m4.sh
+ BuildTools/bin/install.sh
+ Makefile
+ cf/cf/Build
+ cf/cf/generic-hpux10.cf
+ cf/feature/accept_unqualified_senders.m4
+ cf/feature/accept_unresolvable_domains.m4
+ cf/feature/access_db.m4
+ cf/feature/blacklist_recipients.m4
+ cf/feature/loose_relay_check.m4
+ cf/feature/local_lmtp.m4
+ cf/feature/promiscuous_relay.m4
+ cf/feature/rbl.m4
+ cf/feature/relay_based_on_MX.m4
+ cf/feature/relay_entire_domain.m4
+ cf/feature/relay_hosts_only.m4
+ cf/feature/relay_local_from.m4
+ cf/ostype/qnx.m4
+ contrib/doublebounce.pl
+ mail.local/Build
+ mail.local/Makefile.m4
+ mail.local/README
+ mailstats/Build
+ mailstats/Makefile.m4
+ makemap/Build
+ makemap/Makefile.m4
+ praliases/Build
+ praliases/Makefile.m4
+ rmail/Build
+ rmail/Makefile.m4
+ rmail/rmail.0
+ smrsh/Build
+ smrsh/Makefile.m4
+ src/Build
+ src/Makefile.m4
+ src/snprintf.c
+ Deleted Files:
+ cf/cf/Makefile (replaced by Makefile.dist)
+ mail.local/Makefile
+ mail.local/Makefile.dist
+ mailstats/Makefile
+ mailstats/Makefile.dist
+ makemap/Makefile
+ makemap/Makefile.dist
+ praliases/Makefile
+ praliases/Makefile.dist
+ rmail/Makefile
+ smrsh/Makefile
+ smrsh/Makefile.dist
+ src/Makefile
+ src/Makefiles/Makefile.AIX.4 (split into AIX.4.x and AIX.4.2)
+ src/Makefiles/Makefile.SMP_DC.OSx.NILE
+ (renamed BuildTools/OS/dcosx.1.x.NILE)
+ src/Makefiles/Makefile.Utah (obsolete platform)
+ Renamed Files:
+ READ_ME => README
+ cf/cf/Makefile.dist => Makefile
+ cf/cf/obj/* => cf/cf/*
+ src/READ_ME => src/README
+
8.8.8/8.8.8 97/10/24
If the check_relay ruleset failed, the relay= field was logged
incorrectly. Problem noted by Kari Hurtta of the Finnish
@@ -903,7 +1508,7 @@ summary of the changes in that release.
If the F=l flag was set on an SMTP mailer to indicate that it is
actually local delivery, and NOTIFY=SUCCESS is specified in
the envelope, and the receiving SMTP server speaks DSN, then
- the DSN would be both generated locally and propogated to the
+ the DSN would be both generated locally and propagated to the
other end.
The U= mailer field didn't correctly extract the group id if the
user id was numeric. Problem noted by Kenneth Herron of
@@ -913,7 +1518,7 @@ summary of the changes in that release.
not occur if it exceeded the maximum _output_ size. Problem
reported by Kyle Jones of UUNET.
PORTABILITY FIXES:
- AIX4: 4.1 does't have a working setreuid(2); change the
+ AIX4: 4.1 doesn't have a working setreuid(2); change the
AIX4 defines to use seteuid(2) instead, which
works on 4.1 as well as 4.2. Problem noted by
Håkan Lindholm of interAF, Sweden.
@@ -963,7 +1568,7 @@ summary of the changes in that release.
Solaris: Don't use the system getusershell(3); it can
apparently corrupt the heap in some circumstances.
Problem found by Ken Pizzini of Spry, Inc.
- OP.ME: document several mailer flags that were accidently omitted
+ OP.ME: document several mailer flags that were accidentally omitted
from this document. These flags were F=d, F=j, F=R, and F=9.
CONFIG: no changes.
@@ -1060,7 +1665,7 @@ summary of the changes in that release.
Log open file descriptors for the "cannot dup" messages in deliver();
this is an attempt to track down a bug that one person seems
to be having (it may be a Solaris bug!).
- DSN NOTIFY parameters were not properly propogated across queue runs;
+ DSN NOTIFY parameters were not properly propagated across queue runs;
this caused the NOTIFY info to sometimes be lost. Problem
pointed out by Claus Assmann of the
Christian-Albrechts-University of Kiel.
@@ -1201,7 +1806,7 @@ summary of the changes in that release.
This could cause mail to addresses such as [foo.com] to bounce
or get dropped. Problem noted by Christophe Wolfhugel of the
Pasteur Institute.
- DSNs were inconsistent if a failure occured during the DATA phase
+ DSNs were inconsistent if a failure occurred during the DATA phase
rather than the RCPT phase: the Action: would be correct, but
the detailed status information would be wrong. Problem noted
by Bob Snyder of General Electric Company.
@@ -1441,7 +2046,7 @@ summary of the changes in that release.
be set to be lower than Timeout.connect on the principle that
the mail should go through quickly to responsive hosts; less
responsive hosts get to wait for the next queue run.
- Fix a problem on Solaris that occassionally causes programs
+ Fix a problem on Solaris that occasionally causes programs
(such as vacation) to hang with their standard input connected
to a UDP port. It also created some signal handling problems.
The problems turned out to be an interaction between vfork(2)
@@ -1713,12 +2318,12 @@ summary of the changes in that release.
Completely delete the Bcc: header if and only if there are other
valid recipient headers (To:, Cc: or Apparently-To:, the
last being a historic botch, of course). If Bcc: is the
- only recipient header in the message, it's value is tossed,
+ only recipient header in the message, its value is tossed,
but the header name is kept. The old behaviour (always keep
the header name and toss the value) allowed primary recipients
to see that a Bcc: went to _someone_.
Include queue id on ``Authentication-Warning: <host>: <user> set
- sender to <addresss> using -f'' syslog messages. Suggested
+ sender to <address> using -f'' syslog messages. Suggested
by Kari Hurtta.
If a sequence or switch map lookup entry gets a tempfail but then
continues on to another map type, but the name is not found,
@@ -1752,7 +2357,7 @@ summary of the changes in that release.
is not set, since this is required to get the actual DSNs
created. Problem pointed out by John Gardiner Myers of CMU.
Log permission problems that cause .forward and :include: files to
- be untrusted or ignored on log level 12 and higher. Suggestted
+ be untrusted or ignored on log level 12 and higher. Suggested
by Randy Martin of Clemson University.
Allow user ids in U= clauses of M lines to have hyphens and
underscores.
@@ -1779,7 +2384,7 @@ summary of the changes in that release.
Technological University.
When converting a message to Quoted-Printable, prevent any lines with
dots alone on a line by themselves. This is because of the
- preponderence of broken mailers that still get this wrong.
+ preponderance of broken mailers that still get this wrong.
Code contributed by Per Hedeland of Ericsson.
Fix F{macro}/file construct -- it previously did nothing. Pointed
out by Bjart Kvarme of USIT/UiO (Norway).
@@ -1813,7 +2418,7 @@ summary of the changes in that release.
Extensive cleanups to map open code to handle a locking race condition
in ndbm, hash, and btree format database files on some (most
non-4.4-BSD based) OS architectures. This should solve the
- occassional "user unknown" problem during alias rebuilds that
+ occasional "user unknown" problem during alias rebuilds that
has plagued me for quite some time. Based on a patch from
Thomas Dwyer III of Michigan Technological University.
PORTABILITY FIXES:
@@ -1957,7 +2562,7 @@ summary of the changes in that release.
If you have a name with a trailing dot, and you try looking it
up using gethostbyname without the dot (for /etc/hosts
compatibility), be sure to turn off RES_DEFNAMES and
- RES_DNSRCH to avoid finding the wrong name accidently.
+ RES_DNSRCH to avoid finding the wrong name accidentally.
Problem noted by Charles Amos of the University of
Maryland.
Don't do timeouts in collect if you are not running SMTP.
@@ -2224,7 +2829,7 @@ summary of the changes in that release.
contributed by Roy Mongiovi of Georgia Tech (my main
contribution was to make it configurable).
Save i-number of df file in qf file to simplify rebuilding of queue
- after disasterous disk crash. Suggested by Kyle Jones of
+ after disastrous disk crash. Suggested by Kyle Jones of
UUNET; closely based on code from KJS DECWRL code written
by Paul Vixie. NOTA BENE: The qf files produced by 8.7
are NOT back compatible with 8.6 -- that is, you can convert
@@ -2658,8 +3263,8 @@ summary of the changes in that release.
Probe the network interfaces to find alternate names for this
host. Requires the SIOCGIFCONF ioctl call. Code
contributed by SunSoft.
- Add "E" configuration line to set or propogate environment
- variables into children. "E<envar>" will propogate
+ Add "E" configuration line to set or propagate environment
+ variables into children. "E<envar>" will propagate
the named variable from the environment when sendmail
was invoked into any children it calls; "E<envar>=<value>"
sets the named variable to the indicated value. Any
@@ -2837,12 +3442,12 @@ summary of the changes in that release.
Rochester Medical Center.
Altos System V (``the first UNIX/XENIX merge the Altos
did for their Series 1000 & Series 2000 line;
- their merged code was licenced back to AT&T and
+ their merged code was licensed back to AT&T and
Microsoft and became System V release 3.2'') from
Tim Rice <timr@crl.com>.
OSF/1 running on Intel Paragon from Jeff A. Earickson
<jeff@ssd.intel.com> of Intel Scalable Systems
- Divison.
+ Division.
Amdahl UTS System V 2.1.5 (SVr3-based) from Janet Jackson
<janet@dialix.oz.au>.
System V Release 4 (statvfs semantic fix) from Alain
@@ -2995,7 +3600,7 @@ summary of the changes in that release.
properly deal with ``group: addr1, ... addrN;'' syntax.
CONFIG: Require OSTYPE macro (the defaults really don't apply to
any real systems any more) and tweak the DOMAIN macro
- so that it is less likely that users will accidently use
+ so that it is less likely that users will accidentally use
the Berkeley defaults. Also, create some generic files
that really can be used in the real world.
CONFIG: Add new configuration macros to set character sets for
@@ -3210,7 +3815,7 @@ summary of the changes in that release.
because it was passed as a printf-style format string.
In some cases this could cause core dumps.
Avoid possible buffer overrun in returntosender() if error
- message is quite ling. From Fletcher Mattox of the
+ message is quite long. From Fletcher Mattox of the
University of Texas.
Fix a problem that would silently drop "too many hops" error
messages if and only if you were sending to an alias.
@@ -3585,7 +4190,7 @@ summary of the changes in that release.
DOC: Clarify $@ and $: in the Install & Op Guide. From Kimmo
Suominen.
Portability fixes:
- Unicos from David L. Kensiski of Sterling Sofware.
+ Unicos from David L. Kensiski of Sterling Software.
DomainOS from Don Lewis of Silicon Systems.
GNU m4 1.0.3 from Karst Koymans of Utrecht University.
Convex from Kimmo Suominen <kim@tac.nyc.ny.us>.
@@ -3636,8 +4241,8 @@ summary of the changes in that release.
the assumption that the alias file is well controlled.
Security fix: root was not treated suspiciously enough when
looking into subdirectories. This would potentially
- allow a cracker to examine files that were publically
- readable but in a non-publically searchable directory.
+ allow a cracker to examine files that were publicly
+ readable but in a non-publicly searchable directory.
Fix a problem that causes an error on QUIT on a cached
connection to create problems on the current job.
These are typically unrelated, so errors occur in
@@ -3992,7 +4597,7 @@ summary of the changes in that release.
Portability fixes for A/UX and Encore UMAX V.
Fix error message handling -- if you had a name server down
causing an error during parsing, that message was never
- propogated to the queue file.
+ propagated to the queue file.
8.6/8.6 93/10/05
Configuration cleanup: make it easier to undo IDENTPROTO in
@@ -4485,13 +5090,13 @@ summary of the changes in that release.
If the name server timed out over several days, no "timed out"
message would ever be sent back. The timeout code
has been moved from markfailure() to dropenvelope()
- so that all such failures should be diagnosted. Pointed
+ so that all such failures should be diagnosed. Pointed
out by Christophe Wolfhugel and others.
Relax safefile() constraints: directories in an include or
forward path must be readable by self if the controlling
user owns the entry, readable by all otherwise (e.g.,
when reading your .forward file, you have to own and
- have X permssion in it; everyone needs X permission in
+ have X permission in it; everyone needs X permission in
the root and directories leading up to your home);
include files must be readable by anyone, but need not
be owned by you.
@@ -4525,7 +5130,7 @@ summary of the changes in that release.
log. For example, if you lost a connection, don't
bother reporting that fact on the connection you lost.
Add some "extended debugging" flags to try to track down
- why we get occassional problems with file descriptor
+ why we get occasional problems with file descriptor
one being closed when execing a mailer; it seems to
only happen when there has been another error in the
same transaction. This requires XDEBUG, defined
@@ -4644,7 +5249,7 @@ summary of the changes in that release.
the first database listed.
Rearrange doc subdirectory for 4.4BSD release tape.
CONFIG: put $r into the Received line. This was an oversight.
- CONFIG: fix typo (call to ruleset 99 should have been rulset 90).
+ CONFIG: fix typo (call to ruleset 99 should have been ruleset 90).
CONFIG: move "auxiliary" subroutines to be in ruleset 90-99
range -- in the long run, single digit rulesets may
become reserved for builtin use by sendmail.
@@ -5053,7 +5658,7 @@ summary of the changes in that release.
Eric Wassenaar.
Always respond "quickly" to RCPT command; do alias expansion and
the like later. This also means that mail for lists that
- have errors will be acccepted, and an error sent back
+ have errors will be accepted, and an error sent back
later. This is done by instantiating the queue file
and then immediately running and requeueing it.
diff --git a/usr.sbin/sendmail/cf/README b/usr.sbin/sendmail/cf/README
index 184a3532559..df50c9da1d0 100644
--- a/usr.sbin/sendmail/cf/README
+++ b/usr.sbin/sendmail/cf/README
@@ -2,9 +2,9 @@
NEW SENDMAIL CONFIGURATION FILES
- Eric Allman <eric@CS.Berkeley.EDU>
+ Eric Allman <eric@Sendmail.ORG>
- @(#)README 8.124 (Berkeley) 9/23/97
+ @(#)README 8.174 (Berkeley) 6/30/98
This document describes the sendmail configuration files being used
@@ -33,7 +33,7 @@ a newer version. You can m4-expand on their system, then run locally.
SunOS's /usr/5bin/m4 or BSD-Net/2's m4 both work. GNU m4 version 1.1
or later also works. Unfortunately, I'm told that the M4 on BSDI 1.0
doesn't work -- you'll have to use a Net/2 or GNU version. GNU m4 is
-available from ftp://prep.ai.mit.edu/pub/gnu/m4-1.4.tar.gz (check for
+available from ftp://ftp.gnu.org/pub/gnu/m4-1.4.tar.gz (check for
the latest version). EXCEPTIONS: DEC's m4 on Digital UNIX 4.x is broken
(3.x is fine). Use GNU m4 on this platform.
@@ -46,7 +46,7 @@ To get started, you may want to look at tcpproto.mc (for TCP-only
sites), uucpproto.mc (for UUCP-only sites), and clientproto.mc (for
clusters of clients using a single mail host). Others are versions
that we use at Berkeley, although not all are in current use. For
-example, ucbarpa has gone away, but I've left ucbarpa.mc in because
+example, ucbvax has gone away, but I've left ucbvax.mc in because
it demonstrates some interesting techniques.
I'm not pretending that this README describes everything that these
@@ -57,7 +57,8 @@ to great effect. But it should get you started.
*** BE SURE YOU CUSTOMIZE THESE FILES! They have some ***
*** Berkeley-specific assumptions built in, such as the name ***
*** of our UUCP-relay. You'll want to create your own domain ***
-*** description, and use that in place of domain/Berkeley.m4. ***
+*** description, and use that in place of ***
+*** domain/Berkeley.EDU.m4. ***
*******************************************************************
@@ -85,38 +86,14 @@ Let's examine a typical .mc file:
divert(-1)
#
- # Copyright (c) 1983 Eric P. Allman
+ # Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ # Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
- # Redistribution and use in source and binary forms, with or without
- # modification, are permitted provided that the following conditions
- # are met:
- # 1. Redistributions of source code must retain the above copyright
- # notice, this list of conditions and the following disclaimer.
- # 2. Redistributions in binary form must reproduce the above copyright
- # notice, this list of conditions and the following disclaimer in
- # the documentation and/or other materials provided with the
- # distribution.
- # 3. All advertising materials mentioning features or use of this
- # software # must display the following acknowledgement:
- # This product includes software developed by the University of
- # California, Berkeley and its contributors.
- # 4. Neither the name of the University nor the names of its
- # contributors may be used to endorse or promote products derived
- # from this software without specific prior written permission.
- #
- # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS''
- # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
- # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ # 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.
#
#
@@ -182,7 +159,7 @@ rules are that the order should be:
Sendmail uses the M4 macro processor to ``compile'' the configuration
files. The most important thing to know is that M4 is stream-based,
that is, it doesn't understand about lines. For this reason, in some
-places you may see the word ``dnl'', which standards for ``delete
+places you may see the word ``dnl'', which stands for ``delete
through newline''; essentially, it deletes all characters starting
at the ``dnl'' up to and including the next newline character. In
most cases sendmail uses this only to avoid lots of unnecessary
@@ -207,6 +184,16 @@ expanded. This also applies to
because ``define'' is an M4 keyword. If you want to use them, surround
them with directed quotes, `like this'.
++----------------+
+| FILE LOCATIONS |
++----------------+
+
+sendmail 8.9 has introduced a new configuration directory for sendmail
+related files, /etc/mail. The new files available for sendmail 8.9 --
+the class 'R' /etc/mail/relay-domains and the access database
+/etc/mail/access -- take advantage of this new directory. 8.9 will
+serve as a transition release. Beginning with 8.10, all of the files
+will use this directory by default.
+--------+
| OSTYPE |
@@ -243,7 +230,7 @@ QUEUE_DIR [/var/spool/mqueue] The directory containing
STATUS_FILE [/etc/sendmail.st] The file containing status
information.
LOCAL_MAILER_PATH [/bin/mail] The program used to deliver local mail.
-LOCAL_MAILER_FLAGS [rmn] The flags used by the local mailer. The
+LOCAL_MAILER_FLAGS [rmn9] The flags used by the local mailer. The
flags lsDFM are always included.
LOCAL_MAILER_ARGS [mail -d $u] The arguments passed to deliver local
mail.
@@ -252,9 +239,9 @@ LOCAL_MAILER_MAX [undefined] If defined, the maximum size of local
LOCAL_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data
that ARRIVE from an address that resolves to the
local mailer and which are converted to MIME will be
- labelled with this character set.
+ labeled with this character set.
LOCAL_SHELL_PATH [/bin/sh] The shell used to deliver piped email.
-LOCAL_SHELL_FLAGS [eu] The flags used by the shell mailer. The
+LOCAL_SHELL_FLAGS [eu9] The flags used by the shell mailer. The
flags lsDFM are always included.
LOCAL_SHELL_ARGS [sh -c $u] The arguments passed to deliver "prog"
mail.
@@ -282,7 +269,7 @@ RELAY_MAILER_ARGS [IPC $h] The arguments passed to the relay mailer.
SMTP_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data
that ARRIVE from an address that resolves to one of
the SMTP mailers and which are converted to MIME will
- be labelled with this character set.
+ be labeled with this character set.
UUCP_MAILER_PATH [/usr/bin/uux] The program used to send UUCP mail.
UUCP_MAILER_FLAGS [undefined] Flags added to UUCP mailer. Default
flags are `DFMhuU' (and `m' for uucp-new mailer,
@@ -294,7 +281,7 @@ UUCP_MAILER_MAX [100000] The maximum size message accepted for
UUCP_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data
that ARRIVE from an address that resolves to one of
the UUCP mailers and which are converted to MIME will
- be labelled with this character set.
+ be labeled with this character set.
FAX_MAILER_PATH [/usr/local/lib/fax/mailfax] The program used to
submit FAX messages.
FAX_MAILER_ARGS [mailfax $u $h $f] The arguments passed to the FAX
@@ -325,9 +312,9 @@ PH_MAILER_PATH [/usr/local/etc/phquery] The path to the phquery
program.
PH_MAILER_FLAGS [ehmu] Flags for the phquery mailer.
PH_MAILER_ARGS [phquery -- $u] -- arguments to the phquery mailer.
-CYRUS_MAILER_FLAGS [A5@] The flags used by the cyrus mailer. The
- flags lsDFMnP are always included.
-CYRUS_MAILER_PATH [/usr/cyrus/bin/deliver] The progam used to deliver
+CYRUS_MAILER_FLAGS [A5@/:|] The flags used by the cyrus mailer. The
+ flags lsDFMnPq are always included.
+CYRUS_MAILER_PATH [/usr/cyrus/bin/deliver] The program used to deliver
cyrus mail.
CYRUS_MAILER_ARGS [deliver -e -m $h -- $u] The arguments passed
to deliver cyrus mail.
@@ -339,6 +326,9 @@ CYRUS_BB_MAILER_FLAGS [undefined] The flags used by the cyrusbb
mailer. The flags lsDFMnP are always included.
CYRUS_BB_MAILER_ARGS [deliver -e -m $u] The arguments passed
to deliver cyrusbb mail.
+confEBINDIR [/usr/libexec] The directory for executables.
+ Currently used for FEATURE(local_lmtp) and
+ FEATURE(smrsh).
@@ -509,13 +499,23 @@ optional parameter -- for example:
FEATURE(mailertable, dbm /usr/lib/mailertable)
+The default database map type for the table features can be set with
+
+ define(`DATABASE_MAP_TYPE', `dbm')
+
+which would set it to use ndbm databases. The default is the Berkeley DB
+hash database format. Note that you must still declare a database map type
+if you specify an argument to a FEATURE. DATABASE_MAP_TYPE is only used
+if no argument is given for the FEATURE.
+
Available features are:
use_cw_file Read the file /etc/sendmail.cw file to get alternate
names for this host. This might be used if you were
on a host that MXed for a dynamic set of other
hosts. If the set is static, just including the line
- "Cw<name1> <name2> ..." is probably superior.
+ "Cw<name1> <name2> ..." (where the names are fully
+ qualified domain names) is probably superior.
The actual filename can be overridden by redefining
confCW_FILE.
@@ -562,7 +562,16 @@ mailertable Include a "mailer table" which can be used to override
mailer:domain
where "mailer" is the internal mailer name, and "domain"
is where to send the message. These maps are not
- reflected into the message header.
+ reflected into the message header. As a special case,
+ the forms:
+ local:user
+ will forward to the indicated user using the local mailer,
+ local:
+ will forward to the original user in the e-mail address
+ using the local mailer, and
+ error:code message
+ will give an error message with the indicated code and
+ message.
domaintable Include a "domain table" which can be used to provide
domain name mapping. Use of this should really be
@@ -637,30 +646,32 @@ masquerade_entire_domain
NOTE: only domains within your jurisdiction and
current hierarchy should be masqueraded using this.
-genericstable This feature will cause certain addresses originating in the
- local domain or a domain listed in $=G to be looked up in a
- map and turned into another ("generic") form, which can change
- both the domain name and the user name. This is similar to
- the userdb functionality. The same types of addresses as for
- masquerading are looked up, i.e. only header sender addresses
- unless the allmasquerade and/or masquerade_envelope features
- are given. The addresses must be in the list of names given
+genericstable This feature will cause certain addresses originating locally
+ (i.e. that are unqualified) or a domain listed in $=G to be
+ looked up in a map and turned into another ("generic") form,
+ which can change both the domain name and the user name. This
+ is similar to the userdb functionality. The same types of
+ addresses as for masquerading are looked up, i.e. only header
+ sender addresses unless the allmasquerade and/or
+ masquerade_envelope features are given. Qualified addresses
+ must have the domain part in the list of names given by the
by the macros GENERICS_DOMAIN or GENERICS_DOMAIN_FILE
(analogously to MASQUERADE_DOMAIN and MASQUERADE_DOMAIN_FILE,
see below).
The argument of FEATURE(genericstable) may be the map
- defintion; the default map definition is:
+ definition; the default map definition is:
hash -o /etc/genericstable
The key for this table is either the full address or the
unqualified username (the former is tried first); the
value is the new user address. If the new user address does
- not include a domain, $j is used. Note that the address
- being looked up must be fully qualified. For local mail, it
- is necessary to use FEATURE(always_add_domain) for the
- addresses to be qualified.
+ not include a domain, it will be qualified in the standard
+ manner, i.e. using $j or the masquerade name. Note that the
+ address being looked up must be fully qualified. For local
+ mail, it is necessary to use FEATURE(always_add_domain) for
+ the addresses to be qualified.
virtusertable A domain-specific form of aliasing, allowing multiple
virtual domains to be hosted on one machine. For example,
@@ -705,10 +716,18 @@ nullclient This is a special case -- it creates a stripped down
The only other feature that should be used in conjunction
with this one is "nocanonify" (this causes addresses to
be sent unqualified via the SMTP connection; normally
- they are qualifed with the masquerade name, which
+ they are qualified with the masquerade name, which
defaults to the name of the hub machine). No mailers
should be defined. No aliasing or forwarding is done.
+local_lmtp Use an LMTP capable local mailer. The argument to this
+ feature is the pathname of an LMTP capable mailer. By
+ default, mail.local is used. This is expected to be the
+ mail.local which came with the 8.9 distribution which is
+ LMTP capable. The path to mail.local is set by the
+ confEBINDIR m4 variable -- making the default
+ LOCAL_MAILER_PATH /usr/libexec/mail.local.
+
local_procmail Use procmail as the local mailer. This mailer can
make use of the "user+indicator@local.host" syntax;
normally the +indicator is just tossed, but by default
@@ -722,18 +741,101 @@ local_procmail Use procmail as the local mailer. This mailer can
bestmx_is_local Accept mail as though locally addressed for any host that
lists us as the best possible MX record. This generates
additional DNS traffic, but should be OK for low to
- medium traffic hosts. THIS FEATURE IS FUNDAMENTALLY
- INCOMPATIBLE WITH WILDCARD MX RECORDS!!! If you have
- a wildcard MX record that matches your domain, you
- cannot use this feature.
+ medium traffic hosts. The argument may be a set of
+ domains, which will limit the feature to only apply to
+ these domains -- this will reduce unnecessary DNS
+ traffic. THIS FEATURE IS FUNDAMENTALLY INCOMPATIBLE WITH
+ WILDCARD MX RECORDS!!! If you have a wildcard MX record
+ that matches your domain, you cannot use this feature.
smrsh Use the SendMail Restricted SHell (smrsh) provided
with the distribution instead of /bin/sh for mailing
to programs. This improves the ability of the local
system administrator to control what gets run via
e-mail. If an argument is provided it is used as the
- pathname to smrsh; otherwise, /usr/local/etc/smrsh is
- assumed.
+ pathname to smrsh; otherwise, the path defined by
+ confEBINDIR is used for the smrsh binary -- by default,
+ /usr/libexec/smrsh is assumed.
+
+promiscuous_relay
+ By default, the sendmail configuration files do not permit
+ mail relaying (that is, accepting mail from outside your
+ domain and sending it to another host outside your domain).
+ This option sets your site to allow mail relaying from any
+ site to any site. In general, it is better to control the
+ relaying more carefully with the access db and the 'R'
+ class ($=R). Domains can be added to class 'R' by the
+ macros RELAY_DOMAIN or RELAY_DOMAIN_FILE (analogously to
+ MASQUERADE_DOMAIN and MASQUERADE_DOMAIN_FILE, see below).
+
+relay_entire_domain
+ By default, only hosts listed as RELAY in the access db
+ will be allowed to relay. This option also allows any
+ host in your domain as defined by the 'm' class ($=m).
+
+relay_hosts_only
+ By default, names that are listed as RELAY in the access
+ db and class 'R' ($=R) are domain names, not host names.
+ For example, if you specify ``foo.com'', then mail to or
+ from foo.com, abc.foo.com, or a.very.deep.domain.foo.com
+ will all be accepted for relaying. This feature changes
+ the behaviour to lookup individual host names only.
+
+relay_based_on_MX
+ Turns on the ability to allow relaying based on the MX
+ records of the host portion of an incoming recipient. See
+ description below for more information before using this
+ feature.
+
+relay_local_from
+ Allows relaying if the domain portion of the mail sender
+ is a local host. This should only be used if absolutely
+ necessary as it opens a window for spammers.
+
+accept_unqualified_senders
+ Normally, MAIL FROM: commands in the SMTP session will be
+ refused if the connection is a network connection and the
+ sender address does not include a domain name. If your
+ setup sends local mail unqualified (i.e. MAIL FROM: <joe>),
+ you will need to use this feature to accept unqualified
+ sender addresses.
+
+accept_unresolvable_domains
+ Normally, MAIL FROM: commands in the SMTP session will be
+ refused if the host part of the argument to MAIL FROM: cannot
+ be located in the host name service (e.g., DNS). If you are
+ inside a firewall that has only a limited view of the
+ Internet host name space, this could cause problems. In this
+ case you probably want to use this feature to accept all
+ domains on input, even if they are unresolvable.
+
+access_db Turns on the access database feature. The access db gives
+ you the ability to allow or refuse to accept mail from
+ specified domains for administrative reasons. By default,
+ the access database specification is
+ ``hash -o /etc/mail/access''. The format of the
+ database is described below.
+
+blacklist_recipients
+ Turns on the ability to block incoming mail for certain
+ recipient usernames, hostnames, or addresses. For
+ example, you can block incoming mail to user nobody,
+ host foo.mydomain.com, or guest@bar.mydomain.com.
+ These specifications are put in the access db as
+ described below.
+
+rbl Turns on rejection of hosts found in the Realtime Blackhole
+ List. If an argument is provided it is used as the
+ name sever to contact; otherwise, the main RBL server at
+ rbl.maps.vix.com is used. For details, see
+ http://maps.vix.com/rbl/.
+
+loose_relay_check
+ Normally, if a recipient using % addressing is used, e.g.
+ user%site@othersite, and othersite is in class 'R', the
+ check_rcpt ruleset will strip @othersite and recheck
+ user@site for relaying. This feature changes that
+ behavior. It should not be needed for most installations.
+-------+
@@ -915,7 +1017,7 @@ For more complex configurations, you can define special rules.
The macro LOCAL_RULE_3 introduces rules that are used in canonicalizing
the names. Any modifications made here are reflected in the header.
-A common use is to convert old UUCP addreses to SMTP addresses using
+A common use is to convert old UUCP addresses to SMTP addresses using
the UUCPSMTP macro. For example:
LOCAL_RULE_3
@@ -1058,7 +1160,7 @@ MAIL_HUB act identically, with MAIL_HUB taking precedence.
If you want all outgoing mail to go to a central relay site, define
SMART_HOST as well. Briefly:
- LOCAL_RELAY applies to unqualifed names (e.g., "eric").
+ LOCAL_RELAY applies to unqualified names (e.g., "eric").
MAIL_HUB applies to names qualified with the name of the
local host (e.g., "eric@mastodon.CS.Berkeley.EDU").
SMART_HOST applies to names qualified with other hosts.
@@ -1076,6 +1178,211 @@ specified with a terminal dot:
note the trailing dot ---^
++---------------------------------+
+| ANTI-SPAM CONFIGURATION CONTROL |
++---------------------------------+
+
+The primary anti-spam features available in sendmail are:
+
+* Relaying is denied by default.
+* Better checking on sender information.
+* Access database.
+* Header checks.
+
+Relaying (transmission of messages from a site outside your domain to
+another site outside your domain) is denied by default. Note that
+this changed in sendmail 8.9; previous versions allowed relaying by
+default. If you want to revert to the old behaviour, you will need
+to use FEATURE(promiscuous_relay). You can allow certain domains to
+relay through your server by adding their domain name or IP address to
+class 'R' ($=R) using RELAY_DOMAIN() and RELAY_DOMAIN_FILE() or via the
+access database (described below).
+
+If you use
+
+ FEATURE(relay_entire_domain)
+
+then any host in any of your local domains (that is, the $=m class)
+will be relayed.
+
+You can also allow relaying based on the MX records of the host
+portion of an incoming recipient address by using
+
+ FEATURE(relay_based_on_MX)
+
+For example, if your server receives a recipient of user@domain.com
+and domain.com lists your server in its MX records, the mail will be
+accepted. Note that this will stop spammers from using your host to
+relay spam but it will not stop outsiders from using your server as a
+relay for their site. Along the same lines,
+
+ FEATURE(relay_local_from)
+
+will allow relaying if the sender specifies a return path (i.e.
+MAIL FROM: <user@domain>) domain which is a local domain. This a
+dangerous feature as it will allow spammers to spam using your mail
+server by simply specifying a return address of user@your.domain.com.
+It should not be used unless absolutely necessary.
+
+If source routing is used in the recipient address (i.e.
+RCPT TO: <user%site.com@othersite.com>), sendmail will check
+user@site.com for relaying if othersite.com is an allowed relay host
+in either class 'R', class 'm' if FEATURE(relay_entire_domain) is used,
+or the access database if FEATURE(access_db) is used. To prevent
+the address from being stripped down, use:
+
+ FEATURE(loose_relay_check)
+
+If you think you need to use this feature, you probably do not. This
+should only be used for sites which have no control over the addresses
+that they provide a gateway for. Use this FEATURE with caution as it
+can allow spammers to relay through your server if not setup properly.
+
+As of 8.9, sendmail will refuse mail if the MAIL FROM: parameter has
+an unresolvable domain (i.e., one that DNS, your local name service,
+or special case rules in ruleset 3 cannot locate). If you want to
+continue to accept such domains, e.g. because you are inside a
+firewall that has only a limited view of the Internet host name space
+(note that you will not be able to return mail to them unless you have
+some "smart host" forwarder), use
+
+ FEATURE(accept_unresolvable_domains)
+
+sendmail will also refuse mail if the MAIL FROM: parameter is not
+fully qualified (i.e., contains a domain as well as a user). If you
+want to continue to accept such senders, use
+
+ FEATURE(accept_unqualified_senders)
+
+An ``access'' database can be created to accept or reject mail from
+selected domains. For example, you may choose to reject all mail
+originating from known spammers. To enable such a database, use
+
+ FEATURE(access_db)
+
+The FEATURE macro can accept a second parameter giving the key file
+definition for the database; for example
+
+ FEATURE(access_db, hash -o /etc/mail/access)
+
+The table itself uses e-mail addresses, domain names, and network
+numbers as keys. For example,
+
+ spammer@aol.com REJECT
+ cyberspammer.com REJECT
+ 206.117.147 REJECT
+
+would refuse mail from spammer@aol.com, any user from cyberspammer.com
+(or any host within the cyberspammer.com domain), and any host on the
+206.117.147.* network.
+
+The value part of the map can contain:
+
+ OK accept mail even if other rules in the
+ running ruleset would reject it.
+ RELAY Allow domain to relay through your SMTP
+ server. RELAY also serves an implicit
+ OK for the other checks.
+ REJECT reject the sender/recipient with a general
+ purpose message.
+ DISCARD discard the message completely using
+ the $#discard mailer
+ ### any text where ### is an RFC 821 compliant error code
+ and "any text" is a message to return for
+ the command.
+
+For example:
+
+ cyberspammer.com 550 We don't accept mail from spammers
+ okay.cyberspammer.com OK
+ sendmail.org OK
+ 128.32 RELAY
+
+would accept mail from okay.cyberspammer.com, but would reject mail
+from all other hosts at cyberspammer.com with the indicated message.
+It would allow accept mail from any hosts in the sendmail.org domain,
+and allow relaying for the 128.32.*.* network. Note, UUCP users may
+need to add hostname.UUCP to the access database or class 'R' ($=R).
+If you also use:
+
+ FEATURE(relay_hosts_only)
+
+then the above example will allow relaying for sendmail.org, but not
+hosts within the sendmail.org domain. Note that this will also require
+hosts listed in class 'R' ($=R) to be fully qualified host names.
+
+You can also use the access database to block sender addresses based on
+the username portion of the address. For example:
+
+ FREE.STEALTH.MAILER@ 550 Spam not accepted
+
+Note that you must include the @ after the username to signify that
+this database entry is for checking only the username portion of the
+sender address.
+
+If you use:
+
+ FEATURE(blacklist_recipients)
+
+then you can add entries to the map for local users, hosts in your
+domains, or addresses in your domain which should not receive mail:
+
+ badlocaluser 550 Mailbox disabled for this username
+ host.mydomain.com 550 That host does not accept mail
+ user@otherhost.mydomain.com 550 Mailbox disabled for this recipient
+
+This would prevent a recipient of badlocaluser@mydomain.com, any
+user at host.mydomain.com, and the single address
+user@otherhost.mydomain.com from receiving mail.
+
+There is also a ``Realtime Blackhole List'' run by the MAPS project
+at http://maps.vix.com/. This is a database maintained in DNS of
+spammers. To use this database, use
+
+ FEATURE(rbl)
+
+This will cause sendmail to reject mail from any site in the
+Realtime Blackhole List database. You can specify an alternative
+RBL name server to contact by specifying an argument to the FEATURE.
+
+The features described above make use of the check_relay, check_mail,
+and check_rcpt rulesets. If you wish to include your own checks,
+you can put your checks in the rulesets Local_check_relay,
+Local_check_mail, and Local_check_rcpt. For example if you wanted to
+block senders with all numeric usernames (i.e. 2312343@bigisp.com),
+you would use Local_check_mail and the new regex map:
+
+ LOCAL_CONFIG
+ Kallnumbers regex -a@MATCH ^[0-9]+$
+
+ LOCAL_RULESETS
+ SLocal_check_mail
+ # check address against various regex checks
+ R$* $: $>Parse0 $>3 $1
+ R$+ < @ bigisp.com. > $* $: $(allnumbers $1 $)
+ R@MATCH $#error $: 553 Header Error
+
+These rules are called with the original arguments of the corresponding
+check_* ruleset. If the local ruleset returns $#OK, no further checking
+is done by the features described above and the mail is accepted. If the
+local ruleset resolves to a mailer (such as $#error or $#discard), the
+appropriate action is taken. Otherwise, the results of the local
+rewriting are ignored.
+
+
+You can also reject mail on the basis of the contents of headers.
+This is done by adding a ruleset call to the 'H' header definition command
+in sendmail.cf. For example, this can be used to check the validity of
+a Message-ID: header:
+
+ LOCAL_RULESETS
+ HMessage-Id: $>CheckMessageId
+
+ SCheckMessageId
+ R< $+ @ $+ > $@ OK
+ R$* $#error $: 553 Header Error
+
+
+--------------------------------+
| ADDING NEW MAILERS OR RULESETS |
+--------------------------------+
@@ -1089,7 +1396,7 @@ LOCAL_RULESETS respectively. For example:
...
LOCAL_RULESETS
- Scheck_relay
+ Smyruleset
...
@@ -1133,6 +1440,10 @@ use:
That is, send directly only to things you found in your DNS lookup;
anything else goes through SMART_HOST.
+You may need to turn off the anti-spam rules in order to accept
+UUCP mail with FEATURE(promiscuous_relay) and
+FEATURE(accept_unresolvable_domains).
+
+-----------+
| WHO AM I? |
@@ -1257,7 +1568,7 @@ Plussed users
LDAP
For notes on use LDAP in sendmail, see
- http://www-leland.stanford.edu/~bbense/Inst.html
+ http://www.stanford.edu/~bbense/Inst.html
@@ -1348,6 +1659,10 @@ confCW_FILE Fw class [/etc/sendmail.cw] Name of file used
confCT_FILE Ft class [/etc/sendmail.ct] Name of file used
to get the local additions to the $=t
(trusted users) class.
+confCR_FILE FR class [/etc/mail/relay-domains] Name of
+ file used to get the local additions
+ to the $=R (hosts allowed to relay)
+ class.
confTRUSTED_USERS Ct class [no default] Names of users to add to
the list of trusted users. This list
always includes root, uucp, and daemon.
@@ -1399,7 +1714,7 @@ confERROR_MODE ErrorMode [print] Error message mode.
confERROR_MESSAGE ErrorHeader [undefined] Error message header/file.
confSAVE_FROM_LINES SafeFromLine Save extra leading From_ lines.
confTEMP_FILE_MODE TempFileMode [0600] Temporary file mode.
-confMATCH_GECOS MatchGECOS [True] Match GECOS field.
+confMATCH_GECOS MatchGECOS [False] Match GECOS field.
confMAX_HOP MaxHopCount [25] Maximum hop count.
confIGNORE_DOTS* IgnoreDots [False; always False in -bs or -bd mode]
Ignore dot as terminator for incoming
@@ -1582,10 +1897,10 @@ confMIN_QUEUE_AGE MinQueueAge [0] The minimum amount of time a job
must sit in the queue between queue
runs. This allows you to set the
queue run interval low for better
- resposiveness without trying all
+ responsiveness without trying all
jobs in each run.
confDEF_CHAR_SET DefaultCharSet [unknown-8bit] When converting
- unlabelled 8 bit input to MIME, the
+ unlabeled 8 bit input to MIME, the
character set to use by default.
confSERVICE_SWITCH_FILE ServiceSwitchFile
[/etc/service.switch] The file to use
@@ -1649,6 +1964,14 @@ confDONT_EXPAND_CNAMES DontExpandCnames
lookups as well.
confFROM_LINE UnixFromLine [From $g $d] The From_ line used
when sending to files or programs.
+confSINGLE_LINE_FROM_HEADER SingleLineFromHeader
+ [False] From: lines that have
+ embedded newlines are unwrapped
+ onto one line.
+confALLOW_BOGUS_HELO AllowBogusHELO [False] Allow HELO SMTP command that
+ does not include a host name.
+confMUST_QUOTE_CHARS MustQuoteChars [.'] Characters to be quoted in a full
+ name phrase (@,;:\()[] are automatic).
confOPERATORS OperatorChars [.:%@!^/[]+] Address operator
characters.
confSMTP_LOGIN_MSG SmtpGreetingMessage
@@ -1690,6 +2013,32 @@ confRUN_AS_USER RunAsUser [undefined] If set, become this user
files will be written as this user.
Intended for use only on firewalls
where users do not have accounts.
+confMAX_RCPTS_PER_MESSAGE MaxRecipientsPerMessage
+ [infinite] If set, allow no more than
+ the specified number of recipients in
+ an SMTP envelope. Further recipients
+ receive a 452 error code (i.e., they
+ are deferred for the next delivery
+ attempt).
+confDONT_PROBE_INTERFACES DontProbeInterfaces
+ [False] If set, sendmail will _not_
+ insert the names and addresses of any
+ local interfaces into the $=w class
+ (list of known "equivalent" addresses).
+ If you set this, you must also include
+ some support for these addresses (e.g.,
+ in a mailertable entry) -- otherwise,
+ mail to addresses in this list will
+ bounce with a configuration error.
+confDONT_BLAME_SENDMAIL DontBlameSendmail
+ [safe] Override sendmail's file
+ safety checks. This will definitely
+ compromise system security and should
+ not be used unless absolutely
+ necessary.
+confREJECT_MSG - [550 Access denied] The message
+ given if the access database contains
+ REJECT in the value portion.
See also the description of OSTYPE for some parameters that can be
tweaked (generally pathnames to mailers).
diff --git a/usr.sbin/sendmail/cf/cf/Makefile b/usr.sbin/sendmail/cf/cf/Makefile
index c3b2a9b060b..be95b33a16a 100644
--- a/usr.sbin/sendmail/cf/cf/Makefile
+++ b/usr.sbin/sendmail/cf/cf/Makefile
@@ -1,9 +1,10 @@
-# $OpenBSD: Makefile,v 1.15 1997/12/16 04:21:45 mickey Exp $
-# @(#)Makefile 8.19 (Berkeley) 1/14/97
-
+# $OpenBSD: Makefile,v 1.16 1998/07/12 19:41:16 millert Exp $
+#
+# Makefile for configuration files.
#
-# This Makefile uses the new Berkeley "make" program. See Makefile.dist
-# for a more vanilla version.
+# @(#)Makefile 8.17 (Berkeley) 4/2/98
+#
+
#
# Create configuration files using "m4 ../m4/cf.m4 file.mc > file.cf";
# this may be easier than tweaking the Makefile. You do need to
@@ -12,6 +13,7 @@
#
M4= m4
+CFDIR= ..
CHMOD= chmod
ROMODE= 444
RM= rm -f
@@ -35,53 +37,105 @@ clean cleandir:
depend install:
-distribution: openbsd-proto.cf
- ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 644 openbsd-proto.cf \
- ${DESTDIR}/etc/sendmail.cf
-
# this is overkill, but....
M4FILES=\
- ../domain/Berkeley.EDU.m4 \
- ../domain/CS.Berkeley.EDU.m4 \
- ../domain/EECS.Berkeley.EDU.m4 \
- ../domain/S2K.Berkeley.EDU.m4 \
- ../feature/allmasquerade.m4 \
- ../feature/always_add_domain.m4 \
- ../feature/bestmx_is_local.m4 \
- ../feature/bitdomain.m4 \
- ../feature/domaintable.m4 \
- ../feature/local_procmail.m4 \
- ../feature/mailertable.m4 \
- ../feature/nocanonify.m4 \
- ../feature/nodns.m4 \
- ../feature/notsticky.m4 \
- ../feature/nouucp.m4 \
- ../feature/nullclient.m4 \
- ../feature/redirect.m4 \
- ../feature/smrsh.m4 \
- ../feature/stickyhost.m4 \
- ../feature/use_cw_file.m4 \
- ../feature/uucpdomain.m4 \
- ../hack/cssubdomain.m4 \
- ../m4/cf.m4 \
- ../m4/cfhead.m4 \
- ../m4/nullrelay.m4 \
- ../m4/proto.m4 \
- ../m4/version.m4 \
- ../mailer/cyrus.m4 \
- ../mailer/fax.m4 \
- ../mailer/local.m4 \
- ../mailer/mail11.m4 \
- ../mailer/pop.m4 \
- ../mailer/procmail.m4 \
- ../mailer/smtp.m4 \
- ../mailer/usenet.m4 \
- ../mailer/uucp.m4 \
- ../ostype/bsd4.4.m4 \
- ../siteconfig/uucp.cogsci.m4 \
- ../siteconfig/uucp.old.arpa.m4 \
- ../siteconfig/uucp.ucbarpa.m4 \
- ../siteconfig/uucp.ucbvax.m4 \
+ ${CFDIR}/domain/Berkeley.EDU.m4 \
+ ${CFDIR}/domain/CS.Berkeley.EDU.m4 \
+ ${CFDIR}/domain/EECS.Berkeley.EDU.m4 \
+ ${CFDIR}/domain/S2K.Berkeley.EDU.m4 \
+ ${CFDIR}/domain/berkeley-only.m4 \
+ ${CFDIR}/domain/generic.m4 \
+ ${CFDIR}/feature/accept_unqualified_senders.m4 \
+ ${CFDIR}/feature/accept_unresolvable_domains.m4 \
+ ${CFDIR}/feature/access_db.m4 \
+ ${CFDIR}/feature/allmasquerade.m4 \
+ ${CFDIR}/feature/always_add_domain.m4 \
+ ${CFDIR}/feature/bestmx_is_local.m4 \
+ ${CFDIR}/feature/bitdomain.m4 \
+ ${CFDIR}/feature/blacklist_recipients.m4 \
+ ${CFDIR}/feature/loose_relay_check.m4 \
+ ${CFDIR}/feature/domaintable.m4 \
+ ${CFDIR}/feature/genericstable.m4 \
+ ${CFDIR}/feature/limited_masquerade.m4 \
+ ${CFDIR}/feature/local_lmtp.m4 \
+ ${CFDIR}/feature/local_procmail.m4 \
+ ${CFDIR}/feature/mailertable.m4 \
+ ${CFDIR}/feature/masquerade_entire_domain.m4 \
+ ${CFDIR}/feature/masquerade_envelope.m4 \
+ ${CFDIR}/feature/nocanonify.m4 \
+ ${CFDIR}/feature/nodns.m4 \
+ ${CFDIR}/feature/notsticky.m4 \
+ ${CFDIR}/feature/nouucp.m4 \
+ ${CFDIR}/feature/nullclient.m4 \
+ ${CFDIR}/feature/promiscuous_relay.m4 \
+ ${CFDIR}/feature/rbl.m4 \
+ ${CFDIR}/feature/redirect.m4 \
+ ${CFDIR}/feature/relay_based_on_MX.m4 \
+ ${CFDIR}/feature/relay_entire_domain.m4 \
+ ${CFDIR}/feature/relay_hosts_only.m4 \
+ ${CFDIR}/feature/relay_local_from.m4 \
+ ${CFDIR}/feature/smrsh.m4 \
+ ${CFDIR}/feature/stickyhost.m4 \
+ ${CFDIR}/feature/use_ct_file.m4 \
+ ${CFDIR}/feature/use_cw_file.m4 \
+ ${CFDIR}/feature/uucpdomain.m4 \
+ ${CFDIR}/feature/virtusertable.m4 \
+ ${CFDIR}/hack/cssubdomain.m4 \
+ ${CFDIR}/m4/cf.m4 \
+ ${CFDIR}/m4/cfhead.m4 \
+ ${CFDIR}/m4/nullrelay.m4 \
+ ${CFDIR}/m4/proto.m4 \
+ ${CFDIR}/m4/version.m4 \
+ ${CFDIR}/mailer/cyrus.m4 \
+ ${CFDIR}/mailer/fax.m4 \
+ ${CFDIR}/mailer/local.m4 \
+ ${CFDIR}/mailer/mail11.m4 \
+ ${CFDIR}/mailer/pop.m4 \
+ ${CFDIR}/mailer/procmail.m4 \
+ ${CFDIR}/mailer/smtp.m4 \
+ ${CFDIR}/mailer/usenet.m4 \
+ ${CFDIR}/mailer/uucp.m4 \
+ ${CFDIR}/ostype/aix2.m4 \
+ ${CFDIR}/ostype/aix3.m4 \
+ ${CFDIR}/ostype/altos.m4 \
+ ${CFDIR}/ostype/amdahl-uts.m4 \
+ ${CFDIR}/ostype/aux.m4 \
+ ${CFDIR}/ostype/bsd4.3.m4 \
+ ${CFDIR}/ostype/bsd4.4.m4 \
+ ${CFDIR}/ostype/bsdi1.0.m4 \
+ ${CFDIR}/ostype/bsdi2.0.m4 \
+ ${CFDIR}/ostype/dgux.m4 \
+ ${CFDIR}/ostype/domainos.m4 \
+ ${CFDIR}/ostype/dynix3.2.m4 \
+ ${CFDIR}/ostype/gnuhurd.m4 \
+ ${CFDIR}/ostype/hpux10.m4 \
+ ${CFDIR}/ostype/hpux9.m4 \
+ ${CFDIR}/ostype/irix4.m4 \
+ ${CFDIR}/ostype/irix5.m4 \
+ ${CFDIR}/ostype/irix6.m4 \
+ ${CFDIR}/ostype/linux.m4 \
+ ${CFDIR}/ostype/maxion.m4 \
+ ${CFDIR}/ostype/mklinux.m4 \
+ ${CFDIR}/ostype/nextstep.m4 \
+ ${CFDIR}/ostype/osf1.m4 \
+ ${CFDIR}/ostype/powerux.m4 \
+ ${CFDIR}/ostype/ptx2.m4 \
+ ${CFDIR}/ostype/qnx.m4 \
+ ${CFDIR}/ostype/riscos4.5.m4 \
+ ${CFDIR}/ostype/sco-uw-2.1.m4 \
+ ${CFDIR}/ostype/sco3.2.m4 \
+ ${CFDIR}/ostype/solaris2.m4 \
+ ${CFDIR}/ostype/solaris2.ml.m4 \
+ ${CFDIR}/ostype/sunos3.5.m4 \
+ ${CFDIR}/ostype/sunos4.1.m4 \
+ ${CFDIR}/ostype/svr4.m4 \
+ ${CFDIR}/ostype/ultrix4.m4 \
+ ${CFDIR}/ostype/unknown.m4 \
+ ${CFDIR}/ostype/uxpds.m4 \
+ ${CFDIR}/siteconfig/uucp.cogsci.m4 \
+ ${CFDIR}/siteconfig/uucp.old.arpa.m4 \
+ ${CFDIR}/siteconfig/uucp.ucbarpa.m4 \
+ ${CFDIR}/siteconfig/uucp.ucbvax.m4 \
$(ALL): $(M4FILES)
diff --git a/usr.sbin/sendmail/cf/cf/Makefile.dist b/usr.sbin/sendmail/cf/cf/Makefile.dist
index 051e9d38741..8b6fb4d64e9 100644
--- a/usr.sbin/sendmail/cf/cf/Makefile.dist
+++ b/usr.sbin/sendmail/cf/cf/Makefile.dist
@@ -1,7 +1,7 @@
#
# Makefile for configuration files.
#
-# @(#)Makefile.dist 8.11 (Berkeley) 1/14/97
+# @(#)Makefile 8.17 (Berkeley) 4/2/98
#
#
@@ -12,7 +12,6 @@
#
M4= m4
-#M4= /usr/src/usr.bin/m4/obj/m4
CFDIR= ..
CHMOD= chmod
ROMODE= 444
@@ -22,11 +21,12 @@ RM= rm -f
.mc.cf:
$(RM) $@
- $(M4) ${CFDIR}/m4/cf.m4 $*.mc > $@
+ $(M4) ${CFDIR}/m4/cf.m4 $*.mc > $@ || ( $(RM) $@ && exit 1 )
$(CHMOD) $(ROMODE) $@
ALL= generic-bsd4.4.cf generic-hpux9.cf generic-hpux10.cf \
generic-osf1.cf generic-solaris2.cf \
+ generic-sunos4.1.cf generic-ultrix4.cf \
cs-hpux9.cf cs-osf1.cf cs-solaris2.cf \
cs-sunos4.1.cf cs-ultrix4.cf \
s2k-osf1.cf s2k-ultrix4.cf \
@@ -46,25 +46,46 @@ M4FILES=\
${CFDIR}/domain/CS.Berkeley.EDU.m4 \
${CFDIR}/domain/EECS.Berkeley.EDU.m4 \
${CFDIR}/domain/S2K.Berkeley.EDU.m4 \
+ ${CFDIR}/domain/berkeley-only.m4 \
+ ${CFDIR}/domain/generic.m4 \
+ ${CFDIR}/feature/accept_unqualified_senders.m4 \
+ ${CFDIR}/feature/accept_unresolvable_domains.m4 \
+ ${CFDIR}/feature/access_db.m4 \
${CFDIR}/feature/allmasquerade.m4 \
${CFDIR}/feature/always_add_domain.m4 \
${CFDIR}/feature/bestmx_is_local.m4 \
${CFDIR}/feature/bitdomain.m4 \
+ ${CFDIR}/feature/blacklist_recipients.m4 \
+ ${CFDIR}/feature/loose_relay_check.m4 \
${CFDIR}/feature/domaintable.m4 \
+ ${CFDIR}/feature/genericstable.m4 \
+ ${CFDIR}/feature/limited_masquerade.m4 \
+ ${CFDIR}/feature/local_lmtp.m4 \
${CFDIR}/feature/local_procmail.m4 \
${CFDIR}/feature/mailertable.m4 \
+ ${CFDIR}/feature/masquerade_entire_domain.m4 \
+ ${CFDIR}/feature/masquerade_envelope.m4 \
${CFDIR}/feature/nocanonify.m4 \
${CFDIR}/feature/nodns.m4 \
${CFDIR}/feature/notsticky.m4 \
${CFDIR}/feature/nouucp.m4 \
${CFDIR}/feature/nullclient.m4 \
+ ${CFDIR}/feature/promiscuous_relay.m4 \
+ ${CFDIR}/feature/rbl.m4 \
${CFDIR}/feature/redirect.m4 \
+ ${CFDIR}/feature/relay_based_on_MX.m4 \
+ ${CFDIR}/feature/relay_entire_domain.m4 \
+ ${CFDIR}/feature/relay_hosts_only.m4 \
+ ${CFDIR}/feature/relay_local_from.m4 \
${CFDIR}/feature/smrsh.m4 \
${CFDIR}/feature/stickyhost.m4 \
+ ${CFDIR}/feature/use_ct_file.m4 \
${CFDIR}/feature/use_cw_file.m4 \
${CFDIR}/feature/uucpdomain.m4 \
+ ${CFDIR}/feature/virtusertable.m4 \
${CFDIR}/hack/cssubdomain.m4 \
${CFDIR}/m4/cf.m4 \
+ ${CFDIR}/m4/cfhead.m4 \
${CFDIR}/m4/nullrelay.m4 \
${CFDIR}/m4/proto.m4 \
${CFDIR}/m4/version.m4 \
@@ -77,29 +98,43 @@ M4FILES=\
${CFDIR}/mailer/smtp.m4 \
${CFDIR}/mailer/usenet.m4 \
${CFDIR}/mailer/uucp.m4 \
+ ${CFDIR}/ostype/aix2.m4 \
${CFDIR}/ostype/aix3.m4 \
+ ${CFDIR}/ostype/altos.m4 \
${CFDIR}/ostype/amdahl-uts.m4 \
${CFDIR}/ostype/aux.m4 \
${CFDIR}/ostype/bsd4.3.m4 \
${CFDIR}/ostype/bsd4.4.m4 \
${CFDIR}/ostype/bsdi1.0.m4 \
+ ${CFDIR}/ostype/bsdi2.0.m4 \
${CFDIR}/ostype/dgux.m4 \
${CFDIR}/ostype/domainos.m4 \
${CFDIR}/ostype/dynix3.2.m4 \
+ ${CFDIR}/ostype/gnuhurd.m4 \
+ ${CFDIR}/ostype/hpux10.m4 \
${CFDIR}/ostype/hpux9.m4 \
${CFDIR}/ostype/irix4.m4 \
${CFDIR}/ostype/irix5.m4 \
+ ${CFDIR}/ostype/irix6.m4 \
${CFDIR}/ostype/linux.m4 \
+ ${CFDIR}/ostype/maxion.m4 \
+ ${CFDIR}/ostype/mklinux.m4 \
${CFDIR}/ostype/nextstep.m4 \
${CFDIR}/ostype/osf1.m4 \
+ ${CFDIR}/ostype/powerux.m4 \
${CFDIR}/ostype/ptx2.m4 \
+ ${CFDIR}/ostype/qnx.m4 \
${CFDIR}/ostype/riscos4.5.m4 \
+ ${CFDIR}/ostype/sco-uw-2.1.m4 \
${CFDIR}/ostype/sco3.2.m4 \
${CFDIR}/ostype/solaris2.m4 \
+ ${CFDIR}/ostype/solaris2.ml.m4 \
${CFDIR}/ostype/sunos3.5.m4 \
${CFDIR}/ostype/sunos4.1.m4 \
${CFDIR}/ostype/svr4.m4 \
${CFDIR}/ostype/ultrix4.m4 \
+ ${CFDIR}/ostype/unknown.m4 \
+ ${CFDIR}/ostype/uxpds.m4 \
${CFDIR}/siteconfig/uucp.cogsci.m4 \
${CFDIR}/siteconfig/uucp.old.arpa.m4 \
${CFDIR}/siteconfig/uucp.ucbarpa.m4 \
diff --git a/usr.sbin/sendmail/cf/cf/chez.cs.mc b/usr.sbin/sendmail/cf/cf/chez.cs.mc
index 85f7e5c2c1b..9858330bd40 100644
--- a/usr.sbin/sendmail/cf/cf/chez.cs.mc
+++ b/usr.sbin/sendmail/cf/cf/chez.cs.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -45,7 +23,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)chez.cs.mc 8.6 (Berkeley) 3/23/96')
+VERSIONID(`@(#)chez.cs.mc 8.11 (Berkeley) 5/19/98')
OSTYPE(bsd4.4)dnl
DOMAIN(CS.Berkeley.EDU)dnl
define(`LOCAL_RELAY', vangogh.CS.Berkeley.EDU)dnl
diff --git a/usr.sbin/sendmail/cf/cf/clientproto.mc b/usr.sbin/sendmail/cf/cf/clientproto.mc
index 7cbb352c8fb..f0a6ae7d6b2 100644
--- a/usr.sbin/sendmail/cf/cf/clientproto.mc
+++ b/usr.sbin/sendmail/cf/cf/clientproto.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -49,7 +27,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)clientproto.mc 8.7 (Berkeley) 3/23/96')
+VERSIONID(`@(#)clientproto.mc 8.12 (Berkeley) 5/19/98')
OSTYPE(unknown)
FEATURE(nullclient, mailhost.$m)
diff --git a/usr.sbin/sendmail/cf/cf/cs-hpux10.mc b/usr.sbin/sendmail/cf/cf/cs-hpux10.mc
index 898f3605bc5..527f9308b99 100644
--- a/usr.sbin/sendmail/cf/cf/cs-hpux10.mc
+++ b/usr.sbin/sendmail/cf/cf/cs-hpux10.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -44,7 +22,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)cs-hpux10.mc 8.5 (Berkeley) 6/3/97')
+VERSIONID(`@(#)cs-hpux10.mc 8.10 (Berkeley) 5/19/98')
OSTYPE(hpux10)dnl
DOMAIN(CS.Berkeley.EDU)dnl
define(`MAIL_HUB', mailspool.CS.Berkeley.EDU)dnl
diff --git a/usr.sbin/sendmail/cf/cf/cs-hpux9.mc b/usr.sbin/sendmail/cf/cf/cs-hpux9.mc
index 96ff7c84e77..f65505296fe 100644
--- a/usr.sbin/sendmail/cf/cf/cs-hpux9.mc
+++ b/usr.sbin/sendmail/cf/cf/cs-hpux9.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -44,7 +22,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)cs-hpux9.mc 8.6 (Berkeley) 6/3/97')
+VERSIONID(`@(#)cs-hpux9.mc 8.11 (Berkeley) 5/19/98')
OSTYPE(hpux9)dnl
DOMAIN(CS.Berkeley.EDU)dnl
define(`MAIL_HUB', mailspool.CS.Berkeley.EDU)dnl
diff --git a/usr.sbin/sendmail/cf/cf/cs-osf1.mc b/usr.sbin/sendmail/cf/cf/cs-osf1.mc
index 95bb7f2ea4a..ba35c04ac68 100644
--- a/usr.sbin/sendmail/cf/cf/cs-osf1.mc
+++ b/usr.sbin/sendmail/cf/cf/cs-osf1.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -44,7 +22,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)cs-osf1.mc 8.5 (Berkeley) 6/3/97')
+VERSIONID(`@(#)cs-osf1.mc 8.10 (Berkeley) 5/19/98')
OSTYPE(osf1)dnl
DOMAIN(CS.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/cs-solaris2.mc b/usr.sbin/sendmail/cf/cf/cs-solaris2.mc
index 515dd121599..395d19fc7aa 100644
--- a/usr.sbin/sendmail/cf/cf/cs-solaris2.mc
+++ b/usr.sbin/sendmail/cf/cf/cs-solaris2.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -44,7 +22,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)cs-solaris2.mc 8.4 (Berkeley) 6/3/97')
+VERSIONID(`@(#)cs-solaris2.mc 8.9 (Berkeley) 5/19/98')
OSTYPE(solaris2)dnl
DOMAIN(CS.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/cs-sunos4.1.mc b/usr.sbin/sendmail/cf/cf/cs-sunos4.1.mc
index 70f134fdd3d..45dcd124d99 100644
--- a/usr.sbin/sendmail/cf/cf/cs-sunos4.1.mc
+++ b/usr.sbin/sendmail/cf/cf/cs-sunos4.1.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -44,7 +22,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)cs-sunos4.1.mc 8.5 (Berkeley) 6/3/97')
+VERSIONID(`@(#)cs-sunos4.1.mc 8.10 (Berkeley) 5/19/98')
OSTYPE(sunos4.1)dnl
DOMAIN(CS.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/cs-ultrix4.mc b/usr.sbin/sendmail/cf/cf/cs-ultrix4.mc
index 8888be7e934..f2a4b423b90 100644
--- a/usr.sbin/sendmail/cf/cf/cs-ultrix4.mc
+++ b/usr.sbin/sendmail/cf/cf/cs-ultrix4.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -44,7 +22,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)cs-ultrix4.mc 8.5 (Berkeley) 6/3/97')
+VERSIONID(`@(#)cs-ultrix4.mc 8.10 (Berkeley) 5/19/98')
OSTYPE(ultrix4)dnl
DOMAIN(CS.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/generic-bsd4.4.mc b/usr.sbin/sendmail/cf/cf/generic-bsd4.4.mc
index 25783a324d7..106fa31c44d 100644
--- a/usr.sbin/sendmail/cf/cf/generic-bsd4.4.mc
+++ b/usr.sbin/sendmail/cf/cf/generic-bsd4.4.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -42,7 +20,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)generic-bsd4.4.mc 8.2 (Berkeley) 3/23/96')
+VERSIONID(`@(#)generic-bsd4.4.mc 8.7 (Berkeley) 5/19/98')
OSTYPE(bsd4.4)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/generic-hpux10.mc b/usr.sbin/sendmail/cf/cf/generic-hpux10.mc
index 48828eb0246..1a7eda90942 100644
--- a/usr.sbin/sendmail/cf/cf/generic-hpux10.mc
+++ b/usr.sbin/sendmail/cf/cf/generic-hpux10.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -41,7 +19,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)generic-hpux10.mc 8.3 (Berkeley) 3/23/96')
+VERSIONID(`@(#)generic-hpux10.mc 8.8 (Berkeley) 5/19/98')
OSTYPE(hpux10)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/generic-hpux9.mc b/usr.sbin/sendmail/cf/cf/generic-hpux9.mc
index 3c89e433000..6aaf3b65e3d 100644
--- a/usr.sbin/sendmail/cf/cf/generic-hpux9.mc
+++ b/usr.sbin/sendmail/cf/cf/generic-hpux9.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -41,7 +19,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)generic-hpux9.mc 8.3 (Berkeley) 3/23/96')
+VERSIONID(`@(#)generic-hpux9.mc 8.8 (Berkeley) 5/19/98')
OSTYPE(hpux9)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/generic-nextstep3.3.mc b/usr.sbin/sendmail/cf/cf/generic-nextstep3.3.mc
index 7383c0ba0bc..5c81faaf6e7 100644
--- a/usr.sbin/sendmail/cf/cf/generic-nextstep3.3.mc
+++ b/usr.sbin/sendmail/cf/cf/generic-nextstep3.3.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -41,7 +19,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)generic-nextstep3.3.mc 8.2 (Berkeley) 3/23/96')
+VERSIONID(`@(#)generic-nextstep3.3.mc 8.7 (Berkeley) 5/19/98')
OSTYPE(nextstep)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/generic-osf1.mc b/usr.sbin/sendmail/cf/cf/generic-osf1.mc
index bb74d18ab27..2113b927223 100644
--- a/usr.sbin/sendmail/cf/cf/generic-osf1.mc
+++ b/usr.sbin/sendmail/cf/cf/generic-osf1.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -41,7 +19,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)generic-osf1.mc 8.3 (Berkeley) 3/23/96')
+VERSIONID(`@(#)generic-osf1.mc 8.8 (Berkeley) 5/19/98')
OSTYPE(osf1)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/generic-solaris2.mc b/usr.sbin/sendmail/cf/cf/generic-solaris2.mc
index 21fab9fba6b..1e1aa96a6c4 100644
--- a/usr.sbin/sendmail/cf/cf/generic-solaris2.mc
+++ b/usr.sbin/sendmail/cf/cf/generic-solaris2.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -41,7 +19,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)generic-solaris2.mc 8.3 (Berkeley) 3/23/96')
+VERSIONID(`@(#)generic-solaris2.mc 8.8 (Berkeley) 5/19/98')
OSTYPE(solaris2)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/generic-sunos4.1.mc b/usr.sbin/sendmail/cf/cf/generic-sunos4.1.mc
index eeff027a6ab..7e916c15ea8 100644
--- a/usr.sbin/sendmail/cf/cf/generic-sunos4.1.mc
+++ b/usr.sbin/sendmail/cf/cf/generic-sunos4.1.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -41,7 +19,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)generic-sunos4.1.mc 8.3 (Berkeley) 3/23/96')
+VERSIONID(`@(#)generic-sunos4.1.mc 8.8 (Berkeley) 5/19/98')
OSTYPE(sunos4.1)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/generic-ultrix4.mc b/usr.sbin/sendmail/cf/cf/generic-ultrix4.mc
index dd30936d10b..8c900b86e71 100644
--- a/usr.sbin/sendmail/cf/cf/generic-ultrix4.mc
+++ b/usr.sbin/sendmail/cf/cf/generic-ultrix4.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -41,7 +19,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)generic-ultrix4.mc 8.3 (Berkeley) 3/23/96')
+VERSIONID(`@(#)generic-ultrix4.mc 8.8 (Berkeley) 5/19/98')
OSTYPE(ultrix4)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/huginn.cs.mc b/usr.sbin/sendmail/cf/cf/huginn.cs.mc
index aad442b4d84..949e917882d 100644
--- a/usr.sbin/sendmail/cf/cf/huginn.cs.mc
+++ b/usr.sbin/sendmail/cf/cf/huginn.cs.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -43,7 +21,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)huginn.cs.mc 8.7 (Berkeley) 3/23/96')
+VERSIONID(`@(#)huginn.cs.mc 8.12 (Berkeley) 5/19/98')
OSTYPE(hpux9)dnl
DOMAIN(CS.Berkeley.EDU)dnl
MASQUERADE_AS(CS.Berkeley.EDU)dnl
diff --git a/usr.sbin/sendmail/cf/cf/knecht.mc b/usr.sbin/sendmail/cf/cf/knecht.mc
index 71ae12b69bd..97e5e43eb36 100644
--- a/usr.sbin/sendmail/cf/cf/knecht.mc
+++ b/usr.sbin/sendmail/cf/cf/knecht.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -38,7 +16,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)knecht.mc 8.15 (Berkeley) 10/20/97')
+VERSIONID(`@(#)knecht.mc 8.30 (Berkeley) 6/11/98')
OSTYPE(bsd4.4)dnl
DOMAIN(generic)dnl
define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward+$h:$z/.forward')dnl
@@ -47,98 +25,47 @@ define(`confHOST_STATUS_DIRECTORY', `.hoststat')dnl
define(`confTO_ICONNECT', `10s')dnl
define(`confCOPY_ERRORS_TO', `Postmaster')dnl
define(`confTO_QUEUEWARN', `8h')dnl
+define(`confTRUSTED_USERS', `www')dnl
define(`confPRIVACY_FLAGS', ``authwarnings,noexpn,novrfy'')dnl
-define(`LOCAL_MAILER_FLAGS', `rmn9P')dnl
FEATURE(virtusertable)dnl
+FEATURE(access_db)dnl
+FEATURE(local_lmtp)dnl
+define(`LOCAL_MAILER_FLAGS', LOCAL_MAILER_FLAGS`'P)dnl
MAILER(local)dnl
MAILER(smtp)dnl
LOCAL_CONFIG
-# domains that are not us but which we will relay
-FR-o /etc/sendmail.cR
-
-# domain override table to accept unresolvable/reject resolvable domains
-Kdomaincheck hash -o /etc/domaincheck
+#
+# Regular expression to reject:
+# * numeric-only localparts from aol.com and msn.com
+# * localparts starting with a digit from juno.com
+# * localparts longer than 10 characters from aol.com
+#
+Kcheckaddress regex -a@MATCH
+ ^([0-9]+<@(aol|msn)\.com|[0-9][^<]*<@juno\.com|.{10}[^<]+<@aol\.com)\.?>
+#
+# Names that won't be allowed in a To: line (local-part and domains)
+#
+C{RejectToLocalparts} friend you
+C{RejectToDomains} public.com
LOCAL_RULESETS
+HTo: $>CheckTo
-######################################################################
-### LookUpDomain -- search for domain in domaincheck database
-###
-### Parameters:
-### <$1> -- key (domain name)
-### <$2> -- default (what to return if not found in db)
-### <$3> -- passthru (additional data passed through)
-######################################################################
-
-SLookUpDomain
-R<$+> <$+> <$*> $: < $( domaincheck $1 $: ? $) > <$1> <$2> <$3>
-R<OK> <$+> <$+> <$*> $@ <OK> < $3 >
-R<?> <$+.$+> <$+> <$*> $@ $>LookUpDomain <. $2> <$3> <$4>
-R<?> <$+> <$+> <$*> $@ <$2> <$3>
-R<$+> $* $#error $: $1
-
-
-######################################################################
-### LookUpAddress -- search for host address in domaincheck database
-###
-### Parameters:
-### <$1> -- key (dot quadded host address)
-### <$2> -- default (what to return if not found in db)
-### <$3> -- passthru (additional data passed through)
-######################################################################
+SCheckTo
+R$={RejectToLocalparts}@$* $#error $: "553 Header error"
+R$*@$={RejectToDomains} $#error $: "553 Header error"
-SLookUpAddress
-R<$+> <$+> <$*> $: < $( domaincheck $1 $: ? $) > <$1> <$2> <$3>
-R<OK> <$+> <$+> <$*> $@ <OK> < $3 >
-R<?> <$+.$-> <$+> <$*> $@ $>LookUpAddress <$1> <$3> <$4>
-R<?> <$+> <$+> <$*> $@ <$2> <$3>
-R<$+> $* $#error $: $1
+HMessage-Id: $>CheckMessageId
-######################################################################
-### check_relay
-######################################################################
+SCheckMessageId
+R< $+ @ $+ > $@ OK
+R$* $#error $: "553 Header error"
-Scheck_relay
-R$+ $| $+ $: $>LookUpDomain < $1 > <?> < $2 >
-R<?> < $+ > $: $>LookUpAddress < $1 > <OK> <>
-
-######################################################################
-### check_mail
-######################################################################
-
-Scheck_mail
-R<> $@ <OK>
-R$* $: <?> $>Parse0 $>3 $1 make domain canonical
-R<?> $* < @ $+ . > $* $: <OK> $1 < @ $2 > $3 pick default tag
-R<?> $* < @ $+ > $* $: <FAIL> $1 < @ $2 > $3 ... OK or FAIL
-R<$+> $* < @ $+ > $* $: $>LookUpDomain <$3> <$1> <>
-R<OK> $* $@ <OK>
-R<FAIL> $* $#error $: 451 Sender domain must resolve
-
-# handle case of no @domain on address
-R<?> $* $: < ? $&{client_name} > $1
-R<?> $* $@ <OK> ...local unqualed ok
-R<? $+> $* $#error $: 550 Domain name required
- ...remote is not
-R<$+> $* $#error $: $1 error from domaincheck
-
-######################################################################
-### check_rcpt
-######################################################################
-
-Scheck_rcpt
-# anything terminating locally is ok
-R$* $: $>Parse0 $>3 $1 strip local crud
-R$+ < @ $=w . > $@ OK
-R$+ < @ $* $=R . > $@ OK
-
-# anything originating locally is ok
-R$* $: $(dequote "" $&{client_name} $)
-R$=w $@ OK
-R$=R $@ OK
-R$@ $@ OK
-
-# anything else is bogus
-R$* $#error $: "550 Relaying Denied"
+LOCAL_RULESETS
+SLocal_check_mail
+# check address against various regex checks
+R$* $: $>Parse0 $>3 $1
+R$+ $: $(checkaddress $1 $)
+R@MATCH $#error $: "553 Header error"
diff --git a/usr.sbin/sendmail/cf/cf/mail.cs.mc b/usr.sbin/sendmail/cf/cf/mail.cs.mc
index 02a3acf7321..1ecf34e2a91 100644
--- a/usr.sbin/sendmail/cf/cf/mail.cs.mc
+++ b/usr.sbin/sendmail/cf/cf/mail.cs.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -43,7 +21,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)mail.cs.mc 8.10 (Berkeley) 3/23/96')
+VERSIONID(`@(#)mail.cs.mc 8.15 (Berkeley) 5/19/98')
OSTYPE(ultrix4)dnl
DOMAIN(Berkeley.EDU)dnl
MASQUERADE_AS(CS.Berkeley.EDU)dnl
diff --git a/usr.sbin/sendmail/cf/cf/mail.eecs.mc b/usr.sbin/sendmail/cf/cf/mail.eecs.mc
index 756f5ddefd5..42d053d70ee 100644
--- a/usr.sbin/sendmail/cf/cf/mail.eecs.mc
+++ b/usr.sbin/sendmail/cf/cf/mail.eecs.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -43,7 +21,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)mail.eecs.mc 8.10 (Berkeley) 3/23/96')
+VERSIONID(`@(#)mail.eecs.mc 8.15 (Berkeley) 5/19/98')
OSTYPE(ultrix4)dnl
DOMAIN(EECS.Berkeley.EDU)dnl
MASQUERADE_AS(EECS.Berkeley.EDU)dnl
diff --git a/usr.sbin/sendmail/cf/cf/mailspool.cs.mc b/usr.sbin/sendmail/cf/cf/mailspool.cs.mc
index de0a7d7d1ad..7ae62b24d60 100644
--- a/usr.sbin/sendmail/cf/cf/mailspool.cs.mc
+++ b/usr.sbin/sendmail/cf/cf/mailspool.cs.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -45,7 +23,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)mailspool.cs.mc 8.4 (Berkeley) 3/23/96')
+VERSIONID(`@(#)mailspool.cs.mc 8.9 (Berkeley) 5/19/98')
OSTYPE(sunos4.1)dnl
DOMAIN(CS.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/python.cs.mc b/usr.sbin/sendmail/cf/cf/python.cs.mc
index e049d66185a..2cb111d0b65 100644
--- a/usr.sbin/sendmail/cf/cf/python.cs.mc
+++ b/usr.sbin/sendmail/cf/cf/python.cs.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -45,7 +23,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)python.cs.mc 8.4 (Berkeley) 3/23/96')
+VERSIONID(`@(#)python.cs.mc 8.9 (Berkeley) 5/19/98')
OSTYPE(bsd4.4)dnl
DOMAIN(CS.Berkeley.EDU)dnl
define(`LOCAL_RELAY', vangogh.CS.Berkeley.EDU)dnl
diff --git a/usr.sbin/sendmail/cf/cf/s2k-osf1.mc b/usr.sbin/sendmail/cf/cf/s2k-osf1.mc
index ed2d4887fb8..1c7b1ccd1d7 100644
--- a/usr.sbin/sendmail/cf/cf/s2k-osf1.mc
+++ b/usr.sbin/sendmail/cf/cf/s2k-osf1.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -44,7 +22,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)s2k-osf1.mc 8.5 (Berkeley) 6/3/97')
+VERSIONID(`@(#)s2k-osf1.mc 8.10 (Berkeley) 5/19/98')
OSTYPE(osf1)dnl
DOMAIN(S2K.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/s2k-ultrix4.mc b/usr.sbin/sendmail/cf/cf/s2k-ultrix4.mc
index 12fb9602462..06c70d45be6 100644
--- a/usr.sbin/sendmail/cf/cf/s2k-ultrix4.mc
+++ b/usr.sbin/sendmail/cf/cf/s2k-ultrix4.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -44,7 +22,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)s2k-ultrix4.mc 8.5 (Berkeley) 6/3/97')
+VERSIONID(`@(#)s2k-ultrix4.mc 8.10 (Berkeley) 5/19/98')
OSTYPE(ultrix4)dnl
DOMAIN(S2K.Berkeley.EDU)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/tcpproto.mc b/usr.sbin/sendmail/cf/cf/tcpproto.mc
index d023185ccbd..eb6eadecb65 100644
--- a/usr.sbin/sendmail/cf/cf/tcpproto.mc
+++ b/usr.sbin/sendmail/cf/cf/tcpproto.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -47,7 +25,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)tcpproto.mc 8.5 (Berkeley) 3/23/96')
+VERSIONID(`@(#)tcpproto.mc 8.10 (Berkeley) 5/19/98')
OSTYPE(unknown)
FEATURE(nouucp)
MAILER(local)
diff --git a/usr.sbin/sendmail/cf/cf/ucbarpa.mc b/usr.sbin/sendmail/cf/cf/ucbarpa.mc
index 5fe99d00476..925d47fefb7 100644
--- a/usr.sbin/sendmail/cf/cf/ucbarpa.mc
+++ b/usr.sbin/sendmail/cf/cf/ucbarpa.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -42,7 +20,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)ucbarpa.mc 8.4 (Berkeley) 3/23/96')
+VERSIONID(`@(#)ucbarpa.mc 8.9 (Berkeley) 5/19/98')
DOMAIN(CS.Berkeley.EDU)dnl
OSTYPE(bsd4.4)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/cf/ucbvax.mc b/usr.sbin/sendmail/cf/cf/ucbvax.mc
index 89a0f1014cd..76027fb951e 100644
--- a/usr.sbin/sendmail/cf/cf/ucbvax.mc
+++ b/usr.sbin/sendmail/cf/cf/ucbvax.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -43,7 +21,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)ucbvax.mc 8.6 (Berkeley) 3/23/96')
+VERSIONID(`@(#)ucbvax.mc 8.11 (Berkeley) 5/19/98')
OSTYPE(bsd4.3)
DOMAIN(CS.Berkeley.EDU)
MASQUERADE_AS(CS.Berkeley.EDU)
diff --git a/usr.sbin/sendmail/cf/cf/uucpproto.mc b/usr.sbin/sendmail/cf/cf/uucpproto.mc
index 6a21156ed52..4f1c54a332e 100644
--- a/usr.sbin/sendmail/cf/cf/uucpproto.mc
+++ b/usr.sbin/sendmail/cf/cf/uucpproto.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -47,8 +25,9 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)uucpproto.mc 8.6 (Berkeley) 3/23/96')
+VERSIONID(`@(#)uucpproto.mc 8.12 (Berkeley) 5/19/98')
OSTYPE(unknown)
-FEATURE(nodns)dnl
+FEATURE(promiscuous_relay)dnl
+FEATURE(accept_unresolvable_domains)dnl
MAILER(local)dnl
MAILER(uucp)dnl
diff --git a/usr.sbin/sendmail/cf/cf/vangogh.cs.mc b/usr.sbin/sendmail/cf/cf/vangogh.cs.mc
index 95a15e922ed..deefc29febd 100644
--- a/usr.sbin/sendmail/cf/cf/vangogh.cs.mc
+++ b/usr.sbin/sendmail/cf/cf/vangogh.cs.mc
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -44,7 +22,7 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`@(#)vangogh.cs.mc 8.5 (Berkeley) 3/23/96')
+VERSIONID(`@(#)vangogh.cs.mc 8.10 (Berkeley) 5/19/98')
DOMAIN(CS.Berkeley.EDU)dnl
OSTYPE(bsd4.4)dnl
MAILER(local)dnl
diff --git a/usr.sbin/sendmail/cf/domain/Berkeley.EDU.m4 b/usr.sbin/sendmail/cf/domain/Berkeley.EDU.m4
index 2bad42bc306..48e151b7b28 100644
--- a/usr.sbin/sendmail/cf/domain/Berkeley.EDU.m4
+++ b/usr.sbin/sendmail/cf/domain/Berkeley.EDU.m4
@@ -1,39 +1,17 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)Berkeley.EDU.m4 8.9 (Berkeley) 10/5/95')
+VERSIONID(`@(#)Berkeley.EDU.m4 8.14 (Berkeley) 5/19/98')
DOMAIN(berkeley-only)dnl
define(`BITNET_RELAY', `bitnet-relay.Berkeley.EDU')dnl
define(`UUCP_RELAY', `uucp-relay.Berkeley.EDU')dnl
diff --git a/usr.sbin/sendmail/cf/domain/CS.Berkeley.EDU.m4 b/usr.sbin/sendmail/cf/domain/CS.Berkeley.EDU.m4
index 97ccfb20899..20309210b8c 100644
--- a/usr.sbin/sendmail/cf/domain/CS.Berkeley.EDU.m4
+++ b/usr.sbin/sendmail/cf/domain/CS.Berkeley.EDU.m4
@@ -1,39 +1,17 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)CS.Berkeley.EDU.m4 8.2 (Berkeley) 4/21/95')
+VERSIONID(`@(#)CS.Berkeley.EDU.m4 8.7 (Berkeley) 5/19/98')
DOMAIN(Berkeley.EDU)dnl
HACK(cssubdomain)dnl
define(`confUSERDB_SPEC',
diff --git a/usr.sbin/sendmail/cf/domain/EECS.Berkeley.EDU.m4 b/usr.sbin/sendmail/cf/domain/EECS.Berkeley.EDU.m4
index a41fc7ed823..022dddd13a5 100644
--- a/usr.sbin/sendmail/cf/domain/EECS.Berkeley.EDU.m4
+++ b/usr.sbin/sendmail/cf/domain/EECS.Berkeley.EDU.m4
@@ -1,38 +1,16 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)EECS.Berkeley.EDU.m4 8.2 (Berkeley) 4/21/95')
+VERSIONID(`@(#)EECS.Berkeley.EDU.m4 8.7 (Berkeley) 5/19/98')
DOMAIN(Berkeley.EDU)dnl
MASQUERADE_AS(EECS.Berkeley.EDU)dnl
diff --git a/usr.sbin/sendmail/cf/domain/S2K.Berkeley.EDU.m4 b/usr.sbin/sendmail/cf/domain/S2K.Berkeley.EDU.m4
index 4aed130b7ba..14965a6bff0 100644
--- a/usr.sbin/sendmail/cf/domain/S2K.Berkeley.EDU.m4
+++ b/usr.sbin/sendmail/cf/domain/S2K.Berkeley.EDU.m4
@@ -1,38 +1,16 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)S2K.Berkeley.EDU.m4 8.2 (Berkeley) 4/21/95')
+VERSIONID(`@(#)S2K.Berkeley.EDU.m4 8.7 (Berkeley) 5/19/98')
DOMAIN(CS.Berkeley.EDU)dnl
MASQUERADE_AS(postgres.Berkeley.EDU)dnl
diff --git a/usr.sbin/sendmail/cf/domain/berkeley-only.m4 b/usr.sbin/sendmail/cf/domain/berkeley-only.m4
index ef710714ea9..d3d770811c6 100644
--- a/usr.sbin/sendmail/cf/domain/berkeley-only.m4
+++ b/usr.sbin/sendmail/cf/domain/berkeley-only.m4
@@ -1,39 +1,17 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)unspecified-domain.m4 8.2 (Berkeley) 4/21/95')
+VERSIONID(`@(#)unspecified-domain.m4 8.7 (Berkeley) 5/19/98')
errprint(`*** ERROR: You are trying to use the Berkeley sample configuration')
errprint(` files outside of the Computer Science Division at Berkeley.')
errprint(` The configuration (.mc) files must be customized to reference')
diff --git a/usr.sbin/sendmail/cf/domain/generic.m4 b/usr.sbin/sendmail/cf/domain/generic.m4
index ca91f50f112..1329e4499b8 100644
--- a/usr.sbin/sendmail/cf/domain/generic.m4
+++ b/usr.sbin/sendmail/cf/domain/generic.m4
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -41,7 +19,7 @@ divert(-1)
# files.
#
divert(0)
-VERSIONID(`@(#)generic.m4 8.3 (Berkeley) 3/24/96')
-define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward')dnl
+VERSIONID(`@(#)generic.m4 8.9 (Berkeley) 5/19/98')
+define(`confFORWARD_PATH', `$z/.forward.$w+$h:$z/.forward+$h:$z/.forward.$w:$z/.forward')dnl
FEATURE(redirect)dnl
FEATURE(use_cw_file)dnl
diff --git a/usr.sbin/sendmail/cf/feature/bestmx_is_local.m4 b/usr.sbin/sendmail/cf/feature/bestmx_is_local.m4
index 3849623f051..2d3048809ec 100644
--- a/usr.sbin/sendmail/cf/feature/bestmx_is_local.m4
+++ b/usr.sbin/sendmail/cf/feature/bestmx_is_local.m4
@@ -1,48 +1,26 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)bestmx_is_local.m4 8.5 (Berkeley) 3/28/97')
+VERSIONID(`@(#)bestmx_is_local.m4 8.12 (Berkeley) 5/19/98')
divert(-1)
LOCAL_CONFIG
# turn on bestMX lookup table
Kbestmx bestmx
-
+ifelse(_ARG_, `', `dnl',`
# limit bestmx to these domains
-CB`'_ARG_
+CB`'_ARG_')
LOCAL_NET_CONFIG
@@ -57,10 +35,12 @@ LOCAL_NET_CONFIG
# low to medium traffic hosts. If you use the limited bestmx
# by passing in a set of possible domains it will improve things.
-ifelse(_ARG_, `', `', `#')dnl unlimited bestmx
-R$* < @ $* > $* $: $1 < @ $2 @@ $(bestmx $2 $) > $3
-ifelse(_ARG_, `', `#', `')dnl limit bestmx to $=B
-R$* < @ $* $=B . > $* $: $1 < @ $2 $3 . @@ $(bestmx $2 $3 . $) > $4
+ifelse(_ARG_, `', `dnl
+# unlimited bestmx
+R$* < @ $* > $* $: $1 < @ $2 @@ $(bestmx $2 $) > $3',
+`dnl
+# limit bestmx to $=B
+R$* < @ $* $=B . > $* $: $1 < @ $2 $3 . @@ $(bestmx $2 $3 . $) > $4')
R$* $=O $* < @ $* @@ $=w . > $* $@ $>97 $1 $2 $3
R$* < @ $* @@ $=w . > $* $#local $: $1
R$* < @ $* @@ $* > $* $: $1 < @ $2 > $4
diff --git a/usr.sbin/sendmail/cf/feature/genericstable.m4 b/usr.sbin/sendmail/cf/feature/genericstable.m4
index 50fbbd0f25f..ec7a4d3f7d5 100644
--- a/usr.sbin/sendmail/cf/feature/genericstable.m4
+++ b/usr.sbin/sendmail/cf/feature/genericstable.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)genericstable.m4 8.1 (Berkeley) 2/11/96')
+VERSIONID(`@(#)genericstable.m4 8.7 (Berkeley) 5/19/98')
divert(-1)
-define(`GENERICS_TABLE', ifelse(_ARG_, `', `hash -o /etc/genericstable', `_ARG_'))dnl
+define(`GENERICS_TABLE', ifelse(_ARG_, `', DATABASE_MAP_TYPE` -o /etc/genericstable', `_ARG_'))dnl
diff --git a/usr.sbin/sendmail/cf/feature/limited_masquerade.m4 b/usr.sbin/sendmail/cf/feature/limited_masquerade.m4
index fc4f5eaf3fc..ae5e868ed96 100644
--- a/usr.sbin/sendmail/cf/feature/limited_masquerade.m4
+++ b/usr.sbin/sendmail/cf/feature/limited_masquerade.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)limited_masquerade.m4 8.1 (Berkeley) 2/11/96')
+VERSIONID(`@(#)limited_masquerade.m4 8.6 (Berkeley) 5/19/98')
divert(-1)
define(`_LIMITED_MASQUERADE_', 1)
diff --git a/usr.sbin/sendmail/cf/feature/local_procmail.m4 b/usr.sbin/sendmail/cf/feature/local_procmail.m4
index db0cc87964c..adf1237b398 100644
--- a/usr.sbin/sendmail/cf/feature/local_procmail.m4
+++ b/usr.sbin/sendmail/cf/feature/local_procmail.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1994 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1994 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)local_procmail.m4 8.6 (Berkeley) 10/20/96')
+VERSIONID(`@(#)local_procmail.m4 8.11 (Berkeley) 5/19/98')
divert(-1)
define(`LOCAL_MAILER_PATH',
diff --git a/usr.sbin/sendmail/cf/feature/masquerade_entire_domain.m4 b/usr.sbin/sendmail/cf/feature/masquerade_entire_domain.m4
index d94c007783b..9766ae4499a 100644
--- a/usr.sbin/sendmail/cf/feature/masquerade_entire_domain.m4
+++ b/usr.sbin/sendmail/cf/feature/masquerade_entire_domain.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)masquerade_entire_domain.m4 8.1 (Berkeley) 2/11/96')
+VERSIONID(`@(#)masquerade_entire_domain.m4 8.6 (Berkeley) 5/19/98')
divert(-1)
define(`_MASQUERADE_ENTIRE_DOMAIN_', 1)
diff --git a/usr.sbin/sendmail/cf/feature/masquerade_envelope.m4 b/usr.sbin/sendmail/cf/feature/masquerade_envelope.m4
index 1e6010856ea..75d257e64f5 100644
--- a/usr.sbin/sendmail/cf/feature/masquerade_envelope.m4
+++ b/usr.sbin/sendmail/cf/feature/masquerade_envelope.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)masquerade_envelope.m4 8.1 (Berkeley) 7/9/95')
+VERSIONID(`@(#)masquerade_envelope.m4 8.6 (Berkeley) 5/19/98')
divert(-1)
define(`_MASQUERADE_ENVELOPE_', 1)
diff --git a/usr.sbin/sendmail/cf/feature/notsticky.m4 b/usr.sbin/sendmail/cf/feature/notsticky.m4
index 027b8e3a51c..4fa344d7069 100644
--- a/usr.sbin/sendmail/cf/feature/notsticky.m4
+++ b/usr.sbin/sendmail/cf/feature/notsticky.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)notsticky.m4 8.3 (Berkeley) 5/29/95')
+VERSIONID(`@(#)notsticky.m4 8.8 (Berkeley) 5/19/98')
#
# This is now the default. Use ``FEATURE(stickyhost)'' if you want
# the old default behaviour.
diff --git a/usr.sbin/sendmail/cf/feature/nullclient.m4 b/usr.sbin/sendmail/cf/feature/nullclient.m4
index 6eaa8c1aeca..1df782e24de 100644
--- a/usr.sbin/sendmail/cf/feature/nullclient.m4
+++ b/usr.sbin/sendmail/cf/feature/nullclient.m4
@@ -1,36 +1,14 @@
PUSHDIVERT(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
ifdef(`SMTP_MAILER_FLAGS',, `define(`SMTP_MAILER_FLAGS', `')')
define(_NULL_CLIENT_ONLY_, `1')
@@ -45,7 +23,7 @@ POPDIVERT
# sendmail.
#
-VERSIONID(`@(#)nullclient.m4 8.7 (Berkeley) 2/11/96')
+VERSIONID(`@(#)nullclient.m4 8.12 (Berkeley) 5/19/98')
PUSHDIVERT(6)
# hub host (to which all mail is sent)
diff --git a/usr.sbin/sendmail/cf/feature/redirect.m4 b/usr.sbin/sendmail/cf/feature/redirect.m4
index 27f23576535..721d2260c28 100644
--- a/usr.sbin/sendmail/cf/feature/redirect.m4
+++ b/usr.sbin/sendmail/cf/feature/redirect.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)redirect.m4 8.5 (Berkeley) 8/17/96')
+VERSIONID(`@(#)redirect.m4 8.10 (Berkeley) 5/19/98')
divert(-1)
diff --git a/usr.sbin/sendmail/cf/feature/smrsh.m4 b/usr.sbin/sendmail/cf/feature/smrsh.m4
index 6b4faab2526..2c47632649b 100644
--- a/usr.sbin/sendmail/cf/feature/smrsh.m4
+++ b/usr.sbin/sendmail/cf/feature/smrsh.m4
@@ -1,42 +1,23 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)smrsh.m4 8.2 (Berkeley) 11/11/95')
+VERSIONID(`@(#)smrsh.m4 8.8 (Berkeley) 5/19/98')
divert(-1)
ifdef(`_MAILER_local_',
`errprint(`*** FEATURE(smrsh) must occur before MAILER(local)')')dnl
-define(`LOCAL_SHELL_PATH', ifelse(_ARG_, `', `/usr/local/etc/smrsh', _ARG_))
+define(`LOCAL_SHELL_PATH',
+ ifelse(_ARG_, `',
+ ifdef(`confEBINDIR', confEBINDIR, `/usr/libexec')`/smrsh',
+ _ARG_))
diff --git a/usr.sbin/sendmail/cf/feature/stickyhost.m4 b/usr.sbin/sendmail/cf/feature/stickyhost.m4
index bdd9c9a729f..8bbeb49cac6 100644
--- a/usr.sbin/sendmail/cf/feature/stickyhost.m4
+++ b/usr.sbin/sendmail/cf/feature/stickyhost.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)stickyhost.m4 8.1 (Berkeley) 11/12/94')
+VERSIONID(`@(#)stickyhost.m4 8.6 (Berkeley) 5/19/98')
divert(-1)
define(`_STICKY_LOCAL_DOMAIN_', 1)
diff --git a/usr.sbin/sendmail/cf/feature/use_ct_file.m4 b/usr.sbin/sendmail/cf/feature/use_ct_file.m4
index c33bbfd7833..344d178504d 100644
--- a/usr.sbin/sendmail/cf/feature/use_ct_file.m4
+++ b/usr.sbin/sendmail/cf/feature/use_ct_file.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)use_ct_file.m4 8.1 (Berkeley) 9/17/95')
+VERSIONID(`@(#)use_ct_file.m4 8.6 (Berkeley) 5/19/98')
divert(-1)
# if defined, the sendmail.cf will read the /etc/sendmail.ct file
diff --git a/usr.sbin/sendmail/cf/feature/virtusertable.m4 b/usr.sbin/sendmail/cf/feature/virtusertable.m4
index 91db88c2562..337f635766c 100644
--- a/usr.sbin/sendmail/cf/feature/virtusertable.m4
+++ b/usr.sbin/sendmail/cf/feature/virtusertable.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)virtusertable.m4 8.1 (Berkeley) 2/11/96')
+VERSIONID(`@(#)virtusertable.m4 8.7 (Berkeley) 5/19/98')
divert(-1)
-define(`VIRTUSER_TABLE', ifelse(_ARG_, `', `hash -o /etc/virtusertable', `_ARG_'))dnl
+define(`VIRTUSER_TABLE', ifelse(_ARG_, `', DATABASE_MAP_TYPE` -o /etc/virtusertable', `_ARG_'))dnl
diff --git a/usr.sbin/sendmail/cf/m4/cf.m4 b/usr.sbin/sendmail/cf/m4/cf.m4
index 4e54f414289..21655822b22 100644
--- a/usr.sbin/sendmail/cf/m4/cf.m4
+++ b/usr.sbin/sendmail/cf/m4/cf.m4
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983, 1995 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
@@ -47,4 +25,4 @@ ifdef(`_CF_DIR_', `',
divert(0)dnl
ifdef(`OSTYPE', `dnl',
`include(_CF_DIR_`'m4/cfhead.m4)dnl
-VERSIONID(`@(#)cf.m4 8.24 (Berkeley) 8/16/95')')
+VERSIONID(`@(#)cf.m4 8.29 (Berkeley) 5/19/98')')
diff --git a/usr.sbin/sendmail/cf/m4/cfhead.m4 b/usr.sbin/sendmail/cf/m4/cfhead.m4
index 6bef4c685a3..a7a109856d4 100644
--- a/usr.sbin/sendmail/cf/m4/cfhead.m4
+++ b/usr.sbin/sendmail/cf/m4/cfhead.m4
@@ -1,35 +1,13 @@
#
-# Copyright (c) 1983, 1995 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
######################################################################
@@ -118,6 +96,10 @@ define(`GENERICS_DOMAIN', `PUSHDIVERT(5)CG$1
POPDIVERT`'dnl`'')
define(`GENERICS_DOMAIN_FILE', `PUSHDIVERT(5)FG$1
POPDIVERT`'dnl`'')
+define(`RELAY_DOMAIN', `PUSHDIVERT(5)CR$1
+POPDIVERT`'dnl`'')
+define(`RELAY_DOMAIN_FILE', `PUSHDIVERT(5)FR$1
+POPDIVERT`'dnl`'')
define(`_OPTINS', `ifdef(`$1', `$2$1$3')')
m4wrap(`include(_CF_DIR_`m4/proto.m4')')
@@ -151,10 +133,10 @@ define(`confSAFE_QUEUE', `True')
define(`confTO_QUEUERETURN', `5d')
define(`confTO_QUEUEWARN', `4h')
define(`confTIME_ZONE', `USE_SYSTEM')
-define(`confDEF_USER_ID', `1:1')
define(`confCW_FILE', `/etc/sendmail.cw')
define(`confMIME_FORMAT_ERRORS', `True')
define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward')
+define(`confCR_FILE', `-o /etc/mail/relay-domains')
divert(0)dnl
-VERSIONID(`@(#)cfhead.m4 8.9 (Berkeley) 1/18/97')
+VERSIONID(`@(#)cfhead.m4 8.22 (Berkeley) 5/19/98')
diff --git a/usr.sbin/sendmail/cf/m4/nullrelay.m4 b/usr.sbin/sendmail/cf/m4/nullrelay.m4
index e8f96772660..02020697a86 100644
--- a/usr.sbin/sendmail/cf/m4/nullrelay.m4
+++ b/usr.sbin/sendmail/cf/m4/nullrelay.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983, 1995 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)nullrelay.m4 8.13 (Berkeley) 4/30/97')
+VERSIONID(`@(#)nullrelay.m4 8.19 (Berkeley) 5/19/98')
#
# This configuration applies only to relay-only hosts. They send
@@ -108,7 +86,7 @@ R$+ $@ $1 @ $M unadorned user')
S0
-R$*:;<@> $#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
+R$*:;<@> $#error $@ USAGE $: "List:; syntax illegal for recipient addresses"
# pass everything else to a relay host
R$* $#_RELAY_ $@ $H $: $1
diff --git a/usr.sbin/sendmail/cf/m4/proto.m4 b/usr.sbin/sendmail/cf/m4/proto.m4
index 78fa195ef2a..d8842bfff1f 100644
--- a/usr.sbin/sendmail/cf/m4/proto.m4
+++ b/usr.sbin/sendmail/cf/m4/proto.m4
@@ -1,45 +1,23 @@
divert(-1)
#
-# Copyright (c) 1983, 1995 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)proto.m4 8.151 (Berkeley) 7/31/97')
+VERSIONID(`@(#)proto.m4 8.223 (Berkeley) 6/30/98')
MAILER(local)dnl
-# level 7 config file format
-V7/Berkeley
+# level 8 config file format
+V8/Berkeley
divert(-1)
# do some sanity checking
@@ -59,6 +37,9 @@ define(`_LOCAL_', `confLOCAL_MAILER')dnl for readability only
define(`_RELAY_', `confRELAY_MAILER')dnl for readability only
define(`_UUCP_', `confUUCP_MAILER')dnl for readability only
+# set our default hashed database type
+ifdef(`DATABASE_MAP_TYPE',, `define(`DATABASE_MAP_TYPE', `hash')')
+
# back compatibility with old config files
ifdef(`confDEF_GROUP_ID',
`errprint(`*** confDEF_GROUP_ID is obsolete.')
@@ -83,6 +64,10 @@ define(`_OPTION', `ifdef(`$2', `O $1=$2', `#O $1`'ifelse($3, `',, `=$3')')')dnl
divert(0)dnl
+# override file safeties - setting this option compromises system security
+# need to set this now for the sake of class files
+_OPTION(DontBlameSendmail, `confDONT_BLAME_SENDMAIL', safe)
+
##################
# local info #
##################
@@ -129,12 +114,11 @@ CPFAX
# "Smart" relay host (may be null)
DS`'ifdef(`SMART_HOST', SMART_HOST)
+ifdef(`LUSER_RELAY', `dnl
# place to which unknown users should be forwarded
-ifdef(`LUSER_RELAY', `', `#')dnl
Kuser user -m -a<>
-ifdef(`LUSER_RELAY',
- `DL`'LUSER_RELAY',
- `#DLname_of_luser_relay')
+DL`'LUSER_RELAY',
+`dnl')
# operators that cannot be in local usernames (i.e., network indicators)
CO @ % ifdef(`_NO_UUCP_', `', `!')
@@ -145,25 +129,54 @@ C..
# a class with just a left bracket (for identifying domain literals)
C[[
+ifdef(`MAILER_TABLE', `dnl
# Mailer table (overriding domains)
-ifdef(`MAILER_TABLE',
- `Kmailertable MAILER_TABLE',
- `#Kmailertable dbm /etc/mailertable')
+Kmailertable MAILER_TABLE',
+`dnl')
+ifdef(`DOMAIN_TABLE', `dnl
# Domain table (adding domains)
-ifdef(`DOMAIN_TABLE',
- `Kdomaintable DOMAIN_TABLE',
- `#Kdomaintable dbm /etc/domaintable')
+Kdomaintable DOMAIN_TABLE',
+`dnl')
+ifdef(`GENERICS_TABLE', `dnl
# Generics table (mapping outgoing addresses)
-ifdef(`GENERICS_TABLE',
- `Kgenerics GENERICS_TABLE',
- `#Kgenerics dbm /etc/genericstable')
+Kgenerics GENERICS_TABLE',
+`dnl')
+
+ifdef(`UUDOMAIN_TABLE', `dnl
+# UUCP domain table
+Kuudomain UUDOMAIN_TABLE',
+`dnl')
+
+ifdef(`BITDOMAIN_TABLE', `dnl
+# BITNET mapping table
+Kbitdomain BITDOMAIN_TABLE',
+`dnl')
+ifdef(`VIRTUSER_TABLE', `dnl
# Virtual user table (maps incoming users)
-ifdef(`VIRTUSER_TABLE',
- `Kvirtuser VIRTUSER_TABLE',
- `#Kvirtuser dbm /etc/virtusertable')
+Kvirtuser VIRTUSER_TABLE',
+`dnl')
+
+ifdef(`ACCESS_TABLE', `dnl
+# Access list database (for spam stomping)
+Kaccess ACCESS_TABLE',
+`dnl')
+
+ifdef(`_RELAY_MX_SERVED_', `dnl
+# MX map (to allow relaying to hosts that we MX for)
+Kmxserved bestmx -z: -T<TEMP>',
+`dnl')
+
+ifdef(`_ACCEPT_UNRESOLVABLE_DOMAINS_',`dnl',`dnl
+# Resolve map (to check if a host exists in check_mail)
+Kresolve host -a<OK> -T<TEMP>')
+
+ifdef(`confCR_FILE', `dnl
+# Hosts that will permit relaying ($=R)
+FR`'confCR_FILE',
+`dnl')
# who I send unqualified names to (null means deliver locally)
DR`'ifdef(`LOCAL_RELAY', LOCAL_RELAY)
@@ -349,7 +362,7 @@ ifelse(confTIME_ZONE, `USE_SYSTEM', `#O TimeZoneSpec=',
`O TimeZoneSpec=confTIME_ZONE')
# default UID (can be username or userid:groupid)
-_OPTION(DefaultUser, `confDEF_USER_ID', nobody)
+_OPTION(DefaultUser, `confDEF_USER_ID', mailnull)
# list of locations of user database file (null means no lookup)
_OPTION(UserDatabaseSpec, `confUSERDB_SPEC', /etc/userdb)
@@ -423,6 +436,15 @@ _OPTION(SmtpGreetingMessage, `confSMTP_LOGIN_MSG')
# UNIX initial From header format (old $l macro)
_OPTION(UnixFromLine, `confFROM_LINE')
+# From: lines that have embedded newlines are unwrapped onto one line
+_OPTION(SingleLineFromHeader, `confSINGLE_LINE_FROM_HEADER', False)
+
+# Allow HELO SMTP command that does not `include' a host name
+_OPTION(AllowBogusHELO, `confALLOW_BOGUS_HELO', False)
+
+# Characters to be quoted in a full name phrase (@,;:\()[] are automatic)
+_OPTION(MustQuoteChars, `confMUST_QUOTE_CHARS', .)
+
# delimiter (operator) characters (old $o macro)
_OPTION(OperatorChars, `confOPERATORS')
@@ -433,11 +455,17 @@ _OPTION(DontInitGroups, `confDONT_INIT_GROUPS')
_OPTION(UnsafeGroupWrites, `confUNSAFE_GROUP_WRITES')
# where do errors that occur when sending errors get sent?
-_OPTION(DoubleBounceAddress, `confDOUBLE_BOUNCE_ADDRESS')
+_OPTION(DoubleBounceAddress, `confDOUBLE_BOUNCE_ADDRESS', postmaster)
# what user id do we assume for the majority of the processing?
_OPTION(RunAsUser, `confRUN_AS_USER', sendmail)
+# maximum number of recipients per SMTP envelope
+_OPTION(MaxRecipientsPerMessage, `confMAX_RCPTS_PER_MESSAGE', 100)
+
+# shall we get local names from our installed interfaces?
+_OPTION(DontProbeInterfaces, `confDONT_PROBE_INTERFACES')
+
###########################
# Message precedences #
###########################
@@ -572,12 +600,20 @@ R$* < @ [ $+ ] > $* $: $1 < @@ [ $2 ] > $3 mark [a.b.c.d]
R$* < @@ $=w > $* $: $1 < @ $j . > $3 self-literal
R$* < @@ $+ > $* $@ $1 < @ $2 > $3 canon IP addr
+ifdef(`DOMAIN_TABLE', `dnl
# look up domains in the domain table
-ifdef(`DOMAIN_TABLE', `', `#')dnl
-R$* < @ $+ > $* $: $1 < @ $(domaintable $2 $) > $3
+R$* < @ $+ > $* $: $1 < @ $(domaintable $2 $) > $3', `dnl')
undivert(2)dnl
+ifdef(`BITDOMAIN_TABLE', `dnl
+# handle BITNET mapping
+R$* < @ $+ .BITNET > $* $: $1 < @ $(bitdomain $2 $: $2.BITNET $) > $3', `dnl')
+
+ifdef(`UUDOMAIN_TABLE', `dnl
+# handle UUCP mapping
+R$* < @ $+ .UUCP > $* $: $1 < @ $(uudomain $2 $: $2.UUCP $) > $3', `dnl')
+
ifdef(`_NO_UUCP_', `dnl',
`ifdef(`UUCP_RELAY',
`# pass UUCP addresses straight through
@@ -594,15 +630,14 @@ ifdef(`_CLASS_X_',
ifdef(`_CLASS_Y_',
`R$* < @ $=Y . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl')
-define(`X', ifdef(`_NO_CANONIFY_', `#', `'))dnl
+ifdef(`_NO_CANONIFY_', `dnl', `dnl
# try UUCP traffic as a local address
-X`'R$* < @ $+ . UUCP > $* $: $1 < @ $[ $2 $] . UUCP . > $3
-X`'R$* < @ $+ . . UUCP . > $* $@ $1 < @ $2 . > $3')
-undefine(`X')dnl
-')
+R$* < @ $+ . UUCP > $* $: $1 < @ $[ $2 $] . UUCP . > $3
+R$* < @ $+ . . UUCP . > $* $@ $1 < @ $2 . > $3')
+')')
+ifdef(`_NO_CANONIFY_', `dnl', `dnl
# pass to name server to make hostname canonical
-ifdef(`_NO_CANONIFY_', `#')dnl
-R$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4
+R$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4')
# local host aliases and pseudo-domains are always canonical
R$* < @ $=w > $* $: $1 < @ $2 . > $3
@@ -662,50 +697,68 @@ R$* $@ $>0 $1
S0
R$* $: $>Parse0 $1 initial parsing
+R<@> $#_LOCAL_ $: <@> special case error msgs
R$* $: $>98 $1 handle local hacks
R$* $: $>Parse1 $1 final parsing
+#
+# Parse0 -- do initial syntax checking and eliminate local addresses.
+# This should either return with the (possibly modified) input
+# or return with a #error mailer. It should not return with a
+# #mailer other than the #error mailer.
+#
+
SParse0
-R<@> $#_LOCAL_ $: <@> special case error msgs
-R$* : $* ; <@> $#error $@ 5.1.3 $: "list:; syntax illegal for recipient addresses"
-R<@ $+> $#error $@ 5.1.1 $: "user address required"
+R<@> $@ <@> special case error msgs
+R$* : $* ; <@> $#error $@ 5.1.3 $: "List:; syntax illegal for recipient addresses"
+#R@ <@ $* > < @ $1 > catch "@@host" bogosity
+R<@ $+> $#error $@ 5.1.3 $: "User address required"
R$* $: <> $1
R<> $* < @ [ $+ ] > $* $1 < @ [ $2 ] > $3
-R<> $* <$* : $* > $* $#error $@ 5.1.1 $: "colon illegal in host name part"
+R<> $* <$* : $* > $* $#error $@ 5.1.3 $: "Colon illegal in host name part"
R<> $* $1
-R$* < @ . $* > $* $#error $@ 5.1.2 $: "invalid host name"
-R$* < @ $* .. $* > $* $#error $@ 5.1.2 $: "invalid host name"
-
-ifdef(`_MAILER_smtp_',
-`# handle numeric address spec
-R$* < @ [ $+ ] > $* $: $>98 $1 < @ [ $2 ] > $3 numeric internet spec
-R$* < @ [ $+ ] > $* $#_SMTP_ $@ [$2] $: $1 < @ [$2] > $3 still numeric: send',
- `dnl')
+R$* < @ . $* > $* $#error $@ 5.1.2 $: "Invalid host name"
+R$* < @ $* .. $* > $* $#error $@ 5.1.2 $: "Invalid host name"
# now delete the local info -- note $=O to find characters that cause forwarding
R$* < @ > $* $@ $>Parse0 $>3 $1 user@ => user
R< @ $=w . > : $* $@ $>Parse0 $>3 $2 @here:... -> ...
R$- < @ $=w . > $: $(dequote $1 $) < @ $2 . > dequote "foo"@here
-R< @ $+ > $#error $@ 5.1.1 $: "user address required"
+R< @ $+ > $#error $@ 5.1.3 $: "User address required"
R$* $=O $* < @ $=w . > $@ $>Parse0 $>3 $1 $2 $3 ...@here -> ...
+R$- $: $(dequote $1 $) < @ *LOCAL* > dequote "foo"
+R< @ *LOCAL* > $#error $@ 5.1.3 $: "User address required"
+R$* $=O $* < @ *LOCAL* >
+ $@ $>Parse0 $>3 $1 $2 $3 ...@*LOCAL* -> ...
+R$* < @ *LOCAL* > $: $1
+
+#
+# Parse1 -- the bottom half of ruleset 0.
+#
SParse1
+ifdef(`_MAILER_smtp_',
+`# handle numeric address spec
+R$* < @ [ $+ ] > $* $: $>98 $1 < @ [ $2 ] > $3 numeric internet spec
+R$* < @ [ $+ ] > $* $#_SMTP_ $@ [$2] $: $1 < @ [$2] > $3 still numeric: send',
+ `dnl')
+
+ifdef(`VIRTUSER_TABLE', `dnl
# handle virtual users
-define(`X', ifdef(`VIRTUSER_TABLE', `', `#'))dnl
-X`'R$+ < @ $=w . > $: < $(virtuser $1 @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
-X`'R<@> $+ + $* < @ $* . >
+R$+ < @ $=w . > $: < $(virtuser $1 @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
+R<@> $+ + $* < @ $* . >
$: < $(virtuser $1 + * @ $3 $@ $1 $: @ $) > $1 + $2 < @ $3 . >
-X`'R<@> $+ + $* < @ $* . >
+R<@> $+ + $* < @ $* . >
$: < $(virtuser $1 @ $3 $@ $1 $: @ $) > $1 + $2 < @ $3 . >
-X`'R<@> $+ < @ $+ . > $: < $(virtuser @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
-X`'R<@> $+ $: $1
-X`'R< error : $- $+ > $* $#error $@ $( dequote $1 $) $: $2
-X`'R< $+ > $+ < @ $+ > $: $>97 $1
-undefine(`X')dnl
+R<@> $+ < @ $+ . > $: < $(virtuser @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
+R<@> $+ $: $1
+R< error : $- $+ > $* $#error $@ $(dequote $1 $) $: $2
+R< $+ > $+ < @ $+ > $: $>97 $1',
+`dnl')
# short circuit local delivery so forwarded email works
-ifdef(`_MAILER_usenet_', `', `#')dnl
-R$+ . USENET < @ $=w . > $#usenet $: $1 handle usenet specially
+ifdef(`_MAILER_usenet_', `dnl
+R$+ . USENET < @ $=w . > $#usenet $: $1 handle usenet specially', `dnl')
ifdef(`_STICKY_LOCAL_DOMAIN_',
`R$+ < @ $=w . > $: < $H > $1 < @ $2 . > first try hub
R< $+ > $+ < $+ > $>95 < $1 > $2 < $3 > yep ....
@@ -714,14 +767,14 @@ R< > $+ < $+ > $#_LOCAL_ $: @ $1 nope, local address',
`R$=L < @ $=w . > $#_LOCAL_ $: @ $1 special local names
R$+ < @ $=w . > $#_LOCAL_ $: $1 regular local name')
-define(`X', ifdef(`MAILER_TABLE', `', `#'))dnl
+ifdef(`MAILER_TABLE', `dnl
# not local -- try mailer table lookup
-X`'R$* <@ $+ > $* $: < $2 > $1 < @ $2 > $3 extract host name
-X`'R< $+ . > $* $: < $1 > $2 strip trailing dot
-X`'R< $+ > $* $: < $(mailertable $1 $) > $2 lookup
-X`'R< $~[ : $+ > $* $>95 < $1 : $2 > $3 check -- resolved?
-X`'R< $+ > $* $: $>90 <$1> $2 try domain
-undefine(`X')dnl
+R$* <@ $+ > $* $: < $2 > $1 < @ $2 > $3 extract host name
+R< $+ . > $* $: < $1 > $2 strip trailing dot
+R< $+ > $* $: < $(mailertable $1 $) > $2 lookup
+R< $~[ : $+ > $* $>95 < $1 : $2 > $3 check -- resolved?
+R< $+ > $* $: $>90 <$1> $2 try domain',
+`dnl')
undivert(4)dnl
ifdef(`_NO_UUCP_', `dnl',
@@ -774,11 +827,7 @@ R$* < @ $* > $* $: $>95 < $S > $1 < @ $2 > $3 glue on smarthost name
# deal with other remote names
ifdef(`_MAILER_smtp_',
`R$* < @$* > $* $#_SMTP_ $@ $2 $: $1 < @ $2 > $3 user@host.domain',
-`R$* < @$* > $* $#error $@ 5.1.2 $: Unrecognized host name $2')
-
-# if this is quoted, strip the quotes and try again
-R$+ $: $(dequote $1 $) strip quotes
-R$+ $=O $+ $@ $>97 $1 $2 $3 try again
+`R$* < @$* > $* $#error $@ 5.1.2 $: "Unrecognized host name" $2')
# handle locally delivered names
R$=L $#_LOCAL_ $: @ $1 special local names
@@ -797,39 +846,39 @@ R$+ + $* $#_LOCAL_ $@ + $2 $: $1 + *
# prepend an empty "forward host" on the front
R$+ $: <> $1
-define(`X', ifdef(`LUSER_RELAY', `', `#'))dnl
+ifdef(`LUSER_RELAY', `dnl
# send unrecognized local users to a relay host
-X`'R< > $+ $: < $L . > $( user $1 $) look up user
-X`'R< $* > $+ <> $* $: < > $2 $3 found; strip $L
-X`'R< $* . > $+ $: < $1 > $2 strip extra dot
-undefine(`X')dnl
+R< > $+ $: < $L . > $(user $1 $) look up user
+R< $* > $+ <> $* $: < > $2 $3 found; strip $L
+R< $* . > $+ $: < $1 > $2 strip extra dot',
+`dnl')
# see if we have a relay or a hub
R< > $+ $: < $H > $1 try hub
R< > $+ $: < $R > $1 try relay
-R< > $+ $: < > < $1 $(dequote "" $&h $) > nope, restore +detail
+R< > $+ $: < > < $1 $&h > nope, restore +detail
R< > < $+ + $* > $* < > < $1 > + $2 $3 find the user part
R< > < $+ > + $* $#_LOCAL_ $@ $2 $: @ $1 strip the extra +
R< > < $+ > $@ $1 no +detail
-R$+ $: $1 $(dequote "" $&h $) add +detail back in
+R$+ $: $1 $&h add +detail back in
R< local : $* > $* $: $>95 < local : $1 > $2 no host extension
R< error : $* > $* $: $>95 < error : $1 > $2 no host extension
R< $- : $+ > $+ $: $>95 < $1 : $2 > $3 < @ $2 >
R< $+ > $+ $@ $>95 < $1 > $2 < @ $1 >
+ifdef(`MAILER_TABLE', `dnl
###################################################################
### Ruleset 90 -- try domain part of mailertable entry ###
###################################################################
-define(`X', ifdef(`MAILER_TABLE', `', `#'))dnl
S90
-X`'R$* <$- . $+ > $* $: $1$2 < $(mailertable .$3 $@ $1$2 $@ $2 $) > $4
-X`'R$* <$~[ : $+ > $* $>95 < $2 : $3 > $4 check -- resolved?
-X`'R$* < . $+ > $* $@ $>90 $1 . <$2> $3 no -- strip & try again
-X`'R$* < $* > $* $: < $(mailertable . $@ $1$2 $) > $3 try "."
-X`'R< $~[ : $+ > $* $>95 < $1 : $2 > $3 "." found?
-X`'R< $* > $* $@ $2 no mailertable match
-undefine(`X')dnl
+R$* <$- . $+ > $* $: $1$2 < $(mailertable .$3 $@ $1$2 $@ $2 $) > $4
+R$* <$~[ : $+ > $* $>95 < $2 : $3 > $4 check -- resolved?
+R$* < . $+ > $* $@ $>90 $1 . <$2> $3 no -- strip & try again
+R$* < $* > $* $: < $(mailertable . $@ $1$2 $) > $3 try "."
+R< $~[ : $+ > $* $>95 < $1 : $2 > $3 "." found?
+R< $* > $* $@ $2 no mailertable match',
+`dnl')
###################################################################
### Ruleset 95 -- canonify mailer:[user@]host syntax to triple ###
@@ -837,7 +886,7 @@ undefine(`X')dnl
S95
R< > $* $@ $1 strip off null relay
-R< error : $- $+ > $* $#error $@ $( dequote $1 $) $: $2
+R< error : $- $+ > $* $#error $@ $(dequote $1 $) $: $2
R< local : $* > $* $>CanonLocal < $1 > $2
R< $- : $+ @ $+ > $*<$*>$* $# $1 $@ $3 $: $2<@$3> use literal user
R< $- : $+ > $* $# $1 $@ $2 $: $3 try qualified mailer
@@ -869,33 +918,33 @@ R< $+ > $* $#_LOCAL_ $@ $2 $: $1
S93
+ifdef(`GENERICS_TABLE', `dnl
# handle generics database
-define(`X', ifdef(`GENERICS_TABLE', `', `#'))dnl
ifdef(`_GENERICS_ENTIRE_DOMAIN_',
-`X`'R$+ < @ $* $=G . > $: < $1@$2$3 > $1 < @ $2$3 . > @ mark',
-`X`'R$+ < @ $=G . > $: < $1@$2 > $1 < @ $2 . > @ mark')
-X`'R$+ < @ *LOCAL* > $: < $1@$j > $1 < @ *LOCAL* > @ mark
-X`'R< $+ > $+ < $* > @ $: < $(generics $1 $: $) > $2 < $3 >
-X`'R< > $+ < @ $+ > $: < $(generics $1 $: $) > $1 < @ $2 >
-X`'R< $* @ $* > $* < $* > $@ $>3 $1 @ $2 found qualified
-X`'R< $+ > $* < $* > $: $>3 $1 @ *LOCAL* found unqualified
-X`'R< > $* $: $1 not found
-undefine(`X')dnl
+`R$+ < @ $* $=G . > $: < $1@$2$3 > $1 < @ $2$3 . > @ mark',
+`R$+ < @ $=G . > $: < $1@$2 > $1 < @ $2 . > @ mark')
+R$+ < @ *LOCAL* > $: < $1@$j > $1 < @ *LOCAL* > @ mark
+R< $+ > $+ < $* > @ $: < $(generics $1 $: $) > $2 < $3 >
+R< > $+ < @ $+ > $: < $(generics $1 $: $) > $1 < @ $2 >
+R< $* @ $* > $* < $* > $@ $>3 $1 @ $2 found qualified
+R< $+ > $* < $* > $: $>3 $1 @ *LOCAL* found unqualified
+R< > $* $: $1 not found',
+`dnl')
# special case the users that should be exposed
R$=E < @ *LOCAL* > $@ $1 < @ $j . > leave exposed
ifdef(`_MASQUERADE_ENTIRE_DOMAIN_',
`R$=E < @ $* $=M . > $@ $1 < @ $2 $3 . >',
`R$=E < @ $=M . > $@ $1 < @ $2 . >')
-ifdef(`_LIMITED_MASQUERADE_', `#')dnl
-R$=E < @ $=w . > $@ $1 < @ $2 . >
+ifdef(`_LIMITED_MASQUERADE_', `dnl',
+`R$=E < @ $=w . > $@ $1 < @ $2 . >')
# handle domain-specific masquerading
ifdef(`_MASQUERADE_ENTIRE_DOMAIN_',
`R$* < @ $* $=M . > $* $: $1 < @ $2 $3 . @ $M > $4 convert masqueraded doms',
`R$* < @ $=M . > $* $: $1 < @ $2 . @ $M > $3 convert masqueraded doms')
-ifdef(`_LIMITED_MASQUERADE_', `#')dnl
-R$* < @ $=w . > $* $: $1 < @ $2 . @ $M > $3
+ifdef(`_LIMITED_MASQUERADE_', `dnl',
+`R$* < @ $=w . > $* $: $1 < @ $2 . @ $M > $3')
R$* < @ *LOCAL* > $* $: $1 < @ $j . @ $M > $2
R$* < @ $+ @ > $* $: $1 < @ $2 > $3 $M is null
R$* < @ $+ @ $+ > $* $: $1 < @ $3 . > $4 $M is not null
@@ -905,10 +954,9 @@ R$* < @ $+ @ $+ > $* $: $1 < @ $3 . > $4 $M is not null
###################################################################
S94
-ifdef(`_MASQUERADE_ENVELOPE_', `', `#')dnl
-R$+ $@ $>93 $1
-ifdef(`_MASQUERADE_ENVELOPE_', `#', `')dnl
-R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
+ifdef(`_MASQUERADE_ENVELOPE_',
+`R$+ $@ $>93 $1',
+`R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2')
###################################################################
### Ruleset 98 -- local part of ruleset zero (can be null) ###
@@ -916,6 +964,298 @@ R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
S98
undivert(3)dnl
+
+ifelse(confDELIVERY_MODE, defer, `errprint(`WARNING: Antispam rules not available in deferred delivery mode.')')
+ifdef(`ACCESS_TABLE', `dnl
+######################################################################
+### LookUpDomain -- search for domain in access database
+###
+### Parameters:
+### <$1> -- key (domain name)
+### <$2> -- default (what to return if not found in db)
+### <$3> -- passthru (additional data passed unchanged through)
+######################################################################
+
+SLookUpDomain
+R<$+> <$+> <$*> $: < $(access $1 $: ? $) > <$1> <$2> <$3>
+R<?> <$+.$+> <$+> <$*> $@ $>LookUpDomain <$2> <$3> <$4>
+R<?> <$+> <$+> <$*> $@ <$2> <$3>
+R<$*> <$+> <$+> <$*> $@ <$1> <$4>
+
+######################################################################
+### LookUpAddress -- search for host address in access database
+###
+### Parameters:
+### <$1> -- key (dot quadded host address)
+### <$2> -- default (what to return if not found in db)
+### <$3> -- passthru (additional data passed through)
+######################################################################
+
+SLookUpAddress
+R<$+> <$+> <$*> $: < $(access $1 $: ? $) > <$1> <$2> <$3>
+R<?> <$+.$-> <$+> <$*> $@ $>LookUpAddress <$1> <$3> <$4>
+R<?> <$+> <$+> <$*> $@ <$2> <$3>
+R<$*> <$+> <$+> <$*> $@ <$1> <$4>',
+`dnl')
+
+######################################################################
+### ParseRecipient -- Strip off hosts in $=R as well as possibly
+### $* $=m or the access database.
+### Check user portion for host separators.
+###
+### Parameters:
+### $1 -- full recipient address
+###
+### Returns:
+### parsed, non-local-relaying address
+######################################################################
+
+SParseRecipient
+R$* $: <?> $>Parse0 $>3 $1
+R<?> $* < @ $* . > <?> $1 < @ $2 > strip trailing dots
+R<?> $- < @ $* > $: <?> $(dequote $1 $) < @ $2 > dequote local part
+
+# if no $=O character, no host in the user portion, we are done
+R<?> $* $=O $* < @ $* > $: <NO> $1 $2 $3 < @ $4>
+R<?> $* $@ $1
+
+ifdef(`_RELAY_ENTIRE_DOMAIN_', `dnl
+# if we relay, check username portion for user%host so host can be checked also
+R<NO> $* < @ $* $=m > $: <RELAY> $1 < @ $2 $3 >', `dnl')
+ifdef(`_RELAY_HOSTS_ONLY_',
+`R<NO> $* < @ $=R > $: <RELAY> $1 < @ $2 >
+ifdef(`ACCESS_TABLE', `dnl
+R<NO> $* < @ $* > $: <$(access $2 $: NO $)> $1 < @ $2 >',`dnl')',
+`R<NO> $* < @ $* $=R > $: <RELAY> $1 < @ $2 $3 >
+ifdef(`ACCESS_TABLE', `dnl
+R<NO> $* < @ $* > $: $>LookUpDomain <$2> <NO> <$1 < @ $2 >>
+R<$+> <$+> $: <$1> $2',`dnl')')
+R<RELAY> $* < @ $* > $@ $>ParseRecipient $1
+R<$-> $* $@ $2
+
+######################################################################
+### check_relay -- check hostname/address on SMTP startup
+######################################################################
+
+SLocal_check_relay
+Scheck_relay
+R$* $: $1 $| $>"Local_check_relay" $1
+R$* $| $* $| $#$* $#$3
+R$* $| $* $| $* $@ $>"Basic_check_relay" $1 $| $2
+
+SBasic_check_relay
+# check for deferred delivery mode
+R$* $: < ${deliveryMode} > $1
+R< d > $* $@ deferred
+R< $* > $* $: $2
+
+ifdef(`ACCESS_TABLE', `dnl
+R$+ $| $+ $: $>LookUpDomain < $1 > <?> < $2 >
+R<?> < $+ > $: $>LookUpAddress < $1 > <OK> < $1 >
+R<OK> < $* > $: $1
+R<RELAY> < $* > $: $1
+R<REJECT> $* $#error $@ 5.7.1 $: "ifdef(`confREJECT_MSG', `confREJECT_MSG', `550 Access denied')"
+R<DISCARD> $* $#discard $: discard
+R<$+> $* $#error $@ 5.7.1 $: $1', `dnl')
+
+ifdef(`_RBL_', `dnl
+# MAPS project checks -- http://maps.vix.com/
+R$* $: $&{client_addr}
+R$-.$-.$-.$- $: $(host $4.$3.$2.$1._RBL_. $: OK $)
+ROK $@ OK
+R$+ $#error $@ 5.7.1 $: "Mail from " $&{client_addr} " refused; see http://maps.vix.com/rbl/"',
+`dnl')
+
+######################################################################
+### check_mail -- check SMTP ``MAIL FROM:'' command argument
+######################################################################
+
+SLocal_check_mail
+Scheck_mail
+R$* $: $1 $| $>"Local_check_mail" $1
+R$* $| $#$* $#$2
+R$* $| $* $@ $>"Basic_check_mail" $1
+
+SBasic_check_mail
+# check for deferred delivery mode
+R$* $: < ${deliveryMode} > $1
+R< d > $* $@ deferred
+R< $* > $* $: $2
+
+R<> $@ <OK>
+R$* $: <?> $>Parse0 $>3 $1 make domain canonical
+R<?> $* < @ $+ . > $* <?> $1 < @ $2 > $3 strip trailing dots
+# handle non-DNS hostnames (*.bitnet, *.decnet, *.uucp, etc)
+R<?> $* < $* $=P > $* $: <OK> $1 < @ $2 $3 > $4
+ifdef(`_ACCEPT_UNRESOLVABLE_DOMAINS_',
+`R<?> $* < @ $+ > $* $: <OK> $1 < @ $2 > $3 ... unresolvable OK',
+`R<?> $* < @ $+ > $* $: <? $(resolve $2 $: $2 <PERM> $) > $1 < @ $2 > $3
+R<? $* <$->> $* < @ $+ > $*
+ $: <$2> $3 < @ $4 > $5')
+
+ifdef(`_ACCEPT_UNQUALIFIED_SENDERS_',`dnl',`dnl
+# handle case of @localhost on address
+R<$+> $* < @localhost > $: < ? $&{client_name} > <$1> $2 < @localhost >
+R<$+> $* < @localhost.$m >
+ $: < ? $&{client_name} > <$1> $2 < @localhost.$m >
+ifdef(`_NO_UUCP_', `dnl',
+`R<$+> $* < @localhost.UUCP >
+ $: < ? $&{client_name} > <$1> $2 < @localhost.UUCP >')
+R<? $=w> <$+> $* <?> <$2> $3
+R<? $+> <$+> $* $#error $@ 5.5.4 $: "553 Real domain name required"
+R<?> <$+> $* $: <$1> $2')
+
+ifdef(`ACCESS_TABLE', `dnl
+# lookup localpart (user@)
+R<$+> $* < @ $+ > $* $: <USER $(access $2@ $: ? $) > <$1> $2 < @ $3 > $4
+# no match, try full address (user@domain rest)
+R<USER ?> <$+> $* < @ $* > $*
+ $: <USER $(access $2@$3$4 $: ? $) > <$1> $2 < @ $3 > $4
+# no match, try address (user@domain)
+R<USER ?> <$+> $+ < @ $+ > $*
+ $: <USER $(access $2@$3 $: ? $) > <$1> $2 < @ $3 > $4
+# no match, try (sub)domain (domain)
+R<USER ?> <$+> $* < @ $+ > $*
+ $: $>LookUpDomain <$3> <$1> <>
+# check unqualified user in access database
+R<?> $* $: <USER $(access $1@ $: ? $) > <?> $1
+# retransform for further use
+R<USER $+> <$+> $* $: <$1> $3',
+`dnl')
+
+ifdef(`_ACCEPT_UNQUALIFIED_SENDERS_',`dnl',`dnl
+# handle case of no @domain on address
+R<?> $* $: < ? $&{client_name} > $1
+R<?> $* $@ <OK> ...local unqualed ok
+R<? $+> $* $#error $@ 5.5.4 $: "553 Domain name required"
+ ...remote is not')
+# check results
+R<?> $* $@ <OK>
+R<OK> $* $@ <OK>
+R<TEMP> $* $#error $@ 4.1.8 $: "451 Sender domain must resolve"
+R<PERM> $* $#error $@ 5.1.8 $: "501 Sender domain must exist"
+ifdef(`ACCESS_TABLE', `dnl
+R<RELAY> $* $@ <RELAY>
+R<DISCARD> $* $#discard $: discard
+R<REJECT> $* $#error $@ 5.7.1 $: "ifdef(`confREJECT_MSG', `confREJECT_MSG', `550 Access denied')"
+R<$+> $* $#error $@ 5.7.1 $: $1 error from access db',
+`dnl')
+
+######################################################################
+### check_rcpt -- check SMTP ``RCPT TO:'' command argument
+######################################################################
+
+SLocal_check_rcpt
+Scheck_rcpt
+R$* $: $1 $| $>"Local_check_rcpt" $1
+R$* $| $#$* $#$2
+R$* $| $* $@ $>"Basic_check_rcpt" $1
+
+SBasic_check_rcpt
+# check for deferred delivery mode
+R$* $: < ${deliveryMode} > $1
+R< d > $* $@ deferred
+R< $* > $* $: $2
+
+ifdef(`_LOOSE_RELAY_CHECK_',`dnl
+R$* $: $>Parse0 $>3 $1
+R$* < @ $* . > $1 < @ $2 > strip trailing dots',
+`R$* $: $>ParseRecipient $1 strip relayable hosts')
+
+ifdef(`_BLACKLIST_RCPT_',`dnl
+ifdef(`ACCESS_TABLE', `dnl
+# blacklist local users or any host from receiving mail
+R$* $: <?> $1
+R<?> $+ < @ $=w > $: <> <USER $1> <FULL $1@$2> <HOST $2> <$1 < @ $2 >>
+R<?> $+ < @ $* > $: <> <FULL $1@$2> <HOST $2> <$1 < @ $2 >>
+R<?> $+ $: <> <USER $1> <$1>
+R<> <USER $+> $* $: <$(access $1 $: $)> $2
+R<> <FULL $+> $* $: <$(access $1 $: $)> $2
+R<OK> <FULL $+> $* $: <$(access $1 $: $)> $2
+R<> <HOST $+> $* $: <$(access $1 $: $)> $2
+R<OK> <HOST $+> $* $: <$(access $1 $: $)> $2
+R<> <$*> $: $1
+R<OK> <$*> $: $1
+R<RELAY> <$*> $: $1
+R<REJECT> $* $#error $@ 5.2.1 $: "550 Mailbox disabled for this recipient"
+R<$+> $* $#error $@ 5.2.1 $: $1 error from access db', `dnl')', `dnl')
+
+ifdef(`_PROMISCUOUS_RELAY_', `dnl', `dnl
+# anything terminating locally is ok
+ifdef(`_RELAY_ENTIRE_DOMAIN_', `dnl
+R$+ < @ $* $=m > $@ OK', `dnl')
+R$+ < @ $=w > $@ OK
+ifdef(`_RELAY_HOSTS_ONLY_',
+`R$+ < @ $=R > $@ OK
+ifdef(`ACCESS_TABLE', `dnl
+R$+ < @ $* > $: <$(access $2 $: ? $)> <$1 < @ $2 >>',`dnl')',
+`R$+ < @ $* $=R > $@ OK
+ifdef(`ACCESS_TABLE', `dnl
+R$+ < @ $* > $: $>LookUpDomain <$2> <?> <$1 < @ $2 >>',`dnl')')
+ifdef(`ACCESS_TABLE', `dnl
+R<RELAY> $* $@ RELAY
+R<$*> <$*> $: $2',`dnl')
+
+ifdef(`_RELAY_MX_SERVED_', `dnl
+# allow relaying for hosts which we MX serve
+R$+ < @ $* > $: < : $(mxserved $2 $) : > $1 < @ $2 >
+R< : $* <TEMP> : > $* $#error $@ 4.7.1 $: "450 Can not check MX records for recipient host " $1
+R<$* : $=w . : $*> $* $@ OK
+R<$*> $* $: $2',
+`dnl')
+
+# check for local user (i.e. unqualified address)
+R$* $: <?> $1
+R<?> $+ < @ $+ > $: <REMOTE> $1 < @ $2 >
+# local user is ok
+R<?> $+ $@ OK
+R<$+> $* $: $2
+
+# anything originating locally is ok
+R$* $: <?> $&{client_name}
+# check if bracketed IP address (forward lookup != reverse lookup)
+R<?> [$+] $: <BAD> [$1]
+# pass to name server to make hostname canonical
+R<?> $* $~P $: <?> $[ $1 $2 $]
+R<$-> $* $: $2
+R$* . $1 strip trailing dots
+R$@ $@ OK
+ifdef(`_RELAY_ENTIRE_DOMAIN_', `dnl
+R$* $=m $@ OK', `dnl')
+R$=w $@ OK
+ifdef(`_RELAY_HOSTS_ONLY_',
+`R$=R $@ OK
+ifdef(`ACCESS_TABLE', `dnl
+R$* $: <$(access $1 $: ? $)> <$1>',`dnl')',
+`R$* $=R $@ OK
+ifdef(`ACCESS_TABLE', `dnl
+R$* $: $>LookUpDomain <$1> <?> <$1>',`dnl')')
+ifdef(`ACCESS_TABLE', `dnl
+R<RELAY> $* $@ RELAY
+R<$*> <$*> $: $2',`dnl')
+
+# check IP address
+R$* $: $&{client_addr}
+R$@ $@ OK originated locally
+R0 $@ OK originated locally
+R$=R $* $@ OK relayable IP address
+ifdef(`ACCESS_TABLE', `dnl
+R$* $: $>LookUpAddress <$1> <?> <$1>
+R<RELAY> $* $@ RELAY relayable IP address
+R<$*> <$*> $: $2', `dnl')
+R$* $: [ $1 ] put brackets around it...
+R$=w $@ OK ... and see if it is local
+
+ifdef(`_RELAY_LOCAL_FROM_', `dnl
+# anything with a local FROM is ok
+R$* $: $1 $| $>Parse0 $>3 $&f
+R$* $| $+ < @ $=w . > $@ OK FROM local
+R$* $| $* $: $1
+', `dnl')
+
+# anything else is bogus
+R$* $#error $@ 5.7.1 $: "550 Relaying denied"')
+
undivert(9)dnl
#
######################################################################
diff --git a/usr.sbin/sendmail/cf/m4/version.m4 b/usr.sbin/sendmail/cf/m4/version.m4
index a2cbdc9144d..2db220271ad 100644
--- a/usr.sbin/sendmail/cf/m4/version.m4
+++ b/usr.sbin/sendmail/cf/m4/version.m4
@@ -1,39 +1,17 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
-VERSIONID(`@(#)version.m4 8.8.8.1 (Berkeley) 10/24/97')
+VERSIONID(`@(#)version.m4 8.9.1.1 (Berkeley) 7/2/98')
#
divert(0)
# Configuration version number
-DZ8.8.8`'ifdef(`confCF_VERSION', `/confCF_VERSION')
+DZ8.9.1`'ifdef(`confCF_VERSION', `/confCF_VERSION')
diff --git a/usr.sbin/sendmail/cf/mailer/cyrus.m4 b/usr.sbin/sendmail/cf/mailer/cyrus.m4
index 47a4a5afd6a..6e4badcce29 100644
--- a/usr.sbin/sendmail/cf/mailer/cyrus.m4
+++ b/usr.sbin/sendmail/cf/mailer/cyrus.m4
@@ -1,5 +1,16 @@
PUSHDIVERT(-1)
#
+# Copyright (c) 1998 Sendmail, Inc. 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.
+#
+#
+# This code incorporates code from Carnegie Mellon University, whose
+# copyright notice and conditions of redistribution are as follows:
+#
+#***************************************************************************
# (C) Copyright 1995 by Carnegie Mellon University
#
# All Rights Reserved
@@ -23,7 +34,7 @@ PUSHDIVERT(-1)
# Contributed to Berkeley by John Gardiner Myers <jgm+@CMU.EDU>.
#
-ifdef(`CYRUS_MAILER_FLAGS',, `define(`CYRUS_MAILER_FLAGS', `A5@')')
+ifdef(`CYRUS_MAILER_FLAGS',, `define(`CYRUS_MAILER_FLAGS', `A5@/:|')')
ifdef(`CYRUS_MAILER_PATH',, `define(`CYRUS_MAILER_PATH', /usr/cyrus/bin/deliver)')
ifdef(`CYRUS_MAILER_ARGS',, `define(`CYRUS_MAILER_ARGS', `deliver -e -m $h -- $u')')
ifdef(`CYRUS_MAILER_USER',, `define(`CYRUS_MAILER_USER', `cyrus:mail')')
@@ -36,7 +47,7 @@ POPDIVERT
### Cyrus Mailer specification ###
##################################################
-VERSIONID(`@(#)cyrus.m4 8.4 (Carnegie Mellon) 9/2/96')
+VERSIONID(`@(#)cyrus.m4 8.9 (Carnegie Mellon) 5/19/98')
Mcyrus, P=CYRUS_MAILER_PATH, F=CONCAT(`lsDFMnPq', CYRUS_MAILER_FLAGS), S=10, R=20/40, T=X-Unix,
ifdef(`CYRUS_MAILER_MAX', `M=CYRUS_MAILER_MAX, ')U=CYRUS_MAILER_USER,
diff --git a/usr.sbin/sendmail/cf/mailer/fax.m4 b/usr.sbin/sendmail/cf/mailer/fax.m4
index 77124650ee7..581cfed088c 100644
--- a/usr.sbin/sendmail/cf/mailer/fax.m4
+++ b/usr.sbin/sendmail/cf/mailer/fax.m4
@@ -1,40 +1,18 @@
PUSHDIVERT(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# This assumes you already have Sam Leffler's HylaFAX software.
+# 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.
#
-# Tested with HylaFAX 4.0pl1
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# This assumes you already have Sam Leffler's HylaFAX software.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
+# Tested with HylaFAX 4.0pl1
#
ifdef(`FAX_MAILER_ARGS',,
@@ -48,7 +26,7 @@ POPDIVERT
### FAX Mailer specification ###
####################################
-VERSIONID(`@(#)fax.m4 8.6 (Berkeley) 7/6/97')
+VERSIONID(`@(#)fax.m4 8.11 (Berkeley) 5/19/98')
Mfax, P=FAX_MAILER_PATH, F=DFMhu, S=14, R=24, M=FAX_MAILER_MAX, T=X-Phone/X-FAX/X-Unix,
A=FAX_MAILER_ARGS
diff --git a/usr.sbin/sendmail/cf/mailer/local.m4 b/usr.sbin/sendmail/cf/mailer/local.m4
index 998778a0d0c..705e723c6ca 100644
--- a/usr.sbin/sendmail/cf/mailer/local.m4
+++ b/usr.sbin/sendmail/cf/mailer/local.m4
@@ -1,36 +1,14 @@
PUSHDIVERT(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `rmn9')')
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /bin/mail)')
@@ -45,7 +23,7 @@ POPDIVERT
### Local and Program Mailer specification ###
##################################################
-VERSIONID(`@(#)local.m4 8.23 (Berkeley) 5/31/96')
+VERSIONID(`@(#)local.m4 8.30 (Berkeley) 6/30/98')
Mlocal, P=LOCAL_MAILER_PATH, F=CONCAT(`lsDFMAw5:/|@q', LOCAL_MAILER_FLAGS), S=10/30, R=20/40,
_OPTINS(`LOCAL_MAILER_MAX', `M=', `, ')_OPTINS(`LOCAL_MAILER_CHARSET', `C=', `, ')T=DNS/RFC822/X-Unix,
@@ -59,6 +37,7 @@ Mprog, P=LOCAL_SHELL_PATH, F=CONCAT(`lsDFMoq', LOCAL_SHELL_FLAGS), S=10/30, R=2
#
S10
R<@> $n errors to mailer-daemon
+R@ <@ $*> $n temporarily bypass Sun bogosity
R$+ $: $>50 $1 add local domain if needed
R$* $: $>94 $1 do masquerading
@@ -73,6 +52,7 @@ R$+ < @ $* > $: $1 strip host part
#
S30
R<@> $n errors to mailer-daemon
+R@ <@ $*> $n temporarily bypass Sun bogosity
R$+ $: $>50 $1 add local domain if needed
R$* $: $>93 $1 do masquerading
@@ -81,14 +61,14 @@ R$* $: $>93 $1 do masquerading
#
S40
R$+ $: $>50 $1 add local domain if needed
-ifdef(`_ALL_MASQUERADE_', `', `#')dnl
-R$* $: $>93 $1 do all-masquerading
+ifdef(`_ALL_MASQUERADE_', `dnl
+R$* $: $>93 $1 do all-masquerading', `dnl')
#
# Common code to add local domain name (only if always-add-domain)
#
S50
-ifdef(`_ALWAYS_ADD_DOMAIN_', `', `#')dnl
+ifdef(`_ALWAYS_ADD_DOMAIN_', `dnl
R$* < @ $* > $* $@ $1 < @ $2 > $3 already fully qualified
-ifdef(`_ALWAYS_ADD_DOMAIN_', `', `#')dnl
-R$+ $@ $1 < @ *LOCAL* > add local qualification
+R$+ $@ $1 < @ *LOCAL* > add local qualification',
+`dnl')
diff --git a/usr.sbin/sendmail/cf/mailer/mail11.m4 b/usr.sbin/sendmail/cf/mailer/mail11.m4
index a8781cf8686..5c9d94810c6 100644
--- a/usr.sbin/sendmail/cf/mailer/mail11.m4
+++ b/usr.sbin/sendmail/cf/mailer/mail11.m4
@@ -1,5 +1,12 @@
PUSHDIVERT(-1)
#
+# Copyright (c) 1998 Sendmail, Inc. 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.
+#
+#
# Not exciting enough to bother with copyrights and most of the
# rulesets are based from those provided by DEC.
# Barb Dijker, Labyrinth Computer Services, barb@labyrinth.com
@@ -33,7 +40,7 @@ POPDIVERT
### UTK-MAIL11 Mailer specification ###
###########################################
-VERSIONID(`@(#)mail11.m4 8.4 (Berkeley) 3/18/97')
+VERSIONID(`@(#)mail11.m4 8.8 (Berkeley) 5/19/98')
Mmail11, P=MAIL11_MAILER_PATH, F=MAIL11_MAILER_FLAGS, S=15, R=25,
A=MAIL11_MAILER_ARGS
diff --git a/usr.sbin/sendmail/cf/mailer/phquery.m4 b/usr.sbin/sendmail/cf/mailer/phquery.m4
index ee359e09e53..5f1b6b41ce8 100644
--- a/usr.sbin/sendmail/cf/mailer/phquery.m4
+++ b/usr.sbin/sendmail/cf/mailer/phquery.m4
@@ -1,36 +1,14 @@
PUSHDIVERT(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
# Contributed by Kimmo Suominen <kim@tac.nyc.ny.us>.
#
@@ -45,7 +23,7 @@ POPDIVERT
### PH Mailer specification ###
####################################
-VERSIONID(`@(#)phquery.m4 8.1 (Berkeley) 8/1/95')
+VERSIONID(`@(#)phquery.m4 8.6 (Berkeley) 5/19/98')
Mph, P=PH_MAILER_PATH, F=CONCAT(`nrDFM', PH_MAILER_FLAGS), S=10, R=20/40,
A=PH_MAILER_ARGS
diff --git a/usr.sbin/sendmail/cf/mailer/pop.m4 b/usr.sbin/sendmail/cf/mailer/pop.m4
index 7e8ec0d2293..a4f3128f19f 100644
--- a/usr.sbin/sendmail/cf/mailer/pop.m4
+++ b/usr.sbin/sendmail/cf/mailer/pop.m4
@@ -1,36 +1,14 @@
PUSHDIVERT(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
ifdef(`POP_MAILER_PATH',, `define(`POP_MAILER_PATH', /usr/lib/mh/spop)')
@@ -43,7 +21,7 @@ POPDIVERT
### POP Mailer specification ###
####################################
-VERSIONID(`@(#)pop.m4 8.6 (Berkeley) 2/12/96')
+VERSIONID(`@(#)pop.m4 8.11 (Berkeley) 5/19/98')
Mpop, P=POP_MAILER_PATH, F=CONCAT(`lsDFMq', POP_MAILER_FLAGS), S=10, R=20/40, T=DNS/RFC822/X-Unix,
A=POP_MAILER_ARGS
diff --git a/usr.sbin/sendmail/cf/mailer/procmail.m4 b/usr.sbin/sendmail/cf/mailer/procmail.m4
index 0ea0717caa1..b6131c06678 100644
--- a/usr.sbin/sendmail/cf/mailer/procmail.m4
+++ b/usr.sbin/sendmail/cf/mailer/procmail.m4
@@ -1,36 +1,14 @@
PUSHDIVERT(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
ifdef(`PROCMAIL_MAILER_PATH',,
@@ -48,7 +26,7 @@ POPDIVERT
### PROCMAIL Mailer specification ###
##################*****##################
-VERSIONID(`@(#)procmail.m4 8.6 (Berkeley) 4/30/97')
+VERSIONID(`@(#)procmail.m4 8.11 (Berkeley) 5/19/98')
Mprocmail, P=PROCMAIL_MAILER_PATH, F=CONCAT(`DFM', PROCMAIL_MAILER_FLAGS), S=11/31, R=21/31, T=DNS/RFC822/X-Unix,
ifdef(`PROCMAIL_MAILER_MAX', `M=PROCMAIL_MAILER_MAX, ')A=PROCMAIL_MAILER_ARGS
diff --git a/usr.sbin/sendmail/cf/mailer/smtp.m4 b/usr.sbin/sendmail/cf/mailer/smtp.m4
index c816c736001..d70195e7066 100644
--- a/usr.sbin/sendmail/cf/mailer/smtp.m4
+++ b/usr.sbin/sendmail/cf/mailer/smtp.m4
@@ -1,36 +1,14 @@
PUSHDIVERT(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
+# 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.
+#
#
ifdef(`SMTP_MAILER_FLAGS',, `define(`SMTP_MAILER_FLAGS', `')')
ifdef(`SMTP_MAILER_ARGS',, `define(`SMTP_MAILER_ARGS', `IPC $h')')
@@ -44,7 +22,7 @@ POPDIVERT
### SMTP Mailer specification ###
#####################################
-VERSIONID(`@(#)smtp.m4 8.33 (Berkeley) 7/9/96')
+VERSIONID(`@(#)smtp.m4 8.38 (Berkeley) 5/19/98')
Msmtp, P=[IPC], F=CONCAT(mDFMuX, SMTP_MAILER_FLAGS), S=11/31, R=ifdef(`_ALL_MASQUERADE_', `21/31', `21'), E=\r\n, L=990,
_OPTINS(`SMTP_MAILER_MAX', `M=', `, ')_OPTINS(`SMTP_MAILER_CHARSET', `C=', `, ')T=DNS/RFC822/SMTP,
diff --git a/usr.sbin/sendmail/cf/mailer/usenet.m4 b/usr.sbin/sendmail/cf/mailer/usenet.m4
index 2abf3b072db..6c92f5f8dad 100644
--- a/usr.sbin/sendmail/cf/mailer/usenet.m4
+++ b/usr.sbin/sendmail/cf/mailer/usenet.m4
@@ -1,36 +1,14 @@
PUSHDIVERT(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
ifdef(`USENET_MAILER_PATH',, `define(`USENET_MAILER_PATH', /usr/lib/news/inews)')
@@ -41,7 +19,7 @@ POPDIVERT
### USENET Mailer specification ###
####################################
-VERSIONID(`@(#)usenet.m4 8.5 (Berkeley) 4/26/95')
+VERSIONID(`@(#)usenet.m4 8.10 (Berkeley) 5/19/98')
Musenet, P=USENET_MAILER_PATH, F=USENET_MAILER_FLAGS, S=10, R=20,
_OPTINS(`USENET_MAILER_MAX', `M=', `, ')T=X-Usenet/X-Usenet/X-Unix,
diff --git a/usr.sbin/sendmail/cf/mailer/uucp.m4 b/usr.sbin/sendmail/cf/mailer/uucp.m4
index 023982f9b93..cd2619db47e 100644
--- a/usr.sbin/sendmail/cf/mailer/uucp.m4
+++ b/usr.sbin/sendmail/cf/mailer/uucp.m4
@@ -1,36 +1,14 @@
PUSHDIVERT(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')
@@ -44,7 +22,7 @@ POPDIVERT
### UUCP Mailer specification ###
#####################################
-VERSIONID(`@(#)uucp.m4 8.25 (Berkeley) 3/16/97')
+VERSIONID(`@(#)uucp.m4 8.30 (Berkeley) 5/19/98')
#
# There are innumerable variations on the UUCP mailer. It really
diff --git a/usr.sbin/sendmail/cf/ostype/aix2.m4 b/usr.sbin/sendmail/cf/ostype/aix2.m4
index 423393b5f7b..1e77c1cd1e3 100644
--- a/usr.sbin/sendmail/cf/ostype/aix2.m4
+++ b/usr.sbin/sendmail/cf/ostype/aix2.m4
@@ -1,41 +1,20 @@
divert(-1)
#
-# Copyright (c) 1995 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1995 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)aix2.m4 8.2 (Berkeley) 9/19/96')
+VERSIONID(`@(#)aix2.m4 8.8 (Berkeley) 5/19/98')
define(`LOCAL_MAILER_PATH', /bin/bellmail)dnl
define(`LOCAL_MAILER_ARGS', mail $u)dnl
define(`LOCAL_MAILER_FLAGS', `mn9')dnl
+define(`confEBINDIR', `/usr/lib')dnl
define(`confTIME_ZONE', `USE_TZ')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/aix3.m4 b/usr.sbin/sendmail/cf/ostype/aix3.m4
index 153e1f6568c..2cfc8c58220 100644
--- a/usr.sbin/sendmail/cf/ostype/aix3.m4
+++ b/usr.sbin/sendmail/cf/ostype/aix3.m4
@@ -1,41 +1,20 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)aix3.m4 8.6 (Berkeley) 9/19/96')
+VERSIONID(`@(#)aix3.m4 8.12 (Berkeley) 5/19/98')
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /bin/bellmail)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', mail $u)')dnl
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `mn9')')dnl
+define(`confEBINDIR', `/usr/lib')dnl
define(`confTIME_ZONE', `USE_TZ')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/aix4.m4 b/usr.sbin/sendmail/cf/ostype/aix4.m4
index 4dc33878f8f..06c7d1aba15 100644
--- a/usr.sbin/sendmail/cf/ostype/aix4.m4
+++ b/usr.sbin/sendmail/cf/ostype/aix4.m4
@@ -1,41 +1,20 @@
divert(-1)
#
-# Copyright (c) 1996 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1996 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)aix4.m4 8.1 (Berkeley) 11/13/96')
+VERSIONID(`@(#)aix4.m4 8.7 (Berkeley) 5/19/98')
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /bin/bellmail)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', mail -F $g $u)')dnl
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `mn9')')dnl
+define(`confEBINDIR', `/usr/lib')dnl
define(`confTIME_ZONE', `USE_TZ')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/altos.m4 b/usr.sbin/sendmail/cf/ostype/altos.m4
index 10c4da91d92..38a07a0a319 100644
--- a/usr.sbin/sendmail/cf/ostype/altos.m4
+++ b/usr.sbin/sendmail/cf/ostype/altos.m4
@@ -1,42 +1,20 @@
divert(-1)
#
-# Copyright (c) 1996 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1996 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
# Contributed by Tim Rice <tim@trr.metro.NET>.
#
divert(0)
-VERSIONID(`@(#)altos.m4 8.3 (Berkeley) 9/25/96')
+VERSIONID(`@(#)altos.m4 8.9 (Berkeley) 5/19/98')
define(`ALIAS_FILE', /usr/lib/mail/aliases)dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
@@ -47,3 +25,4 @@ ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', mPuhCE9)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `lmail $u')')dnl
ifdef(`LOCAL_SHELL_FLAGS',, `define(`LOCAL_SHELL_FLAGS', Peu)')dnl
ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g $h!rmail ($u)')')dnl
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/amdahl-uts.m4 b/usr.sbin/sendmail/cf/ostype/amdahl-uts.m4
index 3583746a9bc..022b5074137 100644
--- a/usr.sbin/sendmail/cf/ostype/amdahl-uts.m4
+++ b/usr.sbin/sendmail/cf/ostype/amdahl-uts.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)amdahl-uts.m4 8.4 (Berkeley) 9/25/96')
+VERSIONID(`@(#)amdahl-uts.m4 8.10 (Berkeley) 5/19/98')
divert(-1)
define(`ALIAS_FILE', /etc/mail/aliases)
@@ -42,3 +20,4 @@ ifdef(`HELP_FILE',, `define(`HELP_FILE', /etc/mail/sendmail.hf)')
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `fSn9')')
define(`confCW_FILE', /etc/mail/sendmail.cw)
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/aux.m4 b/usr.sbin/sendmail/cf/ostype/aux.m4
index 0f515d150a8..2adbfe4d221 100644
--- a/usr.sbin/sendmail/cf/ostype/aux.m4
+++ b/usr.sbin/sendmail/cf/ostype/aux.m4
@@ -1,43 +1,22 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)aux.m4 8.4 (Berkeley) 9/25/96')
+VERSIONID(`@(#)aux.m4 8.10 (Berkeley) 5/19/98')
define(`ALIAS_FILE', /usr/lib/aliases)dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')dnl
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', mn9)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail -d -r $f $u')')dnl
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/bsd4.3.m4 b/usr.sbin/sendmail/cf/ostype/bsd4.3.m4
index 546fd376c93..47c02cc764a 100644
--- a/usr.sbin/sendmail/cf/ostype/bsd4.3.m4
+++ b/usr.sbin/sendmail/cf/ostype/bsd4.3.m4
@@ -1,39 +1,17 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)bsd4.3.m4 8.4 (Berkeley) 11/13/95')
+VERSIONID(`@(#)bsd4.3.m4 8.9 (Berkeley) 5/19/98')
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -z -a$g $h!rmail ($u)')')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/bsd4.4.m4 b/usr.sbin/sendmail/cf/ostype/bsd4.4.m4
index 835e4d89c6c..c023de54401 100644
--- a/usr.sbin/sendmail/cf/ostype/bsd4.4.m4
+++ b/usr.sbin/sendmail/cf/ostype/bsd4.4.m4
@@ -1,41 +1,19 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
divert(0)
-VERSIONID(`@(#)bsd4.4.m4 8.4 (Berkeley) 11/13/95')
+VERSIONID(`@(#)bsd4.4.m4 8.9 (Berkeley) 5/19/98')
ifdef(`HELP_FILE',, `define(`HELP_FILE', /usr/share/misc/sendmail.hf)')dnl
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /var/log/sendmail.st)')dnl
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /usr/libexec/mail.local)')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/bsdi1.0.m4 b/usr.sbin/sendmail/cf/ostype/bsdi1.0.m4
index 8bc3c218b41..48d60b33380 100644
--- a/usr.sbin/sendmail/cf/ostype/bsdi1.0.m4
+++ b/usr.sbin/sendmail/cf/ostype/bsdi1.0.m4
@@ -1,38 +1,16 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)bsdi1.0.m4 8.2 (Berkeley) 8/16/95')dnl
+VERSIONID(`@(#)bsdi1.0.m4 8.7 (Berkeley) 5/19/98')dnl
include(_CF_DIR_`'ostype/bsd4.4.m4)dnl
diff --git a/usr.sbin/sendmail/cf/ostype/bsdi2.0.m4 b/usr.sbin/sendmail/cf/ostype/bsdi2.0.m4
index a98ddc0d45c..73b0447ec36 100644
--- a/usr.sbin/sendmail/cf/ostype/bsdi2.0.m4
+++ b/usr.sbin/sendmail/cf/ostype/bsdi2.0.m4
@@ -1,38 +1,16 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)bsdi2.0.m4 8.1 (Berkeley) 8/16/95')dnl
+VERSIONID(`@(#)bsdi2.0.m4 8.6 (Berkeley) 5/19/98')dnl
include(_CF_DIR_`'ostype/bsd4.4.m4)dnl
diff --git a/usr.sbin/sendmail/cf/ostype/dgux.m4 b/usr.sbin/sendmail/cf/ostype/dgux.m4
index ec8f4b4ea27..eeb8c4de3a2 100644
--- a/usr.sbin/sendmail/cf/ostype/dgux.m4
+++ b/usr.sbin/sendmail/cf/ostype/dgux.m4
@@ -1,41 +1,20 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)dgux.m4 8.4 (Berkeley) 9/19/96')
+VERSIONID(`@(#)dgux.m4 8.10 (Berkeley) 5/19/98')
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', m9)')dnl
define(`confTIME_ZONE', `USE_TZ')dnl
+define(`confEBINDIR', `/usr/lib')dnl
LOCAL_CONFIG
E_FORCE_MAIL_LOCAL_=yes
diff --git a/usr.sbin/sendmail/cf/ostype/domainos.m4 b/usr.sbin/sendmail/cf/ostype/domainos.m4
index 4af9906459e..c03dee5fc94 100644
--- a/usr.sbin/sendmail/cf/ostype/domainos.m4
+++ b/usr.sbin/sendmail/cf/ostype/domainos.m4
@@ -1,42 +1,21 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)domainos.m4 8.3 (Berkeley) 9/25/96')
+VERSIONID(`@(#)domainos.m4 8.9 (Berkeley) 5/19/98')
divert(-1)
define(`ALIAS_FILE', /usr/lib/aliases)
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/dynix3.2.m4 b/usr.sbin/sendmail/cf/ostype/dynix3.2.m4
index ffbe943e191..94d59b5f371 100644
--- a/usr.sbin/sendmail/cf/ostype/dynix3.2.m4
+++ b/usr.sbin/sendmail/cf/ostype/dynix3.2.m4
@@ -1,39 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)dynix3.2.m4 8.3 (Berkeley) 9/25/96')
+VERSIONID(`@(#)dynix3.2.m4 8.9 (Berkeley) 5/19/98')
define(`ALIAS_FILE', /usr/lib/aliases)dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/gnuhurd.m4 b/usr.sbin/sendmail/cf/ostype/gnuhurd.m4
index 36766795ca1..d7127f6b7eb 100644
--- a/usr.sbin/sendmail/cf/ostype/gnuhurd.m4
+++ b/usr.sbin/sendmail/cf/ostype/gnuhurd.m4
@@ -1,41 +1,20 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1997 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
divert(0)
-VERSIONID(`@(#)gnuhurd.m4 8.1 (Berkeley) 3/8/97')
+VERSIONID(`@(#)gnuhurd.m4 8.7 (Berkeley) 5/19/98')
ifdef(`HELP_FILE',, `define(`HELP_FILE', /share/misc/sendmail.hf)')dnl
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /var/log/sendmail.st)')dnl
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /libexec/mail.local)')dnl
+define(`confEBINDIR', `/libexec')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/hpux10.m4 b/usr.sbin/sendmail/cf/ostype/hpux10.m4
index c1d7e6946d3..9499474de74 100644
--- a/usr.sbin/sendmail/cf/ostype/hpux10.m4
+++ b/usr.sbin/sendmail/cf/ostype/hpux10.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)hpux10.m4 8.8 (Berkeley) 9/25/96')
+VERSIONID(`@(#)hpux10.m4 8.13 (Berkeley) 5/19/98')
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /var/spool/mqueue)')dnl
define(`ALIAS_FILE', /etc/mail/aliases)dnl
diff --git a/usr.sbin/sendmail/cf/ostype/hpux9.m4 b/usr.sbin/sendmail/cf/ostype/hpux9.m4
index 82e4f75ab7b..19579caef06 100644
--- a/usr.sbin/sendmail/cf/ostype/hpux9.m4
+++ b/usr.sbin/sendmail/cf/ostype/hpux9.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)hpux9.m4 8.12 (Berkeley) 9/25/96')
+VERSIONID(`@(#)hpux9.m4 8.18 (Berkeley) 5/19/98')
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
define(`ALIAS_FILE', /usr/lib/aliases)dnl
@@ -44,6 +22,7 @@ ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `m9')')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `rmail -d $u')')dnl
ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g -gC $h!rmail ($u)')')dnl
define(`confTIME_ZONE', `USE_TZ')dnl
+define(`confEBINDIR', `/usr/lib')dnl
dnl
dnl For maximum compability with HP-UX, use:
dnl define(`confME_TOO', True)dnl
diff --git a/usr.sbin/sendmail/cf/ostype/irix4.m4 b/usr.sbin/sendmail/cf/ostype/irix4.m4
index fb8eff720d4..69890e6acbc 100644
--- a/usr.sbin/sendmail/cf/ostype/irix4.m4
+++ b/usr.sbin/sendmail/cf/ostype/irix4.m4
@@ -1,41 +1,20 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)irix4.m4 8.7 (Berkeley) 9/25/96')
+VERSIONID(`@(#)irix4.m4 8.13 (Berkeley) 5/19/98')
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', Ehm9)')dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
define(`ALIAS_FILE', /usr/lib/aliases)dnl
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/irix5.m4 b/usr.sbin/sendmail/cf/ostype/irix5.m4
index 89a2975adff..32f23756e00 100644
--- a/usr.sbin/sendmail/cf/ostype/irix5.m4
+++ b/usr.sbin/sendmail/cf/ostype/irix5.m4
@@ -1,38 +1,16 @@
divert(-1)
#
-# Copyright (c) 1995 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1995 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Contributed by Kari E. Hurtta <Kari.Hurtta@dionysos.fmi.fi>
+# 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.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
+# Contributed by Kari E. Hurtta <Kari.Hurtta@dionysos.fmi.fi>
#
#
@@ -50,7 +28,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)irix5.m4 8.4 (Berkeley) 9/25/96')
+VERSIONID(`@(#)irix5.m4 8.10 (Berkeley) 5/19/98')
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', Ehmu9)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail -s -d $u')')dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /var/spool/mqueue)')dnl
@@ -59,3 +37,4 @@ ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /var/sendmail.st)')dnl
ifdef(`HELP_FILE',, `define(`HELP_FILE', /etc/sendmail.hf)')dnl
define(`confDEF_USER_ID', `998:998')dnl
define(`confTIME_ZONE', USE_TZ)dnl
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/irix6.m4 b/usr.sbin/sendmail/cf/ostype/irix6.m4
index 2304c1c57f6..f046dbf0e8f 100644
--- a/usr.sbin/sendmail/cf/ostype/irix6.m4
+++ b/usr.sbin/sendmail/cf/ostype/irix6.m4
@@ -1,38 +1,16 @@
divert(-1)
#
-# Copyright (c) 1995 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1995 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Contributed by Kari E. Hurtta <Kari.Hurtta@dionysos.fmi.fi>
+# 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.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
+# Contributed by Kari E. Hurtta <Kari.Hurtta@dionysos.fmi.fi>
#
#
@@ -50,7 +28,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)irix6.m4 8.1 (Berkeley) 4/11/97')
+VERSIONID(`@(#)irix6.m4 8.7 (Berkeley) 5/19/98')
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', Ehmu9)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail -s -d $u')')dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /var/spool/mqueue)')dnl
@@ -59,3 +37,4 @@ ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /var/sendmail.st)')dnl
ifdef(`HELP_FILE',, `define(`HELP_FILE', /etc/sendmail.hf)')dnl
define(`confDEF_USER_ID', `998:998')dnl
define(`confTIME_ZONE', USE_TZ)dnl
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/isc4.1.m4 b/usr.sbin/sendmail/cf/ostype/isc4.1.m4
index 902f49a2497..1869eecfc63 100644
--- a/usr.sbin/sendmail/cf/ostype/isc4.1.m4
+++ b/usr.sbin/sendmail/cf/ostype/isc4.1.m4
@@ -1,41 +1,19 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
#
divert(0)
-VERSIONID(`@(#)isc4.1.m4 8.4 (Berkeley) 9/25/96')
+VERSIONID(`@(#)isc4.1.m4 8.10 (Berkeley) 5/19/98')
define(`ALIAS_FILE', /usr/lib/aliases)dnl
ifdef(`HELP_FILE',, `define(`HELP_FILE', /usr/lib/sendmail.hf)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `lmail -s $u')')dnl
@@ -46,3 +24,4 @@ ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -gC $h!rmail ($u)')')dnl
ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')dnl
define(`confTIME_ZONE', `USE_TZ')dnl
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/linux.m4 b/usr.sbin/sendmail/cf/ostype/linux.m4
index 527b6fa3372..d7c3b190b47 100644
--- a/usr.sbin/sendmail/cf/ostype/linux.m4
+++ b/usr.sbin/sendmail/cf/ostype/linux.m4
@@ -1,38 +1,16 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)linux.m4 8.2 (Berkeley) 8/21/93')
+VERSIONID(`@(#)linux.m4 8.7 (Berkeley) 5/19/98')
define(`LOCAL_MAILER_PATH', /bin/mail.local)dnl
diff --git a/usr.sbin/sendmail/cf/ostype/maxion.m4 b/usr.sbin/sendmail/cf/ostype/maxion.m4
index 63cc4961f60..c07ce876e30 100644
--- a/usr.sbin/sendmail/cf/ostype/maxion.m4
+++ b/usr.sbin/sendmail/cf/ostype/maxion.m4
@@ -1,42 +1,21 @@
+divert(-1)
#
-# Copyright (c) 1996 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1996 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
# Concurrent Computer Corporation Maxion system support contributed
# by Donald R. Laster Jr. <Laster@access.digex.com>.
#
divert(0)
-VERSIONID(`@(#)maxion.m4 8.3 (Berkeley) 9/25/96')
+VERSIONID(`@(#)maxion.m4 8.10 (Berkeley) 5/19/98')
define(`ALIAS_FILE', `/etc/ucbmail/aliases')dnl
define(`HELP_FILE', `/etc/ucbmail/sendmail.hf')dnl
@@ -47,4 +26,5 @@ define(`LOCAL_MAILER_FLAGS',`rmn9')dnl
define(`LOCAL_SHELL_FLAGS', `ehuP')dnl
define(`LOCAL_MAILER_ARGS', `mail $u')dnl
define(`UUCP_MAILER_ARGS', `uux - -r -a$g -gmedium $h!rmail ($u)')dnl
+define(`confEBINDIR', `/usr/ucblib')dnl
divert(-1)
diff --git a/usr.sbin/sendmail/cf/ostype/mklinux.m4 b/usr.sbin/sendmail/cf/ostype/mklinux.m4
index 00adedbb1ad..2f40c72d8e2 100644
--- a/usr.sbin/sendmail/cf/ostype/mklinux.m4
+++ b/usr.sbin/sendmail/cf/ostype/mklinux.m4
@@ -1,42 +1,20 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
# MkLinux support contributed by Paul DuBois <dubois@primate.wisc.edu>
#
divert(0)
-VERSIONID(`@(#)mklinux.m4 8.2 (Berkeley) 11/17/96')
+VERSIONID(`@(#)mklinux.m4 8.7 (Berkeley) 5/19/98')
ifdef(`STATUS_FILE',,
`define(`STATUS_FILE', /var/log/sendmail.st)')
ifdef(`PROCMAIL_MAILER_PATH',,
diff --git a/usr.sbin/sendmail/cf/ostype/nextstep.m4 b/usr.sbin/sendmail/cf/ostype/nextstep.m4
index 80139756c66..73c995fb983 100644
--- a/usr.sbin/sendmail/cf/ostype/nextstep.m4
+++ b/usr.sbin/sendmail/cf/ostype/nextstep.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)nextstep.m4 8.8 (Berkeley) 6/18/97')
+VERSIONID(`@(#)nextstep.m4 8.14 (Berkeley) 5/19/98')
define(`ALIAS_FILE', /etc/sendmail/aliases)dnl
define(`confCW_FILE', /etc/sendmail/sendmail.cw)dnl
ifdef(`HELP_FILE',, `define(`HELP_FILE', /usr/lib/sendmail.hf)')dnl
@@ -43,3 +21,4 @@ ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `rmnP9')')dnl
ifdef(`LOCAL_SHELL_FLAGS',, `define(`LOCAL_SHELL_FLAGS', `euP')')dnl
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/osf1.m4 b/usr.sbin/sendmail/cf/ostype/osf1.m4
index ee73e4fef36..fe17b35ee6c 100644
--- a/usr.sbin/sendmail/cf/ostype/osf1.m4
+++ b/usr.sbin/sendmail/cf/ostype/osf1.m4
@@ -1,40 +1,19 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)osf1.m4 8.4 (Berkeley) 9/25/96')
+VERSIONID(`@(#)osf1.m4 8.10 (Berkeley) 5/19/98')
define(`ALIAS_FILE', /usr/adm/sendmail/aliases)dnl
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/adm/sendmail/sendmail.st)')dnl
ifdef(`HELP_FILE',, `define(`HELP_FILE', /usr/share/lib/sendmail.hf)')dnl
+define(`confDEF_USER_ID', `daemon')
diff --git a/usr.sbin/sendmail/cf/ostype/powerux.m4 b/usr.sbin/sendmail/cf/ostype/powerux.m4
index d0fd3dc2812..dc23c7ed295 100644
--- a/usr.sbin/sendmail/cf/ostype/powerux.m4
+++ b/usr.sbin/sendmail/cf/ostype/powerux.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)powerux.m4 8.1 (Berkeley) 1/16/97')
+VERSIONID(`@(#)powerux.m4 8.7 (Berkeley) 5/19/98')
define(`ALIAS_FILE', /etc/mail/aliases)dnl
ifdef(`HELP_FILE',,`define(`HELP_FILE', /etc/mail/sendmail.hf)')dnl
@@ -44,3 +22,4 @@ define(`LOCAL_MAILER_FLAGS', `mn9')dnl
define(`LOCAL_MAILER_ARGS', `rmail $u')dnl
define(`LOCAL_SHELL_FLAGS', `ehuP')dnl
define(`UUCP_MAILER_ARGS', `uux - -r -a$g -gmedium $h!rmail ($u)')dnl
+define(`confEBINDIR', `/usr/local/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/ptx2.m4 b/usr.sbin/sendmail/cf/ostype/ptx2.m4
index cbe0f590a0a..83a05580b14 100644
--- a/usr.sbin/sendmail/cf/ostype/ptx2.m4
+++ b/usr.sbin/sendmail/cf/ostype/ptx2.m4
@@ -1,42 +1,20 @@
divert(-1)
#
-# Copyright (c) 1994 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1994 Eric P. Allman. All rights reserved.
# Copyright (c) 1994
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
# Support for DYNIX/ptx 2.x.
divert(0)
-VERSIONID(`@(#)ptx2.m4 8.5 (Berkeley) 9/25/96')
+VERSIONID(`@(#)ptx2.m4 8.11 (Berkeley) 5/19/98')
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
define(`ALIAS_FILE', /usr/lib/aliases)dnl
ifdef(`HELP_FILE',,`define(`HELP_FILE', /usr/lib/sendmail.hf)')dnl
@@ -44,3 +22,4 @@ ifdef(`STATUS_FILE',,`define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
define(`LOCAL_MAILER_PATH', `/bin/mail')dnl
define(`LOCAL_MAILER_FLAGS', `fmn9')dnl
define(`LOCAL_SHELL_FLAGS', `eu')dnl
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/riscos4.5.m4 b/usr.sbin/sendmail/cf/ostype/riscos4.5.m4
index 96e3b16efee..02db750c023 100644
--- a/usr.sbin/sendmail/cf/ostype/riscos4.5.m4
+++ b/usr.sbin/sendmail/cf/ostype/riscos4.5.m4
@@ -1,42 +1,21 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)riscos4.5.m4 8.4 (Berkeley) 9/25/96')
+VERSIONID(`@(#)riscos4.5.m4 8.10 (Berkeley) 5/19/98')
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `rmail -d $u')')dnl
define(`ALIAS_FILE', `/usr/lib/aliases')dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', `/usr/spool/mqueue')')dnl
ifdef(`HELP_FILE',, `define(`HELP_FILE', `/usr/lib/sendmail.hf')')dnl
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/sco-uw-2.1.m4 b/usr.sbin/sendmail/cf/ostype/sco-uw-2.1.m4
index ebce4991def..356c984fa42 100644
--- a/usr.sbin/sendmail/cf/ostype/sco-uw-2.1.m4
+++ b/usr.sbin/sendmail/cf/ostype/sco-uw-2.1.m4
@@ -1,10 +1,18 @@
+divert(-1)
+#
+# Copyright (c) 1998 Sendmail, Inc. 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.
+#
#
# SCO UnixWare 2.1.2 ostype file
#
# Contributed by Christopher Durham <chrisdu@SCO.COM> of SCO.
#
divert(0)
-VERSIONID(`@(#)sco-uw-2.1.m4 8.1 (Berkeley) 7/6/97')
+VERSIONID(`@(#)sco-uw-2.1.m4 8.6 (Berkeley) 5/19/98')
define(`ALIAS_FILE', /usr/lib/mail/aliases)dnl
ifdef(`HELP_FILE',,`define(`HELP_FILE', /usr/ucblib/sendmail.hf)')dnl
@@ -14,3 +22,4 @@ define(`LOCAL_MAILER_FLAGS', `fhCEn9')dnl
define(`LOCAL_SHELL_FLAGS', `ehuP')dnl
define(`UUCP_MAILER_ARGS', `uux - -r -a$g -gmedium $h!rmail ($u)')dnl
define(`LOCAL_MAILER_ARGS',`rmail $u')dnl
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/sco3.2.m4 b/usr.sbin/sendmail/cf/ostype/sco3.2.m4
index b74eb6f4208..1c58585035b 100644
--- a/usr.sbin/sendmail/cf/ostype/sco3.2.m4
+++ b/usr.sbin/sendmail/cf/ostype/sco3.2.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)sco3.2.m4 8.4 (Berkeley) 9/25/96')
+VERSIONID(`@(#)sco3.2.m4 8.10 (Berkeley) 5/19/98')
define(`ALIAS_FILE', /usr/lib/mail/aliases)dnl
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
@@ -43,3 +21,4 @@ ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /usr/bin/lmail)')dnl
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', PuhCE9)')dnl
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `lmail $u')')dnl
ifdef(`LOCAL_SHELL_FLAGS',, `define(`LOCAL_SHELL_FLAGS', Peu)')dnl
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/sinix.m4 b/usr.sbin/sendmail/cf/ostype/sinix.m4
index 278d4c84cec..51c469d8d74 100644
--- a/usr.sbin/sendmail/cf/ostype/sinix.m4
+++ b/usr.sbin/sendmail/cf/ostype/sinix.m4
@@ -1,42 +1,21 @@
divert(-1)
#
-# Copyright (c) 1996 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1996 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)sinix.m4 8.2 (Berkeley) 9/13/97')
+VERSIONID(`@(#)sinix.m4 8.8 (Berkeley) 5/19/98')
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /var/spool/mqueue)')dnl
define(`ALIAS_FILE', /etc/aliases)dnl
define(`LOCAL_MAILER_PATH', `/bin/mail.local')dnl
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /var/sendmail.st)')dnl
ifdef(`HELP_FILE',, `define(`HELP_FILE', /etc/sendmail.hf)')dnl
+define(`confEBINDIR', `/usr/ucblib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/solaris2.m4 b/usr.sbin/sendmail/cf/ostype/solaris2.m4
index e6553a8b664..5a90175bd36 100644
--- a/usr.sbin/sendmail/cf/ostype/solaris2.m4
+++ b/usr.sbin/sendmail/cf/ostype/solaris2.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)solaris2.m4 8.9 (Berkeley) 9/25/96')
+VERSIONID(`@(#)solaris2.m4 8.15 (Berkeley) 5/19/98')
divert(-1)
define(`ALIAS_FILE', /etc/mail/aliases)
@@ -44,3 +22,4 @@ ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `SnE9')')
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail -f $g -d $u')')
ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g $h!rmail ($u)')')
define(`confCW_FILE', /etc/mail/sendmail.cw)
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/solaris2.ml.m4 b/usr.sbin/sendmail/cf/ostype/solaris2.ml.m4
index 2ce5325158c..0995d50ff18 100644
--- a/usr.sbin/sendmail/cf/ostype/solaris2.ml.m4
+++ b/usr.sbin/sendmail/cf/ostype/solaris2.ml.m4
@@ -1,36 +1,14 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
# This ostype file is suitable for use on Solaris 2.x systems that
# have mail.local installed. It is my understanding that this is
@@ -38,7 +16,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)solaris2.ml.m4 8.2 (Berkeley) 9/25/96')
+VERSIONID(`@(#)solaris2.ml.m4 8.8 (Berkeley) 5/19/98')
divert(-1)
define(`ALIAS_FILE', /etc/mail/aliases)
@@ -49,3 +27,4 @@ ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `fSmn9')')
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail.local -d $u')')
ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g $h!rmail ($u)')')
define(`confCW_FILE', /etc/mail/sendmail.cw)
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/sunos3.5.m4 b/usr.sbin/sendmail/cf/ostype/sunos3.5.m4
index fe76931880a..540d36e6075 100644
--- a/usr.sbin/sendmail/cf/ostype/sunos3.5.m4
+++ b/usr.sbin/sendmail/cf/ostype/sunos3.5.m4
@@ -1,37 +1,17 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)sunos3.5.m4 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)sunos3.5.m4 8.7 (Berkeley) 5/19/98')
+
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/sunos4.1.m4 b/usr.sbin/sendmail/cf/ostype/sunos4.1.m4
index cfa7a9a02ac..aec96d2fdc9 100644
--- a/usr.sbin/sendmail/cf/ostype/sunos4.1.m4
+++ b/usr.sbin/sendmail/cf/ostype/sunos4.1.m4
@@ -1,37 +1,17 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)sunos4.1.m4 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)sunos4.1.m4 8.7 (Berkeley) 5/19/98')
+
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/svr4.m4 b/usr.sbin/sendmail/cf/ostype/svr4.m4
index 3085db17fd3..1451414797f 100644
--- a/usr.sbin/sendmail/cf/ostype/svr4.m4
+++ b/usr.sbin/sendmail/cf/ostype/svr4.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)svr4.m4 8.4 (Berkeley) 9/25/96')
+VERSIONID(`@(#)svr4.m4 8.10 (Berkeley) 5/19/98')
define(`ALIAS_FILE', /usr/ucblib/aliases)dnl
ifdef(`HELP_FILE',,`define(`HELP_FILE', /usr/ucblib/sendmail.hf)')dnl
@@ -43,3 +21,4 @@ define(`LOCAL_MAILER_PATH', `/usr/ucblib/binmail')dnl
define(`LOCAL_MAILER_FLAGS', `rmn9')dnl
define(`LOCAL_SHELL_FLAGS', `ehuP')dnl
define(`UUCP_MAILER_ARGS', `uux - -r -a$g -gmedium $h!rmail ($u)')dnl
+define(`confEBINDIR', `/usr/ucblib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/ultrix4.m4 b/usr.sbin/sendmail/cf/ostype/ultrix4.m4
index f6998e1c5ca..874fa8b89d6 100644
--- a/usr.sbin/sendmail/cf/ostype/ultrix4.m4
+++ b/usr.sbin/sendmail/cf/ostype/ultrix4.m4
@@ -1,37 +1,17 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)ultrix4.m4 8.2 (Berkeley) 7/2/94')
+VERSIONID(`@(#)ultrix4.m4 8.8 (Berkeley) 5/19/98')
+
+define(`confEBINDIR', `/usr/lib')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/unknown.m4 b/usr.sbin/sendmail/cf/ostype/unknown.m4
index 7aadbb505d4..bb85604efa1 100644
--- a/usr.sbin/sendmail/cf/ostype/unknown.m4
+++ b/usr.sbin/sendmail/cf/ostype/unknown.m4
@@ -1,40 +1,18 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)unknown.m4 8.1 (Berkeley) 4/21/95')
+VERSIONID(`@(#)unknown.m4 8.6 (Berkeley) 5/19/98')
errprint(`*** ERROR: You have not specified a valid operating system type.')
errprint(` Use the OSTYPE macro to select a valid system type. This')
errprint(` is necessary in order to get the proper pathnames and flags')
diff --git a/usr.sbin/sendmail/cf/ostype/uxpds.m4 b/usr.sbin/sendmail/cf/ostype/uxpds.m4
index 88e455bc78b..2fb147eb522 100644
--- a/usr.sbin/sendmail/cf/ostype/uxpds.m4
+++ b/usr.sbin/sendmail/cf/ostype/uxpds.m4
@@ -1,43 +1,21 @@
divert(-1)
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
# Definitions for UXP/DS (Fujitsu/ICL DS/90 series)
# Diego R. Lopez, CICA (Seville). 1995
#
divert(0)
-VERSIONID(`@(#)uxpds.m4 8.3 (Berkeley) 9/25/96')
+VERSIONID(`@(#)uxpds.m4 8.9 (Berkeley) 5/19/98')
define(`confDEF_GROUP_ID', `6')
define(`ALIAS_FILE', /usr/ucblib/aliases)dnl
@@ -47,3 +25,4 @@ define(`LOCAL_MAILER_PATH', `/usr/ucblib/binmail')dnl
define(`LOCAL_MAILER_FLAGS', `rmn9')dnl
define(`LOCAL_SHELL_FLAGS', `ehuP')dnl
define(`UUCP_MAILER_ARGS', `uux - -r -a$f -gmedium $h!rmail ($u)')dnl
+define(`confEBINDIR', `/usr/ucblib')dnl
diff --git a/usr.sbin/sendmail/cf/sh/makeinfo.sh b/usr.sbin/sendmail/cf/sh/makeinfo.sh
index d5d26923da4..424c699d649 100644
--- a/usr.sbin/sendmail/cf/sh/makeinfo.sh
+++ b/usr.sbin/sendmail/cf/sh/makeinfo.sh
@@ -1,38 +1,16 @@
#!/bin/sh
#
-# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
-# @(#)makeinfo.sh 8.6 (Berkeley) 8/6/95
+# @(#)makeinfo.sh 8.11 (Berkeley) 5/19/98
#
usewhoami=0
@@ -73,7 +51,7 @@ then
else
host=`uname -n`
fi
-echo '#####' built by root@localhost on `date`
+echo '#####' built by $user@$host on `date`
echo '#####' in `pwd` | sed 's/\/tmp_mnt//'
echo '#####' using $1 as configuration include directory | sed 's/\/tmp_mnt//'
echo "define(\`__HOST__', $host)dnl"
diff --git a/usr.sbin/sendmail/contrib/bitdomain.c b/usr.sbin/sendmail/contrib/bitdomain.c
index ec79b9506e4..52d6d2187c3 100644
--- a/usr.sbin/sendmail/contrib/bitdomain.c
+++ b/usr.sbin/sendmail/contrib/bitdomain.c
@@ -51,7 +51,7 @@ char **argv;
{
int opt;
- while ((opt = getopt(argc, argv, "o:")) != -1) {
+ while ((opt = getopt(argc, argv, "o:")) != EOF) {
switch (opt) {
case 'o':
if (!freopen(optarg, "w", stdout)) {
diff --git a/usr.sbin/sendmail/contrib/bsdi.mc b/usr.sbin/sendmail/contrib/bsdi.mc
index dde20161674..8ec7421476f 100644
--- a/usr.sbin/sendmail/contrib/bsdi.mc
+++ b/usr.sbin/sendmail/contrib/bsdi.mc
@@ -35,7 +35,7 @@ and examples describing most of the common things people need to setup.
# See /usr/share/sendmail/README for help in building a configuration file.
#
include(`../m4/cf.m4')
-VERSIONID(`@(#)$Id: bsdi.mc,v 1.2 1996/12/14 21:16:32 downsj Exp $')
+VERSIONID(`@(#)$Id: bsdi.mc,v 1.3 1998/07/12 19:43:44 millert Exp $')
dnl # Specify your OS type below
OSTYPE(`bsd4.4')
diff --git a/usr.sbin/sendmail/contrib/etrn.pl b/usr.sbin/sendmail/contrib/etrn.pl
index 9ccbd51d665..1e2cba9177c 100644
--- a/usr.sbin/sendmail/contrib/etrn.pl
+++ b/usr.sbin/sendmail/contrib/etrn.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/local/bin/perl
'di ';
'ds 00 \\"';
'ig 00 ';
diff --git a/usr.sbin/sendmail/contrib/expn.pl b/usr.sbin/sendmail/contrib/expn.pl
index 757a7570977..daf65f862f6 100644
--- a/usr.sbin/sendmail/contrib/expn.pl
+++ b/usr.sbin/sendmail/contrib/expn.pl
@@ -6,19 +6,19 @@
# THIS PROGRAM IS ITS OWN MANUAL PAGE. INSTALL IN man & bin.
#
-# hardcoded constants, should work fine for BSD-based systems
-require 'sys/socket.ph';
-$sockaddr = 'S n a4 x8';
+use 5.001;
+use IO::Socket;
# system requirements:
# must have 'nslookup' and 'hostname' programs.
-# $Header: /home/cvs/src/usr.sbin/sendmail/contrib/Attic/expn.pl,v 1.4 1997/11/09 04:05:29 gene Exp $
+# $Header: /home/cvs/src/usr.sbin/sendmail/contrib/Attic/expn.pl,v 1.5 1998/07/12 19:43:47 millert Exp $
# TODO:
# less magic should apply to command-line addresses
# less magic should apply to local addresses
# add magic to deal with cross-domain cnames
+# disconnect & reconnect after 25 commands to the same sendmail 8.8.* host
# Checklist: (hard addresses)
# 250 Kimmo Suominen <"|/usr/local/mh/lib/slocal -user kim"@grendel.tac.nyc.ny.us>
diff --git a/usr.sbin/sendmail/contrib/re-mqueue.pl b/usr.sbin/sendmail/contrib/re-mqueue.pl
index 7593946577d..a0f888f0be3 100644
--- a/usr.sbin/sendmail/contrib/re-mqueue.pl
+++ b/usr.sbin/sendmail/contrib/re-mqueue.pl
@@ -84,7 +84,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# @(#)$Id: re-mqueue.pl,v 1.1 1996/12/14 21:16:38 downsj Exp $
+# @(#)$Id: re-mqueue.pl,v 1.2 1998/07/12 19:43:49 millert Exp $
require "syslog.pl";
diff --git a/usr.sbin/sendmail/doc/changes/changes.me b/usr.sbin/sendmail/doc/changes/changes.me
index ee838bd40d7..dbe9bea3cb8 100644
--- a/usr.sbin/sendmail/doc/changes/changes.me
+++ b/usr.sbin/sendmail/doc/changes/changes.me
@@ -1,36 +1,14 @@
-.\" Copyright (c) 1994 Eric P. Allman
+.\" Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+.\" Copyright (c) 1994 Eric P. Allman. All rights reserved.
.\" Copyright (c) 1988, 1994
.\" The Regents of the University of California. All rights reserved.
.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the University of
-.\" California, Berkeley and its contributors.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
+.\" 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.
.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
.\"
-.\" @(#)changes.me 8.2 (Berkeley) 5/3/95
+.\" @(#)changes.me 8.7 (Berkeley) 5/19/98
.\"
.\" ditroff -me -Pxx changes.me
.eh '%''Changes in Sendmail Version 8'
diff --git a/usr.sbin/sendmail/doc/op/op.me b/usr.sbin/sendmail/doc/op/op.me
index 60bc113807b..fc3290ef2d3 100644
--- a/usr.sbin/sendmail/doc/op/op.me
+++ b/usr.sbin/sendmail/doc/op/op.me
@@ -1,36 +1,14 @@
-.\" Copyright (c) 1983, 1995 Eric P. Allman
+.\" Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+.\" Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
.\" Copyright (c) 1983, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the University of
-.\" California, Berkeley and its contributors.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
+.\" 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.
.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
.\"
-.\" @(#)op.me 8.106 (Berkeley) 10/20/97
+.\" @(#)op.me 8.129 (Berkeley) 6/29/98
.\"
.\" eqn op.me | pic | troff -me
.eh 'SMM:08-%''Sendmail Installation and Operation Guide'
@@ -57,7 +35,7 @@
.+c
.(l C
.sz 16
-.b SENDMAIL
+.b SENDMAIL\u\s-6TM\s0\d
.sz 12
.sp
.b "INSTALLATION AND OPERATION GUIDE"
@@ -65,15 +43,19 @@
.sp
.r
Eric Allman
-eric@Sendmail.ORG
+Sendmail, Inc.
+eric@Sendmail.COM
.sp
-Version 8.106
+Version 8.129
.sp
-For Sendmail Version 8.8
+For Sendmail Version 8.9
.)l
+.(f
+Sendmail is a trademark of Sendmail, Inc.
+.)f
.sp 2
.pp
-.i Sendmail
+.i Sendmail \u\s-2TM\s0\d
implements a general purpose internetwork mail routing facility
under the UNIX\(rg
operating system.
@@ -94,22 +76,25 @@ However, there are only a few basic configurations
for most sites,
for which standard configuration files have been supplied.
Most other configurations
-can be built by adjusting an existing configuration files
+can be built by adjusting an existing configuration file
incrementally.
.pp
.i Sendmail
is based on
RFC821 (Simple Mail Transport Protocol),
-RFC822 (Internet Mail Format Protocol),
+RFC822 (Internet Mail Headers Format),
RFC1123 (Internet Host Requirements),
-RFC1521 (MIME),
-RFC1651 (SMTP Service Extensions),
+RFC2045 (MIME),
+RFC1869 (SMTP Service Extensions),
+RFC1652 (SMTP 8BITMIME Extension),
+RFC1870 (SMTP SIZE Extension),
RFC1891 (SMTP Delivery Status Notifications),
RFC1892 (Multipart/Report),
RFC1893 (Mail System Status Codes),
RFC1894 (Delivery Status Notifications),
+RFC1985 (SMTP Service Extension for Remote Message Queue Starting),
and
-RFC1985 (SMTP Service Extension for Remote Message Queue Starting).
+RFC2033 (Local Message Transmission Protocol).
However, since
.i sendmail
is designed to work in a wider world,
@@ -147,19 +132,13 @@ This section is for masochists
and people who must write their own configuration file.
Section six
describes configuration that can be done at compile time.
-Section seven
-gives a brief description of differences
-in this version of
-.i sendmail .
The appendixes give a brief
but detailed explanation of a number of features
not described in the rest of the paper.
.pp
-.b WARNING:
-Several major changes were introduced in version 8.7.
-You should not attempt to use this document
-for prior versions of
-.i sendmail .
+.\"XXX
+.b DISCLAIMER:
+This documentation is under modification.
.bp
.rs
.sp |4i
@@ -171,7 +150,12 @@ replace it with a blank sheet for double-sided output.
.pp
There are two basic steps to installing
.i sendmail .
-The hard part is to build the configuration table.
+First, you have to compile and install the binary.
+If
+.i sendmail
+has already been ported to your operating system
+that should be simple.
+Second, you must build a run-time configuration file.
This is a file that
.i sendmail
reads when it starts up
@@ -179,11 +163,9 @@ that describes the mailers it knows about,
how to parse addresses,
how to rewrite the message header,
and the settings of various options.
-Although the configuration table is quite complex,
+Although the configuration file can be quite complex,
a configuration can usually be built
-by adjusting an existing off-the-shelf configuration.
-The second part is actually doing the installation,
-i.e., creating the necessary files, etc.
+using an M4-based configuration language.
.pp
The remainder of this section will describe the installation of
.i sendmail
@@ -208,20 +190,76 @@ All
source is in the
.i src
subdirectory.
-If you are running on a 4.4BSD system,
-compile by typing
-.q make .
-On other systems, you may have to make some other adjustments.
-On most systems,
-you can do the appropriate compilation by typing
+To compile sendmail,
+.q cd
+into the
+.i src
+directory and type
.(b
-sh makesendmail
+\&./Build
.)b
-This will leave the binary in an appropriately named subdirectory.
+This will leave the binary in an appropriately named subdirectory,
+e.g.,
+obj.BSD-OS.2.1.i386.
It works for multiple object versions
compiled out of the same directory.
+.sh 3 "Tweaking the Build Invocation"
+.pp
+You can give parameters on the
+.i Build
+command.
+In most cases these are only used when the
+.i obj.*
+directory is first created.
+These commands include:
+.nr ii 0.5i
+.ip "\-L \fIlibdirs\fP"
+A list of directories to search for libraries.
+.ip "\-I \fIincdirs\fP"
+A list of directories to search for include files.
+.ip "\-E \fIenvar\fP=\fIvalue\fP"
+Set an environment variable to an indicated
+.i value
+before compiling.
+This is normally used to set an ABI on Irix.
+.ip "\-c"
+Create a new
+.i obj.*
+tree before running.
+.ip "\-f \fIsiteconfig\fP"
+Read the indicated site configuration file.
+If this parameter is not specified,
+.i Build
+includes
+.i all
+of the files
+.i $BUILDTOOLS/Site/site.$oscf.m4
+and
+.i $BUILDTOOLS/Site/site.config.m4 ,
+where $BUILDTOOLS is normally
+.i \&../BuildTools
+and $oscf is the same name as used on the
+.i obj.*
+directory.
+See below for a description of the site configuration file.
+.ip "\-S"
+Skip auto-configuration.
+.i Build
+will avoid auto-detecting libraries if this is set.
+All libraries and map definitions must be specified
+in the site configuration file.
+.lp
+Any other parameters are passed to the
+.i make
+program.
+.sh 3 "Creating a Site Configuration File"
+.\"XXX
+.pp
+(This section is not yet complete.
+For now, see the file BuildTools/README for details.)
.sh 3 "Tweaking the Makefile"
.pp
+.b "XXX This should all be in the Site Configuration File section."
.i Sendmail
supports two different formats
for the local (on disk) version of databases,
@@ -237,16 +275,17 @@ This was the preferred format prior to 4.4BSD.
It allows such complex things as multiple databases
and closing a currently open database.
.ip NEWDB
-The new database package from Berkeley.
+The Berkeley DB package.
If you have this, use it.
It allows
long records,
multiple open databases,
real in-memory caching,
and so forth.
-You can define this in conjunction with one of the other two;
+You can define this in conjunction with
+.sm NDBM ;
if you do,
-old databases are read,
+old alias databases are read,
but when a new database is created it will be in NEWDB format.
As a nasty hack,
if you have NEWDB, NDBM, and NIS defined,
@@ -284,18 +323,19 @@ unless you are porting to a new environment.
After making the local system configuration described above,
You should be able to compile and install the system.
The script
-.q makesendmail
+.q Build
is the best approach on most systems:
.(b
-sh makesendmail
+\&./Build
.)b
This will use
.i uname (1)
-to select the correct Makefile for your environment.
+to create a custom Makefile for your environment.
.pp
-You may be able to install using
+If you are installing in the standard places,
+you should be able to install using
.(b
-sh makesendmail install
+\&./Build install
.)b
This should install the binary in
/usr/\*(SD
@@ -362,11 +402,9 @@ These can be literal host names
when the hosts are gateways
or more general descriptions
(such as
-.q "tcpproto.mc"
+.q "generic-solaris2.mc"
as a general description of an SMTP-connected host
-or
-.q "uucpproto.mc"
-as a general description of a UUCP-connected host).
+running Solaris 2.x.
Files ending
.b \&.mc
(``Master Configuration'')
@@ -379,12 +417,8 @@ The general structure of these files is described below.
Site-dependent subdomain descriptions.
These are tied to the way your organization wants to do addressing.
For example,
-.b domain/cs.exposed.m4
-is our description for hosts in the CS.Berkeley.EDU subdomain
-that want their individual hostname to be externally visible;
-.b domain/cs.hidden.m4
-is the same except that the hostname is hidden
-(everything looks like it comes from CS.Berkeley.EDU).
+.b domain/CS.Berkeley.EDU.m4
+is our description for hosts in the CS.Berkeley.EDU subdomain.
These are referenced using the
.sm DOMAIN
.b m4
@@ -447,24 +481,6 @@ build process.
You shouldn't have to mess with these.
.ip siteconfig
Local UUCP connectivity information.
-They normally contain lists of site information, for example:
-.(b
-SITE(contessa)
-SITE(hoptoad)
-SITE(nkainc)
-SITE(well)
-.)b
-They are referenced using the SITECONFIG macro:
-.(b
-SITECONFIG(site.config.file, name_of_site, X)
-.)b
-where
-.i X
-is the macro/class name to use.
-It can be U
-(indicating locally connected hosts)
-or one of W, X, or Y
-for up to three remote UUCP hubs.
This directory has been supplanted by the mailertable feature;
any new configurations should use that feature to do UUCP
(and other) routing.
@@ -474,16 +490,14 @@ If you are in a new domain
you will probably want to create a
cf/domain
file for your domain.
-This consists primarily of relay definitions:
+This consists primarily of relay definitions
+and features you want enabled site-wide:
for example, Berkeley's domain definition
defines relays for
-BitNET,
-CSNET,
+BitNET
and UUCP.
-Of these,
-only the UUCP relay is particularly specific
-to Berkeley.
-All of these are internet-style domain names.
+These are specific to Berkeley,
+and should be fully-qualified internet-style domain names.
Please check to make certain they are reasonable for your domain.
.pp
Subdomains at Berkeley are also represented in the
@@ -491,13 +505,14 @@ cf/domain
directory.
For example,
the domain
-cs-exposed
-is the Computer Science subdomain with the local hostname shown
-to other users;
-cs-hidden
-makes users appear to be from the CS.Berkeley.EDU subdomain
-(with no local host information included).
-You will probably have to update this directory
+CS.Berkeley.EDU
+is the Computer Science subdomain,
+EECS.Berkeley.EDU
+is the Electrical Engineering and Computer Sciences subdomain,
+and
+S2K.Berkeley.EDU
+is the Sequoia 2000 subdomain.
+You will probably have to add an entry to this directory
to be appropriate for your domain.
.pp
You will have to use or create
@@ -554,11 +569,12 @@ and I've also seen it in
and
.b /etc/mail .
If you want to move this file,
-change
-.i src/conf.h .
+add -D_PATH_SENDMAILCF=\e"/file/name\e"
+to the flags passed to the C compiler.
+Moving this file is not recommended:
+other programs and scripts know of this location.
.)f
-This and /etc/sendmail.pid
-are the only non-library file names compiled into
+This is the only non-library file name compiled into
.i sendmail \**.
.(f
\**The system libraries can reference other files;
@@ -597,7 +613,9 @@ command should just be a link to
in a fashion similar to
.i newaliases .
This command lists the status of the last mail transaction
-with all remote hosts.
+with all remote hosts. The
+.b \-v
+flag will prevent the status display from being truncated.
It functions only when the
.b HostStatusDirectory
option is set.
@@ -648,38 +666,21 @@ You should extend this file with any aliases that are apropos to your system.
.pp
Normally
.i sendmail
-looks at a version of these files maintained by the
-.i dbm \|(3)
-or
-.i db \|(3)
-routines.
-These are stored either in
+looks at a database version of the files,
+stored either in
.q /etc/aliases.dir
and
.q /etc/aliases.pag
or
.q /etc/aliases.db
depending on which database package you are using.
-These can initially be created as empty files,
-but they will have to be initialized promptly.
-These should be mode 644:
-.(b
-cp /dev/null /etc/aliases.dir
-cp /dev/null /etc/aliases.pag
-chmod 644 /etc/aliases.*
-newaliases
-.)b
-The
-.i db
-routines preset the mode reasonably,
-so this step can be skipped.
The actual path of this file
is defined in the
.b AliasFile
option of the
.i sendmail.cf
file.
-.sh 3 "/etc/rc"
+.sh 3 "/etc/rc or /etc/init.d/sendmail"
.pp
It will be necessary to start up the
.i sendmail
@@ -695,7 +696,11 @@ Add the following lines to
(or
.q /etc/rc.local
as appropriate)
-in the area where it is starting up the daemons:
+in the area where it is starting up the daemons
+on a BSD-base system,
+or on a System-V-based system
+in one of the startup files, typically
+.q /etc/init.d/sendmail :
.(b
if [ \-f /usr/\*(SD/sendmail \-a \-f /etc/sendmail.cf ]; then
(cd /var/spool/mqueue; rm \-f [lnx]f*)
@@ -722,9 +727,10 @@ causes it to run the queue every half hour.
Some people use a more complex startup script,
removing zero length qf files and df files for which there is no qf file.
For example, see Figure 1
-for an example of a complex startup script.
+for an example of a complex script which does this clean up.
.(z
.hl
+#!/bin/sh
# remove zero length qf files
for qffile in qf*
do
@@ -746,8 +752,11 @@ do
echo \-n " <recovering: $tffile>" > /dev/console
mv $tffile $qffile
else
- echo \-n " <extra: $tffile>" > /dev/console
- rm \-f $tffile
+ if [ \-f $tffile ]
+ then
+ echo \-n " <extra: $tffile>" > /dev/console
+ rm \-f $tffile
+ fi
fi
done
# remove df files with no corresponding qf files
@@ -763,7 +772,10 @@ done
# announce files that have been saved during disaster recovery
for xffile in [A-Z]f*
do
- echo \-n " <panic: $xffile>" > /dev/console
+ if [ \-f $xffile ]
+ then
+ echo \-n " <panic: $xffile>" > /dev/console
+ fi
done
.sp
.ce
@@ -788,7 +800,7 @@ cp lib/sendmail.hf /usr/lib
.)b
The actual path of this file
is defined in the
-.b H
+.b HelpFile
option of the
.i sendmail.cf
file.
@@ -1081,11 +1093,12 @@ If this option is set,
you probably want to set the
.b MinQueueAge
option as well and run the queue fairly frequently;
-this will cause hosts that are skipped because another
+this way jobs that are skipped because another
.i sendmail
-instance is talking to it to be tried again soon.
+is talking to the same host will be tried again quickly
+rather than being delayed for a long time.
.pp
-The disk based host information is stored in a subdirectory of of the
+The disk based host information is stored in a subdirectory of the
.b mqueue
directory called
.b \&.hoststat \**.
@@ -1135,7 +1148,13 @@ is controlled by the service switch.
If the host operating system supports such a switch
.i sendmail
will use the native version.
-Ultrix, Solaris, and DEC OSF/1 are examples of such systems.
+Ultrix, Solaris, and DEC OSF/1 are examples of such systems\**.
+.(f
+\**HP-UX 10 has service switch support,
+but since the APIs are apparently not available in the libraries
+.i sendmail
+does not use the native service switch in this release.
+.)f
.pp
If the underlying operating system does not support a service switch
(e.g., SunOS, HP-UX, BSD)
@@ -1144,7 +1163,7 @@ then
will provide a stub implementation.
The
.b ServiceSwitchFile
-option points to the name of a file that has the service definitions
+option points to the name of a file that has the service definitions.
Each line has the name of a service
and the possible implementations of that service.
For example, the file:
@@ -1190,14 +1209,14 @@ which must resolve to a
triple.
If the flags selected by the
.i mailer
-includes the
+include the
.b A
(aliasable) flag,
the
.i user
part of the triple is looked up as the key
(i.e., the left hand side)
-into the alias database
+into the alias database.
If there is a match, the address is deleted from the send queue
and all addresses on the right hand side of the alias
are added in place of the alias that was found.
@@ -1238,15 +1257,17 @@ The second form is processed by the
.(f
\**The
.i gdbm
-package probably works as well.
+package does not work.
.)f
+or the Berkeley DB library.
+This form is in the file
+.i /etc/aliases.db
+(if using NEWDB)
or
-.i db \|(3)
-library.
-This form is in the files
.i /etc/aliases.dir
and
-.i /etc/aliases.pag.
+.i /etc/aliases.pag
+(if using NDBM).
This is the form that
.i sendmail
actually uses to resolve aliases.
@@ -1255,7 +1276,7 @@ This technique is used to improve performance.
The control of search order is actually set by the service switch.
Essentially, the entry
.(b
-OAswitch:aliases
+O AliasFile=switch:aliases
.)b
is always added as the first alias entry;
also, the first alias file name without a class
@@ -1266,7 +1287,7 @@ will be used as the name of the file for a ``files'' entry
in the aliases switch.
For example, if the configuration file contains
.(b
-OA/etc/aliases
+O AliasFile=/etc/aliases
.)b
and the service switch contains
.(b
@@ -1281,8 +1302,8 @@ You can also use
alias files.
For example, the specification:
.(b
-OA/etc/aliases
-OAnis:mail.aliases@my.nis.domain
+O AliasFile=/etc/aliases
+O AliasFile=nis:mail.aliases@my.nis.domain
.)b
will first search the /etc/aliases file
and then the map named
@@ -1305,12 +1326,21 @@ exactly like a
.b K
line \(em for example:
.(b
-OAnis:\-N mail.aliases@my.nis.domain
+O AliasFile=nis:\-N mail.aliases@my.nis.domain
.)b
will search the appropriate NIS map and always include null bytes in the key.
+Also:
+.(b
+O AliasFile=nis:\-f mail.aliases@my.nis.domain
+.)b
+will prevent sendmail from downcasing the key before the alias lookup.
.sh 3 "Rebuilding the alias database"
.pp
-The DB or DBM version of the database
+The
+.i hash
+or
+.i dbm
+version of the database
may be rebuilt explicitly by executing the command
.(b
newaliases
@@ -1471,7 +1501,7 @@ will be redirected to the specified accounts.
Actually, the configuration file defines a sequence of filenames to check.
By default, this is the user's .forward file,
but can be defined to be more generally using the
-.b J
+.b ForwardPath
option.
If you change this,
you will have to inform your user base of the change;
@@ -1500,7 +1530,7 @@ It is only used if the
.b UseErrorsTo
option is set.
.pp
-The Errors-To: header is official deprecated
+The Errors-To: header is officially deprecated
and will go away in a future release.
.sh 3 "Apparently-To:"
.pp
@@ -1516,8 +1546,6 @@ option.
One of the possible actions is to add an
.q "Apparently-To:"
header line for any recipients it is aware of.
-This is not put in as a standard recipient line
-to warn any recipients that the list is not complete.
.pp
The Apparently-To: header is non-standard
and is deprecated.
@@ -2055,6 +2083,11 @@ The timeout waiting for a reply to an IDENT query
.(f
\**On some systems the default is zero to turn the protocol off entirely.
.)f
+.ip hoststatus
+How long status information about a host
+(e.g., host down)
+will be cached before it is considered stale
+[30m, unspecified].
.lp
For compatibility with old configuration files,
if no
@@ -2351,15 +2384,17 @@ The default using a standard configuration table is level 9.
The levels are as follows:
.nr ii 0.5i
.ip 0
-No logging.
+Minimal logging.
.ip 1
Serious system failures and potential security problems.
.ip 2
Lost communications (network problems) and protocol failures.
.ip 3
-Other serious failures.
+Other serious failures, malformed addresses, transient forward/include
+errors, connection timeouts.
.ip 4
-Minor failures.
+Minor failures, out of date alias databases, connection rejections
+via check_ rulesets.
.ip 5
Message collection statistics.
.ip 6
@@ -2374,7 +2409,16 @@ Messages being deferred
(due to a host being down, etc.).
.ip 10
Database expansion (alias, forward, and userdb lookups).
+.ip 11
+NIS errors and end of job processing.
.ip 12
+Logs all SMTP connections.
+.ip 13
+Log bad user shells, files with improper permissions, and other
+questionable situations.
+.ip 14
+Logs refused connections.
+.ip 15
Log all incoming and outgoing SMTP commands.
.ip 20
Logs attempts to run locked queue files.
@@ -2390,28 +2434,38 @@ No normal site would ever set these.
.pp
The modes used for files depend on what functionality you want
and the level of security you require.
+In many cases
+.i sendmail
+does careful checking of the modes
+of files and directories
+to avoid accidental compromise;
+if you want to make it possible to have group-writable support files
+you may need to use the
+.b DontBlameSendmail
+option to turn off some of these checks.
.sh 3 "To suid or not to suid?"
.pp
.i Sendmail
-can safely be made
+is normally installed
setuid to root.
At the point where it is about to
.i exec \|(2)
a mailer,
-it checks to see if the userid is zero;
+it checks to see if the userid is zero (root);
if so,
it resets the userid and groupid to a default
(set by the
-.b u
-and
-.b g
-options).
-(This can be overridden
+.b U=
+equate in the mailer line;
+if that is not set, the
+.b DefaultUser
+option is used).
+This can be overridden
by setting the
.b S
flag to the mailer
for mailers that are trusted
-and must be called as root.)
+and must be called as root.
However,
this will cause mail processing
to be accounted
@@ -2439,62 +2493,174 @@ Also, this isn't a guarantee of security:
for example,
root occasionally sends mail,
and the daemon often runs as root.
-.sh 3 "Should my alias database be writable?"
-.pp
-At Berkeley
-we have the alias database
-(/etc/aliases*)
-mode 644.
-While this is not as flexible as if the database
-were more 666, it avoids potential security problems
-with a globally writable database.
+Note however that
+.i sendmail
+must run as root in order to create the SMTP listener socket.
.pp
-The database that
+A middle ground is to make
.i sendmail
-actually used
-is represented by the two files
-.i aliases.dir
-and
-.i aliases.pag
-(both in /etc)
-(or
-.i aliases.db
-if you are running with the new Berkeley database primitives).
-The mode on these files should match the mode
-on /etc/aliases.
-If
-.i aliases
-is writable
-and the
-DBM
-files
-(\c
-.i aliases.dir
+setuid to root,
+but set the
+.b RunAsUser
+option.
+This causes
+.i sendmail
+to become the indicated user as soon as it has done the startup
+that requires root privileges
+(primarily, opening the
+.sm SMTP
+socket).
+If you use
+.b RunAsUser ,
+the queue directory
+(normally
+.i /var/spool/mqueue )
+should be owned by that user,
+and all files and databases
+(including user
+.i \&.forward
+files,
+alias files,
+:include: files,
+and external databases)
+must be readable by that user.
+.b RunAsUser
+is probably best suited for firewall configurations
+that don't have regular user logins.
+.sh 3 "Turning off security checks"
+.pp
+.i Sendmail
+is very particular about the modes of files that it reads or writes.
+For example, by default it will refuse to read most files
+that are group writable
+on the grounds that they might have been tampered with
+by someone other than the owner;
+it will even refuse to read files in group writable directories.
+.pp
+If you are
+.i quite
+sure that your configuration is safe and you want
+.i sendmail
+to avoid these security checks,
+you can turn off certain checks using the
+.b DontBlameSendmail
+option.
+This option takes one or more names that disable checks.
+In the descriptions that follow,
+.q "unsafe directory"
+means a directory that is writable by anyone other than the owner.
+The values are:
+.nr ii 0.5i
+.ip Safe
+No special handling.
+.ip AssumeSafeChown
+Assume that the
+.i chown
+system call is restricted to root.
+Since some versions of Unix permit regular users
+to give away their files to other users on some filesystems,
+.i sendmail
+often cannot assume that a given file was created by the owner,
+particularly when it is in a writable directory.
+You can set this flag if you know that file giveaway is restricted
+on your system.
+.ip ClassFileInUnsafeDirPath
+When reading class files (using the
+.b F
+line in the configuration file),
+allow files that are in unsafe directories.
+.ip ErrorHeaderInUnsafeDirPath
+Allow the file named in the
+.b ErrorHeader
+option to be in an unsafe directory.
+.ip GroupWritableDirPathSafe
+Change the definition of
+.q "unsafe directory"
+to consider group-writable directories to be safe.
+World-writable directories are always unsafe.
+.ip GroupWritableForwardFileSafe
+Accept group-writable
+.i \&.forward
+files.
+.ip GroupWritableIncludeFileSafe
+Accept group-writable
+.i :include:
+files.
+.ip GroupWritableAliasFile
+Allow group-writable alias files.
+.ip HelpFileInUnsafeDirPath
+Allow the file named in the
+.b HelpFile
+option to be in an unsafe directory.
+.ip WorldWritableAliasFile
+Accept world-writable alias files.
+.ip ForwardFileInGroupWritableDirPath
+Allow
+.i \&.forward
+files in group writable directories.
+.ip IncludeFileInGroupWritableDirPath
+Allow
+.i :include:
+files in group writable directories.
+.ip ForwardFileInUnsafeDirPath
+Allow
+.i \&.forward
+files in unsafe directories.
+.ip IncludeFileInUnsafeDirPath
+Allow
+.i :include:
+files in unsafe directories.
+.ip ForwardFileInUnsafeDirPathSafe
+Allow a
+.i \&.forward
+file that is in an unsafe directory to include references
+to program and files.
+.ip IncludeFileInUnsafeDirPathSafe
+Allow a
+.i :include:
+file that is in an unsafe directory to include references
+to program and files.
+.ip MapInUnsafeDirPath
+Allow maps (e.g.,
+.i hash ,
+.i btree ,
and
-.i aliases.pag )
-are not,
-users will be unable to reflect their desired changes
-through to the actual database.
-However,
-if
-.i aliases
-is read-only
-and the DBM files are writable,
-a slightly sophisticated user
-can arrange to steal mail anyway.
-.pp
-If your DBM files are not writable by the world
-or you do not have auto-rebuild enabled
-(with the
-.b AutoRebuildAliases
-option),
-then you must be careful to reconstruct the alias database
-each time you change the text version:
-.(b
-newaliases
-.)b
-If this step is ignored or forgotten
-any intended changes will also be ignored or forgotten.
+.i dbm
+files)
+in unsafe directories.
+.ip LinkedAliasFileInWritableDir
+Allow an alias file that is a link in a writable directory.
+.ip LinkedClassFileInWritableDir
+Allow class files that are links in writable directories.
+.ip LinkedForwardFileInWritableDir
+Allow
+.i \&.forward
+files that are links in writable directories.
+.ip LinkedIncludeFileInWritableDir
+Allow
+.i :include:
+files that are links in writable directories.
+.ip LinkedMapInWritableDir
+Allow map files that are links in writable directories.
+.ip LinkedServiceSwitchFileInWritableDir
+Allow the service switch file to be a link
+even if the directory is writable.
+.ip FileDeliveryToHardLink
+Allow delivery to files that are hard links.
+.ip FileDeliveryToSymLink
+Allow delivery to files that are symbolic links.
+.ip RunProgramInUnsafeDirPath
+Go ahead and run programs that are in writable directories.
+.ip RunWritableProgram
+Go ahead and run programs that are group- or world-writable.
+.ip WriteMapToHardLink
+Allow writes to maps that are hard links.
+.ip WriteMapToSymLink
+Allow writes to maps that are symbolic links.
+.ip WriteStatsToHardLink
+Allow the status file to be a hard link.
+.ip WriteStatsToSymLink
+Allow the status file to be a symbolic link.
.sh 2 "Connection Caching"
.pp
When processing the queue,
@@ -2558,7 +2724,12 @@ which should be created.
only uses two entries:
.b hosts
and
-.b aliases .
+.b aliases ,
+although system routines may use other services
+(notably the
+.b passwd
+service for user name lookups by
+.i getpwname ).
.pp
However, some systems (such as SunOS)
will do DNS lookups
@@ -2691,6 +2862,12 @@ If you create a directory such as /var/forward,
it should be mode 1777
(that is, the sticky bit should be set).
Users should create the files mode 644.
+Note that you must use the
+forwardfileinunsafedirpath and
+forwardfileinunsafedirpathsafe
+flags with the DontBlameSendmail option
+to allow forward files in a world
+writable directory.
.sh 2 "Free Space"
.pp
On systems that have one of the system calls in the
@@ -2862,7 +3039,7 @@ Expansions of the form
.b $& \c
.i x
are performed at run time using a somewhat less general algorithm.
-This for is intended only for referencing internally defined macros
+This is intended only for referencing internally defined macros
such as
.b $h
that are changed at runtime.
@@ -2969,9 +3146,9 @@ and
would become
.q vangogh.CS.Berkeley.EDU.
.i Sendmail
-recognizes it's numeric IP address
+recognizes its numeric IP address
without calling the name server
-and replaces it with it's canonical name.
+and replaces it with its canonical name.
.pp
The
.b $(
@@ -3001,11 +3178,16 @@ then becomes
the substitution for this rule.
The
.b $>
-syntax can only be used at the beginning of the right hand side;
-it can be only be preceded by
-.b $@
-or
-.b $: .
+syntax expands everything after the ruleset name
+to the end of the replacement string
+and then passes that as the initial input to the ruleset.
+Recursive calls are allowed.
+For example,
+.(b
+$>0 $>3 $1
+.)b
+expands $1, passes that to ruleset 3, and then passes the result
+of ruleset 3 to ruleset 0.
.pp
The
.b $#
@@ -3123,9 +3305,9 @@ and
are processed.
.sh 3 "Semantics of rewriting rule sets"
.pp
-There are five rewriting sets
+There are six rewriting sets
that have specific semantics.
-Four of these are related as depicted by figure 1.
+Five of these are related as depicted by figure 1.
.(z
.hl
.ie n \{\
@@ -3259,8 +3441,13 @@ The
.q check_*
forms all give accept/reject status;
falling off the end or returning normally is an accept,
-and resolving to $#error
+and resolving to
+.b $#error
is a reject.
+Many of these can also resolve to the special mailer
+.b $#discard ;
+this accepts the message as though it were successful
+but then discards it without delivery.
.sh 4 "check_relay"
.pp
The
@@ -3325,7 +3512,7 @@ for example:
[128.32.149.78]
.)b
This causes direct conversion of the numeric value
-to a TCP/IP host address.
+to an IP host address.
.pp
The host name passed in after the
.q $@
@@ -3611,6 +3798,11 @@ The envelope id passed to sendmail as part of the envelope.
The current operation mode (from the
.b \-b
flag).
+.ip ${deliveryMode}
+The current delivery mode
+(from the
+.b DeliveryMode
+option).
.pp
There are three types of dates that can be used.
The
@@ -3828,7 +4020,7 @@ Classes of phrases may be defined
to match on the left hand side of rewriting rules,
where a
.q phrase
-is a sequence of characters that do not contain space characters.
+is a sequence of characters that does not contain space characters.
For example
a class of all local names for this site
might be created
@@ -3955,7 +4147,7 @@ it will be stripped to 7 bits.
set to the set of trusted users by the
.b T
configuration line.
-If you want to read trusted users from a file use
+If you want to read trusted users from a file, use
.b Ft \c
.i /file/name .
.ip $=w
@@ -4032,7 +4224,7 @@ apply to the mailers for the sender address
rather than the usual recipient mailers.
.nr ii 4n
.ip a
-Run Extended SMTP (ESMTP) protocol (defined in RFCs 1651, 1652, and 1653).
+Run Extended SMTP (ESMTP) protocol (defined in RFCs 1869, 1652, and 1870).
This flag defaults on if the SMTP greeting message includes the word
.q ESMTP .
.ip A
@@ -4092,7 +4284,7 @@ so try to avoid connecting normally;
any necessary connection will occur during a queue run.
.ip E
Escape lines beginning with
-.q From
+.q From\0
in the message with a `>' sign.
.ip f
The mailer wants a
@@ -4284,6 +4476,14 @@ will have an extra dot prepended
(to be stripped at the other end).
This insures that lines in the message containing a dot
will not terminate the message prematurely.
+.ip z
+Run Local Mail Transfer Protocol (LMTP)
+between
+.i sendmail
+and the local mailer.
+This is a variant on SMTP
+defined in RFC 2033
+that is specifically designed for delivery to a local mailbox.
.ip 0
Don't look up MX records for hosts sent via SMTP.
.ip 3
@@ -4367,6 +4567,11 @@ if the LHS matches.
This mailer is only functional in rulesets 0, 5,
or one of the check_* rulesets.
.pp
+The mailer with the special name
+.q discard
+causes any mail sent to it to be discarded
+but otherwise treated as though it were successfully delivered.
+.pp
The mailer named
.q local
.i must
@@ -4383,9 +4588,9 @@ files,
and :include: lists respectively.
They default to:
.(b
-Mprog, P=/bin/sh, F=lsD, A=sh \-c $u
-M*file*, P=/dev/null, F=lsDFMPEu, A=FILE
-M*include*, P=/dev/null, F=su, A=INCLUDE
+Mprog, P=/bin/sh, F=lsoDq9, T=DNS/RFC822/X-Unix, A=sh \-c $u
+M*file*, P=[FILE], F=lsDFMPEouq9, T=DNS/RFC822/X-Unix, A=FILE $u
+M*include*, P=/dev/null, F=su, A=INCLUDE $u
.)b
.pp
The Sender and Recipient rewriting sets
@@ -4491,7 +4696,7 @@ Continuation lines in this spec
are reflected directly into the outgoing message.
The
.i htemplate
-is macro expanded before insertion into the message.
+is macro-expanded before insertion into the message.
If the
.i mflags
(surrounded by question marks)
@@ -4505,6 +4710,46 @@ regardless of these flags.
.pp
Some headers have special semantics
that will be described later.
+.pp
+A secondary syntax allows validation of headers as they are being read.
+To enable validation, use:
+.(b
+.b H \c
+.i Header \c
+.b ": $>" \c
+.i Ruleset
+.)b
+The indicated
+.i Ruleset
+is called for the specified
+.i Header ,
+and can return
+.b $#error
+to reject the message or
+.b $#discard
+to discard the message
+(as with the other
+.b check_ *
+rulesets).
+The header is treated as a structured field,
+that is,
+comments (in parentheses) are deleted before processing.
+.pp
+For example, the configuration lines:
+.(b
+HMessage-Id: $>CheckMessageId
+
+SCheckMessageId
+R< $+ @ $+ > $@ OK
+R$* $#error $: Illegal Message-Id header
+.)b
+would refuse any message that had a Message-Id: header of any of the
+following forms:
+.(b
+Message-Id: <>
+Message-Id: some text
+Message-Id: <legal text@domain> extra crud
+.)b
.sh 2 "O \*- Set Option"
.pp
There are a number of
@@ -4813,6 +5058,58 @@ Units default to seconds, so
uses a five second delay.
Defaults to zero
(no retry).
+.ip DontBlameSendmail=\fIoption,option,...\fP
+[no short name]
+In order to avoid possible cracking attempts
+caused by world- and group-writable files and directories,
+.i sendmail
+does paranoid checking when opening most of its support files.
+If for some reason you absolutely must run with,
+for example,
+a group-writable
+.i /etc
+directory,
+then you will have to turn off this checking
+(at the cost of making your system more vulnerable to attack).
+The arguments are individual options that turn off checking:
+.(b
+Safe
+AssumeSafeChown
+ClassFileInUnsafeDirPath
+ErrorHeaderInUnsafeDirPath
+FileDeliveryToHardLink
+FileDeliveryToSymLink
+ForwardFileInUnsafeDirPath
+ForwardFileInUnsafeDirPathSafe
+ForwardFileIngroupWritableDirPath
+GroupWritableAliasFile
+GroupWritableDirPathSafe
+GroupWritableForwardFileSafe
+GroupWritableIncludeFileSafe
+HelpFileinUnsafeDirPath
+IncludeFileInUnsafeDirPath
+IncludeFileInUnsafeDirPathSafe
+IncludeFileIngroupWritableDirPath
+LinkedAliasFileInWritableDir
+LinkedClassFileInWritableDir
+LinkedForwardFileInWritableDir
+LinkedIncludeFileInWritableDir
+LinkedMapInWritableDir
+LinkedServiceSwitchFileInWritableDir
+MapInUnsafeDirPath
+RunProgramInUnsafeDirPath
+RunWritableProgram
+WorldWritableAliasFile
+WriteMapToHardLink
+WriteMapToSymLink
+WriteStatsToHardLink
+WriteStatsToSymLink
+.)b
+.b Safe
+is the default.
+The details of these flags are described above.
+.\"XXX should have more here!!! XXX
+.b "Use of this option is not recommended."
.ip DontExpandCnames
[no short name]
The standards say that all host addresses used in a mail message
@@ -4843,6 +5140,22 @@ The cost of this is that the only group found for users
will be their primary group (the one in the password file),
which will make file access permissions somewhat more restrictive.
Has no effect on systems that don't have group lists.
+.ip DontProbeInterfaces
+[no short name]
+.i Sendmail
+normally finds the names of all interfaces active on your machine
+when it starts up
+and adds their name to the
+.b $=w
+class of known host aliases.
+If you have a large number of virtual interfaces
+or if your DNS inverse lookups are slow
+this can be time consuming.
+This option turns off that probing.
+However, you will need to be certain to include all variant names
+in the
+.b $=w
+class by some other mechanism.
.ip DontPruneRoutes
[R]
Normally,
@@ -5032,7 +5345,7 @@ This is always disabled (that is, dots are always accepted)
when reading SMTP mail.
.ip LogLevel=\fIn\fP
[L]
-Set the default log level to
+Set the log level to
.i n .
Defaults to 9.
.ip M\fIx\|value\fP
@@ -5102,6 +5415,13 @@ highest priority jobs)
this should be set as high as possible to avoid
.q losing
jobs that happen to fall late in the queue directory.
+.ip MaxRecipientsPerMessage=\fIN\fP
+[no short name]
+The maximum number of recipients that will be accepted per message
+in an SMTP transaction.
+Note: setting this too low can interfere with sending mail from
+MUAs that use SMTP for initial submission.
+If not set, there is no limit on the number of recipients per envelope.
.ip MeToo
[m]
Send to me too,
@@ -5216,12 +5536,24 @@ needexpnhelo Insist on HELO or EHLO command before EXPN
noexpn Disallow EXPN entirely
needvrfyhelo Insist on HELO or EHLO command before VRFY
novrfy Disallow VRFY entirely
+noetrn Disallow ETRN entirely
+noverb Disallow VERB entirely
restrictmailq Restrict mailq command
restrictqrun Restrict \-q command line flag
-noreceipts Don't return success DSNs
+noreceipts Don't return success DSNs\**
goaway Disallow essentially all SMTP status queries
authwarnings Put X-Authentication-Warning: headers in messages
.)b
+.(f
+\**N.B.:
+the
+.b noreceipts
+flag causes
+.i sendmail
+to violate RFC 1891,
+which requires that return receipts be provided
+if Delivery Status Notifications are supported.
+.)f
The
.q goaway
pseudo-flag sets all flags except
@@ -5439,7 +5771,7 @@ and discarded.
.ip SendMIMEErrors
[j]
If set, send error messages in MIME format
-(see RFC1521 and RFC1344 for details).
+(see RFC2045 and RFC1344 for details).
If disabled,
.i sendmail
will not return the DSN keyword in response to an EHLO
@@ -5539,7 +5871,7 @@ always instantiate the queue file,
even if you are going to attempt immediate delivery.
.i Sendmail
always instantiates the queue file
-before returning control the client
+before returning control to the client
under any circumstances.
This should really
.i always
@@ -5790,8 +6122,8 @@ on the files.
For example,
as of this writing
version 8 config files
-(specifically, 8.7)
-used version level 6 configurations.
+(specifically, 8.9)
+used version level 7 configurations.
.pp
.q Old
configuration files are defined as version level one.
@@ -5865,6 +6197,27 @@ for lower numbered configuration files;
the configuration file requires some additional intelligence
to properly handle the RFC 822 group construct.
.pp
+Version level seven configuration files
+used new option names to replace old macros
+(\c
+.b $e
+became
+.b SmtpGreeetingMessage ,
+.b $l
+became
+.b UnixFromLine ,
+and
+.b $o
+became
+.b OperatorChars .
+Also, prior to version seven,
+the
+.b F=q
+flag (use 250 instead of 252 return value for
+.sm "SMTP VRFY"
+commands)
+was assumed.
+.pp
The
.b V
line may have an optional
@@ -5984,13 +6337,15 @@ must be compiled with
.b NDBM
defined.
.ip btree
-Database lookups using the btree interface to the Berkeley db(3) library.
+Database lookups using the btree interface to the Berkeley DB
+library.
.i Sendmail
must be compiled with
.b NEWDB
defined.
.ip hash
-Database lookups using the hash interface to the Berkeley db(3) library.
+Database lookups using the hash interface to the Berkeley DB
+library.
.i Sendmail
must be compiled with
.b NEWDB
@@ -6067,6 +6422,17 @@ of a user).
Canonifies host domain names.
Given a host name it calls the name server
to find the canonical name for that host.
+.ip bestmx
+Returns the best MX record for a host name given as the key.
+The current machine is always preferred \*-
+that is, if the current machine is one of the hosts listed as a
+lowest-preference MX record, then it will be guaranteed to be returned.
+This can be used to find out if this machine is the target for an MX record,
+and mail can be accepted on that basis.
+If the
+.b \-z
+flag is given, then all MX names are returned,
+separated by the given delimiter.
.ip sequence
The arguments on the `K' line are a list of maps;
the resulting map searches the argument maps in order
@@ -6134,6 +6500,52 @@ for example,
will have quotes stripped,
but the result is probably not what you had in mind.
Fortunately these cases are rare.
+.ip regex
+The map definition on the
+.b K
+line contains a regular expression.
+Any key input is compared to that expression using the
+POSIX regular expressions routines regcomp(), regerr(), and regexec().
+Refer to the documentation for those routines for more information
+about the regular expression matching.
+No rewriting of the key is done if the
+.b \-m
+flag is used. Without it, the key is discarded or if
+.b \-s
+if used, it is substituted by the substring matches, delimited by
+.b $|
+or the string specified with the the
+.b \-d
+flag. The flags availble for the map are
+.(b
+-n not
+-f case sensitive
+-b basic regular expressions
+ (default is extended)
+-s substring match
+-d set the delimiter used for -s
+-a append string to key
+-m match only, do not
+ replace/discard value
+.)b
+The
+.b \-s flag can include an optional parameter which can be used
+to select the substrings in the result of the lookup. For example,
+.(b
+-s1,3,4
+.)b
+.ip program
+The arguments on the
+.b K
+line are the pathname to a program and any initial parameters to be passed.
+When the map is called,
+the key is added to the initial parameters
+and the program is invoked
+as the default user/group id.
+The first line of standard output is returned as the value of the lookup.
+This has many potential security problems,
+and has terrible performance;
+it should be used only when absolutely necessary.
.pp
Most of these accept as arguments the same optional flags
and a filename
@@ -6186,6 +6598,18 @@ on successful matches.
For example, the default
.i host
map appends a dot on successful matches.
+.ip "\-T\fIx\fP"
+Append the string
+.i x
+on temporary failures.
+For example,
+.i x
+would be appended if a DNS lookup returned
+.q "server failed"
+or an NIS lookup could not locate a server.
+See also the
+.b \-t
+flag.
.ip "\-f"
Do not fold upper to lower case before looking up the key.
.ip "\-m"
@@ -6245,6 +6669,26 @@ to another, possibly better connected, mail server.
For the dequote map only,
the character to use to replace space characters
after a successful dequote.
+.ip "\-q"
+Don't dequote the key before lookup.
+.ip "\-A"
+When rebuilding an alias file,
+the
+.b \-A
+flag causes duplicate entries in the text version
+to be merged.
+For example, two entries:
+.(b
+list: user1, user2
+list: user3
+.)b
+would be treated as though it were the single entry
+.(b
+list: user1, user2, user3
+.)b
+in the presence of the
+.b \-A
+flag.
.pp
The
.i dbm
@@ -6253,8 +6697,10 @@ map appends the strings
and
.q \&.dir
to the given filename;
-the two
-.i db -based
+the
+.i hash
+and
+.i btree
maps append
.q \&.db .
For example, the map specification
@@ -6470,11 +6916,13 @@ In most cases this should be unnecessary
unless you are porting
.i sendmail
to a new environment.
-.sh 2 "Parameters in src/Makefile"
+.sh 2 "Parameters in BuildTools/OS/$oscf"
.pp
These parameters are intended to describe the compilation environment,
not site policy,
-and should normally be defined in src/Makefile.
+and should normally be defined in the operating system
+configuration file.
+.b "This section needs a complete rewrite."
.ip NDBM
If set,
the new version of the DBM library
@@ -6521,7 +6969,7 @@ such as
.q _AIX3
and
.q _SCO_unix_ .
-See the READ_ME
+See the src/README
file for the latest scoop on these flags.
.sh 2 "Parameters in src/conf.h"
.pp
@@ -6536,7 +6984,7 @@ are their default value.
.pp
This document is not the best source of information
for compilation flags in conf.h \(em
-see src/READ_ME or src/conf.h itself.
+see src/README or src/conf.h itself.
.nr ii 1.2i
.ip "MAXLINE [2048]"
The maximum line length of any input line.
@@ -7031,14 +7479,6 @@ of the message in the error return.
The actual use of this routine is highly dependent on the
implementation,
and use should be limited.
-.sh 3 "Load Average Computation"
-.pp
-The routine
-.i getla
-should return an approximation of the current system load average
-as an integer.
-There are several versions included on compilation flags
-as described above.
.sh 3 "New Database Map Classes"
.pp
New key maps can be added by creating a class initialization function
@@ -7079,7 +7519,7 @@ The
.i av
is a list of arguments passed in from the rewrite line.
The lookup function should return a pointer to the new value.
-IF the map lookup fails,
+If the map lookup fails,
.i *statp
should be set to an exit status code;
in particular, it should be set to
@@ -7204,459 +7644,6 @@ if you wanted to generalize
.b $]
lookups.
We now recommend that you create a new keyed map instead.
-.sh 1 "CHANGES IN VERSION 8"
-.pp
-The following summarizes changes
-since the last commonly available version of
-.i sendmail
-(5.67).
-For a detailed list,
-consult the file
-RELEASE_NOTES
-in the root directory of the
-.i sendmail
-distribution.
-.sh 2 "Connection Caching"
-.pp
-Instead of closing SMTP connections immediately,
-those connections are cached for possible future use.
-The advent of MX records made this effective for mailing lists;
-in addition,
-substantial performance improvements can be expected for queue processing.
-.sh 2 "MX Piggybacking"
-.pp
-If two hosts with different names in a single message
-happen to have the same set of MX hosts,
-they can be sent in the same transaction.
-Version 8 notices this and tries to batch the messages.
-.sh 2 "RFC 1123 Compliance"
-.pp
-A number of changes have been made to make
-.i sendmail
-.q "conditionally compliant"
-(that is,
-.i sendmail
-satisfies all of the
-.q MUST
-clauses and most but not all of the
-.q SHOULD
-clauses in RFC 1123).
-.pp
-The major areas of change are (numbers are RFC 1123 section numbers):
-.nr ii \w'5.3.1.1\0\0'u
-.ip 5.2.7
-Response to RCPT command is fast.
-.ip 5.2.8
-Numeric IP addresses are logged in Received: lines.
-.ip 5.2.17
-Self domain literal is properly handled.
-.ip 5.3.2
-Better control over individual timeouts.
-.ip 5.3.3
-Error messages are sent as
-.q From:<> .
-.ip 5.3.3
-Error messages are never sent to
-.q <> .
-.ip 5.3.3
-Route-addrs are pruned.
-.lp
-The areas in which
-.i sendmail
-is not
-.q "unconditionally compliant"
-are:
-.ip 5.2.6
-.i Sendmail
-does do header munging.
-.ip 5.2.10
-.i Sendmail
-doesn't always use the exact SMTP message text
-as listed in RFC 821.
-.ip 5.3.1.1
-.i Sendmail
-doesn't guarantee only one connect for each host in queue runs.
-.ip 5.3.1.1
-.i Sendmail
-doesn't always provide adequate concurrency limits.
-.sh 2 "Extended SMTP Support"
-.pp
-Version 8 includes both sending and receiving support for Extended
-SMTP support as defined by RFC 1651 (basic) and RFC 1653 (SIZE);
-and limited support for RFC 1652 (BODY).
-.sh 2 "Eight-Bit Clean"
-.pp
-Previous versions of
-.i sendmail
-used the 0200 bit for quoting.
-This version avoids that use.
-However, for compatibility with RFC 822,
-you can set option `7' to get seven bit stripping.
-.pp
-Individual mailers can still produce seven bit output using the
-`7' mailer flag.
-.sh 2 "User Database"
-.pp
-The user database is an as-yet experimental attempt
-to provide unified large-site name support.
-We are installing it at Berkeley;
-future versions may show significant modifications.
-.sh 2 "Improved BIND Support"
-.pp
-The BIND support,
-particularly for MX records,
-had a number of annoying
-.q features
-which have been removed in this release.
-In particular,
-these more tightly bind (pun intended) the name server to
-.i sendmail ,
-so that the name server resolution rules are incorporated directly into
-.b sendmail .
-.sh 2 "Keyed Files"
-.pp
-Generalized keyed files is an idea taken directly from
-.sm IDA
-.i sendmail
-(albeit with a completely different implementation).
-They can be useful on large sites.
-.pp
-Version 8 also understands YP.
-.sh 2 "Multi-Word Classes"
-.pp
-Classes can now be multiple words.
-For example,
-.(b
-CShofmann.CS.Berkeley.EDU
-.)b
-allows you to match the entire string
-.q hofmann.CS.Berkeley.EDU
-using the single construct
-.q $=S .
-.sh 2 "Deferred Macro Expansion"
-.pp
-The
-.b $& \c
-.i x
-construct has been adopted from
-.sm IDA .
-.sh 2 "IDENT Protocol Support"
-.pp
-The IDENT protocol as defined in RFC 1413 is supported.
-.sh 2 "Parsing Bug Fixes"
-.pp
-A number of small bugs having to do with things like
-backslash-escaped quotes inside of comments
-have been fixed.
-.sh 2 "Separate Envelope/Header Processing"
-.pp
-Since the From: line is passed in separately from the envelope sender,
-these have both been made visible;
-the
-.b $g
-macro is set to the envelope sender during processing
-of mailer argument vectors
-and the header sender during processing of headers.
-.pp
-It is also possible to specify separate per-mailer
-envelope and header processing.
-The
-.b S enderRWSet
-and
-.b R ecipientRWset
-arguments for mailers
-can be specified as
-.i envelope/header
-to give different rewritings for envelope versus header addresses.
-.sh 2 "Owner-List Propagates to Envelope"
-.pp
-When an alias has an associated owner\-list name,
-that alias is used to change the envelope sender address.
-This will cause downstream errors to be returned to that owner.
-.sh 2 "Dynamic Header Allocation"
-.pp
-The fixed size limit on header lines has been eliminated.
-.sh 2 "New Command Line Flags"
-.pp
-The
-.b \-B
-flag has been added to pass in body type information.
-.pp
-The
-.b \-p
-flag has been added
-to pass in protocol information.
-.pp
-The
-.b \-X
-flag has been added
-to allow logging of all protocol in and out of
-.i sendmail
-for debugging.
-.pp
-The
-.b \-O
-flag implies setting long-form options.
-.sh 2 "Enhanced Command Line Flags"
-.pp
-The
-.b \-q
-flag can limit limit a queue run to specific recipients, senders, or queue ids
-using
-.b \-qR\c
-.i substring ,
-.b \-qS\c
-.i substring ,
-or
-.b \-qI\c
-.i substring
-respectively.
-.sh 2 "New and Old Configuration Line Types"
-.pp
-The
-.b K
-line has been added to declare database maps.
-.pp
-The
-.b V
-line has been added to declare the configuration version level.
-.pp
-The
-.b M
-line has a
-.q D=
-field that lets you change into a temporary directory while that mailer
-is running.
-It also has a
-.q U=
-field to allow you to set the user and group id to be used
-when running the mailer.
-.sh 2 "New Options"
-.pp
-Several new options have been added,
-many to support new features,
-others to allow tuning that was previously available
-only by recompiling.
-They are described in detail in Section 5.6.
-Briefly,
-.nr ii 0.5i
-.ip b
-Insist on a minimum number of disk blocks.
-.ip C
-Set checkpoint interval.
-.ip E
-Default error message.
-.ip G
-Enable GECOS matching.
-.ip h
-Maximum hop count.
-.ip j
-Send errors in MIME-encapsulated format.
-.ip J
-Forward file path.
-.ip k
-Connection cache size
-.ip K
-Connection cache lifetime.
-.ip l
-Enable Errors-To: header.
-These headers violate RFC 1123;
-this option is included to provide back compatibility
-with old versions of
-.i sendmail .
-.ip O
-Set incoming SMTP daemon options, such as an alternate SMTP port.
-.ip p
-Privacy options.
-.ip R
-Don't prune route-addrs.
-.ip U
-User database spec.
-.ip V
-Fallback
-.q MX
-host.
-.ip w
-.q "Best MX"
-handling technique.
-.ip 7
-Do not run eight bit clean.
-.ip 8
-Eight bit data handling mode.
-.sh 2 "Extended Options"
-.pp
-The
-.b r
-(read timeout),
-.b I
-(use BIND),
-and
-.b T
-(queue timeout)
-options have been extended to pass in more information.
-.sh 2 "New Mailer Flags"
-.pp
-Several new mailer flags have been added.
-.ip a
-Try to use ESMTP when creating a connection.
-If this is not set,
-.i sendmail
-will still try if the other end hints that it knows about ESMTP
-in its greeting message;
-this flag says to try even if it doesn't hint.
-If the EHLO (extended hello)
-command fails,
-.i sendmail
-falls back to old SMTP.
-.ip A
-Try the user part of addresses for this mailer as aliases.
-.ip b
-Ensure that there is a blank line at the end of all messages.
-.ip c
-Strip all comments from addresses;
-this should only be used as a last resort
-when dealing with cranky mailers.
-.ip g
-Never use the null sender as the envelope sender,
-even when running SMTP.
-Although this violates RFC 1123,
-it may be necessary when you must deal with some obnoxious old hosts.
-.ip k
-Turn off the loopback check in the HELO protocol;
-doing this may cause mailer loops.
-.ip o
-Always run the mailer as the recipient of the message.
-.ip w
-This user should have a passwd file entry.
-.ip 5
-Try ruleset 5 if no local aliases.
-.ip 7
-Strip all output to 7 bits.
-.ip :
-Check for :include: files.
-.ip |
-Check for |program addresses.
-.ip /
-Check for /file addresses.
-.ip @
-Check this user against the user database.
-.sh 2 "Long Option Names"
-.pp
-All options can be specified using long names,
-and some new options can only be specified with long names.
-.sh 2 "New Pre-Defined Macros"
-.pp
-The following macros are pre-defined:
-.ip $k
-The UUCP node name,
-nominally from
-.i uname (2)
-call.
-.ip $m
-The domain part of our full hostname.
-.ip $_
-The RFC 1413-provided sender address.
-.sh 2 "New LHS Token"
-.pp
-Version 8 allows
-.b $@
-on the Left Hand Side of an
-.q R
-line to match zero tokens.
-This is intended to be used to match the null input.
-.sh 2 "Bigger Defaults"
-.pp
-Version 8 allows up to 100 rulesets instead of 30.
-It is recommended that rulesets 0\-9 be reserved for
-.i sendmail 's
-dedicated use in future releases.
-.pp
-The total number of MX records that can be used has been raised to 20.
-.pp
-The number of queued messages that can be handled at one time
-has been raised from 600 to 1000.
-.sh 2 "Different Default Tuning Parameters"
-.pp
-Version 8 has changed the default parameters
-for tuning queue costs
-to make the number of recipients more important
-than the size of the message (for small messages).
-This is reasonable if you are connected with reasonably fast links.
-.sh 2 "Auto-Quoting in Addresses"
-.pp
-Previously, the
-.q "Full Name <email address>"
-syntax would generate incorrect protocol output
-if
-.q "Full Name"
-had special characters such as dot.
-This version puts quotes around such names.
-.sh 2 "Symbolic Names On Error Mailer"
-.pp
-Several names have been built in to the $@ portion of the $#error
-mailer.
-.sh 2 "SMTP VRFY Doesn't Expand"
-.pp
-Previous versions of
-.i sendmail
-treated VRFY and EXPN the same.
-In this version,
-VRFY doesn't expand aliases or follow .forward files.
-EXPN still does.
-.pp
-As an optimization, if you run with your default delivery mode being
-queue-only or deliver-in-background,
-the RCPT command will also not chase aliases and .forward files.
-It will chase them when it processes the queue.
-.sh 2 "[IPC] Mailers Allow Multiple Hosts"
-.pp
-When an address resolves to a mailer that has
-.q [IPC]
-as its
-.q Path ,
-the $@ part (host name)
-can be a colon-separated list of hosts instead of a single hostname.
-This asks
-.i sendmail
-to search the list for the first entry that is available
-exactly as though it were an MX record.
-The intent is to route internal traffic through internal networks
-without publishing an MX record to the net.
-MX expansion is still done on the individual items.
-.sh 2 "Aliases Extended"
-.pp
-The implementation has been merged with maps.
-Among other things,
-this supports NIS-based aliases.
-.sh 2 "Portability and Security Enhancements"
-.pp
-A number of internal changes have been made to enhance portability.
-.pp
-Several fixes have been made to increase the paranoia factor.
-.sh 2 "Miscellaneous Changes"
-.pp
-.i Sendmail
-writes a
-.i /etc/sendmail.pid
-file with the current process id of the SMTP daemon.
-.pp
-Two people using the same program in their .forward file
-are considered different
-so that duplicate elimination doesn't delete one of them.
-.pp
-The
-.i mailstats
-program prints mailer names
-and gets the location of the
-.i sendmail.st
-file from
-.i /etc/sendmail.cf .
-.pp
-Many minor bugs have been fixed, such as handling of backslashes
-inside of quotes.
-.pp
-A hook (ruleset 5) has been added
-to allow rewriting of local addresses after aliasing.
.sh 1 "ACKNOWLEDGEMENTS"
.pp
I've worked on
@@ -7671,38 +7658,53 @@ at Britton Lee,
and again on the Mammoth and Titan Projects at Berkeley.
.pp
Much of the second wave of improvements
-should be credited to Bryan Costales of ICSI.
+resulting in version 8.1
+should be credited to Bryan Costales of the
+International Computer Science Institute.
As he passed me drafts of his book on
.i sendmail
I was inspired to start working on things again.
Bryan was also available to bounce ideas off of.
.pp
+Gregory Neil Shapiro
+of Worchester Polytechnic Institute
+has become instrumental in all phases of
+.i sendmail
+support and development,
+and was largely responsible for getting versions 8.8 and 8.9
+out the door.
+.pp
Many, many people contributed chunks of code and ideas to
.i sendmail .
It has proven to be a group network effort.
Version 8 in particular was a group project.
The following people made notable contributions:
.(l
-John Beck, Hewlett-Packard
+John Beck, Hewlett-Packard & Sun Microsystems
Keith Bostic, CSRG, University of California, Berkeley
Andrew Cheng, Sun Microsystems
Michael J. Corrigan, University of California, San Diego
-Bryan Costales, International Computer Science Institute
+Bryan Costales, International Computer Science Institute & InfoBeat
Pa\*:r (Pell) Emanuelsson
Craig Everhart, Transarc Corporation
+Per Hedeland, Ericsson
Tom Ivar Helbekkmo, Norwegian School of Economics
+Kari Hurtta, Finnish Meteorological Institute
Allan E. Johannesen, WPI
Jonathan Kamens, OpenVision Technologies, Inc.
Takahiro Kanbe, Fuji Xerox Information Systems Co., Ltd.
Brian Kantor, University of California, San Diego
+John Kennedy, Cal State University, Chico
Murray S. Kucherawy, HookUp Communication Corp.
Bruce Lilly, Sony U.S.
Karl London
Motonori Nakamura, Ritsumeikan University & Kyoto University
John Gardiner Myers, Carnegie Mellon University
Neil Rickert, Northern Illinois University
+Gregory Neil Shapiro, WPI
Eric Schnoebelen, Convex Computer Corp.
Eric Wassenaar, National Institute for Nuclear and High Energy Physics, Amsterdam
+Randall Winchester, University of Maryland
Christophe Wolfhugel, Pasteur Institute & Herve Schauer Consultants (Paris)
.)l
I apologize for anyone I have omitted, misspelled, misattributed, or
@@ -7756,7 +7758,7 @@ Set debugging level.
.ip "\-f\ \fIaddr\fP"
The sender's machine address is
.i addr .
-.ip \-F\fIname\fP
+.ip \-F\ \fIname\fP
Sets the full name of this user to
.i name .
.ip "\-h\ \fIcnt\fP"
@@ -7852,6 +7854,14 @@ to limit based on sender.
A particular queued job is accepted if one of the corresponding addresses
contains the indicated
.i string .
+Multiple
+.i \-q\fIX\fP
+flags are permitted,
+with items with the same key letter
+.q or'ed
+together, and items with different key letters
+.q and'ed
+together.
.ip "\-R ret"
What information you want returned if the message bounces;
.i ret
@@ -8081,20 +8091,20 @@ Seric
Ceric:sendmail@vangogh.CS.Berkeley.EDU
Reric@mammoth.Berkeley.EDU
Rbostic@okeeffe.CS.Berkeley.EDU
-H?P?return-path: <owner-sendmail@vangogh.CS.Berkeley.EDU>
-Hreceived: by vangogh.CS.Berkeley.EDU (5.108/2.7) id AAA06703;
- Fri, 17 Jul 92 00:28:55 -0700
-Hreceived: from mail.CS.Berkeley.EDU by vangogh.CS.Berkeley.EDU (5.108/2.7)
- id AAA06698; Fri, 17 Jul 92 00:28:54 -0700
-Hreceived: from [128.32.31.21] by mail.CS.Berkeley.EDU (5.96/2.5)
- id AA22777; Fri, 17 Jul 92 03:29:14 -0400
-Hreceived: by foo.bar.baz.de (5.57/Ultrix3.0-C)
- id AA22757; Fri, 17 Jul 92 09:31:25 GMT
-H?F?from: eric@foo.bar.baz.de (Eric Allman)
-H?x?full-name: Eric Allman
-Hmessage-id: <9207170931.AA22757@foo.bar.baz.de>
+H?P?Return-path: <owner-sendmail@vangogh.CS.Berkeley.EDU>
+HReceived: by vangogh.CS.Berkeley.EDU (5.108/2.7) id AAA06703;
+ Fri, 17 Jul 1992 00:28:55 -0700
+HReceived: from mail.CS.Berkeley.EDU by vangogh.CS.Berkeley.EDU (5.108/2.7)
+ id AAA06698; Fri, 17 Jul 1992 00:28:54 -0700
+HReceived: from [128.32.31.21] by mail.CS.Berkeley.EDU (5.96/2.5)
+ id AA22777; Fri, 17 Jul 1992 03:29:14 -0400
+HReceived: by foo.bar.baz.de (5.57/Ultrix3.0-C)
+ id AA22757; Fri, 17 Jul 1992 09:31:25 GMT
+H?F?From: eric@foo.bar.baz.de (Eric Allman)
+H?x?Full-name: Eric Allman
+HMessage-id: <9207170931.AA22757@foo.bar.baz.de>
HTo: sendmail@vangogh.CS.Berkeley.EDU
-Hsubject: this is an example message
+HSubject: this is an example message
.)b
This shows
the person who sent the message,
@@ -8142,14 +8152,19 @@ Created in daemon mode;
it contains the process id of the current SMTP daemon.
If you use this in scripts;
use ``head \-1'' to get just the first line;
-later versions of
+the second line contains the command line used to invoke the daemon,
+and later versions of
.i sendmail
-may add information to subsequent lines.
+may add more information to subsequent lines.
.ip /etc/aliases
The textual version of the alias file.
+.ip /etc/aliases.db
+The alias file in
+.i hash \|(3)
+format.
.ip /etc/aliases.{pag,dir}
The alias file in
-.i dbm \|(3)
+.i ndbm \|(3)
format.
.ip /var/spool/mqueue
The directory in which the mail queue
@@ -8187,7 +8202,7 @@ replace it with a blank sheet for double-sided output.
.\".sz 10
.\"Eric Allman
.\".sp
-.\"Version 8.106
+.\"Version 8.129
.\".ce 0
.bp 3
.ce
diff --git a/usr.sbin/sendmail/mailstats/mailstats.8 b/usr.sbin/sendmail/mailstats/mailstats.8
index 3fe87c94766..3a8847a6f64 100644
--- a/usr.sbin/sendmail/mailstats/mailstats.8
+++ b/usr.sbin/sendmail/mailstats/mailstats.8
@@ -1,4 +1,12 @@
-.\" @(#)mailstats.8 8.1 (Berkeley) 9/21/96
+.\" Copyright (c) 1998 Sendmail, Inc. 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.
+.\"
+.\"
+.\" @(#)mailstats.8 8.5 (Berkeley) 5/19/98
+.\"
.Dd April 25, 1996
.Dt MAILSTATS 1
.Os BSD 3
diff --git a/usr.sbin/sendmail/mailstats/mailstats.c b/usr.sbin/sendmail/mailstats/mailstats.c
index 3a2394843e7..6fda6db391a 100644
--- a/usr.sbin/sendmail/mailstats/mailstats.c
+++ b/usr.sbin/sendmail/mailstats/mailstats.c
@@ -1,35 +1,13 @@
/*
- * Copyright (c) 1983 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*
*/
@@ -40,16 +18,19 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)mailstats.c 8.10 (Berkeley) 5/30/97";
+static char sccsid[] = "@(#)mailstats.c 8.26 (Berkeley) 7/2/98";
#endif /* not lint */
-#define NOT_SENDMAIL
+#ifndef NOT_SENDMAIL
+# define NOT_SENDMAIL
+#endif
#include <sendmail.h>
#include <mailstats.h>
#include <pathnames.h>
#define MNAMELEN 20 /* max length of mailer name */
+int
main(argc, argv)
int argc;
char **argv;
@@ -64,7 +45,8 @@ main(argc, argv)
char *cfile;
FILE *cfp;
bool mnames;
- long frmsgs = 0, frbytes = 0, tomsgs = 0, tobytes = 0;
+ long frmsgs = 0, frbytes = 0, tomsgs = 0, tobytes = 0, rejmsgs = 0;
+ long dismsgs = 0;
char mtable[MAXMAILERS][MNAMELEN+1];
char sfilebuf[MAXLINE];
char buf[MAXLINE];
@@ -73,7 +55,7 @@ main(argc, argv)
cfile = _PATH_SENDMAILCF;
sfile = NULL;
mnames = TRUE;
- while ((ch = getopt(argc, argv, "C:f:o")) != -1)
+ while ((ch = getopt(argc, argv, "C:f:o")) != EOF)
{
switch (ch)
{
@@ -129,13 +111,13 @@ main(argc, argv)
case 'O': /* option -- see if .st file */
if (strncasecmp(b, " StatusFile", 11) == 0 &&
- !isalnum(b[11]))
+ !(isascii(b[11]) && isalnum(b[11])))
{
/* new form -- find value */
b = strchr(b, '=');
if (b == NULL)
continue;
- while (isspace(*++b))
+ while (isascii(*++b) && isspace(*b))
continue;
}
else if (*b++ != 'S')
@@ -149,7 +131,7 @@ main(argc, argv)
{
fprintf(stderr,
"StatusFile filename too long: %.30s...\n",
- s);
+ b);
exit(EX_CONFIG);
}
strcpy(sfilebuf, b);
@@ -158,7 +140,7 @@ main(argc, argv)
b = strchr(sfilebuf, '\n');
if (b == NULL)
b = &sfilebuf[strlen(sfilebuf)];
- while (isspace(*--b))
+ while (isascii(*--b) && isspace(*b))
continue;
*++b = '\0';
if (sfile == NULL)
@@ -177,7 +159,8 @@ main(argc, argv)
}
m = mtable[mno];
s = m + MNAMELEN; /* is [MNAMELEN+1] */
- while (*b != ',' && !isspace(*b) && *b != '\0' && m < s)
+ while (*b != ',' && !(isascii(*b) && isspace(*b)) &&
+ *b != '\0' && m < s)
*m++ = *b++;
*m = '\0';
for (i = 0; i < mno; i++)
@@ -208,29 +191,53 @@ main(argc, argv)
if (i == 0)
{
sleep(1);
- i = read(fd, &stat, sizeof stat);
- if (i == 0)
+ if ((i = read(fd, &stat, sizeof stat)) < 0)
+ {
+ fputs("mailstats: ", stderr);
+ perror(sfile);
+ exit(EX_NOINPUT);
+ }
+ else if (i == 0)
{
bzero((ARBPTR_T) &stat, sizeof stat);
(void) time(&stat.stat_itime);
}
}
- else if (i != sizeof stat || stat.stat_size != sizeof(stat))
+ if (i != 0)
{
- fputs("mailstats: file size changed.\n", stderr);
- exit(EX_OSERR);
+ if (stat.stat_magic != STAT_MAGIC)
+ {
+ fprintf(stderr,
+ "mailstats: incorrect magic number in %s\n",
+ sfile);
+ exit(EX_OSERR);
+ }
+ else if (stat.stat_version != STAT_VERSION)
+ {
+ fprintf(stderr,
+ "mailstats version (%d) incompatible with %s version(%d)\n",
+ STAT_VERSION, sfile, stat.stat_version);
+ exit(EX_OSERR);
+ }
+ else if (i != sizeof stat || stat.stat_size != sizeof(stat))
+ {
+ fputs("mailstats: file size changed.\n", stderr);
+ exit(EX_OSERR);
+ }
}
printf("Statistics from %s", ctime(&stat.stat_itime));
- printf(" M msgsfr bytes_from msgsto bytes_to%s\n",
+ printf(" M msgsfr bytes_from msgsto bytes_to msgsrej msgsdis%s\n",
mnames ? " Mailer" : "");
for (i = 0; i < MAXMAILERS; i++)
{
- if (stat.stat_nf[i] || stat.stat_nt[i])
+ if (stat.stat_nf[i] || stat.stat_nt[i] ||
+ stat.stat_nr[i] || stat.stat_nd[i])
{
- printf("%2d %6ld %10ldK %6ld %10ldK", i,
+ printf("%2d %8ld %10ldK %8ld %10ldK %6ld %6ld", i,
stat.stat_nf[i], stat.stat_bf[i],
- stat.stat_nt[i], stat.stat_bt[i]);
+ stat.stat_nt[i], stat.stat_bt[i],
+ stat.stat_nr[i], stat.stat_nd[i]);
if (mnames)
printf(" %s", mtable[i]);
printf("\n");
@@ -238,10 +245,12 @@ main(argc, argv)
frbytes += stat.stat_bf[i];
tomsgs += stat.stat_nt[i];
tobytes += stat.stat_bt[i];
+ rejmsgs += stat.stat_nr[i];
+ dismsgs += stat.stat_nd[i];
}
}
- printf("========================================\n");
- printf(" T %6ld %10ldK %6ld %10ldK\n",
- frmsgs, frbytes, tomsgs, tobytes);
+ printf("=============================================================\n");
+ printf(" T %8ld %10ldK %8ld %10ldK %6ld %6ld\n",
+ frmsgs, frbytes, tomsgs, tobytes, rejmsgs, dismsgs);
exit(EX_OK);
}
diff --git a/usr.sbin/sendmail/makemap/makemap.8 b/usr.sbin/sendmail/makemap/makemap.8
index 3c1f6fad260..6180c8bda8b 100644
--- a/usr.sbin/sendmail/makemap/makemap.8
+++ b/usr.sbin/sendmail/makemap/makemap.8
@@ -1,35 +1,13 @@
+.\" Copyright (c) 1998 Sendmail, Inc. All rights reserved.
.\" Copyright (c) 1988, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the University of
-.\" California, Berkeley and its contributors.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
+.\" 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.
.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
.\"
-.\" @(#)makemap.8 8.4 (Berkeley) 7/23/97
+.\" @(#)makemap.8 8.10 (Berkeley) 5/19/98
.\"
.Dd November 16, 1992
.Dt MAKEMAP 8
@@ -44,6 +22,7 @@
.Op Fl f
.Op Fl o
.Op Fl r
+.Op Fl s
.Op Fl v
.Ar maptype
.Ar mapname
@@ -70,13 +49,11 @@ This requires the
library.
.It Li btree
B-Tree format maps.
-This requires the new Berkeley
-.Xr db 3
+This requires the new Berkeley DB
library.
.It Li hash
Hash format maps.
-This also requires the
-.Xr db 3
+This also requires the Berkeley DB
library.
.El
.Pp
@@ -122,6 +99,10 @@ Normally
.Nm
complains if you repeat a key,
and does not do the insert.
+.It Fl s
+Ignore safety checks on maps being created.
+This includes checking for hard or symbolic
+links in world writable directories.
.It Fl v
Verbosely print what it is doing.
.El
diff --git a/usr.sbin/sendmail/makemap/makemap.c b/usr.sbin/sendmail/makemap/makemap.c
index 3a04a0b6cd5..53b5865606a 100644
--- a/usr.sbin/sendmail/makemap/makemap.c
+++ b/usr.sbin/sendmail/makemap/makemap.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1992 Eric P. Allman.
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1992 Eric P. Allman. All rights reserved.
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)makemap.c 8.38 (Berkeley) 9/23/97";
+static char sccsid[] = "@(#)makemap.c 8.62 (Berkeley) 6/24/98";
#endif /* not lint */
#include <sys/types.h>
@@ -42,13 +20,17 @@ static char sccsid[] = "@(#)makemap.c 8.38 (Berkeley) 9/23/97";
# include <sys/file.h>
#endif
#include "sendmail.h"
+#include "pathnames.h"
#ifdef NDBM
-#include <ndbm.h>
+# include <ndbm.h>
#endif
#ifdef NEWDB
-#include <db.h>
+# include <db.h>
+# ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+# endif
#endif
enum type { T_DBM, T_BTREE, T_HASH, T_ERR, T_UNKNOWN };
@@ -76,23 +58,25 @@ uid_t RunAsGid;
char *RunAsUserName;
int Verbose = 2;
bool DontInitGroups = TRUE;
-bool UnsafeGroupWrites = FALSE;
+long DontBlameSendmail = DBS_SAFE;
u_char tTdvect[100];
+uid_t TrustedFileUid = 0;
#define BUFSIZE 1024
+int
main(argc, argv)
int argc;
char **argv;
{
char *progname;
+ char *cfile;
bool inclnull = FALSE;
bool notrunc = FALSE;
bool allowreplace = FALSE;
bool allowdups = FALSE;
bool verbose = FALSE;
bool foldcase = TRUE;
- bool ignoresafeties = FALSE;
int exitstat;
int opt;
char *typename;
@@ -105,6 +89,8 @@ main(argc, argv)
long dbcachesize = 1024 * 1024;
enum type type;
int fd;
+ int sff = SFF_ROOTOK|SFF_REGONLY;
+ struct passwd *pw;
union
{
#ifdef NDBM
@@ -117,22 +103,33 @@ main(argc, argv)
} dbp;
union dbent key, val;
#ifdef NEWDB
+# if DB_VERSION_MAJOR < 2
BTREEINFO bti;
HASHINFO hinfo;
+# else
+ DB_INFO dbinfo;
+# endif
#endif
char ibuf[BUFSIZE];
char fbuf[MAXNAME];
char dbuf[MAXNAME];
+#ifdef NDBM
char pbuf[MAXNAME];
+#endif
+#if _FFR_TRUSTED_FILE_OWNER
+ FILE *cfp;
+ char buf[MAXLINE];
+#endif
static char rnamebuf[MAXNAME]; /* holds RealUserName */
- struct passwd *pw;
- int sff = SFF_ROOTOK|SFF_REGONLY|SFF_NOLINK|SFF_NOWLINK;
- struct stat std, stp;
+ struct stat std;
+#ifdef NDBM
+ struct stat stp;
+#endif
extern char *optarg;
extern int optind;
- extern bool lockfile();
progname = argv[0];
+ cfile = _PATH_SENDMAILCF;
RunAsUid = RealUid = getuid();
RunAsGid = RealGid = getgid();
@@ -144,18 +141,22 @@ main(argc, argv)
sprintf(rnamebuf, "%s", pw->pw_name);
}
else
- sprintf(rnamebuf, "Unknown UID %d", RealUid);
+ sprintf(rnamebuf, "Unknown UID %d", (int) RealUid);
RunAsUserName = RealUserName = rnamebuf;
#if _FFR_NEW_MAKEMAP_FLAGS
-#define OPTIONS "Nc:dforsv"
+#define OPTIONS "C:Nc:dforsv"
#else
-#define OPTIONS "Ndforv"
+#define OPTIONS "C:Ndforsv"
#endif
- while ((opt = getopt(argc, argv, OPTIONS)) != -1)
+ while ((opt = getopt(argc, argv, OPTIONS)) != EOF)
{
switch (opt)
{
+ case 'C':
+ cfile = optarg;
+ break;
+
case 'N':
inclnull = TRUE;
break;
@@ -182,11 +183,9 @@ main(argc, argv)
allowreplace = TRUE;
break;
-#if _FFR_NEW_MAKEMAP_FLAGS
case 's':
- ignoresafeties = TRUE;
+ DontBlameSendmail |= DBS_MAPINUNSAFEDIRPATH|DBS_WRITEMAPTOHARDLINK|DBS_WRITEMAPTOSYMLINK|DBS_LINKEDMAPINWRITABLEDIR;
break;
-#endif
case 'v':
verbose = TRUE;
@@ -198,6 +197,13 @@ main(argc, argv)
}
}
+ if (!bitset(DBS_WRITEMAPTOSYMLINK, DontBlameSendmail))
+ sff |= SFF_NOSLINK;
+ if (!bitset(DBS_WRITEMAPTOHARDLINK, DontBlameSendmail))
+ sff |= SFF_NOHLINK;
+ if (!bitset(DBS_LINKEDMAPINWRITABLEDIR, DontBlameSendmail))
+ sff |= SFF_NOWLINK;
+
argc -= optind;
argv += optind;
if (argc != 2)
@@ -226,6 +232,65 @@ main(argc, argv)
type = T_UNKNOWN;
}
+#if _FFR_TRUSTED_FILE_OWNER
+ if ((cfp = fopen(cfile, "r")) == NULL)
+ {
+ fprintf(stderr, "mailstats: ");
+ perror(cfile);
+ exit(EX_NOINPUT);
+ }
+ while (fgets(buf, sizeof(buf), cfp) != NULL)
+ {
+ register char *b;
+
+ if ((b = strchr(buf, '\n')) != NULL)
+ *b = '\0';
+
+ b = buf;
+ switch (*b++)
+ {
+ case 'O': /* option */
+ if (strncasecmp(b, " TrustedFileOwner", 17) == 0 &&
+ !(isascii(b[17]) && isalnum(b[17])))
+ {
+ b = strchr(b, '=');
+ if (b == NULL)
+ continue;
+ while (isascii(*++b) && isspace(*b))
+ continue;
+ if (isascii(*b) && isdigit(*b))
+ TrustedFileUid = atoi(b);
+ else
+ {
+ register struct passwd *pw;
+
+ TrustedFileUid = 0;
+ pw = getpwnam(b);
+ if (pw == NULL)
+ fprintf(stderr,
+ "TrustedFileOwner: unknown user %s", b);
+ else
+ TrustedFileUid = pw->pw_uid;
+ }
+
+# ifdef UID_MAX
+ if (TrustedFileUid > UID_MAX)
+ {
+ syserr("TrustedFileOwner: uid value (%ld) > UID_MAX (%ld)",
+ TrustedFileUid, UID_MAX);
+ TrustedFileUid = 0;
+ }
+# endif
+ break;
+ }
+
+
+ default:
+ continue;
+ }
+ }
+ (void) fclose(cfp);
+#endif
switch (type)
{
case T_ERR:
@@ -234,7 +299,7 @@ main(argc, argv)
"Usage: %s [-N] [-c cachesize] [-d] [-f] [-o] [-r] [-s] [-v] type mapname\n",
progname);
#else
- fprintf(stderr, "Usage: %s [-N] [-d] [-f] [-o] [-r] [-v] type mapname\n", progname);
+ fprintf(stderr, "Usage: %s [-N] [-d] [-f] [-o] [-r] [-s] [-v] type mapname\n", progname);
#endif
exit(EX_USAGE);
@@ -256,21 +321,47 @@ main(argc, argv)
#ifdef NEWDB
case T_BTREE:
+# if DB_VERSION_MAJOR < 2
bzero(&bti, sizeof bti);
+# else
+ bzero(&dbinfo, sizeof dbinfo);
+# endif
if (allowdups)
+ {
+# if DB_VERSION_MAJOR < 2
bti.flags |= R_DUP;
+# else
+ dbinfo.flags |= DB_DUP;
+# endif
+ }
if (allowdups || allowreplace)
putflags = 0;
else
+ {
+# if DB_VERSION_MAJOR < 2
putflags = R_NOOVERWRITE;
+# else
+ putflags = DB_NOOVERWRITE;
+# endif
+ }
break;
case T_HASH:
+# if DB_VERSION_MAJOR < 2
bzero(&hinfo, sizeof hinfo);
+# else
+ bzero(&dbinfo, sizeof dbinfo);
+# endif
if (allowreplace)
putflags = 0;
else
+ {
+# if DB_VERSION_MAJOR < 2
putflags = R_NOOVERWRITE;
+# else
+ putflags = DB_NOOVERWRITE;
+# endif
+ }
break;
#endif
#ifdef NDBM
@@ -326,8 +417,7 @@ main(argc, argv)
exit(EX_USAGE);
}
strcpy(dbuf, mapname);
- if (!ignoresafeties &&
- (st = safefile(dbuf, RealUid, RealGid, RealUserName,
+ if ((st = safefile(dbuf, RealUid, RealGid, RealUserName,
sff, S_IWUSR, &std)) != 0)
{
fprintf(stderr,
@@ -347,7 +437,7 @@ main(argc, argv)
}
sprintf(dbuf, "%s.dir", mapname);
if ((st = safefile(dbuf, RealUid, RealGid, RealUserName,
- sff, S_IWUSR, &std)) != 0 && !ignoresafeties)
+ sff, S_IWUSR, &std)) != 0)
{
fprintf(stderr,
"%s: could not create: %s\n",
@@ -356,7 +446,7 @@ main(argc, argv)
}
sprintf(pbuf, "%s.pag", mapname);
if ((st = safefile(pbuf, RealUid, RealGid, RealUserName,
- sff, S_IWUSR, &stp)) != 0 && !ignoresafeties)
+ sff, S_IWUSR, &stp)) != 0)
{
fprintf(stderr,
"%s: could not create: %s\n",
@@ -384,10 +474,7 @@ main(argc, argv)
mode |= O_EXLOCK;
#else
/* pre-lock the database */
- if (ignoresafeties)
- fd = dfopen(dbuf, mode & ~O_TRUNC, 0644, sff);
- else
- fd = safeopen(dbuf, mode & ~O_TRUNC, 0644, sff);
+ fd = safeopen(dbuf, mode & ~O_TRUNC, 0644, sff);
if (fd < 0)
{
fprintf(stderr, "%s: cannot create type %s map %s\n",
@@ -408,9 +495,9 @@ main(argc, argv)
dbm_close(dbp.dbm);
exit(EX_CONFIG);
}
- if (!ignoresafeties && dbp.dbm != NULL &&
- (filechanged(dbuf, dbm_dirfno(dbp.dbm), &std, sff) ||
- filechanged(pbuf, dbm_pagfno(dbp.dbm), &stp, sff)))
+ if (dbp.dbm != NULL &&
+ (filechanged(dbuf, dbm_dirfno(dbp.dbm), &std) ||
+ filechanged(pbuf, dbm_pagfno(dbp.dbm), &stp)))
{
fprintf(stderr,
"dbm map %s: file changed after open\n",
@@ -418,56 +505,138 @@ main(argc, argv)
dbm_close(dbp.dbm);
exit(EX_CANTCREAT);
}
+ if (geteuid() == 0 && TrustedFileUid != 0)
+ {
+ if (fchown(dbm_dirfno(dbp.dbm), TrustedFileUid, -1) < 0 ||
+ fchown(dbm_pagfno(dbp.dbm), TrustedFileUid, -1) < 0)
+ {
+ fprintf(stderr,
+ "WARNING: ownership change on %s failed: %s",
+ mapname, errstring(errno));
+ }
+ }
+
break;
#endif
#ifdef NEWDB
case T_HASH:
/* tweak some parameters for performance */
+# if DB_VERSION_MAJOR < 2
hinfo.nelem = 4096;
hinfo.cachesize = dbcachesize;
+# else
+ dbinfo.h_nelem = 4096;
+ dbinfo.db_cachesize = dbcachesize;
+# endif
+# if DB_VERSION_MAJOR < 2
dbp.db = dbopen(mapname, mode, 0644, DB_HASH, &hinfo);
+# else
+ {
+ int flags = 0;
+
+ if (bitset(O_CREAT, mode))
+ flags |= DB_CREATE;
+ if (bitset(O_TRUNC, mode))
+ flags |= DB_TRUNCATE;
+
+ dbp.db = NULL;
+ errno = db_open(mapname, DB_HASH, flags, 0644,
+ NULL, &dbinfo, &dbp.db);
+ }
+# endif
if (dbp.db != NULL)
{
- if (!ignoresafeties &&
- filechanged(dbuf, dbp.db->fd(dbp.db), &std, sff))
+ int fd;
+
+# if DB_VERSION_MAJOR < 2
+ fd = dbp.db->fd(dbp.db);
+# else
+ fd = -1;
+ errno = dbp.db->fd(dbp.db, &fd);
+# endif
+ if (filechanged(dbuf, fd, &std))
{
fprintf(stderr,
"db map %s: file changed after open\n",
mapname);
+# if DB_VERSION_MAJOR < 2
dbp.db->close(dbp.db);
+# else
+ errno = dbp.db->close(dbp.db, 0);
+# endif
exit(EX_CANTCREAT);
}
-# if OLD_NEWDB
- (void) (*dbp.db->sync)(dbp.db);
-# else
(void) (*dbp.db->sync)(dbp.db, 0);
-# endif
+ if (geteuid() == 0 && TrustedFileUid != 0)
+ {
+ if (fchown(fd, TrustedFileUid, -1) < 0)
+ {
+ fprintf(stderr,
+ "WARNING: ownership change on %s failed: %s",
+ mapname, errstring(errno));
+ }
+ }
}
break;
case T_BTREE:
/* tweak some parameters for performance */
+# if DB_VERSION_MAJOR < 2
bti.cachesize = dbcachesize;
+# else
+ dbinfo.db_cachesize = dbcachesize;
+# endif
+# if DB_VERSION_MAJOR < 2
dbp.db = dbopen(mapname, mode, 0644, DB_BTREE, &bti);
+# else
+ {
+ int flags = 0;
+
+ if (bitset(O_CREAT, mode))
+ flags |= DB_CREATE;
+ if (bitset(O_TRUNC, mode))
+ flags |= DB_TRUNCATE;
+
+ dbp.db = NULL;
+ errno = db_open(mapname, DB_BTREE, flags, 0644,
+ NULL, &dbinfo, &dbp.db);
+ }
+# endif
if (dbp.db != NULL)
{
- if (!ignoresafeties &&
- filechanged(dbuf, dbp.db->fd(dbp.db), &std, sff))
+ int fd;
+
+# if DB_VERSION_MAJOR < 2
+ fd = dbp.db->fd(dbp.db);
+# else
+ fd = -1;
+ errno = dbp.db->fd(dbp.db, &fd);
+# endif
+ if (filechanged(dbuf, fd, &std))
{
fprintf(stderr,
"db map %s: file changed after open\n",
mapname);
+# if DB_VERSION_MAJOR < 2
dbp.db->close(dbp.db);
+# else
+ errno = dbp.db->close(dbp.db, 0);
+# endif
exit(EX_CANTCREAT);
}
-# if OLD_NEWDB
- (void) (*dbp.db->sync)(dbp.db);
-# else
(void) (*dbp.db->sync)(dbp.db, 0);
-# endif
+ if (geteuid() == 0 && TrustedFileUid != 0)
+ {
+ if (fchown(fd, TrustedFileUid, -1) < 0)
+ {
+ fprintf(stderr,
+ "WARNING: ownership change on %s failed: %s",
+ mapname, errstring(errno));
+ }
+ }
}
break;
#endif
@@ -506,23 +675,31 @@ main(argc, argv)
*p = '\0';
else if (!feof(stdin))
{
- fprintf(stderr, "%s: %s: line %d: line too long (%d bytes max)\n",
- progname, mapname, lineno, sizeof ibuf);
+ fprintf(stderr, "%s: %s: line %d: line too long (%ld bytes max)\n",
+ progname, mapname, lineno, (long) sizeof ibuf);
continue;
}
if (ibuf[0] == '\0' || ibuf[0] == '#')
continue;
- if (isspace(ibuf[0]))
+ if (isascii(ibuf[0]) && isspace(ibuf[0]))
{
fprintf(stderr, "%s: %s: line %d: syntax error (leading space)\n",
progname, mapname, lineno);
continue;
}
+#ifdef NEWDB
+ if (type == T_HASH || type == T_BTREE)
+ {
+ bzero(&key.db, sizeof key.db);
+ bzero(&val.db, sizeof val.db);
+ }
+#endif
+
key.xx.data = ibuf;
- for (p = ibuf; *p != '\0' && !isspace(*p); p++)
+ for (p = ibuf; *p != '\0' && !(isascii(*p) && isspace(*p)); p++)
{
- if (foldcase && isupper(*p))
+ if (foldcase && isascii(*p) && isupper(*p))
*p = tolower(*p);
}
key.xx.size = p - key.xx.data;
@@ -530,7 +707,7 @@ main(argc, argv)
key.xx.size++;
if (*p != '\0')
*p++ = '\0';
- while (isspace(*p))
+ while (isascii(*p) && isspace(*p))
p++;
if (*p == '\0')
{
@@ -563,9 +740,30 @@ main(argc, argv)
#ifdef NEWDB
case T_BTREE:
case T_HASH:
+# if DB_VERSION_MAJOR < 2
st = (*dbp.db->put)(dbp.db, &key.db, &val.db, putflags);
+# else
+ errno = (*dbp.db->put)(dbp.db, NULL, &key.db,
+ &val.db, putflags);
+ switch (errno)
+ {
+ case DB_KEYEXIST:
+ st = 1;
+ break;
+
+ case 0:
+ st = 0;
+ break;
+
+ default:
+ st = -1;
+ break;
+ }
+# endif
break;
#endif
+ default:
+ break;
}
if (st < 0)
@@ -598,7 +796,11 @@ main(argc, argv)
#ifdef NEWDB
case T_HASH:
case T_BTREE:
+# if DB_VERSION_MAJOR < 2
if ((*dbp.db->close)(dbp.db) < 0)
+# else
+ if ((errno = (*dbp.db->close)(dbp.db, 0)) != 0)
+# endif
{
fprintf(stderr, "%s: %s: error on close\n",
progname, mapname);
@@ -606,6 +808,8 @@ main(argc, argv)
exitstat = EX_IOERR;
}
#endif
+ default:
+ break;
}
#if !O_EXLOCK
@@ -680,7 +884,7 @@ lockfile(fd, filename, ext, type)
return FALSE;
}
-/*VARARGS2*/
+/*VARARGS1*/
void
#ifdef __STDC__
message(const char *msg, ...)
@@ -694,7 +898,9 @@ message(msg, va_alist)
VA_LOCAL_DECL
m = msg;
- if (isdigit(m[0]) && isdigit(m[1]) && isdigit(m[2]) && m[3] == ' ')
+ if (isascii(m[0]) && isdigit(m[0]) &&
+ isascii(m[1]) && isdigit(m[1]) &&
+ isascii(m[2]) && isdigit(m[2]) && m[3] == ' ')
m += 4;
VA_START(msg);
vfprintf(stderr, m, ap);
@@ -702,7 +908,7 @@ message(msg, va_alist)
fprintf(stderr, "\n");
}
-/*VARARGS2*/
+/*VARARGS1*/
void
#ifdef __STDC__
syserr(const char *msg, ...)
@@ -716,7 +922,9 @@ syserr(msg, va_alist)
VA_LOCAL_DECL
m = msg;
- if (isdigit(m[0]) && isdigit(m[1]) && isdigit(m[2]) && m[3] == ' ')
+ if (isascii(m[0]) && isdigit(m[0]) &&
+ isascii(m[1]) && isdigit(m[1]) &&
+ isascii(m[2]) && isdigit(m[2]) && m[3] == ' ')
m += 4;
VA_START(msg);
vfprintf(stderr, m, ap);
@@ -771,7 +979,7 @@ errstring(err)
#if HASSTRERROR
return strerror(err);
#else
- if (err < 0 || err > sys_nerr)
+ if (err < 0 || err >= sys_nerr)
{
sprintf(errstr, "Error %d", err);
return errstr;
diff --git a/usr.sbin/sendmail/praliases/praliases.1 b/usr.sbin/sendmail/praliases/praliases.1
index 6e8e61bd987..f47121840de 100644
--- a/usr.sbin/sendmail/praliases/praliases.1
+++ b/usr.sbin/sendmail/praliases/praliases.1
@@ -1,56 +1,49 @@
+.\" Copyright (c) 1998 Sendmail, Inc. All rights reserved.
.\"
-.\" $OpenBSD: praliases.1,v 1.1 1996/09/15 05:15:57 millert Exp $
+.\" 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.
.\"
-.Dd Sep 14, 1996
+.\"
+.\" @(#)praliases.8 8.5 (Berkeley) 5/19/98
+.\"
+.Dd April 25, 1996
.Dt PRALIASES 1
-.Os BSD 4
+.Os BSD 3
.Sh NAME
.Nm praliases
-.Nd look up aliases in the aliases file
+.Nd display system mail aliases
.Sh SYNOPSIS
.Nm praliases
.Op Fl f Ar file
-.Op key ...
.Sh DESCRIPTION
-.Nm Praliases
-looks up the specified aliases in the
-system-wide aliases file.
-With no arguments,
+The
.Nm praliases
-prints out the entire aliases file.
+utility displays the current system aliases,
+one per line, in no particular order.
.Pp
-When given the
-.Fl f
-option,
-.Nm
-looks up aliases in the specified
-.Ar file
-instead of the default system-wide aliases file. Note
-that this must be the database version created by:
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl f
+Read the specified file instead of the default
+.Nm sendmail
+system aliases file.
+.El
.Pp
-.Bd -literal -offset indent -compact
-.Pa /usr/sbin/sendmail Fl bi oA Ar file
-.Ed
-.Sh BUGS
-.Nm Praliases
-only will only lookup aliases in the database version of
-the aliases file. It does not look up aliases in the
-raw aliases file, nor does it look in
-.Pa /etc/sendmail.cf
-for the paths to other aliases files or network-based
-databases such as NIS, NetInfo, or Hesiod.
+The
+.Nm praliases
+utility exits 0 on success, and >0 if an error occurs.
.Sh FILES
-.Bl -tag -width /etc/aliases.db -compact
+.Bl -tag -width /var/log/sendmail.stXX -compact
.It Pa /etc/aliases
-raw data for alias names
+The default
+.Nm sendmail
+system aliases file.
.It Pa /etc/aliases.db
-data base of alias names
+The database version of the
+.Pa /etc/aliases
+file.
+.El
.Sh SEE ALSO
-.Xr newaliases 1 ,
-.Xr aliases 5 ,
-.Xr sendmail 8 .
-.Sh HISTORY
-The
-.Nm
-command appeared in
-.Bx 4.3 .
+.Xr mailq 1 ,
+.Xr sendmail 8
diff --git a/usr.sbin/sendmail/praliases/praliases.c b/usr.sbin/sendmail/praliases/praliases.c
index 12973f52adb..3e0048b4fc7 100644
--- a/usr.sbin/sendmail/praliases/praliases.c
+++ b/usr.sbin/sendmail/praliases/praliases.c
@@ -1,35 +1,13 @@
/*
- * Copyright (c) 1983 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
@@ -39,14 +17,37 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)praliases.c 8.5 (Berkeley) 5/28/97";
+static char sccsid[] = "@(#)praliases.c 8.17 (Berkeley) 6/25/98";
#endif /* not lint */
-#include <ndbm.h>
-#define NOT_SENDMAIL
+#if !defined(NDBM) && !defined(NEWDB)
+ ERROR README: You must define one of NDBM or NEWDB in order to compile
+ ERROR README: praliases.
+#endif
+
+#ifdef NDBM
+# include <ndbm.h>
+#endif
+#ifndef NOT_SENDMAIL
+# define NOT_SENDMAIL
+#endif
#include <sendmail.h>
#ifdef NEWDB
-#include <db.h>
+# include <db.h>
+# ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+# endif
+#endif
+
+#if defined(IRIX64) || defined(IRIX5) || defined(IRIX6) || \
+ defined(BSD4_4) || defined(__osf__) || defined(__GNU_LIBRARY__)
+# ifndef HASSTRERROR
+# define HASSTRERROR 1 /* has strerror(3) */
+# endif
+#endif
+
+#if !HASSTRERROR
+extern char *strerror __P((int));
#endif
int
@@ -56,18 +57,20 @@ main(argc, argv)
{
extern char *optarg;
extern int optind;
+#ifdef NDBM
DBM *dbp;
datum content, key;
+#endif
char *filename;
int ch;
#ifdef NEWDB
- const DB *db;
+ DB *db;
DBT newdbkey, newdbcontent;
char buf[MAXNAME];
#endif
filename = "/etc/aliases";
- while ((ch = getopt(argc, argv, "f:")) != -1)
+ while ((ch = getopt(argc, argv, "f:")) != EOF)
switch((char)ch) {
case 'f':
filename = optarg;
@@ -88,26 +91,74 @@ main(argc, argv)
}
(void) strcpy(buf, filename);
(void) strcat(buf, ".db");
- if (db = dbopen(buf, O_RDONLY, 0444 , DB_HASH, NULL)) {
+# if DB_VERSION_MAJOR < 2
+ db = dbopen(buf, O_RDONLY, 0444, DB_HASH, NULL);
+# else
+ db = NULL;
+ errno = db_open(buf, DB_HASH, DB_RDONLY, 0444, NULL, NULL, &db);
+# endif
+ if (db != NULL)
+ {
if (!argc) {
+# if DB_VERSION_MAJOR > 1
+ DBC *dbc;
+# endif
+ bzero(&newdbkey, sizeof newdbkey);
+ bzero(&newdbcontent, sizeof newdbcontent);
+
+# if DB_VERSION_MAJOR < 2
while(!db->seq(db, &newdbkey, &newdbcontent, R_NEXT))
+# else
+ if ((errno = db->cursor(db, NULL, &dbc)) == 0)
+ {
+ while ((errno = dbc->c_get(dbc, &newdbkey,
+ &newdbcontent,
+ DB_NEXT)) == 0)
+# endif
printf("%.*s:%.*s\n",
- newdbkey.size, newdbkey.data,
- newdbcontent.size, newdbcontent.data);
+ (int) newdbkey.size,
+ (char *) newdbkey.data,
+ (int) newdbcontent.size,
+ (char *) newdbcontent.data);
+# if DB_VERSION_MAJOR > 1
+ (void) dbc->c_close(dbc);
+ }
+ else
+ {
+ fprintf(stderr,
+ "praliases: %s: Could not set cursor: %s\n",
+ buf, strerror(errno));
+ exit(EX_DATAERR);
+ }
+# endif
}
else for (; *argv; ++argv) {
+ bzero(&newdbkey, sizeof newdbkey);
+ bzero(&newdbcontent, sizeof newdbcontent);
newdbkey.data = *argv;
newdbkey.size = strlen(*argv) + 1;
+# if DB_VERSION_MAJOR < 2
if (!db->get(db, &newdbkey, &newdbcontent, 0))
- printf("%s:%.*s\n", newdbkey.data,
- newdbcontent.size, newdbcontent.data);
+# else
+ if ((errno = db->get(db, NULL, &newdbkey,
+ &newdbcontent, 0)) == 0)
+# endif
+ printf("%s:%.*s\n", (char *) newdbkey.data,
+ (int) newdbcontent.size,
+ (char *) newdbcontent.data);
else
printf("%s: No such key\n",
- newdbkey.data);
+ (char *) newdbkey.data);
}
+# if DB_VERSION_MAJOR < 2
+ (void)db->close(db);
+# else
+ errno = db->close(db, 0);
+# endif
}
else {
#endif
+#ifdef NDBM
if ((dbp = dbm_open(filename, O_RDONLY, 0)) == NULL) {
(void)fprintf(stderr,
"praliases: %s: %s\n", filename, strerror(errno));
@@ -118,8 +169,8 @@ main(argc, argv)
key.dptr != NULL; key = dbm_nextkey(dbp)) {
content = dbm_fetch(dbp, key);
(void)printf("%.*s:%.*s\n",
- key.dsize, key.dptr,
- content.dsize, content.dptr);
+ (int) key.dsize, key.dptr,
+ (int) content.dsize, content.dptr);
}
else for (; *argv; ++argv) {
key.dptr = *argv;
@@ -129,10 +180,30 @@ main(argc, argv)
(void)printf("%s: No such key\n", key.dptr);
else
(void)printf("%s:%.*s\n", key.dptr,
- content.dsize, content.dptr);
+ (int) content.dsize, content.dptr);
}
+ dbm_close(dbp);
+#endif
#ifdef NEWDB
}
#endif
exit(EX_OK);
}
+
+#if !HASSTRERROR
+
+char *
+strerror(eno)
+ int eno;
+{
+ extern int sys_nerr;
+ extern char *sys_errlist[];
+ static char ebuf[60];
+
+ if (eno >= 0 && eno < sys_nerr)
+ return sys_errlist[eno];
+ (void) sprintf(ebuf, "Error %d", eno);
+ return ebuf;
+}
+
+#endif /* !HASSTRERROR */
diff --git a/usr.sbin/sendmail/smrsh/smrsh.8 b/usr.sbin/sendmail/smrsh/smrsh.8
index f4cb0b3160c..067eaf32ee3 100644
--- a/usr.sbin/sendmail/smrsh/smrsh.8
+++ b/usr.sbin/sendmail/smrsh/smrsh.8
@@ -1,36 +1,14 @@
-.\" Copyright (c) 1993 Eric P. Allman
+.\" Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+.\" Copyright (c) 1993 Eric P. Allman. All rights reserved.
.\" Copyright (c) 1993
.\" The Regents of the University of California. All rights reserved.
.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the University of
-.\" California, Berkeley and its contributors.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
+.\" 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.
.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
.\"
-.\" @(#)smrsh.8 8.2 (Berkeley) 1/9/96
+.\" @(#)smrsh.8 8.7 (Berkeley) 5/19/98
.\"
.TH SMRSH 8 11/02/93
.SH NAME
@@ -59,7 +37,7 @@ limits the set of programs that he or she can execute.
Briefly,
.I smrsh
limits programs to be in the directory
-/usr/libexec/sm.bin,
+/usr/adm/sm.bin,
allowing the system administrator to choose the set of acceptable commands.
It also rejects any commands with the characters
`\`', `<', `>', `|', `;', `&', `$', `(', `)', `\er' (carriage return),
@@ -73,10 +51,10 @@ so forwarding to ``/usr/ucb/vacation'',
and
``vacation''
all actually forward to
-``/usr/libexec/sm.bin/vacation''.
+``/usr/adm/sm.bin/vacation''.
.PP
System administrators should be conservative about populating
-/usr/libexec/sm.bin.
+/usr/adm/sm.bin.
Reasonable additions are
.IR vacation (1),
.IR procmail (1),
@@ -91,15 +69,15 @@ directory.
Note that this does not restrict the use of shell or perl scripts
in the sm.bin directory (using the ``#!'' syntax);
it simply disallows execution of arbitrary programs.
-.\" .SH COMPILATION
-.\" Compilation should be trivial on most systems.
-.\" You may need to use \-DPATH=\e"\fIpath\fP\e"
-.\" to adjust the default search path
-.\" (defaults to ``/bin:/usr/bin:/usr/ucb'')
-.\" and/or \-DCMDBIN=\e"\fIdir\fP\e"
-.\" to change the default program directory
-.\" (defaults to ``/usr/adm/sm.bin'').
+.SH COMPILATION
+Compilation should be trivial on most systems.
+You may need to use \-DPATH=\e"\fIpath\fP\e"
+to adjust the default search path
+(defaults to ``/bin:/usr/bin:/usr/ucb'')
+and/or \-DCMDBIN=\e"\fIdir\fP\e"
+to change the default program directory
+(defaults to ``/usr/adm/sm.bin'').
.SH FILES
-/usr/libexec/sm.bin \- directory for restricted programs
+/usr/adm/sm.bin \- directory for restricted programs
.SH SEE ALSO
sendmail(8)
diff --git a/usr.sbin/sendmail/smrsh/smrsh.c b/usr.sbin/sendmail/smrsh/smrsh.c
index c3314e6e17c..66e0ebab66a 100644
--- a/usr.sbin/sendmail/smrsh/smrsh.c
+++ b/usr.sbin/sendmail/smrsh/smrsh.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1993 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1993 Eric P. Allman. All rights reserved.
* Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)smrsh.c 8.5 (Berkeley) 10/19/97";
+static char sccsid[] = "@(#)smrsh.c 8.11 (Berkeley) 5/19/98";
#endif /* not lint */
/*
@@ -91,6 +69,7 @@ static char sccsid[] = "@(#)smrsh.c 8.5 (Berkeley) 10/19/97";
# define PATH "/bin:/usr/bin:/usr/ucb"
#endif
+int
main(argc, argv)
int argc;
char **argv;
diff --git a/usr.sbin/sendmail/src/Makefile b/usr.sbin/sendmail/src/Makefile
index 9a4314ab5c7..ca380d905f2 100644
--- a/usr.sbin/sendmail/src/Makefile
+++ b/usr.sbin/sendmail/src/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.17 1998/07/12 17:54:16 millert Exp $
+# $OpenBSD: Makefile,v 1.18 1998/07/12 19:44:15 millert Exp $
#
# OpenBSD Makefile
#
@@ -16,13 +16,13 @@ PROG= sendmail
# databases are read, but the new format will be used on any rebuilds. On
# really gnarly systems, you can set this to null; it will crawl like a high
# spiral snail, but it will work.
-DBMDEF= -DNEWDB
+MAPDEF= -DNEWDB -DMAP_REGEX
.if (${YP} == "yes")
-DBMDEF+=-DNIS
+MAPDEF+=-DNIS
.endif
-CFLAGS+=-I${.CURDIR} ${DBMDEF} -DNETISO
+CFLAGS+=-I${.CURDIR} ${MAPDEF} -DNETISO
.if (${TCP_WRAPPERS} == "yes")
CFLAGS+=-DTCPWRAPPERS
@@ -34,8 +34,8 @@ LDADD= -lwrap
SRCS= alias.c arpadate.c clock.c collect.c conf.c convtime.c daemon.c \
deliver.c domain.c envelope.c err.c headers.c macro.c main.c map.c \
mci.c mime.c parseaddr.c queue.c readcf.c recipient.c safefile.c \
- savemail.c srvrsmtp.c stab.c stats.c sysexits.c trace.c udb.c \
- usersmtp.c util.c version.c
+ savemail.c snprintf.c srvrsmtp.c stab.c stats.c sysexits.c trace.c \
+ udb.c usersmtp.c util.c version.c
MAN= aliases.5 mailq.1 newaliases.1 sendmail.8
LINKS= ${BINDIR}/sendmail /usr/bin/newaliases \
${BINDIR}/sendmail /usr/bin/mailq \
@@ -46,8 +46,6 @@ BINGRP= bin
BINMODE=4555
beforeinstall:
-# ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
-# ${DESTDIR}/etc/sendmail.fc
${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
${DESTDIR}/var/log/sendmail.st
${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 \
diff --git a/usr.sbin/sendmail/src/TRACEFLAGS b/usr.sbin/sendmail/src/TRACEFLAGS
index db461db60fc..588714da7f2 100644
--- a/usr.sbin/sendmail/src/TRACEFLAGS
+++ b/usr.sbin/sendmail/src/TRACEFLAGS
@@ -1,7 +1,9 @@
+# @(#)TRACEFLAGS 8.21 (Berkeley) 4/27/98
0, 1 main.c main skip background fork
0, 4 main.c main canonical name, UUCP node name, a.k.a.s
0, 15 main.c main print configuration
0, 44 util.c printav print address of each string
+0, 101 main.c main print version and exit
1 main.c main print from person
2 main.c finis
3 conf.c getla, shouldqueue
diff --git a/usr.sbin/sendmail/src/alias.c b/usr.sbin/sendmail/src/alias.c
index cebd805c1a6..8da3317a3c1 100644
--- a/usr.sbin/sendmail/src/alias.c
+++ b/usr.sbin/sendmail/src/alias.c
@@ -1,41 +1,19 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
- * Copyright (c) 1988, 1993
- * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * Copyright (c) 1988, 1993
+ * The Regents of the University of California. All rights reserved.
*/
# include "sendmail.h"
#ifndef lint
-static char sccsid[] = "@(#)alias.c 8.73 (Berkeley) 5/8/97";
+static char sccsid[] = "@(#)alias.c 8.92 (Berkeley) 6/5/98";
#endif /* not lint */
@@ -77,7 +55,7 @@ alias(a, sendq, aliaslevel, e)
char *owner;
auto int stat = EX_OK;
char obuf[MAXNAME + 7];
- extern char *aliaslookup();
+ extern char *aliaslookup __P((char *, int *, ENVELOPE *));
if (tTd(27, 1))
printf("alias(%s)\n", a->q_user);
@@ -104,7 +82,7 @@ alias(a, sendq, aliaslevel, e)
{
a->q_flags |= QQUEUEUP;
if (e->e_message == NULL)
- e->e_message = "alias database unavailable";
+ e->e_message = newstr("alias database unavailable");
return;
}
if (p == NULL)
@@ -123,11 +101,11 @@ alias(a, sendq, aliaslevel, e)
a->q_flags |= QVERIFIED;
return;
}
- message("aliased to %s", shortenstring(p, 203));
+ message("aliased to %s", shortenstring(p, MAXSHORTSTR));
if (LogLevel > 9)
sm_syslog(LOG_INFO, e->e_id,
"alias %.100s => %s",
- a->q_paddr, shortenstring(p, 203));
+ a->q_paddr, shortenstring(p, MAXSHORTSTR));
a->q_flags &= ~QSELFREF;
if (tTd(27, 5))
{
@@ -237,7 +215,7 @@ setalias(spec)
{
char buf[50];
- while (isspace(*p))
+ while (isascii(*p) && isspace(*p))
p++;
if (*p == '\0')
break;
@@ -402,7 +380,9 @@ aliaswait(map, ext, isopen)
if (stat(buf, &stb) < 0 || stb.st_mtime < mtime || attimeout)
{
/* database is out of date */
- if (AutoRebuild && stb.st_ino != 0 && stb.st_uid == geteuid())
+ if (AutoRebuild && stb.st_ino != 0 &&
+ (stb.st_uid == geteuid() ||
+ (geteuid() == 0 && stb.st_uid == TrustedFileUid)))
{
bool oldSuprErrs;
@@ -414,7 +394,7 @@ aliaswait(map, ext, isopen)
map->map_class->map_close(map);
map->map_mflags &= ~(MF_OPEN|MF_WRITABLE);
}
- rebuildaliases(map, TRUE);
+ (void) rebuildaliases(map, TRUE);
isopen = map->map_class->map_open(map, O_RDONLY);
SuprErrs = oldSuprErrs;
}
@@ -438,28 +418,36 @@ aliaswait(map, ext, isopen)
** automatic -- set if this was automatically generated.
**
** Returns:
-** none.
+** TRUE if successful; FALSE otherwise.
**
** Side Effects:
** Reads the text version of the database, builds the
** DBM or DB version.
*/
-void
+bool
rebuildaliases(map, automatic)
register MAP *map;
bool automatic;
{
FILE *af;
bool nolock = FALSE;
- int sff = SFF_OPENASROOT|SFF_REGONLY|SFF_NOLOCK|SFF_NOWLINK|SFF_NOWFILES;
+ bool success = FALSE;
+ int sff = SFF_OPENASROOT|SFF_REGONLY|SFF_NOLOCK;
sigfunc_t oldsigint, oldsigquit;
#ifdef SIGTSTP
sigfunc_t oldsigtstp;
#endif
if (!bitset(MCF_REBUILDABLE, map->map_class->map_cflags))
- return;
+ return FALSE;
+
+ if (!bitset(DBS_LINKEDALIASFILEINWRITABLEDIR, DontBlameSendmail))
+ sff |= SFF_NOWLINK;
+ if (!bitset(DBS_GROUPWRITABLEALIASFILE, DontBlameSendmail))
+ sff |= SFF_NOGWFILES;
+ if (!bitset(DBS_WORLDWRITABLEALIASFILE, DontBlameSendmail))
+ sff |= SFF_NOWWFILES;
/* try to lock the source file */
if ((af = safefopen(map->map_file, O_RDWR, 0, sff)) == NULL)
@@ -478,7 +466,7 @@ rebuildaliases(map, automatic)
message("newaliases: cannot open %s: %s",
map->map_file, errstring(saveerr));
errno = 0;
- return;
+ return FALSE;
}
nolock = TRUE;
if (tTd(27, 1) ||
@@ -503,7 +491,7 @@ rebuildaliases(map, automatic)
}
(void) xfclose(af, "rebuildaliases1", map->map_file);
errno = 0;
- return;
+ return FALSE;
}
oldsigint = setsignal(SIGINT, SIG_IGN);
@@ -523,6 +511,7 @@ rebuildaliases(map, automatic)
}
map->map_mflags |= MF_OPEN|MF_WRITABLE;
readaliases(map, af, !automatic, TRUE);
+ success = TRUE;
}
else
{
@@ -550,6 +539,7 @@ rebuildaliases(map, automatic)
#ifdef SIGTSTP
(void) setsignal(SIGTSTP, oldsigtstp);
#endif
+ return success;
}
/*
** READALIASES -- read and process the alias file.
@@ -607,6 +597,7 @@ readaliases(map, af, announcestats, logstats)
p--;
if (fgets(p, SPACELEFT(line, p), af) == NULL)
break;
+ LineNumber++;
p = strchr(p, '\n');
}
#endif
@@ -855,6 +846,38 @@ forward(user, sendq, aliaslevel, e)
"forward %s: transient error: %s",
buf, errstring(err));
}
+ else
+ {
+ switch (err)
+ {
+ case ENOENT:
+ break;
+
+#if _FFR_FORWARD_SYSERR
+ case E_SM_NOSLINK:
+ case E_SM_NOHLINK:
+ case E_SM_REGONLY:
+ case E_SM_ISEXEC:
+ case E_SM_WWDIR:
+ case E_SM_GWDIR:
+ case E_SM_WWFILE:
+ case E_SM_GWFILE:
+ syserr("forward: %s: %s", buf, errstring(err));
+ break;
+#endif
+
+ default:
+ if (LogLevel > (RunAsUid == 0 ? 2 : 10))
+ sm_syslog(LOG_WARNING, e->e_id,
+ "forward %s: %s", buf,
+ errstring(err));
+ if (Verbose)
+ message("forward: %s: %s",
+ buf,
+ errstring(err));
+ break;
+ }
+ }
}
if (pp == NULL && got_transient)
{
diff --git a/usr.sbin/sendmail/src/aliases.5 b/usr.sbin/sendmail/src/aliases.5
index ea606e6c8af..8c73ac35a97 100644
--- a/usr.sbin/sendmail/src/aliases.5
+++ b/usr.sbin/sendmail/src/aliases.5
@@ -1,38 +1,16 @@
-.\" Copyright (c) 1983, 1997 Eric P. Allman
+.\" Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+.\" Copyright (c) 1983, 1997 Eric P. Allman. All rights reserved.
.\" Copyright (c) 1985, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the University of
-.\" California, Berkeley and its contributors.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
+.\" 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.
.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
.\"
-.\" @(#)aliases.5 8.3 (Berkeley) 2/1/97
+.\" @(#)aliases.5 8.8 (Berkeley) 5/19/98
.\"
-.Dd February 1, 1997
+.Dd May 19, 1998
.Dt ALIASES 5
.Os BSD 4
.Sh NAME
@@ -83,6 +61,7 @@ change to take effect.
.Sh SEE ALSO
.Xr newaliases 1 ,
.Xr dbopen 3 ,
+.Xr dbm 3 ,
.Xr sendmail 8
.Rs
.%T "SENDMAIL Installation and Operation Guide"
@@ -90,6 +69,15 @@ change to take effect.
.Rs
.%T "SENDMAIL An Internetwork Mail Router"
.Re
+.Sh BUGS
+If you have compiled
+.Xr sendmail
+with DBM support instead of NEWDB,
+you may have encountered problems in
+.Xr dbm 3
+restricting a single alias to about 1000 bytes of information.
+You can get longer aliases by ``chaining''; that is, make the last name in
+the alias be a dummy name which is a continuation alias.
.Sh HISTORY
The
.Nm
diff --git a/usr.sbin/sendmail/src/arpadate.c b/usr.sbin/sendmail/src/arpadate.c
index f289020424a..7a9576bdd4d 100644
--- a/usr.sbin/sendmail/src/arpadate.c
+++ b/usr.sbin/sendmail/src/arpadate.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)arpadate.c 8.7 (Berkeley) 2/1/97";
+static char sccsid[] = "@(#)arpadate.c 8.12 (Berkeley) 5/19/98";
#endif /* not lint */
# include "sendmail.h"
diff --git a/usr.sbin/sendmail/src/clock.c b/usr.sbin/sendmail/src/clock.c
index 6940b297894..e81c9725d6e 100644
--- a/usr.sbin/sendmail/src/clock.c
+++ b/usr.sbin/sendmail/src/clock.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)clock.c 8.24 (Berkeley) 4/19/97";
+static char sccsid[] = "@(#)clock.c 8.34 (Berkeley) 6/4/98";
#endif /* not lint */
# include "sendmail.h"
@@ -106,7 +84,8 @@ setevent(intvl, func, arg)
if (tTd(5, 5))
printf("setevent: intvl=%ld, for=%ld, func=%lx, arg=%d, ev=%lx\n",
- intvl, now + intvl, (u_long) func, arg, (u_long) ev);
+ (long) intvl, (long)(now + intvl), (u_long) func,
+ arg, (u_long) ev);
setsignal(SIGALRM, tick);
intvl = EventQueue->ev_time - now;
@@ -179,9 +158,10 @@ clrevent(ev)
** calls the next function in EventQueue.
*/
+/* ARGSUSED */
static SIGFUNC_DECL
-tick(arg)
- int arg;
+tick(sig)
+ int sig;
{
register time_t now;
register EVENT *ev;
@@ -192,7 +172,7 @@ tick(arg)
now = curtime();
if (tTd(5, 4))
- printf("tick: now=%ld\n", now);
+ printf("tick: now=%ld\n", (long) now);
/* reset signal in case System V semantics */
(void) setsignal(SIGALRM, tick);
@@ -256,7 +236,7 @@ tick(arg)
*/
static bool SleepDone;
-static void endsleep();
+static void endsleep __P((void));
#ifndef SLEEP_T
# define SLEEP_T unsigned int
diff --git a/usr.sbin/sendmail/src/collect.c b/usr.sbin/sendmail/src/collect.c
index 58f0dc75142..190e6995743 100644
--- a/usr.sbin/sendmail/src/collect.c
+++ b/usr.sbin/sendmail/src/collect.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)collect.c 8.72 (Berkeley) 10/6/97";
+static char sccsid[] = "@(#)collect.c 8.89 (Berkeley) 6/4/98";
#endif /* not lint */
# include <errno.h>
@@ -64,7 +42,7 @@ static char sccsid[] = "@(#)collect.c 8.72 (Berkeley) 10/6/97";
*/
static jmp_buf CtxCollectTimeout;
-static void collecttimeout();
+static void collecttimeout __P((time_t));
static bool CollectProgress;
static EVENT *CollectTimeout;
@@ -102,9 +80,9 @@ collect(fp, smtpmode, hdrp, e)
u_char peekbuf[8];
char dfname[MAXQFNAME];
char bufbuf[MAXLINE];
- extern bool isheader();
- extern void eatheader();
- extern void tferror();
+ extern bool isheader __P((char *));
+ extern void eatheader __P((ENVELOPE *, bool));
+ extern void tferror __P((FILE *volatile, ENVELOPE *));
headeronly = hdrp != NULL;
@@ -181,6 +159,8 @@ collect(fp, smtpmode, hdrp, e)
for (;;)
{
+ extern int chompheader __P((char *, bool, HDR **, ENVELOPE *));
+
if (tTd(30, 35))
printf("top, istate=%d, mstate=%d\n", istate, mstate);
for (;;)
@@ -333,14 +313,12 @@ nextstate:
istate, mstate, buf);
switch (mstate)
{
- extern int chompheader();
-
case MS_UFROM:
mstate = MS_HEADER;
#ifndef NOTUNIX
if (strncmp(buf, "From ", 5) == 0)
{
- extern void eatfrom();
+ extern void eatfrom __P((char *volatile, ENVELOPE *));
bp = buf;
eatfrom(buf, e);
@@ -376,7 +354,10 @@ nextstate:
bp++;
*bp = '\0';
if (bitset(H_EOH, chompheader(buf, FALSE, hdrp, e)))
+ {
mstate = MS_BODY;
+ goto nextstate;
+ }
break;
case MS_BODY:
@@ -456,16 +437,16 @@ readerr:
sm_syslog(LOG_NOTICE, e->e_id,
"collect: %s on connection from %.100s, sender=%s: %s",
problem, host,
- shortenstring(e->e_from.q_paddr, 203),
+ shortenstring(e->e_from.q_paddr, MAXSHORTSTR),
errstring(errno));
if (feof(fp))
usrerr("451 collect: %s on connection from %s, from=%s",
problem, host,
- shortenstring(e->e_from.q_paddr, 203));
+ shortenstring(e->e_from.q_paddr, MAXSHORTSTR));
else
syserr("451 collect: %s on connection from %s, from=%s",
problem, host,
- shortenstring(e->e_from.q_paddr, 203));
+ shortenstring(e->e_from.q_paddr, MAXSHORTSTR));
/* don't return an error indication */
e->e_to = NULL;
@@ -490,11 +471,7 @@ readerr:
/* collect statistics */
if (OpMode != MD_VERIFY)
- {
- extern void markstats();
-
- markstats(e, (ADDRESS *) NULL);
- }
+ markstats(e, (ADDRESS *) NULL, FALSE);
#if _FFR_DSN_RRT_OPTION
/*
@@ -527,7 +504,7 @@ readerr:
/* no valid recipient headers */
register ADDRESS *q;
char *hdr = NULL;
- extern void addheader();
+ extern void addheader __P((char *, char *, HDR **));
/* create an Apparently-To: field */
/* that or reject the message.... */
@@ -634,29 +611,40 @@ collecttimeout(timeout)
void
tferror(tf, e)
- FILE *tf;
+ FILE *volatile tf;
register ENVELOPE *e;
{
setstat(EX_IOERR);
if (errno == ENOSPC)
{
+#if STAT64 > 0
+ struct stat64 st;
+#else
struct stat st;
+#endif
long avail;
long bsize;
extern long freediskspace __P((char *, long *));
e->e_flags |= EF_NO_BODY_RETN;
- if (fstat(fileno(tf), &st) < 0)
- st.st_size = 0;
+
+ if (
+#if STAT64 > 0
+ fstat64(fileno(tf), &st)
+#else
+ fstat(fileno(tf), &st)
+#endif
+ < 0)
+ st.st_size = 0;
(void) freopen(queuename(e, 'd'), "w", tf);
if (st.st_size <= 0)
fprintf(tf, "\n*** Mail could not be accepted");
else if (sizeof st.st_size > sizeof (long))
- fprintf(tf, "\n*** Mail of at least %qd bytes could not be accepted\n",
- st.st_size);
+ fprintf(tf, "\n*** Mail of at least %s bytes could not be accepted\n",
+ quad_to_string(st.st_size));
else
- fprintf(tf, "\n*** Mail of at least %ld bytes could not be accepted\n",
- (long) st.st_size);
+ fprintf(tf, "\n*** Mail of at least %lu bytes could not be accepted\n",
+ (unsigned long) st.st_size);
fprintf(tf, "*** at %s due to lack of disk space for temp file.\n",
MyHostName);
avail = freediskspace(QueueDir, &bsize);
@@ -674,7 +662,10 @@ tferror(tf, e)
}
else
syserr("collect: Cannot write tf%s", e->e_id);
- (void) freopen("/dev/null", "w", tf);
+ if (freopen("/dev/null", "w", tf) == NULL)
+ sm_syslog(LOG_ERR, e->e_id,
+ "tferror: freopen(\"/dev/null\") failed: %s",
+ errstring(errno));
}
/*
** EATFROM -- chew up a UNIX style from line and process
@@ -709,7 +700,7 @@ char *MonthList[] =
void
eatfrom(fm, e)
- char *fm;
+ char *volatile fm;
register ENVELOPE *e;
{
register char *p;
diff --git a/usr.sbin/sendmail/src/conf.c b/usr.sbin/sendmail/src/conf.c
index b19ecd9d64f..46a4b88eef3 100644
--- a/usr.sbin/sendmail/src/conf.c
+++ b/usr.sbin/sendmail/src/conf.c
@@ -1,45 +1,24 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)conf.c 8.379 (Berkeley) 10/20/97";
+static char sccsid[] = "@(#)conf.c 8.431 (Berkeley) 6/25/98";
#endif /* not lint */
# include "sendmail.h"
# include "pathnames.h"
# include <sys/ioctl.h>
# include <sys/param.h>
+# include <limits.h>
/*
** CONF.C -- Sendmail Configuration Tables.
@@ -63,8 +42,6 @@ static char sccsid[] = "@(#)conf.c 8.379 (Berkeley) 10/20/97";
*/
-
-
/*
** Header info table
** Final (null) entry contains the flags used for any other field.
@@ -140,15 +117,63 @@ struct prival PrivacyValues[] =
{ "novrfy", PRIV_NOVRFY },
{ "restrictmailq", PRIV_RESTRICTMAILQ },
{ "restrictqrun", PRIV_RESTRICTQRUN },
-#if _FFR_PRIVACY_NOETRN
{ "noetrn", PRIV_NOETRN },
-#endif
+ { "noverb", PRIV_NOVERB },
{ "authwarnings", PRIV_AUTHWARNINGS },
{ "noreceipts", PRIV_NORECEIPTS },
{ "goaway", PRIV_GOAWAY },
{ NULL, 0 }
};
+/*
+** DontBlameSendmail values
+*/
+struct dbsval DontBlameSendmailValues[] =
+{
+ { "safe", DBS_SAFE },
+ { "assumesafechown", DBS_ASSUMESAFECHOWN },
+ { "groupwritabledirpathsafe", DBS_GROUPWRITABLEDIRPATHSAFE },
+ { "groupwritableforwardfilesafe",
+ DBS_GROUPWRITABLEFORWARDFILESAFE },
+ { "groupwritableincludefilesafe",
+ DBS_GROUPWRITABLEINCLUDEFILESAFE },
+ { "groupwritablealiasfile", DBS_GROUPWRITABLEALIASFILE },
+ { "worldwritablealiasfile", DBS_WORLDWRITABLEALIASFILE },
+ { "forwardfileinunsafedirpath", DBS_FORWARDFILEINUNSAFEDIRPATH },
+ { "includefileinunsafedirpath", DBS_INCLUDEFILEINUNSAFEDIRPATH },
+ { "mapinunsafedirpath", DBS_MAPINUNSAFEDIRPATH },
+ { "linkedaliasfileinwritabledir",
+ DBS_LINKEDALIASFILEINWRITABLEDIR },
+ { "linkedclassfileinwritabledir",
+ DBS_LINKEDCLASSFILEINWRITABLEDIR },
+ { "linkedforwardfileinwritabledir",
+ DBS_LINKEDFORWARDFILEINWRITABLEDIR },
+ { "linkedincludefileinwritabledir",
+ DBS_LINKEDINCLUDEFILEINWRITABLEDIR },
+ { "linkedmapinwritabledir", DBS_LINKEDMAPINWRITABLEDIR },
+ { "linkedserviceswitchfileinwritabledir",
+ DBS_LINKEDSERVICESWITCHFILEINWRITABLEDIR },
+ { "filedeliverytohardlink", DBS_FILEDELIVERYTOHARDLINK },
+ { "filedeliverytosymlink", DBS_FILEDELIVERYTOSYMLINK },
+ { "writemaptohardlink", DBS_WRITEMAPTOHARDLINK },
+ { "writemaptosymlink", DBS_WRITEMAPTOSYMLINK },
+ { "writestatstohardlink", DBS_WRITESTATSTOHARDLINK },
+ { "writestatstosymlink", DBS_WRITESTATSTOSYMLINK },
+ { "forwardfileingroupwritabledirpath",
+ DBS_FORWARDFILEINGROUPWRITABLEDIRPATH },
+ { "includefileingroupwritabledirpath",
+ DBS_INCLUDEFILEINGROUPWRITABLEDIRPATH },
+ { "classfileinunsafedirpath", DBS_CLASSFILEINUNSAFEDIRPATH },
+ { "errorheaderinunsafedirpath", DBS_ERRORHEADERINUNSAFEDIRPATH },
+ { "helpfileinunsafedirpath", DBS_HELPFILEINUNSAFEDIRPATH },
+ { "forwardfileinunsafedirpathsafe",
+ DBS_FORWARDFILEINUNSAFEDIRPATHSAFE },
+ { "includefileinunsafedirpathsafe",
+ DBS_INCLUDEFILEINUNSAFEDIRPATHSAFE },
+ { "runprograminunsafedirpath", DBS_RUNPROGRAMINUNSAFEDIRPATH },
+ { "runwritableprogram", DBS_RUNWRITABLEPROGRAM },
+ { NULL, 0 }
+};
/*
@@ -190,12 +215,13 @@ setdefaults(e)
register ENVELOPE *e;
{
int i;
+ struct passwd *pw;
char buf[MAXNAME];
- extern void inittimeouts();
- extern void setdefuser();
- extern void setupmaps();
- extern void setupmailers();
- extern void setupheaders();
+ extern void inittimeouts __P((char *));
+ extern void setdefuser __P((void));
+ extern void setupmaps __P((void));
+ extern void setupmailers __P((void));
+ extern void setupheaders __P((void));
SpaceSub = ' '; /* option B */
QueueLA = 8; /* option x */
@@ -206,8 +232,26 @@ setdefaults(e)
QueueFactor = WkRecipFact * 20; /* option q */
FileMode = (RealUid != geteuid()) ? 0644 : 0600;
/* option F */
- DefUid = 1; /* option u */
- DefGid = 1; /* option g */
+
+ if (((pw = getpwnam("mailnull")) != NULL && pw->pw_uid != 0) ||
+ ((pw = getpwnam("sendmail")) != NULL && pw->pw_uid != 0) ||
+ ((pw = getpwnam("daemon")) != NULL && pw->pw_uid != 0))
+ {
+ DefUid = pw->pw_uid; /* option u */
+ DefGid = pw->pw_gid; /* option g */
+ DefUser = newstr(pw->pw_name);
+ }
+ else
+ {
+ DefUid = 1; /* option u */
+ DefGid = 1; /* option g */
+ setdefuser();
+ }
+ TrustedFileUid = 0;
+ if (tTd(37, 4))
+ printf("setdefaults: DefUser=%s, DefUid=%d, DefGid=%d\n",
+ DefUser != NULL ? DefUser : "<1:1>",
+ (int) DefUid, (int) DefGid);
CheckpointInterval = 10; /* option C */
MaxHopCount = 25; /* option h */
e->e_sendmode = SM_FORK; /* option d */
@@ -217,7 +261,8 @@ setdefaults(e)
MciCacheTimeout = 5 MINUTES; /* option K */
LogLevel = 9; /* option L */
inittimeouts(NULL); /* option r */
- PrivacyFlags = 0; /* option p */
+ PrivacyFlags = PRIV_PUBLIC; /* option p */
+ DontBlameSendmail = DBS_SAFE; /* DontBlameSendmail option */
#if MIME8TO7
MimeMode = MM_CVTMIME|MM_PASS8BIT; /* option 8 */
#else
@@ -244,7 +289,9 @@ setdefaults(e)
_PATH_VARTMP,
_PATH_VARTMP[sizeof _PATH_VARTMP - 2] == '/' ? "" : "/");
DeadLetterDrop = newstr(buf);
- setdefuser();
+#ifdef HESIOD_INIT
+ HesiodContext = NULL;
+#endif
setupmaps();
setupmailers();
setupheaders();
@@ -265,6 +312,9 @@ setdefuser()
defpwent = sm_getpwuid(DefUid);
snprintf(defuserbuf, sizeof defuserbuf, "%s",
defpwent == NULL ? "nobody" : defpwent->pw_name);
+ if (tTd(37, 4))
+ printf("setdefuser: DefUid=%d, DefUser=%s\n",
+ (int) DefUid, DefUser);
}
/*
** SETUPMAILERS -- initialize default mailers
@@ -274,7 +324,7 @@ void
setupmailers()
{
char buf[100];
- extern void makemailer();
+ extern void makemailer __P((char *));
strcpy(buf, "prog, P=/bin/sh, F=lsoDq9, T=DNS/RFC822/X-Unix, A=sh -c \201u");
makemailer(buf);
@@ -396,6 +446,12 @@ setupmaps()
dequote_init, null_map_open, null_map_close,
dequote_map, null_map_store);
+#ifdef MAP_REGEX
+ MAPDEF("regex", NULL, 0,
+ regex_map_init, null_map_open, null_map_close,
+ regex_map_lookup, null_map_store);
+#endif
+
#if USERDB
/* user database */
MAPDEF("userdb", ".db", 0,
@@ -423,7 +479,7 @@ setupmaps()
map_parseargs, null_map_open, null_map_close,
null_map_lookup, null_map_store);
-#if _FFR_SYSLOG_MAP
+#if _FFR_MAP_SYSLOG
/* syslog map -- logs information to syslog */
MAPDEF("syslog", NULL, 0,
syslog_map_parseargs, null_map_open, null_map_close,
@@ -758,10 +814,14 @@ switch_map_find(service, maptype, mapreturn)
{
/* (re)read service switch */
register FILE *fp;
+ int sff = SFF_REGONLY|SFF_OPENASROOT|SFF_NOLOCK;
+
+ if (!bitset(DBS_LINKEDSERVICESWITCHFILEINWRITABLEDIR, DontBlameSendmail))
+ sff |= SFF_NOWLINK;
if (ConfigFileRead)
ServiceCacheTime = now;
- fp = fopen(ServiceSwitchFile, "r");
+ fp = safefopen(ServiceSwitchFile, O_RDONLY, 0, sff);
if (fp != NULL)
{
char buf[MAXLINE];
@@ -830,38 +890,42 @@ switch_map_find(service, maptype, mapreturn)
}
#endif
+#if !defined(_USE_SUN_NSSWITCH_)
/* if the service file doesn't work, use an absolute fallback */
+# ifdef _USE_DEC_SVC_CONF_
punt:
+# endif
for (svcno = 0; svcno < MAXMAPACTIONS; svcno++)
mapreturn[svcno] = 0;
svcno = 0;
if (strcmp(service, "aliases") == 0)
{
maptype[svcno++] = "files";
-#ifdef AUTO_NIS_ALIASES
-# ifdef NISPLUS
+# ifdef AUTO_NIS_ALIASES
+# ifdef NISPLUS
maptype[svcno++] = "nisplus";
-# endif
-# ifdef NIS
+# endif
+# ifdef NIS
maptype[svcno++] = "nis";
+# endif
# endif
-#endif
return svcno;
}
if (strcmp(service, "hosts") == 0)
{
-# if NAMED_BIND
+# if NAMED_BIND
maptype[svcno++] = "dns";
-# else
-# if defined(sun) && !defined(BSD) && !defined(_USE_SUN_NSSWITCH_)
+# else
+# if defined(sun) && !defined(BSD)
/* SunOS */
maptype[svcno++] = "nis";
+# endif
# endif
-# endif
maptype[svcno++] = "files";
return svcno;
}
return -1;
+#endif
}
/*
** USERNAME -- return the user id of the logged in user.
@@ -959,7 +1023,7 @@ ttypath()
}
/* see if we have write permission */
- if (stat(pathn, &stbuf) < 0 || !bitset(02, stbuf.st_mode))
+ if (stat(pathn, &stbuf) < 0 || !bitset(S_IWOTH, stbuf.st_mode))
{
errno = 0;
return (NULL);
@@ -1214,6 +1278,15 @@ init_md(argc, argv)
/* keep gethostby*() from stripping the local domain name */
set_domain_trim_off();
#endif
+#ifdef __QNX__
+ /*
+ ** Due to QNX's network distributed nature, you can target a tcpip
+ ** stack on a different node in the qnx network; this patch lets
+ ** this feature work. The __sock_locate() must be done before the
+ ** environment is clear.
+ */
+ __sock_locate();
+#endif
#if SECUREWARE || defined(_SCO_unix_)
set_auth_parameters(argc, argv);
@@ -1327,10 +1400,6 @@ init_vendor_macros(e)
#include <nlist.h>
-#ifdef IRIX64
-# define nlist nlist64
-#endif
-
/* _PATH_UNIX should be defined in <paths.h> */
#ifndef _PATH_UNIX
# if defined(SYSTEM5)
@@ -1661,95 +1730,12 @@ getla()
#endif /* LA_TYPE == LA_PROCSTR */
#if LA_TYPE == LA_IRIX6
-
-#include <nlist.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#define X_AVENRUN 0
-struct nlist Nl32[] =
-{
- { LA_AVENRUN },
- { 0 },
-};
-struct nlist64 Nl64[] =
-{
- { LA_AVENRUN },
- { 0 },
-};
+#include <sys/sysmp.h>
int getla(void)
{
static int kmem = -1;
- static enum { getla_none, getla_32, getla_64 } kernel_type =
- getla_none;
- uint32_t avenrun[3];
-
- if (kernel_type == getla_none)
- {
- /* Try 32 bit kernel ... */
- errno = 0;
- if (nlist(_PATH_UNIX, Nl32) == 0)
- {
- if (tTd(3, 20))
- printf("getla: Kernel is 32bit\n");
-
- if (Nl32[X_AVENRUN].n_value == 0)
- {
- if (tTd(3, 1))
- printf("getla: nlist(%s, %s) ==> 0\n",
- _PATH_UNIX, LA_AVENRUN);
- }
- else
- kernel_type = getla_32;
- }
- else if (errno != 0)
- {
- if (tTd(3, 1))
- printf("getla: nlist(%s): %s\n",
- _PATH_UNIX, errstring(errno));
- }
- else
- {
- if (tTd(3, 20))
- printf("getla: Kernel is not 32bit\n");
- }
-
- /* Try 64 bit kernel ... */
- errno = 0;
- if (nlist64(_PATH_UNIX, Nl64) == 0)
- {
- if (tTd(3, 20))
- printf("getla: Kernel is 64bit\n");
-
- if (Nl64[X_AVENRUN].n_value == 0)
- {
- if (tTd(3, 1))
- printf("getla: nlist(%s, %s) ==> 0\n",
- _PATH_UNIX, LA_AVENRUN);
- }
- else
- kernel_type = getla_64;
- }
- else if (errno != 0)
- {
- if (tTd(3, 1))
- printf("getla: nlist64(%s): %s\n",
- _PATH_UNIX, errstring(errno));
- }
- else
- {
- if (tTd(3, 20))
- printf("getla: Kernel is not 64bit\n");
- }
- }
-
- if (kernel_type == getla_none)
- {
- if (tTd(3, 1))
- printf("getla: Failed to determine kernel type\n");
- return -1;
- }
+ int avenrun[3];
if (kmem < 0)
{
@@ -1757,56 +1743,34 @@ int getla(void)
if (kmem < 0)
{
if (tTd(3, 1))
- printf("getla: open(/dev/kmem): %s\n",
+ printf("getla: open(%s): %s\n", _PATH_KMEM,
errstring(errno));
return -1;
}
(void) fcntl(kmem, F_SETFD, 1);
}
- switch (kernel_type)
+ if (lseek(kmem, (sysmp(MP_KERNADDR, MPKA_AVENRUN) & 0x7fffffff), SEEK_SET) == -1 ||
+ read(kmem, (char *)avenrun, sizeof(avenrun)) < sizeof(avenrun))
{
- case getla_none:
+ if (tTd(3, 1))
+ printf("getla: lseek or read: %s\n",
+ errstring(errno));
return -1;
-
- case getla_32:
- if (lseek(kmem, (off_t) Nl32[X_AVENRUN].n_value, SEEK_SET) == -1 ||
- read(kmem, (char *) avenrun, sizeof(avenrun)) < sizeof(avenrun))
- {
- if (tTd(3, 1))
- printf("getla: lseek or read: %s\n",
- errstring(errno));
- return -1;
- }
- break;
-
- case getla_64:
- /* Using of lseek64 is perhaps overkill ... */
- if (lseek64(kmem, (off64_t) Nl64[X_AVENRUN].n_value, SEEK_SET) == -1 ||
- read(kmem, (char *) avenrun, sizeof(avenrun)) <
- sizeof(avenrun))
- {
- if (tTd(3, 1))
- printf("getla: lseek64 or read: %s\n",
- errstring(errno));
- return -1;
- }
- break;
}
if (tTd(3, 5))
{
- printf("getla: avenrun = %ld",
- (long int) avenrun[0]);
+ printf("getla: avenrun = %ld", (long int) avenrun[0]);
if (tTd(3, 15))
printf(", %ld, %ld",
- (long int)avenrun[1],
- (long int)avenrun[2]);
+ (long int) avenrun[1], (long int) avenrun[2]);
printf("\n");
}
+
if (tTd(3, 1))
- printf("getla: %d\n",
- (int) (avenrun[0] + FSCALE/2) >> FSHIFT);
+ printf("getla: %d\n", (int) (avenrun[0] + FSCALE/2) >> FSHIFT);
return ((int) (avenrun[0] + FSCALE/2) >> FSHIFT);
+
}
#endif
@@ -1906,6 +1870,8 @@ getla()
#endif /* LA_TYPE == LA_DEVSHORT */
#if LA_TYPE == LA_ALPHAOSF
+struct rtentry;
+struct mbuf;
# include <sys/table.h>
int getla()
@@ -1973,7 +1939,7 @@ getla()
/* Non Apollo stuff removed by Don Lewis 11/15/93 */
#ifndef lint
-static char rcsid[] = "@(#)$Id: conf.c,v 1.9 1997/11/09 04:05:36 gene Exp $";
+static char rcsid[] = "@(#)$Id: conf.c,v 1.10 1998/07/12 19:44:26 millert Exp $";
#endif /* !lint */
#ifdef apollo
@@ -2065,7 +2031,7 @@ refuseconnections(port)
time_t now;
static time_t lastconn = (time_t) 0;
static int conncnt = 0;
- extern bool enoughdiskspace();
+ extern bool enoughdiskspace __P((long));
#ifdef XLA
if (!xla_smtp_ok())
@@ -2246,18 +2212,23 @@ initsetproctitle(argc, argv, envp)
Argv = argv;
/*
- ** Find the last environment variable within sendmail's
- ** process memory area.
- */
- while (i > 0 && (envp[i - 1] < argv[0] ||
- envp[i - 1] > (argv[argc - 1] +
- strlen(argv[argc - 1]) + 1 + envpsize)))
- i--;
-
- if (i > 0)
- LastArgv = envp[i - 1] + strlen(envp[i - 1]);
- else
- LastArgv = argv[argc - 1] + strlen(argv[argc - 1]);
+ ** Determine how much space we can use for setproctitle.
+ ** Use all contiguous argv and envp pointers starting at argv[0]
+ */
+ for (i = 0; i < argc; i++)
+ {
+ if (i==0 || LastArgv + 1 == argv[i])
+ LastArgv = argv[i] + strlen(argv[i]);
+ else
+ continue;
+ }
+ for (i=0; envp[i] != NULL; i++)
+ {
+ if (LastArgv + 1 == envp[i])
+ LastArgv = envp[i] + strlen(envp[i]);
+ else
+ continue;
+ }
}
#if SPT_TYPE != SPT_BUILTIN
@@ -2720,6 +2691,23 @@ initgroups(name, basegid)
#endif
/*
+** SETGROUPS -- set group list
+**
+** Stub implementation for systems that don't have group lists
+*/
+
+#ifndef NGROUPS_MAX
+
+int
+setgroups(ngroups, grouplist)
+ int ngroups;
+ GIDSET_T grouplist[];
+{
+ return 0;
+}
+
+#endif
+ /*
** SETSID -- set session id (for non-POSIX systems)
*/
@@ -2918,333 +2906,6 @@ vsprintf(s, fmt, ap)
#endif
/*
-** SNPRINTF, VSNPRINT -- counted versions of printf
-**
-** These versions have been grabbed off the net. They have been
-** cleaned up to compile properly and support for .precision and
-** %lx has been added.
-*/
-
-/**************************************************************
- * Original:
- * Patrick Powell Tue Apr 11 09:48:21 PDT 1995
- * A bombproof version of doprnt (sm_dopr) included.
- * Sigh. This sort of thing is always nasty do deal with. Note that
- * the version here does not include floating point...
- *
- * snprintf() is used instead of sprintf() as it does limit checks
- * for string length. This covers a nasty loophole.
- *
- * The other functions are there to prevent NULL pointers from
- * causing nast effects.
- **************************************************************/
-
-/*static char _id[] = "$Id: conf.c,v 1.9 1997/11/09 04:05:36 gene Exp $";*/
-static void sm_dopr();
-static char *DoprEnd;
-static int SnprfOverflow;
-
-#if !HASSNPRINTF
-
-/* VARARGS3 */
-int
-# ifdef __STDC__
-snprintf(char *str, size_t count, const char *fmt, ...)
-# else
-snprintf(str, count, fmt, va_alist)
- char *str;
- size_t count;
- const char *fmt;
- va_dcl
-#endif
-{
- int len;
- VA_LOCAL_DECL
-
- VA_START(fmt);
- len = vsnprintf(str, count, fmt, ap);
- VA_END;
- return len;
-}
-
-
-# ifndef luna2
-int
-vsnprintf(str, count, fmt, args)
- char *str;
- size_t count;
- const char *fmt;
- va_list args;
-{
- str[0] = 0;
- DoprEnd = str + count - 1;
- SnprfOverflow = 0;
- sm_dopr( str, fmt, args );
- if (count > 0)
- DoprEnd[0] = 0;
- if (SnprfOverflow && tTd(57, 2))
- printf("\nvsnprintf overflow, len = %d, str = %s",
- count, shortenstring(str, 203));
- return strlen(str);
-}
-
-# endif /* !luna2 */
-#endif /* !HASSNPRINTF */
-
-/*
- * sm_dopr(): poor man's version of doprintf
- */
-
-static void fmtstr __P((char *value, int ljust, int len, int zpad, int maxwidth));
-static void fmtnum __P((long value, int base, int dosign, int ljust, int len, int zpad));
-static void dostr __P(( char * , int ));
-static char *output;
-static void dopr_outch __P(( int c ));
-static int SyslogErrno;
-
-static void
-sm_dopr( buffer, format, args )
- char *buffer;
- const char *format;
- va_list args;
-{
- int ch;
- long value;
- int longflag = 0;
- int pointflag = 0;
- int maxwidth = 0;
- char *strvalue;
- int ljust;
- int len;
- int zpad;
-# if !HASSTRERROR && !defined(ERRLIST_PREDEFINED)
- extern char *sys_errlist[];
- extern int sys_nerr;
-# endif
-
-
- output = buffer;
- while( (ch = *format++) ){
- switch( ch ){
- case '%':
- ljust = len = zpad = maxwidth = 0;
- longflag = pointflag = 0;
- nextch:
- ch = *format++;
- switch( ch ){
- case 0:
- dostr( "**end of format**" , 0);
- return;
- case '-': ljust = 1; goto nextch;
- case '0': /* set zero padding if len not set */
- if(len==0 && !pointflag) zpad = '0';
- case '1': case '2': case '3':
- case '4': case '5': case '6':
- case '7': case '8': case '9':
- if (pointflag)
- maxwidth = maxwidth*10 + ch - '0';
- else
- len = len*10 + ch - '0';
- goto nextch;
- case '*':
- if (pointflag)
- maxwidth = va_arg( args, int );
- else
- len = va_arg( args, int );
- goto nextch;
- case '.': pointflag = 1; goto nextch;
- case 'l': longflag = 1; goto nextch;
- case 'u': case 'U':
- /*fmtnum(value,base,dosign,ljust,len,zpad) */
- if( longflag ){
- value = va_arg( args, long );
- } else {
- value = va_arg( args, int );
- }
- fmtnum( value, 10,0, ljust, len, zpad ); break;
- case 'o': case 'O':
- /*fmtnum(value,base,dosign,ljust,len,zpad) */
- if( longflag ){
- value = va_arg( args, long );
- } else {
- value = va_arg( args, int );
- }
- fmtnum( value, 8,0, ljust, len, zpad ); break;
- case 'd': case 'D':
- if( longflag ){
- value = va_arg( args, long );
- } else {
- value = va_arg( args, int );
- }
- fmtnum( value, 10,1, ljust, len, zpad ); break;
- case 'x':
- if( longflag ){
- value = va_arg( args, long );
- } else {
- value = va_arg( args, int );
- }
- fmtnum( value, 16,0, ljust, len, zpad ); break;
- case 'X':
- if( longflag ){
- value = va_arg( args, long );
- } else {
- value = va_arg( args, int );
- }
- fmtnum( value,-16,0, ljust, len, zpad ); break;
- case 's':
- strvalue = va_arg( args, char *);
- if (maxwidth > 0 || !pointflag) {
- if (pointflag && len > maxwidth)
- len = maxwidth; /* Adjust padding */
- fmtstr( strvalue,ljust,len,zpad, maxwidth);
- }
- break;
- case 'c':
- ch = va_arg( args, int );
- dopr_outch( ch ); break;
- case 'm':
-#if HASSTRERROR
- dostr(strerror(SyslogErrno), 0);
-#else
- if (SyslogErrno < 0 || SyslogErrno > sys_nerr)
- {
- dostr("Error ", 0);
- fmtnum(SyslogErrno, 10, 0, 0, 0, 0);
- }
- else
- dostr(sys_errlist[SyslogErrno], 0);
-#endif
- break;
-
- case '%': dopr_outch( ch ); continue;
- default:
- dostr( "???????" , 0);
- }
- break;
- default:
- dopr_outch( ch );
- break;
- }
- }
- *output = 0;
-}
-
-static void
-fmtstr( value, ljust, len, zpad, maxwidth )
- char *value;
- int ljust, len, zpad, maxwidth;
-{
- int padlen, strlen; /* amount to pad */
-
- if( value == 0 ){
- value = "<NULL>";
- }
- for( strlen = 0; value[strlen]; ++ strlen ); /* strlen */
- if (strlen > maxwidth && maxwidth)
- strlen = maxwidth;
- padlen = len - strlen;
- if( padlen < 0 ) padlen = 0;
- if( ljust ) padlen = -padlen;
- while( padlen > 0 ) {
- dopr_outch( ' ' );
- --padlen;
- }
- dostr( value, maxwidth );
- while( padlen < 0 ) {
- dopr_outch( ' ' );
- ++padlen;
- }
-}
-
-static void
-fmtnum( value, base, dosign, ljust, len, zpad )
- long value;
- int base, dosign, ljust, len, zpad;
-{
- int signvalue = 0;
- unsigned long uvalue;
- char convert[20];
- int place = 0;
- int padlen = 0; /* amount to pad */
- int caps = 0;
-
- /* DEBUGP(("value 0x%x, base %d, dosign %d, ljust %d, len %d, zpad %d\n",
- value, base, dosign, ljust, len, zpad )); */
- uvalue = value;
- if( dosign ){
- if( value < 0 ) {
- signvalue = '-';
- uvalue = -value;
- }
- }
- if( base < 0 ){
- caps = 1;
- base = -base;
- }
- do{
- convert[place++] =
- (caps? "0123456789ABCDEF":"0123456789abcdef")
- [uvalue % (unsigned)base ];
- uvalue = (uvalue / (unsigned)base );
- }while(uvalue);
- convert[place] = 0;
- padlen = len - place;
- if( padlen < 0 ) padlen = 0;
- if( ljust ) padlen = -padlen;
- /* DEBUGP(( "str '%s', place %d, sign %c, padlen %d\n",
- convert,place,signvalue,padlen)); */
- if( zpad && padlen > 0 ){
- if( signvalue ){
- dopr_outch( signvalue );
- --padlen;
- signvalue = 0;
- }
- while( padlen > 0 ){
- dopr_outch( zpad );
- --padlen;
- }
- }
- while( padlen > 0 ) {
- dopr_outch( ' ' );
- --padlen;
- }
- if( signvalue ) dopr_outch( signvalue );
- while( place > 0 ) dopr_outch( convert[--place] );
- while( padlen < 0 ){
- dopr_outch( ' ' );
- ++padlen;
- }
-}
-
-static void
-dostr( str , cut)
- char *str;
- int cut;
-{
- if (cut) {
- while(*str && cut-- > 0) dopr_outch(*str++);
- } else {
- while(*str) dopr_outch(*str++);
- }
-}
-
-static void
-dopr_outch( c )
- int c;
-{
-#if 0
- if( iscntrl(c) && c != '\n' && c != '\t' ){
- c = '@' + (c & 0x1F);
- if( DoprEnd == 0 || output < DoprEnd )
- *output++ = '^';
- }
-#endif
- if( DoprEnd == 0 || output < DoprEnd )
- *output++ = c;
- else
- SnprfOverflow++;
-}
- /*
** USERSHELLOK -- tell if a user's shell is ok for unrestricted use
**
** Parameters:
@@ -3264,6 +2925,9 @@ dopr_outch( c )
# if defined(_AIX3) || defined(_AIX4)
# include <userconf.h>
+# if _AIX4 >= 40200
+# include <userpw.h>
+# endif
# include <usersec.h>
# endif
@@ -3302,6 +2966,15 @@ char *DefaultUserShells[] =
"/bin/ksh", /* Korn shell */
"/usr/bin/ksh",
#endif
+#ifdef sgi
+ "/sbin/sh", /* SGI's shells really live in /sbin */
+ "/sbin/csh",
+ "/bin/ksh", /* Korn shell */
+ "/sbin/ksh",
+ "/usr/bin/ksh",
+ "/bin/tcsh", /* Extended csh */
+ "/usr/bin/tcsh",
+#endif
NULL
};
@@ -3335,7 +3008,8 @@ usershellok(user, shell)
register FILE *shellf;
char buf[MAXLINE];
- if (shell == NULL || shell[0] == '\0' || wordinclass(user, 't'))
+ if (shell == NULL || shell[0] == '\0' || wordinclass(user, 't') ||
+ ConfigLevel <= 1)
return TRUE;
# if USEGETCONFATTR
@@ -3369,6 +3043,11 @@ usershellok(user, shell)
{
/* no /etc/shells; see if it is one of the std shells */
char **d;
+
+ if (errno != ENOENT && LogLevel > 3)
+ sm_syslog(LOG_ERR, NOQID,
+ "usershellok: cannot open %s: %s",
+ _PATH_SHELLS, errstring(errno));
for (d = DefaultUserShells; *d != NULL; d++)
{
@@ -3388,7 +3067,7 @@ usershellok(user, shell)
if (*p == '#' || *p == '\0')
continue;
q = p;
- while (*p != '\0' && *p != '#' && !isspace(*p))
+ while (*p != '\0' && *p != '#' && !(isascii(*p) && isspace(*p)))
p++;
*p = '\0';
if (strcmp(shell, q) == 0 || strcmp(WILDCARD_SHELL, q) == 0)
@@ -3500,8 +3179,10 @@ freediskspace(dir, bsize)
*bsize = FSBLOCKSIZE;
if (fs.SFS_BAVAIL <= 0)
return 0;
+ else if (fs.SFS_BAVAIL > LONG_MAX)
+ return LONG_MAX;
else
- return fs.SFS_BAVAIL;
+ return (long) fs.SFS_BAVAIL;
}
#endif
return (-1);
@@ -3689,6 +3370,7 @@ lockfile(fd, filename, ext, type)
int type;
{
int i;
+ int save_errno;
# if !HASFLOCK
int action;
struct flock lfd;
@@ -3721,9 +3403,10 @@ lockfile(fd, filename, ext, type)
printf("SUCCESS\n");
return TRUE;
}
+ save_errno = errno;
if (tTd(55, 60))
- printf("(%s) ", errstring(errno));
+ printf("(%s) ", errstring(save_errno));
/*
** On SunOS, if you are testing using -oQ/tmp/mqueue or
@@ -3734,21 +3417,19 @@ lockfile(fd, filename, ext, type)
** that this indicates that the lock is successfully grabbed.
*/
- if (errno == EINVAL)
+ if (save_errno == EINVAL)
{
if (tTd(55, 60))
printf("SUCCESS\n");
return TRUE;
}
- if (!bitset(LOCK_NB, type) || (errno != EACCES && errno != EAGAIN))
+ if (!bitset(LOCK_NB, type) || (save_errno != EACCES && save_errno != EAGAIN))
{
int omode = -1;
# ifdef F_GETFL
- int oerrno = errno;
-
(void) fcntl(fd, F_GETFL, &omode);
- errno = oerrno;
+ errno = save_errno;
# endif
syserr("cannot lockf(%s%s, fd=%d, type=%o, omode=%o, euid=%d)",
filename, ext, fd, type, omode, geteuid());
@@ -3769,18 +3450,17 @@ lockfile(fd, filename, ext, type)
printf("SUCCESS\n");
return TRUE;
}
+ save_errno = errno;
if (tTd(55, 60))
- printf("(%s) ", errstring(errno));
+ printf("(%s) ", errstring(save_errno));
- if (!bitset(LOCK_NB, type) || errno != EWOULDBLOCK)
+ if (!bitset(LOCK_NB, type) || save_errno != EWOULDBLOCK)
{
int omode = -1;
# ifdef F_GETFL
- int oerrno = errno;
-
(void) fcntl(fd, F_GETFL, &omode);
- errno = oerrno;
+ errno = save_errno;
# endif
syserr("cannot flock(%s%s, fd=%d, type=%o, omode=%o, euid=%d)",
filename, ext, fd, type, omode, geteuid());
@@ -3789,6 +3469,7 @@ lockfile(fd, filename, ext, type)
# endif
if (tTd(55, 60))
printf("FAIL\n");
+ errno = save_errno;
return FALSE;
}
/*
@@ -3858,7 +3539,7 @@ chownsafe(fd, safedir)
int rval;
/* give the system administrator a chance to override */
- if (ChownAlwaysSafe)
+ if (bitset(DBS_ASSUMESAFECHOWN, DontBlameSendmail))
return TRUE;
/*
@@ -3875,7 +3556,7 @@ chownsafe(fd, safedir)
return safedir && errno == 0 && rval IS_SAFE_CHOWN;
# endif
#else
- return ChownAlwaysSafe;
+ return bitset(DBS_ASSUMESAFECHOWN, DontBlameSendmail);
#endif
}
/*
@@ -3935,7 +3616,7 @@ getcfname()
return ConfFile;
#if NETINFO
{
- extern char *ni_propval();
+ extern char *ni_propval __P((char *, char *, char *, char *, int));
char *cflocation;
cflocation = ni_propval("/locations", NULL, "sendmail",
@@ -4026,6 +3707,13 @@ void
vendor_post_defaults(e)
ENVELOPE *e;
{
+#ifdef __QNX__
+ char *p;
+
+ /* Makes sure the SOCK environment variable remains */
+ if (p = getextenv("SOCK"))
+ setuserenv("SOCK", p);
+#endif
#if defined(SUN_EXTENSIONS) && defined(SUN_DEFAULT_VALUES)
sun_post_defaults(e);
#endif
@@ -4087,8 +3775,8 @@ vendor_set_uid(uid)
** e -- the current envelope.
**
** Returns:
-** TRUE -- if the connection should be accepted.
-** FALSE -- if it should be rejected.
+** error message from rejection.
+** NULL if not rejected.
*/
#if TCPWRAPPERS
@@ -4100,38 +3788,62 @@ int deny_severity = LOG_NOTICE;
#endif
#if DAEMON
-bool
+char *
validate_connection(sap, hostname, e)
SOCKADDR *sap;
char *hostname;
ENVELOPE *e;
{
+#if TCPWRAPPERS
+ char *host;
+#endif
+
if (tTd(48, 3))
printf("validate_connection(%s, %s)\n",
hostname, anynet_ntoa(sap));
if (rscheck("check_relay", hostname, anynet_ntoa(sap), e) != EX_OK)
{
+ static char reject[BUFSIZ*2];
+ extern char MsgBuf[];
+
if (tTd(48, 4))
printf(" ... validate_connection: BAD (rscheck)\n");
- return FALSE;
+
+ if (strlen(MsgBuf) > 5)
+ {
+ if (isascii(MsgBuf[0]) && isdigit(MsgBuf[0]) &&
+ isascii(MsgBuf[1]) && isdigit(MsgBuf[1]) &&
+ isascii(MsgBuf[2]) && isdigit(MsgBuf[2]))
+ strcpy(reject, &MsgBuf[4]);
+ else
+ strcpy(reject, MsgBuf);
+ }
+ else
+ strcpy(reject, "Access denied");
+
+ return reject;
}
#if TCPWRAPPERS
- if (!hosts_ctl("sendmail", hostname, anynet_ntoa(sap), STRING_UNKNOWN))
+ if (hostname[0] == '[' && hostname[strlen(hostname) - 1] == ']')
+ host = "unknown";
+ else
+ host = hostname;
+ if (!hosts_ctl("sendmail", host, anynet_ntoa(sap), STRING_UNKNOWN))
{
if (tTd(48, 4))
printf(" ... validate_connection: BAD (tcpwrappers)\n");
if (LogLevel >= 4)
sm_syslog(LOG_NOTICE, NOQID,
"tcpwrappers (%s, %s) rejection",
- hostname, anynet_ntoa(sap));
- return FALSE;
+ host, anynet_ntoa(sap));
+ return "Access denied";
}
#endif
if (tTd(48, 4))
printf(" ... validate_connection: OK\n");
- return TRUE;
+ return NULL;
}
#endif
@@ -4149,8 +3861,6 @@ validate_connection(sap, hostname, e)
static char sccsid[] = "@(#)strtol.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
-#include <limits.h>
-
/*
* Convert a string to a long integer.
*
@@ -4487,6 +4197,9 @@ struct mbuf;
# ifndef SUNOS403
# include <sys/time.h>
# endif
+# if _AIX4 >= 40300
+# undef __P
+# endif
# include <net/if.h>
#endif
@@ -4696,7 +4409,10 @@ sm_syslog(level, id, fmt, va_alist)
int seq = 1;
int idlen;
extern int SnprfOverflow;
+ extern int SyslogErrno;
+ extern char *DoprEnd;
VA_LOCAL_DECL
+ extern void sm_dopr __P((char *, const char *, ...));
SyslogErrno = errno;
if (id == NULL)
@@ -4805,7 +4521,7 @@ bufalloc:
** syslog succeeds during interrupt handlers.
*/
-#ifdef __hpux
+#if defined(__hpux) && !defined(HPUX11)
# define MAXSYSLOGTRIES 100
# undef syslog
@@ -4879,15 +4595,18 @@ local_hostname_length(hostname)
char *CompileOptions[] =
{
-#if HESIOD
+#ifdef HESIOD
"HESIOD",
#endif
#if HES_GETMAILHOST
"HES_GETMAILHOST",
#endif
-#if LDAPMAP
+#ifdef LDAPMAP
"LDAPMAP",
#endif
+#ifdef MAP_REGEX
+ "MAP_REGEX",
+#endif
#if LOG
"LOG",
#endif
@@ -4903,7 +4622,7 @@ char *CompileOptions[] =
#if NAMED_BIND
"NAMED_BIND",
#endif
-#if NDBM
+#ifdef NDBM
"NDBM",
#endif
#if NETINET
@@ -4924,13 +4643,13 @@ char *CompileOptions[] =
#if NETX25
"NETX25",
#endif
-#if NEWDB
+#ifdef NEWDB
"NEWDB",
#endif
-#if NIS
+#ifdef NIS
"NIS",
#endif
-#if NISPLUS
+#ifdef NISPLUS
"NISPLUS",
#endif
#if QUEUE
@@ -4945,7 +4664,7 @@ char *CompileOptions[] =
#if SMTPDEBUG
"SMTPDEBUG",
#endif
-#if SUID_ROOT_FILES_OK
+#ifdef SUID_ROOT_FILES_OK
"SUID_ROOT_FILES_OK",
#endif
#if TCPWRAPPERS
@@ -4957,7 +4676,7 @@ char *CompileOptions[] =
#if XDEBUG
"XDEBUG",
#endif
-#if XLA
+#ifdef XLA
"XLA",
#endif
NULL
diff --git a/usr.sbin/sendmail/src/conf.h b/usr.sbin/sendmail/src/conf.h
index de37c145b78..fd14d5aaf43 100644
--- a/usr.sbin/sendmail/src/conf.h
+++ b/usr.sbin/sendmail/src/conf.h
@@ -1,37 +1,15 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*
- * @(#)conf.h 8.335 (Berkeley) 10/24/97
+ * @(#)conf.h 8.372 (Berkeley) 6/4/98
*/
/*
@@ -48,7 +26,10 @@ struct rusage; /* forward declaration to get gcc to shut up in wait.h */
# include <sys/param.h>
# include <sys/types.h>
# include <sys/stat.h>
+#ifndef __QNX__
+/* in QNX this grabs bogus LOCK_* manifests */
# include <sys/file.h>
+#endif
# include <sys/wait.h>
# include <limits.h>
# include <fcntl.h>
@@ -80,6 +61,9 @@ struct rusage; /* forward declaration to get gcc to shut up in wait.h */
# define MAXMIMENESTING 20 /* max MIME multipart nesting */
# define QUEUESEGSIZE 1000 /* increment for queue size */
# define MAXQFNAME 20 /* max qf file name length */
+# define MACBUFSIZE 4096 /* max expanded macro buffer size */
+# define TOBUFSIZE 512 /* max buffer to hold address list */
+# define MAXSHORTSTR 203 /* max short string length */
/**********************************************************************
** Compilation options.
@@ -167,11 +151,12 @@ struct rusage; /* forward declaration to get gcc to shut up in wait.h */
** HP-UX -- tested for 8.07, 9.00, and 9.01.
**
** If V4FS is defined, compile for HP-UX 10.0.
+** 11.x support from Richard Allen <ra@hp.is>.
*/
#ifdef __hpux
/* common definitions for HP-UX 9.x and 10.x */
-# undef m_flags /* conflict between db.h & sys/sysmacros.h on HP 300 */
+# undef m_flags /* conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h on HP 300 */
# define SYSTEM5 1 /* include all the System V defines */
# define HASINITGROUPS 1 /* has initgroups(3) call */
# define HASFCHMOD 1 /* has fchmod(2) syscall */
@@ -186,7 +171,9 @@ struct rusage; /* forward declaration to get gcc to shut up in wait.h */
# ifndef HASGETUSERSHELL
# define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */
# endif
-# define syslog hard_syslog
+# ifndef HPUX11
+# define syslog hard_syslog
+# endif
# define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */
# ifdef V4FS
@@ -213,6 +200,8 @@ struct rusage; /* forward declaration to get gcc to shut up in wait.h */
# endif
# ifdef __STDC__
extern void hard_syslog(int, char *, ...);
+# else
+extern void hard_syslog();
# endif
# define FDSET_CAST (int *) /* cast for fd_set parameters to select */
# endif
@@ -228,10 +217,18 @@ extern void hard_syslog(int, char *, ...);
# define _AIX3 1 /* pull in AIX3 stuff */
# define USESETEUID 1 /* seteuid(2) works */
# define TZ_TYPE TZ_NAME /* use tzname[] vector */
-# define SOCKADDR_LEN_T size_t /* e.g., arg#3 to accept, getsockname */
# define SOCKOPT_LEN_T size_t /* arg#5 to getsockopt */
# if _AIX4 >= 40200
# define HASSETREUID 1 /* setreuid(2) works as of AIX 4.2 */
+# define SOCKADDR_LEN_T size_t /* e.g., arg#3 to accept, getsockname */
+# endif
+# if defined(_ILS_MACROS) /* IBM versions aren't side-effect clean */
+# undef isascii
+# define isascii(c) !(c & ~0177)
+# undef isdigit
+# define isdigit(__a) (_IS(__a,_ISDIGIT))
+# undef isspace
+# define isspace(__a) (_IS(__a,_ISSPACE))
# endif
#endif
@@ -348,6 +345,8 @@ typedef int pid_t;
# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
# define SFS_BAVAIL f_bfree /* alternate field name */
# ifdef IRIX6
+# define STAT64 1
+# define QUAD_T unsigned long long
# define LA_TYPE LA_IRIX6 /* figure out at run time */
# define SAFENFSPATHCONF 0 /* pathconf(2) lies on NFS filesystems */
# define SYSLOG_BUFSIZE 512
@@ -355,17 +354,21 @@ typedef int pid_t;
# define LA_TYPE LA_INT
# ifdef IRIX64
+# define STAT64 1
+# define QUAD_T unsigned long long
# define NAMELISTMASK 0x7fffffffffffffff /* mask for nlist() values */
# else
+# define STAT64 0
# define NAMELISTMASK 0x7fffffff /* mask for nlist() values */
# endif
# endif
-# if defined(IRIX64) || defined(IRIX5)
+# if defined(IRIX64) || defined(IRIX5) || defined(IRIX6)
# include <sys/cdefs.h>
# include <paths.h>
# define ARGV_T char *const *
# define HASSETRLIMIT 1 /* has setrlimit(2) syscall */
# define HASGETDTABLESIZE 1 /* has getdtablesize(2) syscall */
+# define HASSTRERROR 1 /* has strerror(3) */
# else
# define ARGV_T const char **
# define WAITUNION 1 /* use "union wait" as wait argument type */
@@ -427,15 +430,23 @@ typedef int pid_t;
# endif
# if SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205)
# define HASSETREUID 1 /* setreuid works as of 2.5 */
-# ifndef LA_TYPE
-# define LA_TYPE LA_KSTAT /* use kstat(3k) -- may work in < 2.5 */
+# if SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700)
+# ifndef LA_TYPE
+# define LA_TYPE LA_KSTAT /* use kstat(3k) -- may work in < 2.5 */
+# endif
# endif
# endif
# if SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206)
# define HASSNPRINTF 1 /* has snprintf starting in 2.6 */
# endif
+# if SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207)
+# ifndef LA_TYPE
+# define LA_TYPE LA_SUBR /* getloadavg(3c) appears in 2.7 */
+# endif
+# define HASGETUSERSHELL 1 /* getusershell(3c) bug fixed in 2.7 */
+# endif
# ifndef HASGETUSERSHELL
-# define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */
+# define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps pre-2.7 */
# endif
# else
@@ -449,6 +460,9 @@ typedef int pid_t;
# define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */
# include <memory.h>
# include <vfork.h>
+# ifdef __GNUC__
+# define strtoul strtol /* gcc library bogosity */
+# endif
# ifdef SUNOS403
/* special tweaking for SunOS 4.0.3 */
@@ -603,13 +617,16 @@ extern long dgux_inet_addr();
# define HASFLOCK 1 /* has flock(2) call */
# endif
# define LA_TYPE LA_ALPHAOSF
-# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
+# define SFS_TYPE SFS_STATVFS /* use <sys/statvfs.h> statfs() impl */
# ifndef _PATH_VENDOR_CF
# define _PATH_VENDOR_CF "/var/adm/sendmail/sendmail.cf"
# endif
# ifndef _PATH_SENDMAILPID
# define _PATH_SENDMAILPID "/var/run/sendmail.pid"
# endif
+# define bcopy(s, d, l) (memmove((d), (s), (l)))
+# define bzero(d, l) (memset((d), '\0', (l)))
+# define bcmp(s, d, l) (memcmp((s), (d), (l)))
#endif
@@ -675,6 +692,7 @@ typedef int pid_t;
# include <sys/cdefs.h>
# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
# define BSD4_4_SOCKADDR /* has sa_len */
+# define NEED_PRINTF_PERCENTQ 1 /* doesn't have %lld */
# define NETLINK 1 /* supports AF_LINK */
# ifndef LA_TYPE
# define LA_TYPE LA_SUBR
@@ -708,20 +726,56 @@ typedef int pid_t;
# define LA_TYPE LA_SUBR
# endif
# define GIDSET_T gid_t
+# define QUAD_T quad_t
# if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
/* version 1.1 or later */
# undef SPT_TYPE
# define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */
# else
/* version 1.0 or earlier */
-# ifndef OLD_NEWDB
-# define OLD_NEWDB 1 /* old version of newdb library */
-# endif
# define SPT_PADCHAR '\0' /* pad process title with nulls */
# endif
+# if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 /* on 3.x */
+# define HASSETUSERCONTEXT 1 /* has setusercontext */
+# endif
#endif
+/*
+** QNX 4.2x
+** Contributed by Glen McCready <glen@qnx.com>.
+**
+** Should work with all versions of QNX.
+*/
+
+#if defined(__QNX__)
+# include <unix.h>
+# include <sys/select.h>
+# undef NGROUPS_MAX
+# define HASSETSID 1 /* has the setsid(2) POSIX syscall */
+# define USESETEUID 1 /* has useable seteuid(2) call */
+# define HASFCHMOD 1 /* has fchmod(2) syscall */
+# define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */
+# define HASSETREUID 1 /* has setreuid(2) call */
+# define HASSTRERROR 1 /* has strerror(3) */
+# define HASFLOCK 0
+# undef HASINITGROUPS /* has initgroups(3) call */
+# define NEEDGETOPT 1 /* use sendmail's getopt */
+# define IP_SRCROUTE 1 /* can check IP source routing */
+# define TZ_TYPE TZ_TMNAME /* use tmname variable */
+# define GIDSET_T gid_t
+# define LA_TYPE LA_ZERO
+# define SFS_TYPE SFS_NONE
+# define SPT_TYPE SPT_REUSEARGV
+# define SPT_PADCHAR '\0' /* pad process title with nulls */
+# define HASGETUSERSHELL 0
+# define E_PSEUDOBASE 512
+# define bcopy(s, d, l) (memmove((d), (s), (l)))
+# define bzero(d, l) (memset((d), '\0', (l)))
+# define bcmp(s, d, l) (memcmp((s), (d), (l)))
+# define _FILE_H_INCLUDED
+#endif
+
/*
** FreeBSD / NetBSD / OpenBSD (all architectures, all versions)
@@ -742,12 +796,14 @@ typedef int pid_t;
# define HASUNAME 1 /* has uname(2) syscall */
# define HASSTRERROR 1 /* has strerror(3) */
# define HAS_ST_GEN 1 /* has st_gen field in stat struct */
+# define NEED_PRINTF_PERCENTQ 1 /* doesn't have %lld */
# include <sys/cdefs.h>
# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
# define BSD4_4_SOCKADDR /* has sa_len */
# define NETLINK 1 /* supports AF_LINK */
# define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */
# define GIDSET_T gid_t
+# define QUAD_T unsigned long long
# ifndef LA_TYPE
# define LA_TYPE LA_SUBR
# endif
@@ -905,7 +961,6 @@ extern int errno;
/* SCO OpenServer 5 */
#if _SCO_DS >= 1
# include <paths.h>
-# define _SCO_unix_4_2
# define SIOCGIFNUM_IS_BROKEN 1 /* SIOCGIFNUM returns bogus value */
# define HASSNPRINTF 1 /* has snprintf(3) call */
# define HASFCHMOD 1 /* has fchmod(2) call */
@@ -918,8 +973,12 @@ extern int errno;
# define LA_TYPE LA_DEVSHORT
# endif
# define _PATH_AVENRUN "/dev/table/avenrun"
-# define SOCKADDR_LEN_T size_t /* e.g., arg#3 to accept, getsockname */
-# define SOCKOPT_LEN_T size_t /* arg#5 to getsockopt */
+# ifndef _SCO_unix_4_2
+# define _SCO_unix_4_2
+# else
+# define SOCKADDR_LEN_T size_t /* e.g., arg#3 to accept, getsockname */
+# define SOCKOPT_LEN_T size_t /* arg#5 to getsockopt */
+# endif
#endif
/* SCO UNIX 3.2v4.2/Open Desktop 3.0 */
@@ -1557,11 +1616,16 @@ typedef int pid_t;
# define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */
# endif
-/* avoid m_flags conflict between db.h & sys/sysmacros.h on HIUX 3050 */
+/*
+** avoid m_flags conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h
+** on HIUX 3050
+*/
# undef m_flags
# ifdef __STDC__
extern int syslog(int, char *, ...);
+#else
+extern int syslog();
# endif
#endif
@@ -1775,7 +1839,7 @@ extern int errno;
/*
** Pyramid DC/OSx
**
-** From Earle Ake <akee@wpdis01.wpafb.af.mil>.
+** From Earle Ake <akee@wpdiss1.wpafb.af.mil>.
*/
#ifdef DCOSx
@@ -1848,10 +1912,20 @@ typedef struct msgb mblk_t;
** Contributed by Gerald Rinske <Gerald.Rinske@mch.sni.de>
** of Siemens Business Services VAS.
*/
-#ifdef _sinix_
+#ifdef sinix
# define SYSLOG_BUFSIZE 1024
#endif
+/*
+** CRAY T3E
+**
+** Contributed by Manu Mahonen <mailadm@csc.fi>
+** of Center for Scientific Computing.
+*/
+#ifdef _CRAY
+# define GET_IPOPT_DST(dst) *(struct in_addr *)&(dst)
+#endif
+
/**********************************************************************
** End of Per-Operating System defines
**********************************************************************/
@@ -1947,6 +2021,11 @@ typedef struct msgb mblk_t;
# if _POSIX_VERSION >= 199500 && !defined(USESETEUID)
# define USESETEUID 1 /* has useable seteuid(2) call */
# endif
+# ifndef bcopy
+# define bcopy(s, d, l) (memmove((d), (s), (l)))
+# define bzero(d, l) (memset((d), '\0', (l)))
+# define bcmp(s, d, l) (memcmp((s), (d), (l)))
+# endif
#endif
/*
** Tweaking for systems that (for example) claim to be BSD or POSIX
@@ -1971,6 +2050,10 @@ typedef struct msgb mblk_t;
# undef bcmp /* despite SystemV claim, uses BSD bcmp */
#endif
+#if defined(sun) && !defined(BSD) && !defined(SOLARIS) && !defined(__svr4__) && !defined(__SVR4)
+# undef bcopy /* SunOS 4 doesn't have memmove() */
+#endif
+
/*
** Due to a "feature" in some operating systems such as Ultrix 4.3 and
@@ -2023,10 +2106,6 @@ typedef struct msgb mblk_t;
# define HASULIMIT 0 /* assume no ulimit(2) support */
#endif
-#ifndef OLD_NEWDB
-# define OLD_NEWDB 0 /* assume newer version of newdb */
-#endif
-
#ifndef SECUREWARE
# define SECUREWARE 0 /* assume no SecureWare C2 auditing hooks */
#endif
@@ -2076,6 +2155,10 @@ typedef struct msgb mblk_t;
#ifndef SOCKOPT_LEN_T
# define SOCKOPT_LEN_T int
#endif
+
+#ifndef QUAD_T
+# define QUAD_T unsigned long
+#endif
/**********************************************************************
** Remaining definitions should never have to be changed. They are
** primarily to provide back compatibility for older systems -- for
@@ -2165,7 +2248,11 @@ typedef struct msgb mblk_t;
# include "cdefs.h"
#endif
-#if NAMED_BIND && !defined(__ksr__)
+#if HESIOD && !defined(NAMED_BIND)
+# define NAMED_BIND 1 /* not one without the other */
+#endif
+
+#if NAMED_BIND && !defined(__ksr__) && !defined(h_errno)
extern int h_errno;
#endif
@@ -2248,6 +2335,18 @@ struct utsname
# define LOCK_UN 0x08 /* unlock */
#endif
+#ifndef S_IXOTH
+# define S_IXOTH (S_IEXEC >> 6)
+#endif
+
+#ifndef S_IXGRP
+# define S_IXGRP (S_IEXEC >> 3)
+#endif
+
+#ifndef S_IXUSR
+# define S_IXUSR (S_IEXEC)
+#endif
+
#ifndef SEEK_SET
# define SEEK_SET 0
# define SEEK_CUR 1
@@ -2281,26 +2380,6 @@ typedef void (*sigfunc_t) __P((int));
#endif
/*
-** Size of tobuf (deliver.c)
-** Tweak this to match your syslog implementation. It will have to
-** allow for the extra information printed.
-*/
-
-#ifndef TOBUFSIZE
-# if (SYSLOG_BUFSIZE) > 768
-# define TOBUFSIZE (SYSLOG_BUFSIZE - 512)
-# else
-# define TOBUFSIZE (SYSLOG_BUFSIZE / 2)
-# endif
-#endif
-
-/* TOBUFSIZE must never be permitted to exceed MAXLINE - 128 */
-#if TOBUFSIZE > (MAXLINE - 128)
-# undef TOBUFSIZE
-# define TOBUFSIZE (MAXLINE - 128)
-#endif
-
-/*
** Size of prescan buffer.
** Despite comments in the _sendmail_ book, this probably should
** not be changed; there are some hard-to-define dependencies.
diff --git a/usr.sbin/sendmail/src/convtime.c b/usr.sbin/sendmail/src/convtime.c
index 5ca1b39149e..02c287b1372 100644
--- a/usr.sbin/sendmail/src/convtime.c
+++ b/usr.sbin/sendmail/src/convtime.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)convtime.c 8.9 (Berkeley) 2/1/97";
+static char sccsid[] = "@(#)convtime.c 8.14 (Berkeley) 5/19/98";
#endif /* not lint */
# include "sendmail.h"
diff --git a/usr.sbin/sendmail/src/daemon.c b/usr.sbin/sendmail/src/daemon.c
index e62aaf147d5..dc0b5b5bd2d 100644
--- a/usr.sbin/sendmail/src/daemon.c
+++ b/usr.sbin/sendmail/src/daemon.c
@@ -1,35 +1,13 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#include <errno.h>
@@ -37,9 +15,9 @@
#ifndef lint
#ifdef DAEMON
-static char sccsid[] = "@(#)daemon.c 8.195 (Berkeley) 10/23/97 (with daemon mode)";
+static char sccsid[] = "@(#)daemon.c 8.220 (Berkeley) 6/24/98 (with daemon mode)";
#else
-static char sccsid[] = "@(#)daemon.c 8.195 (Berkeley) 10/23/97 (without daemon mode)";
+static char sccsid[] = "@(#)daemon.c 8.220 (Berkeley) 6/24/98 (without daemon mode)";
#endif
#endif /* not lint */
@@ -132,7 +110,7 @@ getrequests(e)
#if XDEBUG
bool j_has_dot;
#endif
- extern void reapchild();
+ extern void reapchild __P((int));
extern int opendaemonsocket __P((bool));
/*
@@ -232,7 +210,7 @@ getrequests(e)
auto SOCKADDR_LEN_T lotherend;
int savederrno;
int pipefd[2];
- extern bool refuseconnections();
+ extern bool refuseconnections __P((int));
/* see if we are rejecting connections */
(void) blocksignal(SIGALRM);
@@ -424,7 +402,7 @@ getrequests(e)
(outchannel = fdopen(t, "w")) == NULL)
{
syserr("cannot open SMTP server channel, fd=%d", t);
- exit(0);
+ exit(EX_OK);
}
InChannel = inchannel;
@@ -438,7 +416,7 @@ getrequests(e)
if (!xla_host_ok(RealHostName))
{
message("421 Too many SMTP sessions for this host");
- exit(0);
+ exit(EX_OK);
}
#endif
@@ -814,7 +792,9 @@ makeconnection(host, port, mci, e)
if (host[0] == '[')
{
- long hid;
+#if NETINET
+ unsigned long hid = INADDR_NONE;
+#endif
register char *p = strchr(host, ']');
if (p != NULL)
@@ -908,6 +888,13 @@ gothostent:
#endif
default:
+ if (hp->h_length > sizeof addr.sa.sa_data)
+ {
+ syserr("makeconnection: long sa_data: family %d len %d",
+ hp->h_addrtype, hp->h_length);
+ mci_setstat(mci, EX_NOHOST, "5.1.2", NULL);
+ return EX_NOHOST;
+ }
bcopy(hp->h_addr,
addr.sa.sa_data,
hp->h_length);
@@ -1038,6 +1025,12 @@ gothostent:
ev = setevent(TimeOuts.to_connect, connecttimeout, 0);
else
ev = NULL;
+
+#if _FFR_CONNECTONLYTO_OPTION
+ /* for testing */
+ if (ConnectOnlyTo != 0)
+ addr.sin.sin_addr.s_addr = ConnectOnlyTo;
+#endif
i = connect(s, (struct sockaddr *) &addr, addrlen);
sav_errno = errno;
if (ev != NULL)
@@ -1061,7 +1054,14 @@ gothostent:
/* couldn't connect.... figure out why */
(void) close(s);
- if (hp != NULL && hp->h_addr_list[addrno])
+
+ if (LogLevel >= 14)
+ sm_syslog(LOG_INFO, e->e_id,
+ "makeconnection (%s [%s]) failed: %s",
+ host, anynet_ntoa(&addr),
+ errstring(sav_errno));
+
+ if (hp != NULL && hp->h_addr_list[addrno] != NULL)
{
if (tTd(16, 1))
printf("Connect failed (%s); trying new address....\n",
@@ -1225,6 +1225,9 @@ addrcmp(hp, ha, sa)
**
** Parameters:
** fd -- the descriptor
+** may_be_forged -- an outage that is set to TRUE if the
+** forward lookup of RealHostName does not match
+** RealHostAddr; set to FALSE if they do match.
**
** Returns:
** The user@host information associated with this descriptor.
@@ -1239,8 +1242,9 @@ authtimeout()
}
char *
-getauthinfo(fd)
+getauthinfo(fd, may_be_forged)
int fd;
+ bool *may_be_forged;
{
SOCKADDR_LEN_T falen;
register char *volatile p = NULL;
@@ -1248,19 +1252,22 @@ getauthinfo(fd)
SOCKADDR_LEN_T lalen;
register struct servent *sp;
volatile int s;
- int i;
+ int i = 0;
EVENT *ev;
int nleft;
struct hostent *hp;
+ char *ostype = NULL;
char **ha;
- volatile bool may_be_forged;
char ibuf[MAXNAME + 1];
- static char hbuf[MAXNAME * 2 + 2];
+ static char hbuf[MAXNAME * 2 + 11];
+ *may_be_forged = FALSE;
falen = sizeof RealHostAddr;
- if (isatty(fd) || getpeername(fd, &RealHostAddr.sa, &falen) < 0 ||
+ if (isatty(fd) || (i = getpeername(fd, &RealHostAddr.sa, &falen)) < 0 ||
falen <= 0 || RealHostAddr.sa.sa_family == 0)
{
+ if (i < 0 && errno != ENOTSOCK)
+ return NULL;
(void) snprintf(hbuf, sizeof hbuf, "%s@localhost",
RealUserName);
if (tTd(9, 1))
@@ -1277,15 +1284,14 @@ getauthinfo(fd)
}
/* cross check RealHostName with forward DNS lookup */
- if (anynet_ntoa(&RealHostAddr)[0] == '[')
- {
- /* address is not a socket */
- may_be_forged = FALSE;
- }
- else if (RealHostName[0] == '[')
+ if (anynet_ntoa(&RealHostAddr)[0] == '[' ||
+ RealHostName[0] == '[')
{
- /* have IP address with no forward lookup */
- may_be_forged = FALSE;
+ /*
+ ** address is not a socket or have an
+ ** IP address with no forward lookup
+ */
+ *may_be_forged = FALSE;
}
else
{
@@ -1293,13 +1299,13 @@ getauthinfo(fd)
hp = sm_gethostbyname(RealHostName);
if (hp == NULL)
- may_be_forged = TRUE;
+ *may_be_forged = TRUE;
else
{
for (ha = hp->h_addr_list; *ha != NULL; ha++)
if (addrcmp(hp, *ha, &RealHostAddr) == 0)
break;
- may_be_forged = *ha == NULL;
+ *may_be_forged = *ha == NULL;
}
}
@@ -1407,22 +1413,41 @@ getauthinfo(fd)
}
/* p now points to the OSTYPE field */
+ while (isascii(*p) && isspace(*p))
+ p++;
+ ostype = p;
p = strchr(p, ':');
if (p == NULL)
{
/* malformed response */
goto noident;
}
+ else
+ {
+ char *charset;
+
+ *p = '\0';
+ charset = strchr(ostype, ',');
+ if (charset != NULL)
+ *charset = '\0';
+ }
/* 1413 says don't do this -- but it's broken otherwise */
while (isascii(*++p) && isspace(*p))
continue;
/* p now points to the authenticated name -- copy carefully */
- cleanstrcpy(hbuf, p, MAXNAME);
+ if (strncasecmp(ostype, "other", 5) == 0 &&
+ (ostype[5] == ' ' || ostype[5] == '\0'))
+ {
+ snprintf(hbuf, sizeof hbuf, "IDENT:");
+ cleanstrcpy(&hbuf[6], p, MAXNAME);
+ }
+ else
+ cleanstrcpy(hbuf, p, MAXNAME);
i = strlen(hbuf);
snprintf(&hbuf[i], sizeof hbuf - i, "@%s",
- RealHostName == NULL ? "localhost" : RealHostName);
+ RealHostName == NULL ? "localhost" : RealHostName);
goto postident;
closeident:
@@ -1538,22 +1563,24 @@ postident:
snprintf(p, SPACELEFT(hbuf, p), "]");
goto postipsr;
}
-#endif
noipsr:
+#endif
if (RealHostName != NULL && RealHostName[0] != '[')
{
p = &hbuf[strlen(hbuf)];
(void) snprintf(p, SPACELEFT(hbuf, p), " [%.100s]",
anynet_ntoa(&RealHostAddr));
}
- if (may_be_forged)
+ if (*may_be_forged)
{
p = &hbuf[strlen(hbuf)];
(void) snprintf(p, SPACELEFT(hbuf, p), " (may be forged)");
}
+#if IP_SRCROUTE
postipsr:
+#endif
if (tTd(9, 1))
printf("getauthinfo: %s\n", hbuf);
return hbuf;
@@ -1781,6 +1808,9 @@ myhostname(hostbuf, size)
**
** Parameters:
** fd -- the descriptor
+** may_be_forged -- an outage that is set to TRUE if the
+** forward lookup of RealHostName does not match
+** RealHostAddr; set to FALSE if they do match.
**
** Returns:
** The host name associated with this descriptor, if it can
@@ -1792,9 +1822,11 @@ myhostname(hostbuf, size)
*/
char *
-getauthinfo(fd)
+getauthinfo(fd, may_be_forged)
int fd;
+ bool *may_be_forged;
{
+ *may_be_forged = FALSE;
return NULL;
}
/*
@@ -1837,7 +1869,7 @@ host_map_lookup(map, name, avp, statp)
if (bitset(MF_MATCHONLY, map->map_mflags))
cp = map_rewrite(map, name, strlen(name), NULL);
else
- cp = map_rewrite(map, hp->h_name, strlen(hp->h_name), av);
+ cp = map_rewrite(map, hp->h_name, strlen(hp->h_name), avp);
return cp;
}
@@ -1865,6 +1897,10 @@ host_map_init(map, args)
map->map_app = ++p;
break;
+ case 'T':
+ map->map_tapp = ++p;
+ break;
+
case 'm':
map->map_mflags |= MF_MATCHONLY;
break;
@@ -1880,6 +1916,8 @@ host_map_init(map, args)
}
if (map->map_app != NULL)
map->map_app = newstr(map->map_app);
+ if (map->map_tapp != NULL)
+ map->map_tapp = newstr(map->map_tapp);
return TRUE;
}
/*
@@ -2015,10 +2053,13 @@ hostnamebyanyaddr(sap)
_res.retry = saveretry;
#endif /* NAMED_BIND */
- if (hp != NULL && hp->h_name[0] != '[')
+ if (hp != NULL && hp->h_name[0] != '[' &&
+ inet_addr(hp->h_name) == INADDR_NONE)
return denlstring((char *) hp->h_name, TRUE, TRUE);
+#if NETUNIX
else if (sap->sa.sa_family == AF_UNIX && sap->sunix.sun_path[0] == '\0')
return "localhost";
+#endif
else
{
/* produce a dotted quad */
diff --git a/usr.sbin/sendmail/src/deliver.c b/usr.sbin/sendmail/src/deliver.c
index 957551590fc..0e5eb072990 100644
--- a/usr.sbin/sendmail/src/deliver.c
+++ b/usr.sbin/sendmail/src/deliver.c
@@ -1,47 +1,24 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)deliver.c 8.296 (Berkeley) 10/22/97";
+static char sccsid[] = "@(#)deliver.c 8.353 (Berkeley) 6/30/98";
#endif /* not lint */
#include "sendmail.h"
#include <errno.h>
+#include <grp.h>
#if NAMED_BIND
#include <resolv.h>
-
-extern int h_errno;
#endif
#if HASSETUSERCONTEXT
@@ -83,7 +60,23 @@ sendall(e, mode)
int oldverbose = Verbose;
bool somedeliveries = FALSE, expensive = FALSE;
pid_t pid;
- extern void sendenvelope();
+ void sendenvelope __P((ENVELOPE *, int));
+
+ /*
+ ** If this message is to be discarded, don't bother sending
+ ** the message at all.
+ */
+
+ if (bitset(EF_DISCARD, e->e_flags))
+ {
+ if (tTd(13, 1))
+ printf("sendall: discarding id %s\n", e->e_id);
+ e->e_flags |= EF_CLRQUEUE;
+ if (LogLevel > 4)
+ sm_syslog(LOG_INFO, e->e_id, "discarded");
+ markstats(e, NULL, TRUE);
+ return;
+ }
/*
** If we have had global, fatal errors, don't bother sending
@@ -110,7 +103,7 @@ sendall(e, mode)
if (tTd(13, 1))
{
- extern void printenvflags();
+ extern void printenvflags __P((ENVELOPE *));
printf("\n===== SENDALL: mode %c, id %s, e_from ",
mode, e->e_id);
@@ -297,8 +290,8 @@ sendall(e, mode)
if (owner != NULL && otherowners > 0)
{
- extern HDR *copyheader();
- extern ADDRESS *copyqueue();
+ extern HDR *copyheader __P((HDR *));
+ extern ADDRESS *copyqueue __P((ADDRESS *));
extern void dup_queue_file __P((ENVELOPE *, ENVELOPE *, int));
/*
@@ -453,10 +446,12 @@ sendall(e, mode)
case SM_QUEUE:
case SM_DEFER:
+# if HASFLOCK
queueonly:
+# endif
if (e->e_nrcpts > 0)
e->e_flags |= EF_INQUEUE;
- dropenvelope(e, FALSE);
+ dropenvelope(e, splitenv != NULL);
for (ee = splitenv; ee != NULL; ee = ee->e_sibling)
{
if (ee->e_nrcpts > 0)
@@ -473,36 +468,64 @@ sendall(e, mode)
/*
** Since fcntl locking has the interesting semantic that
** the lock is owned by a process, not by an open file
- ** descriptor, we have to unlock this envelope, and
+ ** descriptor, we have to flush this to the queue, and
** then restart from scratch in the child.
*/
- unlockqueue(e);
+ {
+ /* save id for future use */
+ char *qid = e->e_id;
+
+ /* now drop the envelope in the parent */
+ e->e_flags |= EF_INQUEUE;
+ dropenvelope(e, splitenv != NULL);
+
+ /* arrange to reacquire lock after fork */
+ e->e_id = qid;
+ }
+
for (ee = splitenv; ee != NULL; ee = ee->e_sibling)
- unlockqueue(ee);
+ {
+ /* save id for future use */
+ char *qid = ee->e_id;
+
+ /* drop envelope in parent */
+ ee->e_flags |= EF_INQUEUE;
+ dropenvelope(ee, FALSE);
+
+ /* and save qid for reacquisition */
+ ee->e_id = qid;
+ }
# endif /* !HASFLOCK */
pid = fork();
if (pid < 0)
{
+# if HASFLOCK
goto queueonly;
+# else
+ e->e_id = NULL;
+ for (ee = splitenv; ee != NULL; ee = ee->e_sibling)
+ ee->e_id = NULL;
+ return;
+# endif /* HASFLOCK */
}
else if (pid > 0)
{
# if HASFLOCK
/* be sure we leave the temp files to our child */
- /* can't call unlockqueue to avoid unlink of xfp */
- if (e->e_lockfp != NULL)
- (void) xfclose(e->e_lockfp, "sendenvelope lockfp", e->e_id);
- e->e_lockfp = NULL;
-
/* close any random open files in the envelope */
closexscript(e);
if (e->e_dfp != NULL)
(void) xfclose(e->e_dfp, "sendenvelope dfp", e->e_id);
e->e_dfp = NULL;
e->e_flags &= ~EF_HAS_DF;
+
+ /* can't call unlockqueue to avoid unlink of xfp */
+ if (e->e_lockfp != NULL)
+ (void) xfclose(e->e_lockfp, "sendenvelope lockfp", e->e_id);
+ e->e_lockfp = NULL;
# endif
/* make sure the parent doesn't own the envelope */
@@ -524,7 +547,11 @@ sendall(e, mode)
/* prevent parent from waiting if there was an error */
if (pid < 0)
{
+# if HASFLOCK
e->e_flags |= EF_INQUEUE;
+# else
+ e->e_id = NULL;
+# endif /* HASFLOCK */
finis();
}
@@ -551,8 +578,13 @@ sendall(e, mode)
** Now reacquire and run the various queue files.
*/
- for (ee = splitenv; ee != NULL; ee = e->e_sibling)
+ for (ee = splitenv; ee != NULL; ee = ee->e_sibling)
+ {
+ ENVELOPE *sibling = ee->e_sibling;
+
(void) dowork(ee->e_id, FALSE, FALSE, ee);
+ ee->e_sibling = sibling;
+ }
(void) dowork(e->e_id, FALSE, FALSE, e);
finis();
# endif /* !HASFLOCK */
@@ -578,7 +610,7 @@ sendall(e, mode)
void
sendenvelope(e, mode)
register ENVELOPE *e;
- char mode;
+ int mode;
{
register ADDRESS *q;
bool didany;
@@ -830,10 +862,11 @@ deliver(e, firstto)
volatile bool clever = FALSE; /* running user smtp to this mailer */
ADDRESS *volatile tochain = NULL; /* users chain in this mailer call */
int rcode; /* response code */
+ int lmtp_rcode = EX_OK;
char *firstsig; /* signature of firstto */
pid_t pid = -1;
char *volatile curhost;
- register volatile u_short port = 0;
+ register u_short port = 0;
time_t xstart;
bool suidwarn;
bool anyok; /* at least one address was OK */
@@ -844,7 +877,7 @@ deliver(e, firstto)
char tobuf[TOBUFSIZE]; /* text line of to people */
char buf[MAXNAME + 1];
char rpathbuf[MAXNAME + 1]; /* translated return path */
- extern int checkcompat();
+ extern int checkcompat __P((ADDRESS *, ENVELOPE *));
extern void markfailure __P((ENVELOPE *, ADDRESS *, MCI *, int));
errno = 0;
@@ -878,6 +911,18 @@ deliver(e, firstto)
printopenfds(FALSE);
/*
+ ** Clear $&{client_*} macros if this is a bounce message to
+ ** prevent rejection by check_compat ruleset.
+ */
+
+ if (bitset(EF_RESPONSE, e->e_flags))
+ {
+ define(macid("{client_name}", NULL), "", e);
+ define(macid("{client_addr}", NULL), "", e);
+ define(macid("{client_port}", NULL), "", e);
+ }
+
+ /*
** Do initial argv setup.
** Insert the mailer name. Notice that $x expansion is
** NOT done on the mailer name. Then, if the mailer has
@@ -897,7 +942,7 @@ deliver(e, firstto)
p = remotename(p, m, RF_SENDERADDR|RF_CANONICAL, &rcode, e);
if (strlen(p) >= (SIZE_T) sizeof rpathbuf)
{
- p = shortenstring(p, 203);
+ p = shortenstring(p, MAXSHORTSTR);
syserr("remotename: huge return %s", p);
}
snprintf(rpathbuf, sizeof rpathbuf, "%s", p);
@@ -1028,7 +1073,10 @@ deliver(e, firstto)
if (m->m_maxsize != 0 && e->e_msgsize > m->m_maxsize)
{
e->e_flags |= EF_NO_BODY_RETN;
- to->q_status = "5.2.3";
+ if (bitnset(M_LOCALMAILER, to->q_mailer->m_flags))
+ to->q_status = "5.2.3";
+ else
+ to->q_status = "5.3.4";
usrerr("552 Message is too large; %ld bytes max", m->m_maxsize);
markfailure(e, to, NULL, EX_UNAVAILABLE);
giveresponse(EX_UNAVAILABLE, m, NULL, ctladdr, xstart, e);
@@ -1090,13 +1138,26 @@ deliver(e, firstto)
if (strcmp(m->m_mailer, "[FILE]") == 0)
{
- rcode = mailfile(user, ctladdr, SFF_CREAT, e);
+ define('u', user, e); /* to user */
+ p = to->q_home;
+ if (p == NULL && ctladdr != NULL)
+ p = ctladdr->q_home;
+ define('z', p, e); /* user's home */
+ expand(m->m_argv[1], buf, sizeof buf, e);
+ if (strlen(buf) > 0)
+ rcode = mailfile(buf, m, ctladdr, SFF_CREAT, e);
+ else
+ {
+ syserr("empty filename specification for mailer %s",
+ m->m_name);
+ rcode = EX_CONFIG;
+ }
giveresponse(rcode, m, NULL, ctladdr, xstart, e);
+ markfailure(e, to, NULL, rcode);
e->e_nsent++;
if (rcode == EX_OK)
{
to->q_flags |= QSENT;
- markstats(e, to);
if (bitnset(M_LOCALMAILER, m->m_flags) &&
bitset(QPINGONSUCCESS, to->q_flags))
{
@@ -1107,6 +1168,7 @@ deliver(e, firstto)
}
}
to->q_statdate = curtime();
+ markstats(e, to, FALSE);
continue;
}
@@ -1216,7 +1278,7 @@ deliver(e, firstto)
/* make absolutely certain 0, 1, and 2 are in use */
snprintf(wbuf, sizeof wbuf, "%s... openmailer(%s)",
- shortenstring(e->e_to, 203), m->m_name);
+ shortenstring(e->e_to, MAXSHORTSTR), m->m_name);
checkfd012(wbuf);
}
#endif
@@ -1293,7 +1355,6 @@ deliver(e, firstto)
tryhost:
while (*curhost != '\0')
{
- register char *p;
static char hostbuf[MAXNAME + 1];
extern int makeconnection __P((char *, u_short, MCI *, ENVELOPE *));
@@ -1406,6 +1467,24 @@ tryhost:
{
/* flush any expired connections */
(void) mci_scan(NULL);
+ mci = NULL;
+
+#if SMTP
+ if (bitnset(M_LMTP, m->m_flags))
+ {
+ /* try to get a cached connection */
+ mci = mci_get(m->m_name, m);
+ if (mci->mci_host == NULL)
+ mci->mci_host = m->m_name;
+ CurHostName = mci->mci_host;
+ if (mci->mci_state != MCIS_CLOSED)
+ {
+ message("Using cached LMTP connection for %s...",
+ m->m_name);
+ goto do_transfer;
+ }
+ }
+#endif
/* announce the connection to verbose listeners */
if (host == NULL || host[0] == '\0')
@@ -1430,7 +1509,7 @@ tryhost:
if (pipe(mpvect) < 0)
{
syserr("%s... openmailer(%s): pipe (to mailer)",
- shortenstring(e->e_to, 203), m->m_name);
+ shortenstring(e->e_to, MAXSHORTSTR), m->m_name);
if (tTd(11, 1))
printf("openmailer: NULL\n");
rcode = EX_OSERR;
@@ -1442,7 +1521,7 @@ tryhost:
if (mpvect[0] < 3 || mpvect[1] < 3)
{
syserr("%s... openmailer(%s): bogus mpvect %d %d",
- shortenstring(e->e_to, 203), m->m_name,
+ shortenstring(e->e_to, MAXSHORTSTR), m->m_name,
mpvect[0], mpvect[1]);
printopenfds(TRUE);
if (tTd(11, 1))
@@ -1461,12 +1540,13 @@ tryhost:
{
if (e->e_lockfp == NULL)
syserr("%s... openmailer(%s): overlapping mpvect %d %d",
- shortenstring(e->e_to, 203), m->m_name,
- mpvect[0], mpvect[1]);
+ shortenstring(e->e_to, MAXSHORTSTR),
+ m->m_name, mpvect[0], mpvect[1]);
else
syserr("%s... openmailer(%s): overlapping mpvect %d %d, lockfp = %d",
- shortenstring(e->e_to, 203), m->m_name,
- mpvect[0], mpvect[1], fileno(e->e_lockfp));
+ shortenstring(e->e_to, MAXSHORTSTR),
+ m->m_name, mpvect[0], mpvect[1],
+ fileno(e->e_lockfp));
}
#endif
@@ -1477,7 +1557,8 @@ tryhost:
if (pipe(rpvect) < 0)
{
syserr("%s... openmailer(%s): pipe (from mailer)",
- shortenstring(e->e_to, 203), m->m_name);
+ shortenstring(e->e_to, MAXSHORTSTR),
+ m->m_name);
(void) close(mpvect[0]);
(void) close(mpvect[1]);
if (tTd(11, 1))
@@ -1503,16 +1584,14 @@ tryhost:
if (e->e_xfp != NULL)
(void) fflush(e->e_xfp); /* for debugging */
(void) fflush(stdout);
-# ifdef SIGCHLD
(void) setsignal(SIGCHLD, SIG_DFL);
-# endif /* SIGCHLD */
DOFORK(FORK);
/* pid is set by DOFORK */
if (pid < 0)
{
/* failure */
syserr("%s... openmailer(%s): cannot fork",
- shortenstring(e->e_to, 203), m->m_name);
+ shortenstring(e->e_to, MAXSHORTSTR), m->m_name);
(void) close(mpvect[0]);
(void) close(mpvect[1]);
#if SMTP
@@ -1580,15 +1659,42 @@ tryhost:
else if (ctladdr != NULL && ctladdr->q_gid != 0)
{
if (!DontInitGroups)
- (void) initgroups(ctladdr->q_ruser != NULL ?
- ctladdr->q_ruser : ctladdr->q_user,
- ctladdr->q_gid);
+ {
+ char *u = ctladdr->q_ruser;
+
+ if (u == NULL)
+ u = ctladdr->q_user;
+
+ if (initgroups(u, ctladdr->q_gid) == -1 && suidwarn)
+ syserr("openmailer: initgroups(%s, %d) failed",
+ u, ctladdr->q_gid);
+ }
+ else
+ {
+ GIDSET_T gidset[1];
+
+ gidset[0] = ctladdr->q_gid;
+ if (setgroups(1, gidset) == -1 && suidwarn)
+ syserr("openmailer: setgroups() failed");
+ }
new_gid = ctladdr->q_gid;
}
else
{
if (!DontInitGroups)
- (void) initgroups(DefUser, DefGid);
+ {
+ if (initgroups(DefUser, DefGid) == -1 && suidwarn)
+ syserr("openmailer: initgroups(%s, %d) failed",
+ DefUser, DefGid);
+ }
+ else
+ {
+ GIDSET_T gidset[1];
+
+ gidset[0] = DefGid;
+ if (setgroups(1, gidset) == -1 && suidwarn)
+ syserr("openmailer: setgroups() failed");
+ }
if (m->m_gid == 0)
new_gid = DefGid;
else
@@ -1602,13 +1708,13 @@ tryhost:
endpwent();
if (bitnset(M_SPECIFIC_UID, m->m_flags))
new_euid = m->m_uid;
- if (bitset(S_ISUID, stb.st_mode))
+ else if (bitset(S_ISUID, stb.st_mode))
new_ruid = stb.st_uid;
else if (ctladdr != NULL && ctladdr->q_uid != 0)
new_ruid = ctladdr->q_uid;
else if (m->m_uid != 0)
new_ruid = m->m_uid;
- else if (!bitnset(M_SPECIFIC_UID, m->m_flags))
+ else
new_ruid = DefUid;
if (new_euid != NO_UID)
{
@@ -1644,7 +1750,7 @@ tryhost:
/* move into some "safe" directory */
if (m->m_execdir != NULL)
{
- char *p, *q;
+ char *q;
char buf[MAXLINE + 1];
for (p = m->m_execdir; p != NULL; p = q)
@@ -1671,20 +1777,19 @@ tryhost:
if (dup2(rpvect[1], STDOUT_FILENO) < 0)
{
syserr("%s... openmailer(%s): cannot dup pipe %d for stdout",
- shortenstring(e->e_to, 203),
+ shortenstring(e->e_to, MAXSHORTSTR),
m->m_name, rpvect[1]);
_exit(EX_OSERR);
}
(void) close(rpvect[1]);
}
- else if (OpMode == MD_SMTP || OpMode == MD_DAEMON ||
- HoldErrs || DisConnected)
+ else
{
/* put mailer output in transcript */
if (dup2(fileno(e->e_xfp), STDOUT_FILENO) < 0)
{
syserr("%s... openmailer(%s): cannot dup xscript %d for stdout",
- shortenstring(e->e_to, 203),
+ shortenstring(e->e_to, MAXSHORTSTR),
m->m_name, fileno(e->e_xfp));
_exit(EX_OSERR);
}
@@ -1693,7 +1798,8 @@ tryhost:
if (dup2(STDOUT_FILENO, STDERR_FILENO) < 0)
{
syserr("%s... openmailer(%s): cannot dup stdout for stderr",
- shortenstring(e->e_to, 203), m->m_name);
+ shortenstring(e->e_to, MAXSHORTSTR),
+ m->m_name);
_exit(EX_OSERR);
}
@@ -1702,7 +1808,7 @@ tryhost:
if (dup2(mpvect[0], STDIN_FILENO) < 0)
{
syserr("%s... openmailer(%s): cannot dup pipe %d for stdin",
- shortenstring(e->e_to, 203),
+ shortenstring(e->e_to, MAXSHORTSTR),
m->m_name, mpvect[0]);
_exit(EX_OSERR);
}
@@ -1734,10 +1840,21 @@ tryhost:
** Set up return value.
*/
- mci = (MCI *) xalloc(sizeof *mci);
- bzero((char *) mci, sizeof *mci);
+ if (mci == NULL)
+ {
+ mci = (MCI *) xalloc(sizeof *mci);
+ bzero((char *) mci, sizeof *mci);
+ }
mci->mci_mailer = m;
- mci->mci_state = clever ? MCIS_OPENING : MCIS_OPEN;
+ if (clever)
+ {
+ mci->mci_state = MCIS_OPENING;
+ mci_cache(mci);
+ }
+ else
+ {
+ mci->mci_state = MCIS_OPEN;
+ }
mci->mci_pid = pid;
(void) close(mpvect[0]);
mci->mci_out = fdopen(mpvect[1], "w");
@@ -1796,6 +1913,7 @@ tryhost:
}
#endif
+do_transfer:
/* clear out per-message flags from connection structure */
mci->mci_flags &= ~(MCIF_CVT7TO8|MCIF_CVT8TO7);
@@ -1857,6 +1975,7 @@ tryhost:
** Format and send message.
*/
+ mci->mci_contentlen = 0;
putfromline(mci, e);
(*e->e_puthdr)(mci, e->e_header, e);
(*e->e_putbody)(mci, e, NULL);
@@ -1870,7 +1989,6 @@ tryhost:
extern int smtpmailfrom __P((MAILER *, MCI *, ENVELOPE *));
extern int smtprcpt __P((ADDRESS *, MAILER *, MCI *, ENVELOPE *));
extern int smtpdata __P((MAILER *, MCI *, ENVELOPE *));
- extern int smtpgetstat __P((MAILER *, MCI *, ENVELOPE *));
/*
** Send the MAIL FROM: protocol
@@ -1952,14 +2070,13 @@ tryhost:
give_up:
#if SMTP
-# if _FFR_LMTP
if (bitnset(M_LMTP, m->m_flags))
{
+ lmtp_rcode = rcode;
tobuf[0] = '\0';
anyok = FALSE;
}
else
-# endif
#endif
anyok = rcode == EX_OK;
@@ -1970,11 +2087,13 @@ tryhost:
continue;
#if SMTP
-# if _FFR_LMTP
/* if running LMTP, get the status for each address */
if (bitnset(M_LMTP, m->m_flags))
{
- rcode = smtpgetstat(m, mci, e);
+ extern int smtpgetstat __P((MAILER *, MCI *, ENVELOPE *));
+
+ if (lmtp_rcode == EX_OK)
+ rcode = smtpgetstat(m, mci, e);
if (rcode == EX_OK)
{
if (strlen(to->q_paddr) + strlen(tobuf) + 2 >= sizeof tobuf)
@@ -1998,7 +2117,6 @@ tryhost:
}
}
else
-# endif
#endif
{
/* mark bad addresses */
@@ -2034,7 +2152,6 @@ tryhost:
}
#if SMTP
-# if _FFR_LMTP
if (bitnset(M_LMTP, m->m_flags))
{
/*
@@ -2049,13 +2166,12 @@ tryhost:
if (mci != NULL && mci->mci_state == MCIS_ACTIVE)
mci->mci_state = MCIS_OPEN;
}
-# endif
#endif
if (tobuf[0] != '\0')
giveresponse(rcode, m, mci, ctladdr, xstart, e);
if (anyok)
- markstats(e, tochain);
+ markstats(e, tochain, FALSE);
mci_store_persistent(mci);
#if SMTP
@@ -2076,7 +2192,7 @@ tryhost:
/* make absolutely certain 0, 1, and 2 are in use */
snprintf(wbuf, sizeof wbuf, "%s... end of deliver(%s)",
e->e_to == NULL ? "NO-TO-LIST"
- : shortenstring(e->e_to, 203),
+ : shortenstring(e->e_to, MAXSHORTSTR),
m->m_name);
checkfd012(wbuf);
}
@@ -2134,7 +2250,10 @@ markfailure(e, q, mci, rcode)
if (mci != NULL && mci->mci_status != NULL)
{
q->q_status = mci->mci_status;
- q->q_rstatus = mci->mci_rstatus;
+ if (mci->mci_rstatus != NULL)
+ q->q_rstatus = newstr(mci->mci_rstatus);
+ else
+ q->q_rstatus = NULL;
}
else if (e->e_status != NULL)
{
@@ -2337,7 +2456,7 @@ giveresponse(stat, m, mci, ctladdr, xstart, e)
statmsg = buf;
}
}
- else if (i < 0 || i > N_SysEx)
+ else if (i < 0 || i >= N_SysEx)
{
(void) snprintf(buf, sizeof buf, "554 unknown mailer error %d",
stat);
@@ -2383,7 +2502,7 @@ giveresponse(stat, m, mci, ctladdr, xstart, e)
else
{
statmsg = SysExMsg[i];
- if (*statmsg++ == ':')
+ if (*statmsg++ == ':' && errno != 0)
{
(void) snprintf(buf, sizeof buf, "%s: %s",
statmsg, errstring(errno));
@@ -2534,8 +2653,7 @@ logdelivery(m, mci, stat, ctladdr, xstart, e)
}
else if (strcmp(stat, "queued") != 0)
{
- char *p = macvalue('h', e);
-
+ p = macvalue('h', e);
if (p != NULL && p[0] != '\0')
{
snprintf(bp, SPACELEFT(buf, bp), ", relay=%s",
@@ -2652,8 +2770,7 @@ logdelivery(m, mci, stat, ctladdr, xstart, e)
}
else if (strcmp(stat, "queued") != 0)
{
- char *p = macvalue('h', e);
-
+ p = macvalue('h', e);
if (p != NULL && p[0] != '\0')
snprintf(buf, sizeof buf, "relay=%.100s", p);
}
@@ -2696,6 +2813,8 @@ putfromline(mci, e)
if (bitnset(M_NHDR, mci->mci_mailer->m_flags))
return;
+ mci->mci_flags |= MCIF_INHEADER;
+
if (bitnset(M_UGLYUUCP, mci->mci_mailer->m_flags))
{
char *bang;
@@ -2824,6 +2943,7 @@ putbody(mci, e, separator)
/* now do the hard work */
boundaries[0] = NULL;
+ mci->mci_flags |= MCIF_INHEADER;
mime8to7(mci, e->e_header, e, boundaries, M87F_OUTER);
}
# if MIME7TO8
@@ -2843,6 +2963,7 @@ putbody(mci, e, separator)
int padc;
char *buflim;
int pos = 0;
+ size_t eol_len;
char peekbuf[10];
/* we can pass it through unmodified */
@@ -2857,6 +2978,7 @@ putbody(mci, e, separator)
if (mci->mci_mailer->m_linelimit > 0 &&
mci->mci_mailer->m_linelimit < sizeof buf - 1)
buflim = &buf[mci->mci_mailer->m_linelimit - 1];
+ eol_len = strlen(mci->mci_mailer->m_eol);
/* copy temp file to output with mapping */
ostate = OS_HEAD;
@@ -2925,14 +3047,19 @@ putbody(mci, e, separator)
if (padc != EOF)
{
putc(padc, mci->mci_out);
+ mci->mci_contentlen++;
pos++;
}
for (xp = buf; xp < bp; xp++)
+ {
putc(*xp, mci->mci_out);
+ mci->mci_contentlen++;
+ }
if (c == '\n')
{
fputs(mci->mci_mailer->m_eol,
mci->mci_out);
+ mci->mci_contentlen += eol_len;
pos = 0;
}
else
@@ -2957,6 +3084,7 @@ putbody(mci, e, separator)
{
/* got CRLF */
fputs(mci->mci_mailer->m_eol, mci->mci_out);
+ mci->mci_contentlen += eol_len;
if (TrafficLogFile != NULL)
{
fputs(mci->mci_mailer->m_eol,
@@ -2989,7 +3117,9 @@ putch:
c != '\n')
{
putc('!', mci->mci_out);
+ mci->mci_contentlen++;
fputs(mci->mci_mailer->m_eol, mci->mci_out);
+ mci->mci_contentlen += eol_len;
if (TrafficLogFile != NULL)
{
fprintf(TrafficLogFile, "!%s",
@@ -3005,6 +3135,7 @@ putch:
fputs(mci->mci_mailer->m_eol,
TrafficLogFile);
fputs(mci->mci_mailer->m_eol, mci->mci_out);
+ mci->mci_contentlen += eol_len;
pos = 0;
ostate = OS_HEAD;
}
@@ -3013,6 +3144,7 @@ putch:
if (TrafficLogFile != NULL)
putc(c, TrafficLogFile);
putc(c, mci->mci_out);
+ mci->mci_contentlen++;
pos++;
ostate = OS_INLINE;
}
@@ -3029,7 +3161,10 @@ putch:
putc(*xp, TrafficLogFile);
}
for (xp = buf; xp < bp; xp++)
+ {
putc(*xp, mci->mci_out);
+ mci->mci_contentlen++;
+ }
pos += bp - buf;
}
if (pos > 0)
@@ -3037,6 +3172,7 @@ putch:
if (TrafficLogFile != NULL)
fputs(mci->mci_mailer->m_eol, TrafficLogFile);
fputs(mci->mci_mailer->m_eol, mci->mci_out);
+ mci->mci_contentlen += eol_len;
}
}
@@ -3076,6 +3212,8 @@ endofmessage:
**
** Parameters:
** filename -- the name of the file to send to.
+** mailer -- mailer definition for recipient -- if NULL,
+** use FileMailer.
** ctladdr -- the controlling address header -- includes
** the userid/groupid to be when sending.
** sfflags -- flags for opening.
@@ -3089,11 +3227,12 @@ endofmessage:
*/
static jmp_buf CtxMailfileTimeout;
-static void mailfiletimeout();
+static void mailfiletimeout __P((void));
int
-mailfile(filename, ctladdr, sfflags, e)
+mailfile(filename, mailer, ctladdr, sfflags, e)
char *volatile filename;
+ MAILER *volatile mailer;
ADDRESS *ctladdr;
volatile int sfflags;
register ENVELOPE *e;
@@ -3102,6 +3241,7 @@ mailfile(filename, ctladdr, sfflags, e)
register pid_t pid = -1;
volatile int mode = ST_MODE_NOFILE;
bool suidwarn = geteuid() == 0;
+ char *p;
EVENT *ev;
if (tTd(11, 1))
@@ -3110,6 +3250,9 @@ mailfile(filename, ctladdr, sfflags, e)
printaddr(ctladdr, FALSE);
}
+ if (mailer == NULL)
+ mailer = FileMailer;
+
if (e->e_xfp != NULL)
fflush(e->e_xfp);
@@ -3121,6 +3264,19 @@ mailfile(filename, ctladdr, sfflags, e)
if (strcmp(filename, "/dev/null") == 0)
return EX_OK;
+ /* check for 8-bit available */
+ if (bitset(EF_HAS8BIT, e->e_flags) &&
+ bitnset(M_7BITS, mailer->m_flags) &&
+ (bitset(EF_DONT_MIME, e->e_flags) ||
+ !(bitset(MM_MIME8BIT, MimeMode) ||
+ (bitset(EF_IS_MIME, e->e_flags) &&
+ bitset(MM_CVTMIME, MimeMode)))))
+ {
+ usrerr("554 Cannot send 8-bit data to 7-bit destination");
+ e->e_status = "5.6.3";
+ return(EX_DATAERR);
+ }
+
/*
** Fork so we can change permissions here.
** Note that we MUST use fork, not vfork, because of
@@ -3168,7 +3324,9 @@ mailfile(filename, ctladdr, sfflags, e)
mode = FileMode;
oflags |= O_CREAT|O_EXCL;
}
- else if (bitset(0111, stb.st_mode) || stb.st_nlink != 1 ||
+ else if (bitset(S_IXUSR|S_IXGRP|S_IXOTH, stb.st_mode) ||
+ (!bitset(DBS_FILEDELIVERYTOHARDLINK, DontBlameSendmail) &&
+ stb.st_nlink != 1) ||
(SafeFileEnv != NULL && !S_ISREG(stb.st_mode)))
exit(EX_CANTCREAT);
if (mode == ST_MODE_NOFILE)
@@ -3200,7 +3358,12 @@ mailfile(filename, ctladdr, sfflags, e)
/* select a new user to run as */
if (!bitset(SFF_RUNASREALUID, sfflags))
{
- if (bitset(S_ISUID, mode))
+ if (bitnset(M_SPECIFIC_UID, mailer->m_flags))
+ {
+ RealUserName = NULL;
+ RealUid = mailer->m_uid;
+ }
+ else if (bitset(S_ISUID, mode))
{
RealUserName = NULL;
RealUid = stb.st_uid;
@@ -3213,10 +3376,10 @@ mailfile(filename, ctladdr, sfflags, e)
RealUserName = ctladdr->q_user;
RealUid = ctladdr->q_uid;
}
- else if (FileMailer != NULL && FileMailer->m_uid != 0)
+ else if (mailer != NULL && mailer->m_uid != 0)
{
RealUserName = DefUser;
- RealUid = FileMailer->m_uid;
+ RealUid = mailer->m_uid;
}
else
{
@@ -3225,12 +3388,14 @@ mailfile(filename, ctladdr, sfflags, e)
}
/* select a new group to run as */
- if (bitset(S_ISGID, mode))
+ if (bitnset(M_SPECIFIC_UID, mailer->m_flags))
+ RealGid = mailer->m_gid;
+ else if (bitset(S_ISGID, mode))
RealGid = stb.st_gid;
else if (ctladdr != NULL && ctladdr->q_uid != 0)
RealGid = ctladdr->q_gid;
- else if (FileMailer != NULL && FileMailer->m_gid != 0)
- RealGid = FileMailer->m_gid;
+ else if (mailer != NULL && mailer->m_gid != 0)
+ RealGid = mailer->m_gid;
else
RealGid = DefGid;
}
@@ -3246,7 +3411,19 @@ mailfile(filename, ctladdr, sfflags, e)
/* set group id list (needs /etc/group access) */
if (RealUserName != NULL && !DontInitGroups)
- (void) initgroups(RealUserName, RealGid);
+ {
+ if (initgroups(RealUserName, RealGid) == -1 && suidwarn)
+ syserr("mailfile: initgroups(%s, %d) failed",
+ RealUserName, RealGid);
+ }
+ else
+ {
+ GIDSET_T gidset[1];
+
+ gidset[0] = RealGid;
+ if (setgroups(1, gidset) == -1 && suidwarn)
+ syserr("mailfile: setgroups() failed");
+ }
/* if you have a safe environment, go into it */
if (SafeFileEnv != NULL && SafeFileEnv[0] != '\0')
@@ -3274,15 +3451,43 @@ mailfile(filename, ctladdr, sfflags, e)
if (setuid(RealUid) < 0 && suidwarn)
syserr("mailfile: setuid(%ld) failed", (long) RealUid);
- sfflags |= SFF_NOPATHCHECK|SFF_NOLINK;
+ /* move into some "safe" directory */
+ if (mailer->m_execdir != NULL)
+ {
+ char *q;
+ char buf[MAXLINE + 1];
+
+ for (p = mailer->m_execdir; p != NULL; p = q)
+ {
+ q = strchr(p, ':');
+ if (q != NULL)
+ *q = '\0';
+ expand(p, buf, sizeof buf, e);
+ if (q != NULL)
+ *q++ = ':';
+ if (tTd(11, 20))
+ printf("mailfile: trydir %s\n",
+ buf);
+ if (buf[0] != '\0' && chdir(buf) >= 0)
+ break;
+ }
+ }
+
+ sfflags |= SFF_NOPATHCHECK;
+ if (!bitset(DBS_FILEDELIVERYTOSYMLINK, DontBlameSendmail))
+ sfflags |= SFF_NOSLINK;
+ if (!bitset(DBS_FILEDELIVERYTOHARDLINK, DontBlameSendmail))
+ sfflags |= SFF_NOHLINK;
sfflags &= ~SFF_OPENASROOT;
f = safefopen(filename, oflags, FileMode, sfflags);
if (f == NULL)
{
- message("554 cannot open: %s", errstring(errno));
+ message("554 cannot open %s: %s",
+ shortenstring(filename, MAXSHORTSTR),
+ errstring(errno));
exit(EX_CANTCREAT);
}
- if (filechanged(filename, fileno(f), &stb, sfflags))
+ if (filechanged(filename, fileno(f), &stb))
{
message("554 file changed after open");
exit(EX_CANTCREAT);
@@ -3297,11 +3502,36 @@ mailfile(filename, ctladdr, sfflags, e)
clrevent(ev);
bzero(&mcibuf, sizeof mcibuf);
- mcibuf.mci_mailer = FileMailer;
+ mcibuf.mci_mailer = mailer;
mcibuf.mci_out = f;
- if (bitnset(M_7BITS, FileMailer->m_flags))
+ mcibuf.mci_contentlen = 0;
+ if (bitnset(M_7BITS, mailer->m_flags))
mcibuf.mci_flags |= MCIF_7BIT;
+ /* clear out per-message flags from connection structure */
+ mcibuf.mci_flags &= ~(MCIF_CVT7TO8|MCIF_CVT8TO7);
+
+ if (bitset(EF_HAS8BIT, e->e_flags) &&
+ !bitset(EF_DONT_MIME, e->e_flags) &&
+ bitnset(M_7BITS, mailer->m_flags))
+ mcibuf.mci_flags |= MCIF_CVT8TO7;
+
+#if MIME7TO8
+ if (bitnset(M_MAKE8BIT, mailer->m_flags) &&
+ !bitset(MCIF_7BIT, mcibuf.mci_flags) &&
+ (p = hvalue("Content-Transfer-Encoding", e->e_header)) != NULL &&
+ (strcasecmp(p, "quoted-printable") == 0 ||
+ strcasecmp(p, "base64") == 0) &&
+ (p = hvalue("Content-Type", e->e_header)) != NULL)
+ {
+ /* may want to convert 7 -> 8 */
+ /* XXX should really parse it here -- and use a class XXX */
+ if (strncasecmp(p, "text/plain", 10) == 0 &&
+ (p[10] == '\0' || p[10] == ' ' || p[10] == ';'))
+ mcibuf.mci_flags |= MCIF_CVT7TO8;
+ }
+#endif
+
putfromline(&mcibuf, e);
(*e->e_puthdr)(&mcibuf, e->e_header, e);
(*e->e_putbody)(&mcibuf, e, NULL);
@@ -3330,11 +3560,17 @@ mailfile(filename, ctladdr, sfflags, e)
int st;
st = waitfor(pid);
+ if (st == -1)
+ {
+ syserr("mailfile: %s: wait", mailer->m_name);
+ return (EX_SOFTWARE);
+ }
if (WIFEXITED(st))
return (WEXITSTATUS(st));
else
{
- syserr("child died on signal %d", st);
+ syserr("mailfile: %s: child died on signal %d",
+ mailer->m_name, st);
return (EX_UNAVAILABLE);
}
/*NOTREACHED*/
diff --git a/usr.sbin/sendmail/src/domain.c b/usr.sbin/sendmail/src/domain.c
index 2031726ba44..e3a5500b551 100644
--- a/usr.sbin/sendmail/src/domain.c
+++ b/usr.sbin/sendmail/src/domain.c
@@ -1,44 +1,22 @@
/*
- * Copyright (c) 1986, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1986, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#include "sendmail.h"
#ifndef lint
#if NAMED_BIND
-static char sccsid[] = "@(#)domain.c 8.68 (Berkeley) 8/2/97 (with name server)";
+static char sccsid[] = "@(#)domain.c 8.77 (Berkeley) 6/4/98 (with name server)";
#else
-static char sccsid[] = "@(#)domain.c 8.68 (Berkeley) 8/2/97 (without name server)";
+static char sccsid[] = "@(#)domain.c 8.77 (Berkeley) 6/4/98 (without name server)";
#endif
#endif /* not lint */
@@ -354,7 +332,8 @@ punt:
if (strlen(host) >= (SIZE_T) sizeof MXHostBuf)
{
*rcode = EX_CONFIG;
- syserr("Host name %s too long", shortenstring(host, 203));
+ syserr("Host name %s too long",
+ shortenstring(host, MAXSHORTSTR));
return -1;
}
snprintf(MXHostBuf, sizeof MXHostBuf, "%s", host);
@@ -458,6 +437,7 @@ mxrand(host)
** to generalize it at the moment.
*/
+/* ARGSUSED3 */
char *
bestmx_map_lookup(map, name, av, statp)
MAP *map;
@@ -468,7 +448,10 @@ bestmx_map_lookup(map, name, av, statp)
int nmx;
auto int rcode;
int saveopts = _res.options;
+ int i, len = 0;
+ char *p;
char *mxhosts[MAXMXHOSTS + 1];
+ char buf[MXHOSTBUFSIZE + 1];
_res.options &= ~(RES_DNSRCH|RES_DEFNAMES);
nmx = getmxrr(name, mxhosts, FALSE, &rcode);
@@ -477,8 +460,37 @@ bestmx_map_lookup(map, name, av, statp)
return NULL;
if (bitset(MF_MATCHONLY, map->map_mflags))
return map_rewrite(map, name, strlen(name), NULL);
- else
+ if ((map->map_coldelim == '\0') || (nmx == 1))
return map_rewrite(map, mxhosts[0], strlen(mxhosts[0]), av);
+
+ /*
+ ** We were given a -z flag (return all MXs) and there are multiple
+ ** ones. We need to build them all into a list.
+ */
+ p = buf;
+ for (i = 0; i < nmx; i++)
+ {
+ int slen;
+
+ if (strchr(mxhosts[i], map->map_coldelim) != NULL)
+ {
+ syserr("bestmx_map_lookup: MX host %.64s includes map delimiter character 0x%02X",
+ mxhosts[i], map->map_coldelim);
+ return NULL;
+ }
+ slen = strlen(mxhosts[i]);
+ if (len + slen + 2 > sizeof buf)
+ break;
+ if (i > 0)
+ {
+ *p++ = map->map_coldelim;
+ len++;
+ }
+ strcpy(p, mxhosts[i]);
+ p += slen;
+ len += slen;
+ }
+ return map_rewrite(map, buf, len, av);
}
/*
** DNS_GETCANONNAME -- get the canonical name for named host using DNS
@@ -535,7 +547,7 @@ dns_getcanonname(host, hbsize, trymx, statp)
char *xp;
char nbuf[MAX(MAXPACKET, MAXDNAME*2+2)];
char *searchlist[MAXDNSRCH+2];
- extern char *gethostalias();
+ extern char *gethostalias __P((char *));
if (tTd(8, 2))
printf("dns_getcanonname(%s, trymx=%d)\n", host, trymx);
diff --git a/usr.sbin/sendmail/src/envelope.c b/usr.sbin/sendmail/src/envelope.c
index 3e0fc204020..092148a2a0c 100644
--- a/usr.sbin/sendmail/src/envelope.c
+++ b/usr.sbin/sendmail/src/envelope.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)envelope.c 8.105 (Berkeley) 6/24/97";
+static char sccsid[] = "@(#)envelope.c 8.117 (Berkeley) 6/4/98";
#endif /* not lint */
#include "sendmail.h"
@@ -108,7 +86,7 @@ dropenvelope(e, fulldrop)
if (tTd(50, 1))
{
- extern void printenvflags();
+ extern void printenvflags __P((ENVELOPE *));
printf("dropenvelope %lx: id=", (u_long) e);
xputs(e->e_id);
@@ -344,7 +322,7 @@ simpledrop:
{
if (tTd(50, 1))
{
- extern void printenvflags();
+ extern void printenvflags __P((ENVELOPE *));
printf("\n===== Dropping [dq]f%s... queueit=%d, e_flags=",
e->e_id, queueit);
@@ -419,6 +397,7 @@ clearenvelope(e, fullclear)
/* now clear out the data */
STRUCTCOPY(BlankEnvelope, *e);
+ e->e_message = NULL;
if (Verbose)
e->e_sendmode = SM_DELIVER;
bh = BlankEnvelope.e_header;
@@ -457,9 +436,9 @@ initsys(e)
#ifdef TTYNAME
static char ybuf[60]; /* holds tty id */
register char *p;
-#endif /* TTYNAME */
extern char *ttyname();
- extern void settime();
+#endif /* TTYNAME */
+ extern void settime __P((ENVELOPE *));
/*
** Give this envelope a reality.
@@ -766,7 +745,7 @@ setsender(from, e, delimptr, delimchar, internal)
if (bitnset(M_CHECKUDB, e->e_from.q_mailer->m_flags))
{
register char *p;
- extern char *udbsender();
+ extern char *udbsender __P((char *));
p = udbsender(e->e_from.q_user);
if (p != NULL)
@@ -847,7 +826,7 @@ setsender(from, e, delimptr, delimchar, internal)
if (LogLevel > 2)
sm_syslog(LOG_NOTICE, e->e_id,
"cannot prescan from (%s)",
- shortenstring(from, 203));
+ shortenstring(from, MAXSHORTSTR));
finis();
}
(void) rewrite(pvp, 3, 0, e);
@@ -869,7 +848,7 @@ setsender(from, e, delimptr, delimchar, internal)
bitnset(M_CANONICAL, e->e_from.q_mailer->m_flags))
{
char **lastat;
- extern char **copyplist();
+ extern char **copyplist __P((char **, bool));
/* get rid of any pesky angle brackets */
(void) rewrite(pvp, 3, 0, e);
diff --git a/usr.sbin/sendmail/src/err.c b/usr.sbin/sendmail/src/err.c
index f08d9609d8e..066139557a0 100644
--- a/usr.sbin/sendmail/src/err.c
+++ b/usr.sbin/sendmail/src/err.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)err.c 8.65 (Berkeley) 10/18/97";
+static char sccsid[] = "@(#)err.c 8.74 (Berkeley) 6/4/98";
#endif /* not lint */
# include "sendmail.h"
@@ -273,7 +251,7 @@ usrerr(fmt, va_alist)
** none.
*/
-/*VARARGS2*/
+/*VARARGS1*/
void
#ifdef __STDC__
message(const char *msg, ...)
@@ -325,7 +303,7 @@ message(msg, va_alist)
** none.
*/
-/*VARARGS2*/
+/*VARARGS1*/
void
#ifdef __STDC__
nmessage(const char *msg, ...)
@@ -456,7 +434,7 @@ putoutmsg(msg, holdmsg, heldmsg)
sm_syslog(LOG_CRIT, CurEnv->e_id,
"SYSERR: putoutmsg (%s): error on output channel sending \"%s\": %s",
CurHostName == NULL ? "NO-HOST" : CurHostName,
- shortenstring(msg, 203), errstring(errno));
+ shortenstring(msg, MAXSHORTSTR), errstring(errno));
}
/*
** PUTERRMSG -- like putoutmsg, but does special processing for error messages
@@ -533,7 +511,9 @@ fmtmsg(eb, to, num, eno, fmt, ap)
int spaceleft = sizeof MsgBuf;
/* output the reply code */
- if (isdigit(fmt[0]) && isdigit(fmt[1]) && isdigit(fmt[2]))
+ if (isascii(fmt[0]) && isdigit(fmt[0]) &&
+ isascii(fmt[1]) && isdigit(fmt[1]) &&
+ isascii(fmt[2]) && isdigit(fmt[2]))
{
num = fmt;
fmt += 4;
@@ -561,7 +541,7 @@ fmtmsg(eb, to, num, eno, fmt, ap)
strncmp(num, "251", 3) != 0)
{
(void) snprintf(eb, spaceleft, "%s... ",
- shortenstring(to, 203));
+ shortenstring(to, MAXSHORTSTR));
spaceleft -= strlen(eb);
while (*eb != '\0')
*eb++ &= 0177;
@@ -657,7 +637,10 @@ errstring(errnum)
#if HASSTRERROR
snprintf(bp, SPACELEFT(buf, bp), "%s", strerror(errnum));
#else
- snprintf(bp, SPACELEFT(buf, bp), "%s", sys_errlist[errnum]);
+ if (errnum >= 0 && errnum < sys_nerr)
+ snprintf(bp, SPACELEFT(buf, bp), "%s", sys_errlist[errnum]);
+ else
+ snprintf(bp, SPACELEFT(buf, bp), "Error %d", errnum);
#endif
bp += strlen(bp);
if (CurHostName != NULL)
@@ -675,7 +658,7 @@ errstring(errnum)
bp += strlen(bp);
}
snprintf(bp, SPACELEFT(buf, bp), "%s",
- shortenstring(CurHostName, 203));
+ shortenstring(CurHostName, MAXSHORTSTR));
bp += strlen(buf);
}
if (SmtpPhase != NULL)
@@ -689,14 +672,14 @@ errstring(errnum)
if (CurHostName == NULL)
break;
(void) snprintf(buf, sizeof buf, "Host %s is down",
- shortenstring(CurHostName, 203));
+ shortenstring(CurHostName, MAXSHORTSTR));
return (buf);
case ECONNREFUSED:
if (CurHostName == NULL)
break;
(void) snprintf(buf, sizeof buf, "Connection refused by %s",
- shortenstring(CurHostName, 203));
+ shortenstring(CurHostName, MAXSHORTSTR));
return (buf);
# endif
@@ -765,7 +748,7 @@ errstring(errnum)
if (CurHostName != NULL)
{
snprintf(bp, SPACELEFT(buf, bp), "%s: ",
- shortenstring(CurHostName, 203));
+ shortenstring(CurHostName, MAXSHORTSTR));
bp += strlen(bp);
}
snprintf(bp, SPACELEFT(buf, bp), "%s", dnsmsg);
diff --git a/usr.sbin/sendmail/src/headers.c b/usr.sbin/sendmail/src/headers.c
index 857e9c32da1..a04f59e14f4 100644
--- a/usr.sbin/sendmail/src/headers.c
+++ b/usr.sbin/sendmail/src/headers.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)headers.c 8.115 (Berkeley) 10/22/97";
+static char sccsid[] = "@(#)headers.c 8.127 (Berkeley) 6/4/98";
#endif /* not lint */
# include <errno.h>
@@ -155,7 +133,6 @@ chompheader(line, def, hdrp, e)
if (strlen(fname) > 100)
return H_EOH;
-#if _FFR_HEADER_RSCHECK
/* check to see if it represents a ruleset call */
if (def)
{
@@ -177,7 +154,6 @@ chompheader(line, def, hdrp, e)
return 0;
}
}
-#endif
/* see if it is a known type */
s = stab(fname, ST_HEADER, ST_FIND);
@@ -206,7 +182,7 @@ chompheader(line, def, hdrp, e)
(void) sendtolist(fvalue, NULLADDR, &e->e_errorqueue, 0, e);
/* if this means "end of header" quit now */
- if (bitset(H_EOH, hi->hi_flags))
+ if (!headeronly && bitset(H_EOH, hi->hi_flags))
return hi->hi_flags;
/*
@@ -278,6 +254,10 @@ chompheader(line, def, hdrp, e)
bcopy((char *) mopts, (char *) h->h_mflags, sizeof mopts);
*hp = h;
h->h_flags = hi->hi_flags;
+
+ /* strip EOH flag if parsing MIME headers */
+ if (headeronly)
+ h->h_flags &= ~H_EOH;
if (def)
h->h_flags |= H_DEFAULT;
if (cond)
@@ -463,7 +443,22 @@ eatheader(e, full)
/* full name of from person */
p = hvalue("full-name", e->e_header);
if (p != NULL)
+ {
+ extern bool rfc822_string __P((char *));
+
+ if (!rfc822_string(p))
+ {
+ extern char *addquotes __P((char *));
+
+ /*
+ ** Quote a full name with special characters
+ ** as a comment so crackaddr() doesn't destroy
+ ** the name portion of the address.
+ */
+ p = addquotes(p);
+ }
define('x', p, e);
+ }
if (tTd(32, 1))
printf("----- collected header -----\n");
@@ -493,7 +488,7 @@ eatheader(e, full)
{
if (bitset(H_FROM, h->h_flags))
{
- extern char *crackaddr();
+ extern char *crackaddr __P((char *));
expand(crackaddr(buf), buf, sizeof buf, e);
}
@@ -517,7 +512,9 @@ eatheader(e, full)
!bitset(H_DEFAULT, h->h_flags) &&
(!bitset(EF_RESENT, e->e_flags) || bitset(H_RESENT, h->h_flags)))
{
+#if 0
int saveflags = e->e_flags;
+#endif
(void) sendtolist(h->h_value, NULLADDR,
&e->e_sendqueue, 0, e);
@@ -1181,11 +1178,19 @@ putheader(mci, hdr, e)
printf("--- putheader, mailer = %s ---\n",
mci->mci_mailer->m_name);
- mci->mci_flags |= MCIF_INHEADER;
+ /*
+ ** If we're in MIME mode, we're not really in the header of the
+ ** message, just the header of one of the parts of the body of
+ ** the message. Therefore MCIF_INHEADER should not be turned on.
+ */
+
+ if (!bitset(MCIF_INMIME, mci->mci_flags))
+ mci->mci_flags |= MCIF_INHEADER;
+
for (h = hdr; h != NULL; h = h->h_link)
{
register char *p = h->h_value;
- extern bool bitintersect();
+ extern bool bitintersect __P((BITMAP, BITMAP));
if (tTd(34, 11))
{
@@ -1483,7 +1488,7 @@ commaize(h, p, oldstyle, mci, e)
else if (e->e_from.q_mailer != NULL &&
bitnset(M_UDBRECIPIENT, e->e_from.q_mailer->m_flags))
{
- extern char *udbsender();
+ extern char *udbsender __P((char *));
char *q;
q = udbsender(name);
diff --git a/usr.sbin/sendmail/src/ldap_map.h b/usr.sbin/sendmail/src/ldap_map.h
index dd85da3073b..9f6a6796d7a 100644
--- a/usr.sbin/sendmail/src/ldap_map.h
+++ b/usr.sbin/sendmail/src/ldap_map.h
@@ -1,11 +1,20 @@
/*
+ * Copyright (c) 1998 Sendmail, Inc. 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.
+ *
+ */
+
+/*
** Support for LDAP.
**
-** Contributed by Booker C. Bense <bbense@networking.stanford.edu>.
+** Contributed by Booker C. Bense <bbense+ldap@stanford.edu>.
** Please go to him for support -- since I (Eric) don't run LDAP, I
** can't help you at all.
**
-** @(#)ldap_map.h 8.4 (Berkeley) 6/3/97
+** @(#)ldap_map.h 8.9 (Berkeley) 5/19/98
*/
#ifndef _LDAP_MAP_H
diff --git a/usr.sbin/sendmail/src/macro.c b/usr.sbin/sendmail/src/macro.c
index 0f31d11f3b4..c1f9f7bb06c 100644
--- a/usr.sbin/sendmail/src/macro.c
+++ b/usr.sbin/sendmail/src/macro.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)macro.c 8.18 (Berkeley) 2/1/97";
+static char sccsid[] = "@(#)macro.c 8.25 (Berkeley) 5/19/98";
#endif /* not lint */
# include "sendmail.h"
@@ -72,7 +50,7 @@ expand(s, buf, bufsize, e)
int i;
int skiplev; /* skipping nesting level */
int iflev; /* if nesting level */
- char xbuf[BUFSIZ];
+ char xbuf[MACBUFSIZE];
static int explevel = 0;
if (tTd(35, 24))
@@ -229,6 +207,8 @@ expand(s, buf, bufsize, e)
** $n name of sendmail ("MAILER-DAEMON" on local
** net typically)+
** $o delimiters ("operators") for address tokens+
+** (set via OperatorChars option in V6 or later
+** sendmail.cf files)
** $p my process id in decimal
** $q the string that becomes an address -- this is
** normally used to combine $g & $x.
diff --git a/usr.sbin/sendmail/src/mailq.1 b/usr.sbin/sendmail/src/mailq.1
index b489f31b2c3..fa1d0d56f51 100644
--- a/usr.sbin/sendmail/src/mailq.1
+++ b/usr.sbin/sendmail/src/mailq.1
@@ -1,38 +1,16 @@
-.\" Copyright (c) 1983, 1997 Eric P. Allman
+.\" Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+.\" Copyright (c) 1983, 1997 Eric P. Allman. All rights reserved.
.\" Copyright (c) 1985, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the University of
-.\" California, Berkeley and its contributors.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
+.\" 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.
.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
.\"
-.\" @(#)mailq.1 8.5 (Berkeley) 2/1/97
+.\" @(#)mailq.1 8.10 (Berkeley) 5/19/98
.\"
-.Dd February 1, 1997
+.Dd May 19, 1998
.Dt MAILQ 1
.Os BSD 4
.Sh NAME
diff --git a/usr.sbin/sendmail/src/main.c b/usr.sbin/sendmail/src/main.c
index c496adb78ee..f014d83c359 100644
--- a/usr.sbin/sendmail/src/main.c
+++ b/usr.sbin/sendmail/src/main.c
@@ -1,51 +1,32 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
static char copyright[] =
-"@(#) Copyright (c) 1988, 1993\n\
+"@(#) Copyright (c) 1998 Sendmail, Inc. All rights reserved.\n\
+ Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.\n\
+ Copyright (c) 1988, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 8.258 (Berkeley) 10/20/97";
+static char sccsid[] = "@(#)main.c 8.302 (Berkeley) 6/4/98";
#endif /* not lint */
#define _DEFINE
#include "sendmail.h"
#include <arpa/inet.h>
+#include <grp.h>
#if NAMED_BIND
#include <resolv.h>
#endif
@@ -74,6 +55,7 @@ static char sccsid[] = "@(#)main.c 8.258 (Berkeley) 10/20/97";
** (11/88 - 9/89).
** UCB/Mammoth Project (10/89 - 7/95).
** InReference, Inc. (8/95 - 1/97).
+** Sendmail, Inc. (1/98 - present).
** The support of the my employers is gratefully acknowledged.
** Few of them (Britton-Lee in particular) have had
** anything to gain from my involvement in this project.
@@ -95,7 +77,7 @@ int MissingFds = 0; /* bit map of fds missing on startup */
GIDSET_T InitialGidSet[NGROUPS_MAX];
#endif
-static void obsolete();
+static void obsolete __P((char **));
extern void printmailer __P((MAILER *));
extern void tTflag __P((char *));
@@ -106,7 +88,7 @@ ERROR %%%% Cannot have DAEMON mode without SMTP %%%% ERROR
ERROR %%%% Cannot have SMTP mode without QUEUE %%%% ERROR
#endif /* DAEMON && !SMTP */
-#define MAXCONFIGLEVEL 7 /* highest config version level known */
+#define MAXCONFIGLEVEL 8 /* highest config version level known */
int
main(argc, argv, envp)
@@ -129,20 +111,22 @@ main(argc, argv, envp)
static bool reenter = FALSE;
struct passwd *pw;
struct hostent *hp;
- bool nullserver = FALSE;
+ char *nullserver = NULL;
+ bool forged;
char jbuf[MAXHOSTNAMELEN]; /* holds MyHostName */
static char rnamebuf[MAXNAME]; /* holds RealUserName */
char *emptyenviron[1];
+ QUEUE_CHAR *new;
extern int DtableSize;
extern int optind;
extern int opterr;
extern char *optarg;
extern char **environ;
- extern time_t convtime();
+ extern time_t convtime __P((char *, char));
extern SIGFUNC_DECL intsig __P((int));
- extern struct hostent *myhostname();
- extern char *getauthinfo();
- extern char *getcfname();
+ extern struct hostent *myhostname __P((char *, int));
+ extern char *getauthinfo __P((int, bool *));
+ extern char *getcfname __P((void));
extern SIGFUNC_DECL sigusr1 __P((int));
extern SIGFUNC_DECL sighup __P((int));
extern void initmacros __P((ENVELOPE *));
@@ -159,6 +143,9 @@ main(argc, argv, envp)
extern void printqueue __P((void));
extern void sendtoargv __P((char **, ENVELOPE *));
extern void resetlimits __P((void));
+#ifndef HASUNSETENV
+ extern void unsetenv __P((char *));
+#endif
/*
** Check to see if we reentered.
@@ -250,6 +237,9 @@ main(argc, argv, envp)
setsignal(SIGUSR1, sigusr1);
#endif
+ /* initialize for setproctitle */
+ initsetproctitle(argc, argv, envp);
+
/* Handle any non-getoptable constructions. */
obsolete(argv);
@@ -311,17 +301,38 @@ main(argc, argv, envp)
(void) snprintf(rnamebuf, sizeof rnamebuf, "Unknown UID %d", RealUid);
RealUserName = rnamebuf;
- /* if running non-setuid binary, pretend we are the RunAsUid */
- if (geteuid() == RealUid)
+ if (tTd(0, 101))
+ {
+ printf("Version %s\n", Version);
+ endpwent();
+ setuid(RealUid);
+ exit(EX_OK);
+ }
+
+ /*
+ ** if running non-setuid binary as non-root, pretend
+ ** we are the RunAsUid
+ */
+ if (RealUid != 0 && geteuid() == RealUid)
{
if (tTd(47, 1))
printf("Non-setuid binary: RunAsUid = RealUid = %d\n",
- RealUid);
+ (int)RealUid);
RunAsUid = RealUid;
}
- if (getegid() == RealGid)
+ else if (geteuid() != 0)
+ RunAsUid = geteuid();
+
+ if (RealUid != 0 && getegid() == RealGid)
RunAsGid = RealGid;
+ if (tTd(47, 5))
+ {
+ printf("main: e/ruid = %d/%d e/rgid = %d/%d\n",
+ (int)geteuid(), (int)getuid(), (int)getegid(), (int)getgid());
+ printf("main: RunAsUser = %d:%d\n", (int)RunAsUid, (int)RunAsGid);
+ }
+
/* save command line arguments */
i = 0;
for (av = argv; *av != NULL; )
@@ -402,14 +413,26 @@ main(argc, argv, envp)
InChannel = stdin;
OutChannel = stdout;
- /* initialize for setproctitle */
- initsetproctitle(argc, argv, envp);
-
/* clear sendmail's environment */
ExternalEnviron = environ;
emptyenviron[0] = NULL;
environ = emptyenviron;
+ /*
+ ** restore any original TZ setting until TimeZoneSpec has been
+ ** determined - or early log messages may get bogus time stamps
+ */
+ if ((p = getextenv("TZ")) != NULL)
+ {
+ char *tz;
+ int tzlen;
+
+ tzlen = strlen(p) + 4;
+ tz = xalloc(tzlen);
+ snprintf(tz, tzlen, "TZ=%s", p);
+ putenv(tz);
+ }
+
/* prime the child environment */
setuserenv("AGENT", "sendmail");
@@ -504,8 +527,6 @@ main(argc, argv, envp)
#if NETINET
if (hp->h_addrtype == AF_INET && hp->h_length == INADDRSZ)
{
- register int i;
-
for (i = 0; hp->h_addr_list[i] != NULL; i++)
{
char ipbuf[103];
@@ -523,6 +544,10 @@ main(argc, argv, envp)
/* current time */
define('b', arpadate((char *) NULL), CurEnv);
+ QueueLimitRecipient = (QUEUE_CHAR *) NULL;
+ QueueLimitSender = (QUEUE_CHAR *) NULL;
+ QueueLimitId = (QUEUE_CHAR *) NULL;
+
/*
** Crack argv.
*/
@@ -690,15 +715,27 @@ main(argc, argv, envp)
switch (optarg[0])
{
case 'I':
- QueueLimitId = newstr(&optarg[1]);
+ if ((new = (QUEUE_CHAR *)malloc(sizeof(QUEUE_CHAR))) == NULL)
+ syserr("!Out of memory!!");
+ new->queue_match = newstr(&optarg[1]);
+ new->queue_next = QueueLimitId;
+ QueueLimitId = new;
break;
case 'R':
- QueueLimitRecipient = newstr(&optarg[1]);
+ if ((new = (QUEUE_CHAR *)malloc(sizeof(QUEUE_CHAR))) == NULL)
+ syserr("!Out of memory!!");
+ new->queue_match = newstr(&optarg[1]);
+ new->queue_next = QueueLimitRecipient;
+ QueueLimitRecipient = new;
break;
case 'S':
- QueueLimitSender = newstr(&optarg[1]);
+ if ((new = (QUEUE_CHAR *)malloc(sizeof(QUEUE_CHAR))) == NULL)
+ syserr("!Out of memory!!");
+ new->queue_match = newstr(&optarg[1]);
+ new->queue_next = QueueLimitSender;
+ QueueLimitSender = new;
break;
default:
@@ -850,7 +887,7 @@ main(argc, argv, envp)
** Find our real host name for future logging.
*/
- p = getauthinfo(STDIN_FILENO);
+ p = getauthinfo(STDIN_FILENO, &forged);
define('_', p, CurEnv);
/* suppress error printing if errors mailed back or whatever */
@@ -934,14 +971,15 @@ main(argc, argv, envp)
}
/* check for permissions */
- if ((OpMode == MD_DAEMON || OpMode == MD_PURGESTAT) && RealUid != 0)
+ if ((OpMode == MD_DAEMON || OpMode == MD_FGDAEMON ||
+ OpMode == MD_PURGESTAT) && RealUid != 0)
{
if (LogLevel > 1)
sm_syslog(LOG_ALERT, NOQID,
"user %d attempted to %s",
RealUid,
- OpMode == MD_DAEMON ? "run daemon"
- : "purge host status");
+ OpMode != MD_PURGESTAT ? "run daemon"
+ : "purge host status");
usrerr("Permission denied");
exit(EX_USAGE);
}
@@ -954,8 +992,18 @@ main(argc, argv, envp)
case MD_TEST:
/* don't have persistent host status in test mode */
HostStatDir = NULL;
- Verbose = 2;
+ if (Verbose == 0)
+ Verbose = 2;
+ CurEnv->e_errormode = EM_PRINT;
+ HoldErrs = FALSE;
+ break;
+
+ case MD_VERIFY:
CurEnv->e_errormode = EM_PRINT;
+ HoldErrs = FALSE;
+ /* arrange to exit cleanly on hangup signal */
+ if (setsignal(SIGHUP, SIG_IGN) == (sigfunc_t) SIG_DFL)
+ setsignal(SIGHUP, intsig);
break;
case MD_FGDAEMON:
@@ -983,6 +1031,7 @@ main(argc, argv, envp)
case MD_INITALIAS:
Verbose = 2;
CurEnv->e_errormode = EM_PRINT;
+ HoldErrs = FALSE;
/* fall through... */
case MD_PRINT:
@@ -997,9 +1046,32 @@ main(argc, argv, envp)
break;
}
- /* full names can't have newlines */
- if (FullName != NULL && strchr(FullName, '\n') != NULL)
- FullName = newstr(denlstring(FullName, TRUE, TRUE));
+ /* special considerations for FullName */
+ if (FullName != NULL)
+ {
+ char *full = NULL;
+ extern bool rfc822_string __P((char *));
+
+ /* full names can't have newlines */
+ if (strchr(FullName, '\n') != NULL)
+ {
+ FullName = full = newstr(denlstring(FullName, TRUE, TRUE));
+ }
+ /* check for characters that may have to be quoted */
+ if (!rfc822_string(FullName))
+ {
+ extern char *addquotes __P((char *));
+
+ /*
+ ** Quote a full name with special characters
+ ** as a comment so crackaddr() doesn't destroy
+ ** the name portion of the address.
+ */
+ FullName = addquotes(FullName);
+ if (full != NULL)
+ free(full);
+ }
+ }
/* do heuristic mode adjustment */
if (Verbose)
@@ -1011,6 +1083,13 @@ main(argc, argv, envp)
setoption('d', "", TRUE, FALSE, CurEnv);
}
+ /* check for out of date configuration level */
+ if (ConfigLevel < MAXCONFIGLEVEL)
+ {
+ message("Warning: .cf file is out of date: sendmail %s supports version %d, .cf file is version %d",
+ Version, MAXCONFIGLEVEL, ConfigLevel);
+ }
+
if (ConfigLevel < 3)
{
UseErrorsTo = TRUE;
@@ -1216,9 +1295,6 @@ main(argc, argv, envp)
exit(ExitStat);
case MD_SMTP:
- nullserver = FALSE;
- /* fall through... */
-
case MD_DAEMON:
/* reset DSN parameters */
DefaultNotify = QPINGONFAILURE|QPINGONDELAY;
@@ -1279,7 +1355,7 @@ main(argc, argv, envp)
{
extern void testmodeline __P((char *, ENVELOPE *));
- if (Verbose)
+ if (Verbose == 2)
printf("> ");
(void) fflush(stdout);
if (fgets(buf, sizeof buf, stdin) == NULL)
@@ -1287,7 +1363,7 @@ main(argc, argv, envp)
p = strchr(buf, '\n');
if (p != NULL)
*p = '\0';
- if (!Verbose)
+ if (Verbose < 2)
printf("> %s\n", buf);
testmodeline(buf, CurEnv);
}
@@ -1326,7 +1402,7 @@ main(argc, argv, envp)
if (i < 0)
syserr("daemon: cannot fork");
if (i != 0)
- exit(0);
+ exit(EX_OK);
/* disconnect from our controlling tty */
disconnect(2, CurEnv);
@@ -1379,13 +1455,8 @@ main(argc, argv, envp)
** Get authentication data
*/
- p = getauthinfo(fileno(InChannel));
+ p = getauthinfo(fileno(InChannel), &forged);
define('_', p, &BlankEnvelope);
-
- /* validate the connection */
- HoldErrs = TRUE;
- nullserver = !validate_connection(&RealHostAddr, RealHostName, CurEnv);
- HoldErrs = FALSE;
#endif /* DAEMON */
}
@@ -1398,13 +1469,24 @@ main(argc, argv, envp)
if (OpMode == MD_SMTP || OpMode == MD_DAEMON)
{
char pbuf[20];
- extern void smtp __P((bool, ENVELOPE *));
+ extern void smtp __P((char *, ENVELOPE *));
/*
** Save some macros for check_* rulesets.
*/
- define(macid("{client_name}", NULL), RealHostName, &BlankEnvelope);
+ if (forged)
+ {
+ char ipbuf[103];
+
+ snprintf(ipbuf, sizeof ipbuf, "[%.100s]",
+ inet_ntoa(RealHostAddr.sin.sin_addr));
+
+ define(macid("{client_name}", NULL),
+ newstr(ipbuf), &BlankEnvelope);
+ }
+ else
+ define(macid("{client_name}", NULL), RealHostName, &BlankEnvelope);
define(macid("{client_addr}", NULL),
newstr(anynet_ntoa(&RealHostAddr)), &BlankEnvelope);
if (RealHostAddr.sa.sa_family == AF_INET)
@@ -1413,6 +1495,14 @@ main(argc, argv, envp)
snprintf(pbuf, sizeof pbuf, "0");
define(macid("{client_port}", NULL), newstr(pbuf), &BlankEnvelope);
+ if (OpMode == MD_DAEMON)
+ {
+ /* validate the connection */
+ HoldErrs = TRUE;
+ nullserver = validate_connection(&RealHostAddr,
+ RealHostName, CurEnv);
+ HoldErrs = FALSE;
+ }
smtp(nullserver, CurEnv);
}
# endif /* SMTP */
@@ -1421,9 +1511,7 @@ main(argc, argv, envp)
if (OpMode == MD_VERIFY)
{
CurEnv->e_sendmode = SM_VERIFY;
- CurEnv->e_errormode = EM_PRINT;
PostMasterCopy = NULL;
- HoldErrs = FALSE;
}
else
{
@@ -1464,6 +1552,21 @@ main(argc, argv, envp)
if (Errors > 0 && ExitStat == EX_OK)
ExitStat = EX_USAGE;
+#if _FFR_FIX_DASHT
+ /*
+ ** If using -t, force not sending to argv recipients, even
+ ** if they are mentioned in the headers.
+ */
+
+ if (GrabTo)
+ {
+ ADDRESS *q;
+
+ for (q = CurEnv->e_sendqueue; q != NULL; q = q->q_next)
+ q->q_flags |= QDONTSEND;
+ }
+#endif
+
/*
** Read the input mail.
*/
@@ -1504,6 +1607,7 @@ main(argc, argv, envp)
}
CurEnv->e_to = NULL;
CurrentLA = getla();
+ GrabTo = FALSE;
sendall(CurEnv, SM_DEFAULT);
/*
@@ -1517,6 +1621,7 @@ main(argc, argv, envp)
}
+/* ARGSUSED */
SIGFUNC_DECL
intindebug(sig)
int sig;
@@ -1544,7 +1649,7 @@ finis()
{
if (tTd(2, 1))
{
- extern void printenvflags();
+ extern void printenvflags __P((ENVELOPE *));
printf("\n====finis: stat %d e_id=%s e_flags=",
ExitStat,
@@ -1605,6 +1710,7 @@ finis()
** Unlocks the current job.
*/
+/* ARGSUSED */
SIGFUNC_DECL
intsig(sig)
int sig;
@@ -1752,7 +1858,10 @@ disconnect(droplev, e)
(void) fclose(InChannel);
InChannel = stdin;
}
- (void) freopen("/dev/null", "r", stdin);
+ if (freopen("/dev/null", "r", stdin) == NULL)
+ sm_syslog(LOG_ERR, e->e_id,
+ "disconnect: freopen(\"/dev/null\") failed: %s",
+ errstring(errno));
/* output to the transcript */
if (OutChannel != stdout)
@@ -1763,9 +1872,21 @@ disconnect(droplev, e)
if (droplev > 0)
{
if (e->e_xfp == NULL)
+ {
fd = open("/dev/null", O_WRONLY, 0666);
+ if (fd == -1)
+ sm_syslog(LOG_ERR, e->e_id,
+ "disconnect: open(\"/dev/null\") failed: %s",
+ errstring(errno));
+ }
else
+ {
fd = fileno(e->e_xfp);
+ if (fd == -1)
+ sm_syslog(LOG_ERR, e->e_id,
+ "disconnect: fileno(e->e_xfp) failed: %s",
+ errstring(errno));
+ }
(void) fflush(stdout);
dup2(fd, STDOUT_FILENO);
dup2(fd, STDERR_FILENO);
@@ -1876,7 +1997,7 @@ auth_warning(e, msg, va_alist)
{
register char *p;
static char hostbuf[48];
- extern struct hostent *myhostname();
+ extern struct hostent *myhostname __P((char *, int));
if (hostbuf[0] == '\0')
(void) myhostname(hostbuf, sizeof hostbuf);
@@ -2017,6 +2138,7 @@ dumpstate(when)
}
+/* ARGSUSED */
SIGFUNC_DECL
sigusr1(sig)
int sig;
@@ -2026,6 +2148,7 @@ sigusr1(sig)
}
+/* ARGSUSED */
SIGFUNC_DECL
sighup(sig)
int sig;
@@ -2069,13 +2192,11 @@ drop_privileges(to_real_uid)
bool to_real_uid;
{
int rval = EX_OK;
-#ifdef NGROUPS_MAX
- GIDSET_T emptygidset[NGROUPS_MAX];
-#endif
+ GIDSET_T emptygidset[1];
if (tTd(47, 1))
printf("drop_privileges(%d): Real[UG]id=%d:%d, RunAs[UG]id=%d:%d\n",
- to_real_uid, RealUid, RealGid, RunAsUid, RunAsGid);
+ (int)to_real_uid, (int)RealUid, (int)RealGid, (int)RunAsUid, (int)RunAsGid);
if (to_real_uid)
{
@@ -2087,17 +2208,22 @@ drop_privileges(to_real_uid)
/* make sure no one can grab open descriptors for secret files */
endpwent();
-#ifdef NGROUPS_MAX
/* reset group permissions; these can be set later */
emptygidset[0] = (to_real_uid || RunAsGid != 0) ? RunAsGid : getegid();
- (void) setgroups(1, emptygidset);
-#endif
+ if (setgroups(1, emptygidset) == -1 && geteuid() == 0)
+ rval = EX_OSERR;
/* reset primary group and user id */
if ((to_real_uid || RunAsGid != 0) && setgid(RunAsGid) < 0)
rval = EX_OSERR;
if ((to_real_uid || RunAsUid != 0) && setuid(RunAsUid) < 0)
rval = EX_OSERR;
+ if (tTd(47, 5))
+ {
+ printf("drop_privileges: e/ruid = %d/%d e/rgid = %d/%d\n",
+ (int)geteuid(), (int)getuid(), (int)getegid(), (int)getgid());
+ printf("drop_privileges: RunAsUser = %d:%d\n", (int)RunAsUid, (int)RunAsGid);
+ }
return rval;
}
/*
@@ -2387,13 +2513,14 @@ testmodeline(line, e)
else if (strcasecmp(&line[1], "map") == 0)
{
auto int rcode = EX_OK;
+ char *av[2];
if (*p == '\0')
{
printf("Usage: /map mapname key\n");
return;
}
- for (q = p; *q != '\0' && !isspace(*q); q++)
+ for (q = p; *q != '\0' && !(isascii(*q) && isspace(*q)); q++)
continue;
if (*q == '\0')
{
@@ -2413,8 +2540,10 @@ testmodeline(line, e)
return;
}
printf("map_lookup: %s (%s) ", p, q);
+ av[0] = q;
+ av[1] = NULL;
p = (*map->s_map.map_class->map_lookup)
- (&map->s_map, q, NULL, &rcode);
+ (&map->s_map, q, av, &rcode);
if (p == NULL)
printf("no match (%d)\n", rcode);
else
@@ -2542,8 +2671,8 @@ testmodeline(line, e)
while (*p != '\0')
{
int stat;
- int rs = strtorwset(p, NULL, ST_FIND);
+ rs = strtorwset(p, NULL, ST_FIND);
if (rs < 0)
{
printf("Undefined ruleset %s\n", p);
diff --git a/usr.sbin/sendmail/src/makesendmail b/usr.sbin/sendmail/src/makesendmail
index a28e2f4cc4e..ab8a49d78ca 100644
--- a/usr.sbin/sendmail/src/makesendmail
+++ b/usr.sbin/sendmail/src/makesendmail
@@ -1,52 +1,127 @@
#!/bin/sh
-# Copyright (c) 1993, 1996-1997 Eric P. Allman
-# Copyright (c) 1993 The Regents of the University of California.
-# All rights reserved.
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1993, 1996-1997 Eric P. Allman. All rights reserved.
+# Copyright (c) 1993
+# The Regents of the University of California. All rights reserved.
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
+# 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.
#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
#
-# @(#)makesendmail 8.45 (Berkeley) 4/12/97
+# @(#)Build 8.93 (Berkeley) 6/24/98
#
#
-# A quick-and-dirty script to compile sendmail in the presence of
-# multiple architectures and Makefiles.
+# A quick-and-dirty script to compile sendmail and related programs
+# in the presence of multiple architectures. To use, just use
+# "sh Build".
#
-if [ "x${1-""}" = "x-m" ]
-then
- # show Makefile name only
- mflag=1
-else
- mflag=""
-fi
+trap "rm -f $obj/.settings$$; exit" 1 2 3 15
+
+cflag=""
+mflag=""
+sflag=""
+makeargs=""
+libdirs=""
+incdirs=""
+libsrch=""
+siteconfig=""
+EX_USAGE=64
+EX_NOINPUT=66
+EX_UNAVAILABLE=69
+
+while [ ! -z "$1" ]
+do
+ case $1
+ in
+ -c) # clean out existing $obj tree
+ cflag=1
+ shift
+ ;;
+
+ -m) # show Makefile name only
+ mflag=1
+ shift
+ ;;
+
+ -E*) # environment variables to pass into Build
+ arg=`echo $1 | sed 's/^-E//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ -z "$arg" ]
+ then
+ echo "Empty -E flag" >&2
+ exit $EX_USAGE
+ else
+ case $arg
+ in
+ *=*) # check format
+ eval $arg
+ export `echo $arg | sed 's;=.*;;'`
+ ;;
+ *) # bad format
+ echo "Bad format for -E argument ($arg)" >&2
+ exit $EX_USAGE
+ ;;
+ esac
+ shift
+ fi
+ ;;
+
+ -L*) # set up LIBDIRS
+ libdirs="$libdirs $1"
+ shift
+ ;;
+
+ -I*) # set up INCDIRS
+ incdirs="$incdirs $1"
+ shift
+ ;;
+
+ -f*) # select site config file
+ arg=`echo $1 | sed 's/^-f//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ "$siteconfig" ]
+ then
+ echo "Only one -f flag allowed" >&2
+ exit $EX_USAGE
+ else
+ siteconfig=$arg
+ if [ -z "$siteconfig" ]
+ then
+ echo "Missing argument for -f flag" >&2
+ exit $EX_USAGE
+ elif [ ! -f "$siteconfig" ]
+ then
+ echo "${siteconfig}: File not found"
+ exit $EX_NOINPUT
+ else
+ shift # move past argument
+ fi
+ fi
+ ;;
+
+ -S) # skip auto-configure
+ sflag="-s"
+ shift
+ ;;
+
+ *) # pass argument to make
+ makeargs="$makeargs \"$1\""
+ shift
+ ;;
+ esac
+done
#
# Do heuristic guesses !ONLY! for machines that do not have uname
@@ -80,6 +155,12 @@ then
rel=Mach
arch=luna88k
fi
+elif [ -d /usr/apollo -a -d \`node_data ]
+then
+ # probably a Apollo/DOMAIN
+ os=DomainOS
+ arch=$ISP
+ rel=`/usr/apollo/bin/bldt | grep Domain | awk '{ print $4 }' | sed -e 's/,//g'`
fi
if [ ! "$arch" -a ! "$os" -a ! "$rel" ]
@@ -106,6 +187,9 @@ in
9000/*) arch=`echo $arch | sed -e 's/9000.//' -e 's/..$/xx/'`;;
DS/907000) arch=ds90;;
+
+ NILE*) arch=NILE
+ os=`uname -v`;;
esac
# tweak operating system type and release
@@ -115,15 +199,19 @@ then
# old versions of SCO UNIX set uname -s the same as uname -n
os=SCO_SV
fi
-if [ "$os" = "$node" -a "$rel" = 4.0 -a "$arch" = "3360,3430-R" ]
+if [ "$rel" = 4.0 ]
then
- # AT&T/NCR Machines also set uname -s == uname -n
- if [ -d /usr/sadm/sysadm/add-ons/WIN-TCP ]
- then
- os=NCR.MP-RAS.2.x
- else
- os=NCR.MP-RAS.3.x
- fi
+ case $arch in
+ 3[34]??|3[34]??,*)
+ if [ -d /usr/sadm/sysadm/add-ons/WIN-TCP ]
+ then
+ os=NCR.MP-RAS.2.x
+ elif [ -d /usr/sadm/sysadm/add-ons/inet ]
+ then
+ os=NCR.MP-RAS.3.x
+ fi
+ ;;
+ esac
fi
case $os
@@ -131,11 +219,19 @@ in
DYNIX-ptx) os=PTX;;
Paragon*) os=Paragon;;
HP-UX) rel=`echo $rel | sed -e 's/^[^.]*\.0*//'`;;
- AIX) rel=`uname -v`
- if [ "$rel" = "2" ]
- then
- arch=""
- fi;;
+ AIX) rela=$rel
+ rel=`uname -v`
+ case $rel in
+ 2) arch=""
+ ;;
+ 4) if [ "$rela" = "3" ]
+ then
+ arch=$rela
+ fi
+ ;;
+ esac
+ rel=$rel.$rela
+ ;;
BSD-386) os=BSD-OS;;
SCO_SV) os=SCO; rel=`uname -X | sed -n 's/Release = 3.2v//p'`;;
UNIX_System_V) if [ "$arch" = "ds90" ]
@@ -144,6 +240,10 @@ in
rel=`uname -v | sed -e 's/\(V.*\)L.*/\1/'`
fi;;
SINIX-?) os=SINIX;;
+ DomainOS) case $rel in
+ 10.4*) rel=10.4;;
+ esac
+ ;;
esac
# get "base part" of operating system release
@@ -201,6 +301,17 @@ fi
echo "Configuration: os=$os, rel=$rel, rbase=$rbase, rroot=$rroot, arch=$arch, sfx=$sfx"
+
+SMROOT=${SMROOT-..}
+BUILDTOOLS=${BUILDTOOLS-$SMROOT/BuildTools}
+export SMROOT BUILDTOOLS
+
+# see if we are in a Build-able directory
+if [ ! -f Makefile.m4 ]; then
+ echo "Makefile.m4 not found. Build can only be run from a source directory."
+ exit $EX_UNAVAILABLE
+fi
+
# now try to find a reasonable object directory
if [ -r obj.$os.$rel.$arch$sfx ]; then
obj=obj.$os.$rel.$arch$sfx
@@ -226,75 +337,161 @@ elif [ -r obj.$rel$sfx ]; then
obj=obj.$rel$sfx
elif [ -r obj$sfx ]; then
obj=obj$sfx
-else
- # no existing obj directory -- try to create one if Makefile found
- obj=obj.$os.$rel.$arch$sfx
- if [ -r Makefiles/Makefile.$os.$rel.$arch$sfx ]; then
- makefile=Makefile.$os.$rel.$arch$sfx
- elif [ -r Makefiles/Makefile.$os.$rel.$arch ]; then
- makefile=Makefile.$os.$rel.$arch
- elif [ -r Makefiles/Makefile.$os.$rroot.$arch$sfx ]; then
- makefile=Makefile.$os.$rroot.$arch$sfx
- elif [ -r Makefiles/Makefile.$os.$rroot.$arch ]; then
- makefile=Makefile.$os.$rroot.$arch
- elif [ -r Makefiles/Makefile.$os.$rbase.x.$arch$sfx ]; then
- makefile=Makefile.$os.$rbase.x.$arch$sfx
- elif [ -r Makefiles/Makefile.$os.$rbase.x.$arch ]; then
- makefile=Makefile.$os.$rbase.x.$arch
- elif [ -r Makefiles/Makefile.$os.$rel$sfx ]; then
- makefile=Makefile.$os.$rel$sfx
- elif [ -r Makefiles/Makefile.$os.$rel ]; then
- makefile=Makefile.$os.$rel
- elif [ -r Makefiles/Makefile.$os.$rroot$sfx ]; then
- makefile=Makefile.$os.$rroot$sfx
- elif [ -r Makefiles/Makefile.$os.$rroot ]; then
- makefile=Makefile.$os.$rroot
- elif [ -r Makefiles/Makefile.$os.$rbase.x$sfx ]; then
- makefile=Makefile.$os.$rbase.x$sfx
- elif [ -r Makefiles/Makefile.$os.$rbase.x ]; then
- makefile=Makefile.$os.$rbase.x
- elif [ -r Makefiles/Makefile.$os.$arch$sfx ]; then
- makefile=Makefile.$os.$arch$sfx
- elif [ -r Makefiles/Makefile.$os.$arch ]; then
- makefile=Makefile.$os.$arch
- elif [ -r Makefiles/Makefile.$rel.$arch$sfx ]; then
- makefile=Makefile.$rel.$arch$sfx
- elif [ -r Makefiles/Makefile.$rel.$arch ]; then
- makefile=Makefile.$rel.$arch
- elif [ -r Makefiles/Makefile.$rroot.$arch$sfx ]; then
- makefile=Makefile.$rroot.$arch$sfx
- elif [ -r Makefiles/Makefile.$rroot.$arch ]; then
- makefile=Makefile.$rroot.$arch
- elif [ -r Makefiles/Makefile.$rbase.x.$arch$sfx ]; then
- makefile=Makefile.$rbase.x.$arch$sfx
- elif [ -r Makefiles/Makefile.$rbase.x.$arch ]; then
- makefile=Makefile.$rbase.x.$arch
- elif [ -r Makefiles/Makefile.$os$sfx ]; then
- makefile=Makefile.$os$sfx
- elif [ -r Makefiles/Makefile.$os ]; then
- makefile=Makefile.$os
- elif [ -r Makefiles/Makefile.$arch$sfx ]; then
- makefile=Makefile.$arch$sfx
- elif [ -r Makefiles/Makefile.$arch ]; then
- makefile=Makefile.$arch
- elif [ -r Makefiles/Makefile.$rel$sfx ]; then
- makefile=Makefile.$rel$sfx
- elif [ -r Makefiles/Makefile.$rel ]; then
- makefile=Makefile.$rel
- elif [ -r Makefiles/Makefile.$rel$sfx ]; then
- makefile=Makefile.$rel$sfx
+fi
+if [ -z "$obj" -o "$cflag" ]
+then
+ if [ -n "$obj" ]
+ then
+ echo "Clearing out existing $obj tree"
+ rm -rf $obj
else
- echo "Cannot determine how to support $arch.$os.$rel"
- exit 1
+ # no existing obj directory -- try to create one if Makefile found
+ obj=obj.$os.$rel.$arch$sfx
+ fi
+ if [ -r $BUILDTOOLS/OS/$os.$rel.$arch$sfx ]; then
+ oscf=$os.$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel.$arch ]; then
+ oscf=$os.$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch$sfx ]; then
+ oscf=$os.$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch ]; then
+ oscf=$os.$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch$sfx ]; then
+ oscf=$os.$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch ]; then
+ oscf=$os.$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rel$sfx ]; then
+ oscf=$os.$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel ]; then
+ oscf=$os.$rel
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot$sfx ]; then
+ oscf=$os.$rroot$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot ]; then
+ oscf=$os.$rroot
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x$sfx ]; then
+ oscf=$os.$rbase.x$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x ]; then
+ oscf=$os.$rbase.x
+ elif [ -r $BUILDTOOLS/OS/$os.$arch$sfx ]; then
+ oscf=$os.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$arch ]; then
+ oscf=$os.$arch
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch$sfx ]; then
+ oscf=$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch ]; then
+ oscf=$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch$sfx ]; then
+ oscf=$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch ]; then
+ oscf=$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch$sfx ]; then
+ oscf=$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch ]; then
+ oscf=$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os$sfx ]; then
+ oscf=$os$sfx
+ elif [ -r $BUILDTOOLS/OS/$os ]; then
+ oscf=$os
+ elif [ -r $BUILDTOOLS/OS/$arch$sfx ]; then
+ oscf=$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$arch ]; then
+ oscf=$arch
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel ]; then
+ oscf=$rel
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ else
+ echo "Cannot determine how to support $arch.$os.$rel" >&2
+ exit $EX_UNAVAILABLE
+ fi
+ M4=`sh $BUILDTOOLS/bin/find_m4.sh`
+ ret=$?
+ if [ $ret -ne 0 ]
+ then
+ exit $ret
fi
+ echo "Using M4=$M4"
+ export M4
if [ "$mflag" ]
then
- echo "Will run in virgin $obj using $makefile"
+ echo "Will run in virgin $obj using $BUILDTOOLS/OS/$oscf"
exit 0
fi
- echo "Creating $obj using $makefile"
+ if [ "$ABI" ]
+ then
+ echo "Using ABI $ABI"
+ fi
+ echo "Creating $obj using $BUILDTOOLS/OS/$oscf"
mkdir $obj
- (cd $obj; ln -s ../*.[ch158] ../sendmail.hf .; ln -s ../Makefiles/$makefile Makefile)
+ (cd $obj; ln -s ../*.[ch158] .)
+ if [ -f sendmail.hf ]
+ then
+ (cd $obj; ln -s ../sendmail.hf .)
+ fi
+
+ rm -f $obj/.settings$$
+ echo 'divert(-1)' > $obj/.settings$$
+ cat $BUILDTOOLS/M4/header.m4 >> $obj/.settings$$
+ if [ "$ABI" ]
+ then
+ echo "define(\`confABI', \`$ABI')" >> $obj/.settings$$
+ fi
+ cat $BUILDTOOLS/OS/$oscf >> $obj/.settings$$
+
+ if [ -z "$siteconfig" ]
+ then
+ # none specified, use defaults
+ if [ -f $BUILDTOOLS/Site/site.$oscf$sfx.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf$sfx.m4
+ elif [ -f $BUILDTOOLS/Site/site.$oscf.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf.m4
+ fi
+ if [ -f $BUILDTOOLS/Site/site.config.m4 ]
+ then
+ siteconfig="$BUILDTOOLS/Site/site.config.m4 $siteconfig"
+ fi
+ fi
+ if [ ! -z "$siteconfig" ]
+ then
+ echo "Including $siteconfig"
+ cat $siteconfig >> $obj/.settings$$
+ fi
+ if [ "$libdirs" ]
+ then
+ echo "define(\`confLIBDIRS', confLIBDIRS \`\`$libdirs'')" >> $obj/.settings$$
+ fi
+ if [ "$incdirs" ]
+ then
+ echo "define(\`confINCDIRS', confINCDIRS \`\`$incdirs'')" >> $obj/.settings$$
+ fi
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ libdirs=`(cat $obj/.settings$$; echo "_SRIDBIL_= confLIBDIRS" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_SRIDBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_SRIDBIL_=//"`
+ libsrch=`(cat $obj/.settings$$; echo "_HCRSBIL_= confLIBSEARCH" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_HCRSBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_HCRSBIL_=//"`
+ echo 'divert(-1)' >> $obj/.settings$$
+ LIBDIRS="$libdirs" LIBSRCH="$libsrch" SITECONFIG="$siteconfig" sh $BUILDTOOLS/bin/configure.sh $sflag $oscf >> $obj/.settings$$
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' $obj/.settings$$ | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - Makefile.m4 | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' > $obj/Makefile
+ if [ $? -ne 0 -o ! -s $obj/Makefile ]
+ then
+ echo "ERROR: ${M4} failed; You may need a newer version of M4, at least as new as System V or GNU" 1>&2
+ rm -rf $obj
+ exit $EX_UNAVAILABLE
+ fi
+ rm -f $obj/.settings$$
echo "Making dependencies in $obj"
(cd $obj; ${MAKE-make} depend)
fi
@@ -304,28 +501,13 @@ then
makefile=`ls -l $obj/Makefile | sed 's/.* //'`
if [ -z "$makefile" ]
then
- echo "ERROR: $obj exists but has no Makefile"
- exit 1
+ echo "ERROR: $obj exists but has no Makefile" >&2
+ exit $EX_NOINPUT
fi
- case $makefile
- in
- ../Makefiles/*)
- makefile=`echo $makefile | sed 's/...Makefiles.//'`
- echo "Will run in existing $obj using $makefile"
- ;;
-
- *)
- echo "Will run in existing $obj using custom $makefile"
- ;;
- esac
+ echo "Will run in existing $obj using $makefile"
exit 0
fi
echo "Making in $obj"
cd $obj
-if [ $# = 0 ]
-then
- exec ${MAKE-make}
-else
- exec ${MAKE-make} "$@"
-fi
+eval exec ${MAKE-make} $makeargs
diff --git a/usr.sbin/sendmail/src/map.c b/usr.sbin/sendmail/src/map.c
index 5e77fb4630b..4c95b7fd6ab 100644
--- a/usr.sbin/sendmail/src/map.c
+++ b/usr.sbin/sendmail/src/map.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1992, 1995-1997 Eric P. Allman.
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1992, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)map.c 8.186 (Berkeley) 10/21/97";
+static char sccsid[] = "@(#)map.c 8.239 (Berkeley) 6/5/98";
#endif /* not lint */
#include "sendmail.h"
@@ -42,13 +20,16 @@ static char sccsid[] = "@(#)map.c 8.186 (Berkeley) 10/21/97";
# include <ndbm.h>
# ifdef R_FIRST
ERROR README: You are running the Berkeley DB version of ndbm.h. See
- ERROR README: the READ_ME file about tweaking Berkeley DB so it can
+ ERROR README: the README file about tweaking Berkeley DB so it can
ERROR README: coexist with NDBM, or delete -DNDBM from the Makefile
ERROR README: and use -DNEWDB instead.
# endif
#endif
#ifdef NEWDB
# include <db.h>
+# ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+# endif
#endif
#ifdef NIS
struct dom_binding; /* forward reference needed on IRIX */
@@ -182,6 +163,10 @@ map_parseargs(map, ap)
map->map_app = ++p;
break;
+ case 'T':
+ map->map_tapp = ++p;
+ break;
+
case 'k':
while (isascii(*++p) && isspace(*p))
continue;
@@ -236,6 +221,8 @@ map_parseargs(map, ap)
}
if (map->map_app != NULL)
map->map_app = newstr(map->map_app);
+ if (map->map_tapp != NULL)
+ map->map_tapp = newstr(map->map_tapp);
if (map->map_keycolnm != NULL)
map->map_keycolnm = newstr(map->map_keycolnm);
if (map->map_valcolnm != NULL)
@@ -289,21 +276,21 @@ char *
map_rewrite(map, s, slen, av)
register MAP *map;
register const char *s;
- int slen;
+ size_t slen;
char **av;
{
register char *bp;
register char c;
char **avp;
register char *ap;
- int i;
- int len;
- static int buflen = -1;
+ size_t l;
+ size_t len;
+ static size_t buflen = 0;
static char *buf = NULL;
if (tTd(39, 1))
{
- printf("map_rewrite(%.*s), av =", slen, s);
+ printf("map_rewrite(%.*s), av =", (int)slen, s);
if (av == NULL)
printf(" (nullv)");
else
@@ -315,16 +302,16 @@ map_rewrite(map, s, slen, av)
}
/* count expected size of output (can safely overestimate) */
- i = len = slen;
+ l = len = slen;
if (av != NULL)
{
const char *sp = s;
- for (i = slen; --i >= 0 && (c = *sp++) != 0; )
+ while (l-- > 0 && (c = *sp++) != '\0')
{
if (c != '%')
continue;
- if (--i < 0)
+ if (l-- <= 0)
break;
c = *sp++;
if (!(isascii(c) && isdigit(c)))
@@ -355,7 +342,7 @@ map_rewrite(map, s, slen, av)
}
else
{
- while (--slen >= 0 && (c = *s++) != '\0')
+ while (slen-- > 0 && (c = *s++) != '\0')
{
if (c != '%')
{
@@ -363,7 +350,7 @@ map_rewrite(map, s, slen, av)
*bp++ = c;
continue;
}
- if (--slen < 0 || (c = *s++) == '\0')
+ if (slen-- <= 0 || (c = *s++) == '\0')
c = '%';
if (c == '%')
goto pushc;
@@ -411,7 +398,7 @@ initmaps(rebuild, e)
bool rebuild;
register ENVELOPE *e;
{
- extern void map_init();
+ extern void map_init __P((STAB *, int));
#if XDEBUG
checkfd012("entering initmaps");
@@ -473,10 +460,10 @@ map_init(s, pass)
map->map_class->map_close(map);
map->map_mflags &= ~(MF_OPEN|MF_WRITABLE);
}
-
+
if (pass == 2)
{
- rebuildaliases(map, FALSE);
+ (void) rebuildaliases(map, FALSE);
return;
}
@@ -760,26 +747,55 @@ ndbm_map_open(map, mode)
sff = SFF_ROOTOK|SFF_REGONLY;
if (mode == O_RDWR)
{
- sff |= SFF_NOLINK|SFF_CREAT;
+ sff |= SFF_CREAT;
+ if (!bitset(DBS_WRITEMAPTOSYMLINK, DontBlameSendmail))
+ sff |= SFF_NOSLINK;
+ if (!bitset(DBS_WRITEMAPTOHARDLINK, DontBlameSendmail))
+ sff |= SFF_NOHLINK;
smode = S_IWRITE;
}
else
{
- sff |= SFF_NOWLINK;
+ if (!bitset(DBS_LINKEDMAPINWRITABLEDIR, DontBlameSendmail))
+ sff |= SFF_NOWLINK;
}
- if (FatalWritableDirs)
+ if (!bitset(DBS_MAPINUNSAFEDIRPATH, DontBlameSendmail))
sff |= SFF_SAFEDIRPATH;
- if ((ret = safefile(dirfile, RunAsUid, RunAsGid, RunAsUserName,
- sff, smode, &std)) != 0 ||
- (ret = safefile(pagfile, RunAsUid, RunAsGid, RunAsUserName,
- sff, smode, &stp)) != 0)
+ ret = safefile(dirfile, RunAsUid, RunAsGid, RunAsUserName,
+ sff, smode, &std);
+ if (ret == 0)
+ ret = safefile(pagfile, RunAsUid, RunAsGid, RunAsUserName,
+ sff, smode, &stp);
+ if (ret == ENOENT && AutoRebuild &&
+ bitset(MCF_REBUILDABLE, map->map_class->map_cflags) &&
+ (bitset(MF_IMPL_NDBM, map->map_mflags) ||
+ bitset(MF_ALIAS, map->map_mflags)) &&
+ mode == O_RDONLY)
+ {
+ bool impl = bitset(MF_IMPL_NDBM, map->map_mflags);
+ extern bool impl_map_open __P((MAP *, int));
+
+ /* may be able to rebuild */
+ map->map_mflags &= ~MF_IMPL_NDBM;
+ if (!rebuildaliases(map, TRUE))
+ return FALSE;
+ if (impl)
+ return impl_map_open(map, O_RDONLY);
+ else
+ return ndbm_map_open(map, O_RDONLY);
+ }
+ if (ret != 0)
{
+ char *prob = "unsafe";
+
/* cannot open this map */
+ if (ret == ENOENT)
+ prob = "missing";
if (tTd(38, 2))
- printf("\tunsafe map file: %d\n", ret);
+ printf("\t%s map file: %d\n", prob, ret);
if (!bitset(MF_OPTIONAL, map->map_mflags))
- syserr("dbm map \"%s\": unsafe map file %s",
- map->map_mname, map->map_file);
+ syserr("dbm map \"%s\": %s map file %s",
+ map->map_mname, prob, map->map_file);
return FALSE;
}
if (std.st_mode == ST_MODE_NOFILE)
@@ -811,11 +827,15 @@ ndbm_map_open(map, mode)
int dirfd;
int pagfd;
+ int sff = SFF_CREAT|SFF_OPENASROOT;
+
+ if (!bitset(DBS_WRITEMAPTOSYMLINK, DontBlameSendmail))
+ sff |= SFF_NOSLINK;
+ if (!bitset(DBS_WRITEMAPTOHARDLINK, DontBlameSendmail))
+ sff |= SFF_NOHLINK;
- dirfd = safeopen(dirfile, mode, DBMMODE,
- SFF_NOLINK|SFF_CREAT|SFF_OPENASROOT);
- pagfd = safeopen(pagfile, mode, DBMMODE,
- SFF_NOLINK|SFF_CREAT|SFF_OPENASROOT);
+ dirfd = safeopen(dirfile, mode, DBMMODE, sff);
+ pagfd = safeopen(pagfile, mode, DBMMODE, sff);
if (dirfd < 0 || pagfd < 0)
{
@@ -901,8 +921,8 @@ ndbm_map_open(map, mode)
return FALSE;
}
- if (filechanged(dirfile, dfd, &std, sff) ||
- filechanged(pagfile, pfd, &stp, sff))
+ if (filechanged(dirfile, dfd, &std) ||
+ filechanged(pagfile, pfd, &stp))
{
int save_errno = errno;
@@ -933,6 +953,20 @@ ndbm_map_open(map, mode)
else
{
map->map_mflags |= MF_LOCKED;
+ if (geteuid() == 0 && TrustedFileUid != 0)
+ {
+ if (fchown(dfd, TrustedFileUid, -1) < 0 ||
+ fchown(pfd, TrustedFileUid, -1) < 0)
+ {
+ int err = errno;
+
+ sm_syslog(LOG_ALERT, NOQID,
+ "ownership change on %s failed: %s",
+ map->map_file, errstring(err));
+ message("050 ownership change on %s failed: %s",
+ map->map_file, errstring(err));
+ }
+ }
}
if (fstat(dfd, &st) >= 0)
map->map_mtime = st.st_mtime;
@@ -975,7 +1009,7 @@ lockdbm:
fd = dbm_dirfno((DBM *) map->map_db1);
if (fd >= 0 && !bitset(MF_LOCKED, map->map_mflags))
(void) lockfile(fd, map->map_file, ".dir", LOCK_SH);
- if (fd < 0 || fstat(fd, &stbuf) < 0 || stbuf.st_mtime > map->map_mtime)
+ if (fd < 0 || fstat(fd, &stbuf) < 0 || stbuf.st_mtime > map->map_mtime)
{
/* Reopen the database to sync the cache */
int omode = bitset(map->map_mflags, MF_WRITABLE) ? O_RDWR
@@ -983,7 +1017,7 @@ lockdbm:
map->map_class->map_close(map);
map->map_mflags &= ~(MF_OPEN|MF_WRITABLE);
- if (map->map_class->map_open(map, omode))
+ if (map->map_class->map_open(map, omode))
{
map->map_mflags |= MF_OPEN;
if ((omode && O_ACCMODE) == O_RDWR)
@@ -992,7 +1026,7 @@ lockdbm:
}
else
{
- if (!bitset(MF_OPTIONAL, map->map_mflags))
+ if (!bitset(MF_OPTIONAL, map->map_mflags))
{
extern MAPCLASS BogusMapClass;
@@ -1082,7 +1116,8 @@ ndbm_map_store(map, lhs, rhs)
auto int xstat;
datum old;
- old.dptr = ndbm_map_lookup(map, key.dptr, NULL, &xstat);
+ old.dptr = ndbm_map_lookup(map, key.dptr,
+ (char **)NULL, &xstat);
if (old.dptr != NULL && *(char *) old.dptr != '\0')
{
old.dsize = strlen(old.dptr);
@@ -1117,14 +1152,14 @@ ndbm_map_close(map)
register MAP *map;
{
if (tTd(38, 9))
- printf("ndbm_map_close(%s, %s, %x)\n",
+ printf("ndbm_map_close(%s, %s, %lx)\n",
map->map_mname, map->map_file, map->map_mflags);
if (bitset(MF_WRITABLE, map->map_mflags))
{
#ifdef NDBM_YP_COMPAT
bool inclnull;
- char buf[MAXHOSTNAMELEN];
+ char buf[200];
inclnull = bitset(MF_INCLNULL, map->map_mflags);
map->map_mflags &= ~MF_INCLNULL;
@@ -1179,14 +1214,22 @@ ndbm_map_close(map)
** be pokey about it. That's hard to do.
*/
+#if DB_VERSION_MAJOR < 2
extern bool db_map_open __P((MAP *, int, char *, DBTYPE, const void *));
+#else
+extern bool db_map_open __P((MAP *, int, char *, DBTYPE, DB_INFO *));
+#endif
/* these should be K line arguments */
-#ifndef DB_CACHE_SIZE
-# define DB_CACHE_SIZE (1024 * 1024) /* database memory cache size */
-#endif
-#ifndef DB_HASH_NELEM
-# define DB_HASH_NELEM 4096 /* (starting) size of hash table */
+#if DB_VERSION_MAJOR < 2
+# define db_cachesize cachesize
+# define h_nelem nelem
+# ifndef DB_CACHE_SIZE
+# define DB_CACHE_SIZE (1024 * 1024) /* database memory cache size */
+# endif
+# ifndef DB_HASH_NELEM
+# define DB_HASH_NELEM 4096 /* (starting) size of hash table */
+# endif
#endif
bool
@@ -1194,14 +1237,20 @@ bt_map_open(map, mode)
MAP *map;
int mode;
{
+#if DB_VERSION_MAJOR < 2
BTREEINFO btinfo;
+#else
+ DB_INFO btinfo;
+#endif
if (tTd(38, 2))
printf("bt_map_open(%s, %s, %d)\n",
map->map_mname, map->map_file, mode);
bzero(&btinfo, sizeof btinfo);
- btinfo.cachesize = DB_CACHE_SIZE;
+#ifdef DB_CACHE_SIZE
+ btinfo.db_cachesize = DB_CACHE_SIZE;
+#endif
return db_map_open(map, mode, "btree", DB_BTREE, &btinfo);
}
@@ -1210,15 +1259,23 @@ hash_map_open(map, mode)
MAP *map;
int mode;
{
+#if DB_VERSION_MAJOR < 2
HASHINFO hinfo;
+#else
+ DB_INFO hinfo;
+#endif
if (tTd(38, 2))
printf("hash_map_open(%s, %s, %d)\n",
map->map_mname, map->map_file, mode);
bzero(&hinfo, sizeof hinfo);
- hinfo.nelem = DB_HASH_NELEM;
- hinfo.cachesize = DB_CACHE_SIZE;
+#ifdef DB_HASH_NELEM
+ hinfo.h_nelem = DB_HASH_NELEM;
+#endif
+#ifdef DB_CACHE_SIZE
+ hinfo.db_cachesize = DB_CACHE_SIZE;
+#endif
return db_map_open(map, mode, "hash", DB_HASH, &hinfo);
}
@@ -1228,9 +1285,13 @@ db_map_open(map, mode, mapclassname, dbtype, openinfo)
int mode;
char *mapclassname;
DBTYPE dbtype;
+#if DB_VERSION_MAJOR < 2
const void *openinfo;
+#else
+ DB_INFO *openinfo;
+#endif
{
- DB *db;
+ DB *db = NULL;
int i;
int omode;
int smode = S_IREAD;
@@ -1252,25 +1313,54 @@ db_map_open(map, mode, mapclassname, dbtype, openinfo)
sff = SFF_ROOTOK|SFF_REGONLY;
if (mode == O_RDWR)
{
- sff |= SFF_NOLINK|SFF_CREAT;
+ sff |= SFF_CREAT;
+ if (!bitset(DBS_WRITEMAPTOSYMLINK, DontBlameSendmail))
+ sff |= SFF_NOSLINK;
+ if (!bitset(DBS_WRITEMAPTOHARDLINK, DontBlameSendmail))
+ sff |= SFF_NOHLINK;
smode = S_IWRITE;
}
else
{
- sff |= SFF_NOWLINK;
+ if (!bitset(DBS_LINKEDMAPINWRITABLEDIR, DontBlameSendmail))
+ sff |= SFF_NOWLINK;
}
- if (FatalWritableDirs)
+ if (!bitset(DBS_MAPINUNSAFEDIRPATH, DontBlameSendmail))
sff |= SFF_SAFEDIRPATH;
- if ((i = safefile(buf, RunAsUid, RunAsGid, RunAsUserName,
- sff, smode, &st)) != 0)
+ i = safefile(buf, RunAsUid, RunAsGid, RunAsUserName, sff, smode, &st);
+ if (i == ENOENT && AutoRebuild &&
+ bitset(MCF_REBUILDABLE, map->map_class->map_cflags) &&
+ (bitset(MF_IMPL_HASH, map->map_mflags) ||
+ bitset(MF_ALIAS, map->map_mflags)) &&
+ mode == O_RDONLY)
+ {
+ bool impl = bitset(MF_IMPL_HASH, map->map_mflags);
+ extern bool impl_map_open __P((MAP *, int));
+
+ /* may be able to rebuild */
+ map->map_mflags &= ~MF_IMPL_HASH;
+ if (!rebuildaliases(map, TRUE))
+ return FALSE;
+ if (impl)
+ return impl_map_open(map, O_RDONLY);
+ else
+ return db_map_open(map, O_RDONLY, mapclassname,
+ dbtype, openinfo);
+ }
+
+ if (i != 0)
{
+ char *prob = "unsafe";
+
/* cannot open this map */
+ if (i == ENOENT)
+ prob = "missing";
if (tTd(38, 2))
- printf("\tunsafe map file: %s\n", errstring(i));
+ printf("\t%s map file: %s\n", prob, errstring(i));
errno = i;
if (!bitset(MF_OPTIONAL, map->map_mflags))
- syserr("%s map \"%s\": unsafe map file %s",
- mapclassname, map->map_mname, map->map_file);
+ syserr("%s map \"%s\": %s map file %s",
+ mapclassname, map->map_mname, prob, buf);
return FALSE;
}
if (st.st_mode == ST_MODE_NOFILE)
@@ -1281,10 +1371,8 @@ db_map_open(map, mode, mapclassname, dbtype, openinfo)
#if LOCK_ON_OPEN
if (mode == O_RDWR)
omode |= O_TRUNC|O_EXLOCK;
-# if !OLD_NEWDB
else
omode |= O_SHLOCK;
-# endif
#else
/*
** Pre-lock the file to avoid race conditions. In particular,
@@ -1301,7 +1389,7 @@ db_map_open(map, mode, mapclassname, dbtype, openinfo)
}
/* make sure no baddies slipped in just before the open... */
- if (filechanged(buf, fd, &st, sff))
+ if (filechanged(buf, fd, &st))
{
int save_errno = errno;
@@ -1333,7 +1421,23 @@ db_map_open(map, mode, mapclassname, dbtype, openinfo)
omode &= ~(O_EXCL|O_CREAT);
#endif
+#if DB_VERSION_MAJOR < 2
db = dbopen(buf, omode, DBMMODE, dbtype, openinfo);
+#else
+ {
+ int flags = 0;
+
+ if (mode == O_RDONLY)
+ flags |= DB_RDONLY;
+ if (bitset(O_CREAT, omode))
+ flags |= DB_CREATE;
+ if (bitset(O_TRUNC, omode))
+ flags |= DB_TRUNCATE;
+
+ errno = db_open(buf, dbtype, flags, DBMMODE,
+ NULL, openinfo, &db);
+ }
+#endif
saveerrno = errno;
#if !LOCK_ON_OPEN
@@ -1355,15 +1459,25 @@ db_map_open(map, mode, mapclassname, dbtype, openinfo)
errno = saveerrno;
if (!bitset(MF_OPTIONAL, map->map_mflags))
syserr("Cannot open %s database %s",
- mapclassname, map->map_file);
+ mapclassname, buf);
return FALSE;
}
- if (filechanged(buf, db->fd(db), &st, sff))
+#if DB_VERSION_MAJOR < 2
+ fd = db->fd(db);
+#else
+ fd = -1;
+ errno = db->fd(db, &fd);
+#endif
+ if (filechanged(buf, fd, &st))
{
int save_errno = errno;
+#if DB_VERSION_MAJOR < 2
db->close(db);
+#else
+ errno = db->close(db, 0);
+#endif
#if !LOCK_ON_OPEN
if (map->map_lockfd >= 0)
close(map->map_lockfd);
@@ -1375,26 +1489,34 @@ db_map_open(map, mode, mapclassname, dbtype, openinfo)
if (mode == O_RDWR)
map->map_mflags |= MF_LOCKED;
-#if !OLD_NEWDB
- fd = db->fd(db);
-# if LOCK_ON_OPEN
+#if LOCK_ON_OPEN
if (fd >= 0 && mode == O_RDONLY)
{
(void) lockfile(fd, buf, NULL, LOCK_UN);
}
-# endif
#endif
/* try to make sure that at least the database header is on disk */
if (mode == O_RDWR)
-#if OLD_NEWDB
- (void) db->sync(db);
-#else
+ {
(void) db->sync(db, 0);
+ if (geteuid() == 0 && TrustedFileUid != 0)
+ {
+ if (fchown(fd, TrustedFileUid, -1) < 0)
+ {
+ int err = errno;
+
+ sm_syslog(LOG_ALERT, NOQID,
+ "ownership change on %s failed: %s",
+ buf, errstring(err));
+ message("050 ownership change on %s failed: %s",
+ buf, errstring(err));
+ }
+ }
+ }
if (fd >= 0 && fstat(fd, &st) >= 0)
map->map_mtime = st.st_mtime;
-#endif
map->map_db2 = (ARBPTR_T) db;
if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags) &&
@@ -1425,6 +1547,9 @@ db_map_lookup(map, name, av, statp)
char keybuf[MAXNAME + 1];
char buf[MAXNAME + 1];
+ bzero(&key, sizeof key);
+ bzero(&val, sizeof val);
+
if (tTd(38, 20))
printf("db_map_lookup(%s, %s)\n",
map->map_mname, name);
@@ -1445,12 +1570,16 @@ db_map_lookup(map, name, av, statp)
keybuf[key.size] = '\0';
if (!bitset(MF_NOFOLDCASE, map->map_mflags))
makelower(keybuf);
-#if !OLD_NEWDB
lockdb:
+#if DB_VERSION_MAJOR < 2
fd = db->fd(db);
+#else
+ fd = -1;
+ errno = db->fd(db, &fd);
+#endif
if (fd >= 0 && !bitset(MF_LOCKED, map->map_mflags))
(void) lockfile(fd, buf, ".db", LOCK_SH);
- if (fd < 0 || fstat(fd, &stbuf) < 0 || stbuf.st_mtime > map->map_mtime)
+ if (fd < 0 || fstat(fd, &stbuf) < 0 || stbuf.st_mtime > map->map_mtime)
{
/* Reopen the database to sync the cache */
int omode = bitset(map->map_mflags, MF_WRITABLE) ? O_RDWR
@@ -1458,7 +1587,7 @@ db_map_lookup(map, name, av, statp)
map->map_class->map_close(map);
map->map_mflags &= ~(MF_OPEN|MF_WRITABLE);
- if (map->map_class->map_open(map, omode))
+ if (map->map_class->map_open(map, omode))
{
map->map_mflags |= MF_OPEN;
if ((omode && O_ACCMODE) == O_RDWR)
@@ -1468,7 +1597,7 @@ db_map_lookup(map, name, av, statp)
}
else
{
- if (!bitset(MF_OPTIONAL, map->map_mflags))
+ if (!bitset(MF_OPTIONAL, map->map_mflags))
{
extern MAPCLASS BogusMapClass;
@@ -1481,27 +1610,62 @@ db_map_lookup(map, name, av, statp)
return NULL;
}
}
-#endif
-
+
st = 1;
if (bitset(MF_TRY0NULL, map->map_mflags))
{
+#if DB_VERSION_MAJOR < 2
st = db->get(db, &key, &val, 0);
+#else
+ errno = db->get(db, NULL, &key, &val, 0);
+ switch (errno)
+ {
+ case DB_NOTFOUND:
+ case DB_KEYEMPTY:
+ st = 1;
+ break;
+
+ case 0:
+ st = 0;
+ break;
+
+ default:
+ st = -1;
+ break;
+ }
+#endif
if (st == 0)
map->map_mflags &= ~MF_TRY1NULL;
}
if (st != 0 && bitset(MF_TRY1NULL, map->map_mflags))
{
key.size++;
+#if DB_VERSION_MAJOR < 2
st = db->get(db, &key, &val, 0);
+#else
+ errno = db->get(db, NULL, &key, &val, 0);
+ switch (errno)
+ {
+ case DB_NOTFOUND:
+ case DB_KEYEMPTY:
+ st = 1;
+ break;
+
+ case 0:
+ st = 0;
+ break;
+
+ default:
+ st = -1;
+ break;
+ }
+#endif
if (st == 0)
map->map_mflags &= ~MF_TRY0NULL;
}
saveerrno = errno;
-#if !OLD_NEWDB
if (fd >= 0 && !bitset(MF_LOCKED, map->map_mflags))
(void) lockfile(fd, buf, ".db", LOCK_UN);
-#endif
if (st != 0)
{
errno = saveerrno;
@@ -1532,6 +1696,9 @@ db_map_store(map, lhs, rhs)
register DB *db = map->map_db2;
char keybuf[MAXNAME + 1];
+ bzero(&key, sizeof key);
+ bzero(&data, sizeof data);
+
if (tTd(38, 12))
printf("db_map_store(%s, %s, %s)\n",
map->map_mname, lhs, rhs);
@@ -1557,7 +1724,25 @@ db_map_store(map, lhs, rhs)
data.size++;
}
+#if DB_VERSION_MAJOR < 2
stat = db->put(db, &key, &data, R_NOOVERWRITE);
+#else
+ errno = db->put(db, NULL, &key, &data, DB_NOOVERWRITE);
+ switch (errno)
+ {
+ case DB_KEYEXIST:
+ stat = 1;
+ break;
+
+ case 0:
+ stat = 0;
+ break;
+
+ default:
+ stat = -1;
+ break;
+ }
+#endif
if (stat > 0)
{
if (!bitset(MF_APPEND, map->map_mflags))
@@ -1568,7 +1753,10 @@ db_map_store(map, lhs, rhs)
static int bufsiz = 0;
DBT old;
- old.data = db_map_lookup(map, key.data, NULL, &stat);
+ bzero(&old, sizeof old);
+
+ old.data = db_map_lookup(map, key.data,
+ (char **)NULL, &stat);
if (old.data != NULL)
{
old.size = strlen(old.data);
@@ -1580,7 +1768,7 @@ db_map_store(map, lhs, rhs)
buf = xalloc(bufsiz);
}
snprintf(buf, bufsiz, "%s,%s",
- data.data, old.data);
+ (char *) data.data, (char *) old.data);
data.size = data.size + old.size + 1;
data.data = buf;
if (tTd(38, 9))
@@ -1588,7 +1776,11 @@ db_map_store(map, lhs, rhs)
(char *) data.data);
}
}
+#if DB_VERSION_MAJOR < 2
stat = db->put(db, &key, &data, 0);
+#else
+ stat = errno = db->put(db, NULL, &key, &data, 0);
+#endif
}
if (stat != 0)
syserr("readaliases: db put (%s)", lhs);
@@ -1615,18 +1807,18 @@ db_map_close(map)
db_map_store(map, "@", "@");
}
-#if OLD_NEWDB
- (void) db->sync(db);
-#else
(void) db->sync(db, 0);
-#endif
#if !LOCK_ON_OPEN
if (map->map_lockfd >= 0)
(void) close(map->map_lockfd);
#endif
+#if DB_VERSION_MAJOR < 2
if (db->close(db) != 0)
+#else
+ if ((errno = db->close(db, 0)) != 0)
+#endif
syserr("readaliases: db close failure");
}
@@ -1734,6 +1926,7 @@ nis_map_open(map, mode)
** NIS_MAP_LOOKUP -- look up a datum in a NIS map
*/
+/* ARGSUSED3 */
char *
nis_map_lookup(map, name, av, statp)
MAP *map;
@@ -1910,7 +2103,7 @@ nisplus_map_open(map, mode)
mode &= O_ACCMODE;
if (mode != O_RDONLY)
{
- errno = ENODEV;
+ errno = EPERM;
return FALSE;
}
@@ -1920,7 +2113,7 @@ nisplus_map_open(map, mode)
if (PARTIAL_NAME(map->map_file) && map->map_domain == NULL)
{
/* set default NISPLUS Domain to $m */
- extern char *nisplus_default_domain();
+ extern char *nisplus_default_domain __P((void));
map->map_domain = newstr(nisplus_default_domain());
if (tTd(38, 2))
@@ -1953,7 +2146,7 @@ nisplus_map_open(map, mode)
case NIS_NAMEUNREACHABLE:
if (retry_cnt++ > 4)
{
- errno = EBADR;
+ errno = EAGAIN;
return FALSE;
}
/* try not to overwhelm hosed server */
@@ -1967,7 +2160,7 @@ nisplus_map_open(map, mode)
map->map_file, map->map_domain,
nis_sperrno(res->status));
#endif
- errno = EBADR;
+ errno = EAGAIN;
return FALSE;
}
}
@@ -1983,7 +2176,7 @@ nisplus_map_open(map, mode)
map->map_file, map->map_domain,
nis_sperrno(res->status));
#endif
- errno = EBADR;
+ errno = EBADF;
return FALSE;
}
/* default key column is column 0 */
@@ -1991,7 +2184,7 @@ nisplus_map_open(map, mode)
map->map_keycolnm = newstr(COL_NAME(res,0));
max_col = COL_MAX(res);
-
+
/* verify the key column exist */
for (i=0; i< max_col; i++)
{
@@ -2003,7 +2196,7 @@ nisplus_map_open(map, mode)
if (tTd(38, 2))
printf("nisplus_map_open(%s): can not find key column %s\n",
map->map_file, map->map_keycolnm);
- errno = EBADR;
+ errno = ENOENT;
return FALSE;
}
@@ -2026,7 +2219,7 @@ nisplus_map_open(map, mode)
if (tTd(38, 2))
printf("nisplus_map_open(%s): can not find column %s\n",
map->map_file, map->map_keycolnm);
- errno = EBADR;
+ errno = ENOENT;
return FALSE;
}
@@ -2064,7 +2257,7 @@ nisplus_map_lookup(map, name, av, statp)
return NULL;
}
}
-
+
/*
** Copy the name to the key buffer, escaping double quote characters
** by doubling them and quoting "]" and "," to avoid having the
@@ -2295,7 +2488,7 @@ nisplus_default_domain()
if (default_domain[0] != '\0')
return(default_domain);
-
+
p = nis_local_directory();
snprintf(default_domain, sizeof default_domain, "%s", p);
return default_domain;
@@ -2357,12 +2550,22 @@ ldap_map_open(map, mode)
** Caching should be investigated.
*/
+static jmp_buf LDAPTimeout;
+
+static void
+ldaptimeout(sig_no)
+ int sig_no;
+{
+ longjmp(LDAPTimeout, 1);
+}
+
bool
ldap_map_start(map)
MAP *map;
{
LDAP_MAP_STRUCT *lmap;
LDAP *ld;
+ register EVENT *ev = NULL;
if (tTd(38, 2))
printf("ldap_map_start(%s)\n", map->map_mname);
@@ -2372,6 +2575,22 @@ ldap_map_start(map)
if (tTd(38,9))
printf("ldap_open(%s, %d)\n", lmap->ldaphost, lmap->ldapport);
+ /* Need to set an alarm here, ldap_open is hopelessly broken. */
+
+ /* set the timeout */
+ if (lmap->timeout.tv_sec != 0)
+ {
+ if (setjmp(LDAPTimeout) != 0)
+ {
+ if (LogLevel > 1)
+ sm_syslog(LOG_NOTICE, CurEnv->e_id,
+ "timeout waiting for ldap_open to %.100s",
+ lmap->ldaphost);
+ return (FALSE);
+ }
+ ev = setevent(lmap->timeout.tv_sec, ldaptimeout, 0);
+ }
+
if ((ld = ldap_open(lmap->ldaphost,lmap->ldapport)) == NULL)
{
if (!bitset(MF_OPTIONAL, map->map_mflags))
@@ -2382,6 +2601,9 @@ ldap_map_start(map)
return FALSE;
}
+ /* clear the event if it has not sprung */
+ clrevent(ev);
+ /* From here on in we can use ldap internal timelimits */
ld->ld_deref = lmap->deref;
ld->ld_timelimit = lmap->timelimit;
ld->ld_sizelimit = lmap->sizelimit;
@@ -2642,6 +2864,11 @@ ldap_map_parseargs(map,args)
lmap->passwd = NULL;
lmap->base = NULL;
lmap->ldaphost = NULL;
+
+ /* Default general ptrs to NULL */
+ lmap->ld = NULL;
+ lmap->res = NULL;
+
map->map_mflags |= MF_TRY0NULL | MF_TRY1NULL;
for (;;)
{
@@ -2688,6 +2915,10 @@ ldap_map_parseargs(map,args)
map->map_app = ++p;
break;
+ case 'T':
+ map->map_tapp = ++p;
+ break;
+
/* Start of ldap_map specific args */
case 'k': /* search field */
while (isascii(*++p) && isspace(*p))
@@ -2716,7 +2947,7 @@ ldap_map_parseargs(map,args)
break;
case 's': /* search scope */
- if (strncasecmp(p, "base", 4) == 0)
+ if (strncasecmp(++p, "base", 4) == 0)
{
lmap->scope = LDAP_SCOPE_BASE;
}
@@ -2732,8 +2963,14 @@ ldap_map_parseargs(map,args)
{ /* bad config line */
if (!bitset(MCF_OPTFILE, map->map_class->map_cflags))
{
+ char *ptr;
+
+ if ((ptr = strchr(p, ' ')) != NULL)
+ *ptr = '\0';
syserr("Scope must be [base|one|sub] not %s in map %s",
p, map->map_mname);
+ if (ptr != NULL)
+ *ptr = ' ';
return FALSE;
}
}
@@ -2762,6 +2999,7 @@ ldap_map_parseargs(map,args)
while (isascii(*++p) && isspace(*p))
continue;
lmap->timelimit = atoi(p);
+ lmap->timeout.tv_sec = lmap->timelimit;
break;
}
@@ -2792,7 +3030,8 @@ ldap_map_parseargs(map,args)
if (map->map_app != NULL)
map->map_app = newstr(ldap_map_dequote(map->map_app));
-
+ if (map->map_tapp != NULL)
+ map->map_tapp = newstr(ldap_map_dequote(map->map_tapp));
if (map->map_domain != NULL)
map->map_domain = newstr(ldap_map_dequote(map->map_domain));
@@ -2859,7 +3098,7 @@ ldap_map_parseargs(map,args)
** syslog map
*/
-#if _FFR_SYSLOG_MAP
+#if _FFR_MAP_SYSLOG
#define map_prio map_lockfd /* overload field */
@@ -2895,7 +3134,7 @@ syslog_map_parseargs(map, args)
{
if (strncasecmp("LOG_", priority, 4) == 0)
priority += 4;
-
+
#ifdef LOG_EMERG
if (strcasecmp("EMERG", priority) == 0)
map->map_prio = LOG_EMERG;
@@ -2966,20 +3205,18 @@ syslog_map_lookup(map, string, args, statp)
sm_syslog(map->map_prio, CurEnv->e_id, "%s", ptr);
}
-
+
*statp = EX_OK;
return "";
}
-#endif /* _FFR_SYSLOG_MAP */
+#endif /* _FFR_MAP_SYSLOG */
/*
** HESIOD Modules
*/
#ifdef HESIOD
-#include <hesiod.h>
-
bool
hes_map_open(map, mode)
MAP *map;
@@ -3004,6 +3241,15 @@ hes_map_open(map, mode)
return FALSE;
}
+#ifdef HESIOD_INIT
+ if (HesiodContext != NULL || hesiod_init(&HesiodContext) == 0)
+ return TRUE;
+
+ if (!bitset(MF_OPTIONAL, map->map_mflags))
+ syserr("421 cannot initialize Hesiod map (%s)",
+ errstring(errno));
+ return FALSE;
+#else
if (hes_error() == HES_ER_UNINIT)
hes_init();
switch (hes_error())
@@ -3017,6 +3263,7 @@ hes_map_open(map, mode)
syserr("421 cannot initialize Hesiod map (%d)", hes_error());
return FALSE;
+#endif /* HESIOD_INIT */
}
char *
@@ -3044,14 +3291,45 @@ hes_map_lookup(map, name, av, statp)
np = xalloc(strlen(name) + 2);
np[0] = '\\';
strcpy(&np[1], name);
+#ifdef HESIOD_INIT
+ hp = hesiod_resolve(HesiodContext, np, map->map_file);
+#else
hp = hes_resolve(np, map->map_file);
+#endif /* HESIOD_INIT */
if (np != nbuf)
free(np);
}
else
{
+#ifdef HESIOD_INIT
+ hp = hesiod_resolve(HesiodContext, name, map->map_file);
+#else
hp = hes_resolve(name, map->map_file);
+#endif /* HESIOD_INIT */
}
+#ifdef HESIOD_INIT
+ if (hp == NULL)
+ return NULL;
+ if (*hp == NULL)
+ {
+ hesiod_free_list(HesiodContext, hp);
+ switch (errno)
+ {
+ case ENOENT:
+ *statp = EX_NOTFOUND;
+ break;
+ case ECONNREFUSED:
+ case EMSGSIZE:
+ *statp = EX_TEMPFAIL;
+ break;
+ case ENOMEM:
+ default:
+ *statp = EX_UNAVAILABLE;
+ break;
+ }
+ return NULL;
+ }
+#else
if (hp == NULL || hp[0] == NULL)
{
switch (hes_error())
@@ -3074,7 +3352,8 @@ hes_map_lookup(map, name, av, statp)
}
return NULL;
}
-
+#endif /* HESIOD_INIT */
+
if (bitset(MF_MATCHONLY, map->map_mflags))
return map_rewrite(map, name, strlen(name), NULL);
else
@@ -3162,6 +3441,7 @@ ni_getcanonname(name, hbsize, statp)
int *statp;
{
char *vptr;
+ char *ptr;
char nbuf[MAXNAME + 1];
if (tTd(38, 20))
@@ -3183,7 +3463,7 @@ ni_getcanonname(name, hbsize, statp)
}
/* Do the search */
- vptr = ni_propval("/machines", NULL, nbuf, "name", '\0');
+ vptr = ni_propval("/machines", NULL, nbuf, "name", '\n');
if (vptr == NULL)
{
@@ -3191,6 +3471,10 @@ ni_getcanonname(name, hbsize, statp)
return FALSE;
}
+ /* Only want the first machine name */
+ if ((ptr = strchr(vptr, '\n')) != NULL)
+ *ptr = '\0';
+
if (hbsize >= strlen(vptr))
{
strcpy(name, vptr);
@@ -3411,7 +3695,7 @@ text_map_open(map, mode)
mode &= O_ACCMODE;
if (mode != O_RDONLY)
{
- errno = ENODEV;
+ errno = EPERM;
return FALSE;
}
@@ -3429,8 +3713,10 @@ text_map_open(map, mode)
return FALSE;
}
- sff = SFF_ROOTOK|SFF_REGONLY|SFF_NOWLINK;
- if (FatalWritableDirs)
+ sff = SFF_ROOTOK|SFF_REGONLY;
+ if (!bitset(DBS_LINKEDMAPINWRITABLEDIR, DontBlameSendmail))
+ sff |= SFF_NOWLINK;
+ if (!bitset(DBS_MAPINUNSAFEDIRPATH, DontBlameSendmail))
sff |= SFF_SAFEDIRPATH;
if ((i = safefile(map->map_file, RunAsUid, RunAsGid, RunAsUserName,
sff, S_IRUSR, NULL)) != 0)
@@ -3448,7 +3734,7 @@ text_map_open(map, mode)
map->map_keycolno = 0;
else
{
- if (!isdigit(*map->map_keycolnm))
+ if (!(isascii(*map->map_keycolnm) && isdigit(*map->map_keycolnm)))
{
syserr("text map \"%s\", file %s: -k should specify a number, not %s",
map->map_mname, map->map_file,
@@ -3462,7 +3748,7 @@ text_map_open(map, mode)
map->map_valcolno = 0;
else
{
- if (!isdigit(*map->map_valcolnm))
+ if (!(isascii(*map->map_valcolnm) && isdigit(*map->map_valcolnm)))
{
syserr("text map \"%s\", file %s: -v should specify a number, not %s",
map->map_mname, map->map_file,
@@ -3633,6 +3919,7 @@ text_getcanonname(name, hbsize, statp)
** STAB_MAP_LOOKUP -- look up alias in symbol table
*/
+/* ARGSUSED2 */
char *
stab_map_lookup(map, name, av, pstat)
register MAP *map;
@@ -3695,12 +3982,14 @@ stab_map_open(map, mode)
mode &= O_ACCMODE;
if (mode != O_RDONLY)
{
- errno = ENODEV;
+ errno = EPERM;
return FALSE;
}
- sff = SFF_ROOTOK|SFF_REGONLY|SFF_NOWLINK;
- if (FatalWritableDirs)
+ sff = SFF_ROOTOK|SFF_REGONLY;
+ if (!bitset(DBS_LINKEDMAPINWRITABLEDIR, DontBlameSendmail))
+ sff |= SFF_NOWLINK;
+ if (!bitset(DBS_MAPINUNSAFEDIRPATH, DontBlameSendmail))
sff |= SFF_SAFEDIRPATH;
af = safefopen(map->map_file, O_RDONLY, 0444, sff);
if (af == NULL)
@@ -3808,13 +4097,18 @@ impl_map_open(map, mode)
#if defined(NEWDB) || defined(NDBM)
if (Verbose)
- message("WARNING: cannot open alias database %s", map->map_file);
+ message("WARNING: cannot open alias database %s%s",
+ map->map_file,
+ mode == O_RDONLY ? "; reading text version" : "");
#else
if (mode != O_RDONLY)
usrerr("Cannot rebuild aliases: no database format defined");
#endif
- return stab_map_open(map, mode);
+ if (mode == O_RDONLY)
+ return stab_map_open(map, mode);
+ else
+ return FALSE;
}
@@ -3911,6 +4205,7 @@ user_map_open(map, mode)
** USER_MAP_LOOKUP -- look up a user in the passwd file.
*/
+/* ARGSUSED3 */
char *
user_map_lookup(map, key, av, statp)
MAP *map;
@@ -4340,6 +4635,7 @@ seq_map_store(map, key, val)
** NULL stubs
*/
+/* ARGSUSED */
bool
null_map_open(map, mode)
MAP *map;
@@ -4348,6 +4644,7 @@ null_map_open(map, mode)
return TRUE;
}
+/* ARGSUSED */
void
null_map_close(map)
MAP *map;
@@ -4366,6 +4663,7 @@ null_map_lookup(map, key, args, pstat)
return NULL;
}
+/* ARGSUSED */
void
null_map_store(map, key, val)
MAP *map;
@@ -4397,3 +4695,371 @@ MAPCLASS BogusMapClass =
NULL, bogus_map_lookup, null_map_store,
null_map_open, null_map_close,
};
+ /*
+** REGEX modules
+*/
+
+#ifdef MAP_REGEX
+
+# include <regex.h>
+
+# define DEFAULT_DELIM CONDELSE
+
+# define END_OF_FIELDS -1
+
+# define ERRBUF_SIZE 80
+# define MAX_MATCH 32
+
+# define xnalloc(s) memset(xalloc(s), 0, s);
+
+struct regex_map
+{
+ regex_t pattern_buf; /* xalloc it */
+ int *regex_subfields; /* move to type MAP */
+ char *delim; /* move to type MAP */
+};
+
+static int
+parse_fields(s, ibuf, blen, nr_substrings)
+ char *s;
+ int *ibuf; /* array */
+ int blen; /* number of elements in ibuf */
+ int nr_substrings; /* number of substrings in the pattern */
+{
+ register char *cp;
+ int i = 0;
+ bool lastone = FALSE;
+
+ blen--; /* for terminating END_OF_FIELDS */
+ cp = s;
+ do
+ {
+ for (;; cp++)
+ {
+ if (*cp == ',')
+ {
+ *cp = '\0';
+ break;
+ }
+ if (*cp == '\0')
+ {
+ lastone = TRUE;
+ break;
+ }
+ }
+ if (i < blen)
+ {
+ int val = atoi(s);
+
+ if (val < 0 || val >= nr_substrings)
+ {
+ syserr("field (%d) out of range, only %d substrings in pattern",
+ val, nr_substrings);
+ return -1;
+ }
+ ibuf[i++] = val;
+ }
+ else
+ {
+ syserr("too many fields, %d max\n", blen);
+ return -1;
+ }
+ s = ++cp;
+ } while (!lastone);
+ ibuf[i] = END_OF_FIELDS;
+ return i;
+}
+
+bool
+regex_map_init(map, ap)
+ MAP *map;
+ char *ap;
+{
+ int regerr;
+ struct regex_map *map_p;
+ register char *p;
+ char *sub_param = NULL;
+ int pflags;
+ static char defdstr[] = { (char)DEFAULT_DELIM, '\0' };
+
+ if (tTd(38, 2))
+ printf("regex_map_init: mapname '%s', args '%s'\n",
+ map->map_mname, ap);
+
+ pflags = REG_ICASE | REG_EXTENDED | REG_NOSUB;
+
+ p = ap;
+
+ map_p = (struct regex_map *) xnalloc(sizeof(struct regex_map));
+
+ for (;;)
+ {
+ while (isascii(*p) && isspace(*p))
+ p++;
+ if (*p != '-')
+ break;
+ switch (*++p)
+ {
+ case 'n': /* not */
+ map->map_mflags |= MF_REGEX_NOT;
+ break;
+
+ case 'f': /* case sensitive */
+ map->map_mflags |= MF_NOFOLDCASE;
+ pflags &= ~REG_ICASE;
+ break;
+
+ case 'b': /* basic regular expressions */
+ pflags &= ~REG_EXTENDED;
+ break;
+
+ case 's': /* substring match () syntax */
+ sub_param = ++p;
+ pflags &= ~REG_NOSUB;
+ break;
+
+ case 'd': /* delimiter */
+ map_p->delim = ++p;
+ break;
+
+ case 'a': /* map append */
+ map->map_app = ++p;
+ break;
+
+ case 'm': /* matchonly */
+ map->map_mflags |= MF_MATCHONLY;
+ break;
+
+ }
+ while (*p != '\0' && !(isascii(*p) && isspace(*p)))
+ p++;
+ if (*p != '\0')
+ *p++ = '\0';
+ }
+ if (tTd(38, 3))
+ printf("regex_map_init: compile '%s' 0x%x\n", p, pflags);
+
+ if ((regerr = regcomp(&(map_p->pattern_buf), p, pflags)) != 0)
+ {
+ /* Errorhandling */
+ char errbuf[ERRBUF_SIZE];
+
+ regerror(regerr, &(map_p->pattern_buf), errbuf, ERRBUF_SIZE);
+ syserr("pattern-compile-error: %s\n", errbuf);
+ free(map_p);
+ return FALSE;
+ }
+
+ if (map->map_app != NULL)
+ map->map_app = newstr(map->map_app);
+ if (map_p->delim != NULL)
+ map_p->delim = newstr(map_p->delim);
+ else
+ map_p->delim = defdstr;
+
+ if (!bitset(REG_NOSUB, pflags))
+ {
+ /* substring matching */
+ int substrings;
+ int *fields = (int *)xalloc(sizeof(int) * (MAX_MATCH + 1));
+
+ substrings = map_p->pattern_buf.re_nsub + 1;
+
+ if (tTd(38, 3))
+ printf("regex_map_init: nr of substrings %d\n", substrings);
+
+ if (substrings >= MAX_MATCH)
+ {
+ syserr("too many substrings, %d max\n", MAX_MATCH);
+ free(map_p);
+ return FALSE;
+ }
+ if (sub_param != NULL && sub_param[0] != '\0')
+ {
+ /* optional parameter -sfields */
+ if (parse_fields(sub_param, fields,
+ MAX_MATCH + 1, substrings) == -1)
+ return FALSE;
+ }
+ else
+ {
+ /* set default fields */
+ int i;
+
+ for (i = 0; i < substrings; i++)
+ fields[i] = i;
+ fields[i] = END_OF_FIELDS;
+ }
+ map_p->regex_subfields = fields;
+ if (tTd(38, 3))
+ {
+ int *ip;
+
+ printf("regex_map_init: subfields");
+ for (ip = fields; *ip != END_OF_FIELDS; ip++)
+ printf(" %d", *ip);
+ printf("\n");
+ }
+ }
+ map->map_db1 = (ARBPTR_T)map_p; /* dirty hack */
+
+ return TRUE;
+}
+
+static char *
+regex_map_rewrite(map, s, slen, av)
+ MAP *map;
+ const char *s;
+ size_t slen;
+ char **av;
+{
+ if (bitset(MF_MATCHONLY, map->map_mflags))
+ return map_rewrite(map, av[0], strlen(av[0]), NULL);
+ else
+ return map_rewrite(map, s, slen, NULL);
+}
+
+char *
+regex_map_lookup(map, name, av, statp)
+ MAP *map;
+ char *name;
+ char **av;
+ int *statp;
+{
+ int reg_res;
+ struct regex_map *map_p;
+ regmatch_t pmatch[MAX_MATCH];
+
+ if (tTd(38, 20))
+ {
+ char **cpp;
+
+ printf("regex_map_lookup: key '%s'\n", name);
+ for (cpp = av; cpp && *cpp; cpp++)
+ printf("regex_map_lookup: arg '%s'\n", *cpp);
+ }
+
+ map_p = (struct regex_map *)(map->map_db1);
+ reg_res = regexec(&(map_p->pattern_buf), name, MAX_MATCH, pmatch, 0);
+
+ if (bitset(MF_REGEX_NOT, map->map_mflags))
+ {
+ /* option -n */
+ if (reg_res == REG_NOMATCH)
+ return regex_map_rewrite(map, "", (size_t)0, av);
+ else
+ return NULL;
+ }
+ if (reg_res == REG_NOMATCH)
+ return NULL;
+
+ if (map_p->regex_subfields != NULL)
+ {
+ /* option -s */
+ static char retbuf[MAXNAME];
+ int fields[MAX_MATCH + 1];
+ bool first = TRUE;
+ int anglecnt = 0, cmntcnt = 0, spacecnt = 0;
+ bool quotemode = FALSE, bslashmode = FALSE;
+ register char *dp, *sp;
+ char *endp, *ldp;
+ int *ip;
+
+ dp = retbuf;
+ ldp = retbuf + sizeof(retbuf) - 1;
+
+ if (av[1] != NULL)
+ {
+ if (parse_fields(av[1], fields, MAX_MATCH + 1,
+ (int) map_p->pattern_buf.re_nsub + 1) == -1)
+ {
+ *statp = EX_CONFIG;
+ return NULL;
+ }
+ ip = fields;
+ }
+ else
+ ip = map_p->regex_subfields;
+
+ for ( ; *ip != END_OF_FIELDS; ip++)
+ {
+ if (!first)
+ {
+ for (sp = map_p->delim; *sp; sp++)
+ {
+ if (dp < ldp)
+ *dp++ = *sp;
+ }
+ }
+ else
+ first = FALSE;
+
+
+ if (pmatch[*ip].rm_so < 0 || pmatch[*ip].rm_eo < 0)
+ continue;
+
+ sp = name + pmatch[*ip].rm_so;
+ endp = name + pmatch[*ip].rm_eo;
+ for (; endp > sp; sp++)
+ {
+ if (dp < ldp)
+ {
+ if(bslashmode)
+ {
+ *dp++ = *sp;
+ bslashmode = FALSE;
+ }
+ else if(quotemode && *sp != '"' &&
+ *sp != '\\')
+ {
+ *dp++ = *sp;
+ }
+ else switch(*dp++ = *sp)
+ {
+ case '\\':
+ bslashmode = TRUE;
+ break;
+
+ case '(':
+ cmntcnt++;
+ break;
+
+ case ')':
+ cmntcnt--;
+ break;
+
+ case '<':
+ anglecnt++;
+ break;
+
+ case '>':
+ anglecnt--;
+ break;
+
+ case ' ':
+ spacecnt++;
+ break;
+
+ case '"':
+ quotemode = !quotemode;
+ break;
+ }
+ }
+ }
+ }
+ if (anglecnt != 0 || cmntcnt != 0 || quotemode ||
+ bslashmode || spacecnt != 0)
+ {
+ sm_syslog(LOG_WARNING, NOQID,
+ "Warning: regex may cause prescan() failure map=%s lookup=%s",
+ map->map_mname, name);
+ return NULL;
+ }
+
+ *dp = '\0';
+
+ return regex_map_rewrite(map, retbuf, strlen(retbuf), av);
+ }
+ return regex_map_rewrite(map, "", (size_t)0, av);
+}
+#endif /* MAP_REGEX */
diff --git a/usr.sbin/sendmail/src/mci.c b/usr.sbin/sendmail/src/mci.c
index 929d82d463a..efb8cbad67a 100644
--- a/usr.sbin/sendmail/src/mci.c
+++ b/usr.sbin/sendmail/src/mci.c
@@ -1,42 +1,21 @@
/*
- * Copyright (c) 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)mci.c 8.66 (Berkeley) 8/2/97";
+static char sccsid[] = "@(#)mci.c 8.82 (Berkeley) 6/15/98";
#endif /* not lint */
#include "sendmail.h"
+#include <arpa/inet.h>
#include <dirent.h>
/*
@@ -73,7 +52,7 @@ static char sccsid[] = "@(#)mci.c 8.66 (Berkeley) 8/2/97";
MCI **MciCache; /* the open connection cache */
extern int mci_generate_persistent_path __P((const char *, char *, int, bool));
-extern void mci_load_persistent __P((MCI *));
+extern bool mci_load_persistent __P((MCI *));
extern void mci_uncache __P((MCI **, bool));
/*
** MCI_CACHE -- enter a connection structure into the open connection cache
@@ -105,6 +84,9 @@ mci_cache(mci)
return;
}
+ if (mci->mci_host == NULL)
+ return;
+
/* if this is already cached, we are done */
if (bitset(MCIF_CACHED, mci->mci_flags))
return;
@@ -115,7 +97,7 @@ mci_cache(mci)
if (tTd(42, 5))
printf("mci_cache: caching %lx (%s) in slot %d\n",
- (u_long) mci, mci->mci_host, mcislot - MciCache);
+ (u_long) mci, mci->mci_host, (int)(mcislot - MciCache));
if (tTd(91, 100))
sm_syslog(LOG_DEBUG, CurEnv->e_id,
"mci_cache: caching %x (%.100s) in slot %d",
@@ -208,12 +190,15 @@ mci_uncache(mcislot, doquit)
if (mci == NULL)
return;
*mcislot = NULL;
+ if (mci->mci_host == NULL)
+ return;
mci_unlock_host(mci);
if (tTd(42, 5))
printf("mci_uncache: uncaching %lx (%s) from slot %d (%d)\n",
- (u_long) mci, mci->mci_host, mcislot - MciCache, doquit);
+ (u_long) mci, mci->mci_host,
+ (int)(mcislot - MciCache), doquit);
if (tTd(91, 100))
sm_syslog(LOG_DEBUG, CurEnv->e_id,
"mci_uncache: uncaching %x (%.100s) from slot %d (%d)",
@@ -301,7 +286,15 @@ mci_get(host, m)
mci = &s->s_mci;
mci->mci_host = s->s_name;
- mci_load_persistent(mci);
+ if (!mci_load_persistent(mci))
+ {
+ if (tTd(42, 2))
+ printf("mci_get(%s %s): lock failed\n", host, m->m_name);
+ mci->mci_exitstat = EX_TEMPFAIL;
+ mci->mci_state = MCIS_CLOSED;
+ mci->mci_statfile = NULL;
+ return mci;
+ }
if (tTd(42, 2))
{
@@ -572,7 +565,7 @@ mci_lock_host_statfile(mci)
}
mci->mci_statfile = safefopen(fname, O_RDWR, FileMode,
- SFF_NOLOCK|SFF_NOLINK|SFF_OPENASROOT|SFF_REGONLY|SFF_CREAT);
+ SFF_NOLOCK|SFF_NOLINK|SFF_OPENASROOT|SFF_REGONLY|SFF_SAFEDIRPATH|SFF_CREAT);
if (mci->mci_statfile == NULL)
{
@@ -660,14 +653,16 @@ mci_unlock_host(mci)
** for.
**
** Returns:
-** none.
+** TRUE -- lock was successful
+** FALSE -- lock failed
*/
-void
+bool
mci_load_persistent(mci)
MCI *mci;
{
int saveErrno = errno;
+ bool locked = TRUE;
FILE *fp;
char fname[MAXPATHLEN+1];
@@ -675,12 +670,16 @@ mci_load_persistent(mci)
{
if (tTd(56, 1))
printf("mci_load_persistent: NULL mci\n");
- return;
+ return TRUE;
}
if (IgnoreHostStatus || HostStatDir == NULL || mci->mci_host == NULL)
- return;
+ return TRUE;
+ /* Already have the persistent information in memory */
+ if (SingleThreadDelivery && mci->mci_statfile != NULL)
+ return TRUE;
+
if (tTd(56, 1))
printf("mci_load_persistent: Attempting to load persistent information for %s\n",
mci->mci_host);
@@ -694,7 +693,7 @@ mci_load_persistent(mci)
}
fp = safefopen(fname, O_RDONLY, FileMode,
- SFF_NOLINK|SFF_OPENASROOT|SFF_REGONLY);
+ SFF_NOLOCK|SFF_NOLINK|SFF_OPENASROOT|SFF_REGONLY|SFF_SAFEDIRPATH);
if (fp == NULL)
{
/* I can't think of any reason this should ever happen */
@@ -705,13 +704,16 @@ mci_load_persistent(mci)
}
FileName = fname;
+ locked = lockfile(fileno(fp), fname, "", LOCK_SH|LOCK_NB);
(void) mci_read_persistent(fp, mci);
FileName = NULL;
+ if (locked)
+ lockfile(fileno(fp), fname, "", LOCK_UN);
fclose(fp);
cleanup:
errno = saveErrno;
- return;
+ return locked;
}
/*
** MCI_READ_PERSISTENT -- read persistent host status file
@@ -803,7 +805,10 @@ mci_read_persistent(fp, mci)
return 0;
default:
- syserr("Unknown host status line \"%s\"", buf);
+ sm_syslog(LOG_CRIT, NOQID,
+ "%s: line %d: Unknown host status line \"%s\"",
+ FileName == NULL ? mci->mci_host : FileName,
+ LineNumber, buf);
LineNumber = saveLineNumber;
return -1;
}
@@ -868,7 +873,7 @@ mci_store_persistent(mci)
if (mci->mci_rstatus != NULL)
fprintf(mci->mci_statfile, "R%.80s\n",
denlstring(mci->mci_rstatus, TRUE, FALSE));
- fprintf(mci->mci_statfile, "U%ld\n", mci->mci_lastuse);
+ fprintf(mci->mci_statfile, "U%ld\n", (long)(mci->mci_lastuse));
fprintf(mci->mci_statfile, ".\n");
fflush(mci->mci_statfile);
@@ -1054,7 +1059,7 @@ mci_print_persistent(pathname, hostname)
}
fp = safefopen(pathname, O_RDWR, FileMode,
- SFF_NOLOCK|SFF_NOLINK|SFF_OPENASROOT|SFF_REGONLY);
+ SFF_NOLOCK|SFF_NOLINK|SFF_OPENASROOT|SFF_REGONLY|SFF_SAFEDIRPATH);
if (fp == NULL)
{
@@ -1091,7 +1096,7 @@ mci_print_persistent(pathname, hostname)
extern int N_SysEx;
extern char *SysExMsg[];
- if (i < 0 || i > N_SysEx)
+ if (i < 0 || i >= N_SysEx)
{
char buf[80];
@@ -1210,7 +1215,7 @@ mci_generate_persistent_path(host, path, pathlen, createflag)
if (tTd(56, 80))
printf("mci_generate_persistent_path(%s): ", host);
- if (*host == '\0')
+ if (*host == '\0' || *host == '.')
return -1;
/* make certain this is not a bracketed host number */
@@ -1231,17 +1236,21 @@ mci_generate_persistent_path(host, path, pathlen, createflag)
(elem[-1] == '.' || (host[0] == '[' && elem[-1] == ']')))
*--elem = '\0';
+ /* check for bogus bracketed address */
+ if (host[0] == '[' && inet_addr(t_host) == INADDR_NONE)
+ return -1;
+
/* check for what will be the final length of the path */
len = strlen(HostStatDir) + 2;
- for (p = (char *) host; *p != '\0'; p++)
+ for (p = (char *) t_host; *p != '\0'; p++)
{
- if (*p == '|' || *p == '.')
+ if (*p == '.')
len++;
len++;
if (p[0] == '.' && p[1] == '.')
return -1;
}
- if (len > pathlen)
+ if (len > pathlen || len < 1)
return -1;
strcpy(path, HostStatDir);
@@ -1261,12 +1270,10 @@ mci_generate_persistent_path(host, path, pathlen, createflag)
x = elem + 1;
while ((ch = *x++) != '\0' && ch != '.')
{
- if (isupper(ch))
+ if (isascii(ch) && isupper(ch))
ch = tolower(ch);
- if (ch == '|')
- *p++ = '|'; /* | -> || */
- else if (ch == '/')
- ch = '|'; /* / -> | */
+ if (ch == '/')
+ ch = ':'; /* / -> : */
*p++ = ch;
}
if (elem >= t_host)
diff --git a/usr.sbin/sendmail/src/mime.c b/usr.sbin/sendmail/src/mime.c
index 3e5a610bb39..11a141e4f8a 100644
--- a/usr.sbin/sendmail/src/mime.c
+++ b/usr.sbin/sendmail/src/mime.c
@@ -1,42 +1,20 @@
/*
- * Copyright (c) 1994, 1996-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1994, 1996-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
# include "sendmail.h"
# include <string.h>
#ifndef lint
-static char sccsid[] = "@(#)mime.c 8.59 (Berkeley) 5/6/97";
+static char sccsid[] = "@(#)mime.c 8.66 (Berkeley) 5/19/98";
#endif /* not lint */
/*
@@ -306,6 +284,7 @@ mime8to7(mci, header, e, boundaries, flags)
/* skip the early "comment" prologue */
putline("", mci);
+ mci->mci_flags &= ~MCIF_INHEADER;
while (fgets(buf, sizeof buf, e->e_dfp) != NULL)
{
bt = mimeboundary(buf, boundaries);
@@ -992,6 +971,7 @@ mime7to8(mci, header, e)
cataddr(pvp, NULL, buf, sizeof buf, '\0');
cte = newstr(buf);
+ mci->mci_flags |= MCIF_INHEADER;
putline("Content-Transfer-Encoding: 8bit", mci);
snprintf(buf, sizeof buf,
"X-MIME-Autoconverted: from %.200s to 8bit by %s id %s",
@@ -1146,20 +1126,24 @@ mime_fromqp(infile, outfile, state, maxlen)
if ((c1 = *infile++) == 0)
break;
- if (c1 == '\n') /* ignore it */
+ if (c1 == '\n' || (c1 = HEXCHAR(c1)) == -1)
{
+ /* ignore it */
if (state == 0)
return 0;
}
else
{
- if ((c2 = *infile++) == '\0')
- break;
-
- c1 = HEXCHAR(c1);
- c2 = HEXCHAR(c2);
-
- if (++nchar > maxlen)
+ do
+ {
+ if ((c2 = *infile++) == '\0')
+ {
+ c2 = -1;
+ break;
+ }
+ } while ((c2 = HEXCHAR(c2)) == -1);
+
+ if (c2 == -1 || ++nchar > maxlen)
break;
*(*outfile)++ = c1 << 4 | c2;
diff --git a/usr.sbin/sendmail/src/newaliases.1 b/usr.sbin/sendmail/src/newaliases.1
index 7168c1303f4..acf32453164 100644
--- a/usr.sbin/sendmail/src/newaliases.1
+++ b/usr.sbin/sendmail/src/newaliases.1
@@ -1,38 +1,16 @@
-.\" Copyright (c) 1983, 1997 Eric P. Allman
+.\" Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+.\" Copyright (c) 1983, 1997 Eric P. Allman. All rights reserved.
.\" Copyright (c) 1985, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the University of
-.\" California, Berkeley and its contributors.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
+.\" 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.
.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
.\"
-.\" @(#)newaliases.1 8.5 (Berkeley) 2/1/97
+.\" @(#)newaliases.1 8.10 (Berkeley) 5/19/98
.\"
-.Dd February 1, 1997
+.Dd May 19, 1998
.Dt NEWALIASES 1
.Os BSD 4
.Sh NAME
diff --git a/usr.sbin/sendmail/src/parseaddr.c b/usr.sbin/sendmail/src/parseaddr.c
index 78318347043..c3c89b45d2f 100644
--- a/usr.sbin/sendmail/src/parseaddr.c
+++ b/usr.sbin/sendmail/src/parseaddr.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)parseaddr.c 8.132 (Berkeley) 10/20/97";
+static char sccsid[] = "@(#)parseaddr.c 8.153 (Berkeley) 6/24/98";
#endif /* not lint */
# include "sendmail.h"
@@ -89,8 +67,8 @@ parseaddr(addr, a, flags, delim, delimptr, e)
auto char *delimptrbuf;
bool queueup;
char pvpbuf[PSBUFSIZE];
- extern ADDRESS *buildaddr();
- extern bool invalidaddr();
+ extern ADDRESS *buildaddr __P((char **, ADDRESS *, int, ENVELOPE *));
+ extern bool invalidaddr __P((char *, char *));
extern void allocaddr __P((ADDRESS *, int, char *));
/*
@@ -668,12 +646,12 @@ prescan(addr, delim, pvpbuf, pvpbsize, delimptr, toktab)
}
if (avp >= &av[MAXATOM])
{
- syserr("553 prescan: too many tokens");
+ usrerr("553 prescan: too many tokens");
goto returnnull;
}
if (q - tok > MAXNAME)
{
- syserr("553 prescan: token too long");
+ usrerr("553 prescan: token too long");
goto returnnull;
}
*avp++ = tok;
@@ -761,6 +739,7 @@ rewrite(pvp, ruleset, reclevel, e)
int loopcount;
struct match mlist[MAXMATCH]; /* stores match on LHS */
char *npvp[MAXATOM+1]; /* temporary space for rebuild */
+ char buf[MAXLINE];
extern int callsubr __P((char**, int, ENVELOPE *));
extern int sm_strcasecmp __P((char *, char *));
@@ -845,8 +824,6 @@ rewrite(pvp, ruleset, reclevel, e)
switch (*rp & 0377)
{
- char buf[MAXLINE];
-
case MATCHCLASS:
/* match any phrase in a class */
mlp->pattern = rvp;
@@ -1071,7 +1048,7 @@ rewrite(pvp, ruleset, reclevel, e)
}
else
{
- /* vanilla replacement */
+ /* some sort of replacement */
if (avp >= &npvp[MAXATOM])
{
toolong:
@@ -1079,16 +1056,64 @@ rewrite(pvp, ruleset, reclevel, e)
return EX_DATAERR;
}
if ((*rp & 0377) != MACRODEXPAND)
+ {
+ /* vanilla replacement */
*avp++ = rp;
+ }
else
{
- *avp = macvalue(rp[1], e);
+ /* $&x replacement */
+ char *mval = macvalue(rp[1], e);
+ char **xpvp;
+ int trsize = 0;
+ static size_t pvpb1_size = 0;
+ static char **pvpb1 = NULL;
+ char pvpbuf[PSBUFSIZE];
+
if (tTd(21, 2))
printf("rewrite: RHS $&%s => \"%s\"\n",
macname(rp[1]),
- *avp == NULL ? "(NULL)" : *avp);
- if (*avp != NULL)
- avp++;
+ mval == NULL ? "(NULL)" : mval);
+ if (mval == NULL || *mval == '\0')
+ continue;
+
+ /* save the remainder of the input */
+ for (xpvp = pvp; *xpvp != NULL; xpvp++)
+ trsize += sizeof *xpvp;
+ if (trsize > pvpb1_size)
+ {
+ if (pvpb1 != NULL)
+ free(pvpb1);
+ pvpb1 = (char **)xalloc(trsize);
+ pvpb1_size = trsize;
+ }
+
+ bcopy((char *) pvp, (char *) pvpb1, trsize);
+
+ /* scan the new replacement */
+ xpvp = prescan(mval, '\0', pvpbuf,
+ sizeof pvpbuf, NULL, NULL);
+ if (xpvp == NULL)
+ {
+ /* prescan pre-printed error */
+ return EX_DATAERR;
+ }
+
+ /* insert it into the output stream */
+ while (*xpvp != NULL)
+ {
+ if (tTd(21, 19))
+ printf(" ... %s\n", *xpvp);
+ *avp++ = newstr(*xpvp);
+ if (avp >= &npvp[MAXATOM])
+ goto toolong;
+ xpvp++;
+ }
+ if (tTd(21, 19))
+ printf(" ... DONE\n");
+
+ /* restore the old trailing input */
+ bcopy((char *) pvpb1, (char *) pvp, trsize);
}
}
}
@@ -1239,11 +1264,10 @@ rewrite(pvp, ruleset, reclevel, e)
}
/* restore the old trailing information */
+ rvp = avp - 1;
for (xpvp = pvpb1; (*avp++ = *xpvp++) != NULL; )
if (avp >= &npvp[MAXATOM])
goto toolong;
-
- break;
}
/*
@@ -1308,6 +1332,7 @@ callsubr(pvp, reclevel, e)
{
if ((**avp & 0377) == CALLSUBR && avp[1] != NULL)
{
+ stripquotes(avp[1]);
subr = strtorwset(avp[1], NULL, ST_FIND);
if (subr < 0)
{
@@ -1448,10 +1473,29 @@ map_lookup(map, key, argvect, pstat, e)
snprintf(mbuf, sizeof mbuf,
"%.80s map: lookup (%s): deferred",
map->s_name,
- shortenstring(key, 203));
+ shortenstring(key, MAXSHORTSTR));
e->e_message = newstr(mbuf);
}
}
+ if (stat == EX_TEMPFAIL && map->s_map.map_tapp != NULL)
+ {
+ size_t i = strlen(key) + strlen(map->s_map.map_tapp) + 1;
+ static char *rwbuf = NULL;
+ static size_t rwbuflen = 0;
+
+ if (i > rwbuflen)
+ {
+ if (rwbuf != NULL)
+ free(rwbuf);
+ rwbuflen = i;
+ rwbuf = (char *) xalloc(rwbuflen);
+ }
+ snprintf(rwbuf, rwbuflen, "%s%s", key, map->s_map.map_tapp);
+ if (tTd(60, 4))
+ printf("map_lookup tempfail: returning \"%s\"\n",
+ rwbuf);
+ return rwbuf;
+ }
return replac;
}
/*
@@ -1505,7 +1549,9 @@ buildaddr(tv, a, flags, e)
char *mname;
char **hostp;
char hbuf[MAXNAME + 1];
+ static MAILER discardmailer;
static MAILER errormailer;
+ static char *discardargv[] = { "DISCARD", NULL };
static char *errorargv[] = { "ERROR", NULL };
static char ubuf[MAXNAME + 1];
@@ -1522,6 +1568,14 @@ buildaddr(tv, a, flags, e)
/* set up default error return flags */
a->q_flags |= DefaultNotify;
+ if (discardmailer.m_name == NULL)
+ {
+ /* initialize the discard mailer */
+ discardmailer.m_name = "*discard*";
+ discardmailer.m_mailer = "DISCARD";
+ discardmailer.m_argv = discardargv;
+ }
+
/* figure out what net/mailer to use */
if (*tv == NULL || (**tv & 0377) != CANONNET)
{
@@ -1990,7 +2044,7 @@ remotename(name, m, flags, pstat, e)
static char buf[MAXNAME + 1];
char lbuf[MAXNAME + 1];
char pvpbuf[PSBUFSIZE];
- extern char *crackaddr();
+ extern char *crackaddr __P((char *));
if (tTd(12, 1))
printf("remotename(%s)\n", name);
@@ -2251,6 +2305,7 @@ dequote_init(map, args)
** else -- The dequoted buffer.
*/
+/* ARGSUSED2 */
char *
dequote_map(map, name, av, statp)
MAP *map;
@@ -2356,9 +2411,10 @@ rscheck(rwset, p1, p2, e)
char *buf;
int bufsize;
int saveexitstat;
- int rstat;
+ int rstat = EX_OK;
char **pvp;
int rsno;
+ bool discard = FALSE;
auto ADDRESS a1;
bool saveQuickAbort = QuickAbort;
bool saveSuprErrs = SuprErrs;
@@ -2404,25 +2460,49 @@ rscheck(rwset, p1, p2, e)
SuprErrs = saveSuprErrs;
if (pvp == NULL)
{
+ if (tTd(48, 2))
+ printf("rscheck: cannot prescan input\n");
+/*
syserr("rscheck: cannot prescan input: \"%s\"",
- shortenstring(buf, 203));
+ shortenstring(buf, MAXSHORTSTR));
rstat = EX_DATAERR;
+*/
goto finis;
}
(void) rewrite(pvp, rsno, 0, e);
if (pvp[0] == NULL || (pvp[0][0] & 0377) != CANONNET ||
- pvp[1] == NULL || strcmp(pvp[1], "error") != 0)
+ pvp[1] == NULL || (strcmp(pvp[1], "error") != 0 &&
+ strcmp(pvp[1], "discard") != 0))
{
- rstat = EX_OK;
goto finis;
}
- /* got an error -- process it */
- saveexitstat = ExitStat;
- (void) buildaddr(pvp, &a1, 0, e);
- rstat = ExitStat;
- ExitStat = saveexitstat;
-
+ if (strcmp(pvp[1], "discard") == 0)
+ {
+ if (tTd(48, 2))
+ printf("rscheck: discard mailer selected\n");
+ e->e_flags |= EF_DISCARD;
+ discard = TRUE;
+ }
+ else
+ {
+ int savelogusrerrs = LogUsrErrs;
+ static bool logged = FALSE;
+
+ /* got an error -- process it */
+ saveexitstat = ExitStat;
+ LogUsrErrs = FALSE;
+ (void) buildaddr(pvp, &a1, 0, e);
+ LogUsrErrs = savelogusrerrs;
+ rstat = ExitStat;
+ ExitStat = saveexitstat;
+ if (!logged)
+ {
+ markstats(e, &a1, TRUE);
+ logged = TRUE;
+ }
+ }
+
if (LogLevel >= 4)
{
char *relay;
@@ -2444,9 +2524,14 @@ rscheck(rwset, p1, p2, e)
p += strlen(p);
}
*p = '\0';
- sm_syslog(LOG_NOTICE, e->e_id,
- "ruleset=%s, arg1=%s%s, reject=%s",
- rwset, p1, lbuf, MsgBuf);
+ if (discard)
+ sm_syslog(LOG_NOTICE, e->e_id,
+ "ruleset=%s, arg1=%s%s, discard",
+ rwset, p1, lbuf);
+ else
+ sm_syslog(LOG_NOTICE, e->e_id,
+ "ruleset=%s, arg1=%s%s, reject=%s",
+ rwset, p1, lbuf, MsgBuf);
}
finis:
diff --git a/usr.sbin/sendmail/src/pathnames.h b/usr.sbin/sendmail/src/pathnames.h
index a364fbab33a..e10387ee398 100644
--- a/usr.sbin/sendmail/src/pathnames.h
+++ b/usr.sbin/sendmail/src/pathnames.h
@@ -1,36 +1,14 @@
/*-
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*
- * @(#)pathnames.h 8.4 (Berkeley) 6/19/95
+ * @(#)pathnames.h 8.8 (Berkeley) 5/19/98
*/
#ifndef _PATH_SENDMAILCF
diff --git a/usr.sbin/sendmail/src/queue.c b/usr.sbin/sendmail/src/queue.c
index d48efb1179b..24b789a251b 100644
--- a/usr.sbin/sendmail/src/queue.c
+++ b/usr.sbin/sendmail/src/queue.c
@@ -1,44 +1,22 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
# include "sendmail.h"
#ifndef lint
#if QUEUE
-static char sccsid[] = "@(#)queue.c 8.175 (Berkeley) 10/4/97 (with queueing)";
+static char sccsid[] = "@(#)queue.c 8.202 (Berkeley) 6/15/98 (with queueing)";
#else
-static char sccsid[] = "@(#)queue.c 8.175 (Berkeley) 10/4/97 (without queueing)";
+static char sccsid[] = "@(#)queue.c 8.202 (Berkeley) 6/15/98 (without queueing)";
#endif
#endif /* not lint */
@@ -163,7 +141,7 @@ queueup(e, announce)
newid ? " (new id)" : "");
if (tTd(40, 3))
{
- extern void printenvflags();
+ extern void printenvflags __P((ENVELOPE *));
printf(" e_flags=");
printenvflags(e);
@@ -225,10 +203,10 @@ queueup(e, announce)
fprintf(tfp, "V%d\n", QF_VERSION);
/* output creation time */
- fprintf(tfp, "T%ld\n", e->e_ctime);
+ fprintf(tfp, "T%ld\n", (long) e->e_ctime);
/* output last delivery time */
- fprintf(tfp, "K%ld\n", e->e_dtime);
+ fprintf(tfp, "K%ld\n", (long) e->e_dtime);
/* output number of delivery attempts */
fprintf(tfp, "N%d\n", e->e_ntries);
@@ -239,8 +217,16 @@ queueup(e, announce)
/* output inode number of data file */
/* XXX should probably include device major/minor too */
if (e->e_dfino != -1)
- fprintf(tfp, "I%d/%d/%ld\n",
- major(e->e_dfdev), minor(e->e_dfdev), e->e_dfino);
+ {
+ if (sizeof e->e_dfino > sizeof(long))
+ fprintf(tfp, "I%d/%d/%s\n",
+ major(e->e_dfdev), minor(e->e_dfdev),
+ quad_to_string(e->e_dfino));
+ else
+ fprintf(tfp, "I%d/%d/%lu\n",
+ major(e->e_dfdev), minor(e->e_dfdev),
+ (unsigned long) e->e_dfino);
+ }
/* output body type */
if (e->e_bodytype != NULL)
@@ -360,7 +346,7 @@ queueup(e, announce)
define('g', "\201f", e);
for (h = e->e_header; h != NULL; h = h->h_link)
{
- extern bool bitzerop();
+ extern bool bitzerop __P((BITMAP));
/* don't output null headers */
if (h->h_value == NULL || h->h_value[0] == '\0')
@@ -477,7 +463,7 @@ printctladdr(a, tfp)
register ADDRESS *q;
uid_t uid;
gid_t gid;
- static ADDRESS *lastctladdr;
+ static ADDRESS *lastctladdr = NULL;
static uid_t lastuid;
/* initialization */
@@ -599,12 +585,10 @@ runqueue(forkflag, verbose)
{
pid_t pid;
extern SIGFUNC_DECL intsig __P((int));
-#ifdef SIGCHLD
extern SIGFUNC_DECL reapchild __P((int));
blocksignal(SIGCHLD);
(void) setsignal(SIGCHLD, reapchild);
-#endif
pid = dofork();
if (pid == -1)
@@ -626,27 +610,18 @@ runqueue(forkflag, verbose)
if (pid != 0)
{
/* parent -- pick up intermediate zombie */
-#ifndef SIGCHLD
- (void) waitfor(pid);
-#else
(void) blocksignal(SIGALRM);
proc_list_add(pid);
(void) releasesignal(SIGALRM);
releasesignal(SIGCHLD);
-#endif /* SIGCHLD */
if (QueueIntvl != 0)
(void) setevent(QueueIntvl, runqueueevent, 0);
return TRUE;
}
/* child -- double fork and clean up signals */
proc_list_clear();
-#ifndef SIGCHLD
- if (fork() != 0)
- exit(EX_OK);
-#else /* SIGCHLD */
releasesignal(SIGCHLD);
(void) setsignal(SIGCHLD, SIG_DFL);
-#endif /* SIGCHLD */
(void) setsignal(SIGHUP, intsig);
}
@@ -775,7 +750,7 @@ runqueue(forkflag, verbose)
else
{
pid_t pid;
- extern pid_t dowork();
+ extern pid_t dowork __P((char *, bool, bool, ENVELOPE *));
if (Verbose)
{
@@ -842,20 +817,40 @@ orderq(doall)
{
register struct dirent *d;
register WORK *w;
+ register char *p;
DIR *f;
register int i;
int wn = -1;
int wc;
-
+ QUEUE_CHAR *check;
+
if (tTd(41, 1))
{
printf("orderq:\n");
- if (QueueLimitId != NULL)
- printf("\tQueueLimitId = %s\n", QueueLimitId);
- if (QueueLimitSender != NULL)
- printf("\tQueueLimitSender = %s\n", QueueLimitSender);
- if (QueueLimitRecipient != NULL)
- printf("\tQueueLimitRecipient = %s\n", QueueLimitRecipient);
+
+ check = QueueLimitId;
+ while (check != NULL)
+ {
+ printf("\tQueueLimitId = %s\n",
+ check->queue_match);
+ check = check->queue_next;
+ }
+
+ check = QueueLimitSender;
+ while (check != NULL)
+ {
+ printf("\tQueueLimitSender = %s\n",
+ check->queue_match);
+ check = check->queue_next;
+ }
+
+ check = QueueLimitRecipient;
+ while (check != NULL)
+ {
+ printf("\tQueueLimitRecipient = %s\n",
+ check->queue_match);
+ check = check->queue_next;
+ }
}
/* clear out old WorkQ */
@@ -886,9 +881,9 @@ orderq(doall)
while ((d = readdir(f)) != NULL)
{
FILE *cf;
- register char *p;
+ int qfver = 0;
char lbuf[MAXNAME + 1];
- extern bool strcontainedin();
+ extern bool strcontainedin __P((char *, char *));
if (tTd(41, 50))
printf("orderq: checking %s\n", d->d_name);
@@ -900,8 +895,15 @@ orderq(doall)
if (strlen(d->d_name) > MAXQFNAME)
continue;
- if (QueueLimitId != NULL &&
- !strcontainedin(QueueLimitId, d->d_name))
+ check = QueueLimitId;
+ while (check != NULL)
+ {
+ if (strcontainedin(check->queue_match, d->d_name))
+ break;
+ else
+ check = check->queue_next;
+ }
+ if (QueueLimitId != NULL && check == NULL)
continue;
#ifdef PICKY_QF_NAME_CHECK
@@ -984,10 +986,9 @@ orderq(doall)
i |= NEED_R;
while (i != 0 && fgets(lbuf, sizeof lbuf, cf) != NULL)
{
- int qfver = 0;
- char *p;
int c;
- extern bool strcontainedin();
+ time_t age;
+ extern bool strcontainedin __P((char *, char *));
p = strchr(lbuf, '\n');
if (p != NULL)
@@ -1032,18 +1033,37 @@ orderq(doall)
}
else
p = &lbuf[1];
- if (strcontainedin(QueueLimitRecipient, p))
+ check = QueueLimitRecipient;
+ while (check != NULL)
+ {
+ if (strcontainedin(check->queue_match,
+ p))
+ break;
+ else
+ check = check->queue_next;
+ }
+ if (check != NULL)
i &= ~NEED_R;
break;
case 'S':
- if (QueueLimitSender != NULL &&
- strcontainedin(QueueLimitSender, &lbuf[1]))
- i &= ~NEED_S;
+ check = QueueLimitSender;
+ while (check != NULL)
+ {
+ if (strcontainedin(check->queue_match,
+ &lbuf[1]))
+ break;
+ else
+ check = check->queue_next;
+ }
+ if (check != NULL)
+ i &= ~NEED_S;
break;
case 'K':
- if ((curtime() - (time_t) atol(&lbuf[1])) < MinQueueAge)
+ age = curtime() - (time_t) atol(&lbuf[1]);
+ if (age >= 0 && MinQueueAge > 0 &&
+ age < MinQueueAge)
w->w_tooyoung = TRUE;
break;
@@ -1076,8 +1096,8 @@ orderq(doall)
if (QueueSortOrder == QS_BYHOST)
{
- extern workcmpf1();
- extern workcmpf2();
+ extern int workcmpf1();
+ extern int workcmpf2();
/*
** Sort the work directory for the first time,
@@ -1102,12 +1122,14 @@ orderq(doall)
w = &WorkList[i];
while (++i < wc)
{
+ extern int sm_strcasecmp __P((char *, char *));
+
if (WorkList[i].w_host == NULL &&
w->w_host == NULL)
WorkList[i].w_lock = TRUE;
else if (WorkList[i].w_host != NULL &&
w->w_host != NULL &&
- strcmp(WorkList[i].w_host, w->w_host) == 0)
+ sm_strcasecmp(WorkList[i].w_host, w->w_host) == 0)
WorkList[i].w_lock = TRUE;
else
break;
@@ -1123,7 +1145,7 @@ orderq(doall)
}
else if (QueueSortOrder == QS_BYTIME)
{
- extern workcmpf3();
+ extern int workcmpf3();
/*
** Simple sort based on submission time only.
@@ -1133,7 +1155,7 @@ orderq(doall)
}
else
{
- extern workcmpf0();
+ extern int workcmpf0();
/*
** Simple sort based on queue priority only.
@@ -1163,6 +1185,7 @@ orderq(doall)
if (WorkList != NULL)
free(WorkList);
WorkList = NULL;
+ WorkListSize = 0;
if (tTd(40, 1))
{
@@ -1279,6 +1302,7 @@ workcmpf1(a, b)
register WORK *b;
{
int i;
+ extern int sm_strcasecmp __P((char *, char *));
/* host name */
if (a->w_host != NULL && b->w_host == NULL)
@@ -1286,7 +1310,7 @@ workcmpf1(a, b)
else if (a->w_host == NULL && b->w_host != NULL)
return -1;
if (a->w_host != NULL && b->w_host != NULL &&
- (i = strcmp(a->w_host, b->w_host)))
+ (i = sm_strcasecmp(a->w_host, b->w_host)) != 0)
return i;
/* lock status */
@@ -1320,6 +1344,7 @@ workcmpf2(a, b)
register WORK *b;
{
int i;
+ extern int sm_strcasecmp __P((char *, char *));
/* lock status */
if (a->w_lock != b->w_lock)
@@ -1331,7 +1356,7 @@ workcmpf2(a, b)
else if (a->w_host == NULL && b->w_host != NULL)
return -1;
if (a->w_host != NULL && b->w_host != NULL &&
- (i = strcmp(a->w_host, b->w_host)))
+ (i = sm_strcasecmp(a->w_host, b->w_host)) != 0)
return i;
/* job priority */
@@ -1392,7 +1417,7 @@ dowork(id, forkflag, requeueflag, e)
register ENVELOPE *e;
{
register pid_t pid;
- extern bool readqf();
+ extern bool readqf __P((ENVELOPE *));
if (tTd(40, 1))
printf("dowork(%s)\n", id);
@@ -1461,7 +1486,7 @@ dowork(id, forkflag, requeueflag, e)
/* read the queue control file -- return if locked */
if (!readqf(e))
{
- if (tTd(40, 4))
+ if (tTd(40, 4) && e->e_id != NULL)
printf("readqf(%s) failed\n", e->e_id);
e->e_id = NULL;
if (forkflag)
@@ -1748,10 +1773,11 @@ readqf(e)
/* if this has been tried recently, let it be */
if (e->e_ntries > 0 &&
+ MinQueueAge > 0 && e->e_dtime <= curtime() &&
curtime() < e->e_dtime + MinQueueAge)
{
char *howlong = pintvl(curtime() - e->e_dtime, TRUE);
- extern void unlockqueue();
+ extern void unlockqueue __P((ENVELOPE *));
if (Verbose || tTd(40, 8))
printf("%s: too young (%s)\n",
@@ -1825,7 +1851,7 @@ readqf(e)
default:
syserr("readqf: %s: line %d: bad line \"%s\"",
- qf, LineNumber, shortenstring(bp, 203));
+ qf, LineNumber, shortenstring(bp, MAXSHORTSTR));
fclose(qfp);
loseqfile(e, "unrecognized line");
return FALSE;
@@ -2100,6 +2126,13 @@ printqueue()
** locked, open-for-write file pointer in the envelope.
*/
+#ifndef ENOLCK
+# define ENOLCK -1
+#endif
+#ifndef ENOSPC
+# define ENOSPC -1
+#endif
+
char *
queuename(e, type)
register ENVELOPE *e;
@@ -2133,6 +2166,7 @@ queuename(e, type)
while (c1 < '~' || c2 < 'Z')
{
int i;
+ int attempts = 0;
if (c2 >= 'Z')
{
@@ -2153,10 +2187,32 @@ queuename(e, type)
qf, QueueDir, geteuid());
exit(EX_UNAVAILABLE);
}
- if (lockfile(i, qf, NULL, LOCK_EX|LOCK_NB))
+ do
{
- e->e_lockfp = fdopen(i, "w");
+ if (attempts > 0)
+ sleep(attempts);
+ e->e_lockfp = 0;
+ if (lockfile(i, qf, NULL, LOCK_EX|LOCK_NB))
+ {
+ e->e_lockfp = fdopen(i, "w");
+ break;
+ }
+ } while ((errno == ENOLCK || errno == ENOSPC) &&
+ attempts++ < 4);
+
+ /* Successful lock */
+ if (e->e_lockfp != 0)
break;
+
+#if !HASFLOCK
+ if (errno != EAGAIN && errno != EACCES)
+#else
+ if (errno != EWOULDBLOCK)
+#endif
+ {
+ syserr("queuename: Cannot lock \"%s\" in \"%s\" (euid=%d)",
+ qf, QueueDir, geteuid());
+ exit(EX_OSERR);
}
/* a reader got the file; abandon it and try again */
diff --git a/usr.sbin/sendmail/src/readcf.c b/usr.sbin/sendmail/src/readcf.c
index 681c3d3a1d7..db71937fba6 100644
--- a/usr.sbin/sendmail/src/readcf.c
+++ b/usr.sbin/sendmail/src/readcf.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)readcf.c 8.201 (Berkeley) 10/1/97";
+static char sccsid[] = "@(#)readcf.c 8.230 (Berkeley) 6/5/98";
#endif /* not lint */
# include "sendmail.h"
@@ -43,9 +21,9 @@ static char sccsid[] = "@(#)readcf.c 8.201 (Berkeley) 10/1/97";
#endif
/*
-** READCF -- read control file.
+** READCF -- read configuration file.
**
-** This routine reads the control file and builds the internal
+** This routine reads the configuration file and builds the internal
** form.
**
** The file is formatted as a sequence of lines, each taken
@@ -77,7 +55,7 @@ static char sccsid[] = "@(#)readcf.c 8.201 (Berkeley) 10/1/97";
** Eenvar=value Set the environment value to the given value.
**
** Parameters:
-** cfname -- control file name.
+** cfname -- configuration file name.
** safe -- TRUE if this is the system config file;
** FALSE otherwise.
** e -- the main envelope.
@@ -233,10 +211,6 @@ readcf(cfname, safe, e)
botch = "$0-$9";
break;
- case CANONNET:
- botch = "$#";
- break;
-
case CANONUSER:
botch = "$:";
break;
@@ -536,7 +510,7 @@ readcf(cfname, safe, e)
default:
badline:
- syserr("unknown control line \"%s\"", bp);
+ syserr("unknown configuration line \"%s\"", bp);
}
if (bp != buf)
free(bp);
@@ -750,7 +724,11 @@ fileclass(class, filename, fmt, safe, optional)
else
{
pid = -1;
- sff = SFF_REGONLY|SFF_NOWLINK;
+ sff = SFF_REGONLY;
+ if (!bitset(DBS_CLASSFILEINUNSAFEDIRPATH, DontBlameSendmail))
+ sff |= SFF_SAFEDIRPATH;
+ if (!bitset(DBS_LINKEDCLASSFILEINWRITABLEDIR, DontBlameSendmail))
+ sff |= SFF_NOWLINK;
if (safe)
sff |= SFF_OPENASROOT;
if (DontLockReadFiles)
@@ -850,7 +828,7 @@ makemailer(line)
char fcode;
auto char *endp;
extern int NextMailer;
- extern char **makeargv();
+ extern char **makeargv __P((char *));
extern char *munchstring __P((char *, char **, int));
/* allocate a mailer and set up defaults */
@@ -1105,6 +1083,24 @@ makemailer(line)
m->m_diagtype = "smtp";
}
+ if (strcmp(m->m_mailer, "[FILE]") == 0)
+ {
+ /* Use the second argument for filename */
+ if (m->m_argv[0] == NULL || m->m_argv[1] == NULL ||
+ m->m_argv[2] != NULL)
+ {
+ syserr("M%s: too %s parameters for [FILE] mailer",
+ m->m_name,
+ (m->m_argv[0] == NULL ||
+ m->m_argv[1] == NULL) ? "few" : "many");
+ }
+ else if (strcmp(m->m_argv[0], "FILE") != 0)
+ {
+ syserr("M%s: first argument in [FILE] mailer must be FILE",
+ m->m_name);
+ }
+ }
+
if (m->m_eol == NULL)
{
char **pp;
@@ -1497,34 +1493,32 @@ struct optioninfo
#define O_PIDFILE 0x9f
{ "PidFile", O_PIDFILE, FALSE },
#endif
-#if _FFR_WRITABLE_DIRECTORIES_ARE_FATAL_OPTION
-#define O_WDAF 0xa0
- { "WritableDirectoriesAreFatal", O_WDAF, FALSE },
-#endif
-#if _FFR_CHOWN_IS_ALWAYS_SAFE_OPTION
-#define O_CIAS 0xa1
- { "ChownIsAlwaysSafe", O_CIAS, FALSE },
-#endif
-#if _FFR_DONT_PROBE_INTERFACES_OPTION
-#define O_DPI 0xa2
+#define O_DONTBLAMESENDMAIL 0xa0
+ { "DontBlameSendmail", O_DONTBLAMESENDMAIL, FALSE },
+#define O_DPI 0xa1
{ "DontProbeInterfaces", O_DPI, FALSE },
-#endif
-#if _FFR_MAXRCPT_OPTION
-#define O_MAXRCPT 0xa3
- { "MaxRecipientPerMessage", O_MAXRCPT, FALSE },
-#endif
+#define O_MAXRCPT 0xa2
+ { "MaxRecipientsPerMessage", O_MAXRCPT, FALSE },
#if _FFR_DEADLETTERDROP_OPTION
-#define O_DEADLETTER 0xa4
+#define O_DEADLETTER 0xa3
{ "DeadLetterDrop", O_DEADLETTER, FALSE },
#endif
#if _FFR_DONTLOCKFILESFORREAD_OPTION
-#define O_DONTLOCK 0xa5
+#define O_DONTLOCK 0xa4
{ "DontLockFilesForRead", O_DONTLOCK, FALSE },
#endif
#if _FFR_MAXALIASRECURSION_OPTION
-#define O_MAXALIASRCSN 0xa6
+#define O_MAXALIASRCSN 0xa5
{ "MaxAliasRecursion", O_MAXALIASRCSN, FALSE },
#endif
+#if _FFR_CONNECTONLYTO_OPTION
+#define O_CNCTONLYTO 0xa6
+ { "ConnectOnlyTo", O_CNCTONLYTO, FALSE },
+#endif
+#if _FFR_TRUSTED_FILE_OWNER
+#define O_TRUSTFILEOWN 0xa7
+ { "TrustedFileOwner", O_TRUSTFILEOWN, FALSE },
+#endif
{ NULL, '\0', FALSE }
};
@@ -1543,10 +1537,11 @@ setoption(opt, val, safe, sticky, e)
register struct optioninfo *o;
char *subopt;
int mid;
+ bool can_setuid = RunAsUid == 0;
auto char *ep;
char buf[50];
- extern bool atobool();
- extern time_t convtime();
+ extern bool atobool __P((char *));
+ extern time_t convtime __P((char *, char));
extern int QueueLA;
extern int RefuseLA;
extern bool Warn_Q_option;
@@ -1778,6 +1773,9 @@ setoption(opt, val, safe, sticky, e)
syserr("Unknown delivery mode %c", *val);
exit(EX_USAGE);
}
+ buf[0] = (char)e->e_sendmode;
+ buf[1] = '\0';
+ define(macid("{deliveryMode}", NULL), newstr(buf), e);
break;
case 'D': /* rebuild alias database as needed */
@@ -2052,7 +2050,10 @@ setoption(opt, val, safe, sticky, e)
}
}
if (isascii(*val) && isdigit(*val))
+ {
DefUid = atoi(val);
+ setdefuser();
+ }
else
{
register struct passwd *pw;
@@ -2065,6 +2066,7 @@ setoption(opt, val, safe, sticky, e)
{
DefUid = pw->pw_uid;
DefGid = pw->pw_gid;
+ DefUser = newstr(pw->pw_name);
}
}
@@ -2075,7 +2077,6 @@ setoption(opt, val, safe, sticky, e)
DefUid, UID_MAX);
}
#endif
- setdefuser();
/* handle the group if it is there */
if (*p == '\0')
@@ -2240,7 +2241,8 @@ setoption(opt, val, safe, sticky, e)
break;
case O_UGW: /* group writable files are unsafe */
- UnsafeGroupWrites = atobool(val);
+ if (!atobool(val))
+ DontBlameSendmail |= DBS_GROUPWRITABLEFORWARDFILESAFE|DBS_GROUPWRITABLEINCLUDEFILESAFE;
break;
case O_DBLBOUNCE: /* address to which to send double bounces */
@@ -2270,7 +2272,7 @@ setoption(opt, val, safe, sticky, e)
}
if (isascii(*val) && isdigit(*val))
{
- if (RunAsUid == 0)
+ if (can_setuid)
RunAsUid = atoi(val);
}
else
@@ -2280,7 +2282,7 @@ setoption(opt, val, safe, sticky, e)
pw = sm_getpwnam(val);
if (pw == NULL)
syserr("readcf: option RunAsUser: unknown user %s", val);
- else if (RunAsUid == 0)
+ else if (can_setuid)
{
if (*p == '\0')
RunAsUserName = newstr(val);
@@ -2288,24 +2290,34 @@ setoption(opt, val, safe, sticky, e)
RunAsGid = pw->pw_gid;
}
}
- if (*p == '\0')
- break;
- if (isascii(*p) && isdigit(*p))
+#ifdef UID_MAX
+ if (RunAsUid > UID_MAX)
{
- if (RunAsGid == 0)
- RunAsGid = atoi(p);
+ syserr("readcf: option RunAsUser: uid value (%ld) > UID_MAX (%ld); ignored",
+ RunAsUid, UID_MAX);
}
- else
+#endif
+ if (*p != '\0')
{
- register struct group *gr;
-
- gr = getgrnam(p);
- if (gr == NULL)
- syserr("readcf: option RunAsUser: unknown group %s",
- p);
- else if (RunAsGid == 0)
- RunAsGid = gr->gr_gid;
+ if (isascii(*p) && isdigit(*p))
+ {
+ if (can_setuid)
+ RunAsGid = atoi(p);
+ }
+ else
+ {
+ register struct group *gr;
+
+ gr = getgrnam(p);
+ if (gr == NULL)
+ syserr("readcf: option RunAsUser: unknown group %s",
+ p);
+ else if (can_setuid)
+ RunAsGid = gr->gr_gid;
+ }
}
+ if (tTd(47, 5))
+ printf("readcf: RunAsUser = %d:%d\n", (int)RunAsUid, (int)RunAsGid);
break;
#if _FFR_DSN_RRT_OPTION
@@ -2321,29 +2333,46 @@ setoption(opt, val, safe, sticky, e)
break;
#endif
-#if _FFR_WRITABLE_DIRECTORIES_ARE_FATAL_OPTION
- case O_WDAF:
- FatalWritableDirs = atobool(val);
- break;
-#endif
+ case O_DONTBLAMESENDMAIL:
+ p = val;
+ for (;;)
+ {
+ register struct dbsval *dbs;
+ extern struct dbsval DontBlameSendmailValues[];
+
+ while (isascii(*p) && (isspace(*p) || ispunct(*p)))
+ p++;
+ if (*p == '\0')
+ break;
+ val = p;
+ while (isascii(*p) && isalnum(*p))
+ p++;
+ if (*p != '\0')
+ *p++ = '\0';
-#if _FFR_CHOWN_IS_ALWAYS_SAFE_OPTION
- case O_CIAS:
- ChownIsAlwaysSafe = atobool(val);
+ for (dbs = DontBlameSendmailValues;
+ dbs->dbs_name != NULL; dbs++)
+ {
+ if (strcasecmp(val, dbs->dbs_name) == 0)
+ break;
+ }
+ if (dbs->dbs_name == NULL)
+ syserr("readcf: DontBlameSendmail option: %s unrecognized", val);
+ else if (dbs->dbs_flag == DBS_SAFE)
+ DontBlameSendmail = DBS_SAFE;
+ else
+ DontBlameSendmail |= dbs->dbs_flag;
+ }
+ sticky = FALSE;
break;
-#endif
-#if _FFR_DONT_PROBE_INTERFACES_OPTION
case O_DPI:
DontProbeInterfaces = atobool(val);
break;
-#endif
-#if _FFR_MAXRCPT_OPTION
case O_MAXRCPT:
MaxRcptPerMsg = atoi(val);
break;
-#endif
#if _FFR_DEADLETTERDROP_OPTION
case O_DEADLETTER:
@@ -2365,6 +2394,40 @@ setoption(opt, val, safe, sticky, e)
break;
#endif
+#if _FFR_CONNECTONLYTO_OPTION
+ case O_CNCTONLYTO:
+ /* XXX should probably use gethostbyname */
+ ConnectOnlyTo = inet_addr(val);
+ break;
+#endif
+
+#if _FFR_TRUSTED_FILE_OWNER
+ case O_TRUSTFILEOWN:
+ if (isascii(*val) && isdigit(*val))
+ TrustedFileUid = atoi(val);
+ else
+ {
+ register struct passwd *pw;
+
+ TrustedFileUid = 0;
+ pw = sm_getpwnam(val);
+ if (pw == NULL)
+ syserr("readcf: option TrustedFileOwner: unknown user %s", val);
+ else
+ TrustedFileUid = pw->pw_uid;
+ }
+
+#ifdef UID_MAX
+ if (TrustedFileUid > UID_MAX)
+ {
+ syserr("readcf: option TrustedFileOwner: uid value (%ld) > UID_MAX (%ld)",
+ TrustedFileUid, UID_MAX);
+ TrustedFileUid = 0;
+ }
+#endif
+ break;
+#endif
+
default:
if (tTd(37, 1))
{
@@ -2536,7 +2599,7 @@ strtorwset(p, endp, stabmode)
while (*p != '\0' && isascii(*p) &&
(isalnum(*p) || *p == '_'))
p++;
- if (q == p || !isalpha(*q))
+ if (q == p || !(isascii(*q) && isalpha(*q)))
{
/* no valid characters */
syserr("invalid ruleset name: \"%.20s\"", q);
@@ -2558,7 +2621,7 @@ strtorwset(p, endp, stabmode)
{
while (isascii(*++p) && isspace(*p))
continue;
- if (!isdigit(*p))
+ if (!(isascii(*p) && isdigit(*p)))
{
syserr("bad ruleset definition \"%s\" (number required after `=')", q);
ruleset = -1;
@@ -2623,7 +2686,7 @@ inittimeouts(val)
register char *val;
{
register char *p;
- extern time_t convtime();
+ extern time_t convtime __P((char *, char));
if (tTd(37, 2))
printf("inittimeouts(%s)\n", val == NULL ? "<NULL>" : val);
@@ -2650,20 +2713,20 @@ inittimeouts(val)
if (tTd(37, 5))
{
printf("Timeouts:\n");
- printf(" connect = %ld\n", TimeOuts.to_connect);
- printf(" initial = %ld\n", TimeOuts.to_initial);
- printf(" helo = %ld\n", TimeOuts.to_helo);
- printf(" mail = %ld\n", TimeOuts.to_mail);
- printf(" rcpt = %ld\n", TimeOuts.to_rcpt);
- printf(" datainit = %ld\n", TimeOuts.to_datainit);
- printf(" datablock = %ld\n", TimeOuts.to_datablock);
- printf(" datafinal = %ld\n", TimeOuts.to_datafinal);
- printf(" rset = %ld\n", TimeOuts.to_rset);
- printf(" quit = %ld\n", TimeOuts.to_quit);
- printf(" nextcommand = %ld\n", TimeOuts.to_nextcommand);
- printf(" miscshort = %ld\n", TimeOuts.to_miscshort);
- printf(" ident = %ld\n", TimeOuts.to_ident);
- printf(" fileopen = %ld\n", TimeOuts.to_fileopen);
+ printf(" connect = %ld\n", (long)TimeOuts.to_connect);
+ printf(" initial = %ld\n", (long)TimeOuts.to_initial);
+ printf(" helo = %ld\n", (long)TimeOuts.to_helo);
+ printf(" mail = %ld\n", (long)TimeOuts.to_mail);
+ printf(" rcpt = %ld\n", (long)TimeOuts.to_rcpt);
+ printf(" datainit = %ld\n", (long)TimeOuts.to_datainit);
+ printf(" datablock = %ld\n", (long)TimeOuts.to_datablock);
+ printf(" datafinal = %ld\n", (long)TimeOuts.to_datafinal);
+ printf(" rset = %ld\n", (long)TimeOuts.to_rset);
+ printf(" quit = %ld\n", (long)TimeOuts.to_quit);
+ printf(" nextcommand = %ld\n", (long)TimeOuts.to_nextcommand);
+ printf(" miscshort = %ld\n", (long)TimeOuts.to_miscshort);
+ printf(" ident = %ld\n", (long)TimeOuts.to_ident);
+ printf(" fileopen = %ld\n", (long)TimeOuts.to_fileopen);
}
return;
}
@@ -2722,7 +2785,7 @@ settimeout(name, val)
{
register char *p;
time_t to;
- extern time_t convtime();
+ extern time_t convtime __P((char *, char));
if (tTd(37, 2))
printf("settimeout(%s = %s)\n", name, val);
diff --git a/usr.sbin/sendmail/src/recipient.c b/usr.sbin/sendmail/src/recipient.c
index adcce7acf83..9a73b6a39cf 100644
--- a/usr.sbin/sendmail/src/recipient.c
+++ b/usr.sbin/sendmail/src/recipient.c
@@ -1,42 +1,21 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)recipient.c 8.133 (Berkeley) 10/19/97";
+static char sccsid[] = "@(#)recipient.c 8.154 (Berkeley) 6/24/98";
#endif /* not lint */
# include "sendmail.h"
+# include <grp.h>
/*
** SENDTOLIST -- Designate a send list.
@@ -134,7 +113,7 @@ sendtolist(list, ctladdr, sendq, aliaslevel, e)
if (ctladdr != NULL)
{
ADDRESS *b;
- extern ADDRESS *self_reference();
+ extern ADDRESS *self_reference __P((ADDRESS *, ENVELOPE *));
/* self reference test */
if (sameaddr(ctladdr, a))
@@ -312,6 +291,7 @@ recipient(a, sendq, aliaslevel, e)
{
a->q_flags |= QBADADDR;
a->q_status = "5.7.1";
+ a->q_rstatus = newstr("Unsafe for mailing to programs");
usrerr("550 Address %s is unsafe for mailing to programs",
a->q_alias->q_paddr);
}
@@ -328,7 +308,9 @@ recipient(a, sendq, aliaslevel, e)
for (pq = sendq; (q = *pq) != NULL; pq = &q->q_next)
{
- if (sameaddr(q, a) && bitset(QRCPTOK, q->q_flags))
+ if (sameaddr(q, a) &&
+ (bitset(QRCPTOK, q->q_flags) ||
+ !bitset(QPRIMARY, q->q_flags)))
{
if (tTd(26, 1))
{
@@ -383,12 +365,12 @@ recipient(a, sendq, aliaslevel, e)
if (LogLevel > 2)
sm_syslog(LOG_ERR, e->e_id,
"include %s: transient error: %s",
- shortenstring(a->q_user, 203),
+ shortenstring(a->q_user, MAXSHORTSTR),
errstring(ret));
a->q_flags |= QQUEUEUP;
a->q_flags &= ~QDONTSEND;
usrerr("451 Cannot open %s: %s",
- shortenstring(a->q_user, 203),
+ shortenstring(a->q_user, MAXSHORTSTR),
errstring(ret));
}
else if (ret != 0)
@@ -396,14 +378,14 @@ recipient(a, sendq, aliaslevel, e)
a->q_flags |= QBADADDR;
a->q_status = "5.2.4";
usrerr("550 Cannot open %s: %s",
- shortenstring(a->q_user, 203),
+ shortenstring(a->q_user, MAXSHORTSTR),
errstring(ret));
}
}
}
else if (m == FileMailer)
{
- extern bool writable();
+ extern bool writable __P((char *, ADDRESS *, int));
/* check if writable or creatable */
if (a->q_alias == NULL)
@@ -427,6 +409,7 @@ recipient(a, sendq, aliaslevel, e)
{
a->q_flags |= QBADADDR;
a->q_status = "5.7.1";
+ a->q_rstatus = newstr("Unsafe for mailing to files");
usrerr("550 Address %s is unsafe for mailing to files",
a->q_alias->q_paddr);
}
@@ -452,7 +435,7 @@ recipient(a, sendq, aliaslevel, e)
if (!bitset(QDONTSEND|QNOTREMOTE|QVERIFIED, a->q_flags) &&
bitnset(M_CHECKUDB, m->m_flags))
{
- extern int udbexpand();
+ extern int udbexpand __P((ADDRESS *, ADDRESS **, int, ENVELOPE *));
if (udbexpand(a, sendq, aliaslevel, e) == EX_TEMPFAIL)
{
@@ -856,7 +839,11 @@ writable(filename, ctladdr, flags)
if (geteuid() == 0 &&
(ctladdr == NULL || !bitset(QGOODUID, ctladdr->q_flags)))
flags |= SFF_SETUIDOK;
- flags |= SFF_NOLINK;
+
+ if (!bitset(DBS_FILEDELIVERYTOSYMLINK, DontBlameSendmail))
+ flags |= SFF_NOSLINK;
+ if (!bitset(DBS_FILEDELIVERYTOHARDLINK, DontBlameSendmail))
+ flags |= SFF_NOHLINK;
errno = safefile(filename, euid, egid, uname, flags, S_IWRITE, NULL);
return errno == 0;
@@ -898,7 +885,7 @@ writable(filename, ctladdr, flags)
*/
static jmp_buf CtxIncludeTimeout;
-static void includetimeout();
+static void includetimeout __P((void));
int
include(fname, forwarding, ctladdr, sendq, aliaslevel, e)
@@ -915,6 +902,7 @@ include(fname, forwarding, ctladdr, sendq, aliaslevel, e)
int oldlinenumber = LineNumber;
register EVENT *ev = NULL;
int nincludes;
+ int mode;
register ADDRESS *ca;
volatile uid_t saveduid, uid;
volatile gid_t savedgid, gid;
@@ -926,7 +914,7 @@ include(fname, forwarding, ctladdr, sendq, aliaslevel, e)
volatile bool safedir = FALSE;
struct stat st;
char buf[MAXLINE];
- extern bool chownsafe();
+ extern bool chownsafe __P((int, bool));
if (tTd(27, 2))
printf("include(%s)\n", fname);
@@ -964,9 +952,22 @@ include(fname, forwarding, ctladdr, sendq, aliaslevel, e)
if (saveduid == 0)
{
if (!DontInitGroups)
- initgroups(uname, gid);
- if (gid != 0)
- (void) setgid(gid);
+ {
+ if (initgroups(uname, gid) == -1)
+ syserr("include: initgroups(%s, %d) failed",
+ uname, gid);
+ }
+ else
+ {
+ GIDSET_T gidset[1];
+
+ gidset[0] = gid;
+ if (setgroups(1, gidset) == -1)
+ syserr("include: setgroups() failed");
+ }
+
+ if (gid != 0 && setgid(gid) < -1)
+ syserr("setgid(%d) failure", gid);
if (uid != 0)
{
# if USESETEUID
@@ -978,8 +979,6 @@ include(fname, forwarding, ctladdr, sendq, aliaslevel, e)
syserr("setreuid(0, %d) failure (real=%d, eff=%d)",
uid, getuid(), geteuid());
# endif
- else
- sfflags |= SFF_NOPATHCHECK;
}
}
#endif
@@ -1011,18 +1010,63 @@ include(fname, forwarding, ctladdr, sendq, aliaslevel, e)
p = strrchr(fname, '/');
if (p != NULL)
{
+ int ret;
+
*p = '\0';
- if (safedirpath(fname, uid, gid, uname, sfflags|SFF_SAFEDIRPATH) == 0)
+ ret = safedirpath(fname, uid, gid, uname, sfflags|SFF_SAFEDIRPATH);
+ if (ret == 0)
{
/* in safe directory: relax chown & link rules */
safedir = TRUE;
sfflags |= SFF_NOPATHCHECK;
}
+ else
+ {
+ if (bitset((forwarding ?
+ DBS_FORWARDFILEINUNSAFEDIRPATH :
+ DBS_INCLUDEFILEINUNSAFEDIRPATH),
+ DontBlameSendmail))
+ sfflags |= SFF_NOPATHCHECK;
+ else if (bitset((forwarding ?
+ DBS_FORWARDFILEINGROUPWRITABLEDIRPATH :
+ DBS_INCLUDEFILEINGROUPWRITABLEDIRPATH),
+ DontBlameSendmail) &&
+ ret == E_SM_GWDIR)
+ {
+ DontBlameSendmail |= DBS_GROUPWRITABLEDIRPATHSAFE;
+ ret = safedirpath(fname, uid,
+ gid, uname,
+ sfflags|SFF_SAFEDIRPATH);
+ DontBlameSendmail &= ~DBS_GROUPWRITABLEDIRPATHSAFE;
+ if (ret == 0)
+ sfflags |= SFF_NOPATHCHECK;
+ else
+ sfflags |= SFF_SAFEDIRPATH;
+ }
+ else
+ sfflags |= SFF_SAFEDIRPATH;
+ if (ret > E_PSEUDOBASE &&
+ !bitset((forwarding ?
+ DBS_FORWARDFILEINUNSAFEDIRPATHSAFE :
+ DBS_INCLUDEFILEINUNSAFEDIRPATHSAFE),
+ DontBlameSendmail))
+ {
+ if (LogLevel >= 12)
+ sm_syslog(LOG_INFO, e->e_id,
+ "%s: unsafe directory path, marked unsafe",
+ shortenstring(fname, MAXSHORTSTR));
+ ctladdr->q_flags |= QUNSAFEADDR;
+ }
+ }
*p = '/';
}
/* allow links only in unwritable directories */
- if (!safedir)
+ if (!safedir &&
+ !bitset((forwarding ?
+ DBS_LINKEDFORWARDFILEINWRITABLEDIR :
+ DBS_LINKEDINCLUDEFILEINWRITABLEDIR),
+ DontBlameSendmail))
sfflags |= SFF_NOLINK;
rval = safefile(fname, uid, gid, uname, sfflags, S_IREAD, &st);
@@ -1039,7 +1083,7 @@ include(fname, forwarding, ctladdr, sendq, aliaslevel, e)
if (tTd(27, 4))
printf("include: open: %s\n", errstring(rval));
}
- else if (filechanged(fname, fileno(fp), &st, sfflags))
+ else if (filechanged(fname, fileno(fp), &st))
{
rval = E_SM_FILECHANGE;
if (tTd(27, 4))
@@ -1130,7 +1174,7 @@ resetuid:
if (LogLevel >= 12)
sm_syslog(LOG_INFO, e->e_id,
"%s: user %s has bad shell %s, marked %s",
- shortenstring(fname, 203),
+ shortenstring(fname, MAXSHORTSTR),
pw->pw_name, sh,
safechown ? "bogus" : "unsafe");
if (safechown)
@@ -1156,17 +1200,25 @@ resetuid:
** Group write checking could be more clever, e.g.,
** guessing as to which groups are actually safe ("sys"
** may be; "user" probably is not).
- ** Also, we don't check for writable
- ** directories in the path. We've got to leave
- ** something for the local sysad to do.
*/
- if (bitset(S_IWOTH | (UnsafeGroupWrites ? S_IWGRP : 0), st.st_mode))
+ mode = S_IWOTH;
+ if (!bitset((forwarding ?
+ DBS_GROUPWRITABLEFORWARDFILESAFE :
+ DBS_GROUPWRITABLEINCLUDEFILESAFE),
+ DontBlameSendmail))
+ mode |= S_IWGRP;
+
+ if (bitset(mode, st.st_mode))
{
+ if (tTd(27, 6))
+ printf("include: %s is %s writable, marked unsafe\n",
+ shortenstring(fname, MAXSHORTSTR),
+ bitset(S_IWOTH, st.st_mode) ? "world" : "group");
if (LogLevel >= 12)
sm_syslog(LOG_INFO, e->e_id,
"%s: %s writable %s file, marked unsafe",
- shortenstring(fname, 203),
+ shortenstring(fname, MAXSHORTSTR),
bitset(S_IWOTH, st.st_mode) ? "world" : "group",
forwarding ? "forward" : ":include:");
ctladdr->q_flags |= QUNSAFEADDR;
@@ -1208,7 +1260,7 @@ resetuid:
if (forwarding && LogLevel > 9)
sm_syslog(LOG_INFO, e->e_id,
"forward %.200s => %s",
- oldto, shortenstring(buf, 203));
+ oldto, shortenstring(buf, MAXSHORTSTR));
nincludes += sendtolist(buf, ctladdr, sendq, aliaslevel + 1, e);
}
diff --git a/usr.sbin/sendmail/src/safefile.c b/usr.sbin/sendmail/src/safefile.c
index 842a09f8ca8..16f3f3927c9 100644
--- a/usr.sbin/sendmail/src/safefile.c
+++ b/usr.sbin/sendmail/src/safefile.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)safefile.c 8.18 (Berkeley) 8/1/97";
+static char sccsid[] = "@(#)safefile.c 8.40 (Berkeley) 6/5/98";
#endif /* not lint */
# include "sendmail.h"
@@ -63,18 +41,6 @@ static char sccsid[] = "@(#)safefile.c 8.18 (Berkeley) 8/1/97";
#include <grp.h>
-#ifndef S_IXOTH
-# define S_IXOTH (S_IEXEC >> 6)
-#endif
-
-#ifndef S_IXGRP
-# define S_IXGRP (S_IEXEC >> 3)
-#endif
-
-#ifndef S_IXUSR
-# define S_IXUSR (S_IEXEC)
-#endif
-
int
safefile(fn, uid, gid, uname, flags, mode, st)
char *fn;
@@ -135,7 +101,8 @@ safefile(fn, uid, gid, uname, flags, mode, st)
#ifdef SUID_ROOT_FILES_OK
if (bitset(S_ISUID, st->st_mode))
#else
- if (bitset(S_ISUID, st->st_mode) && st->st_uid != 0)
+ if (bitset(S_ISUID, st->st_mode) && st->st_uid != 0 &&
+ st->st_uid != TrustedFileUid)
#endif
{
uid = st->st_uid;
@@ -174,6 +141,16 @@ safefile(fn, uid, gid, uname, flags, mode, st)
}
else
{
+#ifdef HASLSTAT
+ /* Need lstat() information if called stat() before */
+ if (!bitset(SFF_NOSLINK, flags) && lstat(fn, st) < 0)
+ {
+ ret = errno;
+ if (tTd(44, 4))
+ printf("\t%s\n", errstring(ret));
+ return ret;
+ }
+#endif
/* directory is writable: disallow links */
flags |= SFF_NOLINK;
}
@@ -226,8 +203,34 @@ safefile(fn, uid, gid, uname, flags, mode, st)
if (stat(dir, &stbuf) >= 0)
{
int md = S_IWRITE|S_IEXEC;
- if (stbuf.st_uid != uid)
- md >>= 6;
+
+ if (stbuf.st_uid == uid)
+ ;
+ else if (uid == 0 && TrustedFileUid != 0 && stbuf.st_uid == TrustedFileUid)
+ ;
+ else
+ {
+ md >>= 3;
+ if (stbuf.st_gid == gid)
+ ;
+#ifndef NO_GROUP_SET
+ else if (uname != NULL && !DontInitGroups &&
+ ((gr != NULL &&
+ gr->gr_gid == stbuf.st_gid) ||
+ (gr = getgrgid(stbuf.st_gid)) != NULL))
+ {
+ register char **gp;
+
+ for (gp = gr->gr_mem; *gp != NULL; gp++)
+ if (strcmp(*gp, uname) == 0)
+ break;
+ if (*gp == NULL)
+ md >>= 3;
+ }
+#endif
+ else
+ md >>= 3;
+ }
if ((stbuf.st_mode & md) != md)
errno = EACCES;
}
@@ -246,40 +249,47 @@ safefile(fn, uid, gid, uname, flags, mode, st)
if (bitset(SFF_NOSLINK, flags) && S_ISLNK(st->st_mode))
{
if (tTd(44, 4))
- printf("\t[slink mode %o]\tE_SM_NOSLINK\n",
- st->st_mode);
+ printf("\t[slink mode %lo]\tE_SM_NOSLINK\n",
+ (u_long) st->st_mode);
return E_SM_NOSLINK;
}
#endif
if (bitset(SFF_REGONLY, flags) && !S_ISREG(st->st_mode))
{
if (tTd(44, 4))
- printf("\t[non-reg mode %o]\tE_SM_REGONLY\n",
- st->st_mode);
+ printf("\t[non-reg mode %lo]\tE_SM_REGONLY\n",
+ (u_long) st->st_mode);
return E_SM_REGONLY;
}
- if (bitset(SFF_NOWFILES, flags) &&
- bitset(S_IWOTH | (UnsafeGroupWrites ? S_IWGRP : 0), st->st_mode))
+ if (bitset(SFF_NOGWFILES, flags) &&
+ bitset(S_IWGRP, st->st_mode))
{
if (tTd(44, 4))
- printf("\t[write bits %o]\tE_SM_%cWFILE\n",
- st->st_mode,
- bitset(S_IWOTH, st->st_mode) ? 'W' : 'G');
- return bitset(S_IWOTH, st->st_mode) ? E_SM_WWFILE : E_SM_GWFILE;
+ printf("\t[write bits %lo]\tE_SM_GWFILE\n",
+ (u_long) st->st_mode);
+ return E_SM_GWFILE;
+ }
+ if (bitset(SFF_NOWWFILES, flags) &&
+ bitset(S_IWOTH, st->st_mode))
+ {
+ if (tTd(44, 4))
+ printf("\t[write bits %lo]\tE_SM_WWFILE\n",
+ (u_long) st->st_mode);
+ return E_SM_WWFILE;
}
if (bitset(S_IWUSR|S_IWGRP|S_IWOTH, mode) &&
bitset(S_IXUSR|S_IXGRP|S_IXOTH, st->st_mode))
{
if (tTd(44, 4))
- printf("\t[exec bits %o]\tE_SM_ISEXEC]\n",
- st->st_mode);
+ printf("\t[exec bits %lo]\tE_SM_ISEXEC]\n",
+ (u_long) st->st_mode);
return E_SM_ISEXEC;
}
if (bitset(SFF_NOHLINK, flags) && st->st_nlink != 1)
{
if (tTd(44, 4))
printf("\t[link count %d]\tE_SM_NOHLINK\n",
- st->st_nlink);
+ (int) st->st_nlink);
return E_SM_NOHLINK;
}
@@ -287,7 +297,11 @@ safefile(fn, uid, gid, uname, flags, mode, st)
;
else if (uid == 0 && !bitset(SFF_ROOTOK, flags))
mode >>= 6;
- else if (st->st_uid != uid)
+ else if (st->st_uid == uid)
+ ;
+ else if (uid == 0 && TrustedFileUid != 0 && st->st_uid == TrustedFileUid)
+ ;
+ else
{
mode >>= 3;
if (st->st_gid == gid)
@@ -314,6 +328,7 @@ safefile(fn, uid, gid, uname, flags, mode, st)
(int) st->st_uid, (int) st->st_nlink,
(u_long) st->st_mode, (u_long) mode);
if ((st->st_uid == uid || st->st_uid == 0 ||
+ st->st_uid == TrustedFileUid ||
!bitset(SFF_MUSTOWN, flags)) &&
(st->st_mode & mode) == mode)
{
@@ -357,6 +372,7 @@ safedirpath(fn, uid, gid, uname, flags)
char *p;
register struct group *gr = NULL;
int ret = 0;
+ int mode = S_IWOTH;
struct stat stbuf;
/* special case root directory */
@@ -367,6 +383,9 @@ safedirpath(fn, uid, gid, uname, flags)
printf("safedirpath(%s, uid=%ld, gid=%ld, flags=%x):\n",
fn, (long) uid, (long) gid, flags);
+ if (!bitset(DBS_GROUPWRITABLEDIRPATHSAFE, DontBlameSendmail))
+ mode |= S_IWGRP;
+
p = fn;
do
{
@@ -381,11 +400,11 @@ safedirpath(fn, uid, gid, uname, flags)
break;
}
if ((uid == 0 || bitset(SFF_SAFEDIRPATH, flags)) &&
- bitset(S_IWGRP|S_IWOTH, stbuf.st_mode))
+ bitset(mode, stbuf.st_mode))
{
if (tTd(44, 4))
- printf("\t[dir %s] mode %o\n",
- fn, stbuf.st_mode);
+ printf("\t[dir %s] mode %lo\n",
+ fn, (u_long) stbuf.st_mode);
if (bitset(SFF_SAFEDIRPATH, flags))
{
if (bitset(S_IWOTH, stbuf.st_mode))
@@ -395,7 +414,11 @@ safedirpath(fn, uid, gid, uname, flags)
break;
}
if (Verbose > 1)
- message("051 WARNING: writable directory %s", fn);
+ message("051 WARNING: %s writable directory %s",
+ bitset(S_IWOTH, stbuf.st_mode)
+ ? "World"
+ : "Group",
+ fn);
}
if (uid == 0 && !bitset(SFF_ROOTOK|SFF_OPENASROOT, flags))
{
@@ -404,6 +427,15 @@ safedirpath(fn, uid, gid, uname, flags)
ret = EACCES;
break;
}
+
+ /*
+ ** Let OS determine access to file if we are not
+ ** running as a privileged user. This allows ACLs
+ ** to work.
+ */
+ if (geteuid() != 0)
+ continue;
+
if (stbuf.st_uid == uid &&
bitset(S_IXUSR, stbuf.st_mode))
continue;
@@ -505,7 +537,7 @@ safeopen(fn, omode, cmode, sff)
fd = dfopen(fn, omode, cmode, sff);
if (fd < 0)
return fd;
- if (filechanged(fn, fd, &stb, sff))
+ if (filechanged(fn, fd, &stb))
{
syserr("554 cannot open: file %s changed after open", fn);
close(fd);
@@ -594,7 +626,6 @@ safefopen(fn, omode, cmode, sff)
** fn -- pathname of file to check.
** fd -- file descriptor to check.
** stb -- stat structure from before open.
-** sff -- safe file flags.
**
** Returns:
** TRUE -- if a problem was detected.
@@ -602,11 +633,10 @@ safefopen(fn, omode, cmode, sff)
*/
bool
-filechanged(fn, fd, stb, sff)
+filechanged(fn, fd, stb)
char *fn;
int fd;
struct stat *stb;
- int sff;
{
struct stat sta;
@@ -639,8 +669,17 @@ filechanged(fn, fd, stb, sff)
(long) stb->st_nlink, (long) sta.st_nlink);
printf(" dev = %ld/%ld\n",
(long) stb->st_dev, (long) sta.st_dev);
- printf(" ino = %ld/%ld\n",
- (long) stb->st_ino, (long) sta.st_ino);
+ if (sizeof sta.st_ino > sizeof (long))
+ {
+ printf(" ino = %s/",
+ quad_to_string(stb->st_ino));
+ printf("%s\n",
+ quad_to_string(sta.st_ino));
+ }
+ else
+ printf(" ino = %lu/%lu\n",
+ (unsigned long) stb->st_ino,
+ (unsigned long) sta.st_ino);
#if HAS_ST_GEN
printf(" gen = %ld/%ld\n",
(long) stb->st_gen, (long) sta.st_gen);
diff --git a/usr.sbin/sendmail/src/savemail.c b/usr.sbin/sendmail/src/savemail.c
index 76209dcc40e..4fbfd675621 100644
--- a/usr.sbin/sendmail/src/savemail.c
+++ b/usr.sbin/sendmail/src/savemail.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)savemail.c 8.121 (Berkeley) 10/22/97";
+static char sccsid[] = "@(#)savemail.c 8.138 (Berkeley) 6/17/98";
#endif /* not lint */
# include "sendmail.h"
@@ -84,8 +62,8 @@ savemail(e, sendbody)
MCI mcibuf;
int flags;
char buf[MAXLINE+1];
- extern char *ttypath();
- extern bool writable();
+ extern char *ttypath __P((void));
+ extern bool writable __P((char *, ADDRESS *, int));
if (tTd(6, 1))
{
@@ -366,9 +344,11 @@ savemail(e, sendbody)
/* we have a home directory; write dead.letter */
define('z', p, e);
expand("\201z/dead.letter", buf, sizeof buf, e);
- flags = SFF_NOLINK|SFF_CREAT|SFF_REGONLY|SFF_RUNASREALUID;
+ flags = SFF_CREAT|SFF_REGONLY|SFF_RUNASREALUID;
+ if (RealUid == 0)
+ flags |= SFF_ROOTOK;
e->e_to = buf;
- if (mailfile(buf, NULL, flags, e) == EX_OK)
+ if (mailfile(buf, FileMailer, NULL, flags, e) == EX_OK)
{
int oldverb = Verbose;
@@ -399,7 +379,7 @@ savemail(e, sendbody)
break;
}
- flags = SFF_NOLINK|SFF_CREAT|SFF_REGONLY|SFF_ROOTOK|SFF_OPENASROOT|SFF_MUSTOWN;
+ flags = SFF_CREAT|SFF_REGONLY|SFF_ROOTOK|SFF_OPENASROOT|SFF_MUSTOWN;
if (!writable(DeadLetterDrop, NULL, flags) ||
(fp = safefopen(DeadLetterDrop, O_WRONLY|O_APPEND,
FileMode, flags)) == NULL)
@@ -413,6 +393,7 @@ savemail(e, sendbody)
mcibuf.mci_mailer = FileMailer;
if (bitnset(M_7BITS, FileMailer->m_flags))
mcibuf.mci_flags |= MCIF_7BIT;
+ mcibuf.mci_contentlen = 0;
putfromline(&mcibuf, e);
(*e->e_puthdr)(&mcibuf, e->e_header, e);
@@ -483,7 +464,7 @@ returntosender(msg, returnq, flags, e)
register ENVELOPE *ee;
ENVELOPE *oldcur = CurEnv;
ENVELOPE errenvelope;
- static int returndepth;
+ static int returndepth = 0;
register ADDRESS *q;
char *p;
char buf[MAXNAME + 1];
@@ -562,7 +543,7 @@ returntosender(msg, returnq, flags, e)
p = "DSN";
sm_syslog(LOG_INFO, e->e_id,
"%s: %s: %s",
- ee->e_id, p, shortenstring(msg, 203));
+ ee->e_id, p, shortenstring(msg, MAXSHORTSTR));
}
if (SendMIMEErrors)
@@ -641,7 +622,7 @@ returntosender(msg, returnq, flags, e)
eatheader(ee, TRUE);
/* mark statistics */
- markstats(ee, NULLADDR);
+ markstats(ee, NULLADDR, FALSE);
/* actually deliver the error message */
sendall(ee, SM_DELIVER);
@@ -764,14 +745,16 @@ errbody(mci, e, separator)
if (DontLockReadFiles)
sff |= SFF_NOLOCK;
+ if (!bitset(DBS_ERRORHEADERINUNSAFEDIRPATH, DontBlameSendmail))
+ sff |= SFF_SAFEDIRPATH;
xfile = safefopen(ErrMsgFile, O_RDONLY, 0444, sff);
if (xfile != NULL)
{
while (fgets(buf, sizeof buf, xfile) != NULL)
{
-#if _FFR_BUG_FIX
+ extern void translate_dollars __P((char *));
+
translate_dollars(buf);
-#endif
expand(buf, buf, sizeof buf, e);
putline(buf, mci);
}
@@ -805,12 +788,13 @@ errbody(mci, e, separator)
printheader = FALSE;
}
- snprintf(buf, sizeof buf, "%s", shortenstring(q->q_paddr, 203));
+ snprintf(buf, sizeof buf, "%s",
+ shortenstring(q->q_paddr, MAXSHORTSTR));
putline(buf, mci);
if (q->q_alias != NULL)
{
snprintf(buf, sizeof buf, " (expanded from: %s)",
- shortenstring(q->q_alias->q_paddr, 203));
+ shortenstring(q->q_alias->q_paddr, MAXSHORTSTR));
putline(buf, mci);
}
}
@@ -832,12 +816,13 @@ errbody(mci, e, separator)
printheader = FALSE;
}
- snprintf(buf, sizeof buf, "%s", shortenstring(q->q_paddr, 203));
+ snprintf(buf, sizeof buf, "%s",
+ shortenstring(q->q_paddr, MAXSHORTSTR));
putline(buf, mci);
if (q->q_alias != NULL)
{
snprintf(buf, sizeof buf, " (expanded from: %s)",
- shortenstring(q->q_alias->q_paddr, 203));
+ shortenstring(q->q_alias->q_paddr, MAXSHORTSTR));
putline(buf, mci);
}
}
@@ -875,12 +860,12 @@ errbody(mci, e, separator)
}
snprintf(buf, sizeof buf, "%s (%s)",
- shortenstring(q->q_paddr, 203), p);
+ shortenstring(q->q_paddr, MAXSHORTSTR), p);
putline(buf, mci);
if (q->q_alias != NULL)
{
snprintf(buf, sizeof buf, " (expanded from: %s)",
- shortenstring(q->q_alias->q_paddr, 203));
+ shortenstring(q->q_alias->q_paddr, MAXSHORTSTR));
putline(buf, mci);
}
}
diff --git a/usr.sbin/sendmail/src/sendmail.8 b/usr.sbin/sendmail/src/sendmail.8
index 9a0a687f876..5105e831d35 100644
--- a/usr.sbin/sendmail/src/sendmail.8
+++ b/usr.sbin/sendmail/src/sendmail.8
@@ -1,38 +1,16 @@
-.\" Copyright (c) 1983, 1997 Eric P. Allman
+.\" Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+.\" Copyright (c) 1983, 1997 Eric P. Allman. All rights reserved.
.\" Copyright (c) 1988, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the University of
-.\" California, Berkeley and its contributors.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
+.\" 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.
.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
.\"
-.\" @(#)sendmail.8 8.12 (Berkeley) 2/1/97
+.\" @(#)sendmail.8 8.19 (Berkeley) 5/19/98
.\"
-.Dd February 1, 1997
+.Dd May 19, 1998
.Dt SENDMAIL 8
.Os BSD 4
.Sh NAME
@@ -275,11 +253,6 @@ flag.
Read message for recipients.
To:, Cc:, and Bcc: lines will be scanned for recipient addresses.
The Bcc: line will be deleted before transmission.
-Any addresses in the argument list will be suppressed,
-that is,
-they will
-.Em not
-receive copies even if listed in the message header.
.It Fl U
Initial (user) submission.
This should
@@ -553,7 +526,7 @@ will print the contents of the mail queue.
.Sh FILES
Except for the file
.Pa /etc/sendmail.cf
-itself,
+itself and the daemon process ID file,
the following pathnames are all specified in
.Pa /etc/sendmail.cf.
Thus,
@@ -572,8 +545,6 @@ help file
collected statistics
.It Pa /var/spool/mqueue/*
temp files
-.It Pa /var/run/sendmail.pid
-The process id of the daemon
.El
.Sh SEE ALSO
.Xr binmail 1 ,
diff --git a/usr.sbin/sendmail/src/sendmail.h b/usr.sbin/sendmail/src/sendmail.h
index fc3bf4942ca..7bfe11b7606 100644
--- a/usr.sbin/sendmail/src/sendmail.h
+++ b/usr.sbin/sendmail/src/sendmail.h
@@ -1,37 +1,15 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*
- * @(#)sendmail.h 8.245 (Berkeley) 10/22/97
+ * @(#)sendmail.h 8.280 (Berkeley) 6/5/98
*/
/*
@@ -41,7 +19,7 @@
# ifdef _DEFINE
# define EXTERN
# ifndef lint
-static char SmailSccsId[] = "@(#)sendmail.h 8.245 10/22/97";
+static char SmailSccsId[] = "@(#)sendmail.h 8.280 6/5/98";
# endif
# else /* _DEFINE */
# define EXTERN extern
@@ -94,6 +72,14 @@ static char SmailSccsId[] = "@(#)sendmail.h 8.245 10/22/97";
# endif
#endif
+#ifdef HESIOD
+# include <hesiod.h>
+# if !defined(HES_ER_OK) || defined(HESIOD_INTERFACES)
+# define HESIOD_INIT /* support for the new interface */
+EXTERN void *HesiodContext;
+# endif
+#endif
+
/*
** Following are "sort of" configuration constants, but they should
** be pretty solid on most architectures today. They have to be
@@ -337,6 +323,7 @@ MCI
short mci_herrno; /* h_errno from last DNS lookup */
short mci_exitstat; /* exit status from last connection */
short mci_state; /* SMTP state */
+ off_t mci_contentlen; /* body length for Content-Length: */
long mci_maxsize; /* max size this server will accept */
FILE *mci_in; /* input side of connection */
FILE *mci_out; /* output side of connection */
@@ -384,7 +371,7 @@ extern void mci_flush __P((bool, MCI *));
extern void mci_dump __P((MCI *, bool));
extern void mci_dump_all __P((bool));
extern MCI **mci_scan __P((MCI *));
-extern int mci_traverse_persistent __P((int (), char *));
+extern int mci_traverse_persistent __P((int (*)(), char *));
extern int mci_print_persistent __P((char *, char *));
extern int mci_purge_persistent __P((char *, char *));
extern int mci_lock_host __P((MCI *));
@@ -526,6 +513,7 @@ struct envelope
#define EF_HAS_DF 0x0200000 /* set when df file is instantiated */
#define EF_IS_MIME 0x0400000 /* really is a MIME message */
#define EF_DONT_MIME 0x0800000 /* never MIME this message */
+#define EF_DISCARD 0x1000000 /* discard the message */
EXTERN ENVELOPE *CurEnv; /* envelope currently being processed */
@@ -692,6 +680,7 @@ MAP
u_char map_valcolno; /* value column number */
char map_coldelim; /* column delimiter */
char *map_app; /* to append to successful matches */
+ char *map_tapp; /* to append to "tempfail" matches */
char *map_domain; /* the (nominal) NIS domain */
char *map_rebuild; /* program to run to do auto-rebuild */
time_t map_mtime; /* last database modification time */
@@ -720,6 +709,7 @@ MAP
# define MF_APPEND 0x00008000 /* append new entry on rebuiled */
# define MF_KEEPQUOTES 0x00010000 /* don't dequote key before lookup */
# define MF_NODEFER 0x00020000 /* don't defer if map lookup fails */
+# define MF_REGEX_NOT 0x00040000 /* regular expression negation */
/* indices for map_actions */
# define MA_NOTFOUND 0 /* member map returned "not found" */
@@ -754,7 +744,7 @@ MAPCLASS
#define MCF_OPTFILE 0x0008 /* file name is optional */
/* functions */
-extern char *map_rewrite __P((MAP *, const char *, int, char **));
+extern char *map_rewrite __P((MAP *, const char *, size_t, char **));
extern MAP *makemapentry __P((char *));
extern void initmaps __P((bool, ENVELOPE *));
/*
@@ -949,6 +939,7 @@ EXTERN int NoRecipientAction;
#define PRIV_AUTHWARNINGS 0x0020 /* flag possible authorization probs */
#define PRIV_NORECEIPTS 0x0040 /* disallow return receipts */
#define PRIV_NOETRN 0x0080 /* disallow ETRN command entirely */
+#define PRIV_NOVERB 0x0100 /* disallow VERB command entirely */
#define PRIV_RESTRICTMAILQ 0x1000 /* restrict mailq command */
#define PRIV_RESTRICTQRUN 0x2000 /* restrict queue run */
#define PRIV_GOAWAY 0x0fff /* don't give no info, anyway, anyhow */
@@ -991,11 +982,12 @@ struct prival
#define SFF_SAFEDIRPATH 0x0100 /* no writable directories allowed */
#define SFF_NOHLINK 0x0200 /* file cannot have hard links */
#define SFF_NOWLINK 0x0400 /* links only in non-writable dirs */
-#define SFF_NOWFILES 0x0800 /* disallow world writable files */
+#define SFF_NOGWFILES 0x0800 /* disallow world writable files */
+#define SFF_NOWWFILES 0x1000 /* disallow group writable files */
/* flags that are actually specific to safeopen/safefopen/dfopen */
-#define SFF_OPENASROOT 0x1000 /* open as root instead of real user */
-#define SFF_NOLOCK 0x2000 /* don't lock the file */
+#define SFF_OPENASROOT 0x2000 /* open as root instead of real user */
+#define SFF_NOLOCK 0x4000 /* don't lock the file */
/* pseudo-flags */
#define SFF_NOLINK (SFF_NOHLINK|SFF_NOSLINK)
@@ -1006,7 +998,7 @@ extern int safedirpath __P((char *, UID_T, GID_T, char *, int));
extern int safeopen __P((char *, int, int, int));
extern FILE *safefopen __P((char *, int, int, int));
extern int dfopen __P((char *, int, int, int));
-extern bool filechanged __P((char *, int, struct stat *, int));
+extern bool filechanged __P((char *, int, struct stat *));
/*
@@ -1060,7 +1052,7 @@ EXTERN SOCKADDR RealHostAddr; /* address of host we are talking to */
extern char *hostnamebyanyaddr __P((SOCKADDR *));
extern char *anynet_ntoa __P((SOCKADDR *));
# if DAEMON
-extern bool validate_connection __P((SOCKADDR *, char *, ENVELOPE *));
+extern char *validate_connection __P((SOCKADDR *, char *, ENVELOPE *));
# endif
#endif
@@ -1092,6 +1084,51 @@ EXTERN int VendorCode; /* vendor-specific operation enhancements */
extern void vendor_set_uid __P((UID_T));
extern void vendor_daemon_setup __P((ENVELOPE *));
+/*
+** DontBlameSendmail options
+**
+** Hopefully nobody uses these.
+*/
+#define DBS_SAFE 0
+#define DBS_ASSUMESAFECHOWN 0x00000001
+#define DBS_GROUPWRITABLEDIRPATHSAFE 0x00000002
+#define DBS_GROUPWRITABLEFORWARDFILESAFE 0x00000004
+#define DBS_GROUPWRITABLEINCLUDEFILESAFE 0x00000008
+#define DBS_GROUPWRITABLEALIASFILE 0x00000010
+#define DBS_WORLDWRITABLEALIASFILE 0x00000020
+#define DBS_FORWARDFILEINUNSAFEDIRPATH 0x00000040
+#define DBS_INCLUDEFILEINUNSAFEDIRPATH 0x00000060
+#define DBS_MAPINUNSAFEDIRPATH 0x00000080
+#define DBS_LINKEDALIASFILEINWRITABLEDIR 0x00000100
+#define DBS_LINKEDCLASSFILEINWRITABLEDIR 0x00000200
+#define DBS_LINKEDFORWARDFILEINWRITABLEDIR 0x00000400
+#define DBS_LINKEDINCLUDEFILEINWRITABLEDIR 0x00000800
+#define DBS_LINKEDMAPINWRITABLEDIR 0x00001000
+#define DBS_LINKEDSERVICESWITCHFILEINWRITABLEDIR 0x00002000
+#define DBS_FILEDELIVERYTOHARDLINK 0x00004000
+#define DBS_FILEDELIVERYTOSYMLINK 0x00008000
+#define DBS_WRITEMAPTOHARDLINK 0x00010000
+#define DBS_WRITEMAPTOSYMLINK 0x00020000
+#define DBS_WRITESTATSTOHARDLINK 0x00040000
+#define DBS_WRITESTATSTOSYMLINK 0x00080000
+#define DBS_FORWARDFILEINGROUPWRITABLEDIRPATH 0x00100000
+#define DBS_INCLUDEFILEINGROUPWRITABLEDIRPATH 0x00200000
+#define DBS_CLASSFILEINUNSAFEDIRPATH 0x00400000
+#define DBS_ERRORHEADERINUNSAFEDIRPATH 0x00800000
+#define DBS_HELPFILEINUNSAFEDIRPATH 0x01000000
+#define DBS_FORWARDFILEINUNSAFEDIRPATHSAFE 0x02000000
+#define DBS_INCLUDEFILEINUNSAFEDIRPATHSAFE 0x04000000
+#define DBS_RUNPROGRAMINUNSAFEDIRPATH 0x08000000
+#define DBS_RUNWRITABLEPROGRAM 0x10000000
+
+/* struct defining such things */
+struct dbsval
+{
+ char *dbs_name; /* name of DontBlameSendmail flag */
+ long dbs_flag; /* numeric level */
+};
+
+EXTERN long DontBlameSendmail; /* DontBlameSendmail option bits */
/*
** Terminal escape codes.
@@ -1146,6 +1183,7 @@ EXTERN gid_t RealGid; /* real gid of caller */
EXTERN uid_t DefUid; /* default uid to run as */
EXTERN gid_t DefGid; /* default gid to run as */
EXTERN char *DefUser; /* default user to run as (from DefUid) */
+EXTERN uid_t TrustedFileUid; /* uid of trusted owner of files and dirs */
EXTERN MODE_T OldUmask; /* umask when sendmail starts up */
EXTERN int Verbose; /* set if blow-by-blow desired */
EXTERN int Errors; /* set if errors (local to single pass) */
@@ -1215,6 +1253,7 @@ EXTERN uid_t RunAsUid; /* UID to become for bulk of run */
EXTERN gid_t RunAsGid; /* GID to become for bulk of run */
EXTERN int MaxRcptPerMsg; /* max recipients per SMTP message */
EXTERN bool DoQueueRun; /* non-interrupt time queue run needed */
+EXTERN u_long ConnectOnlyTo; /* override connection address (for testing) */
#if _FFR_DSN_RRT_OPTION
EXTERN bool RrtImpliesDsn; /* turn Return-Receipt-To: into DSN */
#endif
@@ -1223,7 +1262,6 @@ EXTERN bool DontProbeInterfaces; /* don't probe interfaces for names */
EXTERN bool ChownAlwaysSafe; /* treat chown(2) as safe */
EXTERN bool IgnoreHostStatus; /* ignore long term host status files */
EXTERN bool SingleThreadDelivery; /* single thread hosts on delivery */
-EXTERN bool UnsafeGroupWrites; /* group-writable files are unsafe */
EXTERN bool SingleLineFromHeader; /* force From: header to be one line */
EXTERN bool DontLockReadFiles; /* don't read lock support files */
EXTERN int ConnRateThrottle; /* throttle for SMTP connection rate */
@@ -1242,17 +1280,27 @@ EXTERN time_t ServiceCacheTime; /* time service switch was cached */
EXTERN time_t ServiceCacheMaxAge; /* refresh interval for cache */
EXTERN time_t MciCacheTimeout; /* maximum idle time on connections */
EXTERN time_t MciInfoTimeout; /* how long 'til we retry down hosts */
-EXTERN char *QueueLimitRecipient; /* limit queue runs to this recipient */
-EXTERN char *QueueLimitSender; /* limit queue runs to this sender */
-EXTERN char *QueueLimitId; /* limit queue runs to this id */
EXTERN FILE *TrafficLogFile; /* file in which to log all traffic */
EXTERN char *DoubleBounceAddr; /* where to send double bounces */
-EXTERN bool FatalWritableDirs; /* no writable dirs in map paths */
EXTERN char **ExternalEnviron; /* input environment */
EXTERN char *UserEnviron[MAXUSERENVIRON + 1];
/* saved user environment */
extern int errno;
+/*
+** Queue Run Limitations
+*/
+struct queue_char
+{
+ char *queue_match; /* string to match */
+ struct queue_char *queue_next;
+};
+
+typedef struct queue_char QUEUE_CHAR;
+
+EXTERN QUEUE_CHAR *QueueLimitRecipient; /* limit queue runs to this recipient */
+EXTERN QUEUE_CHAR *QueueLimitSender; /* limit queue runs to this sender */
+EXTERN QUEUE_CHAR *QueueLimitId; /* limit queue runs to this id */
/*
** Timeouts
@@ -1334,10 +1382,10 @@ EXTERN u_char tTdvect[100];
extern char *xalloc __P((int));
extern char *sfgets __P((char *, int, FILE *, time_t, char *));
extern char *queuename __P((ENVELOPE *, int));
-extern time_t curtime __P(());
+extern time_t curtime __P((void));
extern bool transienterror __P((int));
extern char *fgetfolded __P((char *, int, FILE *));
-extern char *username __P(());
+extern char *username __P((void));
extern char *pintvl __P((time_t, bool));
extern bool shouldqueue __P((long, time_t));
extern bool lockfile __P((int, char *, char *, int));
@@ -1350,9 +1398,9 @@ extern char *defcharset __P((ENVELOPE *));
extern bool wordinclass __P((char *, int));
extern char *denlstring __P((char *, bool, bool));
extern void makelower __P((char *));
-extern void rebuildaliases __P((MAP *, bool));
+extern bool rebuildaliases __P((MAP *, bool));
extern void readaliases __P((MAP *, FILE *, bool, bool));
-extern void finis __P(());
+extern void finis __P((void));
extern void setsender __P((char *, ENVELOPE *, char **, int, bool));
extern void xputs __P((const char *));
extern void logsender __P((ENVELOPE *, char *));
@@ -1409,10 +1457,10 @@ extern void sendall __P((ENVELOPE *, int));
extern void queueup __P((ENVELOPE *, bool));
extern void checkfds __P((char *));
extern int returntosender __P((char *, ADDRESS *, int, ENVELOPE *));
-extern void markstats __P((ENVELOPE *, ADDRESS *));
+extern void markstats __P((ENVELOPE *, ADDRESS *, bool));
extern void poststats __P((char *));
extern char *arpadate __P((char *));
-extern int mailfile __P((char *, ADDRESS *, int, ENVELOPE *));
+extern int mailfile __P((char *volatile, MAILER *volatile, ADDRESS *, volatile int, ENVELOPE *));
extern void loseqfile __P((ENVELOPE *, char *));
extern int prog_open __P((char **, int *, ENVELOPE *));
extern bool getcanonname __P((char *, int, bool));
@@ -1437,30 +1485,16 @@ extern void checkfd012 __P((char *));
#endif
/* ellipsis is a different case though */
-#ifdef __STDC__
-extern void auth_warning(ENVELOPE *, const char *, ...);
-extern void syserr(const char *, ...);
-extern void usrerr(const char *, ...);
-extern void message(const char *, ...);
-extern void nmessage(const char *, ...);
-extern void setproctitle(const char *, ...);
-extern void sm_syslog(int, const char *, const char *, ...);
-#else
-extern void auth_warning();
-extern void syserr();
-extern void usrerr();
-extern void message();
-extern void nmessage();
-extern void setproctitle();
-extern void sm_syslog();
-#endif
+extern void auth_warning __P((ENVELOPE *, const char *, ...));
+extern void syserr __P((const char *, ...));
+extern void usrerr __P((const char *, ...));
+extern void message __P((const char *, ...));
+extern void nmessage __P((const char *, ...));
+extern void setproctitle __P((const char *, ...));
+extern void sm_syslog __P((int, const char *, const char *, ...));
#if !HASSNPRINTF
-# ifdef __STDC__
-extern int snprintf(char *, size_t, const char *, ...);
-extern int vsnprintf(char *, size_t, const char *, va_list);
-# else
-extern int snprintf();
-extern int vsnprintf();
-# endif
+extern int snprintf __P((char *, size_t, const char *, ...));
+extern int vsnprintf __P((char *, size_t, const char *, va_list));
#endif
+extern char *quad_to_string __P((QUAD_T));
diff --git a/usr.sbin/sendmail/src/sendmail.hf b/usr.sbin/sendmail/src/sendmail.hf
index 7ab6d6139e1..12a306012b3 100644
--- a/usr.sbin/sendmail/src/sendmail.hf
+++ b/usr.sbin/sendmail/src/sendmail.hf
@@ -1,9 +1,15 @@
cpyr
-cpyr Copyright (c) 1983, 1995-1997 Eric P. Allman
+cpyr Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+cpyr Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
cpyr Copyright (c) 1988, 1993
cpyr The Regents of the University of California. All rights reserved.
cpyr
-cpyr @(#)sendmail.hf 8.12 (Berkeley) 2/1/97
+cpyr
+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.hf 8.16 (Berkeley) 5/19/98
cpyr
smtp Topics:
smtp HELO EHLO MAIL RCPT DATA
diff --git a/usr.sbin/sendmail/src/snprintf.c b/usr.sbin/sendmail/src/snprintf.c
index f9b156de5ed..72fce924cd0 100644
--- a/usr.sbin/sendmail/src/snprintf.c
+++ b/usr.sbin/sendmail/src/snprintf.c
@@ -38,7 +38,7 @@ static char sccsid[] = "@(#)snprintf.c 8.11 (Berkeley) 6/4/98";
* causing nast effects.
**************************************************************/
-/*static char _id[] = "$Id: snprintf.c,v 1.1.1.1 1998/07/12 17:10:41 millert Exp $";*/
+/*static char _id[] = "$Id: snprintf.c,v 1.2 1998/07/12 19:45:15 millert Exp $";*/
void sm_dopr();
char *DoprEnd;
int SnprfOverflow;
diff --git a/usr.sbin/sendmail/src/srvrsmtp.c b/usr.sbin/sendmail/src/srvrsmtp.c
index cd47d5de916..fba103c6f04 100644
--- a/usr.sbin/sendmail/src/srvrsmtp.c
+++ b/usr.sbin/sendmail/src/srvrsmtp.c
@@ -1,44 +1,22 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
# include "sendmail.h"
#ifndef lint
#if SMTP
-static char sccsid[] = "@(#)srvrsmtp.c 8.159 (Berkeley) 10/19/97 (with SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.181 (Berkeley) 6/15/98 (with SMTP)";
#else
-static char sccsid[] = "@(#)srvrsmtp.c 8.159 (Berkeley) 10/19/97 (without SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.181 (Berkeley) 6/15/98 (without SMTP)";
#endif
#endif /* not lint */
@@ -50,7 +28,9 @@ static char sccsid[] = "@(#)srvrsmtp.c 8.159 (Berkeley) 10/19/97 (without SMTP)"
** SMTP -- run the SMTP protocol.
**
** Parameters:
-** none.
+** nullserver -- if non-NULL, rejection message for
+** all SMTP commands.
+** e -- the envelope.
**
** Returns:
** never.
@@ -118,7 +98,7 @@ static struct cmd CmdTab[] =
bool OneXact = FALSE; /* one xaction only this run */
char *CurSmtpClient; /* who's at the other end of channel */
-static char *skipword();
+static char *skipword __P((char *volatile, char *));
#define MAXBADCOMMANDS 25 /* maximum number of bad commands */
@@ -129,7 +109,7 @@ static char *skipword();
void
smtp(nullserver, e)
- bool nullserver;
+ char *nullserver;
register ENVELOPE *volatile e;
{
register char *volatile p;
@@ -147,6 +127,7 @@ smtp(nullserver, e)
char *id;
volatile int nrcpts = 0; /* number of RCPT commands */
bool doublequeue;
+ bool discard;
volatile int badcommands = 0; /* count of bad commands */
volatile int nverifies = 0; /* count of VRFY/EXPN commands */
volatile int n_etrn = 0; /* count of ETRN commands */
@@ -155,6 +136,7 @@ smtp(nullserver, e)
bool ok;
volatile int lognullconnection = TRUE;
register char *q;
+ QUEUE_CHAR *new;
char inp[MAXLINE];
char cmdbuf[MAXLINE];
extern ENVELOPE BlankEnvelope;
@@ -178,6 +160,9 @@ smtp(nullserver, e)
if (CurSmtpClient == NULL)
CurSmtpClient = CurHostName;
+ /* check_relay may have set discard bit, save for later */
+ discard = bitset(EF_DISCARD, e->e_flags);
+
setproctitle("server %s startup", CurSmtpClient);
#if DAEMON
if (LogLevel > 11)
@@ -317,7 +302,7 @@ smtp(nullserver, e)
** to everything.
*/
- if (nullserver)
+ if (nullserver != NULL)
{
switch (c->cmdcode)
{
@@ -331,7 +316,7 @@ smtp(nullserver, e)
default:
if (++badcommands > MAXBADCOMMANDS)
sleep(1);
- usrerr("550 Access denied");
+ usrerr("550 %s", nullserver);
continue;
}
}
@@ -380,6 +365,13 @@ smtp(nullserver, e)
break;
}
+ /* check for long domain name (hides Received: info) */
+ if (strlen(p) > MAXNAME)
+ {
+ usrerr("501 Invalid domain name");
+ break;
+ }
+
for (q = p; *q != '\0'; q++)
{
if (!isascii(*q))
@@ -412,7 +404,7 @@ smtp(nullserver, e)
gothello = TRUE;
/* print HELO response message */
- if (c->cmdcode != CMDEHLO)
+ if (c->cmdcode != CMDEHLO || nullserver != NULL)
{
message("250 %s Hello %s, %s",
MyHostName, CurSmtpClient, q);
@@ -426,7 +418,8 @@ smtp(nullserver, e)
if (!bitset(PRIV_NOEXPN, PrivacyFlags))
{
message("250-EXPN");
- message("250-VERB");
+ if (!bitset(PRIV_NOVERB, PrivacyFlags))
+ message("250-VERB");
}
#if MIME8TO7
message("250-8BITMIME");
@@ -440,7 +433,8 @@ smtp(nullserver, e)
message("250-DSN");
#endif
message("250-ONEX");
- message("250-ETRN");
+ if (!bitset(PRIV_NOETRN, PrivacyFlags))
+ message("250-ETRN");
message("250-XUSR");
message("250 HELP");
break;
@@ -727,12 +721,17 @@ smtp(nullserver, e)
break;
}
+ /* put back discard bit */
+ if (discard)
+ e->e_flags |= EF_DISCARD;
+
/* check to see if we need to re-expand aliases */
/* also reset QBADADDR on already-diagnosted addrs */
doublequeue = FALSE;
for (a = e->e_sendqueue; a != NULL; a = a->q_next)
{
- if (bitset(QVERIFIED, a->q_flags))
+ if (bitset(QVERIFIED, a->q_flags) &&
+ !bitset(EF_DISCARD, e->e_flags))
{
/* need to re-expand aliases */
doublequeue = TRUE;
@@ -809,7 +808,7 @@ smtp(nullserver, e)
if (!shouldqueue(e->e_msgpriority, e->e_ctime))
{
- extern pid_t dowork();
+ extern pid_t dowork __P((char *, bool, bool, ENVELOPE *));
unlockqueue(e);
(void) dowork(id, TRUE, TRUE, e);
@@ -863,7 +862,7 @@ smtp(nullserver, e)
sm_syslog(LOG_INFO, e->e_id,
"%.100s: %s [rejected]",
CurSmtpClient,
- shortenstring(inp, 203));
+ shortenstring(inp, MAXSHORTSTR));
break;
}
else if (!gothello &&
@@ -881,7 +880,7 @@ smtp(nullserver, e)
sm_syslog(LOG_INFO, e->e_id,
"%.100s: %s",
CurSmtpClient,
- shortenstring(inp, 203));
+ shortenstring(inp, MAXSHORTSTR));
if (setjmp(TopFrame) > 0)
goto undo_subproc;
QuickAbort = TRUE;
@@ -921,6 +920,17 @@ smtp(nullserver, e)
break;
case CMDETRN: /* etrn -- force queue flush */
+ if (bitset(PRIV_NOETRN, PrivacyFlags))
+ {
+ message("502 Sorry, we do not allow this operation");
+ if (LogLevel > 5)
+ sm_syslog(LOG_INFO, e->e_id,
+ "%.100s: %s [rejected]",
+ CurSmtpClient,
+ shortenstring(inp, MAXSHORTSTR));
+ break;
+ }
+
if (strlen(p) <= 0)
{
usrerr("500 Parameter required");
@@ -934,15 +944,24 @@ smtp(nullserver, e)
sm_syslog(LOG_INFO, e->e_id,
"%.100s: ETRN %s",
CurSmtpClient,
- shortenstring(p, 203));
+ shortenstring(p, MAXSHORTSTR));
id = p;
if (*id == '@')
id++;
else
*--id = '@';
- QueueLimitRecipient = id;
+
+ if ((new = (QUEUE_CHAR *)malloc(sizeof(QUEUE_CHAR))) == NULL)
+ {
+ syserr("500 ETRN out of memory");
+ break;
+ }
+ new->queue_match = id;
+ new->queue_next = NULL;
+ QueueLimitRecipient = new;
ok = runqueue(TRUE, TRUE);
+ free(QueueLimitRecipient);
QueueLimitRecipient = NULL;
if (ok && Errors == 0)
message("250 Queuing for node %s started", p);
@@ -976,7 +995,8 @@ doquit:
finis();
case CMDVERB: /* set verbose mode */
- if (bitset(PRIV_NOEXPN, PrivacyFlags))
+ if (bitset(PRIV_NOEXPN, PrivacyFlags) ||
+ bitset(PRIV_NOVERB, PrivacyFlags))
{
/* this would give out the same info */
message("502 Verbose unavailable");
@@ -1033,7 +1053,7 @@ doquit:
}
usrerr("500 Command unrecognized: \"%s\"",
- shortenstring(inp, 203));
+ shortenstring(inp, MAXSHORTSTR));
break;
default:
@@ -1095,7 +1115,7 @@ checksmtpattack(pcounter, maxcount, cname, e)
static char *
skipword(p, w)
- register char *p;
+ register char *volatile p;
char *w;
{
register char *q;
@@ -1115,7 +1135,7 @@ skipword(p, w)
{
syntax:
usrerr("501 Syntax error in parameters scanning \"%s\"",
- shortenstring(firstp, 203));
+ shortenstring(firstp, MAXSHORTSTR));
return (NULL);
}
*p++ = '\0';
@@ -1461,6 +1481,8 @@ help(topic)
if (DontLockReadFiles)
sff |= SFF_NOLOCK;
+ if (!bitset(DBS_HELPFILEINUNSAFEDIRPATH, DontBlameSendmail))
+ sff |= SFF_SAFEDIRPATH;
if (HelpFile == NULL ||
(hf = safefopen(HelpFile, O_RDONLY, 0444, sff)) == NULL)
diff --git a/usr.sbin/sendmail/src/stab.c b/usr.sbin/sendmail/src/stab.c
index 7d480b90133..1ffc7cb1fcf 100644
--- a/usr.sbin/sendmail/src/stab.c
+++ b/usr.sbin/sendmail/src/stab.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)stab.c 8.13 (Berkeley) 4/19/97";
+static char sccsid[] = "@(#)stab.c 8.19 (Berkeley) 5/19/98";
#endif /* not lint */
# include "sendmail.h"
@@ -72,7 +50,7 @@ stab(name, type, op)
register int hfunc;
register char *p;
int len;
- extern char lower();
+ extern char lower __P((char));
if (tTd(36, 5))
printf("STAB: %s %d ", name, type);
diff --git a/usr.sbin/sendmail/src/stats.c b/usr.sbin/sendmail/src/stats.c
index cb0f9dd761d..767a55e1741 100644
--- a/usr.sbin/sendmail/src/stats.c
+++ b/usr.sbin/sendmail/src/stats.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)stats.c 8.11 (Berkeley) 4/9/97";
+static char sccsid[] = "@(#)stats.c 8.22 (Berkeley) 5/19/98";
#endif /* not lint */
# include "sendmail.h"
@@ -50,11 +28,22 @@ bool GotStats = FALSE; /* set when we have stats to merge */
*/
void
-markstats(e, to)
+markstats(e, to, reject)
register ENVELOPE *e;
register ADDRESS *to;
+ bool reject;
{
- if (to == NULL)
+ if (reject == TRUE)
+ {
+ if (e->e_from.q_mailer != NULL)
+ {
+ if (bitset(EF_DISCARD, e->e_flags))
+ Stat.stat_nd[e->e_from.q_mailer->m_mno]++;
+ else
+ Stat.stat_nr[e->e_from.q_mailer->m_mno]++;
+ }
+ }
+ else if (to == NULL)
{
if (e->e_from.q_mailer != NULL)
{
@@ -88,6 +77,7 @@ poststats(sfile)
char *sfile;
{
register int fd;
+ int sff = SFF_REGONLY|SFF_OPENASROOT;
struct statistics stat;
extern off_t lseek();
@@ -96,15 +86,27 @@ poststats(sfile)
(void) time(&Stat.stat_itime);
Stat.stat_size = sizeof Stat;
+ Stat.stat_magic = STAT_MAGIC;
+ Stat.stat_version = STAT_VERSION;
+
+ if (!bitset(DBS_WRITESTATSTOSYMLINK, DontBlameSendmail))
+ sff |= SFF_NOSLINK;
+ if (!bitset(DBS_WRITESTATSTOHARDLINK, DontBlameSendmail))
+ sff |= SFF_NOHLINK;
- fd = safeopen(sfile, O_RDWR, 0644, SFF_REGONLY|SFF_NOLINK|SFF_OPENASROOT);
+ fd = safeopen(sfile, O_RDWR, 0644, sff);
if (fd < 0)
{
+ if (LogLevel > 12)
+ sm_syslog(LOG_INFO, NOQID, "poststats: %s: %s",
+ sfile, errstring(errno));
errno = 0;
return;
}
if (read(fd, (char *) &stat, sizeof stat) == sizeof stat &&
- stat.stat_size == sizeof stat)
+ stat.stat_size == sizeof stat &&
+ stat.stat_magic == Stat.stat_magic &&
+ stat.stat_version == Stat.stat_version)
{
/* merge current statistics into statfile */
register int i;
@@ -115,6 +117,8 @@ poststats(sfile)
stat.stat_bf[i] += Stat.stat_bf[i];
stat.stat_nt[i] += Stat.stat_nt[i];
stat.stat_bt[i] += Stat.stat_bt[i];
+ stat.stat_nr[i] += Stat.stat_nr[i];
+ stat.stat_nd[i] += Stat.stat_nd[i];
}
}
else
diff --git a/usr.sbin/sendmail/src/sysexits.c b/usr.sbin/sendmail/src/sysexits.c
index 36955363ebe..10d7c85a182 100644
--- a/usr.sbin/sendmail/src/sysexits.c
+++ b/usr.sbin/sendmail/src/sysexits.c
@@ -1,42 +1,20 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)sysexits.c 8.7 (Berkeley) 2/1/97";
+static char sccsid[] = "@(#)sysexits.c 8.13 (Berkeley) 5/24/98";
#endif /* not lint */
-#include <sendmail.h>
+#include "sendmail.h"
/*
** SYSEXITS.C -- error messages corresponding to sysexits.h
diff --git a/usr.sbin/sendmail/src/trace.c b/usr.sbin/sendmail/src/trace.c
index 49a1ae01486..5ff9795c512 100644
--- a/usr.sbin/sendmail/src/trace.c
+++ b/usr.sbin/sendmail/src/trace.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)trace.c 8.6 (Berkeley) 2/1/97";
+static char sccsid[] = "@(#)trace.c 8.12 (Berkeley) 5/19/98";
#endif /* not lint */
# include "sendmail.h"
@@ -94,7 +72,7 @@ tTflag(s)
{
/* find first flag to set */
i = 0;
- while (isdigit(*s))
+ while (isascii(*s) && isdigit(*s))
i = i * 10 + (*s++ - '0');
first = i;
@@ -102,7 +80,7 @@ tTflag(s)
if (*s == '-')
{
i = 0;
- while (isdigit(*++s))
+ while (isascii(*++s) && isdigit(*s))
i = i * 10 + (*s - '0');
}
last = i;
@@ -112,7 +90,7 @@ tTflag(s)
if (*s == '.')
{
i = 0;
- while (isdigit(*++s))
+ while (isascii(*++s) && isdigit(*s))
i = i * 10 + (*s - '0');
}
diff --git a/usr.sbin/sendmail/src/udb.c b/usr.sbin/sendmail/src/udb.c
index cf77bdca376..e7f42af2ba9 100644
--- a/usr.sbin/sendmail/src/udb.c
+++ b/usr.sbin/sendmail/src/udb.c
@@ -1,44 +1,22 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#include "sendmail.h"
#ifndef lint
#if USERDB
-static char sccsid [] = "@(#)udb.c 8.51 (Berkeley) 5/29/97 (with USERDB)";
+static char sccsid [] = "@(#)udb.c 8.66 (Berkeley) 6/18/98 (with USERDB)";
#else
-static char sccsid [] = "@(#)udb.c 8.51 (Berkeley) 5/29/97 (without USERDB)";
+static char sccsid [] = "@(#)udb.c 8.66 (Berkeley) 6/18/98 (without USERDB)";
#endif
#endif
@@ -48,6 +26,9 @@ static char sccsid [] = "@(#)udb.c 8.51 (Berkeley) 5/29/97 (without USERDB)";
#ifdef NEWDB
# include <db.h>
+# ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+# endif
#else
# define DBT struct _data_base_thang_
DBT
@@ -57,10 +38,6 @@ DBT
};
#endif
-#ifdef HESIOD
-# include <hesiod.h>
-#endif /* HESIOD */
-
/*
** UDB.C -- interface between sendmail and Berkeley User Data Base.
**
@@ -120,6 +97,9 @@ struct option
char *val;
};
+#ifdef HESIOD
+extern int hes_udb_get __P((DBT *, DBT *));
+#endif
extern int _udbx_init __P((ENVELOPE *));
/*
** UDBEXPAND -- look up user in database and expand
@@ -162,6 +142,9 @@ udbexpand(a, sendq, aliaslevel, e)
int naddrs;
char keybuf[MAXKEY];
+ bzero(&key, sizeof key);
+ bzero(&info, sizeof info);
+
if (tTd(28, 1))
printf("udbexpand(%s)\n", a->q_paddr);
@@ -208,6 +191,9 @@ udbexpand(a, sendq, aliaslevel, e)
#if defined(HESIOD) && defined(HES_GETMAILHOST)
char pobuf[MAXNAME];
#endif
+#if defined(NEWDB) && DB_VERSION_MAJOR > 1
+ DBC *dbc = NULL;
+#endif
user = userbuf;
userbuf[0] = '\0';
@@ -231,12 +217,31 @@ udbexpand(a, sendq, aliaslevel, e)
if (tTd(28, 80))
printf("udbexpand: trying %s (%d) via db\n",
keybuf, keylen);
+#if DB_VERSION_MAJOR < 2
i = (*up->udb_dbp->seq)(up->udb_dbp, &key, &info, R_CURSOR);
+#else
+ i = 0;
+ if (dbc == NULL &&
+ (errno = (*up->udb_dbp->cursor)(up->udb_dbp,
+ NULL, &dbc)) != 0)
+ i = -1;
+ if (i != 0 || dbc == NULL ||
+ (errno = dbc->c_get(dbc, &key,
+ &info, DB_SET)) != 0)
+ i = 1;
+#endif
if (i > 0 || info.size <= 0)
{
if (tTd(28, 2))
printf("udbexpand: no match on %s (%d)\n",
keybuf, keylen);
+#if DB_VERSION_MAJOR > 1
+ if (dbc != NULL)
+ {
+ (void) dbc->c_close(dbc);
+ dbc = NULL;
+ }
+#endif
break;
}
if (tTd(28, 80))
@@ -253,6 +258,13 @@ udbexpand(a, sendq, aliaslevel, e)
if (bitset(EF_VRFYONLY, e->e_flags))
{
a->q_flags |= QVERIFIED;
+#if DB_VERSION_MAJOR > 1
+ if (dbc != NULL)
+ {
+ (void) dbc->c_close(dbc);
+ dbc = NULL;
+ }
+#endif
return EX_OK;
}
@@ -284,8 +296,23 @@ udbexpand(a, sendq, aliaslevel, e)
userleft -= info.size;
/* get the next record */
+#if DB_VERSION_MAJOR < 2
i = (*up->udb_dbp->seq)(up->udb_dbp, &key, &info, R_NEXT);
+#else
+ i = 0;
+ if ((errno = dbc->c_get(dbc, &key,
+ &info, DB_NEXT)) != 0)
+ i = 1;
+#endif
+ }
+
+#if DB_VERSION_MAJOR > 1
+ if (dbc != NULL)
+ {
+ (void) dbc->c_close(dbc);
+ dbc = NULL;
}
+#endif
/* if nothing ever matched, try next database */
if (!breakout)
@@ -296,7 +323,7 @@ udbexpand(a, sendq, aliaslevel, e)
sm_syslog(LOG_INFO, e->e_id,
"expand %.100s => %s",
e->e_to,
- shortenstring(user, 203));
+ shortenstring(user, MAXSHORTSTR));
naddrs = sendtolist(user, a, sendq, aliaslevel + 1, e);
if (naddrs > 0 && !bitset(QSELFREF, a->q_flags))
{
@@ -310,7 +337,7 @@ udbexpand(a, sendq, aliaslevel, e)
if (i < 0)
{
syserr("udbexpand: db-get %.*s stat %d",
- key.size, key.data, i);
+ (int) key.size, (char *) key.data, i);
return EX_TEMPFAIL;
}
@@ -319,12 +346,20 @@ udbexpand(a, sendq, aliaslevel, e)
** it into the envelope.
*/
+ bzero(&key, sizeof key);
+ bzero(&info, sizeof info);
(void) strcpy(keybuf, a->q_user);
(void) strcat(keybuf, ":mailsender");
keylen = strlen(keybuf);
key.data = keybuf;
key.size = keylen;
+
+#if DB_VERSION_MAJOR < 2
i = (*up->udb_dbp->get)(up->udb_dbp, &key, &info, 0);
+#else
+ i = errno = (*up->udb_dbp->get)(up->udb_dbp, NULL,
+ &key, &info, 0);
+#endif
if (i != 0 || info.size <= 0)
break;
a->q_owner = xalloc(info.size + 1);
@@ -355,7 +390,7 @@ udbexpand(a, sendq, aliaslevel, e)
if (i < 0)
{
syserr("udbexpand: hesiod-get %.*s stat %d",
- key.size, key.data, i);
+ (int) key.size, (char *) key.data, i);
return EX_TEMPFAIL;
}
else if (i > 0 || info.size <= 0)
@@ -366,7 +401,7 @@ udbexpand(a, sendq, aliaslevel, e)
if (tTd(28, 2))
printf("udbexpand: no match on %s (%d)\n",
- keybuf, keylen);
+ (char *) keybuf, (int) keylen);
#if HES_GETMAILHOST
if (tTd(28, 8))
printf(" ... trying hes_getmailhost(%s)\n",
@@ -405,7 +440,8 @@ udbexpand(a, sendq, aliaslevel, e)
}
if (tTd(28, 80))
printf("udbexpand: match %.*s: %.*s\n",
- key.size, key.data, info.size, info.data);
+ (int) key.size, (char *) key.data,
+ (int) info.size, (char *) info.data);
a->q_flags &= ~QSELFREF;
if (bitset(EF_VRFYONLY, e->e_flags))
@@ -425,7 +461,7 @@ udbexpand(a, sendq, aliaslevel, e)
sm_syslog(LOG_INFO, e->e_id,
"hesiod %.100s => %s",
e->e_to,
- shortenstring(user, 203));
+ shortenstring(user, MAXSHORTSTR));
naddrs = sendtolist(user, a, sendq, aliaslevel + 1, e);
if (naddrs > 0 && !bitset(QSELFREF, a->q_flags))
@@ -519,7 +555,7 @@ char *
udbsender(sender)
char *sender;
{
- extern char *udbmatch();
+ extern char *udbmatch __P((char *, char *));
return udbmatch(sender, "mailname");
}
@@ -581,9 +617,16 @@ udbmatch(user, field)
{
#ifdef NEWDB
case UDB_DBFETCH:
+ bzero(&key, sizeof key);
+ bzero(&info, sizeof info);
key.data = keybuf;
key.size = keylen;
+#if DB_VERSION_MAJOR < 2
i = (*up->udb_dbp->get)(up->udb_dbp, &key, &info, 0);
+#else
+ i = errno = (*up->udb_dbp->get)(up->udb_dbp, NULL,
+ &key, &info, 0);
+#endif
if (i != 0 || info.size <= 0)
{
if (tTd(28, 2))
@@ -598,7 +641,6 @@ udbmatch(user, field)
if (tTd(28, 1))
printf("udbmatch ==> %s\n", p);
return p;
- break;
#endif
#ifdef HESIOD
@@ -647,9 +689,18 @@ udbmatch(user, field)
/* get the default case for this database */
if (up->udb_default == NULL)
{
+ bzero(&key, sizeof key);
+ bzero(&info, sizeof info);
key.data = ":default:mailname";
key.size = strlen(key.data);
- i = (*up->udb_dbp->get)(up->udb_dbp, &key, &info, 0);
+#if DB_VERSION_MAJOR < 2
+ i = (*up->udb_dbp->get)(up->udb_dbp,
+ &key, &info, 0);
+#else
+ i = errno = (*up->udb_dbp->get)(up->udb_dbp,
+ NULL, &key,
+ &info, 0);
+#endif
if (i != 0 || info.size <= 0)
{
/* no default case */
@@ -666,9 +717,16 @@ udbmatch(user, field)
continue;
/* we have a default case -- verify user:maildrop */
+ bzero(&key, sizeof key);
+ bzero(&info, sizeof info);
key.data = keybuf;
key.size = keylen;
+#if DB_VERSION_MAJOR < 2
i = (*up->udb_dbp->get)(up->udb_dbp, &key, &info, 0);
+#else
+ i = errno = (*up->udb_dbp->get)(up->udb_dbp, NULL,
+ &key, &info, 0);
+#endif
if (i != 0 || info.size <= 0)
{
/* nope -- no aliasing for this user */
@@ -683,7 +741,6 @@ udbmatch(user, field)
if (tTd(28, 1))
printf("udbmatch ==> %s\n", p);
return p;
- break;
#endif
#ifdef HESIOD
@@ -750,6 +807,7 @@ udbmatch(user, field)
** The rewritten name otherwise.
*/
+/* ARGSUSED3 */
char *
udb_map_lookup(map, name, av, statp)
MAP *map;
@@ -809,6 +867,7 @@ int
_udbx_init(e)
ENVELOPE *e;
{
+ int ents = 0;
register char *p;
register struct udbent *up;
@@ -825,7 +884,6 @@ _udbx_init(e)
while (p != NULL)
{
char *spec;
- int nopts;
int l;
# if 0
auto int rcode;
@@ -846,8 +904,14 @@ _udbx_init(e)
if (p != NULL)
*p++ = '\0';
+ if (ents >= MAXUDBENT)
+ {
+ syserr("Maximum number of UDB entries exceeded");
+ break;
+ }
+
/* extract options */
- nopts = _udb_parsespec(spec, opts, MAXUDBOPTS);
+ (void) _udb_parsespec(spec, opts, MAXUDBOPTS);
/*
** Decode database specification.
@@ -914,6 +978,7 @@ _udbx_init(e)
INADDRSZ);
up->udb_addr.sin_port = UdbPort;
up->udb_timeout = UdbTimeout;
+ ents++;
up++;
}
@@ -929,6 +994,7 @@ _udbx_init(e)
case '@': /* forward to remote host */
up->udb_type = UDB_FORWARD;
up->udb_fwdhost = spec + 1;
+ ents++;
up++;
break;
@@ -938,6 +1004,7 @@ _udbx_init(e)
if (strcasecmp(spec, "hesiod") != 0)
goto badspec;
up->udb_type = UDB_HESIOD;
+ ents++;
up++;
break;
#endif /* HESIOD */
@@ -956,15 +1023,25 @@ _udbx_init(e)
strcat(up->udb_dbname, ".db");
}
errno = 0;
+#if DB_VERSION_MAJOR < 2
up->udb_dbp = dbopen(up->udb_dbname, O_RDONLY,
0644, DB_BTREE, NULL);
+#else
+ up->udb_dbp = NULL;
+ errno = db_open(up->udb_dbname, DB_BTREE, DB_RDONLY,
+ 0644, NULL, NULL, &up->udb_dbp);
+#endif
if (up->udb_dbp == NULL)
{
if (tTd(28, 1))
{
int saveerrno = errno;
+#if DB_VERSION_MAJOR < 2
printf("dbopen(%s): %s\n",
+#else
+ printf("db_open(%s): %s\n",
+#endif
up->udb_dbname,
errstring(errno));
errno = saveerrno;
@@ -973,7 +1050,11 @@ _udbx_init(e)
{
if (LogLevel > 2)
sm_syslog(LOG_ERR, e->e_id,
+#if DB_VERSION_MAJOR < 2
"dbopen(%s): %s",
+#else
+ "db_open(%s): %s",
+#endif
up->udb_dbname,
errstring(errno));
up->udb_type = UDB_EOLIST;
@@ -986,6 +1067,7 @@ _udbx_init(e)
break;
}
up->udb_type = UDB_DBFETCH;
+ ents++;
up++;
break;
#endif
@@ -1051,7 +1133,11 @@ badspec:
{
if (up->udb_type == UDB_DBFETCH)
{
+#if DB_VERSION_MAJOR < 2
(*up->udb_dbp->close)(up->udb_dbp);
+#else
+ errno = (*up->udb_dbp->close)(up->udb_dbp, 0);
+#endif
}
}
#endif
@@ -1096,7 +1182,7 @@ hes_udb_get(key, info)
DBT *info;
{
char *name, *type;
- char *p, **hp;
+ char **hp;
char kbuf[MAXKEY + 1];
if (strlen(key->data) >= (SIZE_T) sizeof kbuf)
@@ -1114,8 +1200,25 @@ hes_udb_get(key, info)
printf("hes_udb_get(%s, %s)\n", name, type);
/* make the hesiod query */
+#ifdef HESIOD_INIT
+ if (HesiodContext == NULL && hesiod_init(&HesiodContext) != 0)
+ return -1;
+ hp = hesiod_resolve(HesiodContext, name, type);
+#else
hp = hes_resolve(name, type);
+#endif /* HESIOD_INIT */
*--type = ':';
+#ifdef HESIOD_INIT
+ if (hp == NULL)
+ return 1;
+ if (*hp == NULL)
+ {
+ hesiod_free_list(HesiodContext, hp);
+ if (errno == ECONNREFUSED || errno == EMSGSIZE)
+ return -1;
+ return 1;
+ }
+#else
if (hp == NULL || hp[0] == NULL)
{
/* network problem or timeout */
@@ -1124,6 +1227,7 @@ hes_udb_get(key, info)
return 1;
}
+#endif /* HESIOD_INIT */
else
{
/*
diff --git a/usr.sbin/sendmail/src/useful.h b/usr.sbin/sendmail/src/useful.h
index 59182febc15..2a283ab7b8b 100644
--- a/usr.sbin/sendmail/src/useful.h
+++ b/usr.sbin/sendmail/src/useful.h
@@ -1,37 +1,15 @@
/*
- * Copyright (c) 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*
- * @(#)useful.h 8.7 (Berkeley) 5/29/97
+ * @(#)useful.h 8.12 (Berkeley) 5/19/98
*/
# include <sys/types.h>
diff --git a/usr.sbin/sendmail/src/usersmtp.c b/usr.sbin/sendmail/src/usersmtp.c
index b088d608943..23e4d025693 100644
--- a/usr.sbin/sendmail/src/usersmtp.c
+++ b/usr.sbin/sendmail/src/usersmtp.c
@@ -1,44 +1,22 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
# include "sendmail.h"
#ifndef lint
#if SMTP
-static char sccsid[] = "@(#)usersmtp.c 8.88 (Berkeley) 10/20/97 (with SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.104 (Berkeley) 6/30/98 (with SMTP)";
#else
-static char sccsid[] = "@(#)usersmtp.c 8.88 (Berkeley) 10/20/97 (without SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.104 (Berkeley) 6/30/98 (without SMTP)";
#endif
#endif /* not lint */
@@ -89,8 +67,8 @@ smtpinit(m, mci, e)
{
register int r;
register char *p;
- extern void esmtp_check();
- extern void helo_options();
+ extern void esmtp_check __P((char *, bool, MAILER *, MCI *, ENVELOPE *));
+ extern void helo_options __P((char *, bool, MAILER *, MCI *, ENVELOPE *));
if (tTd(18, 1))
{
@@ -154,24 +132,16 @@ smtpinit(m, mci, e)
** My mother taught me to always introduce myself.
*/
-#if _FFR_LMTP
if (bitnset(M_ESMTP, m->m_flags) || bitnset(M_LMTP, m->m_flags))
-#else
- if (bitnset(M_ESMTP, m->m_flags))
-#endif
mci->mci_flags |= MCIF_ESMTP;
tryhelo:
-#if _FFR_LMTP
if (bitnset(M_LMTP, m->m_flags))
{
smtpmessage("LHLO %s", m, mci, MyHostName);
SmtpPhase = mci->mci_phase = "client LHLO";
}
else if (bitset(MCIF_ESMTP, mci->mci_flags))
-#else
- if (bitset(MCIF_ESMTP, mci->mci_flags))
-#endif
{
smtpmessage("EHLO %s", m, mci, MyHostName);
SmtpPhase = mci->mci_phase = "client EHLO";
@@ -187,12 +157,8 @@ tryhelo:
goto tempfail1;
else if (REPLYTYPE(r) == 5)
{
-#if _FFR_LMTP
if (bitset(MCIF_ESMTP, mci->mci_flags) &&
!bitnset(M_LMTP, m->m_flags))
-#else
- if (bitset(MCIF_ESMTP, mci->mci_flags))
-#endif
{
/* try old SMTP instead */
mci->mci_flags &= ~MCIF_ESMTP;
@@ -213,13 +179,11 @@ tryhelo:
if (p != NULL)
*p = '\0';
if (!bitnset(M_NOLOOPCHECK, m->m_flags) &&
-#if _FFR_LMTP
!bitnset(M_LMTP, m->m_flags) &&
-#endif
strcasecmp(&SmtpReplyBuffer[4], MyHostName) == 0)
{
syserr("553 %s config error: mail loops back to me (MX problem?)",
- mci->mci_host);
+ CurHostName);
mci_setstat(mci, EX_CONFIG, NULL, NULL);
mci->mci_errno = 0;
smtpquit(m, mci, e);
@@ -416,7 +380,7 @@ smtpmailfrom(m, mci, e)
/* cannot just send a 8-bit version */
extern char MsgBuf[];
- usrerr("%s does not support 8BITMIME", mci->mci_host);
+ usrerr("%s does not support 8BITMIME", CurHostName);
mci_setstat(mci, EX_NOTSTICKY, "5.6.3", MsgBuf);
return EX_DATAERR;
}
@@ -492,15 +456,9 @@ smtpmailfrom(m, mci, e)
smtpquit(m, mci, e);
return EX_TEMPFAIL;
}
- else if (r == 452 && bitset(MCIF_SIZE, mci->mci_flags) &&
- e->e_msgsize > 0)
- {
- mci_setstat(mci, EX_NOTSTICKY, smtptodsn(r), SmtpReplyBuffer);
- return EX_TEMPFAIL;
- }
else if (REPLYTYPE(r) == 4)
{
- mci_setstat(mci, EX_TEMPFAIL, smtptodsn(r), SmtpReplyBuffer);
+ mci_setstat(mci, EX_NOTSTICKY, smtptodsn(r), SmtpReplyBuffer);
return EX_TEMPFAIL;
}
else if (REPLYTYPE(r) == 2)
@@ -522,7 +480,7 @@ smtpmailfrom(m, mci, e)
else if (r == 552)
{
/* exceeded storage allocation */
- mci_setstat(mci, EX_NOTSTICKY, "5.2.2", SmtpReplyBuffer);
+ mci_setstat(mci, EX_NOTSTICKY, "5.3.4", SmtpReplyBuffer);
if (bitset(MCIF_SIZE, mci->mci_flags))
e->e_flags |= EF_NO_BODY_RETN;
return EX_UNAVAILABLE;
@@ -538,7 +496,7 @@ smtpmailfrom(m, mci, e)
{
sm_syslog(LOG_CRIT, e->e_id,
"%.100s: SMTP MAIL protocol error: %s",
- mci->mci_host,
+ CurHostName,
shortenstring(SmtpReplyBuffer, 403));
}
@@ -655,7 +613,7 @@ smtprcpt(to, m, mci, e)
{
sm_syslog(LOG_CRIT, e->e_id,
"%.100s: SMTP RCPT protocol error: %s",
- mci->mci_host,
+ CurHostName,
shortenstring(SmtpReplyBuffer, 403));
}
@@ -678,7 +636,7 @@ smtprcpt(to, m, mci, e)
*/
static jmp_buf CtxDataTimeout;
-static void datatimeout();
+static void datatimeout __P((void));
int
smtpdata(m, mci, e)
@@ -721,7 +679,7 @@ smtpdata(m, mci, e)
{
sm_syslog(LOG_CRIT, e->e_id,
"%.100s: SMTP DATA-1 protocol error: %s",
- mci->mci_host,
+ CurHostName,
shortenstring(SmtpReplyBuffer, 403));
}
smtprset(m, mci, e);
@@ -740,7 +698,7 @@ smtpdata(m, mci, e)
mci->mci_errno = errno;
mci->mci_state = MCIS_ERROR;
mci_setstat(mci, EX_TEMPFAIL, "4.4.2", NULL);
- syserr("451 timeout writing message to %s", mci->mci_host);
+ syserr("451 timeout writing message to %s", CurHostName);
smtpquit(m, mci, e);
return EX_TEMPFAIL;
}
@@ -784,10 +742,8 @@ smtpdata(m, mci, e)
/* check for the results of the transaction */
SmtpPhase = mci->mci_phase = "client DATA status";
setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
-#if _FFR_LMTP
if (bitnset(M_LMTP, m->m_flags))
return EX_OK;
-#endif
r = reply(m, mci, e, TimeOuts.to_datafinal, NULL);
if (r < 0)
{
@@ -818,7 +774,7 @@ smtpdata(m, mci, e)
{
sm_syslog(LOG_CRIT, e->e_id,
"%.100s: SMTP DATA-2 protocol error: %s",
- mci->mci_host,
+ CurHostName,
shortenstring(SmtpReplyBuffer, 403));
}
return rstat;
@@ -842,8 +798,6 @@ datatimeout()
** The exit status corresponding to the reply code.
*/
-#if _FFR_LMTP
-
int
smtpgetstat(m, mci, e)
MAILER *m;
@@ -871,18 +825,18 @@ smtpgetstat(m, mci, e)
stat = EX_OK;
else if (REPLYTYPE(r) == 5)
stat = EX_UNAVAILABLE;
+ else
+ stat = EX_PROTOCOL;
mci_setstat(mci, stat, smtptodsn(r), SmtpReplyBuffer);
if (LogLevel > 1 && stat == EX_PROTOCOL)
{
sm_syslog(LOG_CRIT, e->e_id,
"%.100s: SMTP DATA-3 protocol error: %s",
- mci->mci_host,
+ CurHostName,
shortenstring(SmtpReplyBuffer, 403));
}
return stat;
}
-
-#endif
/*
** SMTPQUIT -- close the SMTP connection.
**
@@ -1020,7 +974,7 @@ reply(m, mci, e, timeout, pfunc)
for (;;)
{
register char *p;
- extern time_t curtime();
+ extern time_t curtime __P((void));
/* actually do the read */
if (e->e_xfp != NULL)
@@ -1053,7 +1007,7 @@ reply(m, mci, e, timeout, pfunc)
mci->mci_errno = errno;
oldholderrs = HoldErrs;
HoldErrs = TRUE;
- usrerr("451 reply: read error from %s", mci->mci_host);
+ usrerr("451 reply: read error from %s", CurHostName);
mci_setstat(mci, EX_TEMPFAIL, "4.4.2", MsgBuf);
/* if debugging, pause so we can see state */
@@ -1072,13 +1026,13 @@ reply(m, mci, e, timeout, pfunc)
int plen;
snprintf(p, wbufleft, "%s... ",
- shortenstring(e->e_to, 203));
+ shortenstring(e->e_to, MAXSHORTSTR));
plen = strlen(p);
p += plen;
wbufleft -= plen;
}
snprintf(p, wbufleft, "reply(%.100s) during %s",
- mci->mci_host, SmtpPhase);
+ CurHostName, SmtpPhase);
checkfd012(wbuf);
}
#endif
@@ -1116,7 +1070,7 @@ reply(m, mci, e, timeout, pfunc)
if (!(isascii(bufp[0]) && isdigit(bufp[0])) ||
!(isascii(bufp[1]) && isdigit(bufp[1])) ||
!(isascii(bufp[2]) && isdigit(bufp[2])) ||
- !(bufp[3] == ' ' || bufp[3] == '-'))
+ !(bufp[3] == ' ' || bufp[3] == '-' || bufp[3] == '\0'))
continue;
/* process the line */
@@ -1146,7 +1100,8 @@ reply(m, mci, e, timeout, pfunc)
*/
/* save temporary failure messages for posterity */
- if (SmtpReplyBuffer[0] == '4' && SmtpError[0] == '\0')
+ if (SmtpReplyBuffer[0] == '4' &&
+ (bitnset(M_LMTP, m->m_flags) || SmtpError[0] == '\0'))
snprintf(SmtpError, sizeof SmtpError, "%s", SmtpReplyBuffer);
/* reply code 421 is "Service Shutting Down" */
diff --git a/usr.sbin/sendmail/src/util.c b/usr.sbin/sendmail/src/util.c
index 2e5aebe6e6c..ba35dcd9531 100644
--- a/usr.sbin/sendmail/src/util.c
+++ b/usr.sbin/sendmail/src/util.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1983, 1995-1997 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)util.c 8.137 (Berkeley) 10/22/97";
+static char sccsid[] = "@(#)util.c 8.159 (Berkeley) 7/1/98";
#endif /* not lint */
# include "sendmail.h"
@@ -80,6 +58,122 @@ stripquotes(s)
} while (c != '\0');
}
/*
+** ADDQUOTES -- Adds quotes & quote bits to a string.
+**
+** Runs through a string and adds characters and quote bits.
+**
+** Parameters:
+** s -- the string to modify.
+**
+** Returns:
+** pointer to quoted string.
+**
+** Side Effects:
+** none.
+**
+*/
+
+char *
+addquotes(s)
+ char *s;
+{
+ int len = 0;
+ char c;
+ char *p = s, *q, *r;
+
+ if (s == NULL)
+ return NULL;
+
+ /* Find length of quoted string */
+ while ((c = *p++) != '\0')
+ {
+ len++;
+ if (c == '\\' || c == '"')
+ len++;
+ }
+
+ q = r = xalloc(len + 3);
+ p = s;
+
+ /* add leading quote */
+ *q++ = '"';
+ while ((c = *p++) != '\0')
+ {
+ /* quote \ or " */
+ if (c == '\\' || c == '"')
+ *q++ = '\\';
+ *q++ = c;
+ }
+ *q++ = '"';
+ *q = '\0';
+ return r;
+}
+ /*
+** RFC822_STRING -- Checks string for proper RFC822 string quoting.
+**
+** Runs through a string and verifies RFC822 special characters
+** are only found inside comments, quoted strings, or backslash
+** escaped. Also verified balanced quotes and parenthesis.
+**
+** Parameters:
+** s -- the string to modify.
+**
+** Returns:
+** TRUE -- if the string is RFC822 compliant.
+** FALSE -- if the string is not RFC822 compliant.
+**
+** Side Effects:
+** none.
+**
+*/
+
+bool
+rfc822_string(s)
+ char *s;
+{
+ bool quoted = FALSE;
+ int commentlev = 0;
+ char *c = s;
+
+ if (s == NULL)
+ return FALSE;
+
+ while (*c != '\0')
+ {
+ /* escaped character */
+ if (*c == '\\')
+ {
+ c++;
+ if (*c == '\0')
+ return FALSE;
+ }
+ else if (commentlev == 0 && *c == '"')
+ quoted = !quoted;
+ else if (!quoted)
+ {
+ if (*c == ')')
+ {
+ /* unbalanced ')' */
+ if (commentlev == 0)
+ return FALSE;
+ else
+ commentlev--;
+ }
+ else if (*c == '(')
+ commentlev++;
+ else if (commentlev == 0 &&
+ strchr(MustQuoteChars, *c) != NULL)
+ return FALSE;
+ }
+ c++;
+ }
+ /* unbalanced '"' or '(' */
+ if (quoted || commentlev != 0)
+ return FALSE;
+ else
+ return TRUE;
+}
+ /*
** XALLOC -- Allocate memory and bitch wildly on failure.
**
** THIS IS A CLUDGE. This should be made to give a proper
@@ -286,10 +380,14 @@ xputs(s)
c = *s++ & 0377;
goto printchar;
}
- if (c == MACROEXPAND)
+ if (c == MACROEXPAND || c == MACRODEXPAND)
{
printf("%s$", TermEscape.te_rv_on);
+ if (c == MACRODEXPAND)
+ putchar('&');
shiftout = TRUE;
+ if (*s == '\0')
+ continue;
if (strchr("=~&?", *s) != NULL)
putchar(*s++);
if (bitset(0200, *s))
@@ -538,6 +636,7 @@ putxline(l, len, mci, pxflags)
{
register char *p, *end;
int slop = 0;
+ size_t eol_len = strlen(mci->mci_mailer->m_eol);
/* strip out 0200 bits -- these can look like TELNET protocol */
if (bitset(MCIF_7BIT, mci->mci_flags) ||
@@ -572,6 +671,8 @@ putxline(l, len, mci, pxflags)
bitnset(M_XDOT, mci->mci_mailer->m_flags))
{
(void) putc('.', mci->mci_out);
+ if (!bitset(MCIF_INHEADER, mci->mci_flags))
+ mci->mci_contentlen++;
if (TrafficLogFile != NULL)
(void) putc('.', TrafficLogFile);
}
@@ -581,14 +682,26 @@ putxline(l, len, mci, pxflags)
bitnset(M_ESCFROM, mci->mci_mailer->m_flags))
{
(void) putc('>', mci->mci_out);
+ if (!bitset(MCIF_INHEADER, mci->mci_flags))
+ mci->mci_contentlen++;
if (TrafficLogFile != NULL)
(void) putc('>', TrafficLogFile);
}
while (l < q)
+ {
(void) putc(*l++, mci->mci_out);
+ if (!bitset(MCIF_INHEADER, mci->mci_flags))
+ mci->mci_contentlen++;
+ }
(void) putc('!', mci->mci_out);
+ if (!bitset(MCIF_INHEADER, mci->mci_flags))
+ mci->mci_contentlen++;
fputs(mci->mci_mailer->m_eol, mci->mci_out);
+ if (!bitset(MCIF_INHEADER, mci->mci_flags))
+ mci->mci_contentlen += eol_len;
(void) putc(' ', mci->mci_out);
+ if (!bitset(MCIF_INHEADER, mci->mci_flags))
+ mci->mci_contentlen++;
if (TrafficLogFile != NULL)
{
for (l = l_base; l < q; l++)
@@ -604,6 +717,8 @@ putxline(l, len, mci, pxflags)
bitnset(M_XDOT, mci->mci_mailer->m_flags))
{
(void) putc('.', mci->mci_out);
+ if (!bitset(MCIF_INHEADER, mci->mci_flags))
+ mci->mci_contentlen++;
if (TrafficLogFile != NULL)
(void) putc('.', TrafficLogFile);
}
@@ -613,6 +728,8 @@ putxline(l, len, mci, pxflags)
bitnset(M_ESCFROM, mci->mci_mailer->m_flags))
{
(void) putc('>', mci->mci_out);
+ if (!bitset(MCIF_INHEADER, mci->mci_flags))
+ mci->mci_contentlen++;
if (TrafficLogFile != NULL)
(void) putc('>', TrafficLogFile);
}
@@ -621,16 +738,22 @@ putxline(l, len, mci, pxflags)
if (TrafficLogFile != NULL)
(void) putc(*l, TrafficLogFile);
(void) putc(*l, mci->mci_out);
+ if (!bitset(MCIF_INHEADER, mci->mci_flags))
+ mci->mci_contentlen++;
}
if (TrafficLogFile != NULL)
(void) putc('\n', TrafficLogFile);
fputs(mci->mci_mailer->m_eol, mci->mci_out);
+ if (!bitset(MCIF_INHEADER, mci->mci_flags))
+ mci->mci_contentlen += eol_len;
if (l < end && *l == '\n')
{
if (*++l != ' ' && *l != '\t' && *l != '\0' &&
bitset(PXLF_HEADER, pxflags))
{
(void) putc(' ', mci->mci_out);
+ if (!bitset(MCIF_INHEADER, mci->mci_flags))
+ mci->mci_contentlen++;
if (TrafficLogFile != NULL)
(void) putc(' ', TrafficLogFile);
}
@@ -715,7 +838,7 @@ xfclose(fp, a, b)
*/
static jmp_buf CtxReadTimeout;
-static void readtimeout();
+static void readtimeout __P((time_t));
char *
sfgets(buf, siz, fp, timeout, during)
@@ -801,6 +924,7 @@ sfgets(buf, siz, fp, timeout, during)
return (buf);
}
+/* ARGSUSED */
static void
readtimeout(timeout)
time_t timeout;
@@ -1192,20 +1316,29 @@ dumpfd(fd, printclosed, logit)
{
register char *p;
char *hp;
- char *fmtstr;
#ifdef S_IFSOCK
SOCKADDR sa;
#endif
auto SOCKADDR_LEN_T slen;
int i;
+#if STAT64 > 0
+ struct stat64 st;
+#else
struct stat st;
+#endif
char buf[200];
p = buf;
snprintf(p, SPACELEFT(buf, p), "%3d: ", fd);
p += strlen(p);
- if (fstat(fd, &st) < 0)
+ if (
+#if STAT64 > 0
+ fstat64(fd, &st)
+#else
+ fstat(fd, &st)
+#endif
+ < 0)
{
if (errno != EBADF)
{
@@ -1299,13 +1432,24 @@ dumpfd(fd, printclosed, logit)
default:
defprint:
+ if (sizeof st.st_ino > sizeof (long))
+ snprintf(p, SPACELEFT(buf, p),
+ "dev=%d/%d, ino=%s, nlink=%d, u/gid=%d/%d, ",
+ major(st.st_dev), minor(st.st_dev),
+ quad_to_string(st.st_ino),
+ st.st_nlink, st.st_uid, st.st_gid);
+ else
+ snprintf(p, SPACELEFT(buf, p),
+ "dev=%d/%d, ino=%lu, nlink=%d, u/gid=%d/%d, ",
+ major(st.st_dev), minor(st.st_dev),
+ (unsigned long) st.st_ino,
+ st.st_nlink, st.st_uid, st.st_gid);
if (sizeof st.st_size > sizeof (long))
- fmtstr = "dev=%d/%d, ino=%d, nlink=%d, u/gid=%d/%d, size=%qd";
+ snprintf(p, SPACELEFT(buf, p), "size=%s",
+ quad_to_string(st.st_size));
else
- fmtstr = "dev=%d/%d, ino=%d, nlink=%d, u/gid=%d/%d, size=%ld";
- snprintf(p, SPACELEFT(buf, p), fmtstr,
- major(st.st_dev), minor(st.st_dev), st.st_ino,
- st.st_nlink, st.st_uid, st.st_gid, st.st_size);
+ snprintf(p, SPACELEFT(buf, p), "size=%lu",
+ (unsigned long) st.st_size);
break;
}
@@ -1317,55 +1461,6 @@ printit:
printf("%s\n", buf);
}
/*
-** SHORTENSTRING -- return short version of a string
-**
-** If the string is already short, just return it. If it is too
-** long, return the head and tail of the string.
-**
-** Parameters:
-** s -- the string to shorten.
-** m -- the max length of the string.
-**
-** Returns:
-** Either s or a short version of s.
-*/
-
-#ifndef MAXSHORTSTR
-# define MAXSHORTSTR 203
-#endif
-
-char *
-shortenstring(s, m)
- register const char *s;
- int m;
-{
- int l;
- static char buf[MAXSHORTSTR + 1];
-
- l = strlen(s);
- if (l < m)
- return (char *) s;
- if (m > MAXSHORTSTR)
- m = MAXSHORTSTR;
- else if (m < 10)
- {
- if (m < 5)
- {
- strncpy(buf, s, m);
- buf[m] = '\0';
- return buf;
- }
- strncpy(buf, s, m - 3);
- strcpy(buf + m - 3, "...");
- return buf;
- }
- m = (m - 3) / 2;
- strncpy(buf, s, m);
- strcpy(buf + m, "...");
- strcpy(buf + m + 3, s + l - m);
- return buf;
-}
- /*
** SHORTEN_HOSTNAME -- strip local domain information off of hostname.
**
** Parameters:
@@ -1481,9 +1576,9 @@ prog_open(argv, pfd, e)
/* run as default user */
endpwent();
- if (setgid(DefGid) < 0)
+ if (setgid(DefGid) < 0 && geteuid() == 0)
syserr("prog_open: setgid(%ld) failed", (long) DefGid);
- if (setuid(DefUid) < 0)
+ if (setuid(DefUid) < 0 && geteuid() == 0)
syserr("prog_open: setuid(%ld) failed", (long) DefUid);
/* run in some directory */
@@ -1686,7 +1781,7 @@ denlstring(s, strict, logattacks)
sm_syslog(LOG_NOTICE, CurEnv->e_id,
"POSSIBLE ATTACK from %.100s: newline in string \"%s\"",
RealHostName == NULL ? "[UNKNOWN]" : RealHostName,
- shortenstring(bp, 203));
+ shortenstring(bp, MAXSHORTSTR));
}
return bp;
diff --git a/usr.sbin/sendmail/src/version.c b/usr.sbin/sendmail/src/version.c
index dc041baa38a..bf0b3918adc 100644
--- a/usr.sbin/sendmail/src/version.c
+++ b/usr.sbin/sendmail/src/version.c
@@ -1,39 +1,17 @@
/*
- * Copyright (c) 1983 Eric P. Allman
+ * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+ * Copyright (c) 1983 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 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.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
*/
#ifndef lint
-static char sccsid[] = "@(#)version.c 8.8.8.1 (Berkeley) 10/24/97";
+static char sccsid[] = "@(#)version.c 8.9.1.1 (Berkeley) 7/2/98";
#endif /* not lint */
-char Version[] = "8.8.8";
+char Version[] = "8.9.1";