diff -Ncr sendmail-8.8.5/FAQ sendmail-8.8.6/FAQ
*** sendmail-8.8.5/FAQ	Sat Aug 17 14:27:46 1996
--- sendmail-8.8.6/FAQ	Sat Jun 14 08:57:59 1997
***************
*** 6,9 ****
  sending email to mail-server@rtfm.mit.edu with the command "send
  usenet/news.answers/mail/sendmail-faq" in the message.
  
! 				--Eric Allman		8/17/96
--- 6,11 ----
  sending email to mail-server@rtfm.mit.edu with the command "send
  usenet/news.answers/mail/sendmail-faq" in the message.
  
! An HTML version is also available at http://www.sendmail.org/faq.
! 
! 				--Eric Allman		14 June 1997
diff -Ncr sendmail-8.8.5/KNOWNBUGS sendmail-8.8.6/KNOWNBUGS
*** sendmail-8.8.5/KNOWNBUGS	Tue Oct 15 13:33:31 1996
--- sendmail-8.8.6/KNOWNBUGS	Fri Jun 13 12:04:51 1997
***************
*** 1,13 ****
  
  
  	     K N O W N   B U G S   I N   S E N D M A I L
! 			     (for 8.8)
  
  
  The following are bugs or deficiencies in sendmail that I am aware of
  but which have not been fixed in the current release.  You probably
! want to get the most up to date version of this from FTP.CS.Berkeley.EDU
! in /ucb/sendmail/KNOWNBUGS.  For descriptions of bugs that have been
  fixed, see the file RELEASE_NOTES (in the root directory of the sendmail
  distribution).
  
--- 1,13 ----
  
  
  	     K N O W N   B U G S   I N   S E N D M A I L
! 			     (for 8.8.6)
  
  
  The following are bugs or deficiencies in sendmail that I am aware of
  but which have not been fixed in the current release.  You probably
! want to get the most up to date version of this from ftp.sendmail.org	
! in /pub/sendmail/KNOWNBUGS.  For descriptions of bugs that have been
  fixed, see the file RELEASE_NOTES (in the root directory of the sendmail
  distribution).
  
***************
*** 40,59 ****
    this address.  It's not clear what the right behaviour is in this
    circumstance.
  
- * MX records that point at non-existent hosts work strangly.
- 
-   Consider the DNS records:
- 
- 	hostH	MX	1 hostA
- 		MX	2 hostB
- 	hostA	A	128.32.8.9
- 
-   (note that there is no A record for hostB).  If hostA is down,
-   an attempt to send to hostH gives "host unknown" -- that is, it
-   reflects out the status on the last host it tries, which in this
-   case is hostB, which is unknown.  It probably ought to eliminate
-   hostB early in processing.
- 
  * \231 considered harmful.
  
    Header addresses that have the \231 character (and possibly others
--- 40,45 ----
***************
*** 77,82 ****
--- 63,80 ----
    Apparently, this problem is due to linking -lc before -lsocket;
    if you are having this problem, check your Makefile.
  
+ * accept() problem on Linux.
+ 
+   Apparently, the accept() in sendmail daemon loop can return ETIMEDOUT
+   and cause sendmail to sleep for 5 seconds during which time no new
+   connections will be accepted.  An error is reported to syslog:
+ 
+   Jun  9 17:14:12 hostname sendmail[207]: NOQUEUE: SYSERR(root):
+ 			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.
+ 
  * Excessive mailing list nesting can run out of file descriptors.
  
    If you have a mailing list that includes lots of other mailing
***************
*** 106,109 ****
    allow for 8->7 bit MIME conversions either.
  
  
! (Version 8.23, last updated 10/15/96)
--- 104,107 ----
    allow for 8->7 bit MIME conversions either.
  
  
! (Version 8.25, last updated 6/13/97)
diff -Ncr sendmail-8.8.5/READ_ME sendmail-8.8.6/READ_ME
*** sendmail-8.8.5/READ_ME	Tue Sep 24 18:24:27 1996
--- sendmail-8.8.6/READ_ME	Thu May  8 08:06:28 1997
***************
*** 1,5 ****
  /*-
!  *	@(#)READ_ME	8.29 (Berkeley) 9/24/96
   */
  
  			SENDMAIL RELEASE 8
--- 1,5 ----
  /*-
!  *	@(#)READ_ME	8.30 (Berkeley) 5/8/97
   */
  
  			SENDMAIL RELEASE 8
***************
*** 165,173 ****
  use the version that was on the Net2 tape -- it has a number of
  nefarious bugs that were bad enough when I got them; you shouldn't have
  to go through the same thing.  Instead, get a new version via public
! FTP from ftp.CS.Berkeley.EDU, file ucb/4bsd/db.tar.Z.  This software
! is highly recommended; it gets rid of several stupid limits, it's much
! faster, and the interface is nicer to animals and plants.  You will
  also probably find that you have to add -I/where/you/put/db/include
  to the sendmail makefile to get db.h to work properly.
  
--- 165,173 ----
  use the version that was on the Net2 tape -- it has a number of
  nefarious bugs that were bad enough when I got them; you shouldn't have
  to go through the same thing.  Instead, get a new version via public
! FTP from ftp.sleepycat.com, file db/packages/db.1.85.tar.gz.  This
! software is highly recommended; it gets rid of several stupid limits, it's
! much faster, and the interface is nicer to animals and plants.  You will
  also probably find that you have to add -I/where/you/put/db/include
  to the sendmail makefile to get db.h to work properly.
  
diff -Ncr sendmail-8.8.5/RELEASE_NOTES sendmail-8.8.6/RELEASE_NOTES
*** sendmail-8.8.5/RELEASE_NOTES	Tue Jan 21 08:43:48 1997
--- sendmail-8.8.6/RELEASE_NOTES	Sat Jun 14 08:45:31 1997
***************
*** 1,11 ****
  			SENDMAIL RELEASE NOTES
! 	     @(#)RELEASE_NOTES	8.8.5.3 (Berkeley) 1/21/97
  
  
  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.8.5/8.8.5	97/01/21
  	SECURITY: Clear out group list during startup.  Without this, sendmail
  		will continue to run with the group permissions of the caller,
--- 1,315 ----
  			SENDMAIL RELEASE NOTES
! 	     @(#)RELEASE_NOTES	8.8.6.11 (Berkeley) 6/14/97
  
  
  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.8.6/8.8.6	97/06/14
+ 	    *************************************************************
+ 	    * The extensive assistance of Gregory Neil Shapiro of WPI	*
+ 	    * in preparing this release is gratefully appreciated.	*
+ 	    * Sun Microsystems has also provided resources toward	*
+ 	    * continued sendmail development.				*
+ 	    *************************************************************
+ 	SECURITY: A few systems allow an open with the O_EXCL|O_CREAT open
+ 		mode bits set to create a file that is a symbolic link that
+ 		points nowhere.  This makes it possible to create a root
+ 		owned file in an arbitrary directory by inserting the symlink
+ 		into a writable directory after the initial lstat(2) check
+ 		determined that the file did not exist.  The only verified
+ 		example of a system having these odd semantics for O_EXCL
+ 		and symbolic links was HP-UX prior to version 9.07.  Most
+ 		systems do not have the problem, since a exclusive create
+ 		of a file disallows symbolic links.  Systems that have been
+ 		verified to NOT have the problem include AIX 3.x, *BSD,
+ 		DEC OSF/1, HP-UX 9.07 and higher, Linux, SunOS, Solaris,
+ 		and Ultrix.  This is a potential exposure on systems that
+ 		have this bug and which do not have a MAILER-DAEMON alias
+ 		pointing at a legitimate account, since this will cause old
+ 		mail to be dropped in /var/tmp/dead.letter.
+ 	SECURITY: Problems can occur on poorly managed systems, specifically,
+ 		if maps or alias files are in world writable directories.
+ 		If your system has alias maps in writable directories, it
+ 		is potentially possible for an attacker to replace the .db
+ 		(or .dir and .pag) files by symbolic links pointing at
+ 		another database; this can be used either to expose
+ 		information (e.g., by pointing an alias file at /etc/spwd.db
+ 		and probing for accounts), or as a denial-of-service attack
+ 		(by trashing the password database).  The fix disallows
+ 		symbolic links entirely when rebuilding alias files or on
+ 		maps that are in writable directories, and always warns on
+ 		writable directories; 8.9 will probably consider writable
+ 		directories to be fatal errors.  This does not represent an
+ 		exposure on systems that have alias files in unwritable
+ 		system directories.
+ 	SECURITY: disallow .forward or :include: files that are links (hard
+ 		or soft) if the parent directory (or any directory in the
+ 		path) is writable by anyone other than the owner.  This is
+ 		similar to the previous case for user files.  This change
+ 		should not affect most systems, but is necessary to prevent
+ 		an attacker who can write the directory from pointing such
+ 		files at other files that are readable only by the owner.
+ 	SECURITY: Tighten safechown rules: many systems will say that they
+ 		have a safe (restricted to root) chown even on files that
+ 		are mounted from another system that allows owners to give
+ 		away files.  The new rules are very strict, trusting file
+ 		ownership only in those few cases where the system has
+ 		been verified to be at least as paranoid as necessary.
+ 		However, it is possible to relax the rules to partially
+ 		trust the ownership if the directory path is not world or
+ 		group writable.  This might allow someone who has a legitimate
+ 		:include: file (referenced directly from /etc/aliases) to
+ 		become another non-root user if the :include: file is in a
+ 		non-writable directory on an NFS-mounted filesystem where
+ 		the local system says that giveaway is denied but it is
+ 		actually permitted.  I believe this to be a very small set
+ 		of cases.  If in doubt, do not point :include: aliases at
+ 		NFS-mounted filesystems.
+ 	SECURITY: When setting a numeric group id using the RunAsUser option
+ 		(e.g., "O RunAsUser=10:20", the group id would not be set.
+ 		Implicit group ids (e.g., "O RunAsUser=mailnull") or alpha
+ 		group ids (e.g., "O RunAsUser=mailuser:mailgrp") worked fine.
+ 		The user id was still set properly.  Problem noted by Uli
+ 		Pralle of the Technical University of Berlin.
+ 	Save the initial gid set for use when checking for if the
+ 		PrivacyOptions=restrictmailq option is set.  Problem reported
+ 		by Wolfgang Ley of DFN-CERT.
+ 	Make 55x reply codes to the SMTP DATA-"." be non-sticky (i.e., a
+ 		failure on one message won't affect future messages to the
+ 		same host).
+ 	IP source route printing had an "off by one" error that would
+ 		affect any options that came after the route option.  Patch
+ 		from Theo de Raadt.
+ 	The "Message is too large" error didn't successfully bounce the error
+ 		back to the sender.  Problem reported by Stephen More of
+ 		PSI; patch from Gregory Neil Shapiro of WPI.
+ 	Change SMTP status code 553 to map into Extended code 5.1.0 (instead
+ 		of 5.1.3); it apparently gets used in multiple ways.
+ 		Suggested by John Myers of Portola Communications.
+ 	Fix possible extra null byte generated during collection if errors
+ 		occur at the beginning of the stream.  Patch contributed by
+ 		Andrey A. Chernov and Gregory Neil Shapiro.
+ 	Code changes to avoid possible reentrant call of malloc/free within
+ 		a signal handler.  Problem noted by John Beck of Sun
+ 		Microsystems.
+ 	Move map initialization to be earlier so that check_relay ruleset
+ 		will have the latest version of the map data.  Problem noted
+ 		by Paul Forgey of Metainfo; patch from Gregory Neil Shapiro.
+ 	If there are fatal errors during the collection phase (e.g., message
+ 		too large) don't send the bogus message.
+ 	Avoid "cannot open xfAAA00000" messages when sending to aliases that
+ 		have errors and have owner- aliases.  Problem noted by Michael
+ 		Barber of MTU; fix from Gregory Neil Shapiro of WPI.
+ 	Avoid null pointer dereference on illegal Boundary= parameters in
+ 		multipart/mixed Content-Type: header.  Problem noted by
+ 		Richard Muirden of RMIT University.
+ 	Always print error messages during newaliases (-bi) even if the
+ 		ErrorMode is not set to "print".  Fix from Gregory Neil
+ 		Shapiro.
+ 	Test mode could core dump if you did a /map lookup in an optional map
+ 		that could not be opened.  Based on a fix from John Beck of
+ 		Sun Microsystems.
+ 	If DNS is misconfigured so that the last MX record tried points to
+ 		a host that does not have an A record, but other MX records
+ 		pointed to something reasonable, don't bounce the message
+ 		with a "host unknown" error.  Note that this should really
+ 		be fixed in the zone file for the domain.  Problem noted by
+ 		Joe Rhett of Navigist, Inc.
+ 	If a map fails (e.g., DNS times out) on all recipient addresses, mark
+ 		the message as having been tried; otherwise the next queue
+ 		run will not realize that this is a second attempt and will
+ 		retry immediately.  Problem noted by Bryan Costales of
+ 		Mercury Mail.
+ 	If the clock is set backwards, and a MinQueueAge is set, no jobs
+ 		will be run until the later setting of the clock is reached.
+ 		"Problem" (I use the term loosely) noted by Eric Hagberg of
+ 		Morgan Stanley.
+ 	If the load average rises above the cutoff threshold (above which
+ 		sendmail will not process the queue at all) during a queue
+ 		run, abort the queue run immediately.  Problem noted by
+ 		Bryan Costales of Mercury Mail.
+ 	The variable queue processing algorithm (based on the message size,
+ 		number of recipients, message precedence, and job age) was
+ 		non-functional -- either the entire queue was processed or
+ 		none of the queue was processed.  The updated algorithm
+ 		does no queue run if a single recipient zero size job will
+ 		not be run.
+ 	If there is a fatal ("panic") message that will cause sendmail to
+ 		die immediately, never hold the error message for future
+ 		printing.
+ 	Force ErrorMode=print in -bt mode so that all errors are printed
+ 		regardless of the setting of the ErrorMode option in the
+ 		configuration file.  Patch from Gregory Neil Shapiro.
+ 	New compile flag HASSTRERROR says that this OS has the strerror(3)
+ 		routine available in one of the libraries.  Use it in conf.h.
+ 	The -m (match only) flag now works on host class maps.
+ 	If class hash or btree maps are rebuilt, sendmail will now detect
+ 		this and reopen the map.  Previously, they could give
+ 		erroneous results during a single message processing
+ 		(but would recover when the next message was received).
+ 	Don't delete zero length queue files when doing queue runs until the
+ 		files are at least ten minutes old.  This avoids a potential
+ 		race condition: the creator creates the qf file, getting back
+ 		a file descriptor.  The queue runner locks it and deletes it
+ 		because it is zero length.  The creator then writes the
+ 		descriptor that is now for a disconnected file, and the
+ 		job goes away.  Based on a suggestion by Bryan Costales.
+ 	When determining the "validated" host 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, tag the
+ 		address as "may be forged".
+ 	Log null connections (i.e., hosts that connect but do not do any
+ 		substantive activity on the connection before disconnecting;
+ 		"substantive" is defined to be MAIL, EXPN, VRFY, or ETRN.
+ 	Always permit "writes" to /dev/null regardless of the link count.
+ 		This is safe because /dev/null is special cased, and no open
+ 		or write is ever actually attempted.  Patch from Villy Kruse
+ 		of TwinCom.
+ 	If a message cannot be sent because of a 552 (exceeded storage
+ 		allocation) response to the MAIL FROM:<>, and a SIZE= parameter
+ 		was given, don't return the body in the bounce, since there
+ 		is a very good chance that the message will double-bounce.
+ 	Fix possible line truncation if a quoted-printable had an =00 escape
+ 		in the body.  Problem noted by Charles Karney of the Princeton
+ 		Plasma Physics Laboratory.
+ 	Notify flags (e.g., -NSUCCESS) were lost on user+detail addresses.
+ 		Problem noted by Kari Hurtta of the Finnish Meteorological
+ 		Institute.
+ 	The MaxDaemonChildren option wasn't applying to queue runs as
+ 		documented.  Note that this increases the potential denial
+ 		of service problems with this option: an attacker can
+ 		connect many times, and thereby lock out queue runs as well
+ 		as incoming connections.  If you use this option, you should
+ 		run the "sendmail -bd" and "sendmail -q30m" jobs separately
+ 		to avoid this attack.  Failure to limit noted by Matthew
+ 		Dillon of BEST Internet Communications.
+ 	Always give a message in newaliases if alias files cannot be
+ 		opened instead of failing silently.  Suggested by Gregory
+ 		Neil Shapiro.  This change makes the code match the O'Reilly
+ 		book (2nd edition).
+ 	Some older versions of the resolver could return with h_errno == -1
+ 		if no name server could be reached, causing mail to bounce
+ 		instead of queueing.  Treat this like TRY_AGAIN.  Fix from
+ 		John Beck of SunSoft.
+ 	If a :include: file is owned by a user that does not have an entry
+ 		in the passwd file, sendmail could dereference a null pointer.
+ 		Problem noted by Satish Mynam of Sun Microsystems.
+ 	Take precautions to make sure that the SMTP protocol cannot get out
+ 		of sync if (for example) an alias file cannot be opened.
+ 	Fix a possible race condition that can cause a SIGALRM to come in
+ 		immediately after a SIGHUP, causing the new sendmail to die.
+ 	Avoid possible hang on SVr3 systems when doing child reaping.  Patch
+ 		from Villy Kruse of TwinCom.
+ 	Ignore improperly formatted SMTP reply codes.  Previously these were
+ 		partially processed, which could cause confusing error
+ 		returns.
+ 	Fix possible bogus pointer dereference when doing ldapx map lookups
+ 		on some architectures.
+ 	Portability:
+ 		A/UX: from Jim Jagielski of NASA/GSFC.
+ 		glibc: SOCK_STREAM was changed from a #define to an enum,
+ 			thus breaking #ifdef SOCK_STREAM.  Only option seems
+ 			to be to assume SOCK_STREAM if __GNU_LIBRARY__ is
+ 			defined.  Problem reported by A Sun of the University
+ 			of Washington.
+ 		Solaris: use SIOCGIFNUM to get the number of interfaces on
+ 			the system rather than guessing at compile time.
+ 			Patch contributed by John Beck of Sun Microsystems.
+ 		Intel Paragon: from Wendy Lin of Purdue University.
+ 		GNU Hurd: from Miles Bader of the GNU project.
+ 		RISC/os 4.50 from Harlan Stenn of PFCS Corporation.
+ 		ISC Unix: wait never returns if SIGCLD signals are blocked.
+ 			Unfortunately releasing them opens a race condition,
+ 			but there appears to be no fix for this.  Patch from
+ 			Gregory Neil Shapiro.
+ 		BIND 8.1 for IPv6 compatibility from John Kennedy.
+ 		Solaris: a bug in strcasecmp caused characters with the
+ 			high order bit set to apparently randomly match
+ 			letters -- for example, $| (0233) matches "i" and "I".
+ 			Problem noted by John Gregson of the University of
+ 			Cambridge.
+ 		IRIX 6.x: make Makefile.IRIX.6.2 apply to all 6.x.  From
+ 			Kari Hurtta.
+ 		IRIX 6.x: Create Makefiles for systems that claim to be
+ 			IRIX64 but are 6.2 or higher (so use the regular
+ 			IRIX Makefile).
+ 		IRIX 6.x: Fix load average computation on 64 bit kernels.
+ 			Problem noted by Eric Hagberg of Morgan Stanley.
+ 	CONFIG: Some canonification was still done for UUCP-like addresses
+ 		even if FEATURE(nocanonify) was set.  Problem pointed out by
+ 		Brian Candler.
+ 	CONFIG: In some cases UUCP mailers wouldn't properly recognize all
+ 		local names as local.  Problem noted by Jeff Polk of BSDI;
+ 		fix provided by Gregory Neil Shapiro.
+ 	CONFIG: The "local:user" syntax entries in mailertables and other
+ 		"mailer:user" syntax locations returned an incorrect value
+ 		for the $h macro.  Problem noted by Gregory Neil Shapiro.
+ 	CONFIG: Retain "+detail" information when forwarding mail to a
+ 		MAIL_HUB, LUSER_RELAY, or LOCAL_RELAY.  Patch from Philip
+ 		Guenther of Gustavus Adolphus College.
+ 	CONFIG: Make sure user+detail works for FEATURE(virtusertable);
+ 		rules are the same as for aliasing.  Based on a patch from
+ 		Gregory Neil Shapiro.
+ 	CONFIG: Break up parsing rules into several pieces; this should
+ 		have no functional change in this release, but makes it
+ 		possible to have better anti-spam rulesets in the future.
+ 	CONFIG: Disallow double dots in host names to avoid having the
+ 		HostStatusDirectory store status under the wrong name.
+ 		In some cases this can be used as a denial-of-service attack.
+ 		Problem noted by Ron Jarrell of Virginia Tech, patch from
+ 		Gregory Neil Shapiro.
+ 	CONFIG: Don't use F=m (multiple recipients per invocation) for
+ 		MAILER(procmail), but do pass F=Pn9 (include Return-Path:,
+ 		don't include From_, and convert to 8-bit).  Suggestions
+ 		from Kimmo Suominen and Roderick Schertler.
+ 	CONFIG: Domains under $=M (specified with MASQUERADE_DOMAIN) where
+ 		being masqueraded as though FEATURE(masquerade_entire_domain)
+ 		was specified, even when it wasn't.
+ 	MAIL.LOCAL: Solaris 2.6 has snprintf.  From John Beck of SunSoft.
+ 	MAIL.LOCAL: SECURITY: check to make sure that an attacker doesn't
+ 		"slip in" a symbolic link between the lstat(2) call and the
+ 		exclusive open.  This is only a problem on System V derived
+ 		systems that allow an exclusive create on files that are
+ 		symbolic links pointing nowhere.
+ 	MAIL.LOCAL: If the final mailbox close() failed, the user id was
+ 		not reset back to root, which on some systems would cause
+ 		later mailboxes to fail.  Also, any partial message would
+ 		not be truncated, which could result in repeated deliveries.
+ 		Problem noted by Bruce Evans via Peter Wemm (FreeBSD
+ 		developers).
+ 	MAKEMAP: Handle cases where O_EXLOCK is #defined to be 0.  A similar
+ 		change to the sendmail map code was made in 8.8.3.  Problem
+ 		noted by Gregory Neil Shapiro.
+ 	MAKEMAP: Give warnings on file problems such as map files that are
+ 		symbolic links; although makemap is not setuid root, it is
+ 		often run as root and hence has the potential for the same
+ 		sorts of problems as alias rebuilds.
+ 	MAKEMAP: Change compilation so that it will link properly on
+ 		NEXTSTEP.
+ 	CONTRIB: etrn.pl: search for Cw as well as Fw lines in sendmail.cf.
+ 		Accept an optional list of arguments following the server
+ 		name for the ETRN arguments to use (instead of $=w).  Other
+ 		miscellaneous bug fixes.  From Christian von Roques via
+ 		John Beck of Sun Microsystems.
+ 	CONTRIB: Add passwd-to-alias.pl, contributed by Kari Hurtta.  This
+ 		Perl script converts GECOS information in the /etc/passwd
+ 		file into aliases, allowing for faster access to full name
+ 		lookups; it is also clever about adding aliases (to root)
+ 		for system accounts.
+ 	NEW FILES:
+ 		src/safefile.c
+ 		cf/ostype/gnuhurd.m4
+ 		cf/ostype/irix6.m4
+ 		contrib/passwd-to-alias.pl
+ 		test/t_exclopen.c
+ 		src/Makefiles/Makefile.IRIX64.6.1
+ 		src/Makefiles/Makefile.IRIX64.6.x
+ 	RENAMED FILES:
+ 		src/Makefiles/Makefile.IRIX.6.2 =>	Makefile.IRIX.6.x
+ 		src/Makefiles/Makefile.IRIX64 =>	Makefile.IRIX64.6.0
+ 
  8.8.5/8.8.5	97/01/21
  	SECURITY: Clear out group list during startup.  Without this, sendmail
  		will continue to run with the group permissions of the caller,
***************
*** 101,108 ****
  	Give better diagnostics on long alias lines.  Based on code contributed
  		by Patrick Gosling of the University of Cambridge.
  	Increase the number of virtual interfaces that will be probed for
! 		alternate names.  Problem noted by Gregory Neil Shapiro of
! 		WPI.
  	PORTABILITY:
  		UXP/DS V20L10 for Fujitsu DS/90: Makefile patches from
  			Toshiaki Nomura of Fujitsu Limited.
--- 405,411 ----
  	Give better diagnostics on long alias lines.  Based on code contributed
  		by Patrick Gosling of the University of Cambridge.
  	Increase the number of virtual interfaces that will be probed for
! 		alternate names.  Problem noted by Amy Rich of Shore.Net.
  	PORTABILITY:
  		UXP/DS V20L10 for Fujitsu DS/90: Makefile patches from
  			Toshiaki Nomura of Fujitsu Limited.
***************
*** 138,145 ****
  		to the named user on the local machine.  ``local:user@host''
  		is equivalent to ``local:user'' (the host is ignored).  In
  		all cases, the original user@host is passed in $@ (i.e., the
! 		detail information).  Inspired by a report from Michael Fuhr
! 		of Dimensional Communications, L.L.C.
  	CONFIG: Strip quotes from the first word of an "error:" host
  		indication.  This lets you set (for example) the LUSER_RELAY
  		to be ``error:\"5.1.1\" Your Message Here''.  Note the use
--- 441,447 ----
  		to the named user on the local machine.  ``local:user@host''
  		is equivalent to ``local:user'' (the host is ignored).  In
  		all cases, the original user@host is passed in $@ (i.e., the
! 		detail information).  Inspired by a report from Michael Fuhr.
  	CONFIG: Strip quotes from the first word of an "error:" host
  		indication.  This lets you set (for example) the LUSER_RELAY
  		to be ``error:\"5.1.1\" Your Message Here''.  Note the use
***************
*** 837,844 ****
  	Add new RunAsUser option; this causes sendmail to do a setuid to that
  		user early in processing to avoid potential security problems.
  		However, this means that all .forward and :include: files must
! 		be readable by that user, and on systems that don't support the
! 		saved uid bit properly, all files to be written must be
  		writable by that user and all programs will be executed by that
  		user.  It is also incompatible with the SafeFileEnvironment
  		option.  In other words, it may not actually add much to
--- 1139,1145 ----
  	Add new RunAsUser option; this causes sendmail to do a setuid to that
  		user early in processing to avoid potential security problems.
  		However, this means that all .forward and :include: files must
! 		be readable by that user, and all files to be written must be
  		writable by that user and all programs will be executed by that
  		user.  It is also incompatible with the SafeFileEnvironment
  		option.  In other words, it may not actually add much to
***************
*** 1407,1413 ****
  		``/mx host'' returns the MX records for ``host''.
  		``/parse address'' will parse address, returning the value of
  			crackaddr (essentially, the comment information)
! 			and the parsed address (the same as -bv).
  		``/try mailer address'' will rewrite address into the form
  			it will have when presented to the indicated mailer.
  		``/tryflags flags'' will set flags used by parsing.  The
--- 1708,1714 ----
  		``/mx host'' returns the MX records for ``host''.
  		``/parse address'' will parse address, returning the value of
  			crackaddr (essentially, the comment information)
! 			and the parsed address.
  		``/try mailer address'' will rewrite address into the form
  			it will have when presented to the indicated mailer.
  		``/tryflags flags'' will set flags used by parsing.  The
diff -Ncr sendmail-8.8.5/cf/README sendmail-8.8.6/cf/README
*** sendmail-8.8.5/cf/README	Thu Jan 16 17:20:29 1997
--- sendmail-8.8.6/cf/README	Sat Jun 14 08:22:42 1997
***************
*** 4,10 ****
  
  		Eric Allman <eric@CS.Berkeley.EDU>
  
! 		@(#)README	8.111 (Berkeley) 1/16/97
  
  
  This document describes the sendmail configuration files being used
--- 4,10 ----
  
  		Eric Allman <eric@CS.Berkeley.EDU>
  
! 		@(#)README	8.120 (Berkeley) 6/14/97
  
  
  This document describes the sendmail configuration files being used
***************
*** 34,40 ****
  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
! the latest version).
  
  IF YOU DON'T HAVE A BERKELEY MAKE, don't despair!  Just run
  "m4 ../m4/cf.m4 foo.mc > foo.cf" -- that should be all you need.
--- 34,41 ----
  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
! the latest version).  EXCEPTIONS: DEC's m4 on Digital UNIX 4.x is broken
! (3.x is fine).  Use GNU m4 on this platform.
  
  IF YOU DON'T HAVE A BERKELEY MAKE, don't despair!  Just run
  "m4 ../m4/cf.m4 foo.mc > foo.cf" -- that should be all you need.
***************
*** 120,126 ****
  
  	#
  	#  This is a Berkeley-specific configuration file for HP-UX 9.x.
! 	#  It applies only the the Computer Science Division at Berkeley,
  	#  and should not be used elsewhere.   It is provided on the sendmail
  	#  distribution as a sample only.  To create your own configuration
  	#  file, create an appropriate domain file in ../domain, change the
--- 121,127 ----
  
  	#
  	#  This is a Berkeley-specific configuration file for HP-UX 9.x.
! 	#  It applies only to the Computer Science Division at Berkeley,
  	#  and should not be used elsewhere.   It is provided on the sendmail
  	#  distribution as a sample only.  To create your own configuration
  	#  file, create an appropriate domain file in ../domain, change the
***************
*** 306,316 ****
  POP_MAILER_ARGS		[pop $u] The arguments passed to the POP mailer.
  PROCMAIL_MAILER_PATH	[/usr/local/bin/procmail] The path to the procmail
  			program.  This is also used by FEATURE(local_procmail).
! PROCMAIL_MAILER_FLAGS	[Shu] Flags added to Procmail mailer.  Flags
! 			``DFMmn'' are always set.  This is NOT used by
  			FEATURE(local_procmail); tweak LOCAL_MAILER_FLAGS
  			instead.
! PROCMAIL_MAILER_ARGS	[procmail -m $h $f $u] The arguments passed to
  			the Procmail mailer.  This is NOT used by
  			FEATURE(local_procmail); tweak LOCAL_MAILER_ARGS
  			instead.
--- 307,317 ----
  POP_MAILER_ARGS		[pop $u] The arguments passed to the POP mailer.
  PROCMAIL_MAILER_PATH	[/usr/local/bin/procmail] The path to the procmail
  			program.  This is also used by FEATURE(local_procmail).
! PROCMAIL_MAILER_FLAGS	[SPhnu9] Flags added to Procmail mailer.  Flags
! 			``DFM'' are always set.  This is NOT used by
  			FEATURE(local_procmail); tweak LOCAL_MAILER_FLAGS
  			instead.
! PROCMAIL_MAILER_ARGS	[procmail -Y -m $h $f $u] The arguments passed to
  			the Procmail mailer.  This is NOT used by
  			FEATURE(local_procmail); tweak LOCAL_MAILER_ARGS
  			instead.
***************
*** 656,662 ****
  		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.
  
  virtusertable	A domain-specific form of aliasing, allowing multiple
  		virtual domains to be hosted on one machine.  For example,
--- 657,666 ----
  		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 must
! 		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,
***************
*** 669,686 ****
  		then mail addressed to info@foo.com will be sent to the
  		address foo-info, mail addressed to info@bar.com will be
  		delivered to bar-info, and mail addressed to anyone at
! 		baz.org will be sent to jane@elsewhere.net.  All the host
! 		names on the left hand side (foo.com, bar.com, and baz.org)
! 		must be in $=w.  The default map definition is:
  
  			hash -o /etc/virtusertable
  
  		A new definition can be specified as the second argument of
! 		the FEATURE macro.
  
  nodns		We aren't running DNS at our site (for example,
  		we are UUCP-only connected).  It's hard to consider
  		this a "feature", but hey, it had to go somewhere.
  
  nullclient	This is a special case -- it creates a stripped down
  		configuration file containing nothing but support for
--- 673,700 ----
  		then mail addressed to info@foo.com will be sent to the
  		address foo-info, mail addressed to info@bar.com will be
  		delivered to bar-info, and mail addressed to anyone at
! 		baz.org will be sent to jane@elsewhere.net.  The username
! 		from the original address is passed as %1 allowing:
! 
! 			@foo.org	%1@elsewhere.com
! 
! 		meaning someone@foo.org will be sent to someone@elsewhere.com.
! 
! 		All the host names on the left hand side (foo.com, bar.com,
! 		and baz.org) must be in $=w.  The default map definition is:
  
  			hash -o /etc/virtusertable
  
  		A new definition can be specified as the second argument of
! 		the FEATURE macro, such as
! 
! 			FEATURE(virtusertable, dbm -o /etc/mail/virtusers)
  
  nodns		We aren't running DNS at our site (for example,
  		we are UUCP-only connected).  It's hard to consider
  		this a "feature", but hey, it had to go somewhere.
+ 		Actually, as of 8.7 this is a no-op -- remove "dns" from
+ 		the hosts service switch entry instead.
  
  nullclient	This is a special case -- it creates a stripped down
  		configuration file containing nothing but support for
***************
*** 1062,1067 ****
--- 1076,1098 ----
  	      note the trailing dot ---^
  
  
+ +--------------------------------+
+ | ADDING NEW MAILERS OR RULESETS |
+ +--------------------------------+
+ 
+ Sometimes you may need to add entirely new mailers or rulesets.  They
+ should be introduced with the constructs MAILER_DEFINITIONS and
+ LOCAL_RULESETS respectively.  For example:
+ 
+ 	MAILER_DEFINITIONS
+ 	Mmymailer, ...
+ 	...
+ 
+ 	LOCAL_RULESETS
+ 	Scheck_relay
+ 	...
+ 
+ 
  +-------------------------------+
  | NON-SMTP BASED CONFIGURATIONS |
  +-------------------------------+
***************
*** 1102,1111 ****
  That is, send directly only to things you found in your DNS lookup;
  anything else goes through SMART_HOST.
  
- If you are not running DNS at all, it is important to use
- FEATURE(nodns) to avoid having sendmail queue everything waiting
- for the name server to come up.
- 
  
  +-----------+
  | WHO AM I? |
--- 1133,1138 ----
***************
*** 1522,1532 ****
  					named directory tree.  This need not be
  					a full pathname, in which case it is
  					interpreted relative to the queue
! 					directory.  This option also
! 					single-threads connections to each
! 					host, i.e., prevents multiple
! 					connections to a single server from
! 					this client.
  confUSE_ERRORS_TO*	UserErrorsTo	[False] Use the Errors-To: header to
  					deliver error messages.  This should
  					not be necessary because of general
--- 1549,1567 ----
  					named directory tree.  This need not be
  					a full pathname, in which case it is
  					interpreted relative to the queue
! 					directory.
! confSINGLE_THREAD_DELIVERY  SingleThreadDelivery
! 					[False] If this option and the
! 					HostStatusDirectory option are both
! 					set, single thread deliveries to other
! 					hosts.  That is, don't allow any two
! 					sendmails on this host to connect
! 					simultaneously to any other single
! 					host.  This can slow down delivery in
! 					some cases, in particular since a
! 					cached but otherwise idle connection
! 					to a host will prevent other sendmails
! 					from connecting to the other host.
  confUSE_ERRORS_TO*	UserErrorsTo	[False] Use the Errors-To: header to
  					deliver error messages.  This should
  					not be necessary because of general
***************
*** 1669,1675 ****
  confWORK_CLASS_FACTOR	ClassFactor	[1800] Priority multiplier for class.
  confWORK_TIME_FACTOR	RetryFactor	[90000] Cost of each delivery attempt.
  confQUEUE_SORT_ORDER	QueueSortOrder	[Priority] Queue sort algorithm:
! 					Priority or Host.
  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
--- 1704,1710 ----
  confWORK_CLASS_FACTOR	ClassFactor	[1800] Priority multiplier for class.
  confWORK_TIME_FACTOR	RetryFactor	[90000] Cost of each delivery attempt.
  confQUEUE_SORT_ORDER	QueueSortOrder	[Priority] Queue sort algorithm:
! 					Priority, Host, or Time.
  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
***************
*** 1782,1799 ****
  					files will be written as this user.
  					Intended for use only on firewalls
  					where users do not have accounts.
- confSINGLE_THREAD_DELIVERY  SingleThreadDelivery
- 					[False] If this option and the
- 					HostStatusDirectory option are both
- 					set, single thread deliveries to other
- 					hosts.  That is, don't allow any two
- 					sendmails on this host to connect
- 					simultaneously to any other single
- 					host.  This can slow down delivery in
- 					some cases, in particular since a
- 					cached but otherwise idle connection
- 					to a host will prevent other sendmails
- 					from connecting to the other host.
  
  See also the description of OSTYPE for some parameters that can be
  tweaked (generally pathnames to mailers).
--- 1817,1822 ----
***************
*** 1935,1941 ****
     O	operators that indicate network operations (cannot be in local names)
     P	top level pseudo-domains: BITNET, DECNET, FAX, UUCP, etc.
     Q
!    R
     S
     T
     U	locally connected UUCP hosts
--- 1958,1964 ----
     O	operators that indicate network operations (cannot be in local names)
     P	top level pseudo-domains: BITNET, DECNET, FAX, UUCP, etc.
     Q
!    R	domains we are willing to relay (pass anti-spam filters)
     S
     T
     U	locally connected UUCP hosts
diff -Ncr sendmail-8.8.5/cf/cf/cs-hpux10.mc sendmail-8.8.6/cf/cf/cs-hpux10.mc
*** sendmail-8.8.5/cf/cf/cs-hpux10.mc	Sat Mar 23 18:22:58 1996
--- sendmail-8.8.6/cf/cf/cs-hpux10.mc	Tue Jun  3 17:14:53 1997
***************
*** 35,41 ****
  
  #
  #  This is a Berkeley-specific configuration file for HP-UX 9.x.
! #  It applies only the the Computer Science Division at Berkeley,
  #  and should not be used elsewhere.   It is provided on the sendmail
  #  distribution as a sample only.  To create your own configuration
  #  file, create an appropriate domain file in ../domain, change the
--- 35,41 ----
  
  #
  #  This is a Berkeley-specific configuration file for HP-UX 9.x.
! #  It applies only to the Computer Science Division at Berkeley,
  #  and should not be used elsewhere.   It is provided on the sendmail
  #  distribution as a sample only.  To create your own configuration
  #  file, create an appropriate domain file in ../domain, change the
***************
*** 44,50 ****
  #
  
  divert(0)dnl
! VERSIONID(`@(#)cs-hpux10.mc	8.4 (Berkeley) 3/23/96')
  OSTYPE(hpux10)dnl
  DOMAIN(CS.Berkeley.EDU)dnl
  define(`MAIL_HUB', mailspool.CS.Berkeley.EDU)dnl
--- 44,50 ----
  #
  
  divert(0)dnl
! VERSIONID(`@(#)cs-hpux10.mc	8.5 (Berkeley) 6/3/97')
  OSTYPE(hpux10)dnl
  DOMAIN(CS.Berkeley.EDU)dnl
  define(`MAIL_HUB', mailspool.CS.Berkeley.EDU)dnl
diff -Ncr sendmail-8.8.5/cf/cf/cs-hpux9.mc sendmail-8.8.6/cf/cf/cs-hpux9.mc
*** sendmail-8.8.5/cf/cf/cs-hpux9.mc	Sat Mar 23 18:22:58 1996
--- sendmail-8.8.6/cf/cf/cs-hpux9.mc	Tue Jun  3 17:14:53 1997
***************
*** 35,41 ****
  
  #
  #  This is a Berkeley-specific configuration file for HP-UX 9.x.
! #  It applies only the the Computer Science Division at Berkeley,
  #  and should not be used elsewhere.   It is provided on the sendmail
  #  distribution as a sample only.  To create your own configuration
  #  file, create an appropriate domain file in ../domain, change the
--- 35,41 ----
  
  #
  #  This is a Berkeley-specific configuration file for HP-UX 9.x.
! #  It applies only to the Computer Science Division at Berkeley,
  #  and should not be used elsewhere.   It is provided on the sendmail
  #  distribution as a sample only.  To create your own configuration
  #  file, create an appropriate domain file in ../domain, change the
***************
*** 44,50 ****
  #
  
  divert(0)dnl
! VERSIONID(`@(#)cs-hpux9.mc	8.5 (Berkeley) 3/23/96')
  OSTYPE(hpux9)dnl
  DOMAIN(CS.Berkeley.EDU)dnl
  define(`MAIL_HUB', mailspool.CS.Berkeley.EDU)dnl
--- 44,50 ----
  #
  
  divert(0)dnl
! VERSIONID(`@(#)cs-hpux9.mc	8.6 (Berkeley) 6/3/97')
  OSTYPE(hpux9)dnl
  DOMAIN(CS.Berkeley.EDU)dnl
  define(`MAIL_HUB', mailspool.CS.Berkeley.EDU)dnl
diff -Ncr sendmail-8.8.5/cf/cf/cs-osf1.mc sendmail-8.8.6/cf/cf/cs-osf1.mc
*** sendmail-8.8.5/cf/cf/cs-osf1.mc	Sat Mar 23 18:22:58 1996
--- sendmail-8.8.6/cf/cf/cs-osf1.mc	Tue Jun  3 17:14:53 1997
***************
*** 35,41 ****
  
  #
  #  This is a Berkeley-specific configuration file for OSF/1.
! #  It applies only the the Computer Science Division at Berkeley,
  #  and should not be used elsewhere.   It is provided on the sendmail
  #  distribution as a sample only.  To create your own configuration
  #  file, create an appropriate domain file in ../domain, change the
--- 35,41 ----
  
  #
  #  This is a Berkeley-specific configuration file for OSF/1.
! #  It applies only to the Computer Science Division at Berkeley,
  #  and should not be used elsewhere.   It is provided on the sendmail
  #  distribution as a sample only.  To create your own configuration
  #  file, create an appropriate domain file in ../domain, change the
***************
*** 44,50 ****
  #
  
  divert(0)dnl
! VERSIONID(`@(#)cs-osf1.mc	8.4 (Berkeley) 3/23/96')
  OSTYPE(osf1)dnl
  DOMAIN(CS.Berkeley.EDU)dnl
  MAILER(local)dnl
--- 44,50 ----
  #
  
  divert(0)dnl
! VERSIONID(`@(#)cs-osf1.mc	8.5 (Berkeley) 6/3/97')
  OSTYPE(osf1)dnl
  DOMAIN(CS.Berkeley.EDU)dnl
  MAILER(local)dnl
diff -Ncr sendmail-8.8.5/cf/cf/cs-solaris2.mc sendmail-8.8.6/cf/cf/cs-solaris2.mc
*** sendmail-8.8.5/cf/cf/cs-solaris2.mc	Sat Mar 23 18:22:58 1996
--- sendmail-8.8.6/cf/cf/cs-solaris2.mc	Tue Jun  3 17:14:53 1997
***************
*** 35,41 ****
  
  #
  #  This is a Berkeley-specific configuration file for Solaris 2.x.
! #  It applies only the the Computer Science Division at Berkeley,
  #  and should not be used elsewhere.   It is provided on the sendmail
  #  distribution as a sample only.  To create your own configuration
  #  file, create an appropriate domain file in ../domain, change the
--- 35,41 ----
  
  #
  #  This is a Berkeley-specific configuration file for Solaris 2.x.
! #  It applies only to the Computer Science Division at Berkeley,
  #  and should not be used elsewhere.   It is provided on the sendmail
  #  distribution as a sample only.  To create your own configuration
  #  file, create an appropriate domain file in ../domain, change the
***************
*** 44,50 ****
  #
  
  divert(0)dnl
! VERSIONID(`@(#)cs-solaris2.mc	8.3 (Berkeley) 3/23/96')
  OSTYPE(solaris2)dnl
  DOMAIN(CS.Berkeley.EDU)dnl
  MAILER(local)dnl
--- 44,50 ----
  #
  
  divert(0)dnl
! VERSIONID(`@(#)cs-solaris2.mc	8.4 (Berkeley) 6/3/97')
  OSTYPE(solaris2)dnl
  DOMAIN(CS.Berkeley.EDU)dnl
  MAILER(local)dnl
diff -Ncr sendmail-8.8.5/cf/cf/cs-sunos4.1.mc sendmail-8.8.6/cf/cf/cs-sunos4.1.mc
*** sendmail-8.8.5/cf/cf/cs-sunos4.1.mc	Sat Mar 23 18:22:57 1996
--- sendmail-8.8.6/cf/cf/cs-sunos4.1.mc	Tue Jun  3 17:14:53 1997
***************
*** 35,41 ****
  
  #
  #  This is a Berkeley-specific configuration file for SunOS 4.1.x.
! #  It applies only the the Computer Science Division at Berkeley,
  #  and should not be used elsewhere.   It is provided on the sendmail
  #  distribution as a sample only.  To create your own configuration
  #  file, create an appropriate domain file in ../domain, change the
--- 35,41 ----
  
  #
  #  This is a Berkeley-specific configuration file for SunOS 4.1.x.
! #  It applies only to the Computer Science Division at Berkeley,
  #  and should not be used elsewhere.   It is provided on the sendmail
  #  distribution as a sample only.  To create your own configuration
  #  file, create an appropriate domain file in ../domain, change the
***************
*** 44,50 ****
  #
  
  divert(0)dnl
! VERSIONID(`@(#)cs-sunos4.1.mc	8.4 (Berkeley) 3/23/96')
  OSTYPE(sunos4.1)dnl
  DOMAIN(CS.Berkeley.EDU)dnl
  MAILER(local)dnl
--- 44,50 ----
  #
  
  divert(0)dnl
! VERSIONID(`@(#)cs-sunos4.1.mc	8.5 (Berkeley) 6/3/97')
  OSTYPE(sunos4.1)dnl
  DOMAIN(CS.Berkeley.EDU)dnl
  MAILER(local)dnl
diff -Ncr sendmail-8.8.5/cf/cf/cs-ultrix4.mc sendmail-8.8.6/cf/cf/cs-ultrix4.mc
*** sendmail-8.8.5/cf/cf/cs-ultrix4.mc	Sat Mar 23 18:22:58 1996
--- sendmail-8.8.6/cf/cf/cs-ultrix4.mc	Tue Jun  3 17:14:53 1997
***************
*** 35,41 ****
  
  #
  #  This is a Berkeley-specific configuration file for Ultrix 4.x.
! #  It applies only the the Computer Science Division at Berkeley,
  #  and should not be used elsewhere.   It is provided on the sendmail
  #  distribution as a sample only.  To create your own configuration
  #  file, create an appropriate domain file in ../domain, change the
--- 35,41 ----
  
  #
  #  This is a Berkeley-specific configuration file for Ultrix 4.x.
! #  It applies only to the Computer Science Division at Berkeley,
  #  and should not be used elsewhere.   It is provided on the sendmail
  #  distribution as a sample only.  To create your own configuration
  #  file, create an appropriate domain file in ../domain, change the
***************
*** 44,50 ****
  #
  
  divert(0)dnl
! VERSIONID(`@(#)cs-ultrix4.mc	8.4 (Berkeley) 3/23/96')
  OSTYPE(ultrix4)dnl
  DOMAIN(CS.Berkeley.EDU)dnl
  MAILER(local)dnl
--- 44,50 ----
  #
  
  divert(0)dnl
! VERSIONID(`@(#)cs-ultrix4.mc	8.5 (Berkeley) 6/3/97')
  OSTYPE(ultrix4)dnl
  DOMAIN(CS.Berkeley.EDU)dnl
  MAILER(local)dnl
diff -Ncr sendmail-8.8.5/cf/cf/knecht.mc sendmail-8.8.6/cf/cf/knecht.mc
*** sendmail-8.8.5/cf/cf/knecht.mc	Sun Nov 24 14:27:45 1996
--- sendmail-8.8.6/cf/cf/knecht.mc	Fri Jun 13 06:52:32 1997
***************
*** 38,44 ****
  #
  
  divert(0)dnl
! VERSIONID(`@(#)knecht.mc	8.4 (Berkeley) 11/24/96')
  OSTYPE(bsd4.4)dnl
  DOMAIN(generic)dnl
  define(`confDEF_USER_ID', `mailnull')dnl
--- 38,44 ----
  #
  
  divert(0)dnl
! VERSIONID(`@(#)knecht.mc	8.11 (Berkeley) 6/12/97')
  OSTYPE(bsd4.4)dnl
  DOMAIN(generic)dnl
  define(`confDEF_USER_ID', `mailnull')dnl
***************
*** 46,51 ****
--- 46,94 ----
  define(`confTO_ICONNECT', `10s')dnl
  define(`confCOPY_ERRORS_TO', `Postmaster')dnl
  define(`confTO_QUEUEWARN', `8h')dnl
+ define(`confPRIVACY_FLAGS', ``authwarnings,noexpn,novrfy'')dnl
  FEATURE(virtusertable)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
+ 
+ 
+ LOCAL_RULESETS
+ 
+ # reject bogus return addresses
+ Scheck_mail
+ R<>			$@ <OK>
+ R$*			$: <?> $>Parse0 $>3 $1		make domain canonical
+ R<?> $* < @ $+ . > $*	$: < $( domaincheck $2 $: OK $) > $1 < @ $2 . > $3
+ 							tag resolved names
+ R<?> $* < @ $+ > $*	$: < $( domaincheck $2 $: ? $) > $1 < @ $2 > $3
+ 							check for overrides
+ R<OK> $*		$@ <OK>
+ R<?> $* < @ $+ > $*	$#error $: 451 Sender domain must resolve
+ R<?> $*			$: < ? $&{client_name} > $1	no @domain on address...
+ R<?> $*			$@ <OK>				...local unqualed ok
+ R<? $+> $*		$#error $: 551 Domain name required
+ 							...remote is not
+ R<$+> $*		$#error $: $1			error from domaincheck
+ 
+ # disallow relaying
+ 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"
diff -Ncr sendmail-8.8.5/cf/cf/obj/sample.simple.cf sendmail-8.8.6/cf/cf/obj/sample.simple.cf
*** sendmail-8.8.5/cf/cf/obj/sample.simple.cf	Fri Apr 11 13:11:34 1997
--- sendmail-8.8.6/cf/cf/obj/sample.simple.cf	Wed Dec 31 16:00:00 1969
***************
*** 1,535 ****
- #
- # Copyright (c) 1983, 1995 Eric P. Allman
- # 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.
- #
- 
- ######################################################################
- ######################################################################
- #####
- #####		SENDMAIL CONFIGURATION FILE
- #####
- ##### built by eric@knecht.Oxford.Reference.COM on Fri Apr 11 13:11:34 PDT 1997
- ##### in /home/knecht/a/eric/src/sendmail-8.8.5/cf/cf
- ##### using ../ as configuration include directory
- #####
- ######################################################################
- ######################################################################
- 
- #####  @(#)cfhead.m4	8.9 (Berkeley) 1/18/97  #####
- #####  @(#)cf.m4	8.24 (Berkeley) 8/16/95  #####
- #####  "sample-only"  #####
- 
- #####  @(#)bsd4.4.m4	8.4 (Berkeley) 11/13/95  #####
- 
- 
- 
- #
- #  This is used only for relaying mail from a client to a hub when
- #  that client does absolutely nothing else -- i.e., it is a "null
- #  mailer".  In this sense, it acts like the "R" option in Sun
- #  sendmail.
- #
- 
- #####  @(#)nullclient.m4	8.7 (Berkeley) 2/11/96  #####
- 
- 
- 
- 
- 
- 
- #####  @(#)proto.m4	8.139 (Berkeley) 12/31/96  #####
- 
- 
- # level 7 config file format
- V7/Berkeley
- 
- ##################
- #   local info   #
- ##################
- 
- Cwlocalhost
- 
- # my official domain name
- # ... define this only if sendmail cannot automatically determine your domain
- #Dj$w.Foo.COM
- 
- # class E: names that should be exposed as from this host, even if we masquerade
- #CE root
- 
- # who I masquerade as (null for no masquerading) (see also $=M)
- DMmailhub
- 
- # my name for error messages
- DnMAILER-DAEMON
- 
- 
- # hub host (to which all mail is sent)
- DHmailhub
- 
- # route-addr separators
- C: : ,
- 
- # Configuration version number
- DZ8.8.5
- 
- 
- ###############
- #   Options   #
- ###############
- 
- # strip message body to 7 bits on input?
- O SevenBitInput=False
- 
- # 8-bit data handling
- O EightBitMode=pass8
- 
- # minimum number of free blocks on filesystem
- O MinFreeBlocks=100
- 
- # maximum message size
- #O MaxMessageSize=1000000
- 
- # substitution for space (blank) characters
- O BlankSub=.
- 
- # avoid connecting to "expensive" mailers on initial submission?
- O HoldExpensive=False
- 
- # checkpoint queue runs after every N successful deliveries
- #O CheckpointInterval=10
- 
- # default delivery mode
- O DeliveryMode=background
- 
- # automatically rebuild the alias database?
- #O AutoRebuildAliases
- 
- # error message header/file
- #O ErrorHeader=/etc/sendmail.oE
- 
- # error mode
- #O ErrorMode=print
- 
- # save Unix-style "From_" lines at top of header?
- #O SaveFromLine
- 
- # temporary file mode
- O TempFileMode=0600
- 
- # match recipients against GECOS field?
- #O MatchGECOS
- 
- # maximum hop count
- #O MaxHopCount=17
- 
- # location of help file
- O HelpFile=/usr/share/misc/sendmail.hf
- 
- # ignore dots as terminators in incoming messages?
- #O IgnoreDots
- 
- # name resolver options
- #O ResolverOptions=+AAONLY
- 
- # deliver MIME-encapsulated error messages?
- O SendMimeErrors=True
- 
- # Forward file search path
- O ForwardPath=$z/.forward.$w:$z/.forward
- 
- # open connection cache size
- O ConnectionCacheSize=2
- 
- # open connection cache timeout
- O ConnectionCacheTimeout=5m
- 
- # persistent host status directory
- #O HostStatusDirectory=.hoststat
- 
- # single thread deliveries (requires HostStatusDirectory)?
- #O SingleThreadDelivery
- 
- # use Errors-To: header?
- O UseErrorsTo=False
- 
- # log level
- O LogLevel=9
- 
- # send to me too, even in an alias expansion?
- #O MeToo
- 
- # verify RHS in newaliases?
- O CheckAliases=False
- 
- # default messages to old style headers if no special punctuation?
- O OldStyleHeaders=True
- 
- # SMTP daemon options
- #O DaemonPortOptions=Port=esmtp
- 
- # privacy flags
- O PrivacyOptions=authwarnings
- 
- # who (if anyone) should get extra copies of error messages
- #O PostMasterCopy=Postmaster
- 
- # slope of queue-only function
- #O QueueFactor=600000
- 
- # queue directory
- O QueueDirectory=/var/spool/mqueue
- 
- # timeouts (many of these)
- #O Timeout.initial=5m
- #O Timeout.connect=5m
- #O Timeout.iconnect=5m
- #O Timeout.helo=5m
- #O Timeout.mail=10m
- #O Timeout.rcpt=1h
- #O Timeout.datainit=5m
- #O Timeout.datablock=1h
- #O Timeout.datafinal=1h
- #O Timeout.rset=5m
- #O Timeout.quit=2m
- #O Timeout.misc=2m
- #O Timeout.command=1h
- #O Timeout.ident=30s
- #O Timeout.fileopen=60s
- O Timeout.queuereturn=5d
- #O Timeout.queuereturn.normal=5d
- #O Timeout.queuereturn.urgent=2d
- #O Timeout.queuereturn.non-urgent=7d
- O Timeout.queuewarn=4h
- #O Timeout.queuewarn.normal=4h
- #O Timeout.queuewarn.urgent=1h
- #O Timeout.queuewarn.non-urgent=12h
- #O Timeout.hoststatus=30m
- 
- # should we not prune routes in route-addr syntax addresses?
- #O DontPruneRoutes
- 
- # queue up everything before forking?
- O SuperSafe=True
- 
- # status file
- O StatusFile=/var/log/sendmail.st
- 
- # time zone handling:
- #  if undefined, use system default
- #  if defined but null, use TZ envariable passed in
- #  if defined and non-null, use that info
- #O TimeZoneSpec=
- 
- # default UID (can be username or userid:groupid)
- O DefaultUser=1:1
- 
- # list of locations of user database file (null means no lookup)
- #O UserDatabaseSpec=/etc/userdb
- 
- # fallback MX host
- #O FallbackMXhost=fall.back.host.net
- 
- # if we are the best MX host for a site, try it directly instead of config err
- #O TryNullMXList
- 
- # load average at which we just queue messages
- #O QueueLA=8
- 
- # load average at which we refuse connections
- #O RefuseLA=12
- 
- # maximum number of children we allow at one time
- #O MaxDaemonChildren=12
- 
- # maximum number of new connections per second
- #O ConnectionRateThrottle=3
- 
- # work recipient factor
- #O RecipientFactor=30000
- 
- # deliver each queued job in a separate process?
- #O ForkEachJob
- 
- # work class factor
- #O ClassFactor=1800
- 
- # work time factor
- #O RetryFactor=90000
- 
- # shall we sort the queue by hostname first?
- #O QueueSortOrder=priority
- 
- # minimum time in queue before retry
- #O MinQueueAge=30m
- 
- # default character set
- #O DefaultCharSet=iso-8859-1
- 
- # service switch file (ignored on Solaris, Ultrix, OSF/1, others)
- #O ServiceSwitchFile=/etc/service.switch
- 
- # hosts file (normally /etc/hosts)
- #O HostsFile=/etc/hosts
- 
- # dialup line delay on connection failure
- #O DialDelay=10s
- 
- # action to take if there are no recipients in the message
- #O NoRecipientAction=add-to-undisclosed
- 
- # chrooted environment for writing to files
- #O SafeFileEnvironment=/arch
- 
- # are colons OK in addresses?
- #O ColonOkInAddr
- 
- # how many jobs can you process in the queue?
- #O MaxQueueRunSize=10000
- 
- # shall I avoid expanding CNAMEs (violates protocols)?
- #O DontExpandCnames
- 
- # SMTP initial login message (old $e macro)
- O SmtpGreetingMessage=$j Sendmail $v/$Z; $b
- 
- # UNIX initial From header format (old $l macro)
- O UnixFromLine=From $g  $d
- 
- # delimiter (operator) characters (old $o macro)
- O OperatorChars=.:%@!^/[]+
- 
- # shall I avoid calling initgroups(3) because of high NIS costs?
- #O DontInitGroups
- 
- # are group-writable :include: and .forward files (un)trustworthy?
- #O UnsafeGroupWrites
- 
- # where do errors that occur when sending errors get sent?
- #O DoubleBounceAddress
- 
- # what user id do we assume for the majority of the processing?
- #O RunAsUser=sendmail
- 
- ###########################
- #   Message precedences   #
- ###########################
- 
- Pfirst-class=0
- Pspecial-delivery=100
- Plist=-30
- Pbulk=-60
- Pjunk=-100
- 
- #####################
- #   Trusted users   #
- #####################
- 
- # this is equivalent to setting class "t"
- #Ft/etc/sendmail.ct
- Troot
- Tdaemon
- Tuucp
- 
- #########################
- #   Format of headers   #
- #########################
- 
- H?P?Return-Path: <$g>
- HReceived: $?sfrom $s $.$?_($?s$|from $.$_)
- 	$.by $j ($v/$Z)$?r with $r$. id $i$?u
- 	for $u; $|;
- 	$.$b
- H?D?Resent-Date: $a
- H?D?Date: $a
- H?F?Resent-From: <$g>
- H?F?From: <$g>
- H?x?Full-Name: $x
- # HPosted-Date: $a
- # H?l?Received-Date: $b
- H?M?Resent-Message-Id: <$t.$i@$j>
- H?M?Message-Id: <$t.$i@$j>
- 
- 
- #####  @(#)nullrelay.m4	8.12 (Berkeley) 10/12/96  #####
- 
- #
- #  This configuration applies only to relay-only hosts.  They send
- #  all mail to a hub without consideration of the address syntax
- #  or semantics, except for adding the hub qualification to the
- #  addresses.
- #
- #	This is based on a prototype done by Bryan Costales of ICSI.
- #
- 
- ######################################################################
- ######################################################################
- #####
- #####			REWRITING RULES
- #####
- ######################################################################
- ######################################################################
- 
- ###########################################
- ###  Rulset 3 -- Name Canonicalization  ###
- ###########################################
- S3
- 
- # handle null input
- R$@			$@ <@>
- 
- # strip group: syntax (not inside angle brackets!) and trailing semicolon
- R$*			$: $1 <@>			mark addresses
- R$* < $* > $* <@>	$: $1 < $2 > $3			unmark <addr>
- R$* :: $* <@>		$: $1 :: $2			unmark node::addr
- R:include: $* <@>	$: :include: $1			unmark :include:...
- R$* : $* <@>		$: $2				strip colon if marked
- R$* <@>			$: $1				unmark
- R$* ;			$: $1				strip trailing semi
- 
- # null input now results from list:; syntax
- R$@			$@ :; <@>
- 
- # basic textual canonicalization -- note RFC733 heuristic here
- R$*			$: < $1 >		housekeeping <>
- R$+ < $* >		   < $2 >		strip excess on left
- R< $* > $+		   < $1 >		strip excess on right
- R<>			$@ < @ >		MAIL FROM:<> case
- R< $+ >			$: $1			remove housekeeping <>
- 
- # eliminate local host if present
- R@ $=w $=: $+		$@ @ $M $2 $3			@thishost ...
- R@ $+			$@ @ $1				@somewhere ...
- 
- R$=E @ $=w		$@ $1 @ $2			leave exposed
- R$+ @ $=w		$@ $1 @ $M			...@thishost
- R$+ @ $+		$@ $1 @ $2			...@somewhere
- 
- R$=w ! $=E		$@ $2 @ $1			leave exposed
- R$=w ! $+		$@ $2 @ $M			thishost!...
- R$+ ! $+		$@ $1 ! $2 @ $M			somewhere ! ...
- 
- R$=E % $=w		$@ $1 @ $2			leave exposed
- R$+ % $=w		$@ $1 @ $M			...%thishost
- R$+ % $+		$@ $1 @ $2			...%somewhere
- 
- R$=E			$@ $1 @ $j			leave exposed
- R$+			$@ $1 @ $M			unadorned user
- 
- 
- ######################################
- ###   Ruleset 0 -- Parse Address   ###
- ######################################
- 
- S0
- 
- R$*:;<@>		$#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
- 
- # pass everything else to a relay host
- R$*			$#nullclient $@ $H $: $1
- 
- 
- ##################################################
- ###  Ruleset 4 -- Final Output Post-rewriting  ###
- ##################################################
- S4
- 
- R$* <@>			$@				handle <> and list:;
- 
- # strip trailing dot off before passing to nullclient relay
- R$* @ $+ .		$1 @ $2
- 
- #
- ######################################################################
- ######################################################################
- #####
- #####			MAILER DEFINITIONS
- #####
- ######################################################################
- ######################################################################
- 
- ############################################
- ###   Null Client Mailer specification   ###
- ############################################
- 
- 
- Mnullclient,	P=[IPC], F=mDFMuXa,
- 		A=IPC $h
- 
- 
- ##################################################
- ###   Local and Program Mailer specification   ###
- ##################################################
- 
- #####  @(#)local.m4	8.23 (Berkeley) 5/31/96  #####
- 
- Mlocal,		P=/usr/libexec/mail.local, F=lsDFMAw5:/|@qrmn9, S=10/30, R=20/40,
- 		T=DNS/RFC822/X-Unix,
- 		A=mail -d $u
- Mprog,		P=/bin/sh, F=lsDFMoqeu9, S=10/30, R=20/40, D=$z:/,
- 		T=X-Unix,
- 		A=sh -c $u
- 
- #
- #  Envelope sender rewriting
- #
- S10
- R<@>			$n			errors to mailer-daemon
- R$+			$: $>50 $1		add local domain if needed
- R$*			$: $>94 $1		do masquerading
- 
- #
- #  Envelope recipient rewriting
- #
- S20
- R$+ < @ $* >		$: $1			strip host part
- 
- #
- #  Header sender rewriting
- #
- S30
- R<@>			$n			errors to mailer-daemon
- R$+			$: $>50 $1		add local domain if needed
- R$*			$: $>93 $1		do masquerading
- 
- #
- #  Header recipient rewriting
- #
- S40
- R$+			$: $>50 $1		add local domain if needed
- #R$*			$: $>93 $1		do all-masquerading
- 
- #
- #  Common code to add local domain name (only if always-add-domain)
- #
- S50
- #R$* < @ $* > $* 	$@ $1 < @ $2 > $3		already fully qualified
- #R$+			$@ $1 < @ *LOCAL* >		add local qualification
--- 0 ----
diff -Ncr sendmail-8.8.5/cf/cf/s2k-osf1.mc sendmail-8.8.6/cf/cf/s2k-osf1.mc
*** sendmail-8.8.5/cf/cf/s2k-osf1.mc	Sat Mar 23 18:22:58 1996
--- sendmail-8.8.6/cf/cf/s2k-osf1.mc	Tue Jun  3 17:14:53 1997
***************
*** 35,41 ****
  
  #
  #  This is a Berkeley-specific configuration file for OSF/1.
! #  It applies only the the Sequoia 2000 Project at Berkeley,
  #  and should not be used elsewhere.   It is provided on the sendmail
  #  distribution as a sample only.  To create your own configuration
  #  file, create an appropriate domain file in ../domain, change the
--- 35,41 ----
  
  #
  #  This is a Berkeley-specific configuration file for OSF/1.
! #  It applies only to the Sequoia 2000 Project at Berkeley,
  #  and should not be used elsewhere.   It is provided on the sendmail
  #  distribution as a sample only.  To create your own configuration
  #  file, create an appropriate domain file in ../domain, change the
***************
*** 44,50 ****
  #
  
  divert(0)dnl
! VERSIONID(`@(#)s2k-osf1.mc	8.4 (Berkeley) 3/23/96')
  OSTYPE(osf1)dnl
  DOMAIN(S2K.Berkeley.EDU)dnl
  MAILER(local)dnl
--- 44,50 ----
  #
  
  divert(0)dnl
! VERSIONID(`@(#)s2k-osf1.mc	8.5 (Berkeley) 6/3/97')
  OSTYPE(osf1)dnl
  DOMAIN(S2K.Berkeley.EDU)dnl
  MAILER(local)dnl
diff -Ncr sendmail-8.8.5/cf/cf/s2k-ultrix4.mc sendmail-8.8.6/cf/cf/s2k-ultrix4.mc
*** sendmail-8.8.5/cf/cf/s2k-ultrix4.mc	Sat Mar 23 18:22:59 1996
--- sendmail-8.8.6/cf/cf/s2k-ultrix4.mc	Tue Jun  3 17:14:53 1997
***************
*** 35,41 ****
  
  #
  #  This is a Berkeley-specific configuration file for Ultrix 4.x.
! #  It applies only the the Sequoia 2000 Project at Berkeley,
  #  and should not be used elsewhere.   It is provided on the sendmail
  #  distribution as a sample only.  To create your own configuration
  #  file, create an appropriate domain file in ../domain, change the
--- 35,41 ----
  
  #
  #  This is a Berkeley-specific configuration file for Ultrix 4.x.
! #  It applies only to the Sequoia 2000 Project at Berkeley,
  #  and should not be used elsewhere.   It is provided on the sendmail
  #  distribution as a sample only.  To create your own configuration
  #  file, create an appropriate domain file in ../domain, change the
***************
*** 44,50 ****
  #
  
  divert(0)dnl
! VERSIONID(`@(#)s2k-ultrix4.mc	8.4 (Berkeley) 3/23/96')
  OSTYPE(ultrix4)dnl
  DOMAIN(S2K.Berkeley.EDU)dnl
  MAILER(local)dnl
--- 44,50 ----
  #
  
  divert(0)dnl
! VERSIONID(`@(#)s2k-ultrix4.mc	8.5 (Berkeley) 6/3/97')
  OSTYPE(ultrix4)dnl
  DOMAIN(S2K.Berkeley.EDU)dnl
  MAILER(local)dnl
diff -Ncr sendmail-8.8.5/cf/cf/sample.simple.mc sendmail-8.8.6/cf/cf/sample.simple.mc
*** sendmail-8.8.5/cf/cf/sample.simple.mc	Fri Apr 11 13:11:25 1997
--- sendmail-8.8.6/cf/cf/sample.simple.mc	Wed Dec 31 16:00:00 1969
***************
*** 1,3 ****
- VERSIONID("sample-only")
- OSTYPE(bsd4.4)
- FEATURE(nullclient, mailhub)
--- 0 ----
diff -Ncr sendmail-8.8.5/cf/feature/bestmx_is_local.m4 sendmail-8.8.6/cf/feature/bestmx_is_local.m4
*** sendmail-8.8.5/cf/feature/bestmx_is_local.m4	Wed Oct 23 08:43:46 1996
--- sendmail-8.8.6/cf/feature/bestmx_is_local.m4	Mon Apr  7 14:39:39 1997
***************
*** 34,40 ****
  #
  
  divert(0)
! VERSIONID(`@(#)bestmx_is_local.m4	8.4 (Berkeley) 10/23/96')
  divert(-1)
  
  LOCAL_CONFIG
--- 34,40 ----
  #
  
  divert(0)
! VERSIONID(`@(#)bestmx_is_local.m4	8.5 (Berkeley) 3/28/97')
  divert(-1)
  
  LOCAL_CONFIG
***************
*** 60,66 ****
  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
  R$* $=O $* < @ $* @@ $=w . > $*	$@ $>97 $1 $2 $3
  R$* < @ $* @@ $=w . > $*	$#local $: $1
  R$* < @ $* @@ $* > $*		$: $1 < @ $2 > $4
--- 60,66 ----
  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
  R$* $=O $* < @ $* @@ $=w . > $*	$@ $>97 $1 $2 $3
  R$* < @ $* @@ $=w . > $*	$#local $: $1
  R$* < @ $* @@ $* > $*		$: $1 < @ $2 > $4
diff -Ncr sendmail-8.8.5/cf/m4/nullrelay.m4 sendmail-8.8.6/cf/m4/nullrelay.m4
*** sendmail-8.8.5/cf/m4/nullrelay.m4	Sat Oct 12 18:27:40 1996
--- sendmail-8.8.6/cf/m4/nullrelay.m4	Wed Apr 30 08:53:05 1997
***************
*** 34,40 ****
  #
  divert(0)
  
! VERSIONID(`@(#)nullrelay.m4	8.12 (Berkeley) 10/12/96')
  
  #
  #  This configuration applies only to relay-only hosts.  They send
--- 34,40 ----
  #
  divert(0)
  
! VERSIONID(`@(#)nullrelay.m4	8.13 (Berkeley) 4/30/97')
  
  #
  #  This configuration applies only to relay-only hosts.  They send
***************
*** 68,74 ****
  R:`include': $* <@>	$: :`include': $1			unmark :`include':...
  R$* : $* <@>		$: $2				strip colon if marked
  R$* <@>			$: $1				unmark
! R$* ;			$: $1				strip trailing semi
  
  # null input now results from list:; syntax
  R$@			$@ :; <@>
--- 68,75 ----
  R:`include': $* <@>	$: :`include': $1			unmark :`include':...
  R$* : $* <@>		$: $2				strip colon if marked
  R$* <@>			$: $1				unmark
! R$* ;			   $1				strip trailing semi
! R$* < $* ; >		   $1 < $2 >			bogus bracketed semi
  
  # null input now results from list:; syntax
  R$@			$@ :; <@>
diff -Ncr sendmail-8.8.5/cf/m4/proto.m4 sendmail-8.8.6/cf/m4/proto.m4
*** sendmail-8.8.5/cf/m4/proto.m4	Tue Dec 31 12:04:17 1996
--- sendmail-8.8.6/cf/m4/proto.m4	Wed Apr 30 13:33:26 1997
***************
*** 34,40 ****
  #
  divert(0)
  
! VERSIONID(`@(#)proto.m4	8.139 (Berkeley) 12/31/96')
  
  MAILER(local)dnl
  
--- 34,40 ----
  #
  divert(0)
  
! VERSIONID(`@(#)proto.m4	8.149 (Berkeley) 4/30/97')
  
  MAILER(local)dnl
  
***************
*** 505,511 ****
  R$* : $* [ $* ]		$: $1 : $2 [ $3 ] <@>		remark if leading colon
  R$* : $* <@>		$: $2				strip colon if marked
  R$* <@>			$: $1				unmark
! R$* ;			$: $1				strip trailing semi
  
  # null input now results from list:; syntax
  R$@			$@ :; <@>
--- 505,512 ----
  R$* : $* [ $* ]		$: $1 : $2 [ $3 ] <@>		remark if leading colon
  R$* : $* <@>		$: $2				strip colon if marked
  R$* <@>			$: $1				unmark
! R$* ;			   $1				strip trailing semi
! R$* < $* ; >		   $1 < $2 >			bogus bracketed semi
  
  # null input now results from list:; syntax
  R$@			$@ :; <@>
***************
*** 593,601 ****
  ifdef(`_CLASS_Y_',
  `R$* < @ $=Y . UUCP > $*	$@ $1 < @ $2 . UUCP . > $3', `dnl')
  
  # try UUCP traffic as a local address
! R$* < @ $+ . UUCP > $*		$: $1 < @ $[ $2 $] . UUCP . > $3
! R$* < @ $+ . . UUCP . > $*		$@ $1 < @ $2 . > $3')
  ')
  # pass to name server to make hostname canonical
  ifdef(`_NO_CANONIFY_', `#')dnl
--- 594,604 ----
  ifdef(`_CLASS_Y_',
  `R$* < @ $=Y . UUCP > $*	$@ $1 < @ $2 . UUCP . > $3', `dnl')
  
+ define(`X', ifdef(`_NO_CANONIFY_', `#', `'))dnl
  # try UUCP traffic as a local address
! X`'R$* < @ $+ . UUCP > $*		$: $1 < @ $[ $2 $] . UUCP . > $3
! X`'R$* < @ $+ . . UUCP . > $*		$@ $1 < @ $2 . > $3')
! undefine(`X')dnl
  ')
  # pass to name server to make hostname canonical
  ifdef(`_NO_CANONIFY_', `#')dnl
***************
*** 604,610 ****
  # local host aliases and pseudo-domains are always canonical
  R$* < @ $=w > $*		$: $1 < @ $2 . > $3
  R$* < @ $j > $*			$: $1 < @ $j . > $2
! R$* < @ $* $=M > $*		$: $1 < @ $2 $3 . > $4
  R$* < @ $* $=P > $*		$: $1 < @ $2 $3 . > $4
  R$* < @ $* . . > $*		$1 < @ $2 . > $3
  
--- 607,615 ----
  # local host aliases and pseudo-domains are always canonical
  R$* < @ $=w > $*		$: $1 < @ $2 . > $3
  R$* < @ $j > $*			$: $1 < @ $j . > $2
! ifdef(`_MASQUERADE_ENTIRE_DOMAIN_',
! `R$* < @ $* $=M > $*		$: $1 < @ $2 $3 . > $4',
! `R$* < @ $=M > $*		$: $1 < @ $2 . > $3')
  R$* < @ $* $=P > $*		$: $1 < @ $2 $3 . > $4
  R$* < @ $* . . > $*		$1 < @ $2 . > $3
  
***************
*** 656,661 ****
--- 661,671 ----
  
  S0
  
+ R$*			$: $>Parse0 $1		initial parsing
+ R$*			$: $>98 $1		handle local hacks
+ R$*			$: $>Parse1 $1		final parsing
+ 
+ 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"
***************
*** 664,669 ****
--- 674,680 ----
  R<> $* <$* : $* > $*	$#error $@ 5.1.1 $: "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
***************
*** 672,691 ****
  	`dnl')
  
  # now delete the local info -- note $=O to find characters that cause forwarding
! R$* < @ > $*		$@ $>97 $1		user@ => user
! R< @ $=w . > : $*	$@ $>97 $2		@here:... -> ...
  R$- < @ $=w . >		$: $(dequote $1 $) < @ $2 . >	dequote "foo"@here
  R< @ $+ >		$#error $@ 5.1.1 $: "user address required"
! R$* $=O $* < @ $=w . >	$@ $>97 $1 $2 $3		...@here -> ...
! 
! # handle local hacks
! R$*			$: $>98 $1
  
  # handle virtual users
  define(`X', ifdef(`VIRTUSER_TABLE', `', `#'))dnl
  X`'R$+ < @ $=w . > 	$: < $(virtuser $1 @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
! X`'R< @ > $+ < @ $+ . >	$: < $(virtuser @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
! X`'R< @ > $+		$: $1
  X`'R< error : $- $+ > $* 	$#error $@ $( dequote $1 $) $: $2
  X`'R< $+ > $+ < @ $+ >	$: $>97 $1
  undefine(`X')dnl
--- 683,704 ----
  	`dnl')
  
  # 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$* $=O $* < @ $=w . >	$@ $>Parse0 $>3 $1 $2 $3	...@here -> ...
  
+ SParse1
  # handle virtual users
  define(`X', ifdef(`VIRTUSER_TABLE', `', `#'))dnl
  X`'R$+ < @ $=w . > 	$: < $(virtuser $1 @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
! X`'R<@> $+ + $* < @ $* . >
! 			$: < $(virtuser $1 + * @ $3 $@ $1 $: @ $) > $1 + $2 < @ $3 . >
! X`'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
***************
*** 779,804 ****
  
  # deal with plussed users so aliases work nicely
  R$+ + *			$#_LOCAL_ $@ $&h $: $1
! R$+ + $*		$#_LOCAL_ $@ $2 $: $1 + *
  
  # prepend an empty "forward host" on the front
  R$+			$: <> $1
  
  define(`X', ifdef(`LUSER_RELAY', `', `#'))dnl
  # send unrecognized local users to a relay host
- X`'R< > $+ + $*		$: < $L . > $( user $1 $) + $2
  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
  
- # handle plussed local names
- R< > $+ + $*		$#_LOCAL_ $@ $2 $: $1
- 
  # see if we have a relay or a hub
  R< > $+			$: < $H > $1			try hub
  R< > $+			$: < $R > $1			try relay
! R< > $+			$@ $1				nope, give up
  R< local : $* > $*	$: $>95 < local : $1 > $2	no host extension
  R< error : $* > $*	$: $>95 < error : $1 > $2	no host extension
  R< $- : $+ > $+		$: $>95 < $1 : $2 > $3 < @ $2 >
--- 792,817 ----
  
  # deal with plussed users so aliases work nicely
  R$+ + *			$#_LOCAL_ $@ $&h $: $1
! R$+ + $*		$#_LOCAL_ $@ + $2 $: $1 + *
  
  # prepend an empty "forward host" on the front
  R$+			$: <> $1
  
  define(`X', 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
  
  # 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 > + $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< local : $* > $*	$: $>95 < local : $1 > $2	no host extension
  R< error : $* > $*	$: $>95 < error : $1 > $2	no host extension
  R< $- : $+ > $+		$: $>95 < $1 : $2 > $3 < @ $2 >
***************
*** 840,854 ****
  R< $* > $* < @ $* . >		$: < $1 > $2 < @ $3 >
  
  # handle local: syntax -- use old user, either with or without host
! R< > $* < @ $* > $*		$#local $@ $1@$2 $: $1
! R< > $+				$#local $@ $1    $: $1
  
  # handle local:user@host syntax -- ignore host part
! R< $+ @ $+ > $*			$: < $1 > $3
  
  # handle local:user syntax
! R< $+ > $* <@ $* > $*		$#local $@ $2@$3 $: $1
! R< $+ > $* 			$#local $@ $2    $: $1
  
  ###################################################################
  ###  Ruleset 93 -- convert header names to masqueraded form	###
--- 853,867 ----
  R< $* > $* < @ $* . >		$: < $1 > $2 < @ $3 >
  
  # handle local: syntax -- use old user, either with or without host
! R< > $* < @ $* > $*		$#_LOCAL_ $@ $1@$2 $: $1
! R< > $+				$#_LOCAL_ $@ $1    $: $1
  
  # handle local:user@host syntax -- ignore host part
! R< $+ @ $+ > $* < @ $* >	$: < $1 > $3 < @ $4 >
  
  # handle local:user syntax
! R< $+ > $* <@ $* > $*		$#_LOCAL_ $@ $2@$3 $: $1
! R< $+ > $* 			$#_LOCAL_ $@ $2    $: $1
  
  ###################################################################
  ###  Ruleset 93 -- convert header names to masqueraded form	###
diff -Ncr sendmail-8.8.5/cf/m4/version.m4 sendmail-8.8.6/cf/m4/version.m4
*** sendmail-8.8.5/cf/m4/version.m4	Tue Jan 21 08:43:31 1997
--- sendmail-8.8.6/cf/m4/version.m4	Sat Jun 14 08:22:08 1997
***************
*** 32,39 ****
  # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  # SUCH DAMAGE.
  #
! VERSIONID(`@(#)version.m4	8.8.5.3 (Berkeley) 1/21/97')
  #
  divert(0)
  # Configuration version number
! DZ8.8.5`'ifdef(`confCF_VERSION', `/confCF_VERSION')
--- 32,39 ----
  # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  # SUCH DAMAGE.
  #
! VERSIONID(`@(#)version.m4	8.8.6.1 (Berkeley) 6/14/97')
  #
  divert(0)
  # Configuration version number
! DZ8.8.6`'ifdef(`confCF_VERSION', `/confCF_VERSION')
diff -Ncr sendmail-8.8.5/cf/mailer/mail11.m4 sendmail-8.8.6/cf/mailer/mail11.m4
*** sendmail-8.8.5/cf/mailer/mail11.m4	Tue May 23 12:05:20 1995
--- sendmail-8.8.6/cf/mailer/mail11.m4	Mon Apr  7 14:39:40 1997
***************
*** 15,26 ****
  ifdef(`MAIL11_MAILER_FLAGS',, `define(`MAIL11_MAILER_FLAGS', nsFx)')
  ifdef(`MAIL11_MAILER_ARGS',, `define(`MAIL11_MAILER_ARGS', mail11 $g $x $h $u)')
  define(`_USE_DECNET_SYNTAX_')
  
  POPDIVERT
  
  PUSHDIVERT(3)
  # DECNET delivery
! R$* < @ $=w .DECNET. >		$#local $: $1			local DECnet
  R$+ < @ $+ .DECNET. >		$#mail11 $@ $2 $: $1		DECnet user
  POPDIVERT
  
--- 15,27 ----
  ifdef(`MAIL11_MAILER_FLAGS',, `define(`MAIL11_MAILER_FLAGS', nsFx)')
  ifdef(`MAIL11_MAILER_ARGS',, `define(`MAIL11_MAILER_ARGS', mail11 $g $x $h $u)')
  define(`_USE_DECNET_SYNTAX_')
+ define(`_LOCAL_', ifdef(`confLOCAL_MAILER', confLOCAL_MAILER, `local'))
  
  POPDIVERT
  
  PUSHDIVERT(3)
  # DECNET delivery
! R$* < @ $=w .DECNET. >		$#_LOCAL_ $: $1			local DECnet
  R$+ < @ $+ .DECNET. >		$#mail11 $@ $2 $: $1		DECnet user
  POPDIVERT
  
***************
*** 32,38 ****
  ###   UTK-MAIL11 Mailer specification   ###
  ###########################################
  
! VERSIONID(`@(#)mail11.m4	8.1 (Berkeley) 5/23/95')
  
  Mmail11, P=MAIL11_MAILER_PATH, F=MAIL11_MAILER_FLAGS, S=15, R=25,
  	A=MAIL11_MAILER_ARGS
--- 33,39 ----
  ###   UTK-MAIL11 Mailer specification   ###
  ###########################################
  
! VERSIONID(`@(#)mail11.m4	8.4 (Berkeley) 3/18/97')
  
  Mmail11, P=MAIL11_MAILER_PATH, F=MAIL11_MAILER_FLAGS, S=15, R=25,
  	A=MAIL11_MAILER_ARGS
diff -Ncr sendmail-8.8.5/cf/mailer/procmail.m4 sendmail-8.8.6/cf/mailer/procmail.m4
*** sendmail-8.8.5/cf/mailer/procmail.m4	Thu Dec 28 07:40:54 1995
--- sendmail-8.8.6/cf/mailer/procmail.m4	Wed Apr 30 10:14:32 1997
***************
*** 38,46 ****
  		`define(`PROCMAIL_MAILER_PATH', PROCMAIL_PATH)',
  		`define(`PROCMAIL_MAILER_PATH', /usr/local/bin/procmail)')')
  ifdef(`PROCMAIL_MAILER_FLAGS',,
! 	`define(`PROCMAIL_MAILER_FLAGS', `Shu')')
  ifdef(`PROCMAIL_MAILER_ARGS',,
! 	`define(`PROCMAIL_MAILER_ARGS', `procmail -m $h $f $u')')
  
  POPDIVERT
  
--- 38,46 ----
  		`define(`PROCMAIL_MAILER_PATH', PROCMAIL_PATH)',
  		`define(`PROCMAIL_MAILER_PATH', /usr/local/bin/procmail)')')
  ifdef(`PROCMAIL_MAILER_FLAGS',,
! 	`define(`PROCMAIL_MAILER_FLAGS', `SPhnu9')')
  ifdef(`PROCMAIL_MAILER_ARGS',,
! 	`define(`PROCMAIL_MAILER_ARGS', `procmail -Y -m $h $f $u')')
  
  POPDIVERT
  
***************
*** 48,54 ****
  ###   PROCMAIL Mailer specification   ###
  ##################*****##################
  
! VERSIONID(`@(#)procmail.m4	8.5 (Berkeley) 12/28/95')
  
! Mprocmail,	P=PROCMAIL_MAILER_PATH, F=CONCAT(`DFMm', 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
--- 48,54 ----
  ###   PROCMAIL Mailer specification   ###
  ##################*****##################
  
! VERSIONID(`@(#)procmail.m4	8.6 (Berkeley) 4/30/97')
  
! 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 -Ncr sendmail-8.8.5/cf/mailer/uucp.m4 sendmail-8.8.6/cf/mailer/uucp.m4
*** sendmail-8.8.5/cf/mailer/uucp.m4	Sat Mar 23 17:00:21 1996
--- sendmail-8.8.6/cf/mailer/uucp.m4	Mon Apr  7 14:39:40 1997
***************
*** 44,50 ****
  ###   UUCP Mailer specification   ###
  #####################################
  
! VERSIONID(`@(#)uucp.m4	8.24 (Berkeley) 9/5/95')
  
  #
  #  There are innumerable variations on the UUCP mailer.  It really
--- 44,50 ----
  ###   UUCP Mailer specification   ###
  #####################################
  
! VERSIONID(`@(#)uucp.m4	8.25 (Berkeley) 3/16/97')
  
  #
  #  There are innumerable variations on the UUCP mailer.  It really
***************
*** 110,116 ****
  R:; <@>				$@
  
  R$* < @ $* . > $*		$1 < @ $2 > $3		strip trailing dots
! R$* < @ $j >			$1			strip local name
  R<@ $- . UUCP > : $+		$1 ! $2			convert to UUCP format
  R<@ $+ > : $+			$1 ! $2			convert to UUCP format
  R$* < @ $- . UUCP >		$2 ! $1			convert to UUCP format
--- 110,116 ----
  R:; <@>				$@
  
  R$* < @ $* . > $*		$1 < @ $2 > $3		strip trailing dots
! R$* < @ $=w >			$1			strip local name
  R<@ $- . UUCP > : $+		$1 ! $2			convert to UUCP format
  R<@ $+ > : $+			$1 ! $2			convert to UUCP format
  R$* < @ $- . UUCP >		$2 ! $1			convert to UUCP format
***************
*** 125,131 ****
  R:; <@>				$@
  
  R$* < @ $* . > $*		$1 < @ $2 > $3		strip trailing dots
! R$* < @ $j >			$1			strip local name
  R<@ $- . UUCP > : $+		$1 ! $2			convert to UUCP format
  R<@ $+ > : $+			$1 ! $2			convert to UUCP format
  R$* < @ $- . UUCP >		$2 ! $1			convert to UUCP format
--- 125,131 ----
  R:; <@>				$@
  
  R$* < @ $* . > $*		$1 < @ $2 > $3		strip trailing dots
! R$* < @ $=w >			$1			strip local name
  R<@ $- . UUCP > : $+		$1 ! $2			convert to UUCP format
  R<@ $+ > : $+			$1 ! $2			convert to UUCP format
  R$* < @ $- . UUCP >		$2 ! $1			convert to UUCP format
diff -Ncr sendmail-8.8.5/cf/ostype/gnuhurd.m4 sendmail-8.8.6/cf/ostype/gnuhurd.m4
*** sendmail-8.8.5/cf/ostype/gnuhurd.m4	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/cf/ostype/gnuhurd.m4	Mon Apr  7 14:39:43 1997
***************
*** 0 ****
--- 1,41 ----
+ divert(-1)
+ #
+ # Copyright (c) 1983 Eric P. Allman
+ # 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.
+ #
+ #
+ 
+ divert(0)
+ VERSIONID(`@(#)gnuhurd.m4	8.1 (Berkeley) 3/8/97')
+ 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
diff -Ncr sendmail-8.8.5/cf/ostype/irix6.m4 sendmail-8.8.6/cf/ostype/irix6.m4
*** sendmail-8.8.5/cf/ostype/irix6.m4	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/cf/ostype/irix6.m4	Fri Apr 11 10:33:36 1997
***************
*** 0 ****
--- 1,61 ----
+ divert(-1)
+ #
+ # Copyright (c) 1995 Eric P. Allman
+ # Copyright (c) 1988, 1993
+ #	The Regents of the University of California.  All rights reserved.
+ #
+ #  Contributed by Kari E. Hurtta <Kari.Hurtta@dionysos.fmi.fi>
+ #
+ # 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.
+ #
+ 
+ #
+ # Notes:
+ # - SGI's /etc/sendmail.cf defines also 'u' for local mailer flags -- you
+ #   perhaps don't want it.
+ # - Perhaps is should also add define(`LOCAL_MAILER_CHARSET', iso-8859-1)
+ #   put some Asian sites may prefer otherwise -- or perhaps not.
+ # - SGI's /etc/sendmail.cf seems use: A=mail -s -d $u
+ #   It seems work without that -s however.
+ # - SGI's /etc/sendmail.cf set's default uid and gid to 998 (guest)
+ # - In SGI seems that TZ variable is needed that correct time is marked to
+ #   syslog
+ # - helpfile is in /etc/sendmail.hf in SGI's /etc/sendmail.cf
+ #
+ 
+ divert(0)
+ VERSIONID(`@(#)irix6.m4	8.1 (Berkeley) 4/11/97')
+ 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
+ define(`ALIAS_FILE', /etc/aliases)dnl
+ 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
diff -Ncr sendmail-8.8.5/contrib/etrn.pl sendmail-8.8.6/contrib/etrn.pl
*** sendmail-8.8.5/contrib/etrn.pl	Fri Nov 22 06:55:08 1996
--- sendmail-8.8.6/contrib/etrn.pl	Sat Feb  1 16:45:28 1997
***************
*** 7,13 ****
  #
  
  # hardcoded constants, should work fine for BSD-based systems
! require 'sys/socket.ph';
  $sockaddr = 'S n a4 x8';
  
  # system requirements:
--- 7,14 ----
  #
  
  # hardcoded constants, should work fine for BSD-based systems
! use Socket;
! use Getopt::Std;
  $sockaddr = 'S n a4 x8';
  
  # system requirements:
***************
*** 61,113 ****
  $0 = "$av0 - lookup host FQDN and IP addr";
  ($hostname,$aliases,$type,$len,$thisaddr) = gethostbyname($name);
  
! push(@hosts,$hostname);
  
! $0 = "$av0 - parsing sendmail.cf";
! open(CF, "</etc/sendmail.cf") || die "open /etc/sendmail.cf: $!";
! while (<CF>){
! 	if (/^Fw.*$/){			# look for a line starting with "Fw"
! 		$cwfile = $_;
! 		chop($cwfile);
! 		$optional = /^Fw-o/;
! 		$cwfile =~ s,^Fw[^/]*,,;	# extract the file name
! 	}
! }
! close(CF);
  
! $0 = "$av0 - reading $cwfile";
! if (open(CW, "<$cwfile")){
! 	while (<CW>){
! 		$thishost = $_;
! 		chop($thishost);
! 		push(@hosts, $thishost) unless $thishost =~ $hostname;
  	}
! 	close(CW);
! } else {
!         die "open $cwfile: $!" unless optional;
! }
  
! $0 = "$av0 - parsing args";
! $usage = "Usage: $av0 [-wd] host";
! for $a (@ARGV) {
! 	die $usage if $a eq "-";
! 	while ($a =~ s/^(-.*)([wd])/$1/) {
! 		eval '$'."flag_$2 += 1";
  	}
- 	next if $a eq "-";
- 	die $usage if $a =~ /^-/;
- 	$server = $a;
  }
- $watch = $flag_w;
- $debug = $flag_d;
- 
- die $usage unless $server;
  
  $0 = "$av0 - building local socket";
  ($name,$aliases,$proto) = getprotobyname('tcp');
  ($name,$aliases,$port) = getservbyname($port,'tcp')
  	unless $port =~ /^\d+/;
- $this = pack($sockaddr, &AF_INET, 0, $thisaddr);
  
  # look it up
  $0 = "$av0 - gethostbyname($server)";
--- 62,117 ----
  $0 = "$av0 - lookup host FQDN and IP addr";
  ($hostname,$aliases,$type,$len,$thisaddr) = gethostbyname($name);
  
! $0 = "$av0 - parsing args";
! $usage = "Usage: $av0 [-wd] host [args]";
! getopts('dw');
! $watch = $opt_w;
! $debug = $opt_d;
! $server = shift(@ARGV);
! @hosts = @ARGV;
! die $usage unless $server;
  
! if (!@hosts) {
! 	push(@hosts,$hostname);
  
! 	$0 = "$av0 - parsing sendmail.cf";
! 	open(CF, "</etc/sendmail.cf") || die "open /etc/sendmail.cf: $!";
! 	while (<CF>){
! 		if (/^Fw.*$/){			# look for a line starting with "Fw"
! 			$cwfile = $_;
! 			chop($cwfile);
! 			$optional = /^Fw-o/;
! 			$cwfile =~ s,^Fw[^/]*,,;	# extract the file name
! 		}
! 		if (/^Cw(.*)$/){		# look for a line starting with "Cw"
! 			@cws = split (' ', $1);
! 			while (@cws) {
! 				$thishost = shift(@cws);
! 				push(@hosts, $thishost) unless $thishost =~ "$hostname|localhost";
! 			}
! 		}
  	}
! 	close(CF);
  
! 	if ($cwfile){
! 		$0 = "$av0 - reading $cwfile";
! 		if (open(CW, "<$cwfile")){
! 			while (<CW>){
! 				$thishost = $_;
! 				chop($thishost);
! 				push(@hosts, $thishost) unless $thishost =~ $hostname;
! 			}
! 			close(CW);
! 		} else {
! 			die "open $cwfile: $!" unless $optional;
! 		}
  	}
  }
  
  $0 = "$av0 - building local socket";
  ($name,$aliases,$proto) = getprotobyname('tcp');
  ($name,$aliases,$port) = getservbyname($port,'tcp')
  	unless $port =~ /^\d+/;
  
  # look it up
  $0 = "$av0 - gethostbyname($server)";
***************
*** 119,127 ****
  $that = pack($sockaddr, &AF_INET, $port, $thataddr);
  socket(S, &AF_INET, &SOCK_STREAM, $proto)
  	|| die "socket: $!";
- $0 = "$av0 - bind to $server";
- bind(S, $this) 
- 	|| die "bind $hostname,0: $!";
  $0 = "$av0 - connect to $server";
  print "debug = $debug server = $server\n" if $debug > 8;
  if (! connect(S, $that)) {
--- 123,128 ----
***************
*** 170,176 ****
  alarm(0);
  
  if ($etrn_support){
! 	print "ETRN supported\n" if ($debug)
  	&alarm("sending etrn to $server",'');
  	while (@hosts) {
  		$server = shift(@hosts);
--- 171,177 ----
  alarm(0);
  
  if ($etrn_support){
! 	print "ETRN supported\n" if ($debug);
  	&alarm("sending etrn to $server",'');
  	while (@hosts) {
  		$server = shift(@hosts);
***************
*** 244,250 ****
  .nr % 0
  .\\"'; __END__ 
  .\" ############## END PERL/TROFF TRANSITION
! .TH ETRN 1 "November 16, 1996"
  .AT 3
  .SH NAME
  etrn \- start mail queue run
--- 245,251 ----
  .nr % 0
  .\\"'; __END__ 
  .\" ############## END PERL/TROFF TRANSITION
! .TH ETRN 1 "January 25, 1997"
  .AT 3
  .SH NAME
  etrn \- start mail queue run
***************
*** 253,263 ****
--- 254,275 ----
  .RI [ -w ]
  .RI [ -d ]
  .IR hostname
+ .RI [ args ]
  .SH DESCRIPTION
  .B etrn
  will use the SMTP
  .B etrn
  command to start mail delivery from the host given on the command line.
+ .B etrn
+ usually sends an
+ .B etrn
+ for each host the local sendmail accepts e-mail for, but if
+ .IR args
+ are specified,
+ .B etrn
+ uses these as arguments for the SMTP
+ .B etrn
+ commands passed to the host given on the command line.
  .SH OPTIONS
  .LP
  The normal mode of operation for
***************
*** 291,296 ****
--- 303,311 ----
  It is assumed that you are running domain names.
  .SH CREDITS
  Leveraged from David Muir Sharnoff's expn.pl script.
+ Christian von Roques added support for
+ .IR args
+ and fixed a couple of bugs.
  .SH AVAILABILITY
  The latest version of 
  .B etrn
diff -Ncr sendmail-8.8.5/contrib/passwd-to-alias.pl sendmail-8.8.6/contrib/passwd-to-alias.pl
*** sendmail-8.8.5/contrib/passwd-to-alias.pl	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/contrib/passwd-to-alias.pl	Wed Mar 19 09:48:07 1997
***************
*** 0 ****
--- 1,28 ----
+ #!/bin/perl
+ 
+ #
+ #  Convert GECOS information in password files to alias syntax.
+ #
+ #  Contributed by Kari E. Hurtta <Kari.Hurtta@ozone.fmi.fi>
+ #
+ 
+ print "# Generated from passwd by $0\n";
+ 
+ while (@a = getpwent) {
+     ($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) = @a;
+ 
+     ($fullname = $gcos) =~ s/,.*$//;
+ 
+     if (!-d $dir || !-x $shell) {
+ 	print "$name: root\n";
+     }
+ 
+     $fullname =~ s/\.*[ _]+\.*/./g;
+     if ($fullname =~ /^[a-zA-Z]+(\.[a-zA-Z]+)+$/) {
+ 	print "$fullname: $name\n";
+     } else {
+ 	print "# $fullname: $name\n";
+     }
+ };
+ 
+ endpwent;
diff -Ncr sendmail-8.8.5/doc/op/op.me sendmail-8.8.6/doc/op/op.me
*** sendmail-8.8.5/doc/op/op.me	Fri Dec 13 10:50:34 1996
--- sendmail-8.8.6/doc/op/op.me	Mon Mar 10 07:34:52 1997
***************
*** 30,36 ****
  .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  .\" SUCH DAMAGE.
  .\"
! .\"	@(#)op.me	8.103 (Berkeley) 12/13/96
  .\"
  .\" eqn op.me | pic | troff -me
  .eh 'SMM:08-%''Sendmail Installation and Operation Guide'
--- 30,36 ----
  .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  .\" SUCH DAMAGE.
  .\"
! .\"	@(#)op.me	8.104 (Berkeley) 3/10/97
  .\"
  .\" eqn op.me | pic | troff -me
  .eh 'SMM:08-%''Sendmail Installation and Operation Guide'
***************
*** 67,73 ****
  Eric Allman
  eric@Sendmail.ORG
  .sp
! Version 8.103
  .sp
  For Sendmail Version 8.8
  .)l
--- 67,73 ----
  Eric Allman
  eric@Sendmail.ORG
  .sp
! Version 8.104
  .sp
  For Sendmail Version 8.8
  .)l
***************
*** 7020,7036 ****
  .pp
  The initialization function is called as
  .(b
! \fIxxx\fP_map_init(MAP *map, char *mapname, char *args)
  .)b
  The
  .i map
  is an internal data structure.
  The
- .i mapname
- is the name of the map (used for error messages).
- The
  .i args
! is a pointer to the rest of the configuration file line;
  flags and filenames can be extracted from this line.
  The initialization function must return
  .sm TRUE
--- 7020,7034 ----
  .pp
  The initialization function is called as
  .(b
! \fIxxx\fP_map_init(MAP *map, char *args)
  .)b
  The
  .i map
  is an internal data structure.
  The
  .i args
! is a pointer to the portion of the configuration file line
! following the map class name;
  flags and filenames can be extracted from this line.
  The initialization function must return
  .sm TRUE
***************
*** 7040,7055 ****
  .pp
  The lookup function is called as
  .(b
! \fIxxx\fP_map_lookup(MAP *map, char buf[], int bufsize, char **av, int *statp)
  .)b
  The
  .i map
  defines the map internally.
! The parameters
  .i buf
! and
! .i bufsize
! have the input key.
  This may be (and often is) used destructively.
  The
  .i av
--- 7038,7051 ----
  .pp
  The lookup function is called as
  .(b
! \fIxxx\fP_map_lookup(MAP *map, char buf[], char **av, int *statp)
  .)b
  The
  .i map
  defines the map internally.
! The
  .i buf
! has the input key.
  This may be (and often is) used destructively.
  The
  .i av
***************
*** 8163,8169 ****
  .\".sz 10
  .\"Eric Allman
  .\".sp
! .\"Version 8.103
  .\".ce 0
  .bp 3
  .ce
--- 8159,8165 ----
  .\".sz 10
  .\"Eric Allman
  .\".sp
! .\"Version 8.104
  .\".ce 0
  .bp 3
  .ce
diff -Ncr sendmail-8.8.5/mail.local/Makefile.dist sendmail-8.8.6/mail.local/Makefile.dist
*** sendmail-8.8.5/mail.local/Makefile.dist	Wed Sep 25 08:39:20 1996
--- sendmail-8.8.6/mail.local/Makefile.dist	Wed Feb 19 10:44:57 1997
***************
*** 1,13 ****
! #	@(#)Makefile.dist	8.3 (Berkeley) 9/25/96
  
  BINDIR=	${DESTDIR}/usr/lib
  BINOWN=	root
  BINMODE=4555
  
  # For Solaris, uncomment one of the CC= lines and the LIBS= line
  #CC=	cc -Xc
  #CC=	gcc
  #LIBS=	-lsocket -lnsl
  
  # Which *roff program has -mandoc support
  NROFF=	groff -Tascii
--- 1,15 ----
! #	@(#)Makefile.dist	8.4 (Berkeley) 2/19/97
  
  BINDIR=	${DESTDIR}/usr/lib
  BINOWN=	root
  BINMODE=4555
  
  # For Solaris, uncomment one of the CC= lines and the LIBS= line
+ # Also, if you're running 2.6 or later, uncomment the ENVDEF= line
  #CC=	cc -Xc
  #CC=	gcc
  #LIBS=	-lsocket -lnsl
+ #ENVDEF=	-DSOLARIS=20600
  
  # Which *roff program has -mandoc support
  NROFF=	groff -Tascii
***************
*** 19,25 ****
  all: ${ALL}
  
  mail.local: mail.local.c
! 	${CC} -O -o mail.local mail.local.c ${LIBS}
  
  mail.local.0: mail.local.8
  	${NROFF} ${MANDOC} mail.local.8 > mail.local.0
--- 21,27 ----
  all: ${ALL}
  
  mail.local: mail.local.c
! 	${CC} -O -o mail.local ${ENVDEF} mail.local.c ${LIBS}
  
  mail.local.0: mail.local.8
  	${NROFF} ${MANDOC} mail.local.8 > mail.local.0
diff -Ncr sendmail-8.8.5/mail.local/mail.local.0 sendmail-8.8.6/mail.local/mail.local.0
*** sendmail-8.8.5/mail.local/mail.local.0	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/mail.local/mail.local.0	Sun Nov 10 13:05:14 1996
***************
*** 0 ****
--- 1,47 ----
+ MAIL.LOCAL(8)             BSD System Manager's Manual            MAIL.LOCAL(8)
+ 
+ NNAAMMEE
+      mmaaiill..llooccaall - store mail in a mailbox
+ 
+ SSYYNNOOPPSSIISS
+      mmaaiill..llooccaall [--ff _f_r_o_m] _u_s_e_r _._._.
+ 
+ DDEESSCCRRIIPPTTIIOONN
+      MMaaiill..llooccaall reads the standard input up to an end-of-file and appends it
+      to each _u_s_e_r_'_s _m_a_i_l file.  The _u_s_e_r must be a valid user name.
+ 
+      The options are as follows:
+ 
+      --ff _f_r_o_m  Specify the sender's name.
+ 
+      Individual mail messages in the mailbox are delimited by an empty line
+      followed by a line beginning with the string ``From ''.  A line contain-
+      ing the string ``From '', the sender's name and a time stamp is prepended
+      to each delivered mail message.  A blank line is appended to each mes-
+      sage.  A greater-than character (``>'') is prepended to any line in the
+      message which could be mistaken for a ``From '' delimiter line.
+ 
+      The mail files are exclusively locked with flock(2) while mail is append-
+      ed.
+ 
+      If the ``biff'' service is returned by getservbyname(3),  the biff server
+      is notified of delivered mail.
+ 
+      The mmaaiill..llooccaall utility exits 0 on success, and >0 if an error occurs.
+ 
+ EENNVVIIRROONNMMEENNTT
+      TZ      Used to set the appropriate time zone on the timestamp.
+ 
+ FFIILLEESS
+      /tmp/local.XXXXXX  temporary files
+      /var/mail/user     user's mailbox directory
+ 
+ SSEEEE AALLSSOO
+      mail(1),  xsend(1),  flock(2),  getservbyname(3),  comsat(8),  send-
+      mail(8)
+ 
+ HHIISSTTOORRYY
+      A superset of mmaaiill..llooccaall (handling mailbox reading as well as mail deliv-
+      ery) appeared in Version 7 AT&T UNIX.  as the program mmaaiill.
+ 
+ BSDI BSD/OS                    December 11, 1993                             1
diff -Ncr sendmail-8.8.5/mail.local/mail.local.c sendmail-8.8.6/mail.local/mail.local.c
*** sendmail-8.8.5/mail.local/mail.local.c	Sun Nov 24 14:15:27 1996
--- sendmail-8.8.6/mail.local/mail.local.c	Wed May 28 08:46:15 1997
***************
*** 38,44 ****
  #endif /* not lint */
  
  #ifndef lint
! static char sccsid[] = "@(#)mail.local.c	8.34 (Berkeley) 11/24/96";
  #endif /* not lint */
  
  /*
--- 38,44 ----
  #endif /* not lint */
  
  #ifndef lint
! static char sccsid[] = "@(#)mail.local.c	8.39 (Berkeley) 5/28/97";
  #endif /* not lint */
  
  /*
***************
*** 86,91 ****
--- 86,92 ----
  
  #if defined(_AIX)
  # define USE_LOCKF	1
+ # define USET_SETEUID	1
  # define USE_VSYSLOG	0
  #endif
  
***************
*** 146,154 ****
  # define _BSD_VA_LIST_	va_list
  #endif
  
  #if !defined(BSD4_4) && !defined(linux)
  extern char	*strerror __P((int));
! extern int	snprintf __P((char *, int, const char *, ...));
  extern FILE	*fdopen __P((int, const char *));
  #endif
  
--- 147,163 ----
  # define _BSD_VA_LIST_	va_list
  #endif
  
+ #if defined(BSD4_4) || defined(linux)
+ # define HASSNPRINTF	1
+ #endif
+ 
+ #if SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206)
+ # define HASSNPRINTF	1		/* has snprintf starting in 2.6 */
+ #endif
+ 
  #if !defined(BSD4_4) && !defined(linux)
  extern char	*strerror __P((int));
! extern int	snprintf __P((char *, size_t, const char *, ...));
  extern FILE	*fdopen __P((int, const char *));
  #endif
  
***************
*** 374,382 ****
  	 */
  tryagain:
  	lockmbox(path);
! 	if (lstat(path, &sb)) {
  		mbfd = open(path,
  		    O_APPEND|O_CREAT|O_EXCL|O_WRONLY, S_IRUSR|S_IWUSR);
  		if (mbfd == -1) {
  			if (errno == EEXIST)
  				goto tryagain;
--- 383,395 ----
  	 */
  tryagain:
  	lockmbox(path);
! 	if (lstat(path, &sb) < 0) {
  		mbfd = open(path,
  		    O_APPEND|O_CREAT|O_EXCL|O_WRONLY, S_IRUSR|S_IWUSR);
+ 		if (lstat(path, &sb) < 0)
+ 			goto filechanged;
+ 		else
+ 			sb.st_uid = pw->pw_uid;
  		if (mbfd == -1) {
  			if (errno == EEXIST)
  				goto tryagain;
***************
*** 395,414 ****
  		goto err0;
  	} else {
  		mbfd = open(path, O_APPEND|O_WRONLY, 0);
- 		if (mbfd != -1 &&
- 		    (fstat(mbfd, &fsb) || fsb.st_nlink != 1 ||
- 		    !S_ISREG(fsb.st_mode) || sb.st_dev != fsb.st_dev ||
- 		    sb.st_ino != fsb.st_ino || sb.st_uid != fsb.st_uid)) {
- 			eval = EX_CANTCREAT;
- 			warn("%s: file changed after open", path);
- 			goto err1;
- 		}
  	}
  
  	if (mbfd == -1) {
  		e_to_sys(errno);
  		warn("%s: %s", path, strerror(errno));
  		goto err0;
  	}
  
  	/* Wait until we can get a lock on the file. */
--- 408,427 ----
  		goto err0;
  	} else {
  		mbfd = open(path, O_APPEND|O_WRONLY, 0);
  	}
  
  	if (mbfd == -1) {
  		e_to_sys(errno);
  		warn("%s: %s", path, strerror(errno));
  		goto err0;
+ 	} else if (fstat(mbfd, &fsb) < 0 ||
+ 	    fsb.st_nlink != 1 || sb.st_nlink != 1 ||
+ 	    !S_ISREG(fsb.st_mode) || sb.st_dev != fsb.st_dev ||
+ 	    sb.st_ino != fsb.st_ino || sb.st_uid != fsb.st_uid) {
+ filechanged:
+ 		eval = EX_CANTCREAT;
+ 		warn("%s: file changed after open", path);
+ 		goto err1;
  	}
  
  	/* Wait until we can get a lock on the file. */
***************
*** 474,482 ****
  	if (close(mbfd)) {
  		e_to_sys(errno);
  		warn("%s: %s", path, strerror(errno));
! 		unlockmbox();
! 		return;
! 	}
  
  	if (setreuid(0, 0) < 0) {
  		e_to_sys(errno);
--- 487,495 ----
  	if (close(mbfd)) {
  		e_to_sys(errno);
  		warn("%s: %s", path, strerror(errno));
! 		truncate(path, curoff);
! 	} else
! 		notifybiff(biffmsg);
  
  	if (setreuid(0, 0) < 0) {
  		e_to_sys(errno);
***************
*** 486,492 ****
  	printf("reset euid = %d\n", geteuid());
  #endif
  	unlockmbox();
- 	notifybiff(biffmsg);
  }
  
  /*
--- 499,504 ----
***************
*** 507,512 ****
--- 519,526 ----
  
  	if (locked)
  		return;
+ 	if (strlen(path) + 6 > sizeof lockname)
+ 		return;
  	sprintf(lockname, "%s.lock", path);
  	for (;; sleep(5)) {
  		int fd;
***************
*** 761,776 ****
  	return ebuf;
  }
  
! # endif
  
! #if !defined(BSD4_4) && !defined(linux)
  
  # if __STDC__
! snprintf(char *buf, int bufsiz, const char *fmt, ...)
  # else
  snprintf(buf, bufsiz, fmt, va_alist)
  	char *buf;
! 	int bufsiz;
  	const char *fmt;
  	va_dcl
  # endif
--- 775,790 ----
  	return ebuf;
  }
  
! #endif /* !defined(BSD4_4) && !defined(__osf__) */
  
! #if !HASSNPRINTF
  
  # if __STDC__
! snprintf(char *buf, size_t bufsiz, const char *fmt, ...)
  # else
  snprintf(buf, bufsiz, fmt, va_alist)
  	char *buf;
! 	size_t bufsiz;
  	const char *fmt;
  	va_dcl
  # endif
***************
*** 786,792 ****
  	va_end(ap);
  }
  
! #endif
  
  #ifdef ultrix
  
--- 800,806 ----
  	va_end(ap);
  }
  
! #endif /* !HASSNPRINTF */
  
  #ifdef ultrix
  
***************
*** 879,885 ****
  			break;
  		if (*trv == '/') {
  			*trv = '\0';
! 			if (stat(path, &sbuf))
  				return(0);
  			if (!S_ISDIR(sbuf.st_mode)) {
  				errno = ENOTDIR;
--- 893,899 ----
  			break;
  		if (*trv == '/') {
  			*trv = '\0';
! 			if (stat(path, &sbuf) < 0)
  				return(0);
  			if (!S_ISDIR(sbuf.st_mode)) {
  				errno = ENOTDIR;
***************
*** 898,904 ****
  			if (errno != EEXIST)
  				return(0);
  		}
! 		else if (stat(path, &sbuf))
  			return(errno == ENOENT ? 1 : 0);
  
  		/* tricky little algorithm for backward compatibility */
--- 912,918 ----
  			if (errno != EEXIST)
  				return(0);
  		}
! 		else if (stat(path, &sbuf) < 0)
  			return(errno == ENOENT ? 1 : 0);
  
  		/* tricky little algorithm for backward compatibility */
***************
*** 919,922 ****
  	/*NOTREACHED*/
  }
  
! #endif
--- 933,936 ----
  	/*NOTREACHED*/
  }
  
! #endif /* ultrix */
diff -Ncr sendmail-8.8.5/mailstats/mailstats.0 sendmail-8.8.6/mailstats/mailstats.0
*** sendmail-8.8.5/mailstats/mailstats.0	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/mailstats/mailstats.0	Sat Sep 21 17:14:59 1996
***************
*** 0 ****
--- 1,47 ----
+ MAILSTATS(1)                 BSD Reference Manual                 MAILSTATS(1)
+ 
+ NNAAMMEE
+      mmaaiillssttaattss - display mail statistics
+ 
+ SSYYNNOOPPSSIISS
+      mmaaiillssttaattss [--oo] [--CC _c_f_f_i_l_e] [--ff _s_t_f_i_l_e]
+ 
+ DDEESSCCRRIIPPTTIIOONN
+      The mmaaiillssttaattss utility displays the current mail statistics.
+ 
+      First, the time at which statistics started being kept is displayed, in
+      the format specified by ctime(3).  Then, the statistics for each mailer
+      are displayed on a single line, each with the following whitespace sepa-
+      rated fields:
+ 
+            MM           The mailer number.
+            mmssggssffrr      Number of messages from the mailer.
+            bbyytteess__ffrroomm  Kbytes from the mailer.
+            mmssggssttoo      Number of messages to the mailer.
+            bbyytteess__ttoo    Kbytes to the mailer.
+            MMaaiilleerr      The name of the mailer.
+ 
+      After this display, a line totaling the values for all of the mailers is
+      displayed, separated from the previous information by a line containing
+      only equals (``='') characters.
+ 
+      The options are as follows:
+ 
+      --CC      Read the specified file instead of the default sseennddmmaaiill ``cf''
+              file.
+ 
+      --ff      Read the specified statistics file instead of the statistics file
+              specified in the sseennddmmaaiill ``cf'' file.
+ 
+      --oo      Don't display the name of the mailer in the output.
+ 
+      The mmaaiillssttaattss utility exits 0 on success, and >0 if an error occurs.
+ 
+ FFIILLEESS
+      /etc/sendmail.cf        The default sseennddmmaaiill ``cf'' file.
+      /var/log/sendmail.st    The default sseennddmmaaiill statistics file.
+ 
+ SSEEEE AALLSSOO
+      mailq(1),  sendmail(8)
+ 
+ 3rd Berkeley Distribution       April 25, 1996                               1
diff -Ncr sendmail-8.8.5/mailstats/mailstats.c sendmail-8.8.6/mailstats/mailstats.c
*** sendmail-8.8.5/mailstats/mailstats.c	Wed Sep 25 08:37:36 1996
--- sendmail-8.8.6/mailstats/mailstats.c	Fri May 30 12:05:20 1997
***************
*** 40,46 ****
  #endif /* not lint */
  
  #ifndef lint
! static char sccsid[] = "@(#)mailstats.c	8.8 (Berkeley) 9/25/96";
  #endif /* not lint */
  
  #define NOT_SENDMAIL
--- 40,46 ----
  #endif /* not lint */
  
  #ifndef lint
! static char sccsid[] = "@(#)mailstats.c	8.10 (Berkeley) 5/30/97";
  #endif /* not lint */
  
  #define NOT_SENDMAIL
***************
*** 66,72 ****
  	bool mnames;
  	long frmsgs = 0, frbytes = 0, tomsgs = 0, tobytes = 0;
  	char mtable[MAXMAILERS][MNAMELEN+1];
! 	char sfilebuf[100];
  	char buf[MAXLINE];
  	extern char *ctime();
  
--- 66,72 ----
  	bool mnames;
  	long frmsgs = 0, frbytes = 0, tomsgs = 0, tobytes = 0;
  	char mtable[MAXMAILERS][MNAMELEN+1];
! 	char sfilebuf[MAXLINE];
  	char buf[MAXLINE];
  	extern char *ctime();
  
***************
*** 145,150 ****
--- 145,157 ----
  			}
  
  			/* this is the S or StatusFile option -- save it */
+ 			if (strlen(b) >= sizeof sfilebuf)
+ 			{
+ 				fprintf(stderr,
+ 					"StatusFile filename too long: %.30s...\n",
+ 					s);
+ 				exit(EX_CONFIG);
+ 			}
  			strcpy(sfilebuf, b);
  			b = strchr(sfilebuf, '#');
  			if (b == NULL)
diff -Ncr sendmail-8.8.5/makemap/Makefile sendmail-8.8.6/makemap/Makefile
*** sendmail-8.8.5/makemap/Makefile	Wed Dec 18 11:19:32 1996
--- sendmail-8.8.6/makemap/Makefile	Tue Jun 10 16:03:15 1997
***************
*** 1,8 ****
! #	@(#)Makefile	8.1 (Berkeley) 6/7/93
  
  PROG=	makemap
  MAN8=	makemap.0
! CFLAGS+=-I${.CURDIR}/../src -DNDBM -DNEWDB
  
  .include "../../Makefile.inc"
  .include <bsd.prog.mk>
--- 1,13 ----
! #	@(#)Makefile	8.4 (Berkeley) 6/10/97
  
  PROG=	makemap
  MAN8=	makemap.0
! CFLAGS+=-I${.CURDIR}/../src -DNEWDB -DNOT_SENDMAIL
! 
! SRCS=	makemap.c safefile.c
! 
! safefile.c: ${.CURDIR}/../src/safefile.c
! 	ln -s ${.CURDIR}/../src/safefile.c
  
  .include "../../Makefile.inc"
  .include <bsd.prog.mk>
diff -Ncr sendmail-8.8.5/makemap/Makefile.dist sendmail-8.8.6/makemap/Makefile.dist
*** sendmail-8.8.5/makemap/Makefile.dist	Wed Dec 18 11:20:19 1996
--- sendmail-8.8.6/makemap/Makefile.dist	Tue Jun 10 16:03:15 1997
***************
*** 5,11 ****
  #  old make program (I recommend that you get and port the new make if you
  #  are going to be doing any signficant work on sendmail).
  #
! #	@(#)Makefile.dist	8.5 (Berkeley) 12/18/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 5,11 ----
  #  old make program (I recommend that you get and port the new make if you
  #  are going to be doing any signficant work on sendmail).
  #
! #	@(#)Makefile.dist	8.7 (Berkeley) 6/10/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 22,28 ****
  DBMDEF=	-DNDBM -DNEWDB
  
  # environment definitions (e.g., -D_AIX3)
! ENVDEF=
  
  # see also conf.h for additional compilation flags
  
--- 22,28 ----
  DBMDEF=	-DNDBM -DNEWDB
  
  # environment definitions (e.g., -D_AIX3)
! ENVDEF= -DNOT_SENDMAIL
  
  # see also conf.h for additional compilation flags
  
***************
*** 48,54 ****
  
  CFLAGS=	-I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
  
! OBJS=	makemap.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
  BINOWN=	bin
--- 48,54 ----
  
  CFLAGS=	-I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
  
! OBJS=	makemap.o safefile.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
  BINOWN=	bin
***************
*** 61,66 ****
--- 61,69 ----
  
  makemap: ${BEFORE} ${OBJS}
  	${CC} -o makemap ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
+ 
+ safefile.c: ${SRCDIR}/safefile.c
+ 	ln -s ${SRCDIR}/safefile.c safefile.c
  
  #NROFF= nroff -h
  NROFF=  groff -Tascii
diff -Ncr sendmail-8.8.5/makemap/makemap.0 sendmail-8.8.6/makemap/makemap.0
*** sendmail-8.8.5/makemap/makemap.0	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/makemap/makemap.0	Sat Sep 21 17:15:01 1996
***************
*** 0 ****
--- 1,58 ----
+ MAKEMAP(8)                BSD System Manager's Manual               MAKEMAP(8)
+ 
+ NNAAMMEE
+      mmaakkeemmaapp - create database maps for sendmail
+ 
+ SSYYNNOOPPSSIISS
+      mmaakkeemmaapp [--NN] [--dd] [--ff] [--oo] [--rr] [--vv] _m_a_p_t_y_p_e _m_a_p_n_a_m_e
+ 
+ DDEESSCCRRIIPPTTIIOONN
+      mmaakkeemmaapp creates the database maps used by the keyed map lookups in
+      sendmail(8).  It reads input from the standard input and outputs them to
+      the indicated _m_a_p_n_a_m_e.
+ 
+      Depending on how it is compiled, mmaakkeemmaapp handles up to three different
+      database formats, selected using the _m_a_p_t_y_p_e parameter.  They may be
+ 
+      dbm         DBM format maps.  This requires the ndbm(3) library.
+ 
+      btree       B-Tree format maps.  This requires the new Berkeley db(3) li-
+                  brary.
+ 
+      hash        Hash format maps.  This also requires the db(3) library.
+ 
+      In all cases, mmaakkeemmaapp reads lines from the standard input consisting of
+      two words separated by white space.  The first is the database key, the
+      second is the value.  The value may contain ``%_n'' strings to indicated
+      parameter substitution.  Literal parentheses should be doubled (``%%'').
+      Blank lines and lines beginning with ``#'' are ignored.
+ 
+    FFllaaggss
+ 
+      --NN          Include the null byte that terminates strings in the map.
+                  This must match the -N flag in the sendmail.cf ``K'' line.
+ 
+      --dd          Allow duplicate keys in the map.  This is only allowed on B-
+                  Tree format maps.  If two identical keys are read, they will
+                  both be inserted into the map.
+ 
+      --ff          Normally all upper case letters in the key are folded to low-
+                  er case.  This flag disables that behaviour.  This is intend-
+                  ed to mesh with the -f flag in the KK line in sendmail.cf.
+                  The value is never case folded.
+ 
+      --oo          Append to an old file.  This allows you to augment an exist-
+                  ing file.
+ 
+      --rr          Allow replacement of existing keys.  Normally mmaakkeemmaapp com-
+                  plains if you repeat a key, and does not do the insert.
+ 
+      --vv          Verbosely print what it is doing.
+ 
+ SSEEEE AALLSSOO
+      sendmail(8)
+ 
+ HHIISSTTOORRYY
+      The mmaakkeemmaapp command appeared in 4.4BSD.
+ 
+ 4.4BSD                         November 16, 1992                             1
diff -Ncr sendmail-8.8.5/makemap/makemap.c sendmail-8.8.6/makemap/makemap.c
*** sendmail-8.8.5/makemap/makemap.c	Mon Nov 18 07:41:59 1996
--- sendmail-8.8.6/makemap/makemap.c	Tue Jun 10 16:03:15 1997
***************
*** 33,53 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)makemap.c	8.19 (Berkeley) 11/18/96";
  #endif /* not lint */
  
- #include <stdio.h>
- #include <sysexits.h>
  #include <sys/types.h>
- #include <ctype.h>
- #include <string.h>
  #include <sys/errno.h>
  #ifndef ISC_UNIX
  # include <sys/file.h>
  #endif
! #define NOT_SENDMAIL
! #include "useful.h"
! #include "conf.h"
  
  #ifdef NDBM
  #include <ndbm.h>
--- 33,47 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)makemap.c	8.35 (Berkeley) 6/10/97";
  #endif /* not lint */
  
  #include <sys/types.h>
  #include <sys/errno.h>
  #ifndef ISC_UNIX
  # include <sys/file.h>
  #endif
! #include "sendmail.h"
  
  #ifdef NDBM
  #include <ndbm.h>
***************
*** 74,79 ****
--- 68,84 ----
  	} xx;
  };
  
+ uid_t	RealUid;
+ gid_t	RealGid;
+ char	*RealUserName;
+ uid_t	RunAsUid;
+ uid_t	RunAsGid;
+ char	*RunAsUserName;
+ int	Verbose = 2;
+ bool	DontInitGroups = TRUE;
+ bool	UnsafeGroupWrites = FALSE;
+ u_char	tTdvect[100];
+ 
  #define BUFSIZE		1024
  
  main(argc, argv)
***************
*** 87,98 ****
  	bool allowdups = FALSE;
  	bool verbose = FALSE;
  	bool foldcase = TRUE;
  	int exitstat;
  	int opt;
  	char *typename;
  	char *mapname;
  	char *ext;
- 	char *lext;
  	int lineno;
  	int st;
  	int mode;
--- 92,103 ----
  	bool allowdups = FALSE;
  	bool verbose = FALSE;
  	bool foldcase = TRUE;
+ 	bool ignoresafeties = FALSE;
  	int exitstat;
  	int opt;
  	char *typename;
  	char *mapname;
  	char *ext;
  	int lineno;
  	int st;
  	int mode;
***************
*** 117,131 ****
  #endif
  	char ibuf[BUFSIZE];
  	char fbuf[MAXNAME];
! 	char lbuf[MAXNAME];
  	extern char *optarg;
  	extern int optind;
  	extern bool lockfile();
  
  	progname = argv[0];
  
! #ifdef FFR_CFLAG
! #define OPTIONS		"Nc:dforv"
  #else
  #define OPTIONS		"Ndforv"
  #endif
--- 122,154 ----
  #endif
  	char ibuf[BUFSIZE];
  	char fbuf[MAXNAME];
! 	char dbuf[MAXNAME];
! 	char pbuf[MAXNAME];
! 	static char rnamebuf[MAXNAME];	/* holds RealUserName */
! 	struct passwd *pw;
! 	int sff = SFF_ROOTOK|SFF_REGONLY|SFF_NOLINK|SFF_NOWLINK;
! 	struct stat std, stp;
  	extern char *optarg;
  	extern int optind;
  	extern bool lockfile();
  
  	progname = argv[0];
  
! 	RunAsUid = RealUid = getuid();
! 	RunAsGid = RealGid = getgid();
! 	pw = getpwuid(RealUid);
! 	if (pw != NULL) 
! 	{
! 		if (strlen(pw->pw_name) > MAXNAME - 1)
! 			pw->pw_name[MAXNAME] = 0;
! 		sprintf(rnamebuf, "%s", pw->pw_name);
! 	}
! 	else
! 		sprintf(rnamebuf, "Unknown UID %d", RealUid);
! 	RunAsUserName = RealUserName = rnamebuf;
! 
! #if _FFR_NEW_MAKEMAP_FLAGS
! #define OPTIONS		"Nc:dforsv"
  #else
  #define OPTIONS		"Ndforv"
  #endif
***************
*** 137,143 ****
  			inclnull = TRUE;
  			break;
  
! #ifdef FFR_CFLAG
  		  case 'c':
  			dbcachesize = atol(optarg);
  			break;
--- 160,166 ----
  			inclnull = TRUE;
  			break;
  
! #if _FFR_NEW_MAKEMAP_FLAGS
  		  case 'c':
  			dbcachesize = atol(optarg);
  			break;
***************
*** 159,164 ****
--- 182,193 ----
  			allowreplace = TRUE;
  			break;
  
+ #if _FFR_NEW_MAKEMAP_FLAGS
+ 		  case 's':
+ 			ignoresafeties = TRUE;
+ 			break;
+ #endif
+ 
  		  case 'v':
  			verbose = TRUE;
  			break;
***************
*** 178,189 ****
  		typename = argv[0];
  		mapname = argv[1];
  		ext = NULL;
- 		lext = NULL;
  
  		if (strcmp(typename, "dbm") == 0)
  		{
  			type = T_DBM;
- 			lext = ".dir";
  		}
  		else if (strcmp(typename, "btree") == 0)
  		{
--- 207,216 ----
***************
*** 202,209 ****
  	switch (type)
  	{
  	  case T_ERR:
! #ifdef FFR_CFLAG
! 		fprintf(stderr, "Usage: %s [-N] [-c cachesize] [-d] [-f] [-o] [-r] [-v] type mapname\n", progname);
  #else
  		fprintf(stderr, "Usage: %s [-N] [-d] [-f] [-o] [-r] [-v] type mapname\n", progname);
  #endif
--- 229,238 ----
  	switch (type)
  	{
  	  case T_ERR:
! #if _FFR_NEW_MAKEMAP_FLAGS
! 		fprintf(stderr,
! 			"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);
  #endif
***************
*** 270,275 ****
--- 299,309 ----
  
  		el = strlen(ext);
  		fl = strlen(mapname);
+ 		if (el + fl + 1 >= sizeof fbuf)
+ 		{
+ 			fprintf(stderr, "%s: file name too long", mapname);
+ 			exit(EX_USAGE);
+ 		}
  		if (fl < el || strcmp(&mapname[fl - el], ext) != 0)
  		{
  			strcpy(fbuf, mapname);
***************
*** 278,286 ****
  		}
  	}
  
! 	strcpy(lbuf, mapname);
! 	if (lext != NULL)
! 		strcat(lbuf, lext);
  
  	/*
  	**  Create the database.
--- 312,379 ----
  		}
  	}
  
! 	if (!notrunc)
! 		sff |= SFF_CREAT;
! 	switch (type) 
! 	{
! #ifdef NEWDB
! 	  case T_BTREE:
! 	  case T_HASH:
! 		if (strlen(mapname) >= sizeof dbuf)
! 		{
! 			fprintf(stderr,
! 				"%s: map name too long\n", mapname);
! 			exit(EX_USAGE);
! 		}
! 		strcpy(dbuf, mapname);
! 		if (!ignoresafeties &&
! 		    (st = safefile(dbuf, RealUid, RealGid, RealUserName,
! 				   sff, S_IWUSR, &std)) != 0) 
! 		{
! 			fprintf(stderr,
! 				"%s: could not create: %s\n",
! 				dbuf, errstring(st));
! 			exit(EX_CANTCREAT);
! 		}
! 		break;
! #endif
! #ifdef NDBM
! 	  case T_DBM:
! 		if (strlen(mapname) + 5 > sizeof dbuf)
! 		{
! 			fprintf(stderr,
! 				"%s: map name too long\n", mapname);
! 			exit(EX_USAGE);
! 		}
! 		sprintf(dbuf, "%s.dir", mapname);
! 		if (!ignoresafeties &&
! 		    (st = safefile(dbuf, RealUid, RealGid, RealUserName,
! 				   sff, S_IWUSR, &std)) != 0) 
! 		{
! 			fprintf(stderr,
! 				"%s: could not create: %s\n",
! 				dbuf, errstring(st));
! 			exit(EX_CANTCREAT);
! 		}
! 		sprintf(pbuf, "%s.pag", mapname);
! 		if (!ignoresafeties &&
! 		    (st = safefile(pbuf, RealUid, RealGid, RealUserName,
! 				   sff, S_IWUSR, &stp)) != 0) 
! 		{
! 			fprintf(stderr,
! 				"%s: could not create: %s\n",
! 				pbuf, errstring(st));
! 			exit(EX_CANTCREAT);
! 		}
! 		break;
! #endif
! 	  default:
! 		fprintf(stderr,
! 			"%s: internal error: type %d\n",
! 			progname,
! 			type);
! 		exit(EX_SOFTWARE);
! 	}
  
  	/*
  	**  Create the database.
***************
*** 289,312 ****
  	mode = O_RDWR;
  	if (!notrunc)
  		mode |= O_CREAT|O_TRUNC;
! #ifdef O_EXLOCK
  	mode |= O_EXLOCK;
  #else
  	/* pre-lock the database */
! 	fd = open(lbuf, mode & ~O_TRUNC, 0644);
  	if (fd < 0)
  	{
  		fprintf(stderr, "%s: cannot create type %s map %s\n",
  			progname, typename, mapname);
  		exit(EX_CANTCREAT);
  	}
- 	(void) lockfile(fd);
  #endif
  	switch (type)
  	{
  #ifdef NDBM
  	  case T_DBM:
  		dbp.dbm = dbm_open(mapname, mode, 0644);
  		break;
  #endif
  
--- 382,417 ----
  	mode = O_RDWR;
  	if (!notrunc)
  		mode |= O_CREAT|O_TRUNC;
! #if O_EXLOCK
  	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);
  	if (fd < 0)
  	{
  		fprintf(stderr, "%s: cannot create type %s map %s\n",
  			progname, typename, mapname);
  		exit(EX_CANTCREAT);
  	}
  #endif
  	switch (type)
  	{
  #ifdef NDBM
  	  case T_DBM:
  		dbp.dbm = dbm_open(mapname, mode, 0644);
+ 		if (!ignoresafeties && dbp.dbm != NULL &&
+ 		    (filechanged(dbuf, dbm_dirfno(dbp.dbm), &std, sff) ||
+ 		     filechanged(pbuf, dbm_pagfno(dbp.dbm), &stp, sff)))
+ 		{
+ 			fprintf(stderr,
+ 				"dbm map %s: file changed after open\n",
+ 				mapname);
+ 			dbm_close(dbp.dbm);
+ 			exit(EX_CANTCREAT);
+ 		}
  		break;
  #endif
  
***************
*** 315,324 ****
  		/* tweak some parameters for performance */
  		hinfo.nelem = 4096;
  		hinfo.cachesize = dbcachesize;
! 
  		dbp.db = dbopen(mapname, mode, 0644, DB_HASH, &hinfo);
  		if (dbp.db != NULL)
  		{
  # if OLD_NEWDB
  			(void) (*dbp.db->sync)(dbp.db);
  # else
--- 420,438 ----
  		/* tweak some parameters for performance */
  		hinfo.nelem = 4096;
  		hinfo.cachesize = dbcachesize;
! 		
  		dbp.db = dbopen(mapname, mode, 0644, DB_HASH, &hinfo);
  		if (dbp.db != NULL)
  		{
+ 			if (!ignoresafeties &&
+ 			    filechanged(dbuf, dbp.db->fd(dbp.db), &std, sff))
+ 			{
+ 				fprintf(stderr,
+ 					"db map %s: file changed after open\n",
+ 					mapname);
+ 				dbp.db->close(dbp.db);
+ 				exit(EX_CANTCREAT);
+ 			}
  # if OLD_NEWDB
  			(void) (*dbp.db->sync)(dbp.db);
  # else
***************
*** 334,339 ****
--- 448,462 ----
  		dbp.db = dbopen(mapname, mode, 0644, DB_BTREE, &bti);
  		if (dbp.db != NULL)
  		{
+ 			if (!ignoresafeties &&
+ 			    filechanged(dbuf, dbp.db->fd(dbp.db), &std, sff))
+ 			{
+ 				fprintf(stderr,
+ 					"db map %s: file changed after open\n",
+ 					mapname);
+ 				dbp.db->close(dbp.db);
+ 				exit(EX_CANTCREAT);
+ 			}
  # if OLD_NEWDB
  			(void) (*dbp.db->sync)(dbp.db);
  # else
***************
*** 344,350 ****
  #endif
  
  	  default:
! 		fprintf(stderr, "%s: internal error: type %d\n", progname, type);
  		exit(EX_SOFTWARE);
  	}
  
--- 467,474 ----
  #endif
  
  	  default:
! 		fprintf(stderr, "%s: internal error: type %d\n",
! 			progname, type);
  		exit(EX_SOFTWARE);
  	}
  
***************
*** 447,453 ****
  		}
  		else if (st > 0)
  		{
! 			fprintf(stderr, "%s: %s: line %d: key %s: duplicate key\n",
  				progname, mapname, lineno, key.xx.data);
  		}
  	}
--- 571,578 ----
  		}
  		else if (st > 0)
  		{
! 			fprintf(stderr,
! 				"%s: %s: line %d: key %s: duplicate key\n",
  				progname, mapname, lineno, key.xx.data);
  		}
  	}
***************
*** 477,483 ****
  #endif
  	}
  
! #ifndef O_EXLOCK
  	/* release locks */
  	close(fd);
  #endif
--- 602,608 ----
  #endif
  	}
  
! #if !O_EXLOCK
  	/* release locks */
  	close(fd);
  #endif
***************
*** 489,494 ****
--- 614,624 ----
  **
  **	Parameters:
  **		fd -- the file descriptor of the file.
+ **		filename -- the file name (for error messages).
+ **		ext -- the filename extension.
+ **		type -- type of the lock.  Bits can be:
+ **			LOCK_EX -- exclusive lock.
+ **			LOCK_NB -- non-blocking.
  **
  **	Returns:
  **		TRUE if the lock was acquired.
***************
*** 496,503 ****
  */
  
  bool
! lockfile(fd)
  	int fd;
  {
  # if !HASFLOCK
  	int action;
--- 626,636 ----
  */
  
  bool
! lockfile(fd, filename, ext, type)
  	int fd;
+ 	char *filename;
+ 	char *ext;
+ 	int type;
  {
  # if !HASFLOCK
  	int action;
***************
*** 505,512 ****
  	extern int errno;
  
  	bzero(&lfd, sizeof lfd);
! 	lfd.l_type = F_WRLCK;
! 	action = F_SETLKW;
  
  	if (fcntl(fd, action, &lfd) >= 0)
  		return TRUE;
--- 638,653 ----
  	extern int errno;
  
  	bzero(&lfd, sizeof lfd);
! 	if (bitset(LOCK_UN, type))
! 		lfd.l_type = F_UNLCK;
! 	else if (bitset(LOCK_EX, type))
! 		lfd.l_type = F_WRLCK;
! 	else
! 		lfd.l_type = F_RDLCK;
! 	if (bitset(LOCK_NB, type))
! 		action = F_SETLK;
! 	else
! 		action = F_SETLKW;
  
  	if (fcntl(fd, action, &lfd) >= 0)
  		return TRUE;
***************
*** 525,534 ****
  
  # else	/* HASFLOCK */
  
! 	if (flock(fd, LOCK_EX) >= 0)
  		return TRUE;
  
  # endif
  
  	return FALSE;
  }
--- 666,775 ----
  
  # else	/* HASFLOCK */
  
! 	if (flock(fd, type) >= 0)
  		return TRUE;
  
  # endif
  
  	return FALSE;
+ }
+ 
+ /*VARARGS2*/
+ void
+ #ifdef __STDC__
+ message(const char *msg, ...)
+ #else
+ message(msg, va_alist)
+ 	const char *msg;
+ 	va_dcl
+ #endif
+ {
+ 	const char *m;
+ 	VA_LOCAL_DECL
+ 
+ 	m = msg;
+ 	if (isdigit(m[0]) && isdigit(m[1]) && isdigit(m[2]) && m[3] == ' ')
+ 		m += 4;
+ 	VA_START(msg);
+ 	vfprintf(stderr, m, ap);
+ 	VA_END;
+ 	fprintf(stderr, "\n");
+ }
+ 
+ /*VARARGS2*/
+ void
+ #ifdef __STDC__
+ syserr(const char *msg, ...)
+ #else
+ syserr(msg, va_alist)
+ 	const char *msg;
+ 	va_dcl
+ #endif
+ {
+ 	const char *m;
+ 	VA_LOCAL_DECL
+ 
+ 	m = msg;
+ 	if (isdigit(m[0]) && isdigit(m[1]) && isdigit(m[2]) && m[3] == ' ')
+ 		m += 4;
+ 	VA_START(msg);
+ 	vfprintf(stderr, m, ap);
+ 	VA_END;
+ 	fprintf(stderr, "\n");
+ }
+ 
+ const char *
+ errstring(err)
+ 	int err;
+ {
+ 	static char errstr[64];
+ #if !HASSTRERROR && !defined(ERRLIST_PREDEFINED)
+ 	extern char *sys_errlist[];
+ 	extern int sys_nerr;
+ #endif
+ 
+ 	/* handle pseudo-errors internal to sendmail */
+ 	switch (err)
+ 	{
+ 	  case E_SM_OPENTIMEOUT:
+ 		return "Timeout on file open";
+ 
+ 	  case E_SM_NOSLINK:
+ 		return "Symbolic links not allowed";
+ 
+ 	  case E_SM_NOHLINK:
+ 		return "Hard links not allowed";
+ 
+ 	  case E_SM_REGONLY:
+ 		return "Regular files only";
+ 
+ 	  case E_SM_ISEXEC:
+ 		return "Executable files not allowed";
+ 
+ 	  case E_SM_WWDIR:
+ 		return "World writable directory";
+ 
+ 	  case E_SM_GWDIR:
+ 		return "Group writable directory";
+ 
+ 	  case E_SM_FILECHANGE:
+ 		return "File changed after open";
+ 
+ 	  case E_SM_WWFILE:
+ 		return "World writable file";
+ 
+ 	  case E_SM_GWFILE:
+ 		return "Group writable file";
+ 	}
+ 
+ #if HASSTRERROR
+ 	return strerror(err);
+ #else
+ 	if (err < 0 || err > sys_nerr) 
+ 	{
+ 		sprintf(errstr, "Error %d", err);
+ 		return errstr;
+ 	}
+ 	return sys_errlist[err];
+ #endif
  }
diff -Ncr sendmail-8.8.5/praliases/praliases.0 sendmail-8.8.6/praliases/praliases.0
*** sendmail-8.8.5/praliases/praliases.0	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/praliases/praliases.0	Sat Sep 21 17:15:02 1996
***************
*** 0 ****
--- 1,27 ----
+ PRALIASES(1)                 BSD Reference Manual                 PRALIASES(1)
+ 
+ NNAAMMEE
+      pprraalliiaasseess - display system mail aliases
+ 
+ SSYYNNOOPPSSIISS
+      pprraalliiaasseess [--ff _f_i_l_e]
+ 
+ DDEESSCCRRIIPPTTIIOONN
+      The pprraalliiaasseess utility displays the current system aliases, one per line,
+      in no particular order.
+ 
+      The options are as follows:
+ 
+      --ff      Read the specified file instead of the default sseennddmmaaiill system
+              aliases file.
+ 
+      The pprraalliiaasseess utility exits 0 on success, and >0 if an error occurs.
+ 
+ FFIILLEESS
+      /etc/aliases            The default sseennddmmaaiill system aliases file.
+      /etc/aliases.db         The database version of the _/_e_t_c_/_a_l_i_a_s_e_s file.
+ 
+ SSEEEE AALLSSOO
+      mailq(1),  sendmail(8)
+ 
+ 3rd Berkeley Distribution       April 25, 1996                               1
diff -Ncr sendmail-8.8.5/praliases/praliases.c sendmail-8.8.6/praliases/praliases.c
*** sendmail-8.8.5/praliases/praliases.c	Wed Sep 25 08:37:48 1996
--- sendmail-8.8.6/praliases/praliases.c	Wed May 28 16:52:17 1997
***************
*** 39,45 ****
  #endif /* not lint */
  
  #ifndef lint
! static char sccsid[] = "@(#)praliases.c	8.4 (Berkeley) 9/25/96";
  #endif /* not lint */
  
  #include <ndbm.h>
--- 39,45 ----
  #endif /* not lint */
  
  #ifndef lint
! static char sccsid[] = "@(#)praliases.c	8.5 (Berkeley) 5/28/97";
  #endif /* not lint */
  
  #include <ndbm.h>
***************
*** 81,86 ****
--- 81,91 ----
  	argv += optind;
  
  #ifdef NEWDB
+ 	if (strlen(filename) + 4 >= sizeof buf)
+ 	{
+ 		fprintf(stderr, "Alias filename too long: %.30s...\n", filename);
+ 		exit(EX_USAGE);
+ 	}
  	(void) strcpy(buf, filename);
  	(void) strcat(buf, ".db");
  	if (db = dbopen(buf, O_RDONLY, 0444 , DB_HASH, NULL)) {
diff -Ncr sendmail-8.8.5/smrsh/smrsh.0 sendmail-8.8.6/smrsh/smrsh.0
*** sendmail-8.8.5/smrsh/smrsh.0	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/smrsh/smrsh.0	Sat Sep 21 17:15:05 1996
***************
*** 0 ****
--- 1,66 ----
+ 
+ 
+ 
+ SMRSH(8)                                                 SMRSH(8)
+ 
+ 
+ NNAAMMEE
+        smrsh - restricted shell for sendmail
+ 
+ SSYYNNOOPPSSIISS
+        ssmmrrsshh --cc command
+ 
+ DDEESSCCRRIIPPTTIIOONN
+        The  _s_m_r_s_h program is intended as a replacement for _s_h for
+        use in the ``prog'' mailer  in  _s_e_n_d_m_a_i_l(8)  configuration
+        files.   It  sharply  limits  the commands that can be run
+        using the ``|program'' syntax  of  _s_e_n_d_m_a_i_l  in  order  to
+        improve  the  over  all security of your system.  Briefly,
+        even if a ``bad guy'' can get sendmail to  run  a  program
+        without going through an alias or forward file, _s_m_r_s_h lim-
+        its the set of programs that he or she can execute.
+ 
+        Briefly, _s_m_r_s_h limits programs  to  be  in  the  directory
+        /usr/adm/sm.bin,  allowing  the  system  administrator  to
+        choose the set of acceptable commands.   It  also  rejects
+        any  commands with the characters ``', `<', `>', `|', `;',
+        `&', `$', `(', `)', `\r' (carriage return), or `\n'  (new-
+        line)  on the command line to prevent ``end run'' attacks.
+ 
+        Initial pathnames on programs are stripped, so  forwarding
+        to      ``/usr/ucb/vacation'',      ``/usr/bin/vacation'',
+        ``/home/server/mydir/bin/vacation'', and ``vacation''  all
+        actually forward to ``/usr/adm/sm.bin/vacation''.
+ 
+        System  administrators  should be conservative about popu-
+        lating /usr/adm/sm.bin.  Reasonable  additions  are  _v_a_c_a_-
+        _t_i_o_n(1),  _p_r_o_c_m_a_i_l(1),  and the like.  No matter how brow-
+        beaten you may be, never include any shell  or  shell-like
+        program  (such  as _p_e_r_l(1)) in the sm.bin 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.
+ 
+ CCOOMMPPIILLAATTIIOONN
+        Compilation should be trivial on most  systems.   You  may
+        need  to  use -DPATH=\"_p_a_t_h\" to adjust the default search
+        path  (defaults  to   ``/bin:/usr/bin:/usr/ucb'')   and/or
+        -DCMDBIN=\"_d_i_r\"  to  change the default program directory
+        (defaults to ``/usr/adm/sm.bin'').
+ 
+ FFIILLEESS
+        /usr/adm/sm.bin - directory for restricted programs
+ 
+ SSEEEE AALLSSOO
+        sendmail(8)
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+                              11/02/93                           1
+ 
+ 
diff -Ncr sendmail-8.8.5/src/Makefile sendmail-8.8.6/src/Makefile
*** sendmail-8.8.5/src/Makefile	Fri Aug 30 08:01:15 1996
--- sendmail-8.8.6/src/Makefile	Fri Mar 28 09:06:01 1997
***************
*** 1,4 ****
! #	@(#)Makefile	8.7 (Berkeley) 10/31/95
  
  #########################################################################
  #  This Makefile is for 4.4BSD only!!!  For all other systems, use	#
--- 1,4 ----
! #	@(#)Makefile	8.8 (Berkeley) 3/28/97
  
  #########################################################################
  #  This Makefile is for 4.4BSD only!!!  For all other systems, use	#
***************
*** 21,29 ****
  
  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 savemail.c \
! 	srvrsmtp.c stab.c stats.c sysexits.c trace.c udb.c usersmtp.c \
! 	util.c version.c
  DPADD=	
  LDADD=	
  MAN1=	mailq.0 newaliases.0
--- 21,29 ----
  
  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
  DPADD=	
  LDADD=	
  MAN1=	mailq.0 newaliases.0
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.386BSD sendmail-8.8.6/src/Makefiles/Makefile.386BSD
*** sendmail-8.8.5/src/Makefiles/Makefile.386BSD	Fri Sep 20 07:35:43 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.386BSD	Fri Mar 28 09:06:39 1997
***************
*** 1,4 ****
! #	@(#)Makefile.386BSD	8.4 (Berkeley) 9/20/96
  
  PROG=	sendmail
  
--- 1,4 ----
! #	@(#)Makefile.386BSD	8.5 (Berkeley) 3/28/97
  
  PROG=	sendmail
  
***************
*** 16,24 ****
  
  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 savemail.c \
! 	srvrsmtp.c stab.c stats.c sysexits.c trace.c udb.c usersmtp.c \
! 	util.c version.c
  DPADD=	
  LDADD=	$(LIBUTIL)
  MAN1=	newaliases.0 mailq.0
--- 16,24 ----
  
  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
  DPADD=	
  LDADD=	$(LIBUTIL)
  MAN1=	newaliases.0 mailq.0
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.A-UX sendmail-8.8.6/src/Makefiles/Makefile.A-UX
*** sendmail-8.8.5/src/Makefiles/Makefile.A-UX	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.A-UX	Mon Apr  7 10:20:32 1997
***************
*** 5,13 ****
  #  old make program (I recommend that you get and port the new make if you
  #  are going to be doing any signficant work on sendmail).
  #
! #	@(#)Makefile.A-UX	8.13 (Berkeley) 9/20/96
  #
! #  Tested on A/UX 3.1.
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 5,13 ----
  #  old make program (I recommend that you get and port the new make if you
  #  are going to be doing any signficant work on sendmail).
  #
! #	@(#)Makefile.A-UX	8.15 (Berkeley) 3/29/97
  #
! #  Tested on A/UX 3.1.1.
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 38,44 ****
  
  # libraries required on your system
  #   If you are running A/UX prior to 3.1, delete -ldb
! LIBS=	-ldbm -ldb -lposix -lmalloc
  
  # location of sendmail binary (usually /usr/sbin or /usr/lib)
  BINDIR=	${DESTDIR}/usr/lib
--- 38,45 ----
  
  # libraries required on your system
  #   If you are running A/UX prior to 3.1, delete -ldb
! #   It may be necessary to change -lUTIL to -lmalloc on older versions
! LIBS=	-ldbm -ldb -lposix -lUTIL
  
  # location of sendmail binary (usually /usr/sbin or /usr/lib)
  BINDIR=	${DESTDIR}/usr/lib
***************
*** 59,65 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 60,66 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.AIX sendmail-8.8.6/src/Makefiles/Makefile.AIX
*** sendmail-8.8.5/src/Makefiles/Makefile.AIX	Fri Sep 20 07:35:43 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.AIX	Fri Mar 28 09:06:39 1997
***************
*** 7,13 ****
  #
  #  This has been tested on AIX 3.1.5 and 3.2.3e.
  #
! #	@(#)Makefile.AIX	8.11 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 7,13 ----
  #
  #  This has been tested on AIX 3.1.5 and 3.2.3e.
  #
! #	@(#)Makefile.AIX	8.12 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 62,68 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/sbin/newaliases ${DESTDIR}/usr/sbin/mailq \
--- 62,68 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/sbin/newaliases ${DESTDIR}/usr/sbin/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.AIX.2 sendmail-8.8.6/src/Makefiles/Makefile.AIX.2
*** sendmail-8.8.5/src/Makefiles/Makefile.AIX.2	Fri Sep 20 07:35:45 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.AIX.2	Fri Mar 28 09:06:42 1997
***************
*** 7,13 ****
  #
  #  This has been tested on AIX/RT V2.2.1  OPSYS level 1773
  #
! #	@(#)Makefile.AIX.2	8.3 (Berkeley) 9/20/96
  #
  
  SMROOT=	/usr/local/newmail
--- 7,13 ----
  #
  #  This has been tested on AIX/RT V2.2.1  OPSYS level 1773
  #
! #	@(#)Makefile.AIX.2	8.4 (Berkeley) 3/28/97
  #
  
  SMROOT=	/usr/local/newmail
***************
*** 67,73 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	newaliases mailq hoststat purgestat
--- 67,73 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	newaliases mailq hoststat purgestat
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.AIX.4 sendmail-8.8.6/src/Makefiles/Makefile.AIX.4
*** sendmail-8.8.5/src/Makefiles/Makefile.AIX.4	Wed Oct 16 10:03:50 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.AIX.4	Fri Mar 28 09:06:42 1997
***************
*** 62,68 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/sbin/newaliases ${DESTDIR}/usr/sbin/mailq \
--- 62,68 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/sbin/newaliases ${DESTDIR}/usr/sbin/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.Altos sendmail-8.8.6/src/Makefiles/Makefile.Altos
*** sendmail-8.8.5/src/Makefiles/Makefile.Altos	Mon Dec 30 07:34:01 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.Altos	Fri Mar 28 09:06:42 1997
***************
*** 7,13 ****
  #
  #  This has been tested on Altos System V.
  #
! #	@(#)Makefile.Altos	8.7 (Berkeley) 12/30/96
  #
  
  # The Altos System V compiler does not understand ANSI
--- 7,13 ----
  #
  #  This has been tested on Altos System V.
  #
! #	@(#)Makefile.Altos	8.8 (Berkeley) 3/28/97
  #
  
  # The Altos System V compiler does not understand ANSI
***************
*** 58,64 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
--- 58,64 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.BSD-OS sendmail-8.8.6/src/Makefiles/Makefile.BSD-OS
*** sendmail-8.8.5/src/Makefiles/Makefile.BSD-OS	Fri Sep 20 07:35:45 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.BSD-OS	Fri Mar 28 09:06:42 1997
***************
*** 1,7 ****
  #
  #  This Makefile is for BSDI boxes running BSD-OS (formerly BSD-386).
  #
! #	@(#)Makefile.BSD-OS	8.5 (Berkeley) 9/20/96
  #
  
  PROG=	sendmail
--- 1,7 ----
  #
  #  This Makefile is for BSDI boxes running BSD-OS (formerly BSD-386).
  #
! #	@(#)Makefile.BSD-OS	8.6 (Berkeley) 3/28/97
  #
  
  PROG=	sendmail
***************
*** 10,18 ****
  
  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 savemail.c \
! 	srvrsmtp.c stab.c stats.c sysexits.c trace.c udb.c usersmtp.c \
! 	util.c version.c
  DPADD=	${LIBUTIL} ${LIBKVM}
  LDADD=	-lutil -lkvm
  MAN1=	mailq.0 newaliases.0
--- 10,18 ----
  
  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
  DPADD=	${LIBUTIL} ${LIBKVM}
  LDADD=	-lutil -lkvm
  MAN1=	mailq.0 newaliases.0
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.BSD43 sendmail-8.8.6/src/Makefiles/Makefile.BSD43
*** sendmail-8.8.5/src/Makefiles/Makefile.BSD43	Fri Sep 20 07:35:43 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.BSD43	Fri Mar 28 09:06:40 1997
***************
*** 11,17 ****
  #	It should also work on UMIPS-BSD from MIPS, if you still have
  #	any lying around.
  #
! #	@(#)Makefile.BSD43	8.9 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 11,17 ----
  #	It should also work on UMIPS-BSD from MIPS, if you still have
  #	any lying around.
  #
! #	@(#)Makefile.BSD43	8.10 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 62,68 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 62,68 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.CLIX sendmail-8.8.6/src/Makefiles/Makefile.CLIX
*** sendmail-8.8.5/src/Makefiles/Makefile.CLIX	Fri Sep 20 07:35:43 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.CLIX	Tue Jun 10 07:15:13 1997
***************
*** 8,14 ****
  #
  #  --Paul Southworth <pauls@cic.net>
  #
! #	@(#)Makefile.CLIX	8.6 (Berkeley) 9/20/96
  #
  
  # make sure the shell constructs below use the right shell
--- 8,14 ----
  #
  #  --Paul Southworth <pauls@cic.net>
  #
! #	@(#)Makefile.CLIX	8.8 (Berkeley) 6/10/97
  #
  
  # make sure the shell constructs below use the right shell
***************
*** 52,58 ****
  HFDIR=	${DESTDIR}/usr/lib
  
  # additional .o files needed
! OBJADD= getusershell.o
  
  ###################  end of user configuration flags  ######################
  
--- 52,58 ----
  HFDIR=	${DESTDIR}/usr/lib
  
  # additional .o files needed
! OBJADD= 
  
  ###################  end of user configuration flags  ######################
  
***************
*** 61,67 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
--- 61,67 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.CSOS sendmail-8.8.6/src/Makefiles/Makefile.CSOS
*** sendmail-8.8.5/src/Makefiles/Makefile.CSOS	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.CSOS	Fri Mar 28 09:06:41 1997
***************
*** 5,11 ****
  #
  #	Contributed by Scott Bolte <scott@craycos.com>.
  #
! #	@(#)Makefile.CSOS	8.7	(Berkeley)	9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 5,11 ----
  #
  #	Contributed by Scott Bolte <scott@craycos.com>.
  #
! #	@(#)Makefile.CSOS	8.8	(Berkeley)	3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 60,66 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 60,66 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.ConvexOS sendmail-8.8.6/src/Makefiles/Makefile.ConvexOS
*** sendmail-8.8.5/src/Makefiles/Makefile.ConvexOS	Fri Sep 20 07:35:43 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.ConvexOS	Fri Mar 28 09:06:40 1997
***************
*** 7,13 ****
  #
  #  This has been tested on CxOS 11.0 beta 1 and 10.x.
  #
! #	@(#)Makefile.ConvexOS	8.12 (Berkeley) 9/20/96
  #
  
  
--- 7,13 ----
  #
  #  This has been tested on CxOS 11.0 beta 1 and 10.x.
  #
! #	@(#)Makefile.ConvexOS	8.13 (Berkeley) 3/28/97
  #
  
  
***************
*** 61,67 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 61,67 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.Dell sendmail-8.8.6/src/Makefiles/Makefile.Dell
*** sendmail-8.8.5/src/Makefiles/Makefile.Dell	Fri Sep 20 07:35:43 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.Dell	Fri Mar 28 09:06:40 1997
***************
*** 9,15 ****
  #	<kim@grendel.lut.fi> -- I haven't tested this myself.  It may
  #	work on other SVR4 ports.
  #
! #	@(#)Makefile.Dell	8.8 (Berkeley) 9/20/96
  #
  
  # make sure the shell constructs below use the right shell
--- 9,15 ----
  #	<kim@grendel.lut.fi> -- I haven't tested this myself.  It may
  #	work on other SVR4 ports.
  #
! #	@(#)Makefile.Dell	8.9 (Berkeley) 3/28/97
  #
  
  # make sure the shell constructs below use the right shell
***************
*** 63,69 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 63,69 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.DomainOS sendmail-8.8.6/src/Makefiles/Makefile.DomainOS
*** sendmail-8.8.5/src/Makefiles/Makefile.DomainOS	Fri Sep 20 07:35:43 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.DomainOS	Fri Mar 28 09:06:40 1997
***************
*** 7,13 ****
  #
  #  This has been tested on DomainOS 10.3.5
  #
! #	@(#)Makefile.DomainOS	8.11 (Berkeley) 9/20/96
  #
  #
  
--- 7,13 ----
  #
  #  This has been tested on DomainOS 10.3.5
  #
! #	@(#)Makefile.DomainOS	8.12 (Berkeley) 3/28/97
  #
  #
  
***************
*** 67,73 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 67,73 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.Dynix sendmail-8.8.6/src/Makefiles/Makefile.Dynix
*** sendmail-8.8.5/src/Makefiles/Makefile.Dynix	Fri Sep 20 07:35:43 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.Dynix	Fri Mar 28 09:06:40 1997
***************
*** 11,17 ****
  #	instead.  I compiled it with gcc 1.40a.  The -lseq is to pick
  #	up getopt.''
  #
! #	@(#)Makefile.Dynix	8.8 (Berkeley) 9/20/96
  #
  
  CC= gcc
--- 11,17 ----
  #	instead.  I compiled it with gcc 1.40a.  The -lseq is to pick
  #	up getopt.''
  #
! #	@(#)Makefile.Dynix	8.9 (Berkeley) 3/28/97
  #
  
  CC= gcc
***************
*** 64,70 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 64,70 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.EWS-UX_V sendmail-8.8.6/src/Makefiles/Makefile.EWS-UX_V
*** sendmail-8.8.5/src/Makefiles/Makefile.EWS-UX_V	Fri Sep 20 07:35:45 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.EWS-UX_V	Fri Mar 28 09:06:42 1997
***************
*** 7,13 ****
  #
  #  This has been tested on NEC EWS-UX/V 4.2
  #
! #	@(#)Makefile.EWS-UX_V	8.6 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 7,13 ----
  #
  #  This has been tested on NEC EWS-UX/V 4.2
  #
! #	@(#)Makefile.EWS-UX_V	8.7 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 64,70 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 64,70 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.FreeBSD sendmail-8.8.6/src/Makefiles/Makefile.FreeBSD
*** sendmail-8.8.5/src/Makefiles/Makefile.FreeBSD	Fri Sep 20 07:35:43 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.FreeBSD	Fri Mar 28 09:06:40 1997
***************
*** 1,7 ****
  #
  #  Makefile for FreeBSD
  #
! #	@(#)Makefile.FreeBSD	8.6 (Berkeley) 9/20/96
  
  PROG=	sendmail
  
--- 1,7 ----
  #
  #  Makefile for FreeBSD
  #
! #	@(#)Makefile.FreeBSD	8.7 (Berkeley) 3/28/97
  
  PROG=	sendmail
  
***************
*** 19,27 ****
  
  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 savemail.c \
! 	srvrsmtp.c stab.c stats.c sysexits.c trace.c udb.c usersmtp.c \
! 	util.c version.c
  DPADD=	${LIBUTIL}
  LDADD=	-lutil
  #
--- 19,27 ----
  
  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
  DPADD=	${LIBUTIL}
  LDADD=	-lutil
  #
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.HP-UX sendmail-8.8.6/src/Makefiles/Makefile.HP-UX
*** sendmail-8.8.5/src/Makefiles/Makefile.HP-UX	Fri Sep 20 07:35:43 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.HP-UX	Fri Mar 28 09:06:40 1997
***************
*** 8,14 ****
  #  This has been tested on HP-UX 9.05 on 7xx series and HP-UX 9.04
  #  on 8xx series.
  #
! #	@(#)Makefile.HP-UX	8.15 (Berkeley) 9/20/96
  #
  
  CC=	cc -Aa -D_HPUX_SOURCE
--- 8,14 ----
  #  This has been tested on HP-UX 9.05 on 7xx series and HP-UX 9.04
  #  on 8xx series.
  #
! #	@(#)Makefile.HP-UX	8.16 (Berkeley) 3/28/97
  #
  
  CC=	cc -Aa -D_HPUX_SOURCE
***************
*** 61,67 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
--- 61,67 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.HP-UX.10.x sendmail-8.8.6/src/Makefiles/Makefile.HP-UX.10.x
*** sendmail-8.8.5/src/Makefiles/Makefile.HP-UX.10.x	Fri Sep 20 07:35:45 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.HP-UX.10.x	Fri Mar 28 09:06:42 1997
***************
*** 8,14 ****
  #  This has been tested on HP-UX 10.x.  Changes for 10.0 contributed
  #  by John Beck of Hewlett-Packard.
  #
! #	@(#)Makefile.HP-UX.10.x	8.9 (Berkeley) 9/20/96
  #
  
  CC=	cc -Aa -D_HPUX_SOURCE
--- 8,14 ----
  #  This has been tested on HP-UX 10.x.  Changes for 10.0 contributed
  #  by John Beck of Hewlett-Packard.
  #
! #	@(#)Makefile.HP-UX.10.x	8.10 (Berkeley) 3/28/97
  #
  
  CC=	cc -Aa -D_HPUX_SOURCE
***************
*** 61,67 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
--- 61,67 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.IRIX sendmail-8.8.6/src/Makefiles/Makefile.IRIX
*** sendmail-8.8.5/src/Makefiles/Makefile.IRIX	Sat Nov 16 09:29:07 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.IRIX	Fri Mar 28 09:06:40 1997
***************
*** 7,13 ****
  #
  #  This has been tested on IRIX 4.0.4.
  #
! #	@(#)Makefile.IRIX	8.12 (Berkeley) 11/16/96
  #
  SHELL=	/bin/sh
  
--- 7,13 ----
  #
  #  This has been tested on IRIX 4.0.4.
  #
! #	@(#)Makefile.IRIX	8.14 (Berkeley) 3/28/97
  #
  SHELL=	/bin/sh
  
***************
*** 35,40 ****
--- 35,41 ----
  LIBDIRS=
  
  # libraries required on your system
+ #	If running bind-4.9.5, you may need to remove -lsun
  LIBS= -lmld -lmalloc -lsun
  
  # location of sendmail binary (usually /usr/sbin or /usr/lib)
***************
*** 56,62 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bsd/newaliases ${DESTDIR}/usr/bsd/mailq \
--- 57,63 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bsd/newaliases ${DESTDIR}/usr/bsd/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.IRIX.5.x sendmail-8.8.6/src/Makefiles/Makefile.IRIX.5.x
*** sendmail-8.8.5/src/Makefiles/Makefile.IRIX.5.x	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.IRIX.5.x	Fri Mar 28 09:06:41 1997
***************
*** 3,9 ****
  #
  #  Tested on IRIX 5.3 by Kari E. Hurtta <Kari.Hurtta@fmi.fi>.
  #
! #	@(#)Makefile.IRIX.5.x	8.10 (Berkeley) 9/20/96
  #
  SHELL=	/bin/sh
  
--- 3,9 ----
  #
  #  Tested on IRIX 5.3 by Kari E. Hurtta <Kari.Hurtta@fmi.fi>.
  #
! #	@(#)Makefile.IRIX.5.x	8.11 (Berkeley) 3/28/97
  #
  SHELL=	/bin/sh
  
***************
*** 55,61 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bsd/newaliases ${DESTDIR}/usr/bsd/mailq \
--- 55,61 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bsd/newaliases ${DESTDIR}/usr/bsd/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.IRIX.6.2 sendmail-8.8.6/src/Makefiles/Makefile.IRIX.6.2
*** sendmail-8.8.5/src/Makefiles/Makefile.IRIX.6.2	Fri Sep 20 07:35:45 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.IRIX.6.2	Wed Dec 31 16:00:00 1969
***************
*** 1,134 ****
- #
- #  This Makefile is designed to work on the old "make" program.  It does
- #  not use the obj subdirectory.  It also does not install documentation
- #  automatically -- think of it as a quick start for sites that have the
- #  old make program (I recommend that you get and port the new make if you
- #  are going to be doing any signficant work on sendmail).
- #
- #  IRIX 6.2 is successor of IRIX 5.3.  It combines 64bit IRIX 6.[01] and
- #  32bit IRIX 5.x.
- #
- #	IRIX 6.2 support provided by Kari Hurtta <Kari.Hurtta@dionysos.fmi.fi>.
- #
- #	@(#)Makefile.IRIX.6.2	8.3	(Berkeley)	9/20/96
- #
- SHELL=	/bin/sh
- 
- # use O=-O (usual) or O=-g (debugging)
- O=	-O
- 
- # Select what ABI we are using -- see abi(5) for details
- #    -32	~ IRIX 5.3				(default: -mips2)
- #                 - long and pointer are 32 bit
- #    -n32        New to IRIX 6.2			(default: -mips3)
- #                 - long and pointer are 32 bit
- #    -64	~ IRIX 6.1				(default: -mips4)
- #                 - long and pointer are 64 bit
- # We force ABI here, so then it does not depend on CPU
- ABI=	-n32
- 
- # define the database mechanisms available for map & alias lookups:
- #	-DNDBM -- use new DBM
- #	-DNEWDB -- use new Berkeley DB (requires -ldb)
- #	-DNIS -- include NIS support
- # The really old (V7) DBM library is no longer supported.
- # See READ_ME for a description of how these flags interact.
- #
- #  N.B.:  Include -D__BIT_TYPES_DEFINED__ if you use -DNEWDB!
- #
- DBMDEF=	-DNDBM -DNIS
- #DBMDEF=	-DNDBM -DNIS -DNEWDB -D__BIT_TYPES_DEFINED__
- 
- # environment definitions (e.g., -D_AIX3)
- # -DIRIX6 is needed, if you use ABI=-32
- #    (or conf.h can't make difference between IRIX 5.3 and IRIX 6.2)
- ENVDEF= -DIRIX6 ${ABI}
- 
- # see also conf.h for additional compilation flags
- 
- # include directories
- INCDIRS=
- 
- # library directories
- LIBDIRS=
- 
- # libraries required on your system
- LIBS= -lelf -lmalloc
- 
- # loader options
- LDOPTS=	${ABI}
- 
- # location of sendmail binary (usually /usr/sbin or /usr/lib)
- BINDIR=	${DESTDIR}/usr/lib
- 
- # location of sendmail.st file (usually /var/log or /usr/lib)
- STDIR=	${DESTDIR}/var
- 
- # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
- HFDIR=	${DESTDIR}/etc
- 
- # additional .o files needed
- OBJADD=
- 
- ###################  end of user configuration flags  ######################
- 
- CFLAGS=	-I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
- 
- OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
- 	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
- 	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
- 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
- 	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
- 
- LINKS=	${DESTDIR}/usr/bsd/newaliases ${DESTDIR}/usr/bsd/mailq \
- 	${DESTDIR}/usr/bsd/hoststat ${DESTDIR}/usr/bsd/purgestat
- INSTALL=install
- BINOWN=	root
- BINGRP=	sys
- BINMODE=4555
- 
- ALL=	sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
- 
- all: ${ALL}
- 
- sendmail: ${BEFORE} ${OBJS}
- 	${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
- 
- #NROFF=	nroff -h
- NROFF=	groff -Tascii
- MANDOC=	-mandoc
- 
- aliases.0: aliases.5
- 	${NROFF} ${MANDOC} aliases.5 > aliases.0
- 
- mailq.0: mailq.1
- 	${NROFF} ${MANDOC} mailq.1 > mailq.0
- 
- newaliases.0: newaliases.1
- 	${NROFF} ${MANDOC} newaliases.1 > newaliases.0
- 
- sendmail.0: sendmail.8
- 	${NROFF} ${MANDOC} sendmail.8 > sendmail.0
- 
- install: install-sendmail install-docs
- 
- install-sendmail: sendmail
- 	${INSTALL} -u ${BINOWN} -g ${BINGRP} -m ${BINMODE} -f ${BINDIR} sendmail
- 	for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
- 	cp /dev/null ${STDIR}/sendmail.st
- 	chmod 644 ${STDIR}/sendmail.st
- 	chown ${BINOWN} ${STDIR}/sendmail.st
- 	chgrp ${BINGRP} ${STDIR}/sendmail.st
- 	${INSTALL} -u ${BINOWN} -g ${BINGRP} -m 444 -f ${HFDIR} sendmail.hf
- 
- # doesn't actually install them -- you may want to install pre-nroff versions
- install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
- 
- clean:
- 	rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
- 
- # dependencies
- #   gross overkill, and yet still not quite enough....
- ${OBJS}: sendmail.h conf.h
- 
- depend:
--- 0 ----
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.IRIX.6.x sendmail-8.8.6/src/Makefiles/Makefile.IRIX.6.x
*** sendmail-8.8.5/src/Makefiles/Makefile.IRIX.6.x	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/src/Makefiles/Makefile.IRIX.6.x	Thu May  8 12:02:59 1997
***************
*** 0 ****
--- 1,134 ----
+ #
+ #  This Makefile is designed to work on the old "make" program.  It does
+ #  not use the obj subdirectory.  It also does not install documentation
+ #  automatically -- think of it as a quick start for sites that have the
+ #  old make program (I recommend that you get and port the new make if you
+ #  are going to be doing any signficant work on sendmail).
+ #
+ #  IRIX 6.2 is successor of IRIX 5.3.  It combines 64bit IRIX 6.[01] and
+ #  32bit IRIX 5.x.
+ #
+ #	IRIX 6.2 support provided by Kari Hurtta <Kari.Hurtta@dionysos.fmi.fi>.
+ #
+ #	@(#)Makefile.IRIX.6.x	8.5	(Berkeley)	4/7/97
+ #
+ SHELL=	/bin/sh
+ 
+ # use O=-O (usual) or O=-g (debugging)
+ O=	-O
+ 
+ # Select what ABI we are using -- see abi(5) for details
+ #    -32	~ IRIX 5.3				(default: -mips2)
+ #                 - long and pointer are 32 bit
+ #    -n32        New to IRIX 6.2			(default: -mips3)
+ #                 - long and pointer are 32 bit
+ #    -64	~ IRIX 6.1				(default: -mips4)
+ #                 - long and pointer are 64 bit
+ # We force ABI here, so then it does not depend on CPU
+ ABI=	-n32
+ 
+ # define the database mechanisms available for map & alias lookups:
+ #	-DNDBM -- use new DBM
+ #	-DNEWDB -- use new Berkeley DB (requires -ldb)
+ #	-DNIS -- include NIS support
+ # The really old (V7) DBM library is no longer supported.
+ # See READ_ME for a description of how these flags interact.
+ #
+ #  N.B.:  Include -D__BIT_TYPES_DEFINED__ if you use -DNEWDB!
+ #
+ DBMDEF=	-DNDBM -DNIS
+ #DBMDEF=	-DNDBM -DNIS -DNEWDB -D__BIT_TYPES_DEFINED__
+ 
+ # environment definitions (e.g., -D_AIX3)
+ # -DIRIX6 is needed, if you use ABI=-32
+ #    (or conf.h can't make difference between IRIX 5.3 and IRIX 6.2)
+ ENVDEF= -DIRIX6 ${ABI}
+ 
+ # see also conf.h for additional compilation flags
+ 
+ # include directories
+ INCDIRS=
+ 
+ # library directories
+ LIBDIRS=
+ 
+ # libraries required on your system
+ LIBS= -lelf
+ 
+ # loader options
+ LDOPTS=	${ABI}
+ 
+ # location of sendmail binary (usually /usr/sbin or /usr/lib)
+ BINDIR=	${DESTDIR}/usr/lib
+ 
+ # location of sendmail.st file (usually /var/log or /usr/lib)
+ STDIR=	${DESTDIR}/var
+ 
+ # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
+ HFDIR=	${DESTDIR}/etc
+ 
+ # additional .o files needed
+ OBJADD=
+ 
+ ###################  end of user configuration flags  ######################
+ 
+ CFLAGS=	-I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
+ 
+ OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
+ 	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
+ 	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
+ 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
+ 	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
+ 
+ LINKS=	${DESTDIR}/usr/bsd/newaliases ${DESTDIR}/usr/bsd/mailq \
+ 	${DESTDIR}/usr/bsd/hoststat ${DESTDIR}/usr/bsd/purgestat
+ INSTALL=install
+ BINOWN=	root
+ BINGRP=	sys
+ BINMODE=4555
+ 
+ ALL=	sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
+ 
+ all: ${ALL}
+ 
+ sendmail: ${BEFORE} ${OBJS}
+ 	${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
+ 
+ #NROFF=	nroff -h
+ NROFF=	groff -Tascii
+ MANDOC=	-mandoc
+ 
+ aliases.0: aliases.5
+ 	${NROFF} ${MANDOC} aliases.5 > aliases.0
+ 
+ mailq.0: mailq.1
+ 	${NROFF} ${MANDOC} mailq.1 > mailq.0
+ 
+ newaliases.0: newaliases.1
+ 	${NROFF} ${MANDOC} newaliases.1 > newaliases.0
+ 
+ sendmail.0: sendmail.8
+ 	${NROFF} ${MANDOC} sendmail.8 > sendmail.0
+ 
+ install: install-sendmail install-docs
+ 
+ install-sendmail: sendmail
+ 	${INSTALL} -u ${BINOWN} -g ${BINGRP} -m ${BINMODE} -f ${BINDIR} sendmail
+ 	for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
+ 	cp /dev/null ${STDIR}/sendmail.st
+ 	chmod 644 ${STDIR}/sendmail.st
+ 	chown ${BINOWN} ${STDIR}/sendmail.st
+ 	chgrp ${BINGRP} ${STDIR}/sendmail.st
+ 	${INSTALL} -u ${BINOWN} -g ${BINGRP} -m 444 -f ${HFDIR} sendmail.hf
+ 
+ # doesn't actually install them -- you may want to install pre-nroff versions
+ install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
+ 
+ clean:
+ 	rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
+ 
+ # dependencies
+ #   gross overkill, and yet still not quite enough....
+ ${OBJS}: sendmail.h conf.h
+ 
+ depend:
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.IRIX64 sendmail-8.8.6/src/Makefiles/Makefile.IRIX64
*** sendmail-8.8.5/src/Makefiles/Makefile.IRIX64	Sat Nov 16 09:29:07 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.IRIX64	Wed Dec 31 16:00:00 1969
***************
*** 1,114 ****
- #
- #  This Makefile is designed to work on the old "make" program.  It does
- #  not use the obj subdirectory.  It also does not install documentation
- #  automatically -- think of it as a quick start for sites that have the
- #  old make program (I recommend that you get and port the new make if you
- #  are going to be doing any signficant work on sendmail).
- #
- #  This has been tested on IRIX64 6.0.
- #  Changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
- #
- #	@(#)Makefile.IRIX64	8.6 (Berkeley) 11/16/96
- #
- SHELL=	/bin/sh
- 
- # use O=-O (usual) or O=-g (debugging)
- O=	-O
- 
- # define the database mechanisms available for map & alias lookups:
- #	-DNDBM -- use new DBM
- #	-DNEWDB -- use new Berkeley DB (requires -ldb)
- #	-DNIS -- include NIS support (requires -lsun)
- # The really old (V7) DBM library is no longer supported.
- # See READ_ME for a description of how these flags interact.
- #
- DBMDEF=	-DNDBM
- 
- # environment definitions (e.g., -D_AIX3)
- ENVDEF= -DIRIX64
- 
- # see also conf.h for additional compilation flags
- 
- # include directories
- INCDIRS=
- 
- # library directories
- LIBDIRS=
- 
- # libraries required on your system
- LIBS= -lelf -lmalloc
- 
- # location of sendmail binary (usually /usr/sbin or /usr/lib)
- BINDIR=	${DESTDIR}/usr/lib
- 
- # location of sendmail.st file (usually /var/log or /usr/lib)
- STDIR=	${DESTDIR}/usr/lib
- 
- # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
- HFDIR=	${DESTDIR}/usr/lib
- 
- # additional .o files needed
- OBJADD=
- 
- ###################  end of user configuration flags  ######################
- 
- CFLAGS=	-I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
- 
- OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
- 	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
- 	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
- 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
- 	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
- 
- LINKS=	${DESTDIR}/usr/bsd/newaliases ${DESTDIR}/usr/bsd/mailq \
- 	${DESTDIR}/usr/bsd/hoststat ${DESTDIR}/usr/bsd/purgestat
- INSTALL=install
- BINOWN=	root
- BINGRP=	sys
- BINMODE=6555
- 
- ALL=	sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
- 
- all: ${ALL}
- 
- sendmail: ${BEFORE} ${OBJS}
- 	${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
- 
- #NROFF=	nroff -h
- NROFF=	groff -Tascii
- MANDOC=	-mandoc
- 
- aliases.0: aliases.5
- 	${NROFF} ${MANDOC} aliases.5 > aliases.0
- 
- mailq.0: mailq.1
- 	${NROFF} ${MANDOC} mailq.1 > mailq.0
- 
- newaliases.0: newaliases.1
- 	${NROFF} ${MANDOC} newaliases.1 > newaliases.0
- 
- sendmail.0: sendmail.8
- 	${NROFF} ${MANDOC} sendmail.8 > sendmail.0
- 
- install: install-sendmail install-docs
- 
- install-sendmail: sendmail
- 	${INSTALL} -u ${BINOWN} -g ${BINGRP} -m ${BINMODE} -f ${BINDIR} sendmail
- 	for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
- 	cp /dev/null ${STDIR}/sendmail.st
- 	chmod 644 ${STDIR}/sendmail.st
- 	chown ${BINOWN} ${STDIR}/sendmail.st
- 	chgrp ${BINGRP} ${STDIR}/sendmail.st
- 	${INSTALL} -u ${BINOWN} -g ${BINGRP} -m 444 -f ${HFDIR} sendmail.hf
- 
- # doesn't actually install them -- you may want to install pre-nroff versions
- install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
- 
- clean:
- 	rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
- 
- # dependencies
- #   gross overkill, and yet still not quite enough....
- ${OBJS}: sendmail.h conf.h
- 
- depend:
--- 0 ----
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.IRIX64.6.0 sendmail-8.8.6/src/Makefiles/Makefile.IRIX64.6.0
*** sendmail-8.8.5/src/Makefiles/Makefile.IRIX64.6.0	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/src/Makefiles/Makefile.IRIX64.6.0	Tue Jun 10 16:50:07 1997
***************
*** 0 ****
--- 1,114 ----
+ #
+ #  This Makefile is designed to work on the old "make" program.  It does
+ #  not use the obj subdirectory.  It also does not install documentation
+ #  automatically -- think of it as a quick start for sites that have the
+ #  old make program (I recommend that you get and port the new make if you
+ #  are going to be doing any signficant work on sendmail).
+ #
+ #  This has been tested on IRIX64 6.0.
+ #  Changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
+ #
+ #	@(#)Makefile.IRIX64.6.0	8.7 (Berkeley) 3/28/97
+ #
+ SHELL=	/bin/sh
+ 
+ # use O=-O (usual) or O=-g (debugging)
+ O=	-O
+ 
+ # define the database mechanisms available for map & alias lookups:
+ #	-DNDBM -- use new DBM
+ #	-DNEWDB -- use new Berkeley DB (requires -ldb)
+ #	-DNIS -- include NIS support (requires -lsun)
+ # The really old (V7) DBM library is no longer supported.
+ # See READ_ME for a description of how these flags interact.
+ #
+ DBMDEF=	-DNDBM
+ 
+ # environment definitions (e.g., -D_AIX3)
+ ENVDEF= -DIRIX64
+ 
+ # see also conf.h for additional compilation flags
+ 
+ # include directories
+ INCDIRS=
+ 
+ # library directories
+ LIBDIRS=
+ 
+ # libraries required on your system
+ LIBS= -lelf -lmalloc
+ 
+ # location of sendmail binary (usually /usr/sbin or /usr/lib)
+ BINDIR=	${DESTDIR}/usr/lib
+ 
+ # location of sendmail.st file (usually /var/log or /usr/lib)
+ STDIR=	${DESTDIR}/usr/lib
+ 
+ # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
+ HFDIR=	${DESTDIR}/usr/lib
+ 
+ # additional .o files needed
+ OBJADD=
+ 
+ ###################  end of user configuration flags  ######################
+ 
+ CFLAGS=	-I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
+ 
+ OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
+ 	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
+ 	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
+ 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
+ 	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
+ 
+ LINKS=	${DESTDIR}/usr/bsd/newaliases ${DESTDIR}/usr/bsd/mailq \
+ 	${DESTDIR}/usr/bsd/hoststat ${DESTDIR}/usr/bsd/purgestat
+ INSTALL=install
+ BINOWN=	root
+ BINGRP=	sys
+ BINMODE=6555
+ 
+ ALL=	sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
+ 
+ all: ${ALL}
+ 
+ sendmail: ${BEFORE} ${OBJS}
+ 	${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
+ 
+ #NROFF=	nroff -h
+ NROFF=	groff -Tascii
+ MANDOC=	-mandoc
+ 
+ aliases.0: aliases.5
+ 	${NROFF} ${MANDOC} aliases.5 > aliases.0
+ 
+ mailq.0: mailq.1
+ 	${NROFF} ${MANDOC} mailq.1 > mailq.0
+ 
+ newaliases.0: newaliases.1
+ 	${NROFF} ${MANDOC} newaliases.1 > newaliases.0
+ 
+ sendmail.0: sendmail.8
+ 	${NROFF} ${MANDOC} sendmail.8 > sendmail.0
+ 
+ install: install-sendmail install-docs
+ 
+ install-sendmail: sendmail
+ 	${INSTALL} -u ${BINOWN} -g ${BINGRP} -m ${BINMODE} -f ${BINDIR} sendmail
+ 	for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
+ 	cp /dev/null ${STDIR}/sendmail.st
+ 	chmod 644 ${STDIR}/sendmail.st
+ 	chown ${BINOWN} ${STDIR}/sendmail.st
+ 	chgrp ${BINGRP} ${STDIR}/sendmail.st
+ 	${INSTALL} -u ${BINOWN} -g ${BINGRP} -m 444 -f ${HFDIR} sendmail.hf
+ 
+ # doesn't actually install them -- you may want to install pre-nroff versions
+ install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
+ 
+ clean:
+ 	rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
+ 
+ # dependencies
+ #   gross overkill, and yet still not quite enough....
+ ${OBJS}: sendmail.h conf.h
+ 
+ depend:
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.IRIX64.6.1 sendmail-8.8.6/src/Makefiles/Makefile.IRIX64.6.1
*** sendmail-8.8.5/src/Makefiles/Makefile.IRIX64.6.1	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/src/Makefiles/Makefile.IRIX64.6.1	Tue Jun 10 16:50:07 1997
***************
*** 0 ****
--- 1,114 ----
+ #
+ #  This Makefile is designed to work on the old "make" program.  It does
+ #  not use the obj subdirectory.  It also does not install documentation
+ #  automatically -- think of it as a quick start for sites that have the
+ #  old make program (I recommend that you get and port the new make if you
+ #  are going to be doing any signficant work on sendmail).
+ #
+ #  This has been tested on IRIX64 6.0.
+ #  Changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
+ #
+ #	@(#)Makefile.IRIX64.6.0	8.7 (Berkeley) 3/28/97
+ #
+ SHELL=	/bin/sh
+ 
+ # use O=-O (usual) or O=-g (debugging)
+ O=	-O
+ 
+ # define the database mechanisms available for map & alias lookups:
+ #	-DNDBM -- use new DBM
+ #	-DNEWDB -- use new Berkeley DB (requires -ldb)
+ #	-DNIS -- include NIS support (requires -lsun)
+ # The really old (V7) DBM library is no longer supported.
+ # See READ_ME for a description of how these flags interact.
+ #
+ DBMDEF=	-DNDBM
+ 
+ # environment definitions (e.g., -D_AIX3)
+ ENVDEF= -DIRIX64
+ 
+ # see also conf.h for additional compilation flags
+ 
+ # include directories
+ INCDIRS=
+ 
+ # library directories
+ LIBDIRS=
+ 
+ # libraries required on your system
+ LIBS= -lelf -lmalloc
+ 
+ # location of sendmail binary (usually /usr/sbin or /usr/lib)
+ BINDIR=	${DESTDIR}/usr/lib
+ 
+ # location of sendmail.st file (usually /var/log or /usr/lib)
+ STDIR=	${DESTDIR}/usr/lib
+ 
+ # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
+ HFDIR=	${DESTDIR}/usr/lib
+ 
+ # additional .o files needed
+ OBJADD=
+ 
+ ###################  end of user configuration flags  ######################
+ 
+ CFLAGS=	-I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
+ 
+ OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
+ 	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
+ 	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
+ 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
+ 	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
+ 
+ LINKS=	${DESTDIR}/usr/bsd/newaliases ${DESTDIR}/usr/bsd/mailq \
+ 	${DESTDIR}/usr/bsd/hoststat ${DESTDIR}/usr/bsd/purgestat
+ INSTALL=install
+ BINOWN=	root
+ BINGRP=	sys
+ BINMODE=6555
+ 
+ ALL=	sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
+ 
+ all: ${ALL}
+ 
+ sendmail: ${BEFORE} ${OBJS}
+ 	${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
+ 
+ #NROFF=	nroff -h
+ NROFF=	groff -Tascii
+ MANDOC=	-mandoc
+ 
+ aliases.0: aliases.5
+ 	${NROFF} ${MANDOC} aliases.5 > aliases.0
+ 
+ mailq.0: mailq.1
+ 	${NROFF} ${MANDOC} mailq.1 > mailq.0
+ 
+ newaliases.0: newaliases.1
+ 	${NROFF} ${MANDOC} newaliases.1 > newaliases.0
+ 
+ sendmail.0: sendmail.8
+ 	${NROFF} ${MANDOC} sendmail.8 > sendmail.0
+ 
+ install: install-sendmail install-docs
+ 
+ install-sendmail: sendmail
+ 	${INSTALL} -u ${BINOWN} -g ${BINGRP} -m ${BINMODE} -f ${BINDIR} sendmail
+ 	for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
+ 	cp /dev/null ${STDIR}/sendmail.st
+ 	chmod 644 ${STDIR}/sendmail.st
+ 	chown ${BINOWN} ${STDIR}/sendmail.st
+ 	chgrp ${BINGRP} ${STDIR}/sendmail.st
+ 	${INSTALL} -u ${BINOWN} -g ${BINGRP} -m 444 -f ${HFDIR} sendmail.hf
+ 
+ # doesn't actually install them -- you may want to install pre-nroff versions
+ install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
+ 
+ clean:
+ 	rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
+ 
+ # dependencies
+ #   gross overkill, and yet still not quite enough....
+ ${OBJS}: sendmail.h conf.h
+ 
+ depend:
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.IRIX64.6.x sendmail-8.8.6/src/Makefiles/Makefile.IRIX64.6.x
*** sendmail-8.8.5/src/Makefiles/Makefile.IRIX64.6.x	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/src/Makefiles/Makefile.IRIX64.6.x	Thu May  8 12:02:59 1997
***************
*** 0 ****
--- 1,134 ----
+ #
+ #  This Makefile is designed to work on the old "make" program.  It does
+ #  not use the obj subdirectory.  It also does not install documentation
+ #  automatically -- think of it as a quick start for sites that have the
+ #  old make program (I recommend that you get and port the new make if you
+ #  are going to be doing any signficant work on sendmail).
+ #
+ #  IRIX 6.2 is successor of IRIX 5.3.  It combines 64bit IRIX 6.[01] and
+ #  32bit IRIX 5.x.
+ #
+ #	IRIX 6.2 support provided by Kari Hurtta <Kari.Hurtta@dionysos.fmi.fi>.
+ #
+ #	@(#)Makefile.IRIX.6.x	8.5	(Berkeley)	4/7/97
+ #
+ SHELL=	/bin/sh
+ 
+ # use O=-O (usual) or O=-g (debugging)
+ O=	-O
+ 
+ # Select what ABI we are using -- see abi(5) for details
+ #    -32	~ IRIX 5.3				(default: -mips2)
+ #                 - long and pointer are 32 bit
+ #    -n32        New to IRIX 6.2			(default: -mips3)
+ #                 - long and pointer are 32 bit
+ #    -64	~ IRIX 6.1				(default: -mips4)
+ #                 - long and pointer are 64 bit
+ # We force ABI here, so then it does not depend on CPU
+ ABI=	-n32
+ 
+ # define the database mechanisms available for map & alias lookups:
+ #	-DNDBM -- use new DBM
+ #	-DNEWDB -- use new Berkeley DB (requires -ldb)
+ #	-DNIS -- include NIS support
+ # The really old (V7) DBM library is no longer supported.
+ # See READ_ME for a description of how these flags interact.
+ #
+ #  N.B.:  Include -D__BIT_TYPES_DEFINED__ if you use -DNEWDB!
+ #
+ DBMDEF=	-DNDBM -DNIS
+ #DBMDEF=	-DNDBM -DNIS -DNEWDB -D__BIT_TYPES_DEFINED__
+ 
+ # environment definitions (e.g., -D_AIX3)
+ # -DIRIX6 is needed, if you use ABI=-32
+ #    (or conf.h can't make difference between IRIX 5.3 and IRIX 6.2)
+ ENVDEF= -DIRIX6 ${ABI}
+ 
+ # see also conf.h for additional compilation flags
+ 
+ # include directories
+ INCDIRS=
+ 
+ # library directories
+ LIBDIRS=
+ 
+ # libraries required on your system
+ LIBS= -lelf
+ 
+ # loader options
+ LDOPTS=	${ABI}
+ 
+ # location of sendmail binary (usually /usr/sbin or /usr/lib)
+ BINDIR=	${DESTDIR}/usr/lib
+ 
+ # location of sendmail.st file (usually /var/log or /usr/lib)
+ STDIR=	${DESTDIR}/var
+ 
+ # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
+ HFDIR=	${DESTDIR}/etc
+ 
+ # additional .o files needed
+ OBJADD=
+ 
+ ###################  end of user configuration flags  ######################
+ 
+ CFLAGS=	-I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
+ 
+ OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
+ 	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
+ 	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
+ 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
+ 	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
+ 
+ LINKS=	${DESTDIR}/usr/bsd/newaliases ${DESTDIR}/usr/bsd/mailq \
+ 	${DESTDIR}/usr/bsd/hoststat ${DESTDIR}/usr/bsd/purgestat
+ INSTALL=install
+ BINOWN=	root
+ BINGRP=	sys
+ BINMODE=4555
+ 
+ ALL=	sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
+ 
+ all: ${ALL}
+ 
+ sendmail: ${BEFORE} ${OBJS}
+ 	${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
+ 
+ #NROFF=	nroff -h
+ NROFF=	groff -Tascii
+ MANDOC=	-mandoc
+ 
+ aliases.0: aliases.5
+ 	${NROFF} ${MANDOC} aliases.5 > aliases.0
+ 
+ mailq.0: mailq.1
+ 	${NROFF} ${MANDOC} mailq.1 > mailq.0
+ 
+ newaliases.0: newaliases.1
+ 	${NROFF} ${MANDOC} newaliases.1 > newaliases.0
+ 
+ sendmail.0: sendmail.8
+ 	${NROFF} ${MANDOC} sendmail.8 > sendmail.0
+ 
+ install: install-sendmail install-docs
+ 
+ install-sendmail: sendmail
+ 	${INSTALL} -u ${BINOWN} -g ${BINGRP} -m ${BINMODE} -f ${BINDIR} sendmail
+ 	for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
+ 	cp /dev/null ${STDIR}/sendmail.st
+ 	chmod 644 ${STDIR}/sendmail.st
+ 	chown ${BINOWN} ${STDIR}/sendmail.st
+ 	chgrp ${BINGRP} ${STDIR}/sendmail.st
+ 	${INSTALL} -u ${BINOWN} -g ${BINGRP} -m 444 -f ${HFDIR} sendmail.hf
+ 
+ # doesn't actually install them -- you may want to install pre-nroff versions
+ install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
+ 
+ clean:
+ 	rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
+ 
+ # dependencies
+ #   gross overkill, and yet still not quite enough....
+ ${OBJS}: sendmail.h conf.h
+ 
+ depend:
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.ISC sendmail-8.8.6/src/Makefiles/Makefile.ISC
*** sendmail-8.8.5/src/Makefiles/Makefile.ISC	Fri Sep 20 07:35:45 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.ISC	Fri Mar 28 09:06:42 1997
***************
*** 3,9 ****
  #
  #	Contributed by J.J. Bailey <jjb@jagware.bcc.com>
  #
! #	@(#)Makefile.ISC	8.9	(Berkeley)	9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 3,9 ----
  #
  #	Contributed by J.J. Bailey <jjb@jagware.bcc.com>
  #
! #	@(#)Makefile.ISC	8.10	(Berkeley)	3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 54,60 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 54,60 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.KSR sendmail-8.8.6/src/Makefiles/Makefile.KSR
*** sendmail-8.8.5/src/Makefiles/Makefile.KSR	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.KSR	Fri Mar 28 09:06:40 1997
***************
*** 8,14 ****
  #  This has been tested on KSR OS 1.2.2.  Contributed by Todd C. Miller
  #	<Todd.Miller@cs.colorado.edu>
  #
! #	@(#)Makefile.KSR	8.3 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 8,14 ----
  #  This has been tested on KSR OS 1.2.2.  Contributed by Todd C. Miller
  #	<Todd.Miller@cs.colorado.edu>
  #
! #	@(#)Makefile.KSR	8.4 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 58,64 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${BINDIR}/newaliases ${BINDIR}/mailq \
--- 58,64 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${BINDIR}/newaliases ${BINDIR}/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.LUNA sendmail-8.8.6/src/Makefiles/Makefile.LUNA
*** sendmail-8.8.5/src/Makefiles/Makefile.LUNA	Fri Sep 20 07:35:45 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.LUNA	Fri Mar 28 09:06:42 1997
***************
*** 5,11 ****
  #  old make program (I recommend that you get and port the new make if you
  #  are going to be doing any signficant work on sendmail).
  #
! #	@(#)Makefile.LUNA	8.6 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 5,11 ----
  #  old make program (I recommend that you get and port the new make if you
  #  are going to be doing any signficant work on sendmail).
  #
! #	@(#)Makefile.LUNA	8.7 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 59,65 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 59,65 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.Linux sendmail-8.8.6/src/Makefiles/Makefile.Linux
*** sendmail-8.8.5/src/Makefiles/Makefile.Linux	Fri Sep 20 13:08:01 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.Linux	Fri Mar 28 09:06:40 1997
***************
*** 20,26 ****
  #  to ENVDEF.  If you are running libc < 4.4.4, you must use -DHASSNPRINTF=0
  #  (or upgrade your libc -- an even better idea!).
  #
! #	@(#)Makefile.Linux	8.17 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 20,26 ----
  #  to ENVDEF.  If you are running libc < 4.4.4, you must use -DHASSNPRINTF=0
  #  (or upgrade your libc -- an even better idea!).
  #
! #	@(#)Makefile.Linux	8.18 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 73,79 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
--- 73,79 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.Linux.ppc sendmail-8.8.6/src/Makefiles/Makefile.Linux.ppc
*** sendmail-8.8.5/src/Makefiles/Makefile.Linux.ppc	Wed Oct 30 07:45:06 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.Linux.ppc	Fri Mar 28 09:06:42 1997
***************
*** 22,28 ****
  #
  #  This Makefile contributed by Paul DuBois <dubois@primate.wisc.edu>.
  #
! #	@(#)Makefile.Linux.ppc	8.2 (Berkeley) 10/30/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 22,28 ----
  #
  #  This Makefile contributed by Paul DuBois <dubois@primate.wisc.edu>.
  #
! #	@(#)Makefile.Linux.ppc	8.3 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 75,81 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
--- 75,81 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.Mach386 sendmail-8.8.6/src/Makefiles/Makefile.Mach386
*** sendmail-8.8.5/src/Makefiles/Makefile.Mach386	Fri Sep 20 07:35:43 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.Mach386	Fri Mar 28 09:06:40 1997
***************
*** 5,11 ****
  #  old make program (I recommend that you get and port the new make if you
  #  are going to be doing any signficant work on sendmail).
  #
! #	@(#)Makefile.Mach386	8.8 (Berkeley) 9/20/96
  #
  
  CC=	gcc
--- 5,11 ----
  #  old make program (I recommend that you get and port the new make if you
  #  are going to be doing any signficant work on sendmail).
  #
! #	@(#)Makefile.Mach386	8.9 (Berkeley) 3/28/97
  #
  
  CC=	gcc
***************
*** 58,64 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 58,64 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.NCR.MP-RAS.2.x sendmail-8.8.6/src/Makefiles/Makefile.NCR.MP-RAS.2.x
*** sendmail-8.8.5/src/Makefiles/Makefile.NCR.MP-RAS.2.x	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.NCR.MP-RAS.2.x	Fri Mar 28 09:07:24 1997
***************
*** 8,14 ****
  #	NCR 3000 support from Kevin Darcy <kevin@tech.mis.cfc.com>
  #		and Tom Moore <tmoore@fievel.DaytonOH.NCR.COM>.
  #
! #	@(#)Makefile.NCR.MP-RAS.2.x	8.11 (Berkeley) 9/13/95
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 8,14 ----
  #	NCR 3000 support from Kevin Darcy <kevin@tech.mis.cfc.com>
  #		and Tom Moore <tmoore@fievel.DaytonOH.NCR.COM>.
  #
! #	@(#)Makefile.NCR.MP-RAS.2.x	8.15 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 59,65 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 59,65 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.NCR.MP-RAS.3.x sendmail-8.8.6/src/Makefiles/Makefile.NCR.MP-RAS.3.x
*** sendmail-8.8.5/src/Makefiles/Makefile.NCR.MP-RAS.3.x	Fri Sep 20 07:35:46 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.NCR.MP-RAS.3.x	Fri Mar 28 09:07:24 1997
***************
*** 8,14 ****
  #	NCR SVR4 MP-RAS 3.x support from
  #	Tom Moore <tmoore@fievel.DaytonOH.NCR.COM>.
  #
! #	@(#)Makefile.NCR.MP-RAS.3.x	8.1 (Berkeley) 3/12/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 8,14 ----
  #	NCR SVR4 MP-RAS 3.x support from
  #	Tom Moore <tmoore@fievel.DaytonOH.NCR.COM>.
  #
! #	@(#)Makefile.NCR.MP-RAS.3.x	8.5 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 59,65 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 59,65 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.NEWS-OS.4.x sendmail-8.8.6/src/Makefiles/Makefile.NEWS-OS.4.x
*** sendmail-8.8.5/src/Makefiles/Makefile.NEWS-OS.4.x	Sat Nov 16 18:16:48 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.NEWS-OS.4.x	Fri Mar 28 09:06:42 1997
***************
*** 5,11 ****
  #  old make program (I recommend that you get and port the new make if you
  #  are going to be doing any signficant work on sendmail).
  #
! #	@(#)Makefile.NEWS-OS.4.x	8.7 (Berkeley) 11/16/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 5,11 ----
  #  old make program (I recommend that you get and port the new make if you
  #  are going to be doing any signficant work on sendmail).
  #
! #	@(#)Makefile.NEWS-OS.4.x	8.8 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 62,68 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 62,68 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.NEWS-OS.6.x sendmail-8.8.6/src/Makefiles/Makefile.NEWS-OS.6.x
*** sendmail-8.8.5/src/Makefiles/Makefile.NEWS-OS.6.x	Fri Sep 20 07:35:45 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.NEWS-OS.6.x	Fri Mar 28 09:06:42 1997
***************
*** 7,13 ****
  #
  #  This has been tested on NEWS-OS 6.0.3
  #
! #	@(#)Makefile.NEWS-OS.6.x	8.6 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 7,13 ----
  #
  #  This has been tested on NEWS-OS 6.0.3
  #
! #	@(#)Makefile.NEWS-OS.6.x	8.7 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 66,72 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 66,72 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.NeXT.2.x sendmail-8.8.6/src/Makefiles/Makefile.NeXT.2.x
*** sendmail-8.8.5/src/Makefiles/Makefile.NeXT.2.x	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.NeXT.2.x	Fri Mar 28 09:06:42 1997
***************
*** 7,13 ****
  #
  #  This has been tested on NeXT 2.1.
  #
! #	@(#)Makefile.NeXT.2.x	8.11 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 7,13 ----
  #
  #  This has been tested on NeXT 2.1.
  #
! #	@(#)Makefile.NeXT.2.x	8.12 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 60,66 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 60,66 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.NeXT.3.x sendmail-8.8.6/src/Makefiles/Makefile.NeXT.3.x
*** sendmail-8.8.5/src/Makefiles/Makefile.NeXT.3.x	Fri Sep 20 10:13:15 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.NeXT.3.x	Fri Mar 28 09:06:40 1997
***************
*** 7,13 ****
  #
  #  This has been tested on NEXTSTEP 3.3.
  #
! #	@(#)Makefile.NeXT.3.x	8.6 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 7,13 ----
  #
  #  This has been tested on NEXTSTEP 3.3.
  #
! #	@(#)Makefile.NeXT.3.x	8.7 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 68,74 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 68,74 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.NetBSD sendmail-8.8.6/src/Makefiles/Makefile.NetBSD
*** sendmail-8.8.5/src/Makefiles/Makefile.NetBSD	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.NetBSD	Fri Mar 28 09:06:40 1997
***************
*** 1,7 ****
  #
  #  NetBSD Makefile
  #
! #	@(#)Makefile.NetBSD	8.5 (Berkeley) 9/20/96
  #	@Id: Makefile.NetBSD,v 1.3 1994/02/01 05:33:44 glass Exp $
  #
  
--- 1,7 ----
  #
  #  NetBSD Makefile
  #
! #	@(#)Makefile.NetBSD	8.6 (Berkeley) 3/28/97
  #	@Id: Makefile.NetBSD,v 1.3 1994/02/01 05:33:44 glass Exp $
  #
  
***************
*** 21,29 ****
  
  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 savemail.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
  #MAN1=	mailq.0 newaliases.0
  #MAN5=	aliases.0
--- 21,29 ----
  
  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
  MAN=	aliases.5 mailq.1 newaliases.1 sendmail.8
  #MAN1=	mailq.0 newaliases.0
  #MAN5=	aliases.0
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.NonStop-UX sendmail-8.8.6/src/Makefiles/Makefile.NonStop-UX
*** sendmail-8.8.5/src/Makefiles/Makefile.NonStop-UX	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.NonStop-UX	Fri Mar 28 09:06:40 1997
***************
*** 9,15 ****
  #	(I don't think this actually compiles cleanly -- I had trouble
  #	 integrating Rick's changes.  EPA 6/94)
  #
! #	@(#)Makefile.NonStop-UX	8.7 (Berkeley) 9/20/96
  #
  
  # make sure the shell constructs below use the right shell
--- 9,15 ----
  #	(I don't think this actually compiles cleanly -- I had trouble
  #	 integrating Rick's changes.  EPA 6/94)
  #
! #	@(#)Makefile.NonStop-UX	8.8 (Berkeley) 3/28/97
  #
  
  # make sure the shell constructs below use the right shell
***************
*** 62,68 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 62,68 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.OSF1 sendmail-8.8.6/src/Makefiles/Makefile.OSF1
*** sendmail-8.8.5/src/Makefiles/Makefile.OSF1	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.OSF1	Fri Mar 28 09:06:40 1997
***************
*** 7,13 ****
  #
  #  This has been tested on OSF/1 1.3
  #
! #	@(#)Makefile.OSF1	8.10 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 7,13 ----
  #
  #  This has been tested on OSF/1 1.3
  #
! #	@(#)Makefile.OSF1	8.11 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 62,68 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${BINDIR}/newaliases ${BINDIR}/mailq \
--- 62,68 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${BINDIR}/newaliases ${BINDIR}/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.PTX sendmail-8.8.6/src/Makefiles/Makefile.PTX
*** sendmail-8.8.5/src/Makefiles/Makefile.PTX	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.PTX	Fri Mar 28 09:06:40 1997
***************
*** 9,15 ****
  #
  #	From Tim "Pinball Wizard" Wright <timw@sequent.com>.
  #
! #	@(#)Makefile.PTX	8.10 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 9,15 ----
  #
  #	From Tim "Pinball Wizard" Wright <timw@sequent.com>.
  #
! #	@(#)Makefile.PTX	8.11 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 63,69 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
--- 63,69 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.Paragon sendmail-8.8.6/src/Makefiles/Makefile.Paragon
*** sendmail-8.8.5/src/Makefiles/Makefile.Paragon	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.Paragon	Fri Mar 28 09:06:42 1997
***************
*** 7,13 ****
  #
  #  This has been tested on OSF/1 1.3
  #
! #	@(#)Makefile.Paragon	8.7 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 7,13 ----
  #
  #  This has been tested on OSF/1 1.3
  #
! #	@(#)Makefile.Paragon	8.8 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 58,64 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${BINDIR}/newaliases ${BINDIR}/mailq \
--- 58,64 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${BINDIR}/newaliases ${BINDIR}/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.PowerUX sendmail-8.8.6/src/Makefiles/Makefile.PowerUX
*** sendmail-8.8.5/src/Makefiles/Makefile.PowerUX	Thu Jan 16 15:55:13 1997
--- sendmail-8.8.6/src/Makefiles/Makefile.PowerUX	Fri Mar 28 09:06:42 1997
***************
*** 5,11 ****
  #  old make program (I recommend that you get and port the new make if you
  #  are going to be doing any signficant work on sendmail).
  #
! #	@(#)Makefile.PowerUX	8.1 (Berkeley) 1/16/97
  #
  #  Harris Nighthawk 6000 series (nh6000) PowerUX Makefile
  #  Bob Miorelli, Pratt & Whitney   <miorelli@pweh.com>
--- 5,11 ----
  #  old make program (I recommend that you get and port the new make if you
  #  are going to be doing any signficant work on sendmail).
  #
! #	@(#)Makefile.PowerUX	8.2 (Berkeley) 3/28/97
  #
  #  Harris Nighthawk 6000 series (nh6000) PowerUX Makefile
  #  Bob Miorelli, Pratt & Whitney   <miorelli@pweh.com>
***************
*** 62,68 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${BINDIR}/newaliases ${BINDIR}/mailq
--- 62,68 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${BINDIR}/newaliases ${BINDIR}/mailq
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.RISCos sendmail-8.8.6/src/Makefiles/Makefile.RISCos
*** sendmail-8.8.5/src/Makefiles/Makefile.RISCos	Fri Sep 20 07:35:43 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.RISCos	Fri Mar 28 09:06:40 1997
***************
*** 7,13 ****
  #
  #	For Mips RISC/os 4.52.
  #
! #	@(#)Makefile.RISCos	8.12 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 7,13 ----
  #
  #	For Mips RISC/os 4.52.
  #
! #	@(#)Makefile.RISCos	8.14 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 61,67 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 61,67 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
***************
*** 78,85 ****
  sendmail: ${BEFORE} ${OBJS}
  	${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
  
! stdlib.h unistd.h stddef.h:
  	cp /dev/null $@
  
  dirent.h:
  	echo "#include <sys/dir.h>" > dirent.h
--- 78,88 ----
  sendmail: ${BEFORE} ${OBJS}
  	${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
  
! stdlib.h stddef.h:
  	cp /dev/null $@
+ 
+ unistd.h:
+ 	echo "typedef unsigned short	mode_t;" > unistd.h
  
  dirent.h:
  	echo "#include <sys/dir.h>" > dirent.h
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.SCO sendmail-8.8.6/src/Makefiles/Makefile.SCO
*** sendmail-8.8.5/src/Makefiles/Makefile.SCO	Sun Nov 10 11:15:56 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.SCO	Fri Mar 28 09:06:40 1997
***************
*** 7,13 ****
  #
  #  This has been tested on SCO.
  #
! #	@(#)Makefile.SCO	8.10 (Berkeley) 11/10/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 7,13 ----
  #
  #  This has been tested on SCO.
  #
! #	@(#)Makefile.SCO	8.11 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 55,61 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 55,61 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.SCO.4.2 sendmail-8.8.6/src/Makefiles/Makefile.SCO.4.2
*** sendmail-8.8.5/src/Makefiles/Makefile.SCO.4.2	Sun Nov 10 11:15:56 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.SCO.4.2	Fri Mar 28 09:06:42 1997
***************
*** 7,13 ****
  #
  #  Tested on SCO rel 4.2 by Marian Durkovic <marian@svf.stuba.sk>.
  #
! #	@(#)Makefile.SCO.4.2	8.4 (Berkeley) 11/10/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 7,13 ----
  #
  #  Tested on SCO rel 4.2 by Marian Durkovic <marian@svf.stuba.sk>.
  #
! #	@(#)Makefile.SCO.4.2	8.5 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 55,61 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 55,61 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.SCO.5.x sendmail-8.8.6/src/Makefiles/Makefile.SCO.5.x
*** sendmail-8.8.5/src/Makefiles/Makefile.SCO.5.x	Fri Nov 22 07:25:56 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.SCO.5.x	Fri Mar 28 09:06:42 1997
***************
*** 7,13 ****
  #
  #  Tested on SCO OpenServer 5 by Keith Reynolds <keithr@sco.COM>.
  #
! #	@(#)Makefile.SCO.5.x	8.4 (Berkeley) 11/22/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 7,13 ----
  #
  #  Tested on SCO OpenServer 5 by Keith Reynolds <keithr@sco.COM>.
  #
! #	@(#)Makefile.SCO.5.x	8.5 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 56,62 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 56,62 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.SINIX sendmail-8.8.6/src/Makefiles/Makefile.SINIX
*** sendmail-8.8.5/src/Makefiles/Makefile.SINIX	Sat Dec 14 19:15:40 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.SINIX	Fri Mar 28 09:06:42 1997
***************
*** 6,12 ****
  #
  #	Contributed by Gerald Rinske <Gerald.Rinske@mch.sni.de>.
  #
! #	@(#)Makefile.SINIX	8.1 (Berkeley) 12/14/96
  #
  
  # make sure the shell constructs below use the right shell
--- 6,12 ----
  #
  #	Contributed by Gerald Rinske <Gerald.Rinske@mch.sni.de>.
  #
! #	@(#)Makefile.SINIX	8.2 (Berkeley) 3/28/97
  #
  
  # make sure the shell constructs below use the right shell
***************
*** 60,66 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 60,66 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.SMP_DC.OSx.NILE sendmail-8.8.6/src/Makefiles/Makefile.SMP_DC.OSx.NILE
*** sendmail-8.8.5/src/Makefiles/Makefile.SMP_DC.OSx.NILE	Fri Sep 20 07:35:45 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.SMP_DC.OSx.NILE	Fri Mar 28 09:06:42 1997
***************
*** 9,15 ****
  #
  #	Contributed by Earle F. Ake <akee@wpdis03.wpafb.af.mil>.
  #
! #	@(#)Makefile.SMP_DC.OSx.NILE	8.2 (Berkeley) 9/20/96
  #
  
  # make sure the shell constructs below use the right shell
--- 9,15 ----
  #
  #	Contributed by Earle F. Ake <akee@wpdis03.wpafb.af.mil>.
  #
! #	@(#)Makefile.SMP_DC.OSx.NILE	8.3 (Berkeley) 3/28/97
  #
  
  # make sure the shell constructs below use the right shell
***************
*** 63,69 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
--- 63,69 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.SVR4 sendmail-8.8.6/src/Makefiles/Makefile.SVR4
*** sendmail-8.8.5/src/Makefiles/Makefile.SVR4	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.SVR4	Fri Mar 28 09:06:40 1997
***************
*** 9,15 ****
  #	<kim@grendel.lut.fi> -- I haven't tested this myself.  It may
  #	work on other SVR4 ports.
  #
! #	@(#)Makefile.SVR4	8.8 (Berkeley) 9/20/96
  #
  
  # make sure the shell constructs below use the right shell
--- 9,15 ----
  #	<kim@grendel.lut.fi> -- I haven't tested this myself.  It may
  #	work on other SVR4 ports.
  #
! #	@(#)Makefile.SVR4	8.9 (Berkeley) 3/28/97
  #
  
  # make sure the shell constructs below use the right shell
***************
*** 63,69 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 63,69 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.SunOS sendmail-8.8.6/src/Makefiles/Makefile.SunOS
*** sendmail-8.8.5/src/Makefiles/Makefile.SunOS	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.SunOS	Fri Mar 28 09:06:40 1997
***************
*** 10,16 ****
  #		create empty files stdlib.h and stddef.h in your
  #		compile directory.
  #
! #	@(#)Makefile.SunOS	8.10 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 10,16 ----
  #		create empty files stdlib.h and stddef.h in your
  #		compile directory.
  #
! #	@(#)Makefile.SunOS	8.11 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 62,68 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 62,68 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.SunOS.4.0 sendmail-8.8.6/src/Makefiles/Makefile.SunOS.4.0
*** sendmail-8.8.5/src/Makefiles/Makefile.SunOS.4.0	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/src/Makefiles/Makefile.SunOS.4.0	Fri Mar 28 09:06:42 1997
***************
*** 0 ****
--- 1,119 ----
+ #
+ #  This Makefile is designed to work on the old "make" program.  It does
+ #  not use the obj subdirectory.  It also does not install documentation
+ #  automatically -- think of it as a quick start for sites that have the
+ #  old make program (I recommend that you get and port the new make if you
+ #  are going to be doing any significant work on sendmail).
+ #
+ #	You may find you need to find versions of some routines
+ #	such as strcasecmp in order to link this on SunOS 4.0.3.
+ #
+ #	@(#)Makefile.SunOS.4.0	8.13 (Berkeley) 3/28/97
+ #
+ 
+ # use O=-O (usual) or O=-g (debugging)
+ O=	-O
+ 
+ # define the database mechanisms available for map & alias lookups:
+ #	-DNDBM -- use new DBM
+ #	-DNEWDB -- use new Berkeley DB
+ #	-DNIS -- include NIS support
+ # The really old (V7) DBM library is no longer supported.
+ # See READ_ME for a description of how these flags interact.
+ #
+ DBMDEF=	-DNDBM -DNEWDB -DNIS
+ 
+ # environment definitions (e.g., -D_AIX3)
+ ENVDEF=	-DSUNOS403
+ 
+ # see also conf.h for additional compilation flags
+ 
+ # include directories
+ INCDIRS=-I/usr/sww/include
+ 
+ # loader options
+ LDOPTS=	-Bstatic
+ 
+ # library directories
+ LIBDIRS=-L/usr/sww/lib
+ 
+ # libraries required on your system
+ LIBS=	-ldb -lresolv
+ 
+ # location of sendmail binary (usually /usr/sbin or /usr/lib)
+ BINDIR=	${DESTDIR}/usr/lib
+ 
+ # location of sendmail.st file (usually /var/log or /usr/lib)
+ STDIR=	${DESTDIR}/etc
+ 
+ # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
+ HFDIR=	${DESTDIR}/usr/lib
+ 
+ # additional .o files needed
+ OBJADD=
+ 
+ BEFORE=	stdlib.h stddef.h limits.h
+ 
+ ###################  end of user configuration flags  ######################
+ 
+ CFLAGS=	-I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
+ 
+ OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
+ 	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
+ 	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
+ 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
+ 	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
+ 
+ LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
+ 	${DESTDIR}/usr/ucb/hoststat ${DESTDIR}/usr/ucb/purgestat
+ INSTALL=install
+ BINOWN=	root
+ BINGRP=	kmem
+ BINMODE=6555
+ 
+ ALL=	sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
+ 
+ all: ${ALL}
+ 
+ sendmail: ${BEFORE} ${OBJS}
+ 	${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
+ 
+ stddef.h stdlib.h limits.h:
+ 	cp /dev/null $@
+ 
+ #NROFF=	nroff -h
+ NROFF=	groff -Tascii
+ MANDOC=	-mandoc
+ 
+ aliases.0: aliases.5
+ 	${NROFF} ${MANDOC} aliases.5 > aliases.0
+ 
+ mailq.0: mailq.1
+ 	${NROFF} ${MANDOC} mailq.1 > mailq.0
+ 
+ newaliases.0: newaliases.1
+ 	${NROFF} ${MANDOC} newaliases.1 > newaliases.0
+ 
+ sendmail.0: sendmail.8
+ 	${NROFF} ${MANDOC} sendmail.8 > sendmail.0
+ 
+ install: install-sendmail install-docs
+ 
+ install-sendmail: sendmail
+ 	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
+ 	for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
+ 	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
+ 	    ${STDIR}/sendmail.st
+ 	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
+ 
+ # doesn't actually install them -- you may want to install pre-nroff versions
+ install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
+ 
+ clean:
+ 	rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
+ 
+ # dependencies
+ #   gross overkill, and yet still not quite enough....
+ ${OBJS}: sendmail.h conf.h
+ 
+ depend:
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.SunOS.5.1 sendmail-8.8.6/src/Makefiles/Makefile.SunOS.5.1
*** sendmail-8.8.5/src/Makefiles/Makefile.SunOS.5.1	Thu Jan 16 15:31:26 1997
--- sendmail-8.8.6/src/Makefiles/Makefile.SunOS.5.1	Fri Mar 28 09:06:42 1997
***************
*** 8,14 ****
  #  This has been tested on Solaris 2.1 and 2.2.  It DOES NOT WORK on
  #  versions of Solaris after 2.2.
  #
! #	@(#)Makefile.SunOS.5.1	8.18 (Berkeley) 1/16/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 8,14 ----
  #  This has been tested on Solaris 2.1 and 2.2.  It DOES NOT WORK on
  #  versions of Solaris after 2.2.
  #
! #	@(#)Makefile.SunOS.5.1	8.19 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 63,69 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 63,69 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.SunOS.5.2 sendmail-8.8.6/src/Makefiles/Makefile.SunOS.5.2
*** sendmail-8.8.5/src/Makefiles/Makefile.SunOS.5.2	Thu Jan 16 15:31:26 1997
--- sendmail-8.8.6/src/Makefiles/Makefile.SunOS.5.2	Fri Mar 28 09:06:42 1997
***************
*** 8,14 ****
  #  This has been tested on Solaris 2.1 and 2.2.  It DOES NOT WORK on
  #  versions of Solaris after 2.2.
  #
! #	@(#)Makefile.SunOS.5.1	8.18 (Berkeley) 1/16/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 8,14 ----
  #  This has been tested on Solaris 2.1 and 2.2.  It DOES NOT WORK on
  #  versions of Solaris after 2.2.
  #
! #	@(#)Makefile.SunOS.5.1	8.19 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 63,69 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 63,69 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.SunOS.5.3 sendmail-8.8.6/src/Makefiles/Makefile.SunOS.5.3
*** sendmail-8.8.5/src/Makefiles/Makefile.SunOS.5.3	Thu Jan 16 15:31:26 1997
--- sendmail-8.8.6/src/Makefiles/Makefile.SunOS.5.3	Fri Mar 28 09:06:42 1997
***************
*** 7,13 ****
  #
  #  This has been tested on Solaris 2.3.
  #
! #	@(#)Makefile.SunOS.5.3	8.18 (Berkeley) 1/16/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 7,13 ----
  #
  #  This has been tested on Solaris 2.3.
  #
! #	@(#)Makefile.SunOS.5.3	8.19 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 62,68 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
--- 62,68 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.SunOS.5.4 sendmail-8.8.6/src/Makefiles/Makefile.SunOS.5.4
*** sendmail-8.8.5/src/Makefiles/Makefile.SunOS.5.4	Thu Jan 16 15:31:26 1997
--- sendmail-8.8.6/src/Makefiles/Makefile.SunOS.5.4	Fri Mar 28 09:06:40 1997
***************
*** 7,13 ****
  #
  #  This has been tested on Solaris 2.4.
  #
! #	@(#)Makefile.SunOS.5.4	8.20 (Berkeley) 1/16/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 7,13 ----
  #
  #  This has been tested on Solaris 2.4.
  #
! #	@(#)Makefile.SunOS.5.4	8.21 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 65,71 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
--- 65,71 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.SunOS.5.5 sendmail-8.8.6/src/Makefiles/Makefile.SunOS.5.5
*** sendmail-8.8.5/src/Makefiles/Makefile.SunOS.5.5	Thu Jan 16 15:31:26 1997
--- sendmail-8.8.6/src/Makefiles/Makefile.SunOS.5.5	Sun Apr 13 17:29:29 1997
***************
*** 7,13 ****
  #
  #  This has been tested on Solaris 2.5.
  #
! #	@(#)Makefile.SunOS.5.5	8.8 (Berkeley) 1/16/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 7,13 ----
  #
  #  This has been tested on Solaris 2.5.
  #
! #	@(#)Makefile.SunOS.5.5	8.10 (Berkeley) 4/13/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 38,43 ****
--- 38,44 ----
  
  # libraries required on your system
  #  delete -l44bsd if you are not running BIND 4.9.x
+ #  add -ldb if you add -DNEWDB above (in DBMDEF)
  LIBS=	-lresolv -l44bsd -lsocket -lnsl -lkstat
  
  # location of sendmail binary (usually /usr/sbin or /usr/lib)
***************
*** 62,68 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
--- 63,69 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.SunOS.5.6 sendmail-8.8.6/src/Makefiles/Makefile.SunOS.5.6
*** sendmail-8.8.5/src/Makefiles/Makefile.SunOS.5.6	Thu Jan 16 15:30:45 1997
--- sendmail-8.8.6/src/Makefiles/Makefile.SunOS.5.6	Fri Mar 28 09:06:42 1997
***************
*** 7,13 ****
  #
  #  This has been tested on Solaris 2.6.
  #
! #	@(#)Makefile.SunOS.5.6	8.1 (Berkeley) 1/16/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 7,13 ----
  #
  #  This has been tested on Solaris 2.6.
  #
! #	@(#)Makefile.SunOS.5.6	8.2 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 62,68 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
--- 62,68 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.Titan sendmail-8.8.6/src/Makefiles/Makefile.Titan
*** sendmail-8.8.5/src/Makefiles/Makefile.Titan	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.Titan	Fri Mar 28 09:06:40 1997
***************
*** 5,11 ****
  #  old make program (I recommend that you get and port the new make if you
  #  are going to be doing any signficant work on sendmail).
  #
! #	@(#)Makefile.Titan	8.8 (Berkeley) 9/20/96
  #
  
  # put the compiler in BSD mode
--- 5,11 ----
  #  old make program (I recommend that you get and port the new make if you
  #  are going to be doing any signficant work on sendmail).
  #
! #	@(#)Makefile.Titan	8.9 (Berkeley) 3/28/97
  #
  
  # put the compiler in BSD mode
***************
*** 62,68 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 62,68 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.ULTRIX sendmail-8.8.6/src/Makefiles/Makefile.ULTRIX
*** sendmail-8.8.5/src/Makefiles/Makefile.ULTRIX	Wed Oct  2 08:54:51 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.ULTRIX	Fri Mar 28 09:06:41 1997
***************
*** 7,13 ****
  #
  #	This has been tested on Ultrix 4.2A and 4.3A.
  #
! #	@(#)Makefile.ULTRIX	8.13 (Berkeley) 10/2/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 7,13 ----
  #
  #	This has been tested on Ultrix 4.2A and 4.3A.
  #
! #	@(#)Makefile.ULTRIX	8.14 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 63,69 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 63,69 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.UMAX sendmail-8.8.6/src/Makefiles/Makefile.UMAX
*** sendmail-8.8.5/src/Makefiles/Makefile.UMAX	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.UMAX	Fri Mar 28 09:06:41 1997
***************
*** 7,13 ****
  #
  #	This has been tested on Encore UMAX V
  #
! #	@(#)Makefile.UMAX	8.8 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 7,13 ----
  #
  #	This has been tested on Encore UMAX V
  #
! #	@(#)Makefile.UMAX	8.9 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 65,71 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 65,71 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.UNICOS sendmail-8.8.6/src/Makefiles/Makefile.UNICOS
*** sendmail-8.8.5/src/Makefiles/Makefile.UNICOS	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.UNICOS	Fri Mar 28 09:06:42 1997
***************
*** 11,17 ****
  #		Douglas K. Rand, University of North Dakota
  #		rand@aero.und.nodak.edu
  #
! #       @(#)Makefile.UNICOS	8.5	(Berkeley)	9/20/96
  #
  
  # make sure the shell constructs below use the right shell
--- 11,17 ----
  #		Douglas K. Rand, University of North Dakota
  #		rand@aero.und.nodak.edu
  #
! #       @(#)Makefile.UNICOS	8.6	(Berkeley)	3/28/97
  #
  
  # make sure the shell constructs below use the right shell
***************
*** 63,69 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 63,69 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.UNIX_SV.4.x.i386 sendmail-8.8.6/src/Makefiles/Makefile.UNIX_SV.4.x.i386
*** sendmail-8.8.5/src/Makefiles/Makefile.UNIX_SV.4.x.i386	Fri Sep 20 07:35:45 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.UNIX_SV.4.x.i386	Fri Mar 28 09:06:42 1997
***************
*** 9,15 ****
  #
  #  For UnixWare 2.x, use -DUNIXWARE2 in ENVDEF in place of -DUNIXWARE.
  #
! #	@(#)Makefile.UNIX_SV.4.x.i386	8.7 (Berkeley) 9/20/96
  #
  
  # make sure the shell constructs below use the right shell
--- 9,15 ----
  #
  #  For UnixWare 2.x, use -DUNIXWARE2 in ENVDEF in place of -DUNIXWARE.
  #
! #	@(#)Makefile.UNIX_SV.4.x.i386	8.8 (Berkeley) 3/28/97
  #
  
  # make sure the shell constructs below use the right shell
***************
*** 64,70 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 64,70 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.UX4800 sendmail-8.8.6/src/Makefiles/Makefile.UX4800
*** sendmail-8.8.5/src/Makefiles/Makefile.UX4800	Fri Sep 20 07:35:45 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.UX4800	Fri Mar 28 09:06:42 1997
***************
*** 8,14 ****
  #  This has been tested on NEC UX4800.
  #  Contributed by Kazuhisa Shimizu <shimizu@lang.csd.nes.nec.co.jp>.
  #
! #	@(#)Makefile.UX4800	8.4 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 8,14 ----
  #  This has been tested on NEC UX4800.
  #  Contributed by Kazuhisa Shimizu <shimizu@lang.csd.nes.nec.co.jp>.
  #
! #	@(#)Makefile.UX4800	8.5 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 66,72 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 66,72 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.UXPDS.V10 sendmail-8.8.6/src/Makefiles/Makefile.UXPDS.V10
*** sendmail-8.8.5/src/Makefiles/Makefile.UXPDS.V10	Sat Nov 16 09:28:17 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.UXPDS.V10	Fri Mar 28 09:06:42 1997
***************
*** 12,18 ****
  #	and Toshiaki Nomura of the Fujitsu FreeSoftware Group
  #	<dsfrsoft@oai6.yk.fujitsu.co.jp>.
  #
! #	@(#)Makefile.UXPDS.V10	8.7 (Berkeley) 11/16/96
  #
  
  # make sure the shell constructs below use the right shell
--- 12,18 ----
  #	and Toshiaki Nomura of the Fujitsu FreeSoftware Group
  #	<dsfrsoft@oai6.yk.fujitsu.co.jp>.
  #
! #	@(#)Makefile.UXPDS.V10	8.8 (Berkeley) 3/28/97
  #
  
  # make sure the shell constructs below use the right shell
***************
*** 76,82 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 76,82 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.UXPDS.V20 sendmail-8.8.6/src/Makefiles/Makefile.UXPDS.V20
*** sendmail-8.8.5/src/Makefiles/Makefile.UXPDS.V20	Fri Dec  6 09:20:06 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.UXPDS.V20	Fri Mar 28 09:06:42 1997
***************
*** 12,18 ****
  #	and Toshiaki Nomura of the Fujitsu FreeSoftware Group
  #	<dsfrsoft@oai6.yk.fujitsu.co.jp>.
  #
! #	@(#)Makefile.UXPDS.V20	8.7 (Berkeley) 12/6/96
  #
  
  # make sure the shell constructs below use the right shell
--- 12,18 ----
  #	and Toshiaki Nomura of the Fujitsu FreeSoftware Group
  #	<dsfrsoft@oai6.yk.fujitsu.co.jp>.
  #
! #	@(#)Makefile.UXPDS.V20	8.8 (Berkeley) 3/28/97
  #
  
  # make sure the shell constructs below use the right shell
***************
*** 76,82 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 76,82 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.Utah sendmail-8.8.6/src/Makefiles/Makefile.Utah
*** sendmail-8.8.5/src/Makefiles/Makefile.Utah	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.Utah	Fri Mar 28 09:06:41 1997
***************
*** 1,4 ****
! #	@(#)Makefile.Utah	8.4 (Berkeley) 9/20/96
  
  PROG=	sendmail
  
--- 1,4 ----
! #	@(#)Makefile.Utah	8.5 (Berkeley) 3/28/97
  
  PROG=	sendmail
  
***************
*** 16,24 ****
  
  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 mci.c parseaddr.c queue.c readcf.c recipient.c savemail.c \
! 	srvrsmtp.c stab.c stats.c sysexits.c trace.c udb.c usersmtp.c \
! 	util.c version.c
  DPADD=	${LIBDBM} ${LIBCOMPAT}
  LDADD=	
  MAN1=	mailq.0 newaliases.0
--- 16,24 ----
  
  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
  DPADD=	${LIBDBM} ${LIBCOMPAT}
  LDADD=	
  MAN1=	mailq.0 newaliases.0
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.dgux sendmail-8.8.6/src/Makefiles/Makefile.dgux
*** sendmail-8.8.5/src/Makefiles/Makefile.dgux	Fri Sep 20 07:35:43 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.dgux	Fri Mar 28 09:06:40 1997
***************
*** 2,8 ****
  #  Tested on DG/UX 5.4.2 by A. Bryan Curnutt <bryan@Stoner.COM>.
  #  Updated for DG/UX 5.4.3 by Mark T. Robinson <mtr@ornl.gov>.
  #
! #	@(#)Makefile.dgux	8.10 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 2,8 ----
  #  Tested on DG/UX 5.4.2 by A. Bryan Curnutt <bryan@Stoner.COM>.
  #  Updated for DG/UX 5.4.3 by Mark T. Robinson <mtr@ornl.gov>.
  #
! #	@(#)Makefile.dgux	8.11 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 54,60 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 54,60 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.dist sendmail-8.8.6/src/Makefiles/Makefile.dist
*** sendmail-8.8.5/src/Makefiles/Makefile.dist	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.dist	Fri Mar 28 09:06:41 1997
***************
*** 5,11 ****
  #  old make program (I recommend that you get and port the new make if you
  #  are going to be doing any signficant work on sendmail).
  #
! #	@(#)Makefile.dist	8.18 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
--- 5,11 ----
  #  old make program (I recommend that you get and port the new make if you
  #  are going to be doing any signficant work on sendmail).
  #
! #	@(#)Makefile.dist	8.19 (Berkeley) 3/28/97
  #
  
  # use O=-O (usual) or O=-g (debugging)
***************
*** 57,63 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 57,63 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.maxion sendmail-8.8.6/src/Makefiles/Makefile.maxion
*** sendmail-8.8.5/src/Makefiles/Makefile.maxion	Fri Sep 20 07:35:45 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.maxion	Fri Mar 28 09:06:42 1997
***************
*** 5,11 ****
  #  old make program (I recommend that you get and port the new make if you
  #  are going to be doing any signficant work on sendmail).
  #
! #	@(#)Makefile.maxion	8.3 (Berkeley) 9/20/96
  #
  #	Concurrent Computer Corporation Maxion support contributed by
  #	Donald R. Laster Jr. <laster@access.digex.net>.
--- 5,11 ----
  #  old make program (I recommend that you get and port the new make if you
  #  are going to be doing any signficant work on sendmail).
  #
! #	@(#)Makefile.maxion	8.4 (Berkeley) 3/28/97
  #
  #	Concurrent Computer Corporation Maxion support contributed by
  #	Donald R. Laster Jr. <laster@access.digex.net>.
***************
*** 61,67 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
--- 61,67 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq \
diff -Ncr sendmail-8.8.5/src/Makefiles/Makefile.uts.systemV sendmail-8.8.6/src/Makefiles/Makefile.uts.systemV
*** sendmail-8.8.5/src/Makefiles/Makefile.uts.systemV	Fri Sep 20 07:35:45 1996
--- sendmail-8.8.6/src/Makefiles/Makefile.uts.systemV	Fri Mar 28 09:06:42 1997
***************
*** 8,14 ****
  #  By Janet Jackson <janet@dialix.oz.au> 1994-11-24
  #	This has been tested on (uname -a output) uts bsuts systemV 2.1.5 5890
  #
! #	@(#)Makefile.uts.systemV	8.5 (Berkeley) 9/20/96
  #
  
  #  Sendmail 8 on UTS requires BIND 4.9's include files and lib44bsd and
--- 8,14 ----
  #  By Janet Jackson <janet@dialix.oz.au> 1994-11-24
  #	This has been tested on (uname -a output) uts bsuts systemV 2.1.5 5890
  #
! #	@(#)Makefile.uts.systemV	8.6 (Berkeley) 3/28/97
  #
  
  #  Sendmail 8 on UTS requires BIND 4.9's include files and lib44bsd and
***************
*** 72,78 ****
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/lib/newaliases ${DESTDIR}/usr/lib/mailq \
--- 72,78 ----
  OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
! 	safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  
  LINKS=	${DESTDIR}/usr/lib/newaliases ${DESTDIR}/usr/lib/mailq \
diff -Ncr sendmail-8.8.5/src/READ_ME sendmail-8.8.6/src/READ_ME
*** sendmail-8.8.5/src/READ_ME	Tue Jan 21 07:47:03 1997
--- sendmail-8.8.6/src/READ_ME	Tue Jun  3 12:34:11 1997
***************
*** 1,4 ****
! # Copyright (c) 1983, 1995, 1996 Eric P. Allman
  # Copyright (c) 1988 The Regents of the University of California.
  # All rights reserved.
  #
--- 1,4 ----
! # Copyright (c) 1983, 1995-1997 Eric P. Allman
  # Copyright (c) 1988 The Regents of the University of California.
  # All rights reserved.
  #
***************
*** 30,36 ****
  # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  # SUCH DAMAGE.
  #
! #	@(#)READ_ME	8.135 (Berkeley) 1/21/97
  #
  
  This directory contains the source files for sendmail.
--- 30,36 ----
  # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  # SUCH DAMAGE.
  #
! #	@(#)READ_ME	8.142 (Berkeley) 6/3/97
  #
  
  This directory contains the source files for sendmail.
***************
*** 149,155 ****
  NEWDB		The new Berkeley DB package.  Some systems (e.g., BSD/OS and
  		Digital UNIX 4.0) have this package pre-installed.  If your
  		system does not have NEWDB installed, get the latest version
! 		from FTP.CS.Berkeley.EDU in /ucb/4bsd/db.tar.gz (or db.tar.Z).
  		DO NOT use the version from the Net2 distribution.  If you are
  		still running BSD/386 1.x, you will also need to define
  		OLD_NEWDB.
--- 149,155 ----
  NEWDB		The new Berkeley DB package.  Some systems (e.g., BSD/OS and
  		Digital UNIX 4.0) have this package pre-installed.  If your
  		system does not have NEWDB installed, get the latest version
! 		from FTP://ftp.sleepycat.com/db/packages/db.1.85.tar.gz.
  		DO NOT use the version from the Net2 distribution.  If you are
  		still running BSD/386 1.x, you will also need to define
  		OLD_NEWDB.
***************
*** 273,286 ****
  		security, since sendmail doesn't have to read .forward
  		and :include: files as root.  There are certain attacks
  		that may be unpreventable without this call.
! USESETEUID	Define this to 1 if you have seteuid(2) if you have a seteuid
! 		system call that will allow root to set only the effective
! 		user id to an arbitrary value ***AND*** you have saved user
! 		ids.  This is preferable to HASSETREUID if these conditions
! 		are fulfilled.  These are the semantics of the to-be-released
! 		revision of Posix.1.  The test program ../test/t_seteuid.c
! 		will try this out on your system.  If you define both
! 		HASSETREUID and USESETEUID, the former is ignored.
  HASLSTAT	Define this if you have symbolic links (and thus the
  		lstat(2) system call).  This improves security.  Unlike
  		most other options, this one is on by default, so you
--- 273,286 ----
  		security, since sendmail doesn't have to read .forward
  		and :include: files as root.  There are certain attacks
  		that may be unpreventable without this call.
! USESETEUID	Define this to 1 if you have a seteuid(2) system call that
! 		will allow root to set only the effective user id to an
! 		arbitrary value ***AND*** you have saved user ids.  This is
! 		preferable to HASSETREUID if these conditions are fulfilled.
! 		These are the semantics of the to-be-released revision of
! 		Posix.1.  The test program ../test/t_seteuid.c will try
! 		this out on your system.  If you define both HASSETREUID
! 		and USESETEUID, the former is ignored.
  HASLSTAT	Define this if you have symbolic links (and thus the
  		lstat(2) system call).  This improves security.  Unlike
  		most other options, this one is on by default, so you
***************
*** 295,300 ****
--- 295,303 ----
  HASWAITPID	Define this if you have the waitpid(2) syscall.
  HASGETDTABLESIZE
  		Define this if you have the getdtablesize(2) syscall.
+ USESTRERROR	Define this if you have the libc strerror function (which
+ 		should be declared in <errno.h>), and it should be used
+ 		instead of sys_errlist.
  NEEDGETOPT	Define this if you need a reimplementation of getopt(3).
  		On some systems, getopt does very odd things if called
  		to scan the arguments twice.  This flag will ask sendmail
***************
*** 396,402 ****
  		<sys/vfs.h>, <sys/mount.h>, or <sys/statfs.h> respectively,
  		or SFS_STATVFS (6) if you have the two-argument statvfs(2)
  		call.  The default if nothing is defined is SFS_NONE.
! SFS_BAVAIL	with SFS_4ARGS hou can also set SFS_BAVAIL to the field name
  		in the statfs structure that holds the useful information;
  		this defaults to f_bavail.
  SPT_TYPE	Encodes how your system can display what a process is doing
--- 399,405 ----
  		<sys/vfs.h>, <sys/mount.h>, or <sys/statfs.h> respectively,
  		or SFS_STATVFS (6) if you have the two-argument statvfs(2)
  		call.  The default if nothing is defined is SFS_NONE.
! SFS_BAVAIL	with SFS_4ARGS you can also set SFS_BAVAIL to the field name
  		in the statfs structure that holds the useful information;
  		this defaults to f_bavail.
  SPT_TYPE	Encodes how your system can display what a process is doing
***************
*** 409,414 ****
--- 412,421 ----
  		SPT_PSTAT (3) -- Use the PSTAT_SETCMD option to pstat(2)
  			to set the process title; this is used by HP-UX.
  		SPT_PSSTRINGS (4) -- Use the magic PS_STRINGS pointer (4.4BSD).
+ 		SPT_SYSMIPS (5) -- Use sysmips() supported by NEWS-OS 6.
+ 		SPT_SCO (6) -- Write kernel u. area.
+ 		SPT_CHANGEARGV (7) -- Write pointers to our own strings into
+ 			the existing argv vector.
  SPT_PADCHAR	Character used to pad the process title; if undefined,
  		the space character (0x20) is used.  This is ignored if
  		SPT_TYPE != SPT_REUSEARGV
***************
*** 441,446 ****
--- 448,462 ----
  		0x7fffffff to strip off the top bit.
  BSD4_4_SOCKADDR	If defined, socket addresses have an sa_len field that
  		defines the length of this address.
+ SAFENFSPATHCONF	Set this to 1 if and only if you have verified that a
+ 		pathconf(2) call with _PC_CHOWN_RESTRICTED argument on an
+ 		NFS filesystem where the underlying system allows users to
+ 		give away files to other users returns <= 0.  Be sure you
+ 		try both on NFS V2 and V3.  Some systems assume that their
+ 		local policy apply to NFS servers -- this is a bad
+ 		assumption!  The test/t_pathconf.c program will try this
+ 		for you -- you have to run it in a directory that is
+ 		mounted from a server that allows file giveaway.
  
  
  
***************
*** 521,528 ****
  MIME8TO7	If non-zero, include 8 to 7 bit MIME conversions.  This
  		also controls advertisement of 8BITMIME in the ESMTP
  		startup dialogue.
! MIME7TO8	If non-zero, include 7 to 8 bit MIME conversions.  Not yet
! 		implemented.
  HES_GETMAILHOST	Define this to 1 if you are using Hesiod with the
  		hes_getmailhost() routine.  This is included with the MIT
  		Hesiod distribution, but not with the DEC Hesiod distribution.
--- 537,543 ----
  MIME8TO7	If non-zero, include 8 to 7 bit MIME conversions.  This
  		also controls advertisement of 8BITMIME in the ESMTP
  		startup dialogue.
! MIME7TO8	If non-zero, include 7 to 8 bit MIME conversions.
  HES_GETMAILHOST	Define this to 1 if you are using Hesiod with the
  		hes_getmailhost() routine.  This is included with the MIT
  		Hesiod distribution, but not with the DEC Hesiod distribution.
***************
*** 791,803 ****
  	incompatible snprintf(3s) calls.  This problem is fixed in sendmail
  	8.8.5.
  
- Ultrix
- 	By default, the IDENT protocol is turned off on Ultrix.  If you
- 	are running Ultrix 4.4 or later, or if you have included patch
- 	CXO-8919 for Ultrix 4.2 or 4.3 to fix the TCP problem, you can turn
- 	IDENT on in the configuration file by setting the "ident" timeout
- 	to 30 seconds.
- 
  Solaris 2.5.1 (SunOS 5.5.1)
  	Apparently patch 103663-01 installs a new /usr/include/resolv.h
  	file that defines the __P macro without checking to see if it is
--- 806,811 ----
***************
*** 815,820 ****
--- 823,835 ----
  
  	... And then file a bug report with Sun.
  
+ Ultrix
+ 	By default, the IDENT protocol is turned off on Ultrix.  If you
+ 	are running Ultrix 4.4 or later, or if you have included patch
+ 	CXO-8919 for Ultrix 4.2 or 4.3 to fix the TCP problem, you can turn
+ 	IDENT on in the configuration file by setting the "ident" timeout
+ 	to 30 seconds.
+ 
  OSF/1
  	If you are compiling on OSF/1 (DEC Alpha), you must use
  	-L/usr/shlib (otherwise it core dumps on startup).  You may also
***************
*** 1279,1293 ****
  	    It requires the ldap and lber libraries from the Umich Ldap3.2
  	    release.
  
- 	  - KNOWN BUGS: It does not work under Digital Unix 3.2c, with gcc and
- 	    ldap3.2 or ldap3.3. It dumps core after attempting to take strlen
- 	    of a garbage string pointer in the lber libraries routine
- 	    ber_printf.
- 
- 	    The string pointer in question is set to 0x50000000, when the
- 	    program crashes. If anyone recognizes where this magic number comes
- 	    from that would be really helpful.
- 
  	    I've tested the software on Solaris.2.4 with gcc and on NeXTStep3.2
  	    and it runs without problems. If you have any questions, please
  	    send them along.
--- 1294,1299 ----
***************
*** 1384,1394 ****
--- 1390,1403 ----
  		contains some miscellaneous routines.
  map.c		Support for database maps.
  mci.c		Routines that handle mail connection information caching.
+ mime.c		MIME conversion routines.
  parseaddr.c	The routines which do address parsing.
  queue.c		Routines to implement message queueing.
  readcf.c	The routine that reads the configuration file and
  		translates it to internal form.
  recipient.c	Routines that manipulate the recipient list.
+ safefile.c	Routines to do careful checking of file modes and permissions
+ 		when opening or creating files.
  savemail.c	Routines which save the letter on processing errors.
  sendmail.h	Main header file for sendmail.
  srvrsmtp.c	Routines to implement server SMTP.
***************
*** 1407,1410 ****
  
  Eric Allman
  
! (Version 8.135, last update 1/21/97 07:47:02)
--- 1416,1419 ----
  
  Eric Allman
  
! (Version 8.142, last update 6/3/97 11:34:09)
diff -Ncr sendmail-8.8.5/src/TRACEFLAGS sendmail-8.8.6/src/TRACEFLAGS
*** sendmail-8.8.5/src/TRACEFLAGS	Wed Sep 18 10:28:48 1996
--- sendmail-8.8.6/src/TRACEFLAGS	Mon Jun  2 16:45:31 1997
***************
*** 52,58 ****
  42	mci.c		mci_get
  43	mime.c		mime8to7
  44	recipient.c	writeable
! 44	util.c		safefile
  45	envelope.c	setsender
  46	envelope.c	openxscript
  49	conf.c		checkcompat
--- 52,58 ----
  42	mci.c		mci_get
  43	mime.c		mime8to7
  44	recipient.c	writeable
! 44	safefile.c	safefile, safedirpath, filechanged
  45	envelope.c	setsender
  46	envelope.c	openxscript
  49	conf.c		checkcompat
***************
*** 70,73 ****
--- 70,74 ----
  80			content length
  81			sun remote mode
  91	mci.c		syslogging of MCI cache information
+ 94	srvrsmtp.c	cause commands to fail (for protocol testing)
  99	main.c		avoid backgrounding (no printed output)
diff -Ncr sendmail-8.8.5/src/alias.c sendmail-8.8.6/src/alias.c
*** sendmail-8.8.5/src/alias.c	Sat Jan 18 09:54:01 1997
--- sendmail-8.8.6/src/alias.c	Thu May  8 17:29:27 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 35,41 ****
  # include "sendmail.h"
  
  #ifndef lint
! static char sccsid[] = "@(#)alias.c	8.67 (Berkeley) 1/18/97";
  #endif /* not lint */
  
  
--- 35,41 ----
  # include "sendmail.h"
  
  #ifndef lint
! static char sccsid[] = "@(#)alias.c	8.73 (Berkeley) 5/8/97";
  #endif /* not lint */
  
  
***************
*** 74,80 ****
  	register ENVELOPE *e;
  {
  	register char *p;
- 	int naliases;
  	char *owner;
  	auto int stat = EX_OK;
  	char obuf[MAXNAME + 7];
--- 74,79 ----
***************
*** 125,136 ****
  		return;
  	}
  	message("aliased to %s", shortenstring(p, 203));
- #ifdef LOG
  	if (LogLevel > 9)
! 		syslog(LOG_INFO, "%s: alias %.100s => %s",
! 			e->e_id == NULL ? "NOQUEUE" : e->e_id,
  			a->q_paddr, shortenstring(p, 203));
- #endif
  	a->q_flags &= ~QSELFREF;
  	if (tTd(27, 5))
  	{
--- 124,133 ----
  		return;
  	}
  	message("aliased to %s", shortenstring(p, 203));
  	if (LogLevel > 9)
! 		sm_syslog(LOG_INFO, e->e_id,
! 			"alias %.100s => %s",
  			a->q_paddr, shortenstring(p, 203));
  	a->q_flags &= ~QSELFREF;
  	if (tTd(27, 5))
  	{
***************
*** 138,144 ****
  		printaddr(a, FALSE);
  	}
  	a->q_flags |= QDONTSEND;
! 	naliases = sendtolist(p, a, sendq, aliaslevel + 1, e);
  	if (bitset(QSELFREF, a->q_flags))
  		a->q_flags &= ~QDONTSEND;
  
--- 135,141 ----
  		printaddr(a, FALSE);
  	}
  	a->q_flags |= QDONTSEND;
! 	(void) sendtolist(p, a, sendq, aliaslevel + 1, e);
  	if (bitset(QSELFREF, a->q_flags))
  		a->q_flags &= ~QDONTSEND;
  
***************
*** 279,285 ****
  		else
  		{
  			class = "implicit";
! 			map->map_mflags = MF_OPTIONAL|MF_INCLNULL;
  		}
  
  		/* find end of spec */
--- 276,282 ----
  		else
  		{
  			class = "implicit";
! 			map->map_mflags = MF_INCLNULL;
  		}
  
  		/* find end of spec */
***************
*** 423,433 ****
  		}
  		else
  		{
- #ifdef LOG
  			if (LogLevel > 3)
! 				syslog(LOG_INFO, "alias database %s out of date",
  					buf);
- #endif /* LOG */
  			message("Warning: alias database %s out of date", buf);
  		}
  	}
--- 420,429 ----
  		}
  		else
  		{
  			if (LogLevel > 3)
! 				sm_syslog(LOG_INFO, NOQID,
! 					"alias database %s out of date",
  					buf);
  			message("Warning: alias database %s out of date", buf);
  		}
  	}
***************
*** 456,461 ****
--- 452,458 ----
  {
  	FILE *af;
  	bool nolock = FALSE;
+ 	int sff = SFF_OPENASROOT|SFF_REGONLY|SFF_NOLOCK|SFF_NOWLINK|SFF_NOWFILES;
  	sigfunc_t oldsigint, oldsigquit;
  #ifdef SIGTSTP
  	sigfunc_t oldsigtstp;
***************
*** 465,476 ****
  		return;
  
  	/* try to lock the source file */
! 	if ((af = fopen(map->map_file, "r+")) == NULL)
  	{
  		struct stat stb;
  
  		if ((errno != EACCES && errno != EROFS) || automatic ||
! 		    (af = fopen(map->map_file, "r")) == NULL)
  		{
  			int saveerr = errno;
  
--- 462,473 ----
  		return;
  
  	/* try to lock the source file */
! 	if ((af = safefopen(map->map_file, O_RDWR, 0, sff)) == NULL)
  	{
  		struct stat stb;
  
  		if ((errno != EACCES && errno != EROFS) || automatic ||
! 		    (af = safefopen(map->map_file, O_RDONLY, 0, sff)) == NULL)
  		{
  			int saveerr = errno;
  
***************
*** 517,530 ****
  
  	if (map->map_class->map_open(map, O_RDWR))
  	{
- #ifdef LOG
  		if (LogLevel > 7)
  		{
! 			syslog(LOG_NOTICE, "alias database %s %srebuilt by %s",
  				map->map_file, automatic ? "auto" : "",
  				username());
  		}
- #endif /* LOG */
  		map->map_mflags |= MF_OPEN|MF_WRITABLE;
  		readaliases(map, af, !automatic, TRUE);
  	}
--- 514,526 ----
  
  	if (map->map_class->map_open(map, O_RDWR))
  	{
  		if (LogLevel > 7)
  		{
! 			sm_syslog(LOG_NOTICE, NOQID,
! 				"alias database %s %srebuilt by %s",
  				map->map_file, automatic ? "auto" : "",
  				username());
  		}
  		map->map_mflags |= MF_OPEN|MF_WRITABLE;
  		readaliases(map, af, !automatic, TRUE);
  	}
***************
*** 605,610 ****
--- 601,615 ----
  
  		LineNumber++;
  		p = strchr(line, '\n');
+ #if _FFR_BACKSLASH_IN_ALIASES
+ 		while (p != NULL && p > line && p[-1] == '\\')
+ 		{
+ 			p--;
+ 			if (fgets(p, SPACELEFT(line, p), af) == NULL)
+ 				break;
+ 			p = strchr(p, '\n');
+ 		}
+ #endif
  		if (p != NULL)
  			*p = '\0';
  		else if (!feof(af))
***************
*** 762,772 ****
  	if (Verbose || announcestats)
  		message("%s: %d aliases, longest %d bytes, %d bytes total",
  			map->map_file, naliases, longest, bytes);
- # ifdef LOG
  	if (LogLevel > 7 && logstats)
! 		syslog(LOG_INFO, "%s: %d aliases, longest %d bytes, %d bytes total",
  			map->map_file, naliases, longest, bytes);
- # endif /* LOG */
  }
  /*
  **  FORWARD -- Try to forward mail
--- 767,776 ----
  	if (Verbose || announcestats)
  		message("%s: %d aliases, longest %d bytes, %d bytes total",
  			map->map_file, naliases, longest, bytes);
  	if (LogLevel > 7 && logstats)
! 		sm_syslog(LOG_INFO, NOQID,
! 			"%s: %d aliases, longest %d bytes, %d bytes total",
  			map->map_file, naliases, longest, bytes);
  }
  /*
  **  FORWARD -- Try to forward mail
***************
*** 846,857 ****
  			got_transient = TRUE;
  			if (tTd(27, 2))
  				printf("forward: transient error on %s\n", buf);
- #ifdef LOG
  			if (LogLevel > 2)
! 				syslog(LOG_ERR, "%s: forward %s: transient error: %s",
! 					e->e_id == NULL ? "NOQUEUE" : e->e_id,
  					buf, errstring(err));
- #endif
  		}
  	}
  	if (pp == NULL && got_transient)
--- 850,859 ----
  			got_transient = TRUE;
  			if (tTd(27, 2))
  				printf("forward: transient error on %s\n", buf);
  			if (LogLevel > 2)
! 				sm_syslog(LOG_ERR, e->e_id,
! 					"forward %s: transient error: %s",
  					buf, errstring(err));
  		}
  	}
  	if (pp == NULL && got_transient)
diff -Ncr sendmail-8.8.5/src/aliases.0 sendmail-8.8.6/src/aliases.0
*** sendmail-8.8.5/src/aliases.0	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/src/aliases.0	Wed Feb 21 17:04:18 1996
***************
*** 0 ****
--- 1,48 ----
+ ALIASES(5)                  BSD Programmer's Manual                 ALIASES(5)
+ 
+ NNAAMMEE
+      aalliiaasseess - aliases file for sendmail
+ 
+ SSYYNNOOPPSSIISS
+      aalliiaasseess
+ 
+ DDEESSCCRRIIPPTTIIOONN
+      This file describes user ID aliases used by _/_u_s_r_/_s_b_i_n_/_s_e_n_d_m_a_i_l. The file
+      resides in _/_e_t_c and is formatted as a series of lines of the form
+ 
+            name: name_1, name2, name_3, . . .
+ 
+      The _n_a_m_e is the name to alias, and the _n_a_m_e___n are the aliases for that
+      name.  Lines beginning with white space are continuation lines.  Lines
+      beginning with `#' are comments.
+ 
+      Aliasing occurs only on local names.  Loops can not occur, since no mes-
+      sage will be sent to any person more than once.
+ 
+      After aliasing has been done, local and valid recipients who have a
+      ``_._f_o_r_w_a_r_d'' file in their home directory have messages forwarded to the
+      list of users defined in that file.
+ 
+      This is only the raw data file; the actual aliasing information is placed
+      into a binary format in the file _/_e_t_c_/_a_l_i_a_s_e_s_._d_b using the program
+      newaliases(1).  A newaliases command should be executed each time the
+      aliases file is changed for the change to take effect.
+ 
+ SSEEEE AALLSSOO
+      newaliases(1),  dbopen(3),  dbm(3),  sendmail(8)
+ 
+      _S_E_N_D_M_A_I_L _I_n_s_t_a_l_l_a_t_i_o_n _a_n_d _O_p_e_r_a_t_i_o_n _G_u_i_d_e.
+ 
+      _S_E_N_D_M_A_I_L _A_n _I_n_t_e_r_n_e_t_w_o_r_k _M_a_i_l _R_o_u_t_e_r.
+ 
+ BBUUGGSS
+      If you have compiled sendmail with DBM support instead of NEWDB, you may
+      have encountered problems in 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 con-
+      tinuation alias.
+ 
+ HHIISSTTOORRYY
+      The aalliiaasseess file format appeared in 4.0BSD.
+ 
+ 4th Berkeley Distribution      December 11, 1993                             1
diff -Ncr sendmail-8.8.5/src/aliases.5 sendmail-8.8.6/src/aliases.5
*** sendmail-8.8.5/src/aliases.5	Wed Feb 21 16:50:04 1996
--- sendmail-8.8.6/src/aliases.5	Sat Feb  1 16:24:50 1997
***************
*** 1,3 ****
--- 1,4 ----
+ .\" Copyright (c) 1983, 1997 Eric P. Allman
  .\" Copyright (c) 1985, 1991, 1993
  .\"	The Regents of the University of California.  All rights reserved.
  .\"
***************
*** 29,37 ****
  .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  .\" SUCH DAMAGE.
  .\"
! .\"     @(#)aliases.5	8.2 (Berkeley) 12/11/93
  .\"
! .Dd December 11, 1993
  .Dt ALIASES 5
  .Os BSD 4
  .Sh NAME
--- 30,38 ----
  .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  .\" SUCH DAMAGE.
  .\"
! .\"     @(#)aliases.5	8.3 (Berkeley) 2/1/97
  .\"
! .Dd February 1, 1997
  .Dt ALIASES 5
  .Os BSD 4
  .Sh NAME
diff -Ncr sendmail-8.8.5/src/arpadate.c sendmail-8.8.6/src/arpadate.c
*** sendmail-8.8.5/src/arpadate.c	Mon Sep 16 14:59:16 1996
--- sendmail-8.8.6/src/arpadate.c	Sat Feb  1 16:24:49 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)arpadate.c	8.6 (Berkeley) 9/16/96";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)arpadate.c	8.7 (Berkeley) 2/1/97";
  #endif /* not lint */
  
  # include "sendmail.h"
diff -Ncr sendmail-8.8.5/src/clock.c sendmail-8.8.6/src/clock.c
*** sendmail-8.8.5/src/clock.c	Tue Dec 31 08:21:24 1996
--- sendmail-8.8.6/src/clock.c	Sat Apr 19 16:18:57 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)clock.c	8.18 (Berkeley) 12/31/96";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)clock.c	8.24 (Berkeley) 4/19/97";
  #endif /* not lint */
  
  # include "sendmail.h"
***************
*** 60,66 ****
  **		none.
  */
  
! static SIGFUNC_DECL tick __P((int));
  
  EVENT *
  setevent(intvl, func, arg)
--- 60,68 ----
  **		none.
  */
  
! EVENT	*FreeEventList;		/* list of free events */
! 
! static SIGFUNC_DECL	tick __P((int));
  
  EVENT *
  setevent(intvl, func, arg)
***************
*** 71,76 ****
--- 73,79 ----
  	register EVENT **evp;
  	register EVENT *ev;
  	auto time_t now;
+ 	int wasblocked;
  
  	if (intvl <= 0)
  	{
***************
*** 78,84 ****
  		return (NULL);
  	}
  
! 	(void) setsignal(SIGALRM, SIG_IGN);
  	(void) time(&now);
  
  	/* search event queue for correct position */
--- 81,87 ----
  		return (NULL);
  	}
  
! 	wasblocked = blocksignal(SIGALRM);
  	(void) time(&now);
  
  	/* search event queue for correct position */
***************
*** 89,95 ****
  	}
  
  	/* insert new event */
! 	ev = (EVENT *) xalloc(sizeof *ev);
  	ev->ev_time = now + intvl;
  	ev->ev_func = func;
  	ev->ev_arg = arg;
--- 92,102 ----
  	}
  
  	/* insert new event */
! 	ev = FreeEventList;
! 	if (ev == NULL)
! 		ev = (EVENT *) xalloc(sizeof *ev);
! 	else
! 		FreeEventList = ev->ev_link;
  	ev->ev_time = now + intvl;
  	ev->ev_func = func;
  	ev->ev_arg = arg;
***************
*** 101,107 ****
  		printf("setevent: intvl=%ld, for=%ld, func=%lx, arg=%d, ev=%lx\n",
  			intvl, now + intvl, (u_long) func, arg, (u_long) ev);
  
! 	tick(0);
  	return (ev);
  }
  /*
--- 108,118 ----
  		printf("setevent: intvl=%ld, for=%ld, func=%lx, arg=%d, ev=%lx\n",
  			intvl, now + intvl, (u_long) func, arg, (u_long) ev);
  
! 	setsignal(SIGALRM, tick);
! 	intvl = EventQueue->ev_time - now;
! 	(void) alarm((unsigned) intvl < 1 ? 1 : intvl);
! 	if (wasblocked == 0)
! 		(void) releasesignal(SIGALRM);
  	return (ev);
  }
  /*
***************
*** 122,127 ****
--- 133,139 ----
  	register EVENT *ev;
  {
  	register EVENT **evp;
+ 	int wasblocked;
  
  	if (tTd(5, 5))
  		printf("clrevent: ev=%lx\n", (u_long) ev);
***************
*** 129,135 ****
  		return;
  
  	/* find the parent event */
! 	(void) setsignal(SIGALRM, SIG_IGN);
  	for (evp = &EventQueue; *evp != NULL; evp = &(*evp)->ev_link)
  	{
  		if (*evp == ev)
--- 141,147 ----
  		return;
  
  	/* find the parent event */
! 	wasblocked = blocksignal(SIGALRM);
  	for (evp = &EventQueue; *evp != NULL; evp = &(*evp)->ev_link)
  	{
  		if (*evp == ev)
***************
*** 140,155 ****
  	if (*evp != NULL)
  	{
  		*evp = ev->ev_link;
! 		free((char *) ev);
  	}
  
  	/* restore clocks and pick up anything spare */
! 	tick(0);
  }
  /*
  **  TICK -- take a clock tick
  **
  **	Called by the alarm clock.  This routine runs events as needed.
  **
  **	Parameters:
  **		One that is ignored; for compatibility with signal handlers.
--- 152,173 ----
  	if (*evp != NULL)
  	{
  		*evp = ev->ev_link;
! 		ev->ev_link = FreeEventList;
! 		FreeEventList = ev;
  	}
  
  	/* restore clocks and pick up anything spare */
! 	if (wasblocked == 0)
! 		releasesignal(SIGALRM);
! 	if (EventQueue != NULL)
! 		kill(getpid(), SIGALRM);
  }
  /*
  **  TICK -- take a clock tick
  **
  **	Called by the alarm clock.  This routine runs events as needed.
+ **	Always called as a signal handler, so we assume that SIGALRM
+ **	has been blocked.
  **
  **	Parameters:
  **		One that is ignored; for compatibility with signal handlers.
***************
*** 170,182 ****
  	int mypid = getpid();
  	int olderrno = errno;
  
- 	(void) setsignal(SIGALRM, SIG_IGN);
  	(void) alarm(0);
  	now = curtime();
  
  	if (tTd(5, 4))
  		printf("tick: now=%ld\n", now);
  
  	while ((ev = EventQueue) != NULL &&
  	       (ev->ev_time <= now || ev->ev_pid != mypid))
  	{
--- 188,201 ----
  	int mypid = getpid();
  	int olderrno = errno;
  
  	(void) alarm(0);
  	now = curtime();
  
  	if (tTd(5, 4))
  		printf("tick: now=%ld\n", now);
  
+ 	/* reset signal in case System V semantics */
+ 	(void) setsignal(SIGALRM, tick);
  	while ((ev = EventQueue) != NULL &&
  	       (ev->ev_time <= now || ev->ev_pid != mypid))
  	{
***************
*** 196,202 ****
  		f = ev->ev_func;
  		arg = ev->ev_arg;
  		pid = ev->ev_pid;
! 		free((char *) ev);
  		if (pid != getpid())
  			continue;
  		if (EventQueue != NULL)
--- 215,222 ----
  		f = ev->ev_func;
  		arg = ev->ev_arg;
  		pid = ev->ev_pid;
! 		ev->ev_link = FreeEventList;
! 		FreeEventList = ev;
  		if (pid != getpid())
  			continue;
  		if (EventQueue != NULL)
***************
*** 207,223 ****
  				(void) alarm(3);
  		}
  
- 		/* restore signals so that we can take ticks while in ev_func */
- 		(void) setsignal(SIGALRM, tick);
- 		(void) releasesignal(SIGALRM);
- 
  		/* call ev_func */
  		errno = olderrno;
  		(*f)(arg);
  		(void) alarm(0);
  		now = curtime();
  	}
- 	(void) setsignal(SIGALRM, tick);
  	if (EventQueue != NULL)
  		(void) alarm((unsigned) (EventQueue->ev_time - now));
  	errno = olderrno;
--- 227,238 ----
diff -Ncr sendmail-8.8.5/src/collect.c sendmail-8.8.6/src/collect.c
*** sendmail-8.8.5/src/collect.c	Wed Dec 11 19:58:44 1996
--- sendmail-8.8.6/src/collect.c	Thu May 29 12:55:51 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)collect.c	8.62 (Berkeley) 12/11/96";
  #endif /* not lint */
  
  # include <errno.h>
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)collect.c	8.69 (Berkeley) 5/29/97";
  #endif /* not lint */
  
  # include <errno.h>
***************
*** 52,59 ****
  **			style message to say we are ready to collect
  **			input, and never ignore a single dot to mean
  **			end of message.
- **		requeueflag -- this message will be requeued later, so
- **			don't do final processing on it.
  **		hdrp -- the location to stash the header.
  **		e -- the current envelope.
  **
--- 52,57 ----
***************
*** 83,92 ****
  #define MS_BODY		2	/* reading message body */
  
  void
! collect(fp, smtpmode, requeueflag, hdrp, e)
  	FILE *fp;
  	bool smtpmode;
- 	bool requeueflag;
  	HDR **hdrp;
  	register ENVELOPE *e;
  {
--- 81,89 ----
  #define MS_BODY		2	/* reading message body */
  
  void
! collect(fp, smtpmode, hdrp, e)
  	FILE *fp;
  	bool smtpmode;
  	HDR **hdrp;
  	register ENVELOPE *e;
  {
***************
*** 94,100 ****
  	volatile bool ignrdot = smtpmode ? FALSE : IgnrDot;
  	volatile time_t dbto = smtpmode ? TimeOuts.to_datablock : 0;
  	register char *volatile bp;
! 	volatile int c = '\0';
  	volatile bool inputerr = FALSE;
  	bool headeronly;
  	char *volatile buf;
--- 91,97 ----
  	volatile bool ignrdot = smtpmode ? FALSE : IgnrDot;
  	volatile time_t dbto = smtpmode ? TimeOuts.to_datablock : 0;
  	register char *volatile bp;
! 	volatile int c = EOF;
  	volatile bool inputerr = FALSE;
  	bool headeronly;
  	char *volatile buf;
***************
*** 103,109 ****
  	volatile int mstate;
  	u_char *volatile pbp;
  	u_char peekbuf[8];
! 	char dfname[20];
  	char bufbuf[MAXLINE];
  	extern bool isheader();
  	extern void eatheader();
--- 100,106 ----
  	volatile int mstate;
  	u_char *volatile pbp;
  	u_char peekbuf[8];
! 	char dfname[MAXQFNAME];
  	char bufbuf[MAXLINE];
  	extern bool isheader();
  	extern void eatheader();
***************
*** 117,126 ****
  
  	if (!headeronly)
  	{
  		struct stat stbuf;
  
  		strcpy(dfname, queuename(e, 'd'));
! 		if ((tf = dfopen(dfname, O_WRONLY|O_CREAT|O_TRUNC, FileMode)) == NULL)
  		{
  			syserr("Cannot create %s", dfname);
  			e->e_flags |= EF_NO_BODY_RETN;
--- 114,125 ----
  
  	if (!headeronly)
  	{
+ 		int tfd;
  		struct stat stbuf;
  
  		strcpy(dfname, queuename(e, 'd'));
! 		tfd = dfopen(dfname, O_WRONLY|O_CREAT|O_TRUNC, FileMode, SFF_ANYFILE);
! 		if (tfd < 0 || (tf = fdopen(tfd, "w")) == NULL)
  		{
  			syserr("Cannot create %s", dfname);
  			e->e_flags |= EF_NO_BODY_RETN;
***************
*** 169,180 ****
  		/* handle possible input timeout */
  		if (setjmp(CtxCollectTimeout) != 0)
  		{
- #ifdef LOG
  			if (LogLevel > 2)
! 				syslog(LOG_NOTICE,
  				    "timeout waiting for input from %s during message collect",
  				    CurHostName ? CurHostName : "<local machine>");
- #endif
  			errno = 0;
  			usrerr("451 timeout waiting for input during message collect");
  			goto readerr;
--- 168,177 ----
  		/* handle possible input timeout */
  		if (setjmp(CtxCollectTimeout) != 0)
  		{
  			if (LogLevel > 2)
! 				sm_syslog(LOG_NOTICE, e->e_id,
  				    "timeout waiting for input from %s during message collect",
  				    CurHostName ? CurHostName : "<local machine>");
  			errno = 0;
  			usrerr("451 timeout waiting for input during message collect");
  			goto readerr;
***************
*** 417,426 ****
  
  		if (tTd(30, 1))
  			printf("collect: premature EOM: %s\n", errmsg);
- #ifdef LOG
  		if (LogLevel >= 2)
! 			syslog(LOG_WARNING, "collect: premature EOM: %s", errmsg);
! #endif
  		inputerr = TRUE;
  	}
  
--- 414,422 ----
  
  		if (tTd(30, 1))
  			printf("collect: premature EOM: %s\n", errmsg);
  		if (LogLevel >= 2)
! 			sm_syslog(LOG_WARNING, e->e_id,
! 				"collect: premature EOM: %s", errmsg);
  		inputerr = TRUE;
  	}
  
***************
*** 455,468 ****
  			problem = "I/O error";
  		else
  			problem = "read timeout";
- # ifdef LOG
  		if (LogLevel > 0 && feof(fp))
! 			syslog(LOG_NOTICE,
  			    "collect: %s on connection from %.100s, sender=%s: %s",
  			    problem, host,
  			    shortenstring(e->e_from.q_paddr, 203),
  			    errstring(errno));
- # endif
  		if (feof(fp))
  			usrerr("451 collect: %s on connection from %s, from=%s",
  				problem, host,
--- 451,462 ----
  			problem = "I/O error";
  		else
  			problem = "read timeout";
  		if (LogLevel > 0 && feof(fp))
! 			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),
  			    errstring(errno));
  		if (feof(fp))
  			usrerr("451 collect: %s on connection from %s, from=%s",
  				problem, host,
***************
*** 501,507 ****
  		markstats(e, (ADDRESS *) NULL);
  	}
  
! #ifdef _FFR_DSN_RRT
  	/*
  	**  If we have a Return-Receipt-To:, turn it into a DSN.
  	*/
--- 495,501 ----
  		markstats(e, (ADDRESS *) NULL);
  	}
  
! #if _FFR_DSN_RRT_OPTION
  	/*
  	**  If we have a Return-Receipt-To:, turn it into a DSN.
  	*/
***************
*** 576,586 ****
  		e->e_status = "5.2.3";
  		usrerr("552 Message exceeds maximum fixed size (%ld)",
  			MaxMessageSize);
- # ifdef LOG
  		if (LogLevel > 6)
! 			syslog(LOG_NOTICE, "%s: message size (%ld) exceeds maximum (%ld)",
! 				e->e_id, e->e_msgsize, MaxMessageSize);
! # endif
  	}
  
  	/* check for illegal 8-bit data */
--- 570,579 ----
  		e->e_status = "5.2.3";
  		usrerr("552 Message exceeds maximum fixed size (%ld)",
  			MaxMessageSize);
  		if (LogLevel > 6)
! 			sm_syslog(LOG_NOTICE, e->e_id,
! 				"message size (%ld) exceeds maximum (%ld)",
! 				e->e_msgsize, MaxMessageSize);
  	}
  
  	/* check for illegal 8-bit data */
diff -Ncr sendmail-8.8.5/src/conf.c sendmail-8.8.6/src/conf.c
*** sendmail-8.8.5/src/conf.c	Tue Jan 21 07:47:33 1997
--- sendmail-8.8.6/src/conf.c	Sat Jun 14 08:21:20 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)conf.c	8.333 (Berkeley) 1/21/97";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)conf.c	8.362 (Berkeley) 6/14/97";
  #endif /* not lint */
  
  # include "sendmail.h"
***************
*** 140,145 ****
--- 140,148 ----
  	{ "novrfy",		PRIV_NOVRFY		},
  	{ "restrictmailq",	PRIV_RESTRICTMAILQ	},
  	{ "restrictqrun",	PRIV_RESTRICTQRUN	},
+ #if _FFR_PRIVACY_NOETRN
+ 	{ "noetrn",		PRIV_NOETRN		},
+ #endif
  	{ "authwarnings",	PRIV_AUTHWARNINGS	},
  	{ "noreceipts",		PRIV_NORECEIPTS		},
  	{ "goaway",		PRIV_GOAWAY		},
***************
*** 187,192 ****
--- 190,196 ----
  	extern void setdefuser();
  	extern void setupmaps();
  	extern void setupmailers();
+ 	extern void setupheaders();
  
  	SpaceSub = ' ';				/* option B */
  	QueueLA = 8;				/* option x */
***************
*** 233,238 ****
--- 237,243 ----
  	setdefuser();
  	setupmaps();
  	setupmailers();
+ 	setupheaders();
  }
  
  
***************
*** 252,299 ****
  		defpwent == NULL ? "nobody" : defpwent->pw_name);
  }
  /*
- **  HOST_MAP_INIT -- initialize host class structures
- */
- 
- bool	host_map_init __P((MAP *map, char *args));
- 
- bool
- host_map_init(map, args)
- 	MAP *map;
- 	char *args;
- {
- 	register char *p = args;
- 
- 	for (;;)
- 	{
- 		while (isascii(*p) && isspace(*p))
- 			p++;
- 		if (*p != '-')
- 			break;
- 		switch (*++p)
- 		{
- 		  case 'a':
- 			map->map_app = ++p;
- 			break;
- 
- 		  case 'm':
- 			map->map_mflags |= MF_MATCHONLY;
- 			break;
- 
- 		  case 't':
- 			map->map_mflags |= MF_NODEFER;
- 			break;
- 		}
- 		while (*p != '\0' && !(isascii(*p) && isspace(*p)))
- 			p++;
- 		if (*p != '\0')
- 			*p++ = '\0';
- 	}
- 	if (map->map_app != NULL)
- 		map->map_app = newstr(map->map_app);
- 	return TRUE;
- }
- /*
  **  SETUPMAILERS -- initialize default mailers
  */
  
--- 257,262 ----
***************
*** 368,375 ****
  #endif
  #ifdef LDAPMAP
  	MAPDEF("ldapx", NULL, 0,
! 	        ldap_map_parseargs, ldap_map_open, ldap_map_close,
! 	        ldap_map_lookup, null_map_store);
  #endif
  
  #ifdef HESIOD
--- 331,338 ----
  #endif
  #ifdef LDAPMAP
  	MAPDEF("ldapx", NULL, 0,
! 		ldap_map_parseargs, ldap_map_open, ldap_map_close,
! 		ldap_map_lookup, null_map_store);
  #endif
  
  #ifdef HESIOD
***************
*** 1062,1068 ****
--- 1025,1035 ----
  	sigfunc_t handler;
  {
  #if defined(SYS5SIGNALS) || defined(BSD4_3)
+ # ifdef BSD4_3
  	return signal(sig, handler);
+ # else
+ 	return sigset(sig, handler);
+ # endif
  #else
  	struct sigaction n, o;
  
***************
*** 1525,1532 ****
  	dg_sys_info((long *)&load_info,
  		DG_SYS_INFO_LOAD_INFO_TYPE, DG_SYS_INFO_LOAD_VERSION_0);
  
!         if (tTd(3, 1))
!                 printf("getla: %d\n", (int) (load_info.one_minute + 0.5));
  
  	return((int) (load_info.one_minute + 0.5));
  }
--- 1492,1499 ----
  	dg_sys_info((long *)&load_info,
  		DG_SYS_INFO_LOAD_INFO_TYPE, DG_SYS_INFO_LOAD_VERSION_0);
  
! 	if (tTd(3, 1))
! 		printf("getla: %d\n", (int) (load_info.one_minute + 0.5));
  
  	return((int) (load_info.one_minute + 0.5));
  }
***************
*** 1557,1564 ****
  			     (size_t) 1, 0) == -1)
  		return 0;
  
!         if (tTd(3, 1))
!                 printf("getla: %d\n", (int) (pstd.psd_avg_1_min + 0.5));
  
  	return (int) (pstd.psd_avg_1_min + 0.5);
  }
--- 1524,1531 ----
  			     (size_t) 1, 0) == -1)
  		return 0;
  
! 	if (tTd(3, 1))
! 		printf("getla: %d\n", (int) (pstd.psd_avg_1_min + 0.5));
  
  	return (int) (pstd.psd_avg_1_min + 0.5);
  }
***************
*** 1699,1706 ****
  	static int kmem = -1;
  	static enum { getla_none, getla_32, getla_64 } kernel_type =
  					getla_none;
! 	uint32_t avenrun32[3];
! 	uint64_t avenrun64[3];
  
  	if (kernel_type == getla_none)
  	{
--- 1666,1672 ----
  	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)
  	{
***************
*** 1783,1839 ****
  
  	switch (kernel_type)
  	{
  	  case getla_32:
  		if (lseek(kmem, (off_t) Nl32[X_AVENRUN].n_value, SEEK_SET) == -1 ||
! 		    read(kmem, (char *) avenrun32, sizeof(avenrun32)) < sizeof(avenrun32))
  		{
  			if (tTd(3, 1))
  				printf("getla: lseek or read: %s\n",
  					errstring(errno));
  			return -1;
  		}
! 		if (tTd(3, 5))
! 		{
! 			printf("getla: avenrun{32} = %ld",
! 				(long int) avenrun32[0]);
! 			if (tTd(3, 15))
! 				printf(", %ld, %ld",
! 					(long int)avenrun32[1],
! 					(long int)avenrun32[2]);
! 			printf("\n");
! 		}
! 		if (tTd(3, 1))
! 			printf("getla: %d\n",
! 				(int) (avenrun32[0] + FSCALE/2) >> FSHIFT);
! 		return ((int) (avenrun32[0] + FSCALE/2) >> FSHIFT);
  
  	  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 *) avenrun64, sizeof(avenrun64)) <
! 					sizeof(avenrun64))
  		{
  			if (tTd(3, 1))
  				printf("getla: lseek64 or read: %s\n",
  					errstring(errno));
  			return -1;
  		}
! 		if (tTd(3, 5))
! 		{
! 			printf("getla: avenrun{64} = %lld",
! 				(long long int) avenrun64[0]);
! 			if (tTd(3, 15))
! 				printf(", %lld, %lld",
! 					(long long int) avenrun64[1],
! 					(long long int) avenrun64[2]);
! 			printf("\n");
! 		}
! 		if (tTd(3, 1))
! 			printf("getla: %d\n",
! 				(int) (avenrun64[0] + FSCALE/2) >> FSHIFT);
! 		return ((int) (avenrun64[0] + FSCALE/2) >> FSHIFT);
  	}
! 	return -1;
  }
  #endif
  
--- 1749,1795 ----
  
  	switch (kernel_type)
  	{
+ 	  case getla_none:
+ 		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]);
! 		if (tTd(3, 15))
! 			printf(", %ld, %ld",
! 				(long int)avenrun[1],
! 				(long int)avenrun[2]);
! 		printf("\n");
! 	}
! 	if (tTd(3, 1))
! 		printf("getla: %d\n",
! 			(int) (avenrun[0] + FSCALE/2) >> FSHIFT);
! 	return ((int) (avenrun[0] + FSCALE/2) >> FSHIFT);
  }
  #endif
  
***************
*** 1913,1919 ****
  		afd = open(_PATH_AVENRUN, O_RDONLY|O_SYNC);
  		if (afd < 0)
  		{
! 			syslog(LOG_ERR, "can't open %s: %m", _PATH_AVENRUN);
  			return -1;
  		}
  	}
--- 1869,1877 ----
  		afd = open(_PATH_AVENRUN, O_RDONLY|O_SYNC);
  		if (afd < 0)
  		{
! 			sm_syslog(LOG_ERR, NOQID,
! 				"can't open %s: %m",
! 				_PATH_AVENRUN);
  			return -1;
  		}
  	}
***************
*** 2036,2051 ****
  **		none.
  */
  
  bool
  shouldqueue(pri, ctime)
  	long pri;
  	time_t ctime;
  {
  	bool rval;
  
  	if (tTd(3, 30))
  		printf("shouldqueue: CurrentLA=%d, pri=%ld: ", CurrentLA, pri);
! 	if (CurrentLA < QueueLA)
  	{
  		if (tTd(3, 30))
  			printf("FALSE (CurrentLA < QueueLA)\n");
--- 1994,2012 ----
  **		none.
  */
  
+ extern int	get_num_procs_online __P((void));
+ 
  bool
  shouldqueue(pri, ctime)
  	long pri;
  	time_t ctime;
  {
  	bool rval;
+ 	int queuela = QueueLA * get_num_procs_online();
  
  	if (tTd(3, 30))
  		printf("shouldqueue: CurrentLA=%d, pri=%ld: ", CurrentLA, pri);
! 	if (CurrentLA < queuela)
  	{
  		if (tTd(3, 30))
  			printf("FALSE (CurrentLA < QueueLA)\n");
***************
*** 2059,2065 ****
  		return (TRUE);
  	}
  #endif
! 	rval = pri > (QueueFactor / (CurrentLA - QueueLA + 1));
  	if (tTd(3, 30))
  		printf("%s (by calculation)\n", rval ? "TRUE" : "FALSE");
  	return rval;
--- 2020,2026 ----
  		return (TRUE);
  	}
  #endif
! 	rval = pri > (QueueFactor / (CurrentLA - queuela + 1));
  	if (tTd(3, 30))
  		printf("%s (by calculation)\n", rval ? "TRUE" : "FALSE");
  	return rval;
***************
*** 2083,2088 ****
--- 2044,2050 ----
  refuseconnections(port)
  	int port;
  {
+ 	int refusela = RefuseLA * get_num_procs_online();
  	time_t now;
  	static time_t lastconn = (time_t) 0;
  	static int conncnt = 0;
***************
*** 2105,2128 ****
  		/* sleep to flatten out connection load */
  		setproctitle("deferring connections on port %d: %d per second",
  			port, ConnRateThrottle);
- #ifdef LOG
  		if (LogLevel >= 14)
! 			syslog(LOG_INFO, "deferring connections on port %d: %d per second",
  				port, ConnRateThrottle);
- #endif
  		sleep(1);
  	}
  
  	CurrentLA = getla();
! 	if (CurrentLA >= RefuseLA)
  	{
  		setproctitle("rejecting connections on port %d: load average: %d",
  			port, CurrentLA);
- #ifdef LOG
  		if (LogLevel >= 14)
! 			syslog(LOG_INFO, "rejecting connections on port %d: load average: %d",
  				port, CurrentLA);
- #endif
  		return TRUE;
  	}
  
--- 2067,2088 ----
  		/* sleep to flatten out connection load */
  		setproctitle("deferring connections on port %d: %d per second",
  			port, ConnRateThrottle);
  		if (LogLevel >= 14)
! 			sm_syslog(LOG_INFO, NOQID,
! 				"deferring connections on port %d: %d per second",
  				port, ConnRateThrottle);
  		sleep(1);
  	}
  
  	CurrentLA = getla();
! 	if (CurrentLA >= refusela)
  	{
  		setproctitle("rejecting connections on port %d: load average: %d",
  			port, CurrentLA);
  		if (LogLevel >= 14)
! 			sm_syslog(LOG_INFO, NOQID,
! 				"rejecting connections on port %d: load average: %d",
  				port, CurrentLA);
  		return TRUE;
  	}
  
***************
*** 2130,2140 ****
  	{
  		setproctitle("rejecting connections on port %d: min free: %d",
  			port, MinBlocksFree);
- #ifdef LOG
  		if (LogLevel >= 14)
! 			syslog(LOG_INFO, "rejecting connections on port %d: min free: %d",
  				port, MinBlocksFree);
- #endif
  		return TRUE;
  	}
  
--- 2090,2099 ----
  	{
  		setproctitle("rejecting connections on port %d: min free: %d",
  			port, MinBlocksFree);
  		if (LogLevel >= 14)
! 			sm_syslog(LOG_INFO, NOQID,
! 				"rejecting connections on port %d: min free: %d",
  				port, MinBlocksFree);
  		return TRUE;
  	}
  
***************
*** 2147,2157 ****
  		{
  			setproctitle("rejecting connections on port %d: %d children, max %d",
  				port, CurChildren, MaxChildren);
- #ifdef LOG
  			if (LogLevel >= 14)
! 				syslog(LOG_INFO, "rejecting connections on port %d: %d children, max %d",
  					port, CurChildren, MaxChildren);
- #endif
  			return TRUE;
  		}
  	}
--- 2106,2115 ----
  		{
  			setproctitle("rejecting connections on port %d: %d children, max %d",
  				port, CurChildren, MaxChildren);
  			if (LogLevel >= 14)
! 				sm_syslog(LOG_INFO, NOQID,
! 					"rejecting connections on port %d: %d children, max %d",
  					port, CurChildren, MaxChildren);
  			return TRUE;
  		}
  	}
***************
*** 2180,2185 ****
--- 2138,2144 ----
  #define SPT_PSSTRINGS	4	/* use PS_STRINGS->... */
  #define SPT_SYSMIPS	5	/* use sysmips() supported by NEWS-OS 6 */
  #define SPT_SCO		6	/* write kernel u. area */
+ #define SPT_CHANGEARGV	7	/* write our own strings into argv[] */
  
  #ifndef SPT_TYPE
  # define SPT_TYPE	SPT_REUSEARGV
***************
*** 2204,2210 ****
  #  endif
  # endif
  
! # if SPT_TYPE == SPT_PSSTRINGS
  #  define SETPROC_STATIC	static
  # else
  #  define SETPROC_STATIC
--- 2163,2169 ----
  #  endif
  # endif
  
! # if SPT_TYPE == SPT_PSSTRINGS || SPT_TYPE == SPT_CHANGEARGV
  #  define SETPROC_STATIC	static
  # else
  #  define SETPROC_STATIC
***************
*** 2253,2259 ****
  	extern char **environ;
  
  	/*
!         **  Move the environment so setproctitle can use the space at
  	**  the top of memory.
  	*/
  
--- 2212,2218 ----
  	extern char **environ;
  
  	/*
! 	**  Move the environment so setproctitle can use the space at
  	**  the top of memory.
  	*/
  
***************
*** 2355,2365 ****
--- 2314,2378 ----
  		*p++ = SPT_PADCHAR;
  	Argv[1] = NULL;
  #  endif
+ #  if SPT_TYPE == SPT_CHANGEARGV
+ 	Argv[0] = buf;
+ 	Argv[1] = 0;
+ #  endif
  # endif /* SPT_TYPE != SPT_NONE */
  }
  
  #endif /* SPT_TYPE != SPT_BUILTIN */
  /*
+ **  WAITFOR -- wait for a particular process id.
+ **
+ **	Parameters:
+ **		pid -- process id to wait for.
+ **
+ **	Returns:
+ **		status of pid.
+ **		-1 if pid never shows up.
+ **
+ **	Side Effects:
+ **		none.
+ */
+ 
+ int
+ waitfor(pid)
+ 	pid_t pid;
+ {
+ #ifdef WAITUNION
+ 	union wait st;
+ #else
+ 	auto int st;
+ #endif
+ 	pid_t i;
+ #if defined(ISC_UNIX) || defined(_SCO_unix_)
+ 	int savesig;
+ #endif
+ 
+ 	do
+ 	{
+ 		errno = 0;
+ #if defined(ISC_UNIX) || defined(_SCO_unix_)
+ 		savesig = releasesignal(SIGCHLD);
+ #endif
+ 		i = wait(&st);
+ #if defined(ISC_UNIX) || defined(_SCO_unix_)
+ 		if (savesig > 0)
+ 			blocksignal(SIGCHLD);
+ #endif
+ 		if (i > 0)
+ 			proc_list_drop(i);
+ 	} while ((i >= 0 || errno == EINTR) && i != pid);
+ 	if (i < 0)
+ 		return -1;
+ #ifdef WAITUNION
+ 	return st.w_status;
+ #else
+ 	return st;
+ #endif
+ }
+ /*
  **  REAPCHILD -- pick up the body of my child, lest it become a zombie
  **
  **	Parameters:
***************
*** 2387,2398 ****
  	{
  		if (count++ > 1000)
  		{
- #ifdef LOG
  			if (LogLevel > 0)
! 				syslog(LOG_ALERT,
  					"reapchild: waitpid loop: pid=%d, status=%x",
  					pid, status);
- #endif
  			break;
  		}
  		proc_list_drop(pid);
--- 2400,2409 ----
  	{
  		if (count++ > 1000)
  		{
  			if (LogLevel > 0)
! 				sm_syslog(LOG_ALERT, NOQID,
  					"reapchild: waitpid loop: pid=%d, status=%x",
  					pid, status);
  			break;
  		}
  		proc_list_drop(pid);
***************
*** 2406,2412 ****
  # else /* WNOHANG */
  	auto int status;
  
! 	while ((pid = wait(&status)) > 0)
  		proc_list_drop(pid);
  # endif /* WNOHANG */
  # endif
--- 2417,2430 ----
  # else /* WNOHANG */
  	auto int status;
  
! 	/*
! 	**  Catch one zombie -- we will be re-invoked (we hope) if there
! 	**  are more.  Unreliable signals probably break this, but this
! 	**  is the "old system" situation -- waitpid or wait3 are to be
! 	**  strongly preferred.
! 	*/
! 
! 	if ((pid = wait(&status)) > 0)
  		proc_list_drop(pid);
  # endif /* WNOHANG */
  # endif
***************
*** 2880,2891 ****
  **	%lx has been added.
  */
  
- #if !HASSNPRINTF
- 
  /**************************************************************
   * Original:
   * Patrick Powell Tue Apr 11 09:48:21 PDT 1995
!  * A bombproof version of doprnt (dopr) included.
   * Sigh.  This sort of thing is always nasty do deal with.  Note that
   * the version here does not include floating point...
   *
--- 2898,2907 ----
  **	%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...
   *
***************
*** 2897,2906 ****
   **************************************************************/
  
  /*static char _id[] = "$Id: snprintf.c,v 1.2 1995/10/09 11:19:47 roberto Exp $";*/
! static void dopr();
! static char *end;
  static int	SnprfOverflow;
  
  /* VARARGS3 */
  int
  # ifdef __STDC__
--- 2913,2924 ----
   **************************************************************/
  
  /*static char _id[] = "$Id: snprintf.c,v 1.2 1995/10/09 11:19:47 roberto Exp $";*/
! static void	sm_dopr();
! static char	*DoprEnd;
  static int	SnprfOverflow;
  
+ #if !HASSNPRINTF
+ 
  /* VARARGS3 */
  int
  # ifdef __STDC__
***************
*** 2932,2950 ****
  	va_list args;
  {
  	str[0] = 0;
! 	end = str + count - 1;
  	SnprfOverflow = 0;
! 	dopr( str, fmt, args );
  	if (count > 0)
! 		end[0] = 0;
  	if (SnprfOverflow && tTd(57, 2))
  		printf("\nvsnprintf overflow, len = %d, str = %s",
  			count, shortenstring(str, 203));
  	return strlen(str);
  }
  
  /*
!  * dopr(): poor man's version of doprintf
   */
  
  static void fmtstr __P((char *value, int ljust, int len, int zpad, int maxwidth));
--- 2950,2971 ----
  	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));
***************
*** 2952,2960 ****
  static void dostr __P(( char * , int ));
  static char *output;
  static void dopr_outch __P(( int c ));
  
  static void
! dopr( buffer, format, args )
         char *buffer;
         const char *format;
         va_list args;
--- 2973,2982 ----
  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;
***************
*** 2968,2997 ****
         int ljust;
         int len;
         int zpad;
  
         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 );
--- 2990,3024 ----
         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 );
***************
*** 2999,3062 ****
  				 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 '%': dopr_outch( ch ); continue;
!                        default:
!                                dostr(  "???????" , 0);
!                        }
!                        break;
!                default:
!                        dopr_outch( ch );
!                        break;
!                }
         }
         *output = 0;
  }
--- 3026,3103 ----
  				 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;
  }
***************
*** 3069,3075 ****
         int padlen, strlen;     /* amount to pad */
  
         if( value == 0 ){
!                value = "<NULL>";
         }
         for( strlen = 0; value[strlen]; ++ strlen ); /* strlen */
         if (strlen > maxwidth && maxwidth)
--- 3110,3116 ----
         int padlen, strlen;     /* amount to pad */
  
         if( value == 0 ){
! 	       value = "<NULL>";
         }
         for( strlen = 0; value[strlen]; ++ strlen ); /* strlen */
         if (strlen > maxwidth && maxwidth)
***************
*** 3078,3090 ****
         if( padlen < 0 ) padlen = 0;
         if( ljust ) padlen = -padlen;
         while( padlen > 0 ) {
!                dopr_outch( ' ' );
!                --padlen;
         }
         dostr( value, maxwidth );
         while( padlen < 0 ) {
!                dopr_outch( ' ' );
!                ++padlen;
         }
  }
  
--- 3119,3131 ----
         if( padlen < 0 ) padlen = 0;
         if( ljust ) padlen = -padlen;
         while( padlen > 0 ) {
! 	       dopr_outch( ' ' );
! 	       --padlen;
         }
         dostr( value, maxwidth );
         while( padlen < 0 ) {
! 	       dopr_outch( ' ' );
! 	       ++padlen;
         }
  }
  
***************
*** 3101,3150 ****
         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;
         }
  }
  
--- 3142,3191 ----
         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;
         }
  }
  
***************
*** 3166,3185 ****
  {
  #if 0
         if( iscntrl(c) && c != '\n' && c != '\t' ){
!                c = '@' + (c & 0x1F);
!                if( end == 0 || output < end )
!                        *output++ = '^';
         }
  #endif
!        if( end == 0 || output < end )
!                *output++ = c;
         else
  		SnprfOverflow++;
  }
- 
- # endif /* !luna2 */
- 
- #endif /* !HASSNPRINTF */
  /*
  **  USERSHELLOK -- tell if a user's shell is ok for unrestricted use
  **
--- 3207,3222 ----
  {
  #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
  **
***************
*** 3434,3440 ****
  	{
  		if (bsize != NULL)
  			*bsize = FSBLOCKSIZE;
! 		if (fs.SFS_BAVAIL < 0)
  			return 0;
  		else
  			return fs.SFS_BAVAIL;
--- 3471,3477 ----
  	{
  		if (bsize != NULL)
  			*bsize = FSBLOCKSIZE;
! 		if (fs.SFS_BAVAIL <= 0)
  			return 0;
  		else
  			return fs.SFS_BAVAIL;
***************
*** 3483,3497 ****
  
  		if (bfree < msize)
  		{
- #ifdef LOG
  			if (LogLevel > 0)
! 				syslog(LOG_ALERT,
! 					"%s: low on space (have %ld, %s needs %ld in %s)",
! 					CurEnv->e_id == NULL ? "[NOQUEUE]" : CurEnv->e_id,
  					bfree,
  					CurHostName == NULL ? "SMTP-DAEMON" : CurHostName,
  					msize, QueueDir);
- #endif
  			return FALSE;
  		}
  	}
--- 3520,3531 ----
  
  		if (bfree < msize)
  		{
  			if (LogLevel > 0)
! 				sm_syslog(LOG_ALERT, CurEnv->e_id,
! 					"low on space (have %ld, %s needs %ld in %s)",
  					bfree,
  					CurHostName == NULL ? "SMTP-DAEMON" : CurHostName,
  					msize, QueueDir);
  			return FALSE;
  		}
  	}
***************
*** 3597,3603 ****
  #if defined(ENOSR) && (!defined(ENOBUFS) || (ENOBUFS != ENOSR))
  	  case ENOSR:			/* Out of streams resources */
  #endif
! 	  case EOPENTIMEOUT:		/* PSEUDO: open timed out */
  		return TRUE;
  	}
  
--- 3631,3637 ----
  #if defined(ENOSR) && (!defined(ENOBUFS) || (ENOBUFS != ENOSR))
  	  case ENOSR:			/* Out of streams resources */
  #endif
! 	  case E_SM_OPENTIMEOUT:	/* PSEUDO: open timed out */
  		return TRUE;
  	}
  
***************
*** 3627,3632 ****
--- 3661,3667 ----
  	char *ext;
  	int type;
  {
+ 	int i;
  # if !HASFLOCK
  	int action;
  	struct flock lfd;
***************
*** 3651,3657 ****
  		printf("lockfile(%s%s, action=%d, type=%d): ",
  			filename, ext, action, lfd.l_type);
  
! 	if (fcntl(fd, action, &lfd) >= 0)
  	{
  		if (tTd(55, 60))
  			printf("SUCCESS\n");
--- 3686,3694 ----
  		printf("lockfile(%s%s, action=%d, type=%d): ",
  			filename, ext, action, lfd.l_type);
  
! 	while ((i = fcntl(fd, action, &lfd)) < 0 && errno == EINTR)
! 		continue;
! 	if (i >= 0)
  	{
  		if (tTd(55, 60))
  			printf("SUCCESS\n");
***************
*** 3697,3703 ****
  	if (tTd(55, 60))
  		printf("lockfile(%s%s, type=%o): ", filename, ext, type);
  
! 	if (flock(fd, type) >= 0)
  	{
  		if (tTd(55, 60))
  			printf("SUCCESS\n");
--- 3734,3742 ----
  	if (tTd(55, 60))
  		printf("lockfile(%s%s, type=%o): ", filename, ext, type);
  
! 	while ((i = flock(fd, type)) < 0 && errno == EINTR)
! 		continue;
! 	if (i >= 0)
  	{
  		if (tTd(55, 60))
  			printf("SUCCESS\n");
***************
*** 3728,3780 ****
  /*
  **  CHOWNSAFE -- tell if chown is "safe" (executable only by root)
  **
  **	Parameters:
  **		fd -- the file descriptor to check.
  **
  **	Returns:
! **		TRUE -- if only root can chown the file to an arbitrary
! **			user.
  **		FALSE -- if an arbitrary user can give away a file.
  */
  
  bool
! chownsafe(fd)
  	int fd;
  {
! #ifdef __hpux
! 	char *s;
! 	int tfd;
! 	uid_t o_uid, o_euid;
! 	gid_t o_gid, o_egid;
! 	bool rval;
! 	struct stat stbuf;
! 
! 	o_uid = getuid();
! 	o_euid = geteuid();
! 	o_gid = getgid();
! 	o_egid = getegid();
! 	fstat(fd, &stbuf);
! 	setresuid(stbuf.st_uid, stbuf.st_uid, -1);
! 	setresgid(stbuf.st_gid, stbuf.st_gid, -1);
! 	s = tmpnam(NULL);
! 	tfd = open(s, O_RDONLY|O_CREAT, 0600);
! 	rval = fchown(tfd, DefUid, DefGid) != 0;
! 	close(tfd);
! 	setresuid(o_uid, o_euid, -1);
! 	setresgid(o_gid, o_egid, -1);
! 	unlink(s);
! 	return rval;
! #else
! # ifdef _POSIX_CHOWN_RESTRICTED
! #  if _POSIX_CHOWN_RESTRICTED == -1
! 	return FALSE;
! #  else
! 	return TRUE;
! #  endif
! # else
! #  ifdef _PC_CHOWN_RESTRICTED
  	int rval;
  
  	/*
  	**  Some systems (e.g., SunOS) seem to have the call and the
  	**  #define _PC_CHOWN_RESTRICTED, but don't actually implement
--- 3767,3839 ----
  /*
  **  CHOWNSAFE -- tell if chown is "safe" (executable only by root)
  **
+ **	Unfortunately, given that we can't predict other systems on which
+ **	a remote mounted (NFS) filesystem will be mounted, the answer is
+ **	almost always that this is unsafe.
+ **
+ **	Note also that many operating systems have non-compliant
+ **	implementations of the _POSIX_CHOWN_RESTRICTED variable and the
+ **	fpathconf() routine.  According to IEEE 1003.1-1990, if
+ **	_POSIX_CHOWN_RESTRICTED is defined and not equal to -1, then
+ **	no non-root process can give away the file.  However, vendors
+ **	don't take NFS into account, so a comfortable value of
+ **	_POSIX_CHOWN_RESTRICTED tells us nothing.
+ **
+ **	Also, some systems (e.g., IRIX 6.2) return 1 from fpathconf()
+ **	even on files where chown is not restricted.  Many systems get
+ **	this wrong on NFS-based filesystems (that is, they say that chown
+ **	is restricted [safe] on NFS filesystems where it may not be, since
+ **	other systems can access the same filesystem and do file giveaway;
+ **	only the NFS server knows for sure!)  Hence, it is important to
+ **	get the value of SAFENFSPATHCONF correct -- it should be defined
+ **	_only_ after testing (see test/t_pathconf.c) a system on an unsafe
+ **	NFS-based filesystem to ensure that you can get meaningful results.
+ **	If in doubt, assume unsafe!
+ **
+ **	You may also need to tweak IS_SAFE_CHOWN -- it should be a
+ **	condition indicating whether the return from pathconf indicates
+ **	that chown is safe (typically either > 0 or >= 0 -- there isn't
+ **	even any agreement about whether a zero return means that a file
+ **	is or is not safe).  It defaults to "> 0".
+ **
+ **	If the parent directory is safe (writable only by owner back
+ **	to the root) then we can relax slightly and trust fpathconf
+ **	in more circumstances.  This is really a crock -- if this is an
+ **	NFS mounted filesystem then we really know nothing about the
+ **	underlying implementation.  However, most systems pessimize and
+ **	return an error (EINVAL or EOPNOTSUPP) on NFS filesystems, which
+ **	we interpret as unsafe, as we should.  Thus, this heuristic gets
+ **	us into a possible problem only on systems that have a broken
+ **	pathconf implementation and which are also poorly configured
+ **	(have :include: files in group- or world-writable directories).
+ **
  **	Parameters:
  **		fd -- the file descriptor to check.
+ **		safedir -- set if the parent directory is safe.
  **
  **	Returns:
! **		TRUE -- if the chown(2) operation is "safe" -- that is,
! **			only root can chown the file to an arbitrary user.
  **		FALSE -- if an arbitrary user can give away a file.
  */
  
+ #ifndef IS_SAFE_CHOWN
+ # define IS_SAFE_CHOWN	> 0
+ #endif
+ 
  bool
! chownsafe(fd, safedir)
  	int fd;
+ 	bool safedir;
  {
! #if !defined(_POSIX_CHOWN_RESTRICTED) || _POSIX_CHOWN_RESTRICTED != -1
! # if defined(_PC_CHOWN_RESTRICTED)
  	int rval;
  
+ 	/* give the system administrator a chance to override */
+ 	if (ChownAlwaysSafe)
+ 		return TRUE;
+ 
  	/*
  	**  Some systems (e.g., SunOS) seem to have the call and the
  	**  #define _PC_CHOWN_RESTRICTED, but don't actually implement
***************
*** 3783,3797 ****
  
  	errno = 0;
  	rval = fpathconf(fd, _PC_CHOWN_RESTRICTED);
! 	if (errno == 0)
! 		return rval > 0;
! #  endif
! #  ifdef BSD
! 	return TRUE;
  #  else
! 	return FALSE;
  #  endif
  # endif
  #endif
  }
  /*
--- 3842,3855 ----
  
  	errno = 0;
  	rval = fpathconf(fd, _PC_CHOWN_RESTRICTED);
! #  if SAFENFSPATHCONF
! 	return errno == 0 && rval IS_SAFE_CHOWN;
  #  else
! 	return safedir && errno == 0 && rval IS_SAFE_CHOWN;
  #  endif
  # endif
+ #else
+ 	return ChownAlwaysSafe;
  #endif
  }
  /*
***************
*** 4028,4038 ****
  #if TCPWRAPPERS
  	if (!hosts_ctl("sendmail", hostname, anynet_ntoa(sap), STRING_UNKNOWN))
  	{
- # ifdef LOG
  		if (LogLevel >= 4)
! 			syslog(LOG_NOTICE, "tcpwrappers (%s, %s) rejection",
  				hostname, anynet_ntoa(sap));
- # endif
  		return FALSE;
  	}
  #endif
--- 4086,4095 ----
  #if TCPWRAPPERS
  	if (!hosts_ctl("sendmail", hostname, anynet_ntoa(sap), STRING_UNKNOWN))
  	{
  		if (LogLevel >= 4)
! 			sm_syslog(LOG_NOTICE, NOQID,
! 				"tcpwrappers (%s, %s) rejection",
  				hostname, anynet_ntoa(sap));
  		return FALSE;
  	}
  #endif
***************
*** 4385,4391 ****
  **		Loads $=w with the names of all the interfaces.
  */
  
! #ifdef SIOCGIFCONF
  struct rtentry;
  struct mbuf;
  # include <arpa/inet.h>
--- 4442,4448 ----
  **		Loads $=w with the names of all the interfaces.
  */
  
! #if defined(SIOCGIFCONF) && !SIOCGIFCONF_IS_BROKEN
  struct rtentry;
  struct mbuf;
  # include <arpa/inet.h>
***************
*** 4398,4416 ****
  void
  load_if_names()
  {
! #ifdef SIOCGIFCONF
  	int s;
  	int i;
!         struct ifconf ifc;
! 	char interfacebuf[10240];
  
  	s = socket(AF_INET, SOCK_DGRAM, 0);
  	if (s == -1)
  		return;
  
  	/* get the list of known IP address from the kernel */
!         ifc.ifc_buf = interfacebuf;
!         ifc.ifc_len = sizeof interfacebuf;
  	if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0)
  	{
  		if (tTd(0, 4))
--- 4455,4492 ----
  void
  load_if_names()
  {
! #if defined(SIOCGIFCONF) && !SIOCGIFCONF_IS_BROKEN
  	int s;
  	int i;
! 	struct ifconf ifc;
! 	int numifs;
  
  	s = socket(AF_INET, SOCK_DGRAM, 0);
  	if (s == -1)
  		return;
  
  	/* get the list of known IP address from the kernel */
! # ifdef SIOCGIFNUM
! 	if (ioctl(s, SIOCGIFNUM, (char *) &numifs) < 0)
! 	{
! 		/* can't get number of interfaces -- fall back */
! 		if (tTd(0, 4))
! 			printf("SIOCGIFNUM failed: %s\n", errstring(errno));
! 		numifs = -1;
! 	}
! 	else if (tTd(0, 42))
! 		printf("system has %d interfaces\n", numifs);
! 	if (numifs < 0)
! # endif
! 		numifs = 512;
! 
! 	if (numifs <= 0)
! 	{
! 		close(s);
! 		return;
! 	}
! 	ifc.ifc_len = numifs * sizeof (struct ifreq);
! 	ifc.ifc_buf = xalloc(ifc.ifc_len);
  	if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0)
  	{
  		if (tTd(0, 4))
***************
*** 4435,4441 ****
  #endif
  		char ip_addr[256];
  		extern char *inet_ntoa();
- 		extern struct hostent *gethostbyaddr();
  
  #ifdef BSD4_4_SOCKADDR
  		if (sa->sa_len > sizeof ifr->ifr_addr)
--- 4511,4516 ----
***************
*** 4456,4467 ****
  		ioctl(s, SIOCGIFFLAGS, (char *) &ifrf);
  		if (tTd(0, 41))
  			printf("\tflags: %x\n", ifrf.ifr_flags);
! 		if (!bitset(IFF_UP, ifrf.ifr_flags))
! 			continue;
  #else
! 		if (!bitset(IFF_UP, ifr->ifr_flags))
! 			continue;
  #endif
  
  		/* extract IP address from the list*/
  		ia = (((struct sockaddr_in *) sa)->sin_addr);
--- 4531,4542 ----
  		ioctl(s, SIOCGIFFLAGS, (char *) &ifrf);
  		if (tTd(0, 41))
  			printf("\tflags: %x\n", ifrf.ifr_flags);
! # define IFRFREF ifrf
  #else
! # define IFRFREF (*ifr)
  #endif
+ 		if (!bitset(IFF_UP, IFRFREF.ifr_flags))
+ 			continue;
  
  		/* extract IP address from the list*/
  		ia = (((struct sockaddr_in *) sa)->sin_addr);
***************
*** 4484,4501 ****
  		}
  
  		/* skip "loopback" interface "lo" */
! 		if (strcmp("lo0", ifr->ifr_name) == 0)
  			continue;
  
  		/* lookup name with IP address */
  		hp = sm_gethostbyaddr((char *) &ia, sizeof(ia), AF_INET);
  		if (hp == NULL)
  		{
- #ifdef LOG
  			if (LogLevel > 3)
! 				syslog(LOG_WARNING,
! 					"gethostbyaddr() failed for %.100s\n",
! 					inet_ntoa(ia));
  #endif
  			continue;
  		}
--- 4559,4579 ----
  		}
  
  		/* skip "loopback" interface "lo" */
! 		if (bitset(IFF_LOOPBACK, IFRFREF.ifr_flags))
  			continue;
  
  		/* lookup name with IP address */
  		hp = sm_gethostbyaddr((char *) &ia, sizeof(ia), AF_INET);
  		if (hp == NULL)
  		{
  			if (LogLevel > 3)
! 				sm_syslog(LOG_WARNING, NOQID,
! 					"gethostbyaddr(%.100s) failed: %d\n",
! 					inet_ntoa(ia),
! #if NAMED_BIND
! 					h_errno);
! #else
! 					-1);
  #endif
  			continue;
  		}
***************
*** 4520,4526 ****
--- 4598,4763 ----
  			hp->h_aliases++;
  		}
  	}
+ 	free(ifc.ifc_buf);
  	close(s);
+ # undef IFRFREF
+ #endif
+ }
+ /*
+ **  GET_NUM_PROCS_ONLINE -- return the number of processors currently online
+ **
+ **	Parameters:
+ **		none.
+ **
+ **	Returns:
+ **		The number of processors online.
+ */
+ 
+ int
+ get_num_procs_online()
+ {
+ 	int nproc = 0;
+ 
+ #if _FFR_SCALE_LA_BY_NUM_PROCS
+ #ifdef _SC_NPROCESSORS_ONLN
+ 	nproc = (int) sysconf(_SC_NPROCESSORS_ONLN);
+ #endif
+ #endif
+ 	if (nproc <= 0)
+ 		nproc = 1;
+ 	return nproc;
+ }
+ /*
+ **  SM_SYSLOG -- syslog wrapper to keep messages under SYSLOG_BUFSIZE
+ **
+ **	Parameters:
+ **		level -- syslog level
+ **		id -- envelope ID or NULL (NOQUEUE)
+ **		fmt -- format string
+ **		arg... -- arguments as implied by fmt.
+ **
+ **	Returns:
+ **		none
+ */
+ 
+ /* VARARGS3 */
+ void
+ # ifdef __STDC__
+ sm_syslog(int level, const char *id, const char *fmt, ...)
+ # else
+ sm_syslog(level, id, fmt, va_alist)
+ 	int level;
+ 	const char *id;
+ 	const char *fmt;
+ 	va_dcl
+ #endif
+ {
+ 	static char *buf = NULL;
+ 	static size_t bufsize = MAXLINE;
+ 	char *begin, *end;
+ 	int seq = 1;
+ 	int idlen;
+ 	extern int SnprfOverflow;
+ 	VA_LOCAL_DECL
+ 	
+ 	SyslogErrno = errno;
+ 	if (id == NULL)
+ 	{
+ 		id = "NOQUEUE";
+ 		idlen = 9;
+ 	}
+ 	else if (strcmp(id, NOQID) == 0)
+ 	{
+ 		id = "";
+ 		idlen = 0;
+ 	}
+ 	else
+ 		idlen = strlen(id + 2);
+ bufalloc:
+ 	if (buf == NULL)
+ 		buf = (char *) xalloc(sizeof(char) * bufsize);
+ 
+ 	/* do a virtual vsnprintf into buf */
+ 	VA_START(fmt);
+ 	buf[0] = 0;
+ 	DoprEnd = buf + bufsize - 1;
+ 	SnprfOverflow = 0;
+ 	sm_dopr(buf, fmt, ap);
+ 	*DoprEnd = '\0';
+ 	VA_END;
+ 	/* end of virtual vsnprintf */
+ 
+ 	if (SnprfOverflow)
+ 	{
+ 		/* String too small, redo with correct size */
+ 		bufsize += SnprfOverflow + 1;
+ 		free(buf);
+ 		buf = NULL;
+ 		goto bufalloc;
+ 	}
+ 	if ((strlen(buf) + idlen + 1) < SYSLOG_BUFSIZE)
+ 	{
+ #if LOG
+ 		if (*id == '\0')
+ 			syslog(level, "%s", buf);
+ 		else
+ 			syslog(level, "%s: %s", id, buf);
+ #else
+ 		/*XXX should do something more sensible */
+ 		if (*id == '\0')
+ 			fprintf(stderr, "%s\n", buf);
+ 		else
+ 			fprintf(stderr, "%s: %s\n", id, buf);
+ #endif
+ 		return;
+ 	}
+ 
+ 	begin = buf;
+ 	while (*begin != '\0' &&
+ 	       (strlen(begin) + idlen + 5) > SYSLOG_BUFSIZE) 
+ 	{
+ 		char save;
+ 	
+ 		if (seq == 999)
+ 		{
+ 			/* Too many messages */
+ 			break;
+ 		}
+ 		end = begin + SYSLOG_BUFSIZE - idlen - 12;
+ 		while (end > begin)
+ 		{
+ 			/* Break on comma or space */
+ 			if (*end == ',' || *end == ' ')
+ 			{
+ 				end++;	  /* Include separator */
+ 				break;
+ 			}
+ 			end--;
+ 		}
+ 		/* No separator, break midstring... */
+ 		if (end == begin)
+ 			end = begin + SYSLOG_BUFSIZE - idlen - 12;
+ 		save = *end;
+ 		*end = 0;
+ #if LOG
+ 		syslog(level, "%s[%d]: %s ...", id, seq++, begin);
+ #else
+ 		fprintf(stderr, "%s[%d]: %s ...\n", id, seq++, begin);
+ #endif
+ 		*end = save;
+ 		begin = end;
+ 	}
+ 	if (seq == 999)
+ #if LOG
+ 		syslog(level, "%s[%d]: log terminated, too many parts", id, seq);
+ #else
+ 		fprintf(stderr, "%s[%d]: log terminated, too many parts\n", id, seq);
+ #endif
+ 	else if (*begin != '\0')
+ #if LOG
+ 		syslog(level, "%s[%d]: %s", id, seq, begin);
+ #else
+ 		fprintf(stderr, "%s[%d]: %s\n", id, seq, begin);
  #endif
  }
  /*
***************
*** 4553,4559 ****
  # endif
  {
  	int i;
! 	char buf[SYSLOG_BUFSIZE * 2];
  	VA_LOCAL_DECL;
  
  	VA_START(msg);
--- 4790,4796 ----
  # endif
  {
  	int i;
! 	char buf[SYSLOG_BUFSIZE];
  	VA_LOCAL_DECL;
  
  	VA_START(msg);
***************
*** 4613,4619 ****
  #if LDAPMAP
  	"LDAPMAP",
  #endif
! #ifdef LOG
  	"LOG",
  #endif
  #if MATCHGECOS
--- 4850,4856 ----
  #if LDAPMAP
  	"LDAPMAP",
  #endif
! #if LOG
  	"LOG",
  #endif
  #if MATCHGECOS
***************
*** 4695,4700 ****
--- 4932,4940 ----
  
  char	*OsCompileOptions[] =
  {
+ #if BOGUS_O_EXCL
+ 	"BOGUS_O_EXCL",
+ #endif
  #if HASFCHMOD
  	"HASFCHMOD",
  #endif
***************
*** 4731,4736 ****
--- 4971,4979 ----
  #if HASSNPRINTF
  	"HASSNPRINTF",
  #endif
+ #if HASSTRERROR
+ 	"HASSTRERROR",
+ #endif
  #if HASULIMIT
  	"HASULIMIT",
  #endif
***************
*** 4758,4768 ****
--- 5001,5017 ----
  #if RLIMIT_NEEDS_SYS_TIME_H
  	"RLIMIT_NEEDS_SYS_TIME_H",
  #endif
+ #if SAFENFSPATHCONF
+ 	"SAFENFSPATHCONF",
+ #endif
  #if SECUREWARE
  	"SECUREWARE",
  #endif
  #if SHARE_V1
  	"SHARE_V1",
+ #endif
+ #if SIOCGIFCONF_IS_BROKEN
+ 	"SIOCGIFCONF_IS_BROKEN",
  #endif
  #if SYS5SETPGRP
  	"SYS5SETPGRP",
diff -Ncr sendmail-8.8.5/src/conf.h sendmail-8.8.6/src/conf.h
*** sendmail-8.8.5/src/conf.h	Fri Jan 17 15:54:22 1997
--- sendmail-8.8.6/src/conf.h	Thu Jun 12 12:00:26 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 31,37 ****
   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   *
!  *	@(#)conf.h	8.288 (Berkeley) 1/17/97
   */
  
  /*
--- 31,37 ----
   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   *
!  *	@(#)conf.h	8.313 (Berkeley) 6/11/97
   */
  
  /*
***************
*** 79,84 ****
--- 79,85 ----
  # define MAXMIMEARGS	20		/* max args in Content-Type: */
  # define MAXMIMENESTING	20		/* max MIME multipart nesting */
  # define QUEUESEGSIZE	1000		/* increment for queue size */
+ # define MAXQFNAME	20		/* max qf file name length */
  
  /**********************************************************************
  **  Compilation options.
***************
*** 130,136 ****
  **  be turned off unless absolutely necessary.
  **********************************************************************/
  
! # define LOG			/* enable logging -- don't turn off */
  
  /**********************************************************************
  **  End of site-specific configuration.
--- 131,137 ----
  **  be turned off unless absolutely necessary.
  **********************************************************************/
  
! # define LOG		1	/* enable logging -- don't turn off */
  
  /**********************************************************************
  **  End of site-specific configuration.
***************
*** 175,180 ****
--- 176,182 ----
  # define HASINITGROUPS	1	/* has initgroups(3) call */
  # define HASFCHMOD	1	/* has fchmod(2) syscall */
  # define USESETEUID	1	/* has useable seteuid(2) call */
+ # define BOGUS_O_EXCL	1	/* exclusive open follows symlinks */
  # define seteuid(e)	setresuid(-1, e, -1)
  # define IP_SRCROUTE	1	/* can check IP source routing */
  # define LA_TYPE	LA_HPUX
***************
*** 185,190 ****
--- 187,193 ----
  #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
  # endif
  # define syslog		hard_syslog
+ # define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
  
  # ifdef V4FS
  		/* HP-UX 10.x */
***************
*** 217,222 ****
--- 220,226 ----
  */
  
  #ifdef _AIX4
+ # include <sys/select.h>
  # define _AIX3		1	/* pull in AIX3 stuff */
  # define USESETEUID	1	/* seteuid(2) works */
  # define TZ_TYPE	TZ_NAME	/* use tzname[] vector */
***************
*** 336,341 ****
--- 340,346 ----
  # define SFS_BAVAIL	f_bfree		/* alternate field name */
  # ifdef IRIX6
  #  define LA_TYPE	LA_IRIX6	/* figure out at run time */
+ #  define SAFENFSPATHCONF 0	/* pathconf(2) lies on NFS filesystems */
  # else
  #  define LA_TYPE	LA_INT
  
***************
*** 373,378 ****
--- 378,384 ----
  # define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
  # define HASFCHMOD	1	/* has fchmod(2) syscall */
  # define IP_SRCROUTE	1	/* can check IP source routing */
+ # define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
  
  # ifdef SOLARIS_2_3
  #  define SOLARIS	20300	/* for back compat only -- use -DSOLARIS=20300 */
***************
*** 402,407 ****
--- 408,416 ----
  #  ifndef SYSLOG_BUFSIZE
  #   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
  #  endif
+ #  ifndef TZ_TYPE
+ #   define TZ_TYPE	TZ_TZNAME
+ #  endif
  #  if SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203)
  #   define USESETEUID	1		/* seteuid works as of 2.3 */
  #  endif
***************
*** 529,534 ****
--- 538,544 ----
  # ifndef IDENTPROTO
  #  define IDENTPROTO	0	/* pre-4.4 TCP/IP implementation is broken */
  # endif
+ # define SYSLOG_BUFSIZE	256
  #endif
  
  
***************
*** 558,563 ****
--- 568,575 ----
  # ifndef TZ_TYPE
  #  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
  # endif
+ # define GIDSET_T	gid_t
+ # define MAXNAMLEN	NAME_MAX
  #endif
  
  
***************
*** 600,607 ****
  # define UID_T		int	/* compiler gripes on uid_t */
  # define GID_T		int	/* ditto for gid_t */
  # define MODE_T		int	/* and mode_t */
- # define sleep		sleepX
  # define setpgid	setpgrp
  # ifndef LA_TYPE
  #  define LA_TYPE	LA_MACH
  # endif
--- 612,621 ----
  # define UID_T		int	/* compiler gripes on uid_t */
  # define GID_T		int	/* ditto for gid_t */
  # define MODE_T		int	/* and mode_t */
  # define setpgid	setpgrp
+ # ifndef NOT_SENDMAIL
+ #  define sleep		sleepX
+ # endif
  # ifndef LA_TYPE
  #  define LA_TYPE	LA_MACH
  # endif
***************
*** 624,635 ****
  **	See also BSD defines.
  */
  
! #if defined(BSD4_4) && !defined(__bsdi__)
  # include <paths.h>
  # define HASUNSETENV	1	/* has unsetenv(3) call */
  # define USESETEUID	1	/* has useable seteuid(2) call */
  # define HASFCHMOD	1	/* has fchmod(2) syscall */
  # define HASSNPRINTF	1	/* has snprintf(3) and vsnprintf(3) */
  # include <sys/cdefs.h>
  # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
  # define BSD4_4_SOCKADDR	/* has sa_len */
--- 638,650 ----
  **	See also BSD defines.
  */
  
! #if defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__)
  # include <paths.h>
  # define HASUNSETENV	1	/* has unsetenv(3) call */
  # define USESETEUID	1	/* has useable seteuid(2) call */
  # define HASFCHMOD	1	/* has fchmod(2) syscall */
  # define HASSNPRINTF	1	/* has snprintf(3) and vsnprintf(3) */
+ # define HASSTRERROR	1	/* has strerror(3) */
  # include <sys/cdefs.h>
  # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
  # define BSD4_4_SOCKADDR	/* has sa_len */
***************
*** 655,660 ****
--- 670,676 ----
  # define HASFCHMOD	1	/* has fchmod(2) syscall */
  # define HASSNPRINTF	1	/* has snprintf(3) and vsnprintf(3) */
  # define HASUNAME	1	/* has uname(2) syscall */
+ # define HASSTRERROR	1	/* has strerror(3) */
  # include <sys/cdefs.h>
  # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
  # define BSD4_4_SOCKADDR	/* has sa_len */
***************
*** 696,705 ****
--- 712,723 ----
  # define HASFCHMOD	1	/* has fchmod(2) syscall */
  # define HASSNPRINTF	1	/* has snprintf(3) and vsnprintf(3) */
  # define HASUNAME	1	/* has uname(2) syscall */
+ # define HASSTRERROR	1	/* has strerror(3) */
  # 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
  # ifndef LA_TYPE
  #  define LA_TYPE	LA_SUBR
***************
*** 737,743 ****
  **	For mt Xinu's Mach386 system.
  */
  
! #if defined(MACH) && defined(i386)
  # define MACH386	1
  # define HASUNSETENV	1	/* has unsetenv(3) call */
  # define HASINITGROUPS	1	/* has initgroups(3) call */
--- 755,761 ----
  **	For mt Xinu's Mach386 system.
  */
  
! #if defined(MACH) && defined(i386) && !defined(__GNU__)
  # define MACH386	1
  # define HASUNSETENV	1	/* has unsetenv(3) call */
  # define HASINITGROUPS	1	/* has initgroups(3) call */
***************
*** 761,766 ****
--- 779,828 ----
  #endif
  
  
+ 
+ /*
+ **  GNU OS (hurd)
+ **	Largely BSD & posix compatible.
+ **	Port contributed by Miles Bader <miles@gnu.ai.mit.edu>.
+ */
+ 
+ #ifdef __GNU_HURD__
+ # define SIOCGIFCONF_IS_BROKEN	1
+ # define IP_SRCROUTE		0
+ # define HASFCHMOD		1
+ # define HASFLOCK		1
+ # define HASUNAME		1
+ # define HASUNSETENV		1
+ # define HASSETSID		1
+ # define HASINITGROUPS		1
+ # define HASSETVBUF		1
+ # define HASSETREUID		1
+ # define USESETEUID		1
+ # define HASLSTAT		1
+ # define HASSETRLIMIT		1
+ # define HASWAITPID		1
+ # define HASGETDTABLESIZE	1
+ # define HASSTRERROR		1
+ /* # define NEEDGETOPT		1 */
+ # define HASGETUSERSHELL	1
+ # define ERRLIST_PREDEFINED	1
+ # define BSD4_4_SOCKADDR	1
+ # define GIDSET_T	gid_t
+ # define LA_TYPE	LA_MACH
+ 
+ /* GNU uses mach[34], which renames some rpcs from mach2.x.  */
+ # define host_self	mach_host_self
+ # define SFS_TYPE	SFS_STATFS
+ # define SPT_TYPE	SPT_CHANGEARGV
+ 
+ /* GNU has no MAXPATHLEN; ideally the code should be changed to not use it.  */
+ # define MAXPATHLEN	2048
+ 
+ /* Define device num frobbing macros.  */
+ # define major(x)	((x)>>8)
+ # define minor(x)	((x)&0xFF)
+ #endif /* GNU */
+ 
  /*
  **  4.3 BSD -- this is for very old systems
  **
***************
*** 1066,1071 ****
--- 1128,1134 ----
  # define GIDSET_T	gid_t	/* from <linux/types.h> */
  # define HASGETUSERSHELL 0	/* getusershell(3) broken in Slackware 2.0 */
  # define IP_SRCROUTE	0	/* linux <= 1.2.8 doesn't support IP_OPTIONS */
+ # define USE_SIGLONGJMP	1	/* sigsetjmp needed for signal handling */
  # ifndef HASFLOCK
  #  include <linux/version.h>
  #  if LINUX_VERSION_CODE < 66399
***************
*** 1117,1126 ****
  # define HASUNAME	1	/* use System V uname(2) system call */
  # define HASFCHMOD	1	/* has fchmod(2) syscall */
  # define HASINITGROUPS	1	/* has initgroups(3) call */
! # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
  # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
! # define SIGFUNC_RETURN	(0)	/* XXX this is a guess */
! # define SIGFUNC_DECL	int	/* XXX this is a guess */
  # ifndef IDENTPROTO
  #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
  # endif
--- 1180,1191 ----
  # define HASUNAME	1	/* use System V uname(2) system call */
  # define HASFCHMOD	1	/* has fchmod(2) syscall */
  # define HASINITGROUPS	1	/* has initgroups(3) call */
! # define HASSETVBUF	1	/* has setvbuf(3) in libc */
! # define HASSTRERROR	1	/* has strerror(3) */
  # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
! # define SIGFUNC_RETURN		/* POSIX-mode */
! # define SIGFUNC_DECL	void	/* POSIX-mode */
! # define ERRLIST_PREDEFINED	1
  # ifndef IDENTPROTO
  #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
  # endif
***************
*** 1829,1835 ****
  **  are closed.  Some firewalls return this error if you try to connect
  **  to the IDENT port (113), so you can't receive email from these hosts
  **  on these systems.  The firewall really should use a more specific
! **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
  **  not explicitly set to zero above, default it on.
  */
  
--- 1894,1900 ----
  **  are closed.  Some firewalls return this error if you try to connect
  **  to the IDENT port (113), so you can't receive email from these hosts
  **  on these systems.  The firewall really should use a more specific
! **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _FILTER_PROHIB.  If
  **  not explicitly set to zero above, default it on.
  */
  
***************
*** 1930,1941 ****
--- 1995,2015 ----
  #if !defined(S_ISLNK) && defined(S_IFLNK)
  # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
  #endif
+ #ifndef S_IRUSR
+ # define S_IRUSR		0400
+ #endif
  #ifndef S_IWUSR
  # define S_IWUSR		0200
  #endif
+ #ifndef S_IRGRP
+ # define S_IRGRP		0040
+ #endif
  #ifndef S_IWGRP
  # define S_IWGRP		0020
  #endif
+ #ifndef S_IROTH
+ # define S_IROTH		0004
+ #endif
  #ifndef S_IWOTH
  # define S_IWOTH		0002
  #endif
***************
*** 1957,1962 ****
--- 2031,2043 ----
  
  
  /*
+ **  An "impossible" file mode to indicate that the file does not exist.
+ */
+ 
+ #define ST_MODE_NOFILE	0171147		/* unlikely to occur */
+ 
+ 
+ /*
  **  These are used in a few cases where we need some special
  **  error codes, but where the system doesn't provide something
  **  reasonable.  They are printed in errstring.
***************
*** 1966,1972 ****
  # define E_PSEUDOBASE	256
  #endif
  
! #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
  #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
  
  /* type of arbitrary pointer */
--- 2047,2062 ----
  # define E_PSEUDOBASE	256
  #endif
  
! #define E_SM_OPENTIMEOUT (E_PSEUDOBASE + 0)	/* Timeout on file open */
! #define E_SM_NOSLINK	(E_PSEUDOBASE + 1)	/* Symbolic links not allowed */
! #define E_SM_NOHLINK	(E_PSEUDOBASE + 2)	/* Hard links not allowed */
! #define E_SM_REGONLY	(E_PSEUDOBASE + 3)	/* Regular files only */
! #define E_SM_ISEXEC	(E_PSEUDOBASE + 4)	/* Executable files not allowed */
! #define E_SM_WWDIR	(E_PSEUDOBASE + 5)	/* World writable directory */
! #define E_SM_GWDIR	(E_PSEUDOBASE + 6)	/* Group writable directory */
! #define E_SM_FILECHANGE (E_PSEUDOBASE + 7)	/* File changed after open */
! #define E_SM_WWFILE	(E_PSEUDOBASE + 8)	/* World writable file */
! #define E_SM_GWFILE	(E_PSEUDOBASE + 9)	/* Group writable file */
  #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
  
  /* type of arbitrary pointer */
***************
*** 1978,1993 ****
  # include "cdefs.h"
  #endif
  
! #if NAMED_BIND
! # include <arpa/nameser.h>
! # ifdef __svr4__
! #  ifdef NOERROR
! #   undef NOERROR		/* avoid compiler conflict with stream.h */
! #  endif
! # endif
! # ifndef __ksr__
! extern int h_errno;
! # endif
  #endif
  
  /*
--- 2068,2075 ----
  # include "cdefs.h"
  #endif
  
! #if NAMED_BIND && !defined(__ksr__)
! extern int	h_errno;
  #endif
  
  /*
***************
*** 2133,2139 ****
  # if (SYSLOG_BUFSIZE) > 768
  #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 512)
  # else
! #  define TOBUFSIZE	256
  # endif
  #endif
  
--- 2215,2221 ----
  # if (SYSLOG_BUFSIZE) > 768
  #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 512)
  # else
! #  define TOBUFSIZE	(SYSLOG_BUFSIZE / 2)
  # endif
  #endif
  
***************
*** 2181,2184 ****
--- 2263,2281 ----
  
  #if !defined(NGROUPS_MAX) && defined(NGROUPS)
  # define NGROUPS_MAX	NGROUPS		/* POSIX naming convention */
+ #endif
+ 
+ /*
+ **  If we don't have a system syslog, simulate it.
+ */
+ 
+ #if !LOG
+ # define LOG_EMERG	0	/* system is unusable */
+ # define LOG_ALERT	1	/* action must be taken immediately */
+ # define LOG_CRIT	2	/* critical conditions */
+ # define LOG_ERR	3	/* error conditions */
+ # define LOG_WARNING	4	/* warning conditions */
+ # define LOG_NOTICE	5	/* normal but significant condition */
+ # define LOG_INFO	6	/* informational */
+ # define LOG_DEBUG	7	/* debug-level messages */
  #endif
diff -Ncr sendmail-8.8.5/src/convtime.c sendmail-8.8.6/src/convtime.c
*** sendmail-8.8.5/src/convtime.c	Sun Nov 24 07:27:16 1996
--- sendmail-8.8.6/src/convtime.c	Sat Feb  1 16:24:48 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)convtime.c	8.8 (Berkeley) 11/24/96";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)convtime.c	8.9 (Berkeley) 2/1/97";
  #endif /* not lint */
  
  # include "sendmail.h"
diff -Ncr sendmail-8.8.5/src/daemon.c sendmail-8.8.6/src/daemon.c
*** sendmail-8.8.5/src/daemon.c	Tue Jan 14 18:01:05 1997
--- sendmail-8.8.6/src/daemon.c	Sun Jun  1 16:34:01 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 37,49 ****
  
  #ifndef lint
  #ifdef DAEMON
! static char sccsid[] = "@(#)daemon.c	8.159 (Berkeley) 1/14/97 (with daemon mode)";
  #else
! static char sccsid[] = "@(#)daemon.c	8.159 (Berkeley) 1/14/97 (without daemon mode)";
  #endif
  #endif /* not lint */
  
! #if DAEMON || defined(SOCK_STREAM)
  # include <arpa/inet.h>
  # if NAMED_BIND
  #  include <resolv.h>
--- 37,53 ----
  
  #ifndef lint
  #ifdef DAEMON
! static char sccsid[] = "@(#)daemon.c	8.175 (Berkeley) 6/1/97 (with daemon mode)";
  #else
! static char sccsid[] = "@(#)daemon.c	8.175 (Berkeley) 6/1/97 (without daemon mode)";
  #endif
  #endif /* not lint */
  
! #if defined(SOCK_STREAM) || defined(__GNU_LIBRARY__)
! # define USE_SOCK_STREAM	1
! #endif
! 
! #if DAEMON || defined(USE_SOCK_STREAM)
  # include <arpa/inet.h>
  # if NAMED_BIND
  #  include <resolv.h>
***************
*** 55,60 ****
--- 59,66 ----
  
  #if DAEMON
  
+ # include <sys/time.h>
+ 
  # if IP_SRCROUTE
  #  include <netinet/in_systm.h>
  #  include <netinet/ip.h>
***************
*** 166,173 ****
  
  	/* write the pid to the log file for posterity */
  	pidf = safefopen(PidFile, O_WRONLY|O_CREAT|O_TRUNC, 0644,
! 			 SFF_NOSLINK|SFF_ROOTOK|SFF_REGONLY|SFF_CREAT);
! 	if (pidf != NULL)
  	{
  		extern char *CommandLineArgs;
  
--- 172,183 ----
  
  	/* write the pid to the log file for posterity */
  	pidf = safefopen(PidFile, O_WRONLY|O_CREAT|O_TRUNC, 0644,
! 			 SFF_NOLINK|SFF_ROOTOK|SFF_REGONLY|SFF_CREAT);
! 	if (pidf == NULL)
! 	{
! 		sm_syslog(LOG_ERR, NOQID, "unable to write %s", PidFile);
! 	}
! 	else
  	{
  		extern char *CommandLineArgs;
  
***************
*** 200,206 ****
  		int savederrno;
  		int pipefd[2];
  		extern bool refuseconnections();
- 		extern int getla();
  
  		/* see if we are rejecting connections */
  		(void) blocksignal(SIGALRM);
--- 210,215 ----
***************
*** 234,246 ****
  			if (!wordinclass(jbuf, 'w'))
  			{
  				dumpstate("daemon lost $j");
! 				syslog(LOG_ALERT, "daemon process doesn't have $j in $=w; see syslog");
  				abort();
  			}
  			else if (j_has_dot && strchr(jbuf, '.') == NULL)
  			{
  				dumpstate("daemon $j lost dot");
! 				syslog(LOG_ALERT, "daemon process $j lost dot; see syslog");
  				abort();
  			}
  		}
--- 243,257 ----
  			if (!wordinclass(jbuf, 'w'))
  			{
  				dumpstate("daemon lost $j");
! 				sm_syslog(LOG_ALERT, NOQID,
! 					"daemon process doesn't have $j in $=w; see syslog");
  				abort();
  			}
  			else if (j_has_dot && strchr(jbuf, '.') == NULL)
  			{
  				dumpstate("daemon $j lost dot");
! 				sm_syslog(LOG_ALERT, NOQID,
! 					"daemon process $j lost dot; see syslog");
  				abort();
  			}
  		}
***************
*** 260,272 ****
  			log an error here;
  #endif
  		(void) releasesignal(SIGALRM);
! 		do
  		{
  			errno = 0;
  			lotherend = socksize;
  			t = accept(DaemonSocket,
  			    (struct sockaddr *)&RealHostAddr, &lotherend);
! 		} while (t < 0 && errno == EINTR);
  		savederrno = errno;
  		(void) blocksignal(SIGALRM);
  		if (t < 0)
--- 271,299 ----
  			log an error here;
  #endif
  		(void) releasesignal(SIGALRM);
! 		for (;;)
  		{
+ 			fd_set readfds;
+ 			struct timeval timeout;
+ 
+ 			FD_ZERO(&readfds);
+ 			FD_SET(DaemonSocket, &readfds);
+ 			timeout.tv_sec = 60;
+ 			timeout.tv_usec = 0;
+ 
+ 			t = select(DaemonSocket + 1, &readfds, NULL, NULL, &timeout);
+ 			if (DoQueueRun)
+ 				(void) runqueue(TRUE, FALSE);
+ 			if (t <= 0 || !FD_ISSET(DaemonSocket, &readfds))
+ 				continue;
+ 
  			errno = 0;
  			lotherend = socksize;
  			t = accept(DaemonSocket,
  			    (struct sockaddr *)&RealHostAddr, &lotherend);
! 			if (t >= 0 || errno != EINTR)
! 				break;
! 		}
  		savederrno = errno;
  		(void) blocksignal(SIGALRM);
  		if (t < 0)
***************
*** 381,386 ****
--- 408,416 ----
  			OutChannel = outchannel;
  			DisConnected = FALSE;
  
+ 			/* open maps for check_relay ruleset */
+ 			initmaps(FALSE, e);
+ 
  			/* validate the connection */
  			HoldErrs = TRUE;
  			nullconn = !validate_connection(&RealHostAddr, RealHostName, e);
***************
*** 463,472 ****
  				saveerrno = errno;
  				syserr("opendaemonsocket: can't create server SMTP socket");
  			  severe:
- # ifdef LOG
  				if (LogLevel > 0)
! 					syslog(LOG_ALERT, "problem creating SMTP socket");
! # endif /* LOG */
  				DaemonSocket = -1;
  				continue;
  			}
--- 493,501 ----
  				saveerrno = errno;
  				syserr("opendaemonsocket: can't create server SMTP socket");
  			  severe:
  				if (LogLevel > 0)
! 					sm_syslog(LOG_ALERT, NOQID,
! 						"problem creating SMTP socket");
  				DaemonSocket = -1;
  				continue;
  			}
***************
*** 747,753 ****
  	register MCI *mci;
  	ENVELOPE *e;
  {
! 	register volatile int i = 0;
  	register volatile int s;
  	register struct hostent *volatile hp = (struct hostent *)NULL;
  	SOCKADDR addr;
--- 776,782 ----
  	register MCI *mci;
  	ENVELOPE *e;
  {
! 	register volatile int addrno = 0;
  	register volatile int s;
  	register struct hostent *volatile hp = (struct hostent *)NULL;
  	SOCKADDR addr;
***************
*** 870,876 ****
  				hp->h_length);
  			break;
  		}
! 		i = 1;
  	}
  
  	/*
--- 899,905 ----
  				hp->h_length);
  			break;
  		}
! 		addrno = 1;
  	}
  
  	/*
***************
*** 883,892 ****
  
  		if (sp == NULL)
  		{
- #ifdef LOG
  			if (LogLevel > 2)
! 				syslog(LOG_ERR, "makeconnection: service \"smtp\" unknown");
! #endif
  			port = htons(25);
  		}
  		else
--- 912,920 ----
  
  		if (sp == NULL)
  		{
  			if (LogLevel > 2)
! 				sm_syslog(LOG_ERR, NOQID,
! 					"makeconnection: service \"smtp\" unknown");
  			port = htons(25);
  		}
  		else
***************
*** 988,1009 ****
  
  		if (setjmp(CtxConnectTimeout) == 0)
  		{
  			if (e->e_ntries <= 0 && TimeOuts.to_iconnect != 0)
  				ev = setevent(TimeOuts.to_iconnect, connecttimeout, 0);
  			else if (TimeOuts.to_connect != 0)
  				ev = setevent(TimeOuts.to_connect, connecttimeout, 0);
  			else
  				ev = NULL;
! 			if (connect(s, (struct sockaddr *) &addr, addrlen) >= 0)
! 			{
! 				if (ev != NULL)
! 					clrevent(ev);
  				break;
- 			}
  		}
! 		sav_errno = errno;
! 		if (ev != NULL)
! 			clrevent(ev);
  
  		/* if running demand-dialed connection, try again */
  		if (DialDelay > 0 && firstconnect)
--- 1016,1038 ----
  
  		if (setjmp(CtxConnectTimeout) == 0)
  		{
+ 			int i;
+ 
  			if (e->e_ntries <= 0 && TimeOuts.to_iconnect != 0)
  				ev = setevent(TimeOuts.to_iconnect, connecttimeout, 0);
  			else if (TimeOuts.to_connect != 0)
  				ev = setevent(TimeOuts.to_connect, connecttimeout, 0);
  			else
  				ev = NULL;
! 			i = connect(s, (struct sockaddr *) &addr, addrlen);
! 			sav_errno = errno;
! 			if (ev != NULL)
! 				clrevent(ev);
! 			if (i >= 0)
  				break;
  		}
! 		else
! 			sav_errno = errno;
  
  		/* if running demand-dialed connection, try again */
  		if (DialDelay > 0 && firstconnect)
***************
*** 1018,1024 ****
  
  		/* couldn't connect.... figure out why */
  		(void) close(s);
! 		if (hp != NULL && hp->h_addr_list[i])
  		{
  			if (tTd(16, 1))
  				printf("Connect failed (%s); trying new address....\n",
--- 1047,1053 ----
  
  		/* couldn't connect.... figure out why */
  		(void) close(s);
! 		if (hp != NULL && hp->h_addr_list[addrno])
  		{
  			if (tTd(16, 1))
  				printf("Connect failed (%s); trying new address....\n",
***************
*** 1027,1040 ****
  			{
  #if NETINET
  			  case AF_INET:
! 				bcopy(hp->h_addr_list[i++],
  				      &addr.sin.sin_addr,
  				      INADDRSZ);
  				break;
  #endif
  
  			  default:
! 				bcopy(hp->h_addr_list[i++],
  					addr.sa.sa_data,
  					hp->h_length);
  				break;
--- 1056,1069 ----
  			{
  #if NETINET
  			  case AF_INET:
! 				bcopy(hp->h_addr_list[addrno++],
  				      &addr.sin.sin_addr,
  				      INADDRSZ);
  				break;
  #endif
  
  			  default:
! 				bcopy(hp->h_addr_list[addrno++],
  					addr.sa.sa_data,
  					hp->h_length);
  				break;
***************
*** 1129,1147 ****
  	if (strchr(hostbuf, '.') == NULL &&
  	    !getcanonname(hostbuf, size, TRUE))
  	{
! #ifdef LOG
! 		syslog(LOG_CRIT, "My unqualified host name (%s) unknown; sleeping for retry",
  			hostbuf);
- #endif
  		message("My unqualified host name (%s) unknown; sleeping for retry",
  			hostbuf);
  		sleep(60);
  		if (!getcanonname(hostbuf, size, TRUE))
  		{
! #ifdef LOG
! 			syslog(LOG_ALERT, "unable to qualify my own domain name (%s) -- using short name",
  				hostbuf);
- #endif
  			message("WARNING: unable to qualify my own domain name (%s) -- using short name",
  				hostbuf);
  		}
--- 1158,1174 ----
  	if (strchr(hostbuf, '.') == NULL &&
  	    !getcanonname(hostbuf, size, TRUE))
  	{
! 		sm_syslog(LOG_CRIT, NOQID,
! 			"My unqualified host name (%s) unknown; sleeping for retry",
  			hostbuf);
  		message("My unqualified host name (%s) unknown; sleeping for retry",
  			hostbuf);
  		sleep(60);
  		if (!getcanonname(hostbuf, size, TRUE))
  		{
! 			sm_syslog(LOG_ALERT, NOQID,
! 				"unable to qualify my own domain name (%s) -- using short name",
  				hostbuf);
  			message("WARNING: unable to qualify my own domain name (%s) -- using short name",
  				hostbuf);
  		}
***************
*** 1181,1186 ****
--- 1208,1216 ----
  	int i;
  	EVENT *ev;
  	int nleft;
+ 	struct hostent *hp;
+ 	char **ha;
+ 	bool may_be_forged;
  	char ibuf[MAXNAME + 1];
  	static char hbuf[MAXNAME * 2 + 2];
  
***************
*** 1203,1208 ****
--- 1233,1262 ----
  			RealHostName[MAXNAME - 1] = '\0';
  	}
  
+ 	/* cross check RealHostName with forward DNS lookup */
+ 	if (anynet_ntoa(&RealHostAddr)[0] == '[')
+ 	{
+ 		/* address is not a socket */
+ 		may_be_forged = FALSE;
+ 	}
+ 	else
+ 	{
+ 		/* try to match the reverse against the forward lookup */
+ 		hp = gethostbyname(RealHostName);
+ 
+ 		if (hp == NULL)
+ 			may_be_forged = TRUE;
+ 		else
+ 		{
+ 			for (ha = hp->h_addr_list; *ha != NULL; ha++)
+ 				if (bcmp(*ha,
+ 					 (char *) &RealHostAddr.sin.sin_addr,
+ 					 hp->h_length) == 0)
+ 					break;
+ 			may_be_forged = *ha == NULL;
+ 		}
+ 	}
+ 
  	if (TimeOuts.to_ident == 0)
  		goto noident;
  
***************
*** 1340,1345 ****
--- 1394,1402 ----
  
  postident:
  #if IP_SRCROUTE
+ # ifndef GET_IPOPT_DST
+ #  define GET_IPOPT_DST(dst)	(dst)
+ # endif
  	/*
  	**  Extract IP source routing information.
  	**
***************
*** 1383,1403 ****
  
  			  case IPOPT_SSRR:
  			  case IPOPT_LSRR:
  				p = &hbuf[strlen(hbuf)];
  				l = sizeof hbuf - (hbuf - p) - 6;
  				snprintf(p, SPACELEFT(hbuf, p), " [%s@%.*s",
  				    *o == IPOPT_SSRR ? "!" : "",
  				    l > 240 ? 120 : l / 2,
! 				    inet_ntoa(ipopt.ipopt_dst));
  				i = strlen(p);
  				p += i;
  				l -= strlen(p);
  
! 				/* o[1] is option length */
! 				j = *++o / sizeof(struct in_addr) - 1;
  
  				/* q skips length and router pointer to data */
! 				q = o + 2;
  				for ( ; j >= 0; j--)
  				{
  					memcpy(&addr, q, sizeof(addr));
--- 1440,1470 ----
  
  			  case IPOPT_SSRR:
  			  case IPOPT_LSRR:
+ 				/*
+ 				**  Source routing.
+ 				**	o[0] is the option type (loose/strict).
+ 				**	o[1] is the length of this option,
+ 				**		including option type and
+ 				**		length.
+ 				**	o[2] is the pointer into the route
+ 				**		data.
+ 				**	o[3] begins the route data.
+ 				*/
+ 
  				p = &hbuf[strlen(hbuf)];
  				l = sizeof hbuf - (hbuf - p) - 6;
  				snprintf(p, SPACELEFT(hbuf, p), " [%s@%.*s",
  				    *o == IPOPT_SSRR ? "!" : "",
  				    l > 240 ? 120 : l / 2,
! 				    inet_ntoa(GET_IPOPT_DST(ipopt.ipopt_dst)));
  				i = strlen(p);
  				p += i;
  				l -= strlen(p);
  
! 				j = o[1] / sizeof(struct in_addr) - 1;
  
  				/* q skips length and router pointer to data */
! 				q = &o[3];
  				for ( ; j >= 0; j--)
  				{
  					memcpy(&addr, q, sizeof(addr));
***************
*** 1412,1418 ****
  					l -= i + 1;
  					q += sizeof(struct in_addr); 
  				}
! 				o += *o;
  				break;
  
  			  default:
--- 1479,1485 ----
  					l -= i + 1;
  					q += sizeof(struct in_addr); 
  				}
! 				o += o[1];
  				break;
  
  			  default:
***************
*** 1433,1438 ****
--- 1500,1510 ----
  		(void) snprintf(p, SPACELEFT(hbuf, p), " [%.100s]",
  			anynet_ntoa(&RealHostAddr));
  	}
+ 	if (may_be_forged)
+ 	{
+ 		p = &hbuf[strlen(hbuf)];
+ 		(void) snprintf(p, SPACELEFT(hbuf, p), " (may be forged)");
+ 	}
  
  postipsr:
  	if (tTd(9, 1))
***************
*** 1443,1449 ****
  **  HOST_MAP_LOOKUP -- turn a hostname into canonical form
  **
  **	Parameters:
! **		map -- a pointer to this map (unused).
  **		name -- the (presumably unqualified) hostname.
  **		av -- unused -- for compatibility with other mapping
  **			functions.
--- 1515,1521 ----
  **  HOST_MAP_LOOKUP -- turn a hostname into canonical form
  **
  **	Parameters:
! **		map -- a pointer to this map.
  **		name -- the (presumably unqualified) hostname.
  **		av -- unused -- for compatibility with other mapping
  **			functions.
***************
*** 1457,1463 ****
  **	Side Effects:
  **		Looks up the host specified in hbuf.  If it is not
  **		the canonical name for that host, return the canonical
! **		name.
  */
  
  char *
--- 1529,1536 ----
  **	Side Effects:
  **		Looks up the host specified in hbuf.  If it is not
  **		the canonical name for that host, return the canonical
! **		name (unless MF_MATCHONLY is set, which will cause the
! **		status only to be returned).
  */
  
  char *
***************
*** 1498,1504 ****
  			message("851 %s: Name server timeout",
  				shortenstring(name, 33));
  		}
! 		return s->s_namecanon.nc_cname;
  	}
  
  	/*
--- 1571,1586 ----
  			message("851 %s: Name server timeout",
  				shortenstring(name, 33));
  		}
! 		if (*statp != EX_OK)
! 			return NULL;
! 		if (bitset(MF_MATCHONLY, map->map_mflags))
! 			cp = map_rewrite(map, name, strlen(name), NULL);
! 		else
! 			cp = map_rewrite(map,
! 					 s->s_namecanon.nc_cname,
! 					 strlen(s->s_namecanon.nc_cname),
! 					 av);
! 		return cp;
  	}
  
  	/*
***************
*** 1532,1547 ****
  		{
  			if (tTd(9, 1))
  				printf("%s\n", hbuf);
  			if (bitset(MF_MATCHONLY, map->map_mflags))
! 			{
! 				cp = map_rewrite(map, name, strlen(name), av);
! 				s->s_namecanon.nc_cname = newstr(hbuf);
! 			}
  			else
- 			{
  				cp = map_rewrite(map, hbuf, strlen(hbuf), av);
- 				s->s_namecanon.nc_cname = newstr(cp);
- 			}
  			return cp;
  		}
  		else
--- 1614,1625 ----
  		{
  			if (tTd(9, 1))
  				printf("%s\n", hbuf);
+ 			s->s_namecanon.nc_stat = EX_OK;
+ 			s->s_namecanon.nc_cname = newstr(hbuf);
  			if (bitset(MF_MATCHONLY, map->map_mflags))
! 				cp = map_rewrite(map, name, strlen(name), NULL);
  			else
  				cp = map_rewrite(map, hbuf, strlen(hbuf), av);
  			return cp;
  		}
  		else
***************
*** 1589,1594 ****
--- 1667,1673 ----
  		return (NULL);
  	*cp = '\0';
  	in_addr.s_addr = inet_addr(&name[1]);
+ 	*cp = ']';
  
  	/* nope -- ask the name server */
  	hp = sm_gethostbyaddr((char *)&in_addr, INADDRSZ, AF_INET);
***************
*** 1604,1612 ****
  	}
  
  	/* found a match -- copy out */
- 	cp = map_rewrite(map, (char *) hp->h_name, strlen(hp->h_name), av);
  	s->s_namecanon.nc_stat = *statp = EX_OK;
! 	s->s_namecanon.nc_cname = newstr(cp);
  	return cp;
  }
  
--- 1683,1694 ----
  	}
  
  	/* found a match -- copy out */
  	s->s_namecanon.nc_stat = *statp = EX_OK;
! 	s->s_namecanon.nc_cname = newstr(hp->h_name);
! 	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);
  	return cp;
  }
  
***************
*** 1688,1703 ****
  	char *statp;
  {
  	register struct hostent *hp;
  
  	hp = sm_gethostbyname(name);
! 	if (hp != NULL)
! 		return hp->h_name;
! 	*statp = EX_NOHOST;
! 	return NULL;
  }
  
  #endif /* DAEMON */
  /*
  **  ANYNET_NTOA -- convert a network address to printable form.
  **
  **	Parameters:
--- 1770,1832 ----
  	char *statp;
  {
  	register struct hostent *hp;
+ 	char *cp;
  
  	hp = sm_gethostbyname(name);
! 	if (hp == NULL)
! 	{
! 		*statp = EX_NOHOST;
! 		return NULL;
! 	}
! 	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);
! 	return cp;
  }
  
  #endif /* DAEMON */
  /*
+ **  HOST_MAP_INIT -- initialize host class structures
+ */
+ 
+ bool
+ host_map_init(map, args)
+ 	MAP *map;
+ 	char *args;
+ {
+ 	register char *p = args;
+ 
+ 	for (;;)
+ 	{
+ 		while (isascii(*p) && isspace(*p))
+ 			p++;
+ 		if (*p != '-')
+ 			break;
+ 		switch (*++p)
+ 		{
+ 		  case 'a':
+ 			map->map_app = ++p;
+ 			break;
+ 
+ 		  case 'm':
+ 			map->map_mflags |= MF_MATCHONLY;
+ 			break;
+ 
+ 		  case 't':
+ 			map->map_mflags |= MF_NODEFER;
+ 			break;
+ 		}
+ 		while (*p != '\0' && !(isascii(*p) && isspace(*p)))
+ 			p++;
+ 		if (*p != '\0')
+ 			*p++ = '\0';
+ 	}
+ 	if (map->map_app != NULL)
+ 		map->map_app = newstr(map->map_app);
+ 	return TRUE;
+ }
+ /*
  **  ANYNET_NTOA -- convert a network address to printable form.
  **
  **	Parameters:
***************
*** 1707,1713 ****
  **		A printable version of that sockaddr.
  */
  
! #ifdef SOCK_STREAM
  
  #if NETLINK
  # include <net/if_dl.h>
--- 1836,1842 ----
  **		A printable version of that sockaddr.
  */
  
! #ifdef USE_SOCK_STREAM
  
  #if NETLINK
  # include <net/if_dl.h>
diff -Ncr sendmail-8.8.5/src/deliver.c sendmail-8.8.6/src/deliver.c
*** sendmail-8.8.5/src/deliver.c	Fri Jan 17 10:03:29 1997
--- sendmail-8.8.6/src/deliver.c	Wed Jun 11 16:26:44 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)deliver.c	8.266 (Berkeley) 1/17/97";
  #endif /* not lint */
  
  #include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)deliver.c	8.282 (Berkeley) 6/11/97";
  #endif /* not lint */
  
  #include "sendmail.h"
***************
*** 76,82 ****
  	int otherowners;
  	register ENVELOPE *ee;
  	ENVELOPE *splitenv = NULL;
! 	bool oldverbose = Verbose;
  	bool somedeliveries = FALSE;
  	pid_t pid;
  	extern void sendenvelope();
--- 76,82 ----
  	int otherowners;
  	register ENVELOPE *ee;
  	ENVELOPE *splitenv = NULL;
! 	int oldverbose = Verbose;
  	bool somedeliveries = FALSE;
  	pid_t pid;
  	extern void sendenvelope();
***************
*** 96,102 ****
  	}
  
  	/* determine actual delivery mode */
- 	CurrentLA = getla();
  	if (mode == SM_DEFAULT)
  	{
  		mode = e->e_sendmode;
--- 96,101 ----
***************
*** 295,300 ****
--- 294,300 ----
  		{
  			extern HDR *copyheader();
  			extern ADDRESS *copyqueue();
+ 			extern void dup_queue_file __P((ENVELOPE *, ENVELOPE *, int));
  
  			/*
  			**  Split this envelope into two.
***************
*** 360,401 ****
  			}
  
  			if (mode != SM_VERIFY && bitset(EF_HAS_DF, e->e_flags))
! 			{
! 				char df1buf[20], df2buf[20];
! 
! 				ee->e_dfp = NULL;
! 				snprintf(df1buf, sizeof df1buf, "%s",
! 					queuename(e, 'd'));
! 				snprintf(df2buf, sizeof df2buf, "%s",
! 					queuename(ee, 'd'));
! 				if (link(df1buf, df2buf) < 0)
! 				{
! 					int saverrno = errno;
! 
! 					syserr("sendall: link(%s, %s)",
! 						df1buf, df2buf);
! 					if (saverrno == EEXIST)
! 					{
! 						if (unlink(df2buf) < 0)
! 						{
! 							syserr("!sendall: unlink(%s): permanent",
! 								df2buf);
! 							/*NOTREACHED*/
! 						}
! 						if (link(df1buf, df2buf) < 0)
! 						{
! 							syserr("!sendall: link(%s, %s): permanent",
! 								df1buf, df2buf);
! 							/*NOTREACHED*/
! 						}
! 					}
! 				}
! 			}
! #ifdef LOG
  			if (LogLevel > 4)
! 				syslog(LOG_INFO, "%s: clone %s, owner=%s",
! 					ee->e_id, e->e_id, owner);
! #endif
  		}
  	}
  
--- 360,371 ----
  			}
  
  			if (mode != SM_VERIFY && bitset(EF_HAS_DF, e->e_flags))
! 				dup_queue_file(e, ee, 'd');
! 			openxscript(ee);
  			if (LogLevel > 4)
! 				sm_syslog(LOG_INFO, ee->e_id,
! 					"clone %s, owner=%s",
! 					e->e_id, owner);
  		}
  	}
  
***************
*** 420,425 ****
--- 390,404 ----
  		if (tTd(13, 29))
  			printf("No deliveries: auto-queuing\n");
  		mode = SM_QUEUE;
+ 
+ 		/* treat this as a delivery in terms of counting tries */
+ 		e->e_dtime = curtime();
+ 		e->e_ntries++;
+ 		for (ee = splitenv; ee != NULL; ee = ee->e_sibling)
+ 		{
+ 			ee->e_dtime = curtime();
+ 			ee->e_ntries++;
+ 		}
  	}
  
  # if QUEUE
***************
*** 462,468 ****
  	switch (mode)
  	{
  	  case SM_VERIFY:
! 		Verbose = TRUE;
  		break;
  
  	  case SM_QUEUE:
--- 441,447 ----
  	switch (mode)
  	{
  	  case SM_VERIFY:
! 		Verbose = 2;
  		break;
  
  	  case SM_QUEUE:
***************
*** 563,568 ****
--- 542,550 ----
  			finis();
  		}
  
+ 		/* be sure to give error messages in child */
+ 		QuickAbort = OnlyOneError = FALSE;
+ 
  		/*
  		**  Close any cached connections.
  		**
***************
*** 619,630 ****
  		printf("sendenvelope(%s) e_flags=0x%lx\n",
  			e->e_id == NULL ? "[NOQUEUE]" : e->e_id,
  			e->e_flags);
- #ifdef LOG
  	if (LogLevel > 80)
! 		syslog(LOG_DEBUG, "%s: sendenvelope, flags=0x%x",
! 			e->e_id == NULL ? "[NOQUEUE]" : e->e_id,
  			e->e_flags);
- #endif
  
  	/*
  	**  If we have had global, fatal errors, don't bother sending
--- 601,610 ----
  		printf("sendenvelope(%s) e_flags=0x%lx\n",
  			e->e_id == NULL ? "[NOQUEUE]" : e->e_id,
  			e->e_flags);
  	if (LogLevel > 80)
! 		sm_syslog(LOG_DEBUG, e->e_id,
! 			"sendenvelope, flags=0x%x",
  			e->e_flags);
  
  	/*
  	**  If we have had global, fatal errors, don't bother sending
***************
*** 709,714 ****
--- 689,739 ----
  #endif
  }
  /*
+ **  DUP_QUEUE_FILE -- duplicate a queue file into a split queue
+ **
+ **	Parameters:
+ **		e -- the existing envelope
+ **		ee -- the new envelope
+ **		type -- the queue file type (e.g., 'd')
+ **
+ **	Returns:
+ **		none
+ */
+ 
+ void
+ dup_queue_file(e, ee, type)
+ 	struct envelope *e, *ee;
+ 	int type;
+ {
+ 	char f1buf[MAXQFNAME], f2buf[MAXQFNAME];
+ 
+ 	ee->e_dfp = NULL;
+ 	ee->e_xfp = NULL;
+ 	snprintf(f1buf, sizeof f1buf, "%s", queuename(e, type));
+ 	snprintf(f2buf, sizeof f2buf, "%s", queuename(ee, type));
+ 	if (link(f1buf, f2buf) < 0)
+ 	{
+ 		int saverrno = errno;
+ 
+ 		syserr("sendall: link(%s, %s)", f1buf, f2buf);
+ 		if (saverrno == EEXIST)
+ 		{
+ 			if (unlink(f2buf) < 0)
+ 			{
+ 				syserr("!sendall: unlink(%s): permanent",
+ 					f2buf);
+ 				/*NOTREACHED*/
+ 			}
+ 			if (link(f1buf, f2buf) < 0)
+ 			{
+ 				syserr("!sendall: link(%s, %s): permanent",
+ 					f1buf, f2buf);
+ 				/*NOTREACHED*/
+ 			}
+ 		}
+ 	}
+ }
+ /*
  **  DOFORK -- do a fork, retrying a couple of times on failure.
  **
  **	This MUST be a macro, since after a vfork we are running
***************
*** 826,831 ****
--- 851,857 ----
  	time_t xstart;
  	bool suidwarn;
  	bool anyok;			/* at least one address was OK */
+ 	bool goodmxfound = FALSE;	/* at least one MX was OK */
  	int mpvect[2];
  	int rpvect[2];
  	char *pv[MAXPV+1];
***************
*** 1018,1023 ****
--- 1044,1050 ----
  			e->e_flags |= EF_NO_BODY_RETN;
  			to->q_status = "5.2.3";
  			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);
  			continue;
  		}
***************
*** 1294,1301 ****
  				curhost++;
  				continue;
  			}
! 			strncpy(hostbuf, curhost, p - curhost);
! 			hostbuf[p - curhost] = '\0';
  			if (*p != '\0')
  				p++;
  			curhost = p;
--- 1321,1331 ----
  				curhost++;
  				continue;
  			}
! 			i = p - curhost;
! 			if (i >= sizeof hostbuf)
! 				i = sizeof hostbuf - 1;
! 			strncpy(hostbuf, curhost, i);
! 			hostbuf[i] = '\0';
  			if (*p != '\0')
  				p++;
  			curhost = p;
***************
*** 1318,1328 ****
--- 1348,1363 ----
  			}
  			mci->mci_mailer = m;
  			if (mci->mci_exitstat != EX_OK)
+ 			{
+ 				if (mci->mci_exitstat == EX_TEMPFAIL)
+ 					goodmxfound = TRUE;
  				continue;
+ 			}
  
  			if (mci_lock_host(mci) != EX_OK)
  			{
  				mci_setstat(mci, EX_TEMPFAIL, "4.4.5", NULL);
+ 				goodmxfound = TRUE;
  				continue;
  			}
  
***************
*** 1343,1348 ****
--- 1378,1384 ----
  #endif
  			if (i == EX_OK)
  			{
+ 				goodmxfound = TRUE;
  				mci->mci_state = MCIS_OPENING;
  				mci_cache(mci);
  				if (TrafficLogFile != NULL)
***************
*** 1355,1360 ****
--- 1391,1398 ----
  			    	if (tTd(11, 1))
  					printf("openmailer: makeconnection => stat=%d, errno=%d\n",
  						i, errno);
+ 				if (i == EX_TEMPFAIL)
+ 					goodmxfound = TRUE;
  				mci_unlock_host(mci);
  			}
  
***************
*** 1863,1869 ****
  			for (to = tochain; to != NULL; to = to->q_tchain)
  			{
  				e->e_to = to->q_paddr;
! 				if ((i = smtprcpt(to, m, mci, e)) != EX_OK)
  				{
  					markfailure(e, to, mci, i);
  					giveresponse(i, m, mci, ctladdr, xstart, e);
--- 1901,1912 ----
  			for (to = tochain; to != NULL; to = to->q_tchain)
  			{
  				e->e_to = to->q_paddr;
! 				if (strlen(to->q_paddr) + (t - tobuf) + 2 >= sizeof tobuf)
! 				{
! 					/* not enough room */
! 					continue;
! 				}
! 				else if ((i = smtprcpt(to, m, mci, e)) != EX_OK)
  				{
  					markfailure(e, to, mci, i);
  					giveresponse(i, m, mci, ctladdr, xstart, e);
***************
*** 1948,1955 ****
  			rcode = smtpgetstat(m, mci, e);
  			if (rcode == EX_OK)
  			{
! 				strcat(tobuf, ",");
! 				strcat(tobuf, to->q_paddr);
  				anyok = TRUE;
  			}
  			else
--- 1991,2005 ----
  			rcode = smtpgetstat(m, mci, e);
  			if (rcode == EX_OK)
  			{
! 				if (strlen(to->q_paddr) + strlen(tobuf) + 2 >= sizeof tobuf)
! 				{
! 					syserr("LMTP tobuf overflow");
! 				}
! 				else
! 				{
! 					strcat(tobuf, ",");
! 					strcat(tobuf, to->q_paddr);
! 				}
  				anyok = TRUE;
  			}
  			else
***************
*** 1968,1973 ****
--- 2018,2025 ----
  			/* mark bad addresses */
  			if (rcode != EX_OK)
  			{
+ 				if (goodmxfound && rcode == EX_NOHOST)
+ 					rcode = EX_TEMPFAIL;
  				markfailure(e, to, mci, rcode);
  				continue;
  			}
***************
*** 2084,2089 ****
--- 2136,2142 ----
  	  case EX_IOERR:
  	  case EX_OSERR:
  		q->q_flags |= QQUEUEUP;
+ 		q->q_flags &= ~QDONTSEND;
  		break;
  
  	  default:
***************
*** 2203,2209 ****
  	if (mci->mci_pid == 0)
  		return (EX_OK);
  
! #ifdef _FFR_TIMEOUT_WAIT
  	put a timeout around the wait
  #endif
  
--- 2256,2262 ----
  	if (mci->mci_pid == 0)
  		return (EX_OK);
  
! #if _FFR_TIMEOUT_WAIT
  	put a timeout around the wait
  #endif
  
***************
*** 2428,2434 ****
  	time_t xstart;
  	register ENVELOPE *e;
  {
- # ifdef LOG
  	register char *bp;
  	register char *p;
  	int l;
--- 2481,2486 ----
***************
*** 2533,2543 ****
  
  		if (q == NULL)
  			break;
! 		syslog(LOG_INFO, "%s: to=%.*s [more]%s",
! 			e->e_id, ++q - p, p, buf);
  		p = q;
  	}
! 	syslog(LOG_INFO, "%s: to=%s%s", e->e_id, p, buf);
  
  #  else		/* we have a very short log buffer size */
  
--- 2585,2596 ----
  
  		if (q == NULL)
  			break;
! 		sm_syslog(LOG_INFO, e->e_id,
! 			"to=%.*s [more]%s",
! 			++q - p, p, buf);
  		p = q;
  	}
! 	sm_syslog(LOG_INFO, e->e_id, "to=%s%s", p, buf);
  
  #  else		/* we have a very short log buffer size */
  
***************
*** 2549,2559 ****
  
  		if (q == NULL)
  			break;
! 		syslog(LOG_INFO, "%s: to=%.*s [more]",
! 			e->e_id, ++q - p, p);
  		p = q;
  	}
! 	syslog(LOG_INFO, "%s: to=%s", e->e_id, p);
  
  	if (ctladdr != NULL)
  	{
--- 2602,2613 ----
  
  		if (q == NULL)
  			break;
! 		sm_syslog(LOG_INFO, e->e_id,
! 			"to=%.*s [more]",
! 			++q - p, p);
  		p = q;
  	}
! 	sm_syslog(LOG_INFO, e->e_id, "to=%s", p);
  
  	if (ctladdr != NULL)
  	{
***************
*** 2567,2573 ****
  					ctladdr->q_uid, ctladdr->q_gid);
  			bp += strlen(bp);
  		}
! 		syslog(LOG_INFO, "%s: %s", e->e_id, buf);
  	}
  	bp = buf;
  	snprintf(bp, SPACELEFT(buf, bp), "delay=%s",
--- 2621,2627 ----
  					ctladdr->q_uid, ctladdr->q_gid);
  			bp += strlen(bp);
  		}
! 		sm_syslog(LOG_INFO, e->e_id, "%s", buf);
  	}
  	bp = buf;
  	snprintf(bp, SPACELEFT(buf, bp), "delay=%s",
***************
*** 2585,2591 ****
  		snprintf(bp, SPACELEFT(buf, bp), ", mailer=%s", m->m_name);
  		bp += strlen(bp);
  	}
! 	syslog(LOG_INFO, "%s: %.1000s", e->e_id, buf);
  
  	buf[0] = '\0';
  	bp = buf;
--- 2639,2645 ----
  		snprintf(bp, SPACELEFT(buf, bp), ", mailer=%s", m->m_name);
  		bp += strlen(bp);
  	}
! 	sm_syslog(LOG_INFO, e->e_id, "%.1000s", buf);
  
  	buf[0] = '\0';
  	bp = buf;
***************
*** 2612,2622 ****
  			snprintf(buf, sizeof buf, "relay=%.100s", p);
  	}
  	if (buf[0] != '\0')
! 		syslog(LOG_INFO, "%s: %.1000s", e->e_id, buf);
  
! 	syslog(LOG_INFO, "%s: stat=%s", e->e_id, shortenstring(stat, 63));
  #  endif /* short log buffer */
- # endif /* LOG */
  }
  /*
  **  PUTFROMLINE -- output a UNIX-style from line (or whatever)
--- 2666,2675 ----
  			snprintf(buf, sizeof buf, "relay=%.100s", p);
  	}
  	if (buf[0] != '\0')
! 		sm_syslog(LOG_INFO, e->e_id, "%.1000s", buf);
  
! 	sm_syslog(LOG_INFO, e->e_id, "stat=%s", shortenstring(stat, 63));
  #  endif /* short log buffer */
  }
  /*
  **  PUTFROMLINE -- output a UNIX-style from line (or whatever)
***************
*** 2688,2694 ****
  		}
  	}
  	expand(template, buf, sizeof buf, e);
! 	putxline(buf, mci, PXLF_NOTHINGSPECIAL);
  }
  /*
  **  PUTBODY -- put the body of a message.
--- 2741,2747 ----
  		}
  	}
  	expand(template, buf, sizeof buf, e);
! 	putxline(buf, strlen(buf), mci, PXLF_NOTHINGSPECIAL);
  }
  /*
  **  PUTBODY -- put the body of a message.
***************
*** 2828,2834 ****
  			switch (ostate)
  			{
  			  case OS_HEAD:
! #ifdef _FFR_NONULLS
  				if (c == '\0' &&
  				    bitnset(M_NONULLS, mci->mci_mailer->m_flags))
  					break;
--- 2881,2887 ----
  			switch (ostate)
  			{
  			  case OS_HEAD:
! #if _FFR_NONULLS
  				if (c == '\0' &&
  				    bitnset(M_NONULLS, mci->mci_mailer->m_flags))
  					break;
***************
*** 2933,2939 ****
  					ostate = OS_CR;
  					continue;
  				}
! #ifdef _FFR_NONULLS
  				if (c == '\0' &&
  				    bitnset(M_NONULLS, mci->mci_mailer->m_flags))
  					break;
--- 2986,2992 ----
  					ostate = OS_CR;
  					continue;
  				}
! #if _FFR_NONULLS
  				if (c == '\0' &&
  				    bitnset(M_NONULLS, mci->mci_mailer->m_flags))
  					break;
***************
*** 3214,3220 ****
  		if (setuid(RealUid) < 0 && suidwarn)
  			syserr("mailfile: setuid(%ld) failed", (long) RealUid);
  
! 		sfflags |= SFF_NOPATHCHECK;
  		sfflags &= ~SFF_OPENASROOT;
  		f = safefopen(filename, oflags, FileMode, sfflags);
  		if (f == NULL)
--- 3267,3273 ----
  		if (setuid(RealUid) < 0 && suidwarn)
  			syserr("mailfile: setuid(%ld) failed", (long) RealUid);
  
! 		sfflags |= SFF_NOPATHCHECK|SFF_NOLINK;
  		sfflags &= ~SFF_OPENASROOT;
  		f = safefopen(filename, oflags, FileMode, sfflags);
  		if (f == NULL)
***************
*** 3252,3257 ****
--- 3305,3311 ----
  #endif
  		(void) xfclose(f, "mailfile", filename);
  		(void) fflush(stdout);
+ 		setuid(RealUid);
  		exit(ExitStat);
  		/*NOTREACHED*/
  	}
diff -Ncr sendmail-8.8.5/src/domain.c sendmail-8.8.6/src/domain.c
*** sendmail-8.8.5/src/domain.c	Wed Oct 30 09:42:41 1996
--- sendmail-8.8.6/src/domain.c	Wed Apr  9 08:03:32 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1986, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1986, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 36,44 ****
  
  #ifndef lint
  #if NAMED_BIND
! static char sccsid[] = "@(#)domain.c	8.64 (Berkeley) 10/30/96 (with name server)";
  #else
! static char sccsid[] = "@(#)domain.c	8.64 (Berkeley) 10/30/96 (without name server)";
  #endif
  #endif /* not lint */
  
--- 36,44 ----
  
  #ifndef lint
  #if NAMED_BIND
! static char sccsid[] = "@(#)domain.c	8.67 (Berkeley) 4/9/97 (with name server)";
  #else
! static char sccsid[] = "@(#)domain.c	8.67 (Berkeley) 4/9/97 (without name server)";
  #endif
  #endif /* not lint */
  
***************
*** 197,202 ****
--- 197,203 ----
  			goto punt;
  
  		  case TRY_AGAIN:
+ 		  case -1:
  			/* couldn't connect to the name server */
  			if (fallbackMX != NULL)
  			{
***************
*** 880,885 ****
--- 881,887 ----
  		fclose(fp);
  		return NULL;
  	}
+ 	fclose(fp);
  
  	/* got a match; extract the equivalent name */
  	while (*p != '\0' && isascii(*p) && isspace(*p))
diff -Ncr sendmail-8.8.5/src/envelope.c sendmail-8.8.6/src/envelope.c
*** sendmail-8.8.5/src/envelope.c	Mon Dec 16 13:51:19 1996
--- sendmail-8.8.6/src/envelope.c	Tue Jun  3 09:41:08 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)envelope.c	8.101 (Berkeley) 12/16/96";
  #endif /* not lint */
  
  #include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)envelope.c	8.104 (Berkeley) 6/3/97";
  #endif /* not lint */
  
  #include "sendmail.h"
***************
*** 121,132 ****
  		}
  	}
  
- #ifdef LOG
  	if (LogLevel > 84)
! 		syslog(LOG_DEBUG, "%s: dropenvelope, e_flags=0x%x, OpMode=%c, pid=%d",
! 			id == NULL ? "[NOQUEUE]" : id,
  			e->e_flags, OpMode, getpid());
- #endif
  
  	/* we must have an id to remove disk files */
  	if (id == NULL)
--- 121,130 ----
  		}
  	}
  
  	if (LogLevel > 84)
! 		sm_syslog(LOG_DEBUG, id,
! 			"dropenvelope, e_flags=0x%x, OpMode=%c, pid=%d",
  			e->e_flags, OpMode, getpid());
  
  	/* we must have an id to remove disk files */
  	if (id == NULL)
***************
*** 168,175 ****
  			queueit = TRUE;
  #if XDEBUG
  		else if (bitset(QQUEUEUP, q->q_flags))
! 			syslog(LOG_DEBUG, "dropenvelope: %s: q_flags = %x, paddr = %s",
! 				e->e_id, q->q_flags, q->q_paddr);
  #endif
  
  		/* see if a notification is needed */
--- 166,174 ----
  			queueit = TRUE;
  #if XDEBUG
  		else if (bitset(QQUEUEUP, q->q_flags))
! 			sm_syslog(LOG_DEBUG, e->e_id,
! 				"dropenvelope: q_flags = %x, paddr = %s",
! 				q->q_flags, q->q_paddr);
  #endif
  
  		/* see if a notification is needed */
***************
*** 296,301 ****
--- 295,302 ----
  	{
  		auto ADDRESS *rlist = NULL;
  
+ 		if (tTd(50, 8))
+ 			printf("dropenvelope(%s): sending return receipt\n", id);
  		e->e_flags |= EF_SENDRECEIPT;
  		(void) sendtolist(e->e_from.q_paddr, NULLADDR, &rlist, 0, e);
  		(void) returntosender("Return receipt", rlist, RTSF_NO_BODY, e);
***************
*** 310,315 ****
--- 311,318 ----
  	{
  		extern void savemail __P((ENVELOPE *, bool));
  
+ 		if (tTd(50, 8))
+ 			printf("dropenvelope(%s): saving mail\n", id);
  		savemail(e, !bitset(EF_NO_BODY_RETN, e->e_flags));
  	}
  
***************
*** 323,328 ****
--- 326,333 ----
  	{
  		auto ADDRESS *rlist = NULL;
  
+ 		if (tTd(50, 8))
+ 			printf("dropenvelope(%s): sending postmaster copy\n", id);
  		(void) sendtolist(PostMasterCopy, NULLADDR, &rlist, 0, e);
  		(void) returntosender(e->e_message, rlist, RTSF_PM_BOUNCE, e);
  	}
***************
*** 332,337 ****
--- 337,345 ----
  	*/
  
  simpledrop:
+ 	if (tTd(50, 8))
+ 		printf("dropenvelope(%s): at simpledrop, queueit=%d\n",
+ 			id, queueit);
  	if (!queueit || bitset(EF_CLRQUEUE, e->e_flags))
  	{
  		if (tTd(50, 1))
***************
*** 345,354 ****
  		xunlink(queuename(e, 'd'));
  		xunlink(queuename(e, 'q'));
  
- #ifdef LOG
  		if (LogLevel > 10)
! 			syslog(LOG_INFO, "%s: done", id);
! #endif
  	}
  	else if (queueit || !bitset(EF_INQUEUE, e->e_flags))
  	{
--- 353,360 ----
  		xunlink(queuename(e, 'd'));
  		xunlink(queuename(e, 'q'));
  
  		if (LogLevel > 10)
! 			sm_syslog(LOG_INFO, id, "done");
  	}
  	else if (queueit || !bitset(EF_INQUEUE, e->e_flags))
  	{
***************
*** 360,365 ****
--- 366,373 ----
  	}
  
  	/* now unlock the job */
+ 	if (tTd(50, 8))
+ 		printf("dropenvelope(%s): unlocking job\n", id);
  	closexscript(e);
  	unlockqueue(e);
  
***************
*** 698,704 ****
  	    e->e_from.q_mailer == InclMailer)
  	{
  		/* log garbage addresses for traceback */
- # ifdef LOG
  		if (from != NULL && LogLevel > 2)
  		{
  			char *p;
--- 706,711 ----
***************
*** 716,726 ****
  					MAXNAME, host);
  				p = ebuf;
  			}
! 			syslog(LOG_NOTICE,
  				"setsender: %s: invalid or unparseable, received from %s",
  				shortenstring(from, 83), p);
  		}
- # endif /* LOG */
  		if (from != NULL)
  		{
  			if (!bitset(QBADADDR, e->e_from.q_flags))
--- 723,732 ----
  					MAXNAME, host);
  				p = ebuf;
  			}
! 			sm_syslog(LOG_NOTICE, e->e_id,
  				"setsender: %s: invalid or unparseable, received from %s",
  				shortenstring(from, 83), p);
  		}
  		if (from != NULL)
  		{
  			if (!bitset(QBADADDR, e->e_from.q_flags))
***************
*** 838,848 ****
  	if (pvp == NULL)
  	{
  		/* don't need to give error -- prescan did that already */
- # ifdef LOG
  		if (LogLevel > 2)
! 			syslog(LOG_NOTICE, "cannot prescan from (%s)",
  				shortenstring(from, 203));
- # endif
  		finis();
  	}
  	(void) rewrite(pvp, 3, 0, e);
--- 844,853 ----
  	if (pvp == NULL)
  	{
  		/* don't need to give error -- prescan did that already */
  		if (LogLevel > 2)
! 			sm_syslog(LOG_NOTICE, e->e_id,
! 				"cannot prescan from (%s)",
  				shortenstring(from, 203));
  		finis();
  	}
  	(void) rewrite(pvp, 3, 0, e);
diff -Ncr sendmail-8.8.5/src/err.c sendmail-8.8.6/src/err.c
*** sendmail-8.8.5/src/err.c	Sun Dec  1 10:47:02 1996
--- sendmail-8.8.6/src/err.c	Thu Jun  5 09:24:45 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)err.c	8.52 (Berkeley) 12/1/96";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)err.c	8.62 (Berkeley) 6/5/97";
  #endif /* not lint */
  
  # include "sendmail.h"
***************
*** 42,49 ****
  /*
  **  SYSERR -- Print error message.
  **
! **	Prints an error message via printf to the diagnostic
! **	output.  If LOG is defined, it logs it also.
  **
  **	If the first character of the syserr message is `!' it will
  **	log this as an ALERT message and exit immediately.  This can
--- 42,48 ----
  /*
  **  SYSERR -- Print error message.
  **
! **	Prints an error message via printf to the diagnostic output.
  **
  **	If the first character of the syserr message is `!' it will
  **	log this as an ALERT message and exit immediately.  This can
***************
*** 90,105 ****
  	register char *p;
  	int olderrno = errno;
  	bool panic;
- #ifdef LOG
  	char *uname;
  	struct passwd *pw;
  	char ubuf[80];
- #endif
  	VA_LOCAL_DECL
  
  	panic = *fmt == '!';
  	if (panic)
  		fmt++;
  
  	/* format and output the error message */
  	if (olderrno == 0)
--- 89,105 ----
  	register char *p;
  	int olderrno = errno;
  	bool panic;
  	char *uname;
  	struct passwd *pw;
  	char ubuf[80];
  	VA_LOCAL_DECL
  
  	panic = *fmt == '!';
  	if (panic)
+ 	{
  		fmt++;
+ 		HoldErrs = FALSE;
+ 	}
  
  	/* format and output the error message */
  	if (olderrno == 0)
***************
*** 130,136 ****
  			printf("syserr: ExitStat = %d\n", ExitStat);
  	}
  
- # ifdef LOG
  	pw = sm_getpwuid(getuid());
  	if (pw != NULL)
  		uname = pw->pw_name;
--- 130,135 ----
***************
*** 141,150 ****
  	}
  
  	if (LogLevel > 0)
! 		syslog(panic ? LOG_ALERT : LOG_CRIT, "%s: SYSERR(%s): %.900s",
! 			CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
  			uname, &MsgBuf[4]);
- # endif /* LOG */
  	switch (olderrno)
  	{
  	  case EBADF:
--- 140,148 ----
  	}
  
  	if (LogLevel > 0)
! 		sm_syslog(panic ? LOG_ALERT : LOG_CRIT, CurEnv->e_id,
! 			"SYSERR(%s): %.900s",
  			uname, &MsgBuf[4]);
  	switch (olderrno)
  	{
  	  case EBADF:
***************
*** 180,186 ****
  		exit(EX_OSERR);
  	}
  	errno = 0;
! 	if (QuickAbort)
  		longjmp(TopFrame, 2);
  }
  /*
--- 178,184 ----
  		exit(EX_OSERR);
  	}
  	errno = 0;
! 	if (QuickAbort || (OnlyOneError && !HoldErrs))
  		longjmp(TopFrame, 2);
  }
  /*
***************
*** 251,264 ****
  
  	puterrmsg(MsgBuf);
  
- # ifdef LOG
  	if (LogLevel > 3 && LogUsrErrs)
! 		syslog(LOG_NOTICE, "%s: %.900s",
! 			CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
  			&MsgBuf[4]);
- # endif /* LOG */
  
! 	if (QuickAbort)
  		longjmp(TopFrame, 1);
  }
  /*
--- 249,260 ----
  
  	puterrmsg(MsgBuf);
  
  	if (LogLevel > 3 && LogUsrErrs)
! 		sm_syslog(LOG_NOTICE, CurEnv->e_id,
! 			"%.900s",
  			&MsgBuf[4]);
  
! 	if (QuickAbort || (OnlyOneError && !HoldErrs))
  		longjmp(TopFrame, 1);
  }
  /*
***************
*** 404,413 ****
  	if (!heldmsg && CurEnv->e_xfp != NULL && strchr("45", msg[0]) != NULL)
  		fprintf(CurEnv->e_xfp, "%s\n", msg);
  
- #ifdef LOG
  	if (LogLevel >= 15 && (OpMode == MD_SMTP || OpMode == MD_DAEMON))
! 		syslog(LOG_INFO, "--> %s%s", msg, holdmsg ? " (held)" : "");
! #endif
  
  	if (msgcode == '8')
  		msg[0] = '0';
--- 400,409 ----
  	if (!heldmsg && CurEnv->e_xfp != NULL && strchr("45", msg[0]) != NULL)
  		fprintf(CurEnv->e_xfp, "%s\n", msg);
  
  	if (LogLevel >= 15 && (OpMode == MD_SMTP || OpMode == MD_DAEMON))
! 		sm_syslog(LOG_INFO, CurEnv->e_id,
! 			"--> %s%s",
! 			msg, holdmsg ? " (held)" : "");
  
  	if (msgcode == '8')
  		msg[0] = '0';
***************
*** 450,463 ****
  
  	/* can't call syserr, 'cause we are using MsgBuf */
  	HoldErrs = TRUE;
- #ifdef LOG
  	if (LogLevel > 0)
! 		syslog(LOG_CRIT,
! 			"%s: SYSERR: putoutmsg (%s): error on output channel sending \"%s\": %s",
! 			CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
  			CurHostName == NULL ? "NO-HOST" : CurHostName,
  			shortenstring(msg, 203), errstring(errno));
- #endif
  }
  /*
  **  PUTERRMSG -- like putoutmsg, but does special processing for error messages
--- 446,456 ----
  
  	/* can't call syserr, 'cause we are using MsgBuf */
  	HoldErrs = TRUE;
  	if (LogLevel > 0)
! 		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));
  }
  /*
  **  PUTERRMSG -- like putoutmsg, but does special processing for error messages
***************
*** 522,528 ****
  	va_list ap;
  {
  	char del;
- 	char *meb;
  	int l;
  	int spaceleft = sizeof MsgBuf;
  
--- 515,520 ----
***************
*** 559,566 ****
  			*eb++ &= 0177;
  	}
  
- 	meb = eb;
- 
  	/* output the message */
  	(void) vsnprintf(eb, spaceleft, fmt, ap);
  	spaceleft -= strlen(eb);
--- 551,556 ----
***************
*** 627,633 ****
  	char *dnsmsg;
  	char *bp;
  	static char buf[MAXLINE];
! # ifndef ERRLIST_PREDEFINED
  	extern char *sys_errlist[];
  	extern int sys_nerr;
  # endif
--- 617,623 ----
  	char *dnsmsg;
  	char *bp;
  	static char buf[MAXLINE];
! # if !HASSTRERROR && !defined(ERRLIST_PREDEFINED)
  	extern char *sys_errlist[];
  	extern int sys_nerr;
  # endif
***************
*** 648,654 ****
--- 638,648 ----
  	  case ETIMEDOUT:
  	  case ECONNRESET:
  		bp = buf;
+ #if HASSTRERROR
+ 		snprintf(bp, SPACELEFT(buf, bp), "%s", strerror(errnum));
+ #else
  		snprintf(bp, SPACELEFT(buf, bp), "%s", sys_errlist[errnum]);
+ #endif
  		bp += strlen(bp);
  		if (CurHostName != NULL)
  		{
***************
*** 690,698 ****
  		return (buf);
  # endif
  
- 	  case EOPENTIMEOUT:
- 		return "Timeout on file open";
- 
  # if NAMED_BIND
  	  case HOST_NOT_FOUND + E_DNSBASE:
  		dnsmsg = "host not found";
--- 684,689 ----
***************
*** 714,719 ****
--- 705,744 ----
  	  case EPERM:
  		/* SunOS gives "Not owner" -- this is the POSIX message */
  		return "Operation not permitted";
+ 
+ 	/*
+ 	**  Error messages used internally in sendmail.
+ 	*/
+ 
+ 	  case E_SM_OPENTIMEOUT:
+ 		return "Timeout on file open";
+ 
+ 	  case E_SM_NOSLINK:
+ 		return "Symbolic links not allowed";
+ 
+ 	  case E_SM_NOHLINK:
+ 		return "Hard links not allowed";
+ 
+ 	  case E_SM_REGONLY:
+ 		return "Regular files only";
+ 
+ 	  case E_SM_ISEXEC:
+ 		return "Executable files not allowed";
+ 
+ 	  case E_SM_WWDIR:
+ 		return "World writable directory";
+ 
+ 	  case E_SM_GWDIR:
+ 		return "Group writable directory";
+ 
+ 	  case E_SM_FILECHANGE:
+ 		return "File changed after open";
+ 
+ 	  case E_SM_WWFILE:
+ 		return "World writable file";
+ 
+ 	  case E_SM_GWFILE:
+ 		return "Group writable file";
  	}
  
  	if (dnsmsg != NULL)
***************
*** 731,739 ****
--- 756,768 ----
  		return buf;
  	}
  
+ #if HASSTRERROR
+ 	return strerror(errnum);
+ #else
  	if (errnum > 0 && errnum < sys_nerr)
  		return (sys_errlist[errnum]);
  
  	(void) snprintf(buf, sizeof buf, "Error %d", errnum);
  	return (buf);
+ #endif
  }
diff -Ncr sendmail-8.8.5/src/headers.c sendmail-8.8.6/src/headers.c
*** sendmail-8.8.5/src/headers.c	Wed Dec 11 19:58:44 1996
--- sendmail-8.8.6/src/headers.c	Sat Jun 14 08:21:20 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,45 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)headers.c	8.103 (Berkeley) 12/11/96";
  #endif /* not lint */
  
  # include <errno.h>
  # include "sendmail.h"
  
  /*
  **  CHOMPHEADER -- process and save a header line.
  **
  **	Called by collect and by readcf to deal with header lines.
--- 33,68 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)headers.c	8.110 (Berkeley) 6/14/97";
  #endif /* not lint */
  
  # include <errno.h>
  # include "sendmail.h"
  
  /*
+ **  SETUPHEADERS -- initialize headers in symbol table
+ **
+ **	Parameters:
+ **		none
+ **
+ **	Returns:
+ **		none
+ */
+ 
+ void
+ setupheaders()
+ {
+ 	struct hdrinfo *hi;
+ 	STAB *s;
+ 
+ 	for (hi = HdrInfo; hi->hi_field != NULL; hi++)
+ 	{
+ 		s = stab(hi->hi_field, ST_HEADER, ST_ENTER);
+ 		s->s_header.hi_flags = hi->hi_flags;
+ 		s->s_header.hi_ruleset = NULL;
+ 	}
+ }
+ /*
  **  CHOMPHEADER -- process and save a header line.
  **
  **	Called by collect and by readcf to deal with header lines.
***************
*** 58,63 ****
--- 81,88 ----
  **		Contents of 'line' are destroyed.
  */
  
+ struct hdrinfo	NormalHeader =	{ NULL, 0, NULL };
+ 
  int
  chompheader(line, def, hdrp, e)
  	char *line;
***************
*** 70,78 ****
  	HDR **hp;
  	char *fname;
  	char *fvalue;
- 	struct hdrinfo *hi;
  	bool cond = FALSE;
  	bool headeronly;
  	BITMAP mopts;
  
  	if (tTd(31, 6))
--- 95,104 ----
  	HDR **hp;
  	char *fname;
  	char *fvalue;
  	bool cond = FALSE;
  	bool headeronly;
+ 	STAB *s;
+ 	struct hdrinfo *hi;
  	BITMAP mopts;
  
  	if (tTd(31, 6))
***************
*** 116,122 ****
  	if (*p++ != ':' || fname == fvalue)
  	{
  		syserr("553 header syntax error, line \"%s\"", line);
! 		return (0);
  	}
  	*fvalue = '\0';
  	fvalue = p;
--- 142,148 ----
  	if (*p++ != ':' || fname == fvalue)
  	{
  		syserr("553 header syntax error, line \"%s\"", line);
! 		return 0;
  	}
  	*fvalue = '\0';
  	fvalue = p;
***************
*** 129,147 ****
  	if (strlen(fname) > 100)
  		return H_EOH;
  
! 	/* see if it is a known type */
! 	for (hi = HdrInfo; hi->hi_field != NULL; hi++)
  	{
! 		if (strcasecmp(hi->hi_field, fname) == 0)
! 			break;
  	}
  
  	if (tTd(31, 9))
  	{
! 		if (hi->hi_field == NULL)
! 			printf("no header match\n");
  		else
! 			printf("header match, hi_flags=%x\n", hi->hi_flags);
  	}
  
  	/* see if this is a resent message */
--- 155,198 ----
  	if (strlen(fname) > 100)
  		return H_EOH;
  
! #if _FFR_HEADER_RSCHECK
! 	/* check to see if it represents a ruleset call */
! 	if (def)
  	{
! 		char hbuf[50];
! 
! 		(void) expand(fvalue, hbuf, sizeof hbuf, e);
! 		for (p = hbuf; isascii(*p) && isspace(*p); )
! 			p++;
! 		if ((*p++ & 0377) == CALLSUBR)
! 		{
! 			auto char *endp;
! 
! 			if (strtorwset(p, &endp, ST_ENTER) > 0)
! 			{
! 				*endp = '\0';
! 				s = stab(fname, ST_HEADER, ST_ENTER);
! 				s->s_header.hi_ruleset = newstr(p);
! 			}
! 			return 0;
! 		}
  	}
+ #endif
+ 
+ 	/* see if it is a known type */
+ 	s = stab(fname, ST_HEADER, ST_FIND);
+ 	if (s != NULL)
+ 		hi = &s->s_header;
+ 	else
+ 		hi = &NormalHeader;
  
  	if (tTd(31, 9))
  	{
! 		if (s == NULL)
! 			printf("no header flags match\n");
  		else
! 			printf("header match, flags=%x, ruleset=%s\n", 
! 				hi->hi_flags, hi->hi_ruleset);
  	}
  
  	/* see if this is a resent message */
***************
*** 155,161 ****
  
  	/* if this means "end of header" quit now */
  	if (bitset(H_EOH, hi->hi_flags))
! 		return (hi->hi_flags);
  
  	/*
  	**  Horrible hack to work around problem with Lotus Notes SMTP
--- 206,212 ----
  
  	/* if this means "end of header" quit now */
  	if (bitset(H_EOH, hi->hi_flags))
! 		return hi->hi_flags;
  
  	/*
  	**  Horrible hack to work around problem with Lotus Notes SMTP
***************
*** 172,177 ****
--- 223,235 ----
  	}
  
  	/*
+ 	**  If there is a check ruleset, verify it against the header.
+ 	*/
+ 
+ 	if (!def && hi->hi_ruleset != NULL)
+ 		(void) rscheck(hi->hi_ruleset, fvalue, NULL, e);
+ 
+ 	/*
  	**  Drop explicit From: if same as what we would generate.
  	**  This is to make MH (which doesn't always give a full name)
  	**  insert the full name information in all circumstances.
***************
*** 191,197 ****
  		if (e->e_from.q_paddr != NULL &&
  		    (strcmp(fvalue, e->e_from.q_paddr) == 0 ||
  		     strcmp(fvalue, e->e_from.q_user) == 0))
! 			return (hi->hi_flags);
  	}
  
  	/* delete default value for this header */
--- 249,255 ----
  		if (e->e_from.q_paddr != NULL &&
  		    (strcmp(fvalue, e->e_from.q_paddr) == 0 ||
  		     strcmp(fvalue, e->e_from.q_user) == 0))
! 			return hi->hi_flags;
  	}
  
  	/* delete default value for this header */
***************
*** 232,238 ****
  		e->e_flags &= ~EF_OLDSTYLE;
  	}
  
! 	return (h->h_flags);
  }
  /*
  **  ADDHEADER -- add a header entry to the end of the queue.
--- 290,296 ----
  		e->e_flags &= ~EF_OLDSTYLE;
  	}
  
! 	return h->h_flags;
  }
  /*
  **  ADDHEADER -- add a header entry to the end of the queue.
***************
*** 258,272 ****
  	HDR **hdrlist;
  {
  	register HDR *h;
! 	register struct hdrinfo *hi;
  	HDR **hp;
  
  	/* find info struct */
! 	for (hi = HdrInfo; hi->hi_field != NULL; hi++)
! 	{
! 		if (strcasecmp(field, hi->hi_field) == 0)
! 			break;
! 	}
  
  	/* find current place in list -- keep back pointer? */
  	for (hp = hdrlist; (h = *hp) != NULL; hp = &h->h_link)
--- 316,326 ----
  	HDR **hdrlist;
  {
  	register HDR *h;
! 	STAB *s;
  	HDR **hp;
  
  	/* find info struct */
! 	s = stab(field, ST_HEADER, ST_FIND);
  
  	/* find current place in list -- keep back pointer? */
  	for (hp = hdrlist; (h = *hp) != NULL; hp = &h->h_link)
***************
*** 280,286 ****
  	h->h_field = field;
  	h->h_value = newstr(value);
  	h->h_link = *hp;
! 	h->h_flags = hi->hi_flags | H_DEFAULT;
  	clrbitmap(h->h_mflags);
  	*hp = h;
  }
--- 334,342 ----
  	h->h_field = field;
  	h->h_value = newstr(value);
  	h->h_link = *hp;
! 	h->h_flags = H_DEFAULT;
! 	if (s != NULL)
! 		h->h_flags |= s->s_header.hi_flags;
  	clrbitmap(h->h_mflags);
  	*hp = h;
  }
***************
*** 577,586 ****
  	**  Log collection information.
  	*/
  
- # ifdef LOG
  	if (bitset(EF_LOGSENDER, e->e_flags) && LogLevel > 4)
  		logsender(e, msgid);
- # endif /* LOG */
  	e->e_flags &= ~EF_LOGSENDER;
  }
  /*
--- 633,640 ----
***************
*** 599,605 ****
  	register ENVELOPE *e;
  	char *msgid;
  {
- # ifdef LOG
  	char *name;
  	register char *sbp;
  	register char *p;
--- 653,658 ----
***************
*** 663,699 ****
  	p = macvalue('r', e);
  	if (p != NULL)
  		(void) snprintf(sbp, SPACELEFT(sbuf, sbp), ", proto=%.20s", p);
! 	syslog(LOG_INFO, "%s: %.850s, relay=%.100s",
! 	    e->e_id, sbuf, name);
  
  #  else			/* short syslog buffer */
  
! 	syslog(LOG_INFO, "%s: from=%s",
! 		e->e_id, e->e_from.q_paddr == NULL ? "<NONE>" :
! 				shortenstring(e->e_from.q_paddr, 83));
! 	syslog(LOG_INFO, "%s: size=%ld, class=%ld, pri=%ld, nrcpts=%d",
! 		e->e_id, e->e_msgsize, e->e_class,
! 		e->e_msgpriority, e->e_nrcpts);
  	if (msgid != NULL)
! 		syslog(LOG_INFO, "%s: msgid=%s",
! 			e->e_id, shortenstring(mbuf, 83));
  	sbp = sbuf;
! 	snprintf(sbp, SPACELEFT(sbuf, sbp), "%s:", e->e_id);
! 	sbp += strlen(sbp);
  	if (e->e_bodytype != NULL)
  	{
! 		snprintf(sbp, SPACELEFT(sbuf, sbp), " bodytype=%.20s,", e->e_bodytype);
  		sbp += strlen(sbp);
  	}
  	p = macvalue('r', e);
  	if (p != NULL)
  	{
! 		snprintf(sbp, SPACELEFT(sbuf, sbp), " proto=%.20s,", p);
  		sbp += strlen(sbp);
  	}
! 	syslog(LOG_INFO, "%.400s relay=%.100s", sbuf, name);
  #  endif
- # endif
  }
  /*
  **  PRIENCODE -- encode external priority names into internal values.
--- 716,754 ----
  	p = macvalue('r', e);
  	if (p != NULL)
  		(void) snprintf(sbp, SPACELEFT(sbuf, sbp), ", proto=%.20s", p);
! 	sm_syslog(LOG_INFO, e->e_id,
! 		"%.850s, relay=%.100s",
! 		sbuf, name);
  
  #  else			/* short syslog buffer */
  
! 	sm_syslog(LOG_INFO, e->e_id,
! 		"from=%s",
! 		e->e_from.q_paddr == NULL ? "<NONE>"
! 					  : shortenstring(e->e_from.q_paddr, 83));
! 	sm_syslog(LOG_INFO, e->e_id,
! 		"size=%ld, class=%ld, pri=%ld, nrcpts=%d",
! 		e->e_msgsize, e->e_class, e->e_msgpriority, e->e_nrcpts);
  	if (msgid != NULL)
! 		sm_syslog(LOG_INFO, e->e_id,
! 			"msgid=%s",
! 			shortenstring(mbuf, 83));
  	sbp = sbuf;
! 	*sbp = '\0';
  	if (e->e_bodytype != NULL)
  	{
! 		snprintf(sbp, SPACELEFT(sbuf, sbp), "bodytype=%.20s, ", e->e_bodytype);
  		sbp += strlen(sbp);
  	}
  	p = macvalue('r', e);
  	if (p != NULL)
  	{
! 		snprintf(sbp, SPACELEFT(sbuf, sbp), "proto=%.20s, ", p);
  		sbp += strlen(sbp);
  	}
! 	sm_syslog(LOG_INFO, e->e_id,
! 		"%.400srelay=%.100s", sbuf, name);
  #  endif
  }
  /*
  **  PRIENCODE -- encode external priority names into internal values.
***************
*** 788,794 ****
  	*/
  
  	bp = bufhead = buf;
! 	buflim = &buf[sizeof buf - 6];
  	p = addrhead = addr;
  	copylev = anglelev = realanglelev = cmtlev = realcmtlev = 0;
  	bracklev = 0;
--- 843,849 ----
  	*/
  
  	bp = bufhead = buf;
! 	buflim = &buf[sizeof buf - 7];
  	p = addrhead = addr;
  	copylev = anglelev = realanglelev = cmtlev = realcmtlev = 0;
  	bracklev = 0;
***************
*** 1165,1171 ****
  
  		/* suppress return receipts if requested */
  		if (bitset(H_RECEIPTTO, h->h_flags) &&
! #if _FFR_DSN_RRT
  		    (RrtImpliesDsn || bitset(EF_NORECEIPT, e->e_flags)))
  #else
  		    bitset(EF_NORECEIPT, e->e_flags))
--- 1220,1226 ----
  
  		/* suppress return receipts if requested */
  		if (bitset(H_RECEIPTTO, h->h_flags) &&
! #if _FFR_DSN_RRT_OPTION
  		    (RrtImpliesDsn || bitset(EF_NORECEIPT, e->e_flags)))
  #else
  		    bitset(EF_NORECEIPT, e->e_flags))
***************
*** 1181,1187 ****
  		{
  			expand(p, buf, sizeof buf, e);
  			p = buf;
! 			if (p == NULL || *p == '\0')
  			{
  				if (tTd(34, 11))
  					printf(" (skipped -- null value)\n");
--- 1236,1242 ----
  		{
  			expand(p, buf, sizeof buf, e);
  			p = buf;
! 			if (*p == '\0')
  			{
  				if (tTd(34, 11))
  					printf(" (skipped -- null value)\n");
***************
*** 1275,1281 ****
  	char obuf[MAXLINE];
  
  	putflags = 0;
! #ifdef _FFR_7BITHDRS
  	if (bitnset(M_7BITHDRS, mci->mci_mailer->m_flags))
  		putflags |= PXLF_STRIP8BIT;
  #endif
--- 1330,1336 ----
  	char obuf[MAXLINE];
  
  	putflags = 0;
! #if _FFR_7BITHDRS
  	if (bitnset(M_7BITHDRS, mci->mci_mailer->m_flags))
  		putflags |= PXLF_STRIP8BIT;
  #endif
***************
*** 1290,1296 ****
  			l = sizeof obuf - (obp - obuf);
  
  		snprintf(obp, SPACELEFT(obuf, obp), "%.*s", l, v);
! 		putxline(obuf, mci, putflags);
  		v += l + 1;
  		obp = obuf;
  		if (*v != ' ' && *v != '\t')
--- 1345,1351 ----
  			l = sizeof obuf - (obp - obuf);
  
  		snprintf(obp, SPACELEFT(obuf, obp), "%.*s", l, v);
! 		putxline(obuf, strlen(obuf), mci, putflags);
  		v += l + 1;
  		obp = obuf;
  		if (*v != ' ' && *v != '\t')
***************
*** 1298,1304 ****
  	}
  	snprintf(obp, SPACELEFT(obuf, obp), "%.*s",
  		sizeof obuf - (obp - obuf) - 1, v);
! 	putxline(obuf, mci, putflags);
  }
  /*
  **  COMMAIZE -- output a header field, making a comma-translated list.
--- 1353,1359 ----
  	}
  	snprintf(obp, SPACELEFT(obuf, obp), "%.*s",
  		sizeof obuf - (obp - obuf) - 1, v);
! 	putxline(obuf, strlen(obuf), mci, putflags);
  }
  /*
  **  COMMAIZE -- output a header field, making a comma-translated list.
***************
*** 1340,1346 ****
  	if (tTd(14, 2))
  		printf("commaize(%s: %s)\n", h->h_field, p);
  
! #ifdef _FFR_7BITHDRS
  	if (bitnset(M_7BITHDRS, mci->mci_mailer->m_flags))
  		putflags |= PXLF_STRIP8BIT;
  #endif
--- 1395,1401 ----
  	if (tTd(14, 2))
  		printf("commaize(%s: %s)\n", h->h_field, p);
  
! #if _FFR_7BITHDRS
  	if (bitnset(M_7BITHDRS, mci->mci_mailer->m_flags))
  		putflags |= PXLF_STRIP8BIT;
  #endif
***************
*** 1348,1353 ****
--- 1403,1410 ----
  	obp = obuf;
  	(void) snprintf(obp, SPACELEFT(obuf, obp), "%.200s: ", h->h_field);
  	opos = strlen(h->h_field) + 2;
+ 	if (opos > 202)
+ 		opos = 202;
  	obp += opos;
  	omax = mci->mci_mailer->m_linelimit - 2;
  	if (omax < 0 || omax > 78)
***************
*** 1441,1447 ****
  		if (opos > omax && !firstone)
  		{
  			snprintf(obp, SPACELEFT(obuf, obp), ",\n");
! 			putxline(obuf, mci, putflags);
  			obp = obuf;
  			(void) strcpy(obp, "        ");
  			opos = strlen(obp);
--- 1498,1504 ----
  		if (opos > omax && !firstone)
  		{
  			snprintf(obp, SPACELEFT(obuf, obp), ",\n");
! 			putxline(obuf, strlen(obuf), mci, putflags);
  			obp = obuf;
  			(void) strcpy(obp, "        ");
  			opos = strlen(obp);
***************
*** 1460,1466 ****
  		*p = savechar;
  	}
  	*obp = '\0';
! 	putxline(obuf, mci, putflags);
  }
  /*
  **  COPYHEADER -- copy header list
--- 1517,1523 ----
  		*p = savechar;
  	}
  	*obp = '\0';
! 	putxline(obuf, strlen(obuf), mci, putflags);
  }
  /*
  **  COPYHEADER -- copy header list
diff -Ncr sendmail-8.8.5/src/ldap_map.h sendmail-8.8.6/src/ldap_map.h
*** sendmail-8.8.5/src/ldap_map.h	Wed May 22 13:01:39 1996
--- sendmail-8.8.6/src/ldap_map.h	Tue Jun  3 12:34:11 1997
***************
*** 5,16 ****
  **	Please go to him for support -- since I (Eric) don't run LDAP, I
  **	can't help you at all.
  **
! **	@(#)ldap_map.h	8.2 (Berkeley) 5/22/96
  */
  
  #ifndef _LDAP_MAP_H
  #define _LDAP_MAP_H
  
  struct ldap_map_struct
  {
  	/* needed for ldap_open */
--- 5,18 ----
  **	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
  */
  
  #ifndef _LDAP_MAP_H
  #define _LDAP_MAP_H
  
+ #include <sys/time.h>
+ 
  struct ldap_map_struct
  {
  	/* needed for ldap_open */
***************
*** 33,39 ****
  	char		*base;
  	int		scope;
  	char		*filter;
! 	char		*attr;
  	int		attrsonly;
  	struct timeval	timeout;
  	LDAPMessage	*res;
--- 35,41 ----
  	char		*base;
  	int		scope;
  	char		*filter;
! 	char		*attr[2];
  	int		attrsonly;
  	struct timeval	timeout;
  	LDAPMessage	*res;
diff -Ncr sendmail-8.8.5/src/macro.c sendmail-8.8.6/src/macro.c
*** sendmail-8.8.5/src/macro.c	Mon May 13 10:34:43 1996
--- sendmail-8.8.6/src/macro.c	Sat Feb 15 10:51:41 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)macro.c	8.17 (Berkeley) 5/13/96";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)macro.c	8.18 (Berkeley) 2/1/97";
  #endif /* not lint */
  
  # include "sendmail.h"
diff -Ncr sendmail-8.8.5/src/mailq.0 sendmail-8.8.6/src/mailq.0
*** sendmail-8.8.5/src/mailq.0	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/src/mailq.0	Wed Feb 21 17:04:16 1996
***************
*** 0 ****
--- 1,41 ----
+ MAILQ(1)                     BSD Reference Manual                     MAILQ(1)
+ 
+ NNAAMMEE
+      mmaaiillqq - print the mail queue
+ 
+ SSYYNNOOPPSSIISS
+      mmaaiillqq [--vv]
+ 
+ DDEESSCCRRIIPPTTIIOONN
+      MMaaiillqq prints a summary of the mail messages queued for future delivery.
+ 
+      The first line printed for each message shows the internal identifier
+      used on this host for the message, the size of the message in bytes, the
+      date and time the message was accepted into the queue, and the envelope
+      sender of the message.  The second line shows the error message that
+      caused this message to be retained in the queue; it will not be present
+      if the message is being processed for the first time.  The following
+      lines show message recipients, one per line.
+ 
+      MMaaiillqq is identical to ``sendmail -bp''.
+ 
+      The options are as follows:
+ 
+      --vv      Print verbose information.  This adds the priority of the message
+              and a single character indicator (``+'' or blank) indicating
+              whether a warning message has been sent on the first line of the
+              message.  Additionally, extra lines may be intermixed with the
+              recipients indicating the ``controlling user'' information; this
+              shows who will own any programs that are executed on behalf of
+              this message and the name of the alias this command expanded
+              from, if any.
+ 
+      The mmaaiillqq utility exits 0 on success, and >0 if an error occurs.
+ 
+ SSEEEE AALLSSOO
+      sendmail(8)
+ 
+ HHIISSTTOORRYY
+      The mmaaiillqq command appeared in 4.0BSD.
+ 
+ 4th Berkeley Distribution      February 22, 1994                             1
diff -Ncr sendmail-8.8.5/src/mailq.1 sendmail-8.8.6/src/mailq.1
*** sendmail-8.8.5/src/mailq.1	Wed Feb 21 16:50:04 1996
--- sendmail-8.8.6/src/mailq.1	Sat Feb  1 16:24:53 1997
***************
*** 1,3 ****
--- 1,4 ----
+ .\" Copyright (c) 1983, 1997 Eric P. Allman
  .\" Copyright (c) 1985, 1990, 1993
  .\"	The Regents of the University of California.  All rights reserved.
  .\"
***************
*** 29,37 ****
  .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  .\" SUCH DAMAGE.
  .\"
! .\"     @(#)mailq.1	8.4 (Berkeley) 2/22/94
  .\"
! .Dd February 22, 1994
  .Dt MAILQ 1
  .Os BSD 4
  .Sh NAME
--- 30,38 ----
  .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  .\" SUCH DAMAGE.
  .\"
! .\"     @(#)mailq.1	8.5 (Berkeley) 2/1/97
  .\"
! .Dd February 1, 1997
  .Dt MAILQ 1
  .Os BSD 4
  .Sh NAME
diff -Ncr sendmail-8.8.5/src/main.c sendmail-8.8.6/src/main.c
*** sendmail-8.8.5/src/main.c	Fri Jan 17 10:51:02 1997
--- sendmail-8.8.6/src/main.c	Wed Jun 11 16:26:43 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 39,45 ****
  #endif /* not lint */
  
  #ifndef lint
! static char sccsid[] = "@(#)main.c	8.230 (Berkeley) 1/17/97";
  #endif /* not lint */
  
  #define	_DEFINE
--- 39,45 ----
  #endif /* not lint */
  
  #ifndef lint
! static char sccsid[] = "@(#)main.c	8.246 (Berkeley) 6/11/97";
  #endif /* not lint */
  
  #define	_DEFINE
***************
*** 62,74 ****
  **	turn calls a bunch of mail servers that do the real work of
  **	delivering the mail.
  **
! **	Sendmail is driven by tables read in from /usr/lib/sendmail.cf
! **	(read by readcf.c).  Some more static configuration info,
! **	including some code that you may want to tailor for your
! **	installation, is in conf.c.  You may also want to touch
! **	daemon.c (if you have some other IPC mechanism), acct.c
! **	(to change your accounting), names.c (to adjust the name
! **	server mechanism).
  **
  **	Usage:
  **		/usr/lib/sendmail [flags] addr ...
--- 62,69 ----
  **	turn calls a bunch of mail servers that do the real work of
  **	delivering the mail.
  **
! **	Sendmail is driven by settings read in from /etc/sendmail.cf
! **	(read by readcf.c).
  **
  **	Usage:
  **		/usr/lib/sendmail [flags] addr ...
***************
*** 82,88 ****
  **			     International Computer Science Institute
  **				(11/88 - 9/89).
  **			     UCB/Mammoth Project (10/89 - 7/95).
! **			     InReference, Inc. (8/95 - 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.
--- 77,83 ----
  **			     International Computer Science Institute
  **				(11/88 - 9/89).
  **			     UCB/Mammoth Project (10/89 - 7/95).
! **			     InReference, Inc. (8/95 - 1/97).
  **		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.
***************
*** 99,104 ****
--- 94,103 ----
  bool		Warn_Q_option = FALSE;	/* warn about Q option use */
  char		**SaveArgv;	/* argument vector for re-execing */
  
+ #ifdef NGROUPS_MAX
+ GIDSET_T	InitialGidSet[NGROUPS_MAX];
+ #endif
+ 
  static void	obsolete();
  extern void	printmailer __P((MAILER *));
  extern void	tTflag __P((char *));
***************
*** 219,225 ****
  	}
  	errno = 0;
  
! #ifdef LOG
  # ifdef LOG_MAIL
  	openlog("sendmail", LOG_PID, LOG_MAIL);
  # else 
--- 218,224 ----
  	}
  	errno = 0;
  
! #if LOG
  # ifdef LOG_MAIL
  	openlog("sendmail", LOG_PID, LOG_MAIL);
  # else 
***************
*** 229,234 ****
--- 228,242 ----
  
  	tTsetup(tTdvect, sizeof tTdvect, "0-99.1");
  
+ #ifdef NGROUPS_MAX
+ 	/* save initial group set for future checks */
+ 	i = getgroups(NGROUPS_MAX, InitialGidSet);
+ 	if (i == 0)
+ 		InitialGidSet[0] = (GID_T) -1;
+ 	while (i < NGROUPS_MAX)
+ 		InitialGidSet[i++] = InitialGidSet[0];
+ #endif
+ 
  	/* drop group id privileges (RunAsUser not yet set) */
  	drop_privileges();
  
***************
*** 489,497 ****
  #endif
  	}
  
- 	/* probe interfaces and locate any additional names */
- 	load_if_names();
- 
  	/* current time */
  	define('b', arpadate((char *) NULL), CurEnv);
  
--- 497,502 ----
***************
*** 828,833 ****
--- 833,842 ----
  	expand("\201m", jbuf, sizeof jbuf, CurEnv);
  	setclass('m', jbuf);
  
+ 	/* probe interfaces and locate any additional names */
+ 	if (!DontProbeInterfaces)
+ 		load_if_names();
+ 
  	if (tTd(0, 1))
  	{
  		printf("\n============ SYSTEM IDENTITY (after readcf) ============");
***************
*** 880,885 ****
--- 889,898 ----
  		setuserenv("TZ", NULL);
  	tzset();
  
+ 	/* be sure we don't pick up bogus HOSTALIASES environment variable */
+ 	if (queuemode && RealUid != 0)
+ 		(void) unsetenv("HOSTALIASES");
+ 
  	/* check for sane configuration level */
  	if (ConfigLevel > MAXCONFIGLEVEL)
  	{
***************
*** 904,916 ****
  	/* check for permissions */
  	if ((OpMode == MD_DAEMON || OpMode == MD_PURGESTAT) && RealUid != 0)
  	{
- #ifdef LOG
  		if (LogLevel > 1)
! 			syslog(LOG_ALERT, "user %d attempted to %s",
  				RealUid,
  				OpMode == MD_DAEMON ? "run daemon"
  						    : "purge host status");
- #endif
  		usrerr("Permission denied");
  		exit(EX_USAGE);
  	}
--- 917,928 ----
  	/* check for permissions */
  	if ((OpMode == MD_DAEMON || 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");
  		usrerr("Permission denied");
  		exit(EX_USAGE);
  	}
***************
*** 923,928 ****
--- 935,942 ----
  	  case MD_TEST:
  		/* don't have persistent host status in test mode */
  		HostStatDir = NULL;
+ 		Verbose = 2;
+ 		CurEnv->e_errormode = EM_PRINT;
  		break;
  
  	  case MD_FGDAEMON:
***************
*** 938,947 ****
  		GrabTo = FALSE;
  
  		/* arrange to restart on hangup signal */
- #ifdef LOG
  		if (SaveArgv[0] == NULL || SaveArgv[0][0] != '/')
! 			syslog(LOG_WARNING, "daemon invoked without full pathname; kill -1 won't work");
! #endif
  		setsignal(SIGHUP, sighup);
  
  		/* workaround: can't seem to release the signal in the parent */
--- 952,960 ----
  		GrabTo = FALSE;
  
  		/* arrange to restart on hangup signal */
  		if (SaveArgv[0] == NULL || SaveArgv[0][0] != '/')
! 			sm_syslog(LOG_WARNING, NOQID,
! 				"daemon invoked without full pathname; kill -1 won't work");
  		setsignal(SIGHUP, sighup);
  
  		/* workaround: can't seem to release the signal in the parent */
***************
*** 949,955 ****
  		break;
  
  	  case MD_INITALIAS:
! 		Verbose = TRUE;
  		/* fall through... */
  
  	  case MD_PRINT:
--- 962,969 ----
  		break;
  
  	  case MD_INITALIAS:
! 		Verbose = 2;
! 		CurEnv->e_errormode = EM_PRINT;
  		/* fall through... */
  
  	  case MD_PRINT:
***************
*** 1088,1104 ****
  #endif
  
  	/* operate in queue directory */
! 	if (OpMode == MD_TEST)
! 		/* nothing -- just avoid further if clauses */ ;
! 	else if (QueueDir == NULL)
  	{
! 		syserr("QueueDirectory (Q) option must be set");
! 		ExitStat = EX_CONFIG;
  	}
! 	else if (chdir(QueueDir) < 0)
  	{
! 		syserr("cannot chdir(%s)", QueueDir);
! 		ExitStat = EX_CONFIG;
  	}
  
  	/* check host status directory for validity */
--- 1102,1124 ----
  #endif
  
  	/* operate in queue directory */
! 	if (QueueDir == NULL)
  	{
! 		if (OpMode != MD_TEST)
! 		{
! 			syserr("QueueDirectory (Q) option must be set");
! 			ExitStat = EX_CONFIG;
! 		}
  	}
! 	else
  	{
! 		/* test path to get warning messages */
! 		(void) safedirpath(QueueDir, (uid_t) 0, (gid_t) 0, NULL, SFF_ANYFILE);
! 		if (OpMode != MD_TEST && chdir(QueueDir) < 0)
! 		{
! 			syserr("cannot chdir(%s)", QueueDir);
! 			ExitStat = EX_CONFIG;
! 		}
  	}
  
  	/* check host status directory for validity */
***************
*** 1226,1232 ****
  		SIGFUNC_DECL intindebug __P((int));
  
  		if (isatty(fileno(stdin)))
! 			Verbose = TRUE;
  
  		if (Verbose)
  		{
--- 1246,1252 ----
  		SIGFUNC_DECL intindebug __P((int));
  
  		if (isatty(fileno(stdin)))
! 			Verbose = 2;
  
  		if (Verbose)
  		{
***************
*** 1261,1267 ****
  
  	if (queuemode && OpMode != MD_DAEMON && QueueIntvl == 0)
  	{
- 		(void) unsetenv("HOSTALIASES");
  		(void) runqueue(FALSE, Verbose);
  		finis();
  	}
--- 1281,1286 ----
***************
*** 1305,1313 ****
  		if (tTd(0, 1))
  			strcat(dtype, "+debugging");
  
! #ifdef LOG
! 		syslog(LOG_INFO, "starting daemon (%s): %s", Version, dtype + 1);
! #endif
  #ifdef XLA
  		xla_create_file();
  #endif
--- 1324,1331 ----
  		if (tTd(0, 1))
  			strcat(dtype, "+debugging");
  
! 		sm_syslog(LOG_INFO, NOQID,
! 			"starting daemon (%s): %s", Version, dtype + 1);
  #ifdef XLA
  		xla_create_file();
  #endif
***************
*** 1317,1324 ****
--- 1335,1348 ----
  		{
  			(void) runqueue(TRUE, FALSE);
  			if (OpMode != MD_DAEMON)
+ 			{
  				for (;;)
+ 				{
  					pause();
+ 					if (DoQueueRun)
+ 						(void) runqueue(TRUE, FALSE);
+ 				}
+ 			}
  		}
  # endif /* QUEUE */
  		dropenvelope(CurEnv, TRUE);
***************
*** 1402,1408 ****
  
  		/* collect body for UUCP return */
  		if (OpMode != MD_VERIFY)
! 			collect(InChannel, FALSE, FALSE, NULL, CurEnv);
  		finis();
  	}
  
--- 1426,1432 ----
  
  		/* collect body for UUCP return */
  		if (OpMode != MD_VERIFY)
! 			collect(InChannel, FALSE, NULL, CurEnv);
  		finis();
  	}
  
***************
*** 1423,1430 ****
  	CurEnv->e_to = NULL;
  	if (OpMode != MD_VERIFY || GrabTo)
  	{
  		CurEnv->e_flags |= EF_GLOBALERRS;
! 		collect(InChannel, FALSE, FALSE, NULL, CurEnv);
  	}
  	errno = 0;
  
--- 1447,1467 ----
  	CurEnv->e_to = NULL;
  	if (OpMode != MD_VERIFY || GrabTo)
  	{
+ 		long savedflags = CurEnv->e_flags & EF_FATALERRS;
+ 
  		CurEnv->e_flags |= EF_GLOBALERRS;
! 		CurEnv->e_flags &= ~EF_FATALERRS;
! 		collect(InChannel, FALSE, NULL, CurEnv);
! 
! 		/* bail out if there were fatal errors in collect */
! 		if (OpMode != MD_VERIFY && bitset(EF_FATALERRS, CurEnv->e_flags))
! 		{
! 			CurEnv->e_flags |= EF_CLRQUEUE;
! 			finis();
! 			/*NOTREACHED*/
! 			return -1;
! 		}
! 		CurEnv->e_flags |= savedflags;
  	}
  	errno = 0;
  
***************
*** 1443,1448 ****
--- 1480,1486 ----
  		printaddr(&CurEnv->e_from, FALSE);
  	}
  	CurEnv->e_to = NULL;
+ 	CurrentLA = getla();
  	sendall(CurEnv, SM_DEFAULT);
  
  	/*
***************
*** 1493,1498 ****
--- 1531,1543 ----
  	if (tTd(2, 9))
  		printopenfds(FALSE);
  
+ 	/* if we fail in finis(), just exit */
+ 	if (setjmp(TopFrame) != 0)
+ 	{
+ 		/* failed -- just give it up */
+ 		goto forceexit;
+ 	}
+ 
  	/* clean up temp files */
  	CurEnv->e_to = NULL;
  	if (CurEnv->e_id != NULL)
***************
*** 1507,1516 ****
  # endif
  
  	/* and exit */
! # ifdef LOG
  	if (LogLevel > 78)
! 		syslog(LOG_DEBUG, "finis, pid=%d", getpid());
! # endif /* LOG */
  	if (ExitStat == EX_TEMPFAIL || CurEnv->e_errormode == EM_BERKNET)
  		ExitStat = EX_OK;
  
--- 1552,1562 ----
  # endif
  
  	/* and exit */
!   forceexit:
  	if (LogLevel > 78)
! 		sm_syslog(LOG_DEBUG, CurEnv->e_id,
! 			"finis, pid=%d",
! 			getpid());
  	if (ExitStat == EX_TEMPFAIL || CurEnv->e_errormode == EM_BERKNET)
  		ExitStat = EX_OK;
  
***************
*** 1540,1550 ****
  intsig(sig)
  	int sig;
  {
- #ifdef LOG
  	if (LogLevel > 79)
! 		syslog(LOG_DEBUG, "%s: interrupt",
! 			CurEnv->e_id == NULL ? "[NOQUEUE]" : CurEnv->e_id);
! #endif
  	FileName = NULL;
  	unlockqueue(CurEnv);
  #ifdef XLA
--- 1586,1593 ----
  intsig(sig)
  	int sig;
  {
  	if (LogLevel > 79)
! 		sm_syslog(LOG_DEBUG, CurEnv->e_id, "interrupt");
  	FileName = NULL;
  	unlockqueue(CurEnv);
  #ifdef XLA
***************
*** 1665,1675 ****
  		printf("don't\n");
  		return;
  	}
- #ifdef LOG
  	if (LogLevel > 93)
! 		syslog(LOG_DEBUG, "%s: disconnect level %d",
! 			e->e_id == NULL ? "[NOQUEUE]" : e->e_id, droplev);
! #endif
  
  	/* be sure we don't get nasty signals */
  	(void) setsignal(SIGINT, SIG_IGN);
--- 1708,1717 ----
  		printf("don't\n");
  		return;
  	}
  	if (LogLevel > 93)
! 		sm_syslog(LOG_DEBUG, e->e_id,
! 			"disconnect level %d",
! 			droplev);
  
  	/* be sure we don't get nasty signals */
  	(void) setsignal(SIGINT, SIG_IGN);
***************
*** 1678,1684 ****
  	/* we can't communicate with our caller, so.... */
  	HoldErrs = TRUE;
  	CurEnv->e_errormode = EM_MAIL;
! 	Verbose = FALSE;
  	DisConnected = TRUE;
  
  	/* all input from /dev/null */
--- 1720,1726 ----
  	/* we can't communicate with our caller, so.... */
  	HoldErrs = TRUE;
  	CurEnv->e_errormode = EM_MAIL;
! 	Verbose = 0;
  	DisConnected = TRUE;
  
  	/* all input from /dev/null */
***************
*** 1719,1728 ****
  	checkfd012("disconnect");
  #endif
  
- # ifdef LOG
  	if (LogLevel > 71)
! 		syslog(LOG_DEBUG, "in background, pid=%d", getpid());
! # endif /* LOG */
  
  	errno = 0;
  }
--- 1761,1770 ----
  	checkfd012("disconnect");
  #endif
  
  	if (LogLevel > 71)
! 		sm_syslog(LOG_DEBUG, e->e_id,
! 			"in background, pid=%d",
! 			getpid());
  
  	errno = 0;
  }
***************
*** 1822,1832 ****
  		vsnprintf(p, SPACELEFT(buf, p), msg, ap);
  		VA_END;
  		addheader("X-Authentication-Warning", buf, &e->e_header);
- #ifdef LOG
  		if (LogLevel > 3)
! 			syslog(LOG_INFO, "%s: Authentication-Warning: %.400s",
! 				e->e_id == NULL ? "[NOQUEUE]" : e->e_id, buf);
! #endif
  	}
  }
  /*
--- 1864,1873 ----
  		vsnprintf(p, SPACELEFT(buf, p), msg, ap);
  		VA_END;
  		addheader("X-Authentication-Warning", buf, &e->e_header);
  		if (LogLevel > 3)
! 			sm_syslog(LOG_INFO, e->e_id,
! 				"Authentication-Warning: %.400s",
! 				buf);
  	}
  }
  /*
***************
*** 1916,1937 ****
  dumpstate(when)
  	char *when;
  {
- #ifdef LOG
  	register char *j = macvalue('j', CurEnv);
  	int rs;
  
! 	syslog(LOG_DEBUG, "--- dumping state on %s: $j = %s ---",
  		when,
  		j == NULL ? "<NULL>" : j);
  	if (j != NULL)
  	{
  		if (!wordinclass(j, 'w'))
! 			syslog(LOG_DEBUG, "*** $j not in $=w ***");
  	}
! 	syslog(LOG_DEBUG, "CurChildren = %d", CurChildren);
! 	syslog(LOG_DEBUG, "--- open file descriptors: ---");
  	printopenfds(TRUE);
! 	syslog(LOG_DEBUG, "--- connection cache: ---");
  	mci_dump_all(TRUE);
  	rs = strtorwset("debug_dumpstate", NULL, ST_FIND);
  	if (rs > 0)
--- 1957,1979 ----
  dumpstate(when)
  	char *when;
  {
  	register char *j = macvalue('j', CurEnv);
  	int rs;
  
! 	sm_syslog(LOG_DEBUG, CurEnv->e_id,
! 		"--- dumping state on %s: $j = %s ---",
  		when,
  		j == NULL ? "<NULL>" : j);
  	if (j != NULL)
  	{
  		if (!wordinclass(j, 'w'))
! 			sm_syslog(LOG_DEBUG, CurEnv->e_id,
! 				"*** $j not in $=w ***");
  	}
! 	sm_syslog(LOG_DEBUG, CurEnv->e_id, "CurChildren = %d", CurChildren);
! 	sm_syslog(LOG_DEBUG, CurEnv->e_id, "--- open file descriptors: ---");
  	printopenfds(TRUE);
! 	sm_syslog(LOG_DEBUG, CurEnv->e_id, "--- connection cache: ---");
  	mci_dump_all(TRUE);
  	rs = strtorwset("debug_dumpstate", NULL, ST_FIND);
  	if (rs > 0)
***************
*** 1942,1955 ****
  
  		pv[0] = NULL;
  		stat = rewrite(pv, rs, 0, CurEnv);
! 		syslog(LOG_DEBUG,
  		       "--- ruleset debug_dumpstate returns stat %d, pv: ---",
  		       stat);
  		for (pvp = pv; *pvp != NULL; pvp++)
! 			syslog(LOG_DEBUG, "%s", *pvp);
  	}
! 	syslog(LOG_DEBUG, "--- end of state dump ---");
! #endif
  }
  
  
--- 1984,1996 ----
  
  		pv[0] = NULL;
  		stat = rewrite(pv, rs, 0, CurEnv);
! 		sm_syslog(LOG_DEBUG, CurEnv->e_id,
  		       "--- ruleset debug_dumpstate returns stat %d, pv: ---",
  		       stat);
  		for (pvp = pv; *pvp != NULL; pvp++)
! 			sm_syslog(LOG_DEBUG, CurEnv->e_id, "%s", *pvp);
  	}
! 	sm_syslog(LOG_DEBUG, CurEnv->e_id, "--- end of state dump ---");
  }
  
  
***************
*** 1968,1998 ****
  {
  	if (SaveArgv[0][0] != '/')
  	{
- #ifdef LOG
  		if (LogLevel > 3)
! 			syslog(LOG_INFO, "could not restart: need full path");
! #endif
  		exit(EX_OSFILE);
  	}
- #ifdef LOG
  	if (LogLevel > 3)
! 		syslog(LOG_INFO, "restarting %s on signal", SaveArgv[0]);
! #endif
  	releasesignal(SIGHUP);
  	if (setgid(RealGid) < 0 || setuid(RealUid) < 0)
  	{
- #ifdef LOG
  		if (LogLevel > 0)
! 			syslog(LOG_ALERT, "could not set[ug]id(%d, %d): %m",
  				RealUid, RealGid);
- #endif
  		exit(EX_OSERR);
  	}
  	execv(SaveArgv[0], (ARGV_T) SaveArgv);
- #ifdef LOG
  	if (LogLevel > 0)
! 		syslog(LOG_ALERT, "could not exec %s: %m", SaveArgv[0]);
! #endif
  	exit(EX_OSFILE);
  }
  /*
--- 2009,2032 ----
  {
  	if (SaveArgv[0][0] != '/')
  	{
  		if (LogLevel > 3)
! 			sm_syslog(LOG_INFO, NOQID, "could not restart: need full path");
  		exit(EX_OSFILE);
  	}
  	if (LogLevel > 3)
! 		sm_syslog(LOG_INFO, NOQID, "restarting %s on signal", SaveArgv[0]);
! 	alarm(0);
  	releasesignal(SIGHUP);
  	if (setgid(RealGid) < 0 || setuid(RealUid) < 0)
  	{
  		if (LogLevel > 0)
! 			sm_syslog(LOG_ALERT, NOQID, "could not set[ug]id(%d, %d): %m",
  				RealUid, RealGid);
  		exit(EX_OSERR);
  	}
  	execv(SaveArgv[0], (ARGV_T) SaveArgv);
  	if (LogLevel > 0)
! 		sm_syslog(LOG_ALERT, NOQID, "could not exec %s: %m", SaveArgv[0]);
  	exit(EX_OSFILE);
  }
  /*
***************
*** 2283,2288 ****
--- 2317,2327 ----
  			if (map == NULL)
  			{
  				printf("Map named \"%s\" not found\n", p);
+ 				return;
+ 			}
+ 			if (!bitset(MF_OPEN, map->s_map.map_mflags))
+ 			{
+ 				printf("Map named \"%s\" not open\n", p);
  				return;
  			}
  			printf("map_lookup: %s (%s) ", p, q);
diff -Ncr sendmail-8.8.5/src/makesendmail sendmail-8.8.6/src/makesendmail
*** sendmail-8.8.5/src/makesendmail	Sat Dec 14 19:31:03 1996
--- sendmail-8.8.6/src/makesendmail	Sat Apr 12 09:28:12 1997
***************
*** 1,6 ****
  #!/bin/sh
  
! # Copyright (c) 1993, 1996 Eric P. Allman
  # Copyright (c) 1993 The Regents of the University of California.
  # All rights reserved.
  #
--- 1,6 ----
  #!/bin/sh
  
! # Copyright (c) 1993, 1996-1997 Eric P. Allman
  # Copyright (c) 1993 The Regents of the University of California.
  # All rights reserved.
  #
***************
*** 32,38 ****
  # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  # SUCH DAMAGE.
  #
! #       @(#)makesendmail	8.43 (Berkeley) 12/14/96
  #
  
  #
--- 32,38 ----
  # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  # SUCH DAMAGE.
  #
! #       @(#)makesendmail	8.45 (Berkeley) 4/12/97
  #
  
  #
***************
*** 114,119 ****
--- 114,129 ----
  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" ]
+ 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
  fi
  
  case $os
diff -Ncr sendmail-8.8.5/src/map.c sendmail-8.8.6/src/map.c
*** sendmail-8.8.5/src/map.c	Fri Jan 17 10:02:57 1997
--- sendmail-8.8.6/src/map.c	Sat Jun 14 08:21:20 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1992, 1995, 1996 Eric P. Allman.
   * Copyright (c) 1992, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1992, 1995-1997 Eric P. Allman.
   * Copyright (c) 1992, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)map.c	8.147 (Berkeley) 1/17/97";
  #endif /* not lint */
  
  #include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)map.c	8.168 (Berkeley) 6/14/97";
  #endif /* not lint */
  
  #include "sendmail.h"
***************
*** 107,117 ****
  extern bool	aliaswait __P((MAP *, char *, int));
  extern bool	extract_canonname __P((char *, char *, char[], int));
  
! #if O_EXLOCK && HASFLOCK
  # define LOCK_ON_OPEN	1	/* we can open/create a locked file */
  #else
  # define LOCK_ON_OPEN	0	/* no such luck -- bend over backwards */
  #endif
  /*
  **  MAP_PARSEARGS -- parse config line arguments for database lookup
  **
--- 107,129 ----
  extern bool	aliaswait __P((MAP *, char *, int));
  extern bool	extract_canonname __P((char *, char *, char[], int));
  
! #if O_EXLOCK && HASFLOCK && !BOGUS_O_EXCL
  # define LOCK_ON_OPEN	1	/* we can open/create a locked file */
  #else
  # define LOCK_ON_OPEN	0	/* no such luck -- bend over backwards */
  #endif
+ 
+ #ifndef O_LEAVELOCKED
+ # if O_SHLOCK
+ #  define O_LEAVELOCKED	O_SHLOCK
+ # else
+ #  define O_LEAVELOCKED	0x1000
+ # endif
+ #endif
+ 
+ #ifndef O_ACCMODE
+ # define O_ACCMODE	(O_RDONLY|O_WRONLY|O_RDWR)
+ #endif
  /*
  **  MAP_PARSEARGS -- parse config line arguments for database lookup
  **
***************
*** 284,290 ****
  char *
  map_rewrite(map, s, slen, av)
  	register MAP *map;
! 	register char *s;
  	int slen;
  	char **av;
  {
--- 296,302 ----
  char *
  map_rewrite(map, s, slen, av)
  	register MAP *map;
! 	register const char *s;
  	int slen;
  	char **av;
  {
***************
*** 314,327 ****
  	i = len = slen;
  	if (av != NULL)
  	{
! 		bp = s;
! 		for (i = slen; --i >= 0 && (c = *bp++) != 0; )
  		{
  			if (c != '%')
  				continue;
  			if (--i < 0)
  				break;
! 			c = *bp++;
  			if (!(isascii(c) && isdigit(c)))
  				continue;
  			for (avp = av; --c >= '0' && *avp != NULL; avp++)
--- 326,340 ----
  	i = len = slen;
  	if (av != NULL)
  	{
! 		const char *sp = s;
! 
! 		for (i = slen; --i >= 0 && (c = *sp++) != 0; )
  		{
  			if (c != '%')
  				continue;
  			if (--i < 0)
  				break;
! 			c = *sp++;
  			if (!(isascii(c) && isdigit(c)))
  				continue;
  			for (avp = av; --c >= '0' && *avp != NULL; avp++)
***************
*** 675,685 ****
  	int i;
  	char *p;
  	bool found = FALSE;
- 	int l;
  	extern char *get_column __P((char *, int, char, char *, int));
  
  	cbuf[0] = '\0';
- 	l = cbuflen;
  	if (line[0] == '#')
  		return FALSE;
  
--- 688,696 ----
***************
*** 733,743 ****
--- 744,792 ----
  	register DBM *dbm;
  	struct stat st;
  	int fd;
+ 	int sff;
+ 	int ret;
+ 	int smode = S_IREAD;
+ 	char dirfile[MAXNAME + 1];
+ 	char pagfile[MAXNAME + 1];
+ 	struct stat std, stp;
  
  	if (tTd(38, 2))
  		printf("ndbm_map_open(%s, %s, %d)\n",
  			map->map_mname, map->map_file, mode);
  	map->map_lockfd = -1;
+ 	mode &= O_ACCMODE;
+ 
+ 	/* do initial file and directory checks */
+ 	snprintf(dirfile, sizeof dirfile, "%s.dir", map->map_file);
+ 	snprintf(pagfile, sizeof pagfile, "%s.pag", map->map_file);
+ 	sff = SFF_ROOTOK|SFF_REGONLY|SFF_CREAT;
+ 	if (mode == O_RDWR)
+ 	{
+ 		sff |= SFF_NOLINK;
+ 		smode = S_IWRITE;
+ 	}
+ 	else
+ 	{
+ 		sff |= SFF_NOWLINK;
+ 	}
+ 	if (FatalWritableDirs)
+ 		sff |= SFF_SAFEDIRPATH;
+ 	if ((ret = safefile(dirfile, RunAsUid, RunAsGid, RunAsUserName,
+ 			    sff, smode, &std)) != 0 ||
+ 	    (ret = safefile(pagfile, RunAsUid, RunAsGid, RunAsUserName,
+ 			    sff, smode, &stp)) != 0)
+ 	{
+ 		/* cannot open this map */
+ 		if (tTd(38, 2))
+ 			printf("\tunsafe map file: %d\n", ret);
+ 		if (!bitset(MF_OPTIONAL, map->map_mflags))
+ 			syserr("dbm map \"%s\": unsafe map file %s",
+ 				map->map_mname, map->map_file);
+ 		return FALSE;
+ 	}
+ 	if (std.st_mode == ST_MODE_NOFILE)
+ 		mode |= O_EXCL;
  
  #if LOCK_ON_OPEN
  	if (mode == O_RDONLY)
***************
*** 745,756 ****
  	else
  		mode |= O_CREAT|O_TRUNC|O_EXLOCK;
  #else
! 	if (mode == O_RDWR)
  	{
  # if NOFTRUNCATE
  		/*
  		**  Warning: race condition.  Try to lock the file as
  		**  quickly as possible after opening it.
  		*/
  
  		mode |= O_CREAT|O_TRUNC;
--- 794,807 ----
  	else
  		mode |= O_CREAT|O_TRUNC|O_EXLOCK;
  #else
! 	if ((mode & O_ACCMODE) == O_RDWR)
  	{
  # if NOFTRUNCATE
  		/*
  		**  Warning: race condition.  Try to lock the file as
  		**  quickly as possible after opening it.
+ 		**	This may also have security problems on some systems,
+ 		**	but there isn't anything we can do about it.
  		*/
  
  		mode |= O_CREAT|O_TRUNC;
***************
*** 763,775 ****
  
  		int dirfd;
  		int pagfd;
- 		char dirfile[MAXNAME + 1];
- 		char pagfile[MAXNAME + 1];
  
! 		snprintf(dirfile, sizeof dirfile, "%s.dir", map->map_file);
! 		snprintf(pagfile, sizeof pagfile, "%s.pag", map->map_file);
! 		dirfd = open(dirfile, mode|O_CREAT, DBMMODE);
! 		pagfd = open(pagfile, mode|O_CREAT, DBMMODE);
  
  		if (dirfd < 0 || pagfd < 0)
  		{
--- 814,824 ----
  
  		int dirfd;
  		int pagfd;
  
! 		dirfd = safeopen(dirfile, mode|O_CREAT, DBMMODE,
! 				 SFF_NOLINK|SFF_CREAT|SFF_OPENASROOT);
! 		pagfd = safeopen(pagfile, mode|O_CREAT, DBMMODE,
! 				 SFF_NOLINK|SFF_CREAT|SFF_OPENASROOT);
  
  		if (dirfd < 0 || pagfd < 0)
  		{
***************
*** 779,787 ****
  			close(pagfd);
  			return FALSE;
  		}
- 		if (!lockfile(dirfd, map->map_file, ".dir", LOCK_EX))
- 			syserr("ndbm_map_open: cannot lock %s.dir",
- 				map->map_file);
  		if (ftruncate(dirfd, (off_t) 0) < 0)
  			syserr("ndbm_map_open: cannot truncate %s.dir",
  				map->map_file);
--- 828,833 ----
***************
*** 805,812 ****
--- 851,875 ----
  			return TRUE;
  		if (!bitset(MF_OPTIONAL, map->map_mflags))
  			syserr("Cannot open DBM database %s", map->map_file);
+ #if !LOCK_ON_OPEN && !NOFTRUNCATE
+ 		if (map->map_lockfd >= 0)
+ 			close(map->map_lockfd);
+ #endif
+ 		return FALSE;
+ 	}
+ 	if (filechanged(dirfile, dbm_dirfno(dbm), &std, sff) ||
+ 	    filechanged(pagfile, dbm_pagfno(dbm), &stp, sff))
+ 	{
+ 		syserr("ndbm_map_open(%s): file changed after open",
+ 			map->map_file);
+ 		dbm_close(dbm);
+ #if !LOCK_ON_OPEN && !NOFTRUNCATE
+ 		if (map->map_lockfd >= 0)
+ 			close(map->map_lockfd);
+ #endif
  		return FALSE;
  	}
+ 
  	map->map_db1 = (void *) dbm;
  	fd = dbm_dirfno((DBM *) map->map_db1);
  	if (mode == O_RDONLY)
***************
*** 1036,1042 ****
  **	be pokey about it.  That's hard to do.
  */
  
! extern bool	db_map_open __P((MAP *, int, DBTYPE, const void *));
  
  /* these should be K line arguments */
  #ifndef DB_CACHE_SIZE
--- 1099,1105 ----
  **	be pokey about it.  That's hard to do.
  */
  
! extern bool	db_map_open __P((MAP *, int, char *, DBTYPE, const void *));
  
  /* these should be K line arguments */
  #ifndef DB_CACHE_SIZE
***************
*** 1059,1065 ****
  
  	bzero(&btinfo, sizeof btinfo);
  	btinfo.cachesize = DB_CACHE_SIZE;
! 	return db_map_open(map, mode, DB_BTREE, &btinfo);
  }
  
  bool
--- 1122,1128 ----
  
  	bzero(&btinfo, sizeof btinfo);
  	btinfo.cachesize = DB_CACHE_SIZE;
! 	return db_map_open(map, mode, "btree", DB_BTREE, &btinfo);
  }
  
  bool
***************
*** 1076,1107 ****
  	bzero(&hinfo, sizeof hinfo);
  	hinfo.nelem = DB_HASH_NELEM;
  	hinfo.cachesize = DB_CACHE_SIZE;
! 	return db_map_open(map, mode, DB_HASH, &hinfo);
  }
  
  bool
! db_map_open(map, mode, dbtype, openinfo)
  	MAP *map;
  	int mode;
  	DBTYPE dbtype;
  	const void *openinfo;
  {
  	DB *db;
  	int i;
  	int omode;
  	int fd;
  	int saveerrno;
  	struct stat st;
  	char buf[MAXNAME + 1];
  
  	snprintf(buf, sizeof buf - 3, "%s", map->map_file);
  	i = strlen(buf);
  	if (i < 3 || strcmp(&buf[i - 3], ".db") != 0)
  		(void) strcat(buf, ".db");
- 	map->map_lockfd = -1;
  
  	omode = mode;
  
  #if LOCK_ON_OPEN
  	if (mode == O_RDWR)
  		omode |= O_CREAT|O_TRUNC|O_EXLOCK;
--- 1139,1203 ----
  	bzero(&hinfo, sizeof hinfo);
  	hinfo.nelem = DB_HASH_NELEM;
  	hinfo.cachesize = DB_CACHE_SIZE;
! 	return db_map_open(map, mode, "hash", DB_HASH, &hinfo);
  }
  
  bool
! db_map_open(map, mode, mapclassname, dbtype, openinfo)
  	MAP *map;
  	int mode;
+ 	char *mapclassname;
  	DBTYPE dbtype;
  	const void *openinfo;
  {
  	DB *db;
  	int i;
  	int omode;
+ 	int smode = S_IREAD;
  	int fd;
+ 	int sff;
  	int saveerrno;
+ 	bool leavelocked = bitset(O_LEAVELOCKED, mode);
  	struct stat st;
  	char buf[MAXNAME + 1];
  
+ 	/* do initial file and directory checks */
  	snprintf(buf, sizeof buf - 3, "%s", map->map_file);
  	i = strlen(buf);
  	if (i < 3 || strcmp(&buf[i - 3], ".db") != 0)
  		(void) strcat(buf, ".db");
  
+ 	mode &= O_ACCMODE;
  	omode = mode;
  
+ 	sff = SFF_ROOTOK|SFF_REGONLY|SFF_CREAT;
+ 	if (mode == O_RDWR)
+ 	{
+ 		sff |= SFF_NOLINK;
+ 		smode = S_IWRITE;
+ 	}
+ 	else
+ 	{
+ 		sff |= SFF_NOWLINK;
+ 	}
+ 	if (FatalWritableDirs)
+ 		sff |= SFF_SAFEDIRPATH;
+ 	if ((i = safefile(buf, RunAsUid, RunAsGid, RunAsUserName,
+ 			  sff, smode, &st)) != 0)
+ 	{
+ 		/* cannot open this map */
+ 		if (tTd(38, 2))
+ 			printf("\tunsafe map file: %d\n", i);
+ 		if (!bitset(MF_OPTIONAL, map->map_mflags))
+ 			syserr("%s map \"%s\": unsafe map file %s",
+ 				mapclassname, map->map_mname, map->map_file);
+ 		return FALSE;
+ 	}
+ 	if (st.st_mode == ST_MODE_NOFILE)
+ 		omode |= O_EXCL;
+ 
+ 	map->map_lockfd = -1;
+ 
  #if LOCK_ON_OPEN
  	if (mode == O_RDWR)
  		omode |= O_CREAT|O_TRUNC|O_EXLOCK;
***************
*** 1139,1145 ****
  	saveerrno = errno;
  
  #if !LOCK_ON_OPEN
! 	if (mode == O_RDWR)
  		map->map_lockfd = fd;
  	else
  		(void) close(fd);
--- 1235,1241 ----
  	saveerrno = errno;
  
  #if !LOCK_ON_OPEN
! 	if (leavelocked || mode == O_RDWR)
  		map->map_lockfd = fd;
  	else
  		(void) close(fd);
***************
*** 1152,1158 ****
  			return TRUE;
  		errno = saveerrno;
  		if (!bitset(MF_OPTIONAL, map->map_mflags))
! 			syserr("Cannot open DB database %s", map->map_file);
  		return FALSE;
  	}
  
--- 1248,1270 ----
  			return TRUE;
  		errno = saveerrno;
  		if (!bitset(MF_OPTIONAL, map->map_mflags))
! 			syserr("Cannot open %s database %s",
! 				mapclassname, map->map_file);
! #if !LOCK_ON_OPEN
! 		if (map->map_lockfd >= 0)
! 			(void) close(map->map_lockfd);
! #endif
! 		return FALSE;
! 	}
! 
! 	if (filechanged(buf, db->fd(db), &st, sff))
! 	{
! 		syserr("db_map_open(%s): file changed after open", buf);
! 		db->close(db);
! #if !LOCK_ON_OPEN
! 		if (map->map_lockfd >= 0)
! 			close(map->map_lockfd);
! #endif
  		return FALSE;
  	}
  
***************
*** 1161,1167 ****
  #if !OLD_NEWDB
  	fd = db->fd(db);
  # if LOCK_ON_OPEN
! 	if (fd >= 0 && mode == O_RDONLY)
  	{
  		(void) lockfile(fd, map->map_file, ".db", LOCK_UN);
  	}
--- 1273,1279 ----
  #if !OLD_NEWDB
  	fd = db->fd(db);
  # if LOCK_ON_OPEN
! 	if (fd >= 0 && mode == O_RDONLY && !leavelocked)
  	{
  		(void) lockfile(fd, map->map_file, ".db", LOCK_UN);
  	}
***************
*** 1203,1208 ****
--- 1315,1321 ----
  	int st;
  	int saveerrno;
  	int fd;
+ 	struct stat stbuf;
  	char keybuf[MAXNAME + 1];
  
  	if (tTd(38, 20))
***************
*** 1220,1227 ****
  #if !OLD_NEWDB
  	fd = db->fd(db);
  	if (fd >= 0 && !bitset(MF_LOCKED, map->map_mflags))
! 		(void) lockfile(db->fd(db), map->map_file, ".db", LOCK_SH);
  #endif
  	st = 1;
  	if (bitset(MF_TRY0NULL, map->map_mflags))
  	{
--- 1333,1373 ----
  #if !OLD_NEWDB
  	fd = db->fd(db);
  	if (fd >= 0 && !bitset(MF_LOCKED, map->map_mflags))
! 		(void) lockfile(fd, map->map_file, ".db", LOCK_SH);
! 	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
! 								 : O_RDONLY;
! 
! 		map->map_class->map_close(map);
! 		map->map_mflags &= ~(MF_OPEN|MF_WRITABLE);
! 		omode |= O_LEAVELOCKED;
! 		if (map->map_class->map_open(map, omode)) 
! 		{
! 			map->map_mflags |= MF_OPEN;
! 			if ((omode && O_ACCMODE) == O_RDWR)
! 				map->map_mflags |= MF_WRITABLE;
! 			db = (DB *) map->map_db2;
! 			fd = db->fd(db);
! 		}
! 		else
! 		{
! 			if (!bitset(MF_OPTIONAL, map->map_mflags)) 
! 			{
! 				extern MAPCLASS BogusMapClass;
! 
! 				*statp = EX_TEMPFAIL;
! 				map->map_class = &BogusMapClass;
! 				map->map_mflags |= MF_OPEN;
! 				syserr("Cannot reopen DB database %s",
! 					map->map_file);
! 			}
! 			return NULL;
! 		}
! 	}
  #endif
+ 	
  	st = 1;
  	if (bitset(MF_TRY0NULL, map->map_mflags))
  	{
***************
*** 1392,1397 ****
--- 1538,1544 ----
  		printf("nis_map_open(%s, %s, %d)\n",
  			map->map_mname, map->map_file, mode);
  
+ 	mode &= O_ACCMODE;
  	if (mode != O_RDONLY)
  	{
  		/* issue a pseudo-error message */
***************
*** 1581,1586 ****
--- 1728,1735 ----
  			*statp = EX_UNAVAILABLE;
  		return FALSE;
  	}
+ 	if (vsize >= sizeof host_record)
+ 		vsize = sizeof host_record - 1;
  	strncpy(host_record, vp, vsize);
  	host_record[vsize] = '\0';
  	if (tTd(38, 44))
***************
*** 1637,1642 ****
--- 1786,1792 ----
  		printf("nisplus_map_open(%s, %s, %d)\n",
  			map->map_mname, map->map_file, mode);
  
+ 	mode &= O_ACCMODE;
  	if (mode != O_RDONLY)
  	{
  		errno = ENODEV;
***************
*** 1657,1671 ****
  				 map->map_file, map->map_domain);
  	}
  	if (!PARTIAL_NAME(map->map_file))
  		map->map_domain = newstr("");
! 
! 	/* check to see if this map actually exists */
! 	if (PARTIAL_NAME(map->map_file))
  		snprintf(qbuf, sizeof qbuf, "%s.%s",
  			map->map_file, map->map_domain);
! 	else
! 		strcpy(qbuf, map->map_file);
! 	
  	retry_cnt = 0;
  	while (res == NULL || res->status != NIS_SUCCESS)
  	{
--- 1807,1823 ----
  				 map->map_file, map->map_domain);
  	}
  	if (!PARTIAL_NAME(map->map_file))
+ 	{
  		map->map_domain = newstr("");
! 		snprintf(qbuf, sizeof qbuf, "%s", map->map_file);
! 	}
! 	else
! 	{
! 		/* check to see if this map actually exists */
  		snprintf(qbuf, sizeof qbuf, "%s.%s",
  			map->map_file, map->map_domain);
! 	}
! 
  	retry_cnt = 0;
  	while (res == NULL || res->status != NIS_SUCCESS)
  	{
***************
*** 1769,1778 ****
  	char **av;
  	int *statp;
  {
! 	char *vp;
  	auto int vsize;
! 	int buflen;
! 	char search_key[MAXNAME + 1];
  	char qbuf[MAXLINE + NIS_MAXNAMELEN];
  	nis_result *result;
  
--- 1921,1931 ----
  	char **av;
  	int *statp;
  {
! 	char *p;
  	auto int vsize;
! 	char *skp;
! 	int skleft;
! 	char search_key[MAXNAME + 4];
  	char qbuf[MAXLINE + NIS_MAXNAMELEN];
  	nis_result *result;
  
***************
*** 1791,1801 ****
  		}
  	}
  		
! 	buflen = strlen(name);
! 	if (buflen > sizeof search_key - 1)
! 		buflen = sizeof search_key - 1;
! 	bcopy(name, search_key, buflen);
! 	search_key[buflen] = '\0';
  	if (!bitset(MF_NOFOLDCASE, map->map_mflags))
  		makelower(search_key);
  
--- 1944,1983 ----
  		}
  	}
  		
! 	/*
! 	**  Copy the name to the key buffer, escaping double quote characters
! 	**  by doubling them and quoting "]" and "," to avoid having the
! 	**  NIS+ parser choke on them.
! 	*/
! 
! 	skleft = sizeof search_key - 4;
! 	skp = search_key;
! 	for (p = name; *p != '\0' && skleft > 0; p++)
! 	{
! 		switch (*p)
! 		{
! 		  case ']':
! 		  case ',':
! 			/* quote the character */
! 			*skp++ = '"';
! 			*skp++ = *p;
! 			*skp++ = '"';
! 			skleft -= 3;
! 			break;
! 
! 		  case '"':
! 			/* double the quote */
! 			*skp++ = '"';
! 			skleft--;
! 			/* fall through... */
! 
! 		  default:
! 			*skp++ = *p;
! 			skleft--;
! 			break;
! 		}
! 	}
! 	*skp = '\0';
  	if (!bitset(MF_NOFOLDCASE, map->map_mflags))
  		makelower(search_key);
  
***************
*** 1819,1825 ****
  		if ((count = NIS_RES_NUMOBJ(result)) != 1)
  		{
  			if (LogLevel > 10)
! 				syslog(LOG_WARNING,
  				  "%s: lookup error, expected 1 entry, got %d",
  				    map->map_file, count);
  
--- 2001,2007 ----
  		if ((count = NIS_RES_NUMOBJ(result)) != 1)
  		{
  			if (LogLevel > 10)
! 				sm_syslog(LOG_WARNING, CurEnv->e_id,
  				  "%s: lookup error, expected 1 entry, got %d",
  				    map->map_file, count);
  
***************
*** 1829,1846 ****
  					name, count);
  		}
  
! 		vp = ((NIS_RES_OBJECT(result))->EN_col(map->map_valcolno));
  		/* set the length of the result */
! 		if (vp == NULL)
! 			vp = "";
! 		vsize = strlen(vp);
  		if (tTd(38, 20))
  			printf("nisplus_map_lookup(%s), found %s\n",
! 				name, vp);
  		if (bitset(MF_MATCHONLY, map->map_mflags))
  			str = map_rewrite(map, name, strlen(name), NULL);
  		else
! 			str = map_rewrite(map, vp, vsize, av);
  		nis_freeresult(result);
  		*statp = EX_OK;
  		return str;
--- 2011,2028 ----
  					name, count);
  		}
  
! 		p = ((NIS_RES_OBJECT(result))->EN_col(map->map_valcolno));
  		/* set the length of the result */
! 		if (p == NULL)
! 			p = "";
! 		vsize = strlen(p);
  		if (tTd(38, 20))
  			printf("nisplus_map_lookup(%s), found %s\n",
! 				name, p);
  		if (bitset(MF_MATCHONLY, map->map_mflags))
  			str = map_rewrite(map, name, strlen(name), NULL);
  		else
! 			str = map_rewrite(map, p, vsize, av);
  		nis_freeresult(result);
  		*statp = EX_OK;
  		return str;
***************
*** 1923,1934 ****
  
  		if ((count = NIS_RES_NUMOBJ(result)) != 1)
  		{
- #ifdef LOG
  			if (LogLevel > 10)
! 				syslog(LOG_WARNING,
  				       "nisplus_getcanonname: lookup error, expected 1 entry, got %d",
  				       count);
- #endif
  
  			/* ignore second entry */
  			if (tTd(38, 20))
--- 2105,2114 ----
  
  		if ((count = NIS_RES_NUMOBJ(result)) != 1)
  		{
  			if (LogLevel > 10)
! 				sm_syslog(LOG_WARNING, CurEnv->e_id,
  				       "nisplus_getcanonname: lookup error, expected 1 entry, got %d",
  				       count);
  
  			/* ignore second entry */
  			if (tTd(38, 20))
***************
*** 2031,2036 ****
--- 2211,2217 ----
  	if (tTd(38, 2))
  		printf("ldap_map_open(%s, %d)\n", map->map_mname, mode);
  
+ 	mode &= O_ACCMODE;
  	if (mode != O_RDONLY)
  	{
  		/* issue a pseudo-error message */
***************
*** 2207,2213 ****
  	snprintf(filter, sizeof filter, lmap->filter, keybuf);
  
  	if (ldap_search_st(lmap->ld, lmap->base,lmap->scope,filter,
! 			   &(lmap->attr), lmap->attrsonly, &(lmap->timeout),
  			   &(lmap->res)) != LDAP_SUCCESS)
  	{
  		/* try close/opening map */
--- 2388,2394 ----
  	snprintf(filter, sizeof filter, lmap->filter, keybuf);
  
  	if (ldap_search_st(lmap->ld, lmap->base,lmap->scope,filter,
! 			   lmap->attr, lmap->attrsonly, &(lmap->timeout),
  			   &(lmap->res)) != LDAP_SUCCESS)
  	{
  		/* try close/opening map */
***************
*** 2219,2225 ****
  			goto quick_exit;
  		}
  		if (ldap_search_st(lmap->ld, lmap->base, lmap->scope, filter,
! 				   &(lmap->attr), lmap->attrsonly,
  				   &(lmap->timeout), &(lmap->res))
  			!= LDAP_SUCCESS)
  		{
--- 2400,2406 ----
  			goto quick_exit;
  		}
  		if (ldap_search_st(lmap->ld, lmap->base, lmap->scope, filter,
! 				   lmap->attr, lmap->attrsonly,
  				   &(lmap->timeout), &(lmap->res))
  			!= LDAP_SUCCESS)
  		{
***************
*** 2243,2249 ****
  	}
  
  	/* Need to build the args for map_rewrite here */
! 	attr_values = ldap_get_values(lmap->ld,entry,lmap->attr);
  	if (attr_values == NULL)
  	{
  		/* bad things happened */
--- 2424,2430 ----
  	}
  
  	/* Need to build the args for map_rewrite here */
! 	attr_values = ldap_get_values(lmap->ld,entry,lmap->attr[0]);
  	if (attr_values == NULL)
  	{
  		/* bad things happened */
***************
*** 2258,2269 ****
  	vp = attr_values[0];
  	vsize = strlen(vp);
  
- # ifdef LOG
  	if (LogLevel > 9)
! 		syslog(LOG_INFO, "%s: ldap %.100s => %s",
! 			CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
  			name, vp);
- # endif
  	if (bitset(MF_MATCHONLY, map->map_mflags))
  		result = map_rewrite(map, name, strlen(name), NULL);
  	else
--- 2439,2448 ----
  	vp = attr_values[0];
  	vsize = strlen(vp);
  
  	if (LogLevel > 9)
! 		sm_syslog(LOG_INFO, CurEnv->e_id,
! 			"ldap %.100s => %s",
  			name, vp);
  	if (bitset(MF_MATCHONLY, map->map_mflags))
  		result = map_rewrite(map, name, strlen(name), NULL);
  	else
***************
*** 2398,2404 ****
  		  case 'v':		/* attr to return */
  			while (isascii(*++p) && isspace(*p))
  				continue;
! 			lmap->attr = p;
  			break;
  
  			/* args stolen from ldapsearch.c */
--- 2577,2584 ----
  		  case 'v':		/* attr to return */
  			while (isascii(*++p) && isspace(*p))
  				continue;
! 			lmap->attr[0] = p;
! 			lmap->attr[1] = NULL;
  			break;
  
  			/* args stolen from ldapsearch.c */
***************
*** 2538,2545 ****
  			return FALSE;
  		}
  	}
! 	if (lmap->attr != NULL)
! 		lmap->attr = newstr(ldap_map_dequote(lmap->attr));
  	else
  	{
  		if (!bitset(MCF_OPTFILE, map->map_class->map_cflags))
--- 2718,2725 ----
  			return FALSE;
  		}
  	}
! 	if (lmap->attr[0] != NULL)
! 		lmap->attr[0] = newstr(ldap_map_dequote(lmap->attr[0]));
  	else
  	{
  		if (!bitset(MCF_OPTFILE, map->map_class->map_cflags))
***************
*** 2690,2695 ****
--- 2870,2876 ----
  	if (tTd(38, 2))
  		printf("ni_map_open(%s, %s, %d)\n",
  			map->map_mname, map->map_file, mode);
+ 	mode &= O_ACCMODE;
  
  	if (*map->map_file == '\0')
  		map->map_file = NETINFO_DEFAULT_DIR;
***************
*** 2970,2975 ****
--- 3151,3158 ----
  **	This code donated by Sun Microsystems.
  */
  
+ #define map_sff		map_lockfd	/* overload field */
+ 
  
  /*
  **  TEXT_MAP_OPEN -- open text table
***************
*** 2980,2991 ****
  	MAP *map;
  	int mode;
  {
! 	struct stat sbuf;
  
  	if (tTd(38, 2))
  		printf("text_map_open(%s, %s, %d)\n",
  			map->map_mname, map->map_file, mode);
  
  	if (mode != O_RDONLY)
  	{
  		errno = ENODEV;
--- 3163,3176 ----
  	MAP *map;
  	int mode;
  {
! 	int sff;
! 	int i;
  
  	if (tTd(38, 2))
  		printf("text_map_open(%s, %s, %d)\n",
  			map->map_mname, map->map_file, mode);
  
+ 	mode &= O_ACCMODE;
  	if (mode != O_RDONLY)
  	{
  		errno = ENODEV;
***************
*** 3005,3037 ****
  			map->map_mname);
  		return FALSE;
  	}
! 	/* check to see if this map actually accessable */
! 	if (access(map->map_file, R_OK) <0)
  	{
  		if (tTd(38, 2))
! 			printf("text_map_open(%s, %s): cannot access: %s\n",
! 				map->map_mname, map->map_file, errstring(errno));
  		if (!bitset(MF_OPTIONAL, map->map_mflags))
! 			syserr("text map \"%s\": cannot access file %s",
  				map->map_mname, map->map_file);
  		return FALSE;
  	}
  
- 	/* check to see if this map actually exist */
- 	if (stat(map->map_file, &sbuf) <0)
- 	{
- 		syserr("text_map_open(%s, %s): cannot stat",
- 			map->map_mname, map->map_file);
- 		return FALSE;
- 	}
- 
- 	if (!S_ISREG(sbuf.st_mode))
- 	{
- 		syserr("text map \"%s\": %s is not a regular file",
- 			map->map_mname, map->map_file);
- 		return FALSE;
- 	}
- 
  	if (map->map_keycolnm == NULL)
  		map->map_keycolno = 0;
  	else
--- 3190,3211 ----
  			map->map_mname);
  		return FALSE;
  	}
! 
! 	sff = SFF_ROOTOK|SFF_REGONLY|SFF_NOWLINK;
! 	if (FatalWritableDirs)
! 		sff |= SFF_SAFEDIRPATH;
! 	if ((i = safefile(map->map_file, RunAsUid, RunAsGid, RunAsUserName,
! 			  sff, S_IRUSR, NULL)) != 0)
  	{
+ 		/* cannot open this map */
  		if (tTd(38, 2))
! 			printf("\tunsafe map file: %d\n", i);
  		if (!bitset(MF_OPTIONAL, map->map_mflags))
! 			syserr("text map \"%s\": unsafe map file %s",
  				map->map_mname, map->map_file);
  		return FALSE;
  	}
  
  	if (map->map_keycolnm == NULL)
  		map->map_keycolno = 0;
  	else
***************
*** 3070,3075 ****
--- 3244,3250 ----
  			printf("%c\n", map->map_coldelim);
  	}
  
+ 	map->map_sff = sff;
  	return TRUE;
  }
  
***************
*** 3088,3100 ****
  	char *vp;
  	auto int vsize;
  	int buflen;
- 	char search_key[MAXNAME + 1];
- 	char linebuf[MAXLINE];
  	FILE *f;
- 	char buf[MAXNAME + 1];
  	char delim;
  	int key_idx;
  	bool found_it;
  	extern char *get_column __P((char *, int, char, char *, int));
  
  	found_it = FALSE;
--- 3263,3276 ----
  	char *vp;
  	auto int vsize;
  	int buflen;
  	FILE *f;
  	char delim;
  	int key_idx;
  	bool found_it;
+ 	int sff = map->map_sff;
+ 	char search_key[MAXNAME + 1];
+ 	char linebuf[MAXLINE];
+ 	char buf[MAXNAME + 1];
  	extern char *get_column __P((char *, int, char, char *, int));
  
  	found_it = FALSE;
***************
*** 3109,3115 ****
  	if (!bitset(MF_NOFOLDCASE, map->map_mflags))
  		makelower(search_key);
  
! 	f = fopen(map->map_file, "r");
  	if (f == NULL)
  	{
  		map->map_mflags &= ~(MF_VALID|MF_OPEN);
--- 3285,3291 ----
  	if (!bitset(MF_NOFOLDCASE, map->map_mflags))
  		makelower(search_key);
  
! 	f = safefopen(map->map_file, O_RDONLY, FileMode, sff);
  	if (f == NULL)
  	{
  		map->map_mflags &= ~(MF_VALID|MF_OPEN);
***************
*** 3166,3172 ****
  	char linebuf[MAXLINE];
  	char cbuf[MAXNAME + 1];
  	char nbuf[MAXNAME + 1];
- 	extern char *get_column __P((char *, int, char, char *, int));
  
  	if (tTd(38, 20))
  		printf("text_getcanonname(%s)\n", name);
--- 3342,3347 ----
***************
*** 3272,3290 ****
  	int mode;
  {
  	FILE *af;
  	struct stat st;
  
  	if (tTd(38, 2))
  		printf("stab_map_open(%s, %s, %d)\n",
  			map->map_mname, map->map_file, mode);
  
  	if (mode != O_RDONLY)
  	{
  		errno = ENODEV;
  		return FALSE;
  	}
  
! 	af = fopen(map->map_file, "r");
  	if (af == NULL)
  		return FALSE;
  	readaliases(map, af, FALSE, FALSE);
--- 3447,3470 ----
  	int mode;
  {
  	FILE *af;
+ 	int sff;
  	struct stat st;
  
  	if (tTd(38, 2))
  		printf("stab_map_open(%s, %s, %d)\n",
  			map->map_mname, map->map_file, mode);
  
+ 	mode &= O_ACCMODE;
  	if (mode != O_RDONLY)
  	{
  		errno = ENODEV;
  		return FALSE;
  	}
  
! 	sff = SFF_ROOTOK|SFF_REGONLY|SFF_NOWLINK;
! 	if (FatalWritableDirs)
! 		sff |= SFF_SAFEDIRPATH;
! 	af = safefopen(map->map_file, O_RDONLY, 0444, sff);
  	if (af == NULL)
  		return FALSE;
  	readaliases(map, af, FALSE, FALSE);
***************
*** 3365,3370 ****
--- 3545,3551 ----
  		printf("impl_map_open(%s, %s, %d)\n",
  			map->map_mname, map->map_file, mode);
  
+ 	mode &= O_ACCMODE;
  #ifdef NEWDB
  	map->map_mflags |= MF_IMPL_HASH;
  	if (hash_map_open(map, mode))
***************
*** 3447,3452 ****
--- 3628,3634 ----
  		printf("user_map_open(%s, %d)\n",
  			map->map_mname, mode);
  
+ 	mode &= O_ACCMODE;
  	if (mode != O_RDONLY)
  	{
  		/* issue a pseudo-error message */
***************
*** 3768,3773 ****
--- 3950,3956 ----
  		printf("switch_map_open(%s, %s, %d)\n",
  			map->map_mname, map->map_file, mode);
  
+ 	mode &= O_ACCMODE;
  	nmaps = switch_map_find(map->map_file, maptype, map->map_return);
  	if (tTd(38, 19))
  	{
diff -Ncr sendmail-8.8.5/src/mci.c sendmail-8.8.6/src/mci.c
*** sendmail-8.8.5/src/mci.c	Wed Dec 11 18:27:55 1996
--- sendmail-8.8.6/src/mci.c	Thu May 29 12:55:52 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)mci.c	8.54 (Berkeley) 12/1/96";
  #endif /* not lint */
  
  #include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)mci.c	8.62 (Berkeley) 5/29/97";
  #endif /* not lint */
  
  #include "sendmail.h"
***************
*** 116,127 ****
  	if (tTd(42, 5))
  		printf("mci_cache: caching %lx (%s) in slot %d\n",
  			(u_long) mci, mci->mci_host, mcislot - MciCache);
- #ifdef LOG
  	if (tTd(91, 100))
! 		syslog(LOG_DEBUG, "%s: mci_cache: caching %x (%.100s) in slot %d",
! 			CurEnv->e_id ? CurEnv->e_id : "NOQUEUE",
  			mci, mci->mci_host, mcislot - MciCache);
- #endif
  
  	*mcislot = mci;
  	mci->mci_flags |= MCIF_CACHED;
--- 116,125 ----
  	if (tTd(42, 5))
  		printf("mci_cache: caching %lx (%s) in slot %d\n",
  			(u_long) mci, mci->mci_host, mcislot - MciCache);
  	if (tTd(91, 100))
! 		sm_syslog(LOG_DEBUG, CurEnv->e_id,
! 			"mci_cache: caching %x (%.100s) in slot %d",
  			mci, mci->mci_host, mcislot - MciCache);
  
  	*mcislot = mci;
  	mci->mci_flags |= MCIF_CACHED;
***************
*** 216,227 ****
  	if (tTd(42, 5))
  		printf("mci_uncache: uncaching %lx (%s) from slot %d (%d)\n",
  			(u_long) mci, mci->mci_host, mcislot - MciCache, doquit);
- #ifdef LOG
  	if (tTd(91, 100))
! 		syslog(LOG_DEBUG, "%s: mci_uncache: uncaching %x (%.100s) from slot %d (%d)",
! 			CurEnv->e_id ? CurEnv->e_id : "NOQUEUE",
  			mci, mci->mci_host, mcislot - MciCache, doquit);
- #endif
  
  #if SMTP
  	if (doquit)
--- 214,223 ----
  	if (tTd(42, 5))
  		printf("mci_uncache: uncaching %lx (%s) from slot %d (%d)\n",
  			(u_long) mci, mci->mci_host, mcislot - MciCache, doquit);
  	if (tTd(91, 100))
! 		sm_syslog(LOG_DEBUG, CurEnv->e_id,
! 			"mci_uncache: uncaching %x (%.100s) from slot %d (%d)",
  			mci, mci->mci_host, mcislot - MciCache, doquit);
  
  #if SMTP
  	if (doquit)
***************
*** 485,495 ****
  		mci->mci_host == NULL ? "NULL" : mci->mci_host,
  		ctime(&mci->mci_lastuse));
  printit:
- #ifdef LOG
  	if (logit)
! 		syslog(LOG_DEBUG, "%.1000s", buf);
  	else
- #endif
  		printf("%s\n", buf);
  }
  /*
--- 481,489 ----
  		mci->mci_host == NULL ? "NULL" : mci->mci_host,
  		ctime(&mci->mci_lastuse));
  printit:
  	if (logit)
! 		sm_syslog(LOG_DEBUG, CurEnv->e_id, "%.1000s", buf);
  	else
  		printf("%s\n", buf);
  }
  /*
***************
*** 577,584 ****
  		goto cleanup;
  	}
  
! 	if ((mci->mci_statfile = fopen(fname, "r+")) == NULL)
! 		mci->mci_statfile = fopen(fname, "w");
  
  	if (mci->mci_statfile == NULL)
  	{
--- 571,578 ----
  		goto cleanup;
  	}
  
! 	mci->mci_statfile = safefopen(fname, O_RDWR|O_CREAT, FileMode,
! 		   SFF_NOLOCK|SFF_NOLINK|SFF_OPENASROOT|SFF_REGONLY|SFF_CREAT);
  
  	if (mci->mci_statfile == NULL)
  	{
***************
*** 699,705 ****
  		goto cleanup;
  	}
  
! 	fp = fopen(fname, "r");
  	if (fp == NULL)
  	{
  		/* I can't think of any reason this should ever happen */
--- 693,700 ----
  		goto cleanup;
  	}
  
! 	fp = safefopen(fname, O_RDONLY, FileMode,
! 		       SFF_NOLOCK|SFF_NOLINK|SFF_OPENASROOT|SFF_REGONLY);
  	if (fp == NULL)
  	{
  		/* I can't think of any reason this should ever happen */
***************
*** 744,749 ****
--- 739,745 ----
  {
  	int ver;
  	register char *p;
+ 	int saveLineNumber = LineNumber;
  	char buf[MAXLINE];
  
  	if (fp == NULL)
***************
*** 763,770 ****
--- 759,768 ----
  
  	rewind(fp);
  	ver = -1;
+ 	LineNumber = 0;
  	while (fgets(buf, sizeof buf, fp) != NULL)
  	{
+ 		LineNumber++;
  		p = strchr(buf, '\n');
  		if (p != NULL)
  			*p = '\0';
***************
*** 806,814 ****
--- 804,814 ----
  
  		  default:
  			syserr("Unknown host status line \"%s\"", buf);
+ 			LineNumber = saveLineNumber;
  			return -1;
  		}
  	}
+ 	LineNumber = saveLineNumber;
  	if (ver < 0)
  		return -1;
  	return 0;
***************
*** 1053,1059 ****
  		printf(" -------------- Hostname --------------- How long ago ---------Results---------\n");
  	}
  
! 	fp = fopen(pathname, "r+");
  
  	if (fp == NULL)
  	{
--- 1053,1060 ----
  		printf(" -------------- Hostname --------------- How long ago ---------Results---------\n");
  	}
  
! 	fp = safefopen(pathname, O_RDWR, FileMode,
! 		       SFF_NOLOCK|SFF_NOLINK|SFF_OPENASROOT|SFF_REGONLY);
  
  	if (fp == NULL)
  	{
***************
*** 1063,1078 ****
--- 1064,1082 ----
  		return 0;
  	}
  
+ 	FileName = pathname;
  	bzero(&mcib, sizeof mcib);
  	if (mci_read_persistent(fp, &mcib) < 0)
  	{
  		syserr("%s: could not read status file", pathname);
  		fclose(fp);
+ 		FileName = NULL;
  		return 0;
  	}
  
  	locked = !lockfile(fileno(fp), pathname, "", LOCK_EX|LOCK_NB);
  	fclose(fp);
+ 	FileName = NULL;
  
  	printf("%c%-39s %12s ",
  		locked ? '*' : ' ', hostname,
***************
*** 1193,1205 ****
--- 1197,1218 ----
  	*/
  
  	if (host == NULL)
+ 	{
  		syserr("mci_generate_persistent_path: null host");
+ 		return -1;
+ 	}
  	if (path == NULL)
+ 	{
  		syserr("mci_generate_persistent_path: null path");
+ 		return -1;
+ 	}
  
  	if (tTd(56, 80))
  		printf("mci_generate_persistent_path(%s): ", host);
  
+ 	if (*host == '\0')
+ 		return -1;
+ 
  	/* make certain this is not a bracketed host number */
  	if (strlen(host) > sizeof t_host - 1)
  		return -1;
***************
*** 1214,1229 ****
  	*/
  
  	elem = t_host + strlen(t_host);
! 	while (elem > t_host && (elem[-1] == '.' || elem[-1] == ']'))
  		*--elem = '\0';
  
  	/* check for what will be the final length of the path */
  	len = strlen(HostStatDir) + 2;
  	for (p = (char *) host; *p != '\0'; p++)
  	{
! 		if (*p == '|' || *p != '.')
  			len++;
  		len++;
  	}
  	if (len > pathlen)
  		return -1;
--- 1227,1245 ----
  	*/
  
  	elem = t_host + strlen(t_host);
! 	while (elem > t_host &&
! 	       (elem[-1] == '.' || (host[0] == '[' && elem[-1] == ']')))
  		*--elem = '\0';
  
  	/* check for what will be the final length of the path */
  	len = strlen(HostStatDir) + 2;
  	for (p = (char *) host; *p != '\0'; p++)
  	{
! 		if (*p == '|' || *p == '.')
  			len++;
  		len++;
+ 		if (p[0] == '.' && p[1] == '.')
+ 			return -1;
  	}
  	if (len > pathlen)
  		return -1;
diff -Ncr sendmail-8.8.5/src/mime.c sendmail-8.8.6/src/mime.c
*** sendmail-8.8.5/src/mime.c	Tue Jan 14 17:21:22 1997
--- sendmail-8.8.6/src/mime.c	Tue May  6 09:52:10 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1994, 1996 Eric P. Allman
   * Copyright (c) 1994
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1994, 1996-1997 Eric P. Allman
   * Copyright (c) 1994
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 36,42 ****
  # include <string.h>
  
  #ifndef lint
! static char sccsid[] = "@(#)mime.c	8.54 (Berkeley) 1/14/97";
  #endif /* not lint */
  
  /*
--- 36,42 ----
  # include <string.h>
  
  #ifndef lint
! static char sccsid[] = "@(#)mime.c	8.59 (Berkeley) 5/6/97";
  #endif /* not lint */
  
  /*
***************
*** 259,268 ****
  			if (strcasecmp(argv[i].field, "boundary") == 0)
  				break;
  		}
! 		if (i >= argc)
  		{
! 			syserr("mime8to7: Content-Type: \"%s\": missing boundary",
! 				p);
  			p = "---";
  
  			/* avoid bounce loops */
--- 259,268 ----
  			if (strcasecmp(argv[i].field, "boundary") == 0)
  				break;
  		}
! 		if (i >= argc || argv[i].value == NULL)
  		{
! 			syserr("mime8to7: Content-Type: \"%s\": %s boundary",
! 				i >= argc ? "missing" : "bogus", p);
  			p = "---";
  
  			/* avoid bounce loops */
***************
*** 311,317 ****
  			bt = mimeboundary(buf, boundaries);
  			if (bt != MBT_NOTSEP)
  				break;
! 			putxline(buf, mci, PXLF_MAPFROM|PXLF_STRIP8BIT);
  			if (tTd(43, 99))
  				printf("  ...%s", buf);
  		}
--- 311,317 ----
  			bt = mimeboundary(buf, boundaries);
  			if (bt != MBT_NOTSEP)
  				break;
! 			putxline(buf, strlen(buf), mci, PXLF_MAPFROM|PXLF_STRIP8BIT);
  			if (tTd(43, 99))
  				printf("  ...%s", buf);
  		}
***************
*** 325,331 ****
  			putline(buf, mci);
  			if (tTd(43, 35))
  				printf("  ...%s\n", buf);
! 			collect(e->e_dfp, FALSE, FALSE, &hdr, e);
  			if (tTd(43, 101))
  				putline("+++after collect", mci);
  			putheader(mci, hdr, e);
--- 325,331 ----
  			putline(buf, mci);
  			if (tTd(43, 35))
  				printf("  ...%s\n", buf);
! 			collect(e->e_dfp, FALSE, &hdr, e);
  			if (tTd(43, 101))
  				putline("+++after collect", mci);
  			putheader(mci, hdr, e);
***************
*** 346,352 ****
  			bt = mimeboundary(buf, boundaries);
  			if (bt != MBT_NOTSEP)
  				break;
! 			putxline(buf, mci, PXLF_MAPFROM|PXLF_STRIP8BIT);
  			if (tTd(43, 99))
  				printf("  ...%s", buf);
  		}
--- 346,352 ----
  			bt = mimeboundary(buf, boundaries);
  			if (bt != MBT_NOTSEP)
  				break;
! 			putxline(buf, strlen(buf), mci, PXLF_MAPFROM|PXLF_STRIP8BIT);
  			if (tTd(43, 99))
  				printf("  ...%s", buf);
  		}
***************
*** 377,383 ****
  			putline("", mci);
  
  			mci->mci_flags |= MCIF_INMIME;
! 			collect(e->e_dfp, FALSE, FALSE, &hdr, e);
  			if (tTd(43, 101))
  				putline("+++after collect", mci);
  			putheader(mci, hdr, e);
--- 377,383 ----
  			putline("", mci);
  
  			mci->mci_flags |= MCIF_INMIME;
! 			collect(e->e_dfp, FALSE, &hdr, e);
  			if (tTd(43, 101))
  				putline("+++after collect", mci);
  			putheader(mci, hdr, e);
***************
*** 1048,1055 ****
  				if (*--fbufp != '\n' ||
  				    (fbufp > fbuf && *--fbufp != '\r'))
  					fbufp++;
! 				*fbufp = '\0';
! 				putline((char *) fbuf, mci);
  				fbufp = fbuf;
  			}
  			if (c3 == '=')
--- 1048,1055 ----
  				if (*--fbufp != '\n' ||
  				    (fbufp > fbuf && *--fbufp != '\r'))
  					fbufp++;
! 				putxline((char *) fbuf, fbufp - fbuf,
! 					 mci, PXLF_MAPFROM);
  				fbufp = fbuf;
  			}
  			if (c3 == '=')
***************
*** 1061,1068 ****
  				if (*--fbufp != '\n' ||
  				    (fbufp > fbuf && *--fbufp != '\r'))
  					fbufp++;
! 				*fbufp = '\0';
! 				putline((char *) fbuf, mci);
  				fbufp = fbuf;
  			}
  			if (c4 == '=')
--- 1061,1068 ----
  				if (*--fbufp != '\n' ||
  				    (fbufp > fbuf && *--fbufp != '\r'))
  					fbufp++;
! 				putxline((char *) fbuf, fbufp - fbuf,
! 					 mci, PXLF_MAPFROM);
  				fbufp = fbuf;
  			}
  			if (c4 == '=')
***************
*** 1074,1081 ****
  				if (*--fbufp != '\n' ||
  				    (fbufp > fbuf && *--fbufp != '\r'))
  					fbufp++;
! 				*fbufp = '\0';
! 				putline((char *) fbuf, mci);
  				fbufp = fbuf;
  			}
  		}
--- 1074,1081 ----
  				if (*--fbufp != '\n' ||
  				    (fbufp > fbuf && *--fbufp != '\r'))
  					fbufp++;
! 				putxline((char *) fbuf, fbufp - fbuf,
! 					 mci, PXLF_MAPFROM);
  				fbufp = fbuf;
  			}
  		}
***************
*** 1090,1096 ****
  					&fbuf[MAXLINE] - fbufp) == 0)
  				continue;
  
! 			putline((char *) fbuf, mci);
  			fbufp = fbuf;
  		}
  	}
--- 1090,1098 ----
  					&fbuf[MAXLINE] - fbufp) == 0)
  				continue;
  
! 			if (fbufp - fbuf > 0)
! 				putxline((char *) fbuf, fbufp - fbuf - 1, mci,
! 					 PXLF_MAPFROM);
  			fbufp = fbuf;
  		}
  	}
***************
*** 1099,1105 ****
  	if (fbufp > fbuf)
  	{
  		*fbufp = '\0';
! 		putline((char *) fbuf, mci);
  	}
  	if (tTd(43, 3))
  		printf("\t\t\tmime7to8 => %s to 8bit done\n", cte);
--- 1101,1107 ----
  	if (fbufp > fbuf)
  	{
  		*fbufp = '\0';
! 		putxline((char *) fbuf, fbufp - fbuf, mci, PXLF_MAPFROM);
  	}
  	if (tTd(43, 3))
  		printf("\t\t\tmime7to8 => %s to 8bit done\n", cte);
diff -Ncr sendmail-8.8.5/src/newaliases.0 sendmail-8.8.6/src/newaliases.0
*** sendmail-8.8.5/src/newaliases.0	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/src/newaliases.0	Wed Feb 21 17:04:17 1996
***************
*** 0 ****
--- 1,27 ----
+ NEWALIASES(1)                BSD Reference Manual                NEWALIASES(1)
+ 
+ NNAAMMEE
+      nneewwaalliiaasseess - rebuild the data base for the mail aliases file
+ 
+ SSYYNNOOPPSSIISS
+      nneewwaalliiaasseess
+ 
+ DDEESSCCRRIIPPTTIIOONN
+      NNeewwaalliiaasseess rebuilds the random access data base for the mail aliases file
+      _/_e_t_c_/_a_l_i_a_s_e_s. It must be run each time this file is changed in order for
+      the change to take effect.
+ 
+      NNeewwaalliiaasseess is identical to ``sendmail -bi''.
+ 
+      The nneewwaalliiaasseess utility exits 0 on success, and >0 if an error occurs.
+ 
+ FFIILLEESS
+      /etc/aliases  The mail aliases file
+ 
+ SSEEEE AALLSSOO
+      aliases(5),  sendmail(8)
+ 
+ HHIISSTTOORRYY
+      The nneewwaalliiaasseess command appeared in 4.0BSD.
+ 
+ 4th Berkeley Distribution      February 22, 1994                             1
diff -Ncr sendmail-8.8.5/src/newaliases.1 sendmail-8.8.6/src/newaliases.1
*** sendmail-8.8.5/src/newaliases.1	Wed Feb 21 16:50:04 1996
--- sendmail-8.8.6/src/newaliases.1	Sat Feb  1 16:24:51 1997
***************
*** 1,3 ****
--- 1,4 ----
+ .\" Copyright (c) 1983, 1997 Eric P. Allman
  .\" Copyright (c) 1985, 1990, 1993
  .\"	The Regents of the University of California.  All rights reserved.
  .\"
***************
*** 29,37 ****
  .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  .\" SUCH DAMAGE.
  .\"
! .\"     @(#)newaliases.1	8.4 (Berkeley) 2/22/94
  .\"
! .Dd February 22, 1994
  .Dt NEWALIASES 1
  .Os BSD 4
  .Sh NAME
--- 30,38 ----
  .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  .\" SUCH DAMAGE.
  .\"
! .\"     @(#)newaliases.1	8.5 (Berkeley) 2/1/97
  .\"
! .Dd February 1, 1997
  .Dt NEWALIASES 1
  .Os BSD 4
  .Sh NAME
diff -Ncr sendmail-8.8.5/src/parseaddr.c sendmail-8.8.6/src/parseaddr.c
*** sendmail-8.8.5/src/parseaddr.c	Wed Dec 11 18:27:58 1996
--- sendmail-8.8.6/src/parseaddr.c	Sat Jun 14 08:21:20 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)parseaddr.c	8.115 (Berkeley) 11/24/96";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)parseaddr.c	8.128 (Berkeley) 6/14/97";
  #endif /* not lint */
  
  # include "sendmail.h"
***************
*** 220,225 ****
--- 220,230 ----
  		if (savedelim != '\0')
  			*delimptr = '\0';
  	}
+ 	if (strlen(addr) > TOBUFSIZE - 2)
+ 	{
+ 		usrerr("553 Address too long (%d bytes max)", TOBUFSIZE - 2);
+ 		goto failure;
+ 	}
  	for (; *addr != '\0'; addr++)
  	{
  		if ((*addr & 0340) == 0200)
***************
*** 233,238 ****
--- 238,244 ----
  	}
  	setstat(EX_USAGE);
  	usrerr("553 Address contained invalid control characters");
+ failure:
  	if (delimptr != NULL && savedelim != '\0')
  		*delimptr = savedelim;
  	return TRUE;
***************
*** 756,761 ****
--- 762,768 ----
  	struct match mlist[MAXMATCH];	/* stores match on LHS */
  	char *npvp[MAXATOM+1];		/* temporary space for rebuild */
  	extern int callsubr __P((char**, int, ENVELOPE *));
+ 	extern int sm_strcasecmp __P((char *, char *));
  
  	if (OpMode == MD_TEST || tTd(21, 1))
  	{
***************
*** 930,936 ****
  
  			  default:
  				/* must have exact match */
! 				if (strcasecmp(rp, ap))
  					goto backup;
  				avp++;
  				break;
--- 937,943 ----
  
  			  default:
  				/* must have exact match */
! 				if (sm_strcasecmp(rp, ap))
  					goto backup;
  				avp++;
  				break;
***************
*** 1436,1442 ****
  				map->s_name, key, errno);
  		if (e->e_message == NULL)
  		{
! 			char mbuf[300];
  
  			snprintf(mbuf, sizeof mbuf,
  				"%.80s map: lookup (%s): deferred",
--- 1443,1449 ----
  				map->s_name, key, errno);
  		if (e->e_message == NULL)
  		{
! 			char mbuf[320];
  
  			snprintf(mbuf, sizeof mbuf,
  				"%.80s map: lookup (%s): deferred",
***************
*** 2106,2111 ****
--- 2113,2122 ----
  **		none.
  */
  
+ #define Q_COPYFLAGS	(QPRIMARY|QBOGUSSHELL|QUNSAFEADDR|\
+ 			 Q_PINGFLAGS|QHASNOTIFY|\
+ 			 QRELAYED|QEXPANDED|QDELIVERED|QDELAYED)
+ 
  void
  maplocaluser(a, sendq, aliaslevel, e)
  	register ADDRESS *a;
***************
*** 2127,2132 ****
--- 2138,2147 ----
  	if (pvp == NULL)
  		return;
  
+ 	define('h', a->q_host, e);
+ 	define('u', a->q_user, e);
+ 	define('z', a->q_home, e);
+  
  	if (rewrite(pvp, 5, 0, e) == EX_TEMPFAIL)
  	{
  		a->q_flags |= QQUEUEUP;
***************
*** 2139,2145 ****
--- 2154,2169 ----
  	/* if non-null, mailer destination specified -- has it changed? */
  	a1 = buildaddr(pvp, NULL, 0, e);
  	if (a1 == NULL || sameaddr(a, a1))
+ 	{
+ 		if (a1 != NULL)
+ 			free(a1);
  		return;
+ 	}
+ 
+ 	/* make new address take on flags and print attributes of old */
+ 	a1->q_flags &= ~Q_COPYFLAGS;
+ 	a1->q_flags |= a->q_flags & Q_COPYFLAGS;
+ 	a1->q_paddr = a->q_paddr;
  
  	/* mark old address as dead; insert new address */
  	a->q_flags |= QDONTSEND;
***************
*** 2324,2329 ****
--- 2348,2355 ----
  	int rsno;
  	auto ADDRESS a1;
  	bool saveQuickAbort = QuickAbort;
+ 	bool saveSuprErrs = SuprErrs;
+ 	bool saveOnlyOneError = OnlyOneError;
  	char buf0[MAXLINE];
  	char pvpbuf[PSBUFSIZE];
  	extern char MsgBuf[];
***************
*** 2360,2403 ****
  		}
  		(void) snprintf(buf, bufsize, "%s", p1);
  	}
  	pvp = prescan(buf, '\0', pvpbuf, sizeof pvpbuf, NULL, NULL);
  	if (pvp == NULL)
  	{
  		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)
! 		return EX_OK;
  
  	/* got an error -- process it */
  	saveexitstat = ExitStat;
- 	QuickAbort = FALSE;
  	(void) buildaddr(pvp, &a1, 0, e);
- 	QuickAbort = saveQuickAbort;
  	rstat = ExitStat;
  	ExitStat = saveexitstat;
  
- #ifdef LOG
  	if (LogLevel >= 4)
  	{
  		if (p2 == NULL)
! 			syslog(LOG_NOTICE, "Ruleset %s (%s) rejection: %s",
  				rwset, p1, MsgBuf);
  		else
! 			syslog(LOG_NOTICE, "Ruleset %s (%s, %s) rejection: %s",
  				rwset, p1, p2, MsgBuf);
  	}
- #endif
- 
- 	if (QuickAbort)
- 		longjmp(TopFrame, 2);
  
- 	/* clean up */
   finis:
  	setstat(rstat);
  	if (buf != buf0)
  		free(buf);
  	return rstat;
  }
--- 2386,2437 ----
  		}
  		(void) snprintf(buf, bufsize, "%s", p1);
  	}
+ 	SuprErrs = TRUE;
+ 	OnlyOneError = QuickAbort = FALSE;
  	pvp = prescan(buf, '\0', pvpbuf, sizeof pvpbuf, NULL, NULL);
+ 	SuprErrs = saveSuprErrs;
  	if (pvp == NULL)
  	{
+ 		syserr("rscheck: cannot prescan input: \"%s\"",
+ 			shortenstring(buf, 203));
  		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)
! 	{
! 		rstat = EX_OK;
! 		goto finis;
! 	}
  
  	/* got an error -- process it */
  	saveexitstat = ExitStat;
  	(void) buildaddr(pvp, &a1, 0, e);
  	rstat = ExitStat;
  	ExitStat = saveexitstat;
  
  	if (LogLevel >= 4)
  	{
  		if (p2 == NULL)
! 			sm_syslog(LOG_NOTICE, e->e_id,
! 				"Ruleset %s (%s) rejection: %s",
  				rwset, p1, MsgBuf);
  		else
! 			sm_syslog(LOG_NOTICE, e->e_id,
! 				"Ruleset %s (%s, %s) rejection: %s",
  				rwset, p1, p2, MsgBuf);
  	}
  
   finis:
+ 	/* clean up */
+ 	QuickAbort = saveQuickAbort;
+ 	OnlyOneError = saveOnlyOneError;
  	setstat(rstat);
  	if (buf != buf0)
  		free(buf);
+ 
+ 	if (rstat != EX_OK && (QuickAbort || (OnlyOneError && !HoldErrs)))
+ 		longjmp(TopFrame, 2);
  	return rstat;
  }
diff -Ncr sendmail-8.8.5/src/queue.c sendmail-8.8.6/src/queue.c
*** sendmail-8.8.5/src/queue.c	Tue Jan 14 18:01:26 1997
--- sendmail-8.8.6/src/queue.c	Sat Jun 14 08:21:20 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 36,44 ****
  
  #ifndef lint
  #if QUEUE
! static char sccsid[] = "@(#)queue.c	8.153 (Berkeley) 1/14/97 (with queueing)";
  #else
! static char sccsid[] = "@(#)queue.c	8.153 (Berkeley) 1/14/97 (without queueing)";
  #endif
  #endif /* not lint */
  
--- 36,44 ----
  
  #ifndef lint
  #if QUEUE
! static char sccsid[] = "@(#)queue.c	8.169 (Berkeley) 6/14/97 (with queueing)";
  #else
! static char sccsid[] = "@(#)queue.c	8.169 (Berkeley) 6/14/97 (without queueing)";
  #endif
  #endif /* not lint */
  
***************
*** 99,105 ****
  	register char *p;
  	MAILER nullmailer;
  	MCI mcibuf;
! 	char buf[MAXLINE], tf[MAXLINE];
  	extern void printctladdr __P((ADDRESS *, FILE *));
  
  	/*
--- 99,106 ----
  	register char *p;
  	MAILER nullmailer;
  	MCI mcibuf;
! 	char tf[MAXQFNAME];
! 	char buf[MAXLINE];
  	extern void printctladdr __P((ADDRESS *, FILE *));
  
  	/*
***************
*** 125,145 ****
  			{
  				if (errno != EEXIST)
  					break;
- #ifdef LOG
  				if (LogLevel > 0 && (i % 32) == 0)
! 					syslog(LOG_ALERT, "queueup: cannot create %s, uid=%d: %s",
  						tf, geteuid(), errstring(errno));
- #endif
  			}
  			else
  			{
  				if (lockfile(fd, tf, NULL, LOCK_EX|LOCK_NB))
  					break;
- #ifdef LOG
  				else if (LogLevel > 0 && (i % 32) == 0)
! 					syslog(LOG_ALERT, "queueup: cannot lock %s: %s",
  						tf, errstring(errno));
- #endif
  				close(fd);
  			}
  
--- 126,144 ----
  			{
  				if (errno != EEXIST)
  					break;
  				if (LogLevel > 0 && (i % 32) == 0)
! 					sm_syslog(LOG_ALERT, e->e_id,
! 						"queueup: cannot create %s, uid=%d: %s",
  						tf, geteuid(), errstring(errno));
  			}
  			else
  			{
  				if (lockfile(fd, tf, NULL, LOCK_EX|LOCK_NB))
  					break;
  				else if (LogLevel > 0 && (i % 32) == 0)
! 					sm_syslog(LOG_ALERT, e->e_id,
! 						"queueup: cannot lock %s: %s",
  						tf, errstring(errno));
  				close(fd);
  			}
  
***************
*** 192,198 ****
  	if (!bitset(EF_HAS_DF, e->e_flags))
  	{
  		register FILE *dfp = NULL;
! 		char dfname[20];
  		struct stat stbuf;
  
  		strcpy(dfname, queuename(e, 'd'));
--- 191,197 ----
  	if (!bitset(EF_HAS_DF, e->e_flags))
  	{
  		register FILE *dfp = NULL;
! 		char dfname[MAXQFNAME];
  		struct stat stbuf;
  
  		strcpy(dfname, queuename(e, 'd'));
***************
*** 247,252 ****
--- 246,256 ----
  	if (e->e_bodytype != NULL)
  		fprintf(tfp, "B%s\n", denlstring(e->e_bodytype, TRUE, FALSE));
  
+ #if _FFR_SAVE_CHARSET
+ 	if (e->e_charset != NULL)
+ 		fprintf(tfp, "X%s\n", denlstring(e->e_charset, TRUE, FALSE));
+ #endif
+ 
  	/* message from envelope, if it exists */
  	if (e->e_message != NULL)
  		fprintf(tfp, "M%s\n", denlstring(e->e_message, TRUE, FALSE));
***************
*** 296,304 ****
  		{
  #if XDEBUG
  			if (bitset(QQUEUEUP, q->q_flags))
! 				syslog(LOG_DEBUG,
! 					"dropenvelope: %s: q_flags = %x, paddr = %s",
! 					e->e_id, q->q_flags, q->q_paddr);
  #endif
  			continue;
  		}
--- 300,308 ----
  		{
  #if XDEBUG
  			if (bitset(QQUEUEUP, q->q_flags))
! 				sm_syslog(LOG_DEBUG, e->e_id,
! 					"dropenvelope: q_flags = %x, paddr = %s",
! 					q->q_flags, q->q_paddr);
  #endif
  			continue;
  		}
***************
*** 453,463 ****
  	errno = 0;
  	e->e_flags |= EF_INQUEUE;
  
- # ifdef LOG
  	/* save log info */
  	if (LogLevel > 79)
! 		syslog(LOG_DEBUG, "%s: queueup, qf=%s", e->e_id, qf);
! # endif /* LOG */
  
  	if (tTd(40, 1))
  		printf("<<<<< done queueing %s <<<<<\n\n", e->e_id);
--- 457,465 ----
  	errno = 0;
  	e->e_flags |= EF_INQUEUE;
  
  	/* save log info */
  	if (LogLevel > 79)
! 		sm_syslog(LOG_DEBUG, e->e_id, "queueup, qf=%s", qf);
  
  	if (tTd(40, 1))
  		printf("<<<<< done queueing %s <<<<<\n\n", e->e_id);
***************
*** 537,542 ****
--- 539,545 ----
  */
  
  ENVELOPE	QueueEnvelope;		/* the queue run envelope */
+ extern int	get_num_procs_online __P((void));
  
  bool
  runqueue(forkflag, verbose)
***************
*** 546,575 ****
  	register ENVELOPE *e;
  	int njobs;
  	int sequenceno = 0;
  	extern ENVELOPE BlankEnvelope;
  	extern void clrdaemon __P((void));
! 	extern void runqueueevent __P((bool));
  	extern void drop_privileges __P((void));
  
  	/*
  	**  If no work will ever be selected, don't even bother reading
  	**  the queue.
  	*/
  
  	CurrentLA = getla();	/* get load average */
  
! 	if (CurrentLA >= QueueLA)
  	{
  		char *msg = "Skipping queue run -- load average too high";
  
  		if (verbose)
  			message("458 %s\n", msg);
- #ifdef LOG
  		if (LogLevel > 8)
! 			syslog(LOG_INFO, "runqueue: %s", msg);
! #endif
  		if (forkflag && QueueIntvl != 0)
! 			(void) setevent(QueueIntvl, runqueueevent, TRUE);
  		return FALSE;
  	}
  
--- 549,593 ----
  	register ENVELOPE *e;
  	int njobs;
  	int sequenceno = 0;
+ 	time_t current_la_time;
  	extern ENVELOPE BlankEnvelope;
  	extern void clrdaemon __P((void));
! 	extern void runqueueevent __P((void));
  	extern void drop_privileges __P((void));
  
+ 	DoQueueRun = FALSE;
+ 
  	/*
  	**  If no work will ever be selected, don't even bother reading
  	**  the queue.
  	*/
  
  	CurrentLA = getla();	/* get load average */
+ 	current_la_time = curtime();
  
! 	if (shouldqueue(WkRecipFact, current_la_time))
  	{
  		char *msg = "Skipping queue run -- load average too high";
  
  		if (verbose)
  			message("458 %s\n", msg);
  		if (LogLevel > 8)
! 			sm_syslog(LOG_INFO, NOQID,
! 				"runqueue: %s",
! 				msg);
  		if (forkflag && QueueIntvl != 0)
! 			(void) setevent(QueueIntvl, runqueueevent, 0);
! 		return FALSE;
! 	}
! 
! 	/*
! 	**  See if we already have too many children.
! 	*/
! 
! 	if (forkflag && QueueIntvl != 0 &&
! 	    MaxChildren > 0 && CurChildren >= MaxChildren)
! 	{
! 		(void) setevent(QueueIntvl, runqueueevent, 0);
  		return FALSE;
  	}
  
***************
*** 596,607 ****
  
  			if (verbose)
  				message("458 %s: %s\n", msg, err);
- #ifdef LOG
  			if (LogLevel > 8)
! 				syslog(LOG_INFO, "runqueue: %s: %s", msg, err);
! #endif
  			if (QueueIntvl != 0)
! 				(void) setevent(QueueIntvl, runqueueevent, TRUE);
  			(void) releasesignal(SIGCHLD);
  			return FALSE;
  		}
--- 614,625 ----
  
  			if (verbose)
  				message("458 %s: %s\n", msg, err);
  			if (LogLevel > 8)
! 				sm_syslog(LOG_INFO, NOQID,
! 					"runqueue: %s: %s",
! 					msg, err);
  			if (QueueIntvl != 0)
! 				(void) setevent(QueueIntvl, runqueueevent, 0);
  			(void) releasesignal(SIGCHLD);
  			return FALSE;
  		}
***************
*** 617,623 ****
  			releasesignal(SIGCHLD);
  #endif /* SIGCHLD */
  			if (QueueIntvl != 0)
! 				(void) setevent(QueueIntvl, runqueueevent, TRUE);
  			return TRUE;
  		}
  		/* child -- double fork and clean up signals */
--- 635,641 ----
  			releasesignal(SIGCHLD);
  #endif /* SIGCHLD */
  			if (QueueIntvl != 0)
! 				(void) setevent(QueueIntvl, runqueueevent, 0);
  			return TRUE;
  		}
  		/* child -- double fork and clean up signals */
***************
*** 634,644 ****
  
  	setproctitle("running queue: %s", QueueDir);
  
- # ifdef LOG
  	if (LogLevel > 69)
! 		syslog(LOG_DEBUG, "runqueue %s, pid=%d, forkflag=%d",
  			QueueDir, getpid(), forkflag);
- # endif /* LOG */
  
  	/*
  	**  Release any resources used by the daemon code.
--- 652,661 ----
  
  	setproctitle("running queue: %s", QueueDir);
  
  	if (LogLevel > 69)
! 		sm_syslog(LOG_DEBUG, NOQID,
! 			"runqueue %s, pid=%d, forkflag=%d",
  			QueueDir, getpid(), forkflag);
  
  	/*
  	**  Release any resources used by the daemon code.
***************
*** 665,671 ****
--- 682,691 ----
  
  	/* make sure we have disconnected from parent */
  	if (forkflag)
+ 	{
  		disconnect(1, e);
+ 		OnlyOneError = QuickAbort = FALSE;
+ 	}
  
  	/*
  	**  Make sure the alias database is open.
***************
*** 705,721 ****
  
  		/*
  		**  Ignore jobs that are too expensive for the moment.
  		*/
  
  		sequenceno++;
  		if (shouldqueue(w->w_pri, w->w_ctime))
  		{
  			if (Verbose)
- 			{
  				message("");
  				message("Skipping %s (sequence %d of %d)",
  					w->w_name + 2, sequenceno, njobs);
- 			}
  		}
  		else
  		{
--- 725,776 ----
  
  		/*
  		**  Ignore jobs that are too expensive for the moment.
+ 		**
+ 		**	Get new load average every 30 seconds.
  		*/
  
+ 		if (current_la_time < curtime() - 30)
+ 		{
+ 			CurrentLA = getla();
+ 			current_la_time = curtime();
+ 		}
+ 		if (shouldqueue(WkRecipFact, current_la_time))
+ 		{
+ 			char *msg = "Aborting queue run: load average too high";
+ 
+ 			if (Verbose)
+ 				message("%s", msg);
+ 			if (LogLevel > 8)
+ 				sm_syslog(LOG_INFO, NOQID,
+ 					"runqueue: %s",
+ 					msg);
+ 			break;
+ 		}
  		sequenceno++;
  		if (shouldqueue(w->w_pri, w->w_ctime))
  		{
  			if (Verbose)
  				message("");
+ 			if (QueueSortOrder == QS_BYPRIORITY)
+ 			{
+ 				if (Verbose)
+ 					message("Skipping %s (sequence %d of %d) and flushing rest of queue",
+ 						w->w_name + 2,
+ 						sequenceno,
+ 						njobs);
+ 				if (LogLevel > 8)
+ 					sm_syslog(LOG_INFO, NOQID,
+ 						"runqueue: Flushing queue from %s (pri %ld, LA %d, %d of %d)",
+ 						w->w_name + 2,
+ 						w->w_pri,
+ 						CurrentLA,
+ 						sequenceno,
+ 						njobs);
+ 				break;
+ 			}
+ 			else if (Verbose)
  				message("Skipping %s (sequence %d of %d)",
  					w->w_name + 2, sequenceno, njobs);
  		}
  		else
  		{
***************
*** 752,761 ****
  */
  
  void
! runqueueevent(forkflag)
! 	bool forkflag;
  {
! 	(void) runqueue(forkflag, FALSE);
  }
  /*
  **  ORDERQ -- order the work queue.
--- 807,815 ----
  */
  
  void
! runqueueevent()
  {
! 	DoQueueRun = TRUE;
  }
  /*
  **  ORDERQ -- order the work queue.
***************
*** 843,848 ****
--- 897,905 ----
  		if (d->d_name[0] != 'q' || d->d_name[1] != 'f')
  			continue;
  
+ 		if (strlen(d->d_name) > MAXQFNAME)
+ 			continue;
+ 
  		if (QueueLimitId != NULL &&
  		    !strcontainedin(QueueLimitId, d->d_name))
  			continue;
***************
*** 866,876 ****
  		{
  			if (Verbose)
  				printf("orderq: bogus qf name %s\n", d->d_name);
- # ifdef LOG
  			if (LogLevel > 0)
! 				syslog(LOG_ALERT, "orderq: bogus qf name %s",
  					d->d_name);
- # endif
  			if (strlen(d->d_name) > (SIZE_T) MAXNAME)
  				d->d_name[MAXNAME] = '\0';
  			strcpy(lbuf, d->d_name);
--- 923,932 ----
  		{
  			if (Verbose)
  				printf("orderq: bogus qf name %s\n", d->d_name);
  			if (LogLevel > 0)
! 				sm_syslog(LOG_ALERT, NOQID,
! 					"orderq: bogus qf name %s",
  					d->d_name);
  			if (strlen(d->d_name) > (SIZE_T) MAXNAME)
  				d->d_name[MAXNAME] = '\0';
  			strcpy(lbuf, d->d_name);
***************
*** 883,893 ****
  		/* open control file (if not too many files) */
  		if (++wn >= MaxQueueRun && MaxQueueRun > 0)
  		{
- # ifdef LOG
  			if (wn == MaxQueueRun && LogLevel > 0)
! 				syslog(LOG_ALERT, "WorkList for %s maxed out at %d",
! 						QueueDir, MaxQueueRun);
! # endif
  			continue;
  		}
  		if (wn >= WorkListSize)
--- 939,948 ----
  		/* open control file (if not too many files) */
  		if (++wn >= MaxQueueRun && MaxQueueRun > 0)
  		{
  			if (wn == MaxQueueRun && LogLevel > 0)
! 				sm_syslog(LOG_ALERT, NOQID,
! 					"WorkList for %s maxed out at %d",
! 					QueueDir, MaxQueueRun);
  			continue;
  		}
  		if (wn >= WorkListSize)
***************
*** 930,937 ****
--- 985,1004 ----
  		while (i != 0 && fgets(lbuf, sizeof lbuf, cf) != NULL)
  		{
  			int qfver = 0;
+ 			char *p;
+ 			int c;
  			extern bool strcontainedin();
  
+ 			p = strchr(lbuf, '\n');
+ 			if (p != NULL)
+ 				*p = '\0';
+ 			else
+ 			{
+ 				/* flush rest of overly long line */
+ 				while ((c = getc(cf)) != EOF && c != '\n')
+ 					continue;
+ 			}
+ 
  			switch (lbuf[0])
  			{
  			  case 'V':
***************
*** 1140,1157 ****
  		{
  			WorkListSize = newsize;
  			WorkList = newlist;
- # ifdef LOG
  			if (LogLevel > 1)
  			{
! 				syslog(LOG_NOTICE, "grew WorkList for %s to %d",
! 						QueueDir, WorkListSize);
  			}
  		}
  		else if (LogLevel > 0)
  		{
! 			syslog(LOG_ALERT, "FAILED to grow WorkList for %s to %d",
! 					QueueDir, newsize);
! # endif
  		}
  	}
  	if (tTd(41, 1))
--- 1207,1224 ----
  		{
  			WorkListSize = newsize;
  			WorkList = newlist;
  			if (LogLevel > 1)
  			{
! 				sm_syslog(LOG_NOTICE, NOQID,
! 					"grew WorkList for %s to %d",
! 					QueueDir, WorkListSize);
  			}
  		}
  		else if (LogLevel > 0)
  		{
! 			sm_syslog(LOG_ALERT, NOQID,
! 				"FAILED to grow WorkList for %s to %d",
! 				QueueDir, newsize);
  		}
  	}
  	if (tTd(41, 1))
***************
*** 1347,1352 ****
--- 1414,1424 ----
  			/* parent -- clean out connection cache */
  			mci_flush(FALSE, NULL);
  		}
+ 		else
+ 		{
+ 			/* child -- error messages to the transcript */
+ 			QuickAbort = OnlyOneError = FALSE;
+ 		}
  	}
  	else
  	{
***************
*** 1378,1388 ****
  			OpMode = MD_DELIVER;
  		}
  		setproctitle("%s: from queue", id);
- # ifdef LOG
  		if (LogLevel > 76)
! 			syslog(LOG_DEBUG, "%s: dowork, pid=%d", e->e_id,
! 			       getpid());
! # endif /* LOG */
  
  		/* don't use the headers from sendmail.cf... */
  		e->e_header = NULL;
--- 1450,1459 ----
  			OpMode = MD_DELIVER;
  		}
  		setproctitle("%s: from queue", id);
  		if (LogLevel > 76)
! 			sm_syslog(LOG_DEBUG, e->e_id,
! 				"dowork, pid=%d",
! 				getpid());
  
  		/* don't use the headers from sendmail.cf... */
  		e->e_header = NULL;
***************
*** 1443,1449 ****
  	register char *p;
  	char *orcpt = NULL;
  	bool nomore = FALSE;
! 	char qf[20];
  	char buf[MAXLINE];
  	extern ADDRESS *setctluser __P((char *, int));
  
--- 1514,1520 ----
  	register char *p;
  	char *orcpt = NULL;
  	bool nomore = FALSE;
! 	char qf[MAXQFNAME];
  	char buf[MAXLINE];
  	extern ADDRESS *setctluser __P((char *, int));
  
***************
*** 1468,1477 ****
  		/* being processed by another queuer */
  		if (Verbose || tTd(40, 8))
  			printf("%s: locked\n", e->e_id);
- # ifdef LOG
  		if (LogLevel > 19)
! 			syslog(LOG_DEBUG, "%s: locked", e->e_id);
! # endif /* LOG */
  		(void) fclose(qfp);
  		return FALSE;
  	}
--- 1539,1546 ----
  		/* being processed by another queuer */
  		if (Verbose || tTd(40, 8))
  			printf("%s: locked\n", e->e_id);
  		if (LogLevel > 19)
! 			sm_syslog(LOG_DEBUG, e->e_id, "locked");
  		(void) fclose(qfp);
  		return FALSE;
  	}
***************
*** 1493,1505 ****
  	if ((st.st_uid != geteuid() && geteuid() != RealUid) ||
  	    bitset(S_IWOTH|S_IWGRP, st.st_mode))
  	{
- # ifdef LOG
  		if (LogLevel > 0)
  		{
! 			syslog(LOG_ALERT, "%s: bogus queue file, uid=%d, mode=%o",
! 				e->e_id, st.st_uid, st.st_mode);
  		}
- # endif /* LOG */
  		if (tTd(40, 8))
  			printf("readqf(%s): bogus file\n", qf);
  		loseqfile(e, "bogus file uid in mqueue");
--- 1562,1573 ----
  	if ((st.st_uid != geteuid() && geteuid() != RealUid) ||
  	    bitset(S_IWOTH|S_IWGRP, st.st_mode))
  	{
  		if (LogLevel > 0)
  		{
! 			sm_syslog(LOG_ALERT, e->e_id,
! 				"bogus queue file, uid=%d, mode=%o",
! 				st.st_uid, st.st_mode);
  		}
  		if (tTd(40, 8))
  			printf("readqf(%s): bogus file\n", qf);
  		loseqfile(e, "bogus file uid in mqueue");
***************
*** 1509,1519 ****
  
  	if (st.st_size == 0)
  	{
! 		/* must be a bogus file -- just remove it */
! 		qf[0] = 'd';
! 		(void) unlink(qf);
! 		qf[0] = 'q';
! 		(void) unlink(qf);
  		fclose(qfp);
  		return FALSE;
  	}
--- 1577,1590 ----
  
  	if (st.st_size == 0)
  	{
! 		/* must be a bogus file -- if also old, just remove it */
! 		if (st.st_ctime + 10 * 60 < curtime())
! 		{
! 			qf[0] = 'd';
! 			(void) unlink(qf);
! 			qf[0] = 'q';
! 			(void) unlink(qf);
! 		}
  		fclose(qfp);
  		return FALSE;
  	}
***************
*** 1636,1641 ****
--- 1707,1713 ----
  			hdrsize += strlen(&bp[1]);
  			break;
  
+ 		  case 'L':		/* Solaris Content-Length: */
  		  case 'M':		/* message */
  			/* ignore this; we want a new message next time */
  			break;
***************
*** 1648,1653 ****
--- 1720,1731 ----
  			e->e_bodytype = newstr(&bp[1]);
  			break;
  
+ #if _FFR_SAVE_CHARSET
+ 		  case 'X':		/* character set */
+ 			e->e_charset = newstr(&bp[1]);
+ 			break;
+ #endif
+ 
  		  case 'D':		/* data file name */
  			/* obsolete -- ignore */
  			break;
***************
*** 1669,1675 ****
  
  			/* if this has been tried recently, let it be */
  			if (e->e_ntries > 0 &&
! 			    (curtime() - e->e_dtime) < MinQueueAge)
  			{
  				char *howlong = pintvl(curtime() - e->e_dtime, TRUE);
  				extern void unlockqueue();
--- 1747,1753 ----
  
  			/* if this has been tried recently, let it be */
  			if (e->e_ntries > 0 &&
! 			    curtime() < e->e_dtime + MinQueueAge)
  			{
  				char *howlong = pintvl(curtime() - e->e_dtime, TRUE);
  				extern void unlockqueue();
***************
*** 1677,1687 ****
  				if (Verbose || tTd(40, 8))
  					printf("%s: too young (%s)\n",
  						e->e_id, howlong);
- #ifdef LOG
  				if (LogLevel > 19)
! 					syslog(LOG_DEBUG, "%s: too young (%s)",
! 						e->e_id, howlong);
! #endif
  				e->e_id = NULL;
  				unlockqueue(e);
  				return FALSE;
--- 1755,1764 ----
  				if (Verbose || tTd(40, 8))
  					printf("%s: too young (%s)\n",
  						e->e_id, howlong);
  				if (LogLevel > 19)
! 					sm_syslog(LOG_DEBUG, e->e_id,
! 						"too young (%s)",
! 						howlong);
  				e->e_id = NULL;
  				unlockqueue(e);
  				return FALSE;
***************
*** 1822,1828 ****
  		struct stat st;
  # ifdef NGROUPS_MAX
  		int n;
! 		GIDSET_T gidset[NGROUPS_MAX];
  # endif
  
  		if (stat(QueueDir, &st) < 0)
--- 1899,1905 ----
  		struct stat st;
  # ifdef NGROUPS_MAX
  		int n;
! 		extern GIDSET_T InitialGidSet[NGROUPS_MAX];
  # endif
  
  		if (stat(QueueDir, &st) < 0)
***************
*** 1831,1840 ****
  			return;
  		}
  # ifdef NGROUPS_MAX
! 		n = getgroups(NGROUPS_MAX, gidset);
  		while (--n >= 0)
  		{
! 			if (gidset[n] == st.st_gid)
  				break;
  		}
  		if (n < 0 && RealGid != st.st_gid)
--- 1908,1917 ----
  			return;
  		}
  # ifdef NGROUPS_MAX
! 		n = NGROUPS_MAX;
  		while (--n >= 0)
  		{
! 			if (InitialGidSet[n] == st.st_gid)
  				break;
  		}
  		if (n < 0 && RealGid != st.st_gid)
***************
*** 2037,2043 ****
  
  	if (e->e_id == NULL)
  	{
! 		char qf[20];
  
  		/* find a unique id */
  		if (pid != getpid())
--- 2114,2120 ----
  
  	if (e->e_id == NULL)
  	{
! 		char qf[MAXQFNAME];
  
  		/* find a unique id */
  		if (pid != getpid())
***************
*** 2100,2109 ****
  			printf("  lockfd=");
  			dumpfd(fileno(e->e_lockfp), TRUE, FALSE);
  		}
- # ifdef LOG
  		if (LogLevel > 93)
! 			syslog(LOG_DEBUG, "%s: assigned id", e->e_id);
! # endif /* LOG */
  	}
  
  	if (type == '\0')
--- 2177,2184 ----
  			printf("  lockfd=");
  			dumpfd(fileno(e->e_lockfp), TRUE, FALSE);
  		}
  		if (LogLevel > 93)
! 			sm_syslog(LOG_DEBUG, e->e_id, "assigned id");
  	}
  
  	if (type == '\0')
***************
*** 2144,2153 ****
  		return;
  
  	/* remove the transcript */
- # ifdef LOG
  	if (LogLevel > 87)
! 		syslog(LOG_DEBUG, "%s: unlock", e->e_id);
! # endif /* LOG */
  	if (!tTd(51, 104))
  		xunlink(queuename(e, 'x'));
  
--- 2219,2226 ----
  		return;
  
  	/* remove the transcript */
  	if (LogLevel > 87)
! 		sm_syslog(LOG_DEBUG, e->e_id, "unlock");
  	if (!tTd(51, 104))
  		xunlink(queuename(e, 'x'));
  
***************
*** 2252,2258 ****
  	char *why;
  {
  	char *p;
! 	char buf[40];
  
  	if (e == NULL || e->e_id == NULL)
  		return;
--- 2325,2331 ----
  	char *why;
  {
  	char *p;
! 	char buf[MAXQFNAME];
  
  	if (e == NULL || e->e_id == NULL)
  		return;
***************
*** 2262,2269 ****
  	p = queuename(e, 'Q');
  	if (rename(buf, p) < 0)
  		syserr("cannot rename(%s, %s), uid=%d", buf, p, geteuid());
- #ifdef LOG
  	else if (LogLevel > 0)
! 		syslog(LOG_ALERT, "Losing %s: %s", buf, why);
! #endif
  }
--- 2335,2341 ----
  	p = queuename(e, 'Q');
  	if (rename(buf, p) < 0)
  		syserr("cannot rename(%s, %s), uid=%d", buf, p, geteuid());
  	else if (LogLevel > 0)
! 		sm_syslog(LOG_ALERT, e->e_id,
! 			"Losing %s: %s", buf, why);
  }
diff -Ncr sendmail-8.8.5/src/readcf.c sendmail-8.8.6/src/readcf.c
*** sendmail-8.8.5/src/readcf.c	Tue Jan 14 17:51:49 1997
--- sendmail-8.8.6/src/readcf.c	Thu May 29 12:55:51 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)readcf.c	8.184 (Berkeley) 1/14/97";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)readcf.c	8.196 (Berkeley) 5/29/97";
  #endif /* not lint */
  
  # include "sendmail.h"
***************
*** 121,127 ****
  	FileName = cfname;
  	LineNumber = 0;
  
! 	cf = fopen(cfname, "r");
  	if (cf == NULL)
  	{
  		syserr("cannot open");
--- 121,127 ----
  	FileName = cfname;
  	LineNumber = 0;
  
! 	cf = safefopen(cfname, O_RDONLY, 0444, SFF_OPENASROOT|SFF_NOLOCK);
  	if (cf == NULL)
  	{
  		syserr("cannot open");
***************
*** 145,155 ****
  		if (OpMode == MD_DAEMON || OpMode == MD_INITALIAS)
  			fprintf(stderr, "%s: WARNING: dangerous write permissions\n",
  				FileName);
- #ifdef LOG
  		if (LogLevel > 0)
! 			syslog(LOG_CRIT, "%s: WARNING: dangerous write permissions",
  				FileName);
- #endif
  	}
  
  #ifdef XLA
--- 145,154 ----
  		if (OpMode == MD_DAEMON || OpMode == MD_INITALIAS)
  			fprintf(stderr, "%s: WARNING: dangerous write permissions\n",
  				FileName);
  		if (LogLevel > 0)
! 			sm_syslog(LOG_CRIT, NOQID,
! 				"%s: WARNING: dangerous write permissions",
  				FileName);
  	}
  
  #ifdef XLA
***************
*** 745,751 ****
  	else
  	{
  		pid = -1;
! 		sff = SFF_REGONLY;
  		if (safe)
  			sff |= SFF_OPENASROOT;
  		f = safefopen(filename, O_RDONLY, 0, sff);
--- 744,750 ----
  	else
  	{
  		pid = -1;
! 		sff = SFF_REGONLY|SFF_NOWLINK;
  		if (safe)
  			sff |= SFF_OPENASROOT;
  		f = safefopen(filename, O_RDONLY, 0, sff);
***************
*** 761,767 ****
  	{
  		register char *p;
  # if SCANF
! 		char wordbuf[MAXNAME+1];
  # endif
  
  		if (buf[0] == '#')
--- 760,766 ----
  	{
  		register char *p;
  # if SCANF
! 		char wordbuf[MAXLINE + 1];
  # endif
  
  		if (buf[0] == '#')
***************
*** 1482,1495 ****
  	{ "SingleThreadDelivery",	O_SINGTHREAD,	FALSE	},
  #define O_RUNASUSER	0x9d
  	{ "RunAsUser",			O_RUNASUSER,	FALSE	},
! #ifdef _FFR_DSN_RRT
  #define O_DSN_RRT	0x9e
  	{ "RrtImpliesDsn",		O_DSN_RRT,	FALSE	},
  #endif
! #ifdef _FFR_PIDFILE_OPT
  #define O_PIDFILE	0x9f
  	{ "PidFile",			O_PIDFILE,	FALSE	},
  #endif
  
  	{ NULL,				'\0',		FALSE	}
  };
--- 1481,1510 ----
  	{ "SingleThreadDelivery",	O_SINGTHREAD,	FALSE	},
  #define O_RUNASUSER	0x9d
  	{ "RunAsUser",			O_RUNASUSER,	FALSE	},
! #if _FFR_DSN_RRT_OPTION
  #define O_DSN_RRT	0x9e
  	{ "RrtImpliesDsn",		O_DSN_RRT,	FALSE	},
  #endif
! #if _FFR_PIDFILE_OPTION
  #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
+ 	{ "DontProbeInterfaces",	O_DPI,		FALSE	},
+ #endif
+ #if _FFR_MAXRCPT_OPTION
+ #define O_MAXRCPT	0xa3
+ 	{ "MaxRecipientPerMessage",	O_MAXRCPT,	FALSE	},
+ #endif
  
  	{ NULL,				'\0',		FALSE	}
  };
***************
*** 1575,1583 ****
  		}
  		if (strlen(val) != strlen(o->o_name))
  		{
! 			bool oldVerbose = Verbose;
  
! 			Verbose = TRUE;
  			message("Option %s used as abbreviation for %s",
  				val, o->o_name);
  			Verbose = oldVerbose;
--- 1590,1598 ----
  		}
  		if (strlen(val) != strlen(o->o_name))
  		{
! 			int oldVerbose = Verbose;
  
! 			Verbose = 1;
  			message("Option %s used as abbreviation for %s",
  				val, o->o_name);
  			Verbose = oldVerbose;
***************
*** 2061,2067 ****
  		break;
  
  	  case 'v':		/* run in verbose mode */
! 		Verbose = atobool(val);
  		break;
  
  	  case 'w':		/* if we are best MX, try host directly */
--- 2076,2082 ----
  		break;
  
  	  case 'v':		/* run in verbose mode */
! 		Verbose = atobool(val) ? 1 : 0;
  		break;
  
  	  case 'w':		/* if we are best MX, try host directly */
***************
*** 2251,2256 ****
--- 2266,2273 ----
  				syserr("readcf: option RunAsUser: unknown user %s", val);
  			else
  			{
+ 				if (*p == '\0')
+ 					RunAsUserName = newstr(val);
  				RunAsUid = pw->pw_uid;
  				RunAsGid = pw->pw_gid;
  			}
***************
*** 2258,2264 ****
  		if (*p == '\0')
  			break;
  		if (isascii(*p) && isdigit(*p))
! 			DefGid = atoi(p);
  		else
  		{
  			register struct group *gr;
--- 2275,2281 ----
  		if (*p == '\0')
  			break;
  		if (isascii(*p) && isdigit(*p))
! 			RunAsGid = atoi(p);
  		else
  		{
  			register struct group *gr;
***************
*** 2272,2287 ****
  		}
  		break;
  
! #ifdef _FFR_DSN_RRT
  	  case O_DSN_RRT:
! 		RrtImpliesDsn = atobool(p);
  		break;
  #endif
  
! #ifdef _FFR_PIDFILE_OPT
  	  case O_PIDFILE:
  		free(PidFile);
! 		PidFile = newstr(p);
  		break;
  #endif
  
--- 2289,2328 ----
  		}
  		break;
  
! #if _FFR_DSN_RRT_OPTION
  	  case O_DSN_RRT:
! 		RrtImpliesDsn = atobool(val);
  		break;
  #endif
  
! #if _FFR_PIDFILE_OPTION
  	  case O_PIDFILE:
  		free(PidFile);
! 		PidFile = newstr(val);
! 		break;
! #endif
! 
! #if _FFR_WRITABLE_DIRECTORIES_ARE_FATAL_OPTION
! 	  case O_WDAF:
! 		FatalWritableDirs = atobool(val);
! 		break;
! #endif
! 
! #if _FFR_CHOWN_IS_ALWAYS_SAFE_OPTION
! 	  case O_CIAS:
! 		ChownIsAlwaysSafe = atobool(val);
! 		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
  
diff -Ncr sendmail-8.8.5/src/recipient.c sendmail-8.8.6/src/recipient.c
*** sendmail-8.8.5/src/recipient.c	Sun Dec  1 18:16:23 1996
--- sendmail-8.8.6/src/recipient.c	Thu May 29 10:42:25 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)recipient.c	8.118 (Berkeley) 12/1/96";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)recipient.c	8.130 (Berkeley) 5/29/97";
  #endif /* not lint */
  
  # include "sendmail.h"
***************
*** 76,82 ****
  {
  	register char *p;
  	register ADDRESS *al;	/* list of addresses to send to */
- 	bool firstone;		/* set on first address sent */
  	char delimiter;		/* the address delimiter */
  	int naddrs;
  	int i;
--- 76,81 ----
***************
*** 105,111 ****
  	if (!bitset(EF_OLDSTYLE, e->e_flags) || ctladdr != NULL)
  		delimiter = ',';
  
- 	firstone = TRUE;
  	al = NULL;
  	naddrs = 0;
  
--- 104,109 ----
***************
*** 185,191 ****
  		}
  
  		al = a;
- 		firstone = FALSE;
  	}
  
  	/* arrange to send to everyone on the local send list */
--- 183,188 ----
***************
*** 303,310 ****
  		{
  			a->q_flags |= QBADADDR;
  			a->q_status = "5.7.1";
! 			usrerr("550 User %s@%s doesn't have a valid shell for mailing to programs",
! 				a->q_alias->q_ruser, MyHostName);
  		}
  		else if (bitset(QUNSAFEADDR, a->q_alias->q_flags))
  		{
--- 300,311 ----
  		{
  			a->q_flags |= QBADADDR;
  			a->q_status = "5.7.1";
! 			if (a->q_alias->q_ruser == NULL)
! 				usrerr("550 UID %d is an unknown user: cannot mail to programs",
! 					a->q_alias->q_uid);
! 			else
! 				usrerr("550 User %s@%s doesn't have a valid shell for mailing to programs",
! 					a->q_alias->q_ruser, MyHostName);
  		}
  		else if (bitset(QUNSAFEADDR, a->q_alias->q_flags))
  		{
***************
*** 378,390 ****
  			ret = include(a->q_user, FALSE, a, sendq, aliaslevel, e);
  			if (transienterror(ret))
  			{
- #ifdef LOG
  				if (LogLevel > 2)
! 					syslog(LOG_ERR, "%s: include %s: transient error: %s",
! 						e->e_id == NULL ? "NOQUEUE" : e->e_id,
  						shortenstring(a->q_user, 203),
  						errstring(ret));
- #endif
  				a->q_flags |= QQUEUEUP;
  				a->q_flags &= ~QDONTSEND;
  				usrerr("451 Cannot open %s: %s",
--- 379,389 ----
  			ret = include(a->q_user, FALSE, a, sendq, aliaslevel, e);
  			if (transienterror(ret))
  			{
  				if (LogLevel > 2)
! 					sm_syslog(LOG_ERR, e->e_id,
! 						"include %s: transient error: %s",
  						shortenstring(a->q_user, 203),
  						errstring(ret));
  				a->q_flags |= QQUEUEUP;
  				a->q_flags &= ~QDONTSEND;
  				usrerr("451 Cannot open %s: %s",
***************
*** 416,423 ****
  		{
  			a->q_flags |= QBADADDR;
  			a->q_status = "5.7.1";
! 			usrerr("550 User %s@%s doesn't have a valid shell for mailing to files",
! 				a->q_alias->q_ruser, MyHostName);
  		}
  		else if (bitset(QUNSAFEADDR, a->q_alias->q_flags))
  		{
--- 415,426 ----
  		{
  			a->q_flags |= QBADADDR;
  			a->q_status = "5.7.1";
! 			if (a->q_alias->q_ruser == NULL)
! 				usrerr("550 UID %d is an unknown user: cannot mail to files",
! 					a->q_alias->q_uid);
! 			else
! 				usrerr("550 User %s@%s doesn't have a valid shell for mailing to files",
! 					a->q_alias->q_ruser, MyHostName);
  		}
  		else if (bitset(QUNSAFEADDR, a->q_alias->q_flags))
  		{
***************
*** 426,431 ****
--- 429,438 ----
  			usrerr("550 Address %s is unsafe for mailing to files",
  				a->q_alias->q_paddr);
  		}
+ 		else if (strcmp(buf, "/dev/null") == 0)
+ 		{
+ 			/* /dev/null is always accepted */
+ 		}
  		else if (!writable(buf, a->q_alias, SFF_CREAT))
  		{
  			a->q_flags |= QBADADDR;
***************
*** 451,462 ****
  			a->q_flags |= QQUEUEUP;
  			if (e->e_message == NULL)
  				e->e_message = newstr("Deferred: user database error");
- # ifdef LOG
  			if (LogLevel > 8)
! 				syslog(LOG_INFO, "%s: deferred: udbexpand: %s",
! 					e->e_id == NULL ? "NOQUEUE" : e->e_id,
  					errstring(errno));
- # endif
  			message("queued (user database error): %s",
  				errstring(errno));
  			e->e_nrcpts++;
--- 458,467 ----
  			a->q_flags |= QQUEUEUP;
  			if (e->e_message == NULL)
  				e->e_message = newstr("Deferred: user database error");
  			if (LogLevel > 8)
! 				sm_syslog(LOG_INFO, e->e_id,
! 					"deferred: udbexpand: %s",
  					errstring(errno));
  			message("queued (user database error): %s",
  				errstring(errno));
  			e->e_nrcpts++;
***************
*** 808,814 ****
  	**  File does exist -- check that it is writable.
  	*/
  
! 	if (ctladdr != NULL && geteuid() == 0)
  	{
  		euid = ctladdr->q_uid;
  		egid = ctladdr->q_gid;
--- 813,825 ----
  	**  File does exist -- check that it is writable.
  	*/
  
! 	if (geteuid() != 0)
! 	{
! 		euid = geteuid();
! 		egid = getegid();
! 		uname = NULL;
! 	}
! 	else if (ctladdr != NULL)
  	{
  		euid = ctladdr->q_uid;
  		egid = ctladdr->q_gid;
***************
*** 844,849 ****
--- 855,861 ----
  	if (geteuid() == 0 &&
  	    (ctladdr == NULL || !bitset(QGOODUID, ctladdr->q_flags)))
  		flags |= SFF_SETUIDOK;
+ 	flags |= SFF_NOLINK;
  
  	errno = safefile(filename, euid, egid, uname, flags, S_IWRITE, NULL);
  	return errno == 0;
***************
*** 908,932 ****
  	char *volatile uname;
  	int rval = 0;
  	volatile int sfflags = SFF_REGONLY;
  	struct stat st;
  	char buf[MAXLINE];
- #ifdef _POSIX_CHOWN_RESTRICTED
- # if _POSIX_CHOWN_RESTRICTED == -1
- #  define safechown	FALSE
- # else
- #  define safechown	TRUE
- # endif
- #else
- # ifdef _PC_CHOWN_RESTRICTED
- 	bool safechown;
- # else
- #  ifdef BSD
- #   define safechown	TRUE
- #  else
- #   define safechown	FALSE
- #  endif
- # endif
- #endif
  	extern bool chownsafe();
  
  	if (tTd(27, 2))
--- 920,930 ----
  	char *volatile uname;
  	int rval = 0;
  	volatile int sfflags = SFF_REGONLY;
+ 	register char *p;
+ 	bool safechown = FALSE;
+ 	bool safedir = FALSE;
  	struct stat st;
  	char buf[MAXLINE];
  	extern bool chownsafe();
  
  	if (tTd(27, 2))
***************
*** 1000,1006 ****
  		errno = 0;
  
  		/* return pseudo-error code */
! 		rval = EOPENTIMEOUT;
  		goto resetuid;
  	}
  	if (TimeOuts.to_fileopen > 0)
--- 998,1004 ----
  		errno = 0;
  
  		/* return pseudo-error code */
! 		rval = E_SM_OPENTIMEOUT;
  		goto resetuid;
  	}
  	if (TimeOuts.to_fileopen > 0)
***************
*** 1008,1015 ****
  	else
  		ev = NULL;
  
! 	/* the input file must be marked safe */
! 	rval = safefile(fname, uid, gid, uname, sfflags, S_IREAD, NULL);
  	if (rval != 0)
  	{
  		/* don't use this :include: file */
--- 1006,1030 ----
  	else
  		ev = NULL;
  
! 	/* check for writable parent directory */
! 	p = strrchr(fname, '/');
! 	if (p != NULL)
! 	{
! 		*p = '\0';
! 		if (safedirpath(fname, uid, gid, uname, sfflags|SFF_SAFEDIRPATH) == 0)
! 		{
! 			/* in safe directory: relax chown & link rules */
! 			safedir = TRUE;
! 			sfflags |= SFF_NOPATHCHECK;
! 		}
! 		*p = '/';
! 	}
! 
! 	/* allow links only in unwritable directories */
! 	if (!safedir)
! 		sfflags |= SFF_NOLINK;
! 
! 	rval = safefile(fname, uid, gid, uname, sfflags, S_IREAD, &st);
  	if (rval != 0)
  	{
  		/* don't use this :include: file */
***************
*** 1017,1031 ****
  			printf("include: not safe (uid=%d): %s\n",
  				(int) uid, errstring(rval));
  	}
! 	else
  	{
! 		fp = fopen(fname, "r");
! 		if (fp == NULL)
! 		{
! 			rval = errno;
! 			if (tTd(27, 4))
! 				printf("include: open: %s\n", errstring(rval));
! 		}
  	}
  	if (ev != NULL)
  		clrevent(ev);
--- 1032,1048 ----
  			printf("include: not safe (uid=%d): %s\n",
  				(int) uid, errstring(rval));
  	}
! 	else if ((fp = fopen(fname, "r")) == NULL)
  	{
! 		rval = errno;
! 		if (tTd(27, 4))
! 			printf("include: open: %s\n", errstring(rval));
! 	}
! 	else if (filechanged(fname, fileno(fp), &st, sfflags))
! 	{
! 		rval = E_SM_FILECHANGE;
! 		if (tTd(27, 4))
! 			printf("include: file changed after open\n");
  	}
  	if (ev != NULL)
  		clrevent(ev);
***************
*** 1058,1064 ****
  		printf("include: reset uid = %d/%d\n",
  		       (int) getuid(), (int) geteuid());
  
! 	if (rval == EOPENTIMEOUT)
  		usrerr("451 open timeout on %s", fname);
  
  	if (fp == NULL)
--- 1075,1081 ----
  		printf("include: reset uid = %d/%d\n",
  		       (int) getuid(), (int) geteuid());
  
! 	if (rval == E_SM_OPENTIMEOUT)
  		usrerr("451 open timeout on %s", fname);
  
  	if (fp == NULL)
***************
*** 1071,1079 ****
  		return rval;
  	}
  
! #ifndef safechown
! 	safechown = chownsafe(fileno(fp));
! #endif
  	if (ca == NULL && safechown)
  	{
  		ctladdr->q_uid = st.st_uid;
--- 1088,1101 ----
  		return rval;
  	}
  
! 	/* if path was writable, check to avoid file giveaway tricks */
! 	safechown = chownsafe(fileno(fp), safedir);
! 	if (tTd(27, 6))
! 		printf("include: parent of %s is %s, chown is %ssafe\n",
! 			fname,
! 			safedir ? "safe" : "dangerous",
! 			safechown ? "" : "un");
! 
  	if (ca == NULL && safechown)
  	{
  		ctladdr->q_uid = st.st_uid;
***************
*** 1104,1116 ****
  				sh = "/SENDMAIL/ANY/SHELL/";
  			if (!usershellok(pw->pw_name, sh))
  			{
- #ifdef LOG
  				if (LogLevel >= 12)
! 					syslog(LOG_INFO, "%s: user %s has bad shell %s, marked %s",
  						shortenstring(fname, 203),
  						pw->pw_name, sh,
  						safechown ? "bogus" : "unsafe");
- #endif
  				if (safechown)
  					ctladdr->q_flags |= QBOGUSSHELL;
  				else
--- 1126,1137 ----
  				sh = "/SENDMAIL/ANY/SHELL/";
  			if (!usershellok(pw->pw_name, sh))
  			{
  				if (LogLevel >= 12)
! 					sm_syslog(LOG_INFO, e->e_id,
! 						"%s: user %s has bad shell %s, marked %s",
  						shortenstring(fname, 203),
  						pw->pw_name, sh,
  						safechown ? "bogus" : "unsafe");
  				if (safechown)
  					ctladdr->q_flags |= QBOGUSSHELL;
  				else
***************
*** 1141,1153 ****
  
  	if (bitset(S_IWOTH | (UnsafeGroupWrites ? S_IWGRP : 0), st.st_mode))
  	{
- #ifdef LOG
  		if (LogLevel >= 12)
! 			syslog(LOG_INFO, "%s: %s writable %s file, marked unsafe",
  				shortenstring(fname, 203),
  				bitset(S_IWOTH, st.st_mode) ? "world" : "group",
  				forwarding ? "forward" : ":include:");
- #endif
  		ctladdr->q_flags |= QUNSAFEADDR;
  	}
  
--- 1162,1173 ----
  
  	if (bitset(S_IWOTH | (UnsafeGroupWrites ? S_IWGRP : 0), st.st_mode))
  	{
  		if (LogLevel >= 12)
! 			sm_syslog(LOG_INFO, e->e_id,
! 				"%s: %s writable %s file, marked unsafe",
  				shortenstring(fname, 203),
  				bitset(S_IWOTH, st.st_mode) ? "world" : "group",
  				forwarding ? "forward" : ":include:");
  		ctladdr->q_flags |= QUNSAFEADDR;
  	}
  
***************
*** 1184,1195 ****
  		e->e_to = NULL;
  		message("%s to %s",
  			forwarding ? "forwarding" : "sending", buf);
- #ifdef LOG
  		if (forwarding && LogLevel > 9)
! 			syslog(LOG_INFO, "%s: forward %.200s => %s",
! 				e->e_id == NULL ? "NOQUEUE" : e->e_id,
  				oldto, shortenstring(buf, 203));
- #endif
  
  		nincludes += sendtolist(buf, ctladdr, sendq, aliaslevel + 1, e);
  	}
--- 1204,1213 ----
  		e->e_to = NULL;
  		message("%s to %s",
  			forwarding ? "forwarding" : "sending", buf);
  		if (forwarding && LogLevel > 9)
! 			sm_syslog(LOG_INFO, e->e_id,
! 				"forward %.200s => %s",
  				oldto, shortenstring(buf, 203));
  
  		nincludes += sendtolist(buf, ctladdr, sendq, aliaslevel + 1, e);
  	}
diff -Ncr sendmail-8.8.5/src/safefile.c sendmail-8.8.6/src/safefile.c
*** sendmail-8.8.5/src/safefile.c	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/src/safefile.c	Sat Jun 14 08:21:21 1997
***************
*** 0 ****
--- 1,686 ----
+ /*
+  * Copyright (c) 1983, 1995-1997 Eric P. Allman
+  * 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.
+  */
+ 
+ #ifndef lint
+ static char sccsid[] = "@(#)safefile.c	8.12 (Berkeley) 6/14/97";
+ #endif /* not lint */
+ 
+ # include "sendmail.h"
+ /*
+ **  SAFEFILE -- return true if a file exists and is safe for a user.
+ **
+ **	Parameters:
+ **		fn -- filename to check.
+ **		uid -- user id to compare against.
+ **		gid -- group id to compare against.
+ **		uname -- user name to compare against (used for group
+ **			sets).
+ **		flags -- modifiers:
+ **			SFF_MUSTOWN -- "uid" must own this file.
+ **			SFF_NOSLINK -- file cannot be a symbolic link.
+ **		mode -- mode bits that must match.
+ **		st -- if set, points to a stat structure that will
+ **			get the stat info for the file.
+ **
+ **	Returns:
+ **		0 if fn exists, is owned by uid, and matches mode.
+ **		An errno otherwise.  The actual errno is cleared.
+ **
+ **	Side Effects:
+ **		none.
+ */
+ 
+ #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;
+ 	UID_T uid;
+ 	GID_T gid;
+ 	char *uname;
+ 	int flags;
+ 	int mode;
+ 	struct stat *st;
+ {
+ 	register char *p;
+ 	register struct group *gr = NULL;
+ 	int file_errno = 0;
+ 	bool checkpath;
+ 	struct stat stbuf;
+ 	struct stat fstbuf;
+ 	char fbuf[MAXPATHLEN + 1];
+ 
+ 	if (tTd(44, 4))
+ 		printf("safefile(%s, uid=%d, gid=%d, flags=%x, mode=%o):\n",
+ 			fn, (int) uid, (int) gid, flags, mode);
+ 	errno = 0;
+ 	if (st == NULL)
+ 		st = &fstbuf;
+ 	if (strlen(fn) > sizeof fbuf - 1)
+ 	{
+ 		if (tTd(44, 4))
+ 			printf("\tpathname too long\n");
+ 		return ENAMETOOLONG;
+ 	}
+ 	strcpy(fbuf, fn);
+ 	fn = fbuf;
+ 
+ 	/* first check to see if the file exists at all */
+ #ifdef HASLSTAT
+ 	if ((bitset(SFF_NOSLINK, flags) ? lstat(fn, st)
+ 					: stat(fn, st)) < 0)
+ #else
+ 	if (stat(fn, st) < 0)
+ #endif
+ 	{
+ 		file_errno = errno;
+ 	}
+ 	else if (bitset(SFF_SETUIDOK, flags) &&
+ 		 !bitset(S_IXUSR|S_IXGRP|S_IXOTH, st->st_mode) &&
+ 		 S_ISREG(st->st_mode))
+ 	{
+ 		/*
+ 		**  If final file is setuid, run as the owner of that
+ 		**  file.  Gotta be careful not to reveal anything too
+ 		**  soon here!
+ 		*/
+ 
+ #ifdef SUID_ROOT_FILES_OK
+ 		if (bitset(S_ISUID, st->st_mode))
+ #else
+ 		if (bitset(S_ISUID, st->st_mode) && st->st_uid != 0)
+ #endif
+ 		{
+ 			uid = st->st_uid;
+ 			uname = NULL;
+ 		}
+ #ifdef SUID_ROOT_FILES_OK
+ 		if (bitset(S_ISGID, st->st_mode))
+ #else
+ 		if (bitset(S_ISGID, st->st_mode) && st->st_gid != 0)
+ #endif
+ 			gid = st->st_gid;
+ 	}
+ 
+ 	checkpath = !bitset(SFF_NOPATHCHECK, flags) ||
+ 		    (uid == 0 && !bitset(SFF_ROOTOK|SFF_OPENASROOT, flags));
+ 	if (bitset(SFF_NOWLINK, flags) && !bitset(SFF_SAFEDIRPATH, flags))
+ 	{
+ 		int ret;
+ 
+ 		/* check the directory */
+ 		p = strrchr(fn, '/');
+ 		if (p == NULL)
+ 		{
+ 			ret = safedirpath(".", uid, gid, uname, flags|SFF_SAFEDIRPATH);
+ 		}
+ 		else
+ 		{
+ 			*p = '\0';
+ 			ret = safedirpath(fn, uid, gid, uname, flags|SFF_SAFEDIRPATH);
+ 			*p = '/';
+ 		}
+ 		if (ret == 0)
+ 		{
+ 			/* directory is safe */
+ 			checkpath = FALSE;
+ 		}
+ 		else
+ 		{
+ 			/* directory is writable: disallow links */
+ 			flags |= SFF_NOLINK;
+ 		}
+ 	}
+ 
+ 	if (checkpath)
+ 	{
+ 		int ret;
+ 
+ 		p = strrchr(fn, '/');
+ 		if (p == NULL)
+ 		{
+ 			ret = safedirpath(".", uid, gid, uname, flags);
+ 		}
+ 		else
+ 		{
+ 			*p = '\0';
+ 			ret = safedirpath(fn, uid, gid, uname, flags);
+ 			*p = '/';
+ 		}
+ 		if (ret != 0)
+ 			return ret;
+ 	}
+ 
+ 	/*
+ 	**  If the target file doesn't exist, check the directory to
+ 	**  ensure that it is writable by this user.
+ 	*/
+ 
+ 	if (file_errno != 0)
+ 	{
+ 		int ret = file_errno;
+ 		char *dir = fn;
+ 
+ 		if (tTd(44, 4))
+ 			printf("\t%s\n", errstring(ret));
+ 
+ 		errno = 0;
+ 		if (!bitset(SFF_CREAT, flags) || file_errno != ENOENT)
+ 			return ret;
+ 
+ 		/* check to see if legal to create the file */
+ 		p = strrchr(dir, '/');
+ 		if (p == NULL)
+ 			dir = ".";
+ 		else if (p == dir)
+ 			dir = "/";
+ 		else
+ 			*p = '\0';
+ 		if (stat(dir, &stbuf) >= 0)
+ 		{
+ 			int md = S_IWRITE|S_IEXEC;
+ 			if (stbuf.st_uid != uid)
+ 				md >>= 6;
+ 			if ((stbuf.st_mode & md) != md)
+ 				errno = EACCES;
+ 		}
+ 		ret = errno;
+ 		if (tTd(44, 4))
+ 			printf("\t[final dir %s uid %d mode %lo] %s\n",
+ 				dir, (int) stbuf.st_uid, (u_long) stbuf.st_mode,
+ 				errstring(ret));
+ 		if (p != NULL)
+ 			*p = '/';
+ 		st->st_mode = ST_MODE_NOFILE;
+ 		return ret;
+ 	}
+ 
+ #ifdef S_ISLNK
+ 	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);
+ 		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);
+ 		return E_SM_REGONLY;
+ 	}
+ 	if (bitset(SFF_NOWFILES, flags) &&
+ 	    bitset(S_IWOTH | (UnsafeGroupWrites ? S_IWGRP : 0), 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;
+ 	}
+ 	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);
+ 		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);
+ 		return E_SM_NOHLINK;
+ 	}
+ 
+ 	if (uid == 0 && bitset(SFF_OPENASROOT, flags))
+ 		;
+ 	else if (uid == 0 && !bitset(SFF_ROOTOK, flags))
+ 		mode >>= 6;
+ 	else if (st->st_uid != uid)
+ 	{
+ 		mode >>= 3;
+ 		if (st->st_gid == gid)
+ 			;
+ #ifndef NO_GROUP_SET
+ 		else if (uname != NULL && !DontInitGroups &&
+ 			 ((gr != NULL && gr->gr_gid == st->st_gid) ||
+ 			  (gr = getgrgid(st->st_gid)) != NULL))
+ 		{
+ 			register char **gp;
+ 
+ 			for (gp = gr->gr_mem; *gp != NULL; gp++)
+ 				if (strcmp(*gp, uname) == 0)
+ 					break;
+ 			if (*gp == NULL)
+ 				mode >>= 3;
+ 		}
+ #endif
+ 		else
+ 			mode >>= 3;
+ 	}
+ 	if (tTd(44, 4))
+ 		printf("\t[uid %d, nlink %d, stat %lo, mode %lo] ",
+ 			(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 ||
+ 	     !bitset(SFF_MUSTOWN, flags)) &&
+ 	    (st->st_mode & mode) == mode)
+ 	{
+ 		if (tTd(44, 4))
+ 			printf("\tOK\n");
+ 		return 0;
+ 	}
+ 	if (tTd(44, 4))
+ 		printf("\tEACCES\n");
+ 	return EACCES;
+ }
+ /*
+ **  SAFEDIRPATH -- check to make sure a path to a directory is safe
+ **
+ **	Safe means not writable and owned by the right folks.
+ **
+ **	Parameters:
+ **		fn -- filename to check.
+ **		uid -- user id to compare against.
+ **		gid -- group id to compare against.
+ **		uname -- user name to compare against (used for group
+ **			sets).
+ **		flags -- modifiers:
+ **			SFF_ROOTOK -- ok to use root permissions to open.
+ **			SFF_SAFEDIRPATH -- writable directories are considered
+ **				to be fatal errors.
+ **
+ **	Returns:
+ **		0 -- if the directory path is "safe".
+ **		else -- an error number associated with the path.
+ */
+ 
+ int
+ safedirpath(fn, uid, gid, uname, flags)
+ 	char *fn;
+ 	UID_T uid;
+ 	GID_T gid;
+ 	char *uname;
+ 	int flags;
+ {
+ 	char *p;
+ 	register struct group *gr = NULL;
+ 	int ret = 0;
+ 	struct stat stbuf;
+ 
+ 	/* special case root directory */
+ 	if (*fn == '\0')
+ 		fn = "/";
+ 
+ 	if (tTd(44, 4))
+ 		printf("safedirpath(%s, uid=%ld, gid=%ld, flags=%x):\n",
+ 			fn, (long) uid, (long) gid, flags);
+ 
+ 	p = fn;
+ 	do
+ 	{
+ 		if (*p == '\0')
+ 			*p = '/';
+ 		p = strchr(++p, '/');
+ 		if (p != NULL)
+ 			*p = '\0';
+ 		if (stat(fn, &stbuf) < 0)
+ 		{
+ 			ret = errno;
+ 			break;
+ 		}
+ 		if ((uid == 0 || bitset(SFF_SAFEDIRPATH, flags)) &&
+ 		    bitset(S_IWGRP|S_IWOTH, stbuf.st_mode))
+ 		{
+ 			if (tTd(44, 4))
+ 				printf("\t[dir %s] mode %o\n",
+ 					fn, stbuf.st_mode);
+ 			if (bitset(SFF_SAFEDIRPATH, flags))
+ 			{
+ 				if (bitset(S_IWOTH, stbuf.st_mode))
+ 					ret = E_SM_WWDIR;
+ 				else
+ 					ret = E_SM_GWDIR;
+ 				break;
+ 			}
+ 			if (Verbose > 1)
+ 				message("051 WARNING: writable directory %s", fn);
+ 		}
+ 		if (uid == 0 && !bitset(SFF_ROOTOK|SFF_OPENASROOT, flags))
+ 		{
+ 			if (bitset(S_IXOTH, stbuf.st_mode))
+ 				continue;
+ 			ret = EACCES;
+ 			break;
+ 		}
+ 		if (stbuf.st_uid == uid &&
+ 		    bitset(S_IXUSR, stbuf.st_mode))
+ 			continue;
+ 		if (stbuf.st_gid == gid &&
+ 		    bitset(S_IXGRP, stbuf.st_mode))
+ 			continue;
+ #ifndef NO_GROUP_SET
+ 		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 != NULL; gp++)
+ 				if (strcmp(*gp, uname) == 0)
+ 					break;
+ 			if (gp != NULL && *gp != NULL &&
+ 			    bitset(S_IXGRP, stbuf.st_mode))
+ 				continue;
+ 		}
+ #endif
+ 		if (!bitset(S_IXOTH, stbuf.st_mode))
+ 		{
+ 			ret = EACCES;
+ 			break;
+ 		}
+ 	} while (p != NULL);
+ 	if (ret != 0 && tTd(44, 4))
+ 		printf("\t[dir %s] %s\n", fn, errstring(ret));
+ 	if (p != NULL)
+ 		*p = '/';
+ 	return ret;
+ }
+ /*
+ **  SAFEOPEN -- do a file open with extra checking
+ **
+ **	Parameters:
+ **		fn -- the file name to open.
+ **		omode -- the open-style mode flags.
+ **		cmode -- the create-style mode flags.
+ **		sff -- safefile flags.
+ **
+ **	Returns:
+ **		Same as open.
+ */
+ 
+ #ifndef O_ACCMODE
+ # define O_ACCMODE	(O_RDONLY|O_WRONLY|O_RDWR)
+ #endif
+ 
+ int
+ safeopen(fn, omode, cmode, sff)
+ 	char *fn;
+ 	int omode;
+ 	int cmode;
+ 	int sff;
+ {
+ 	int rval;
+ 	int fd;
+ 	int smode;
+ 	struct stat stb;
+ 
+ 	if (bitset(O_CREAT, omode))
+ 		sff |= SFF_CREAT;
+ 	smode = 0;
+ 	switch (omode & O_ACCMODE)
+ 	{
+ 	  case O_RDONLY:
+ 		smode = S_IREAD;
+ 		break;
+ 
+ 	  case O_WRONLY:
+ 		smode = S_IWRITE;
+ 		break;
+ 
+ 	  case O_RDWR:
+ 		smode = S_IREAD|S_IWRITE;
+ 		break;
+ 
+ 	  default:
+ 		smode = 0;
+ 		break;
+ 	}
+ 	if (bitset(SFF_OPENASROOT, sff))
+ 		rval = safefile(fn, RunAsUid, RunAsGid, RunAsUserName,
+ 				sff, smode, &stb);
+ 	else
+ 		rval = safefile(fn, RealUid, RealGid, RealUserName,
+ 				sff, smode, &stb);
+ 	if (rval != 0)
+ 	{
+ 		errno = rval;
+ 		return -1;
+ 	}
+ 	if (stb.st_mode == ST_MODE_NOFILE)
+ 		omode |= O_EXCL;
+ 
+ 	fd = dfopen(fn, omode, cmode, sff);
+ 	if (fd < 0)
+ 		return fd;
+ 	if (filechanged(fn, fd, &stb, sff))
+ 	{
+ 		syserr("554 cannot open: file %s changed after open", fn);
+ 		close(fd);
+ 		errno = E_SM_FILECHANGE;
+ 		return -1;
+ 	}
+ 	return fd;
+ }
+ /*
+ **  SAFEFOPEN -- do a file open with extra checking
+ **
+ **	Parameters:
+ **		fn -- the file name to open.
+ **		omode -- the open-style mode flags.
+ **		cmode -- the create-style mode flags.
+ **		sff -- safefile flags.
+ **
+ **	Returns:
+ **		Same as fopen.
+ */
+ 
+ FILE *
+ safefopen(fn, omode, cmode, sff)
+ 	char *fn;
+ 	int omode;
+ 	int cmode;
+ 	int sff;
+ {
+ 	int fd;
+ 	FILE *fp;
+ 	char *fmode;
+ 
+ 	switch (omode & O_ACCMODE)
+ 	{
+ 	  case O_RDONLY:
+ 		fmode = "r";
+ 		break;
+ 
+ 	  case O_WRONLY:
+ 		if (bitset(O_APPEND, omode))
+ 			fmode = "a";
+ 		else
+ 			fmode = "w";
+ 		break;
+ 
+ 	  case O_RDWR:
+ 		if (bitset(O_TRUNC, omode))
+ 			fmode = "w+";
+ 		else if (bitset(O_APPEND, omode))
+ 			fmode = "a+";
+ 		else
+ 			fmode = "r+";
+ 		break;
+ 
+ 	  default:
+ 		syserr("safefopen: unknown omode %o", omode);
+ 		fmode = "x";
+ 	}
+ 	fd = safeopen(fn, omode, cmode, sff);
+ 	if (fd < 0)
+ 		return NULL;
+ 	fp = fdopen(fd, fmode);
+ 	if (fp != NULL)
+ 		return fp;
+ 	(void) close(fd);
+ 	return NULL;
+ }
+ /*
+ **  FILECHANGED -- check to see if file changed after being opened
+ **
+ **	Parameters:
+ **		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.
+ **		FALSE -- if this file is still the same.
+ */
+ 
+ bool
+ filechanged(fn, fd, stb, sff)
+ 	char *fn;
+ 	int fd;
+ 	struct stat *stb;
+ 	int sff;
+ {
+ 	struct stat sta;
+ 
+ 	if (stb->st_mode == ST_MODE_NOFILE)
+ 	{
+ #if HASLSTAT && BOGUS_O_EXCL
+ 		/* only necessary if exclusive open follows symbolic links */
+ 		if (lstat(fn, stb) < 0 || stb->st_nlink != 1)
+ 			return TRUE;
+ #else
+ 		return FALSE;
+ #endif
+ 	}
+ 	if (fstat(fd, &sta) < 0)
+ 		return TRUE;
+ 
+ 	if (sta.st_nlink != stb->st_nlink ||
+ 	    sta.st_dev != stb->st_dev ||
+ 	    sta.st_ino != stb->st_ino ||
+ 	    sta.st_uid != stb->st_uid ||
+ 	    sta.st_gid != stb->st_gid)
+ 	{
+ 		if (tTd(44, 8))
+ 		{
+ 			printf("File changed after opening:\n");
+ 			printf(" nlink	= %ld/%ld\n",
+ 				(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);
+ 			printf(" uid	= %ld/%ld\n",
+ 				(long) stb->st_uid, (long) sta.st_uid);
+ 			printf(" gid	= %ld/%ld\n",
+ 				(long) stb->st_gid, (long) sta.st_gid);
+ 		}
+ 		return TRUE;
+ 	}
+ 
+ 	return FALSE;
+ }
+ /*
+ **  DFOPEN -- determined file open
+ **
+ **	This routine has the semantics of open, except that it will
+ **	keep trying a few times to make this happen.  The idea is that
+ **	on very loaded systems, we may run out of resources (inodes,
+ **	whatever), so this tries to get around it.
+ */
+ 
+ int
+ dfopen(filename, omode, cmode, sff)
+ 	char *filename;
+ 	int omode;
+ 	int cmode;
+ 	int sff;
+ {
+ 	register int tries;
+ 	int fd;
+ 	struct stat st;
+ 
+ 	for (tries = 0; tries < 10; tries++)
+ 	{
+ 		sleep((unsigned) (10 * tries));
+ 		errno = 0;
+ 		fd = open(filename, omode, cmode);
+ 		if (fd >= 0)
+ 			break;
+ 		switch (errno)
+ 		{
+ 		  case ENFILE:		/* system file table full */
+ 		  case EINTR:		/* interrupted syscall */
+ #ifdef ETXTBSY
+ 		  case ETXTBSY:		/* Apollo: net file locked */
+ #endif
+ 			continue;
+ 		}
+ 		break;
+ 	}
+ 	if (!bitset(SFF_NOLOCK, sff) &&
+ 	    fd >= 0 &&
+ 	    fstat(fd, &st) >= 0 &&
+ 	    S_ISREG(st.st_mode))
+ 	{
+ 		int locktype;
+ 
+ 		/* lock the file to avoid accidental conflicts */
+ 		if ((omode & O_ACCMODE) != O_RDONLY)
+ 			locktype = LOCK_EX;
+ 		else
+ 			locktype = LOCK_SH;
+ 		(void) lockfile(fd, filename, NULL, locktype);
+ 		errno = 0;
+ 	}
+ 	return fd;
+ }
diff -Ncr sendmail-8.8.5/src/savemail.c sendmail-8.8.6/src/savemail.c
*** sendmail-8.8.5/src/savemail.c	Sat Jan 18 09:54:29 1997
--- sendmail-8.8.6/src/savemail.c	Mon Apr  7 14:41:14 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)savemail.c	8.103 (Berkeley) 1/18/97";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)savemail.c	8.110 (Berkeley) 4/7/97";
  #endif /* not lint */
  
  # include "sendmail.h"
***************
*** 349,361 ****
  			/* we have a home directory; write dead.letter */
  			define('z', p, e);
  			expand("\201z/dead.letter", buf, sizeof buf, e);
! 			flags = SFF_NOSLINK|SFF_CREAT|SFF_REGONLY|SFF_RUNASREALUID;
  			e->e_to = buf;
  			if (mailfile(buf, NULL, flags, e) == EX_OK)
  			{
! 				bool oldverb = Verbose;
  
! 				Verbose = TRUE;
  				message("Saved message in %s", buf);
  				Verbose = oldverb;
  				state = ESM_DONE;
--- 349,361 ----
  			/* 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;
  			e->e_to = buf;
  			if (mailfile(buf, NULL, flags, e) == EX_OK)
  			{
! 				int oldverb = Verbose;
  
! 				Verbose = 1;
  				message("Saved message in %s", buf);
  				Verbose = oldverb;
  				state = ESM_DONE;
***************
*** 383,389 ****
  
  			snprintf(buf, sizeof buf, "%sdead.letter", _PATH_VARTMP);
  
! 			flags = SFF_NOSLINK|SFF_CREAT|SFF_REGONLY|SFF_ROOTOK|SFF_OPENASROOT;
  			if (!writable(buf, NULL, flags) ||
  			    (fp = safefopen(buf, O_WRONLY|O_CREAT|O_APPEND,
  					    FileMode, flags)) == NULL)
--- 383,389 ----
  
  			snprintf(buf, sizeof buf, "%sdead.letter", _PATH_VARTMP);
  
! 			flags = SFF_NOLINK|SFF_CREAT|SFF_REGONLY|SFF_OPENASROOT|SFF_MUSTOWN;
  			if (!writable(buf, NULL, flags) ||
  			    (fp = safefopen(buf, O_WRONLY|O_CREAT|O_APPEND,
  					    FileMode, flags)) == NULL)
***************
*** 407,421 ****
  				state = ESM_PANIC;
  			else
  			{
! 				bool oldverb = Verbose;
  
! 				Verbose = TRUE;
  				message("Saved message in %s", buf);
  				Verbose = oldverb;
- #ifdef LOG
  				if (LogLevel > 3)
! 					syslog(LOG_NOTICE, "Saved message in %s", buf);
! #endif
  				state = ESM_DONE;
  			}
  			(void) xfclose(fp, "savemail", buf);
--- 407,421 ----
  				state = ESM_PANIC;
  			else
  			{
! 				int oldverb = Verbose;
  
! 				Verbose = 1;
  				message("Saved message in %s", buf);
  				Verbose = oldverb;
  				if (LogLevel > 3)
! 					sm_syslog(LOG_NOTICE, e->e_id,
! 						"Saved message in %s",
! 						buf);
  				state = ESM_DONE;
  			}
  			(void) xfclose(fp, "savemail", buf);
***************
*** 550,556 ****
  			addheader("To", q->q_paddr, &ee->e_header);
  	}
  
- # ifdef LOG
  	if (LogLevel > 5)
  	{
  		if (bitset(EF_RESPONSE|EF_WARNING, e->e_flags))
--- 550,555 ----
***************
*** 559,568 ****
  			p = "postmaster notify";
  		else
  			p = "DSN";
! 		syslog(LOG_INFO, "%s: %s: %s: %s",
! 			e->e_id, ee->e_id, p, shortenstring(msg, 203));
  	}
- # endif
  
  	if (SendMIMEErrors)
  	{
--- 558,567 ----
  			p = "postmaster notify";
  		else
  			p = "DSN";
! 		sm_syslog(LOG_INFO, e->e_id,
! 			"%s: %s: %s",
! 			ee->e_id, p, shortenstring(msg, 203));
  	}
  
  	if (SendMIMEErrors)
  	{
***************
*** 759,769 ****
  	{
  		if (*ErrMsgFile == '/')
  		{
! 			xfile = fopen(ErrMsgFile, "r");
  			if (xfile != NULL)
  			{
  				while (fgets(buf, sizeof buf, xfile) != NULL)
  				{
  					expand(buf, buf, sizeof buf, e);
  					putline(buf, mci);
  				}
--- 758,772 ----
  	{
  		if (*ErrMsgFile == '/')
  		{
! 			xfile = safefopen(ErrMsgFile, O_RDONLY, 0444,
! 					  SFF_ROOTOK|SFF_REGONLY);
  			if (xfile != NULL)
  			{
  				while (fgets(buf, sizeof buf, xfile) != NULL)
  				{
+ #if _FFR_BUG_FIX
+ 					translate_dollars(buf);
+ #endif
  					expand(buf, buf, sizeof buf, e);
  					putline(buf, mci);
  				}
***************
*** 1223,1229 ****
  		return "5.2.2";
  
  	  case 553:	/* Req action not taken: mailbox name not allowed */
! 		return "5.1.3";
  
  	  case 554:	/* Transaction failed */
  		return "5.0.0";
--- 1226,1232 ----
  		return "5.2.2";
  
  	  case 553:	/* Req action not taken: mailbox name not allowed */
! 		return "5.1.0";
  
  	  case 554:	/* Transaction failed */
  		return "5.0.0";
diff -Ncr sendmail-8.8.5/src/sendmail.0 sendmail-8.8.6/src/sendmail.0
*** sendmail-8.8.5/src/sendmail.0	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/src/sendmail.0	Fri Sep 20 09:57:39 1996
***************
*** 0 ****
--- 1,358 ----
+ SENDMAIL(8)               BSD System Manager's Manual              SENDMAIL(8)
+ 
+ NNAAMMEE
+      sseennddmmaaiill - an electronic mail transport agent
+ 
+ SSYYNNOOPPSSIISS
+      sseennddmmaaiill [_f_l_a_g_s] [_a_d_d_r_e_s_s _._._.]
+      nneewwaalliiaasseess
+      mmaaiillqq [--vv]
+ 
+ DDEESSCCRRIIPPTTIIOONN
+      SSeennddmmaaiill sends a message to one or more _r_e_c_i_p_i_e_n_t_s, routing the message
+      over whatever networks are necessary.  SSeennddmmaaiill does internetwork for-
+      warding as necessary to deliver the message to the correct place.
+ 
+      SSeennddmmaaiill is not intended as a user interface routine; other programs pro-
+      vide user-friendly front ends; sseennddmmaaiill is used only to deliver pre-
+      formatted messages.
+ 
+      With no flags, sseennddmmaaiill reads its standard input up to an end-of-file or
+      a line consisting only of a single dot and sends a copy of the message
+      found there to all of the addresses listed.  It determines the network(s)
+      to use based on the syntax and contents of the addresses.
+ 
+      Local addresses are looked up in a file and aliased appropriately.
+      Aliasing can be prevented by preceding the address with a backslash.
+      Normally the sender is not included in any alias expansions, e.g., if
+      `john' sends to `group', and `group' includes `john' in the expansion,
+      then the letter will not be delivered to `john'.
+ 
+    PPaarraammeetteerrss
+ 
+      --BB_t_y_p_e      Set the body type to _t_y_p_e. Current legal values 7BIT or
+                  8BITMIME.
+ 
+      --bbaa         Go into ARPANET mode.  All input lines must end with a CR-LF,
+                  and all messages will be generated with a CR-LF at the end.
+                  Also, the ``From:'' and ``Sender:'' fields are examined for
+                  the name of the sender.
+ 
+      --bbdd         Run as a daemon.  This requires Berkeley IPC. SSeennddmmaaiill will
+                  fork and run in background listening on socket 25 for incom-
+                  ing SMTP connections.  This is normally run from _/_e_t_c_/_r_c.
+ 
+      --bbDD         Same as --bbdd except runs in foreground.
+ 
+      --bbhh         Print the persistent host status database.
+ 
+      --bbHH         Purge the persistent host status database.
+ 
+      --bbii         Initialize the alias database.
+ 
+      --bbmm         Deliver mail in the usual way (default).
+ 
+      --bbpp         Print a listing of the queue.
+ 
+      --bbss         Use the SMTP protocol as described in RFC821 on standard in-
+                  put and output.  This flag implies all the operations of the
+                  --bbaa flag that are compatible with SMTP.
+ 
+      --bbtt         Run in address test mode.  This mode reads addresses and
+                  shows the steps in parsing; it is used for debugging configu-
+                  ration tables.
+ 
+      --bbvv         Verify names only - do not try to collect or deliver a mes-
+                  sage.  Verify mode is normally used for validating users or
+                  mailing lists.
+ 
+      --CC_f_i_l_e      Use alternate configuration file.  SSeennddmmaaiill refuses to run as
+                  root if an alternate configuration file is specified.
+ 
+      --dd_X         Set debugging value to _X.
+ 
+      --FF_f_u_l_l_n_a_m_e  Set the full name of the sender.
+ 
+      --ff_n_a_m_e      Sets the name of the ``from'' person (i.e., the sender of the
+                  mail).  --ff can only be used by ``trusted'' users (normally
+                  _r_o_o_t, _d_a_e_m_o_n, and _n_e_t_w_o_r_k) or if the person you are trying to
+                  become is the same as the person you are.
+ 
+      --hh_N         Set the hop count to _N. The hop count is incremented every
+                  time the mail is processed.  When it reaches a limit, the
+                  mail is returned with an error message, the victim of an
+                  aliasing loop.  If not specified, ``Received:'' lines in the
+                  message are counted.
+ 
+      --ii          Ignore dots alone on lines by themselves in incoming mes-
+                  sages.  This should be set if you are reading data from a
+                  file.
+ 
+      --NN _d_s_n      Set delivery status notification conditions to _d_s_n_, which can
+                  be `never' for no notifications or a comma separated list of
+                  the values `failure' to be notified if delivery failed,
+                  `delay' to be notified if delivery is delayed, and `success'
+                  to be notified when the message is successfully delivered.
+ 
+      --nn          Don't do aliasing.
+ 
+      --OO _o_p_t_i_o_n=_v_a_l_u_e
+                  Set option _o_p_t_i_o_n to the specified _v_a_l_u_e. This form uses long
+                  names.  See below for more details.
+ 
+      --oo_x _v_a_l_u_e   Set option _x to the specified _v_a_l_u_e. This form uses single
+                  character names only.  The short names are not described in
+                  this manual page; see the _S_e_n_d_m_a_i_l _I_n_s_t_a_l_l_a_t_i_o_n _a_n_d _O_p_e_r_a_t_i_o_n
+                  _G_u_i_d_e for details.
+ 
+      --pp_p_r_o_t_o_c_o_l  Set the name of the protocol used to receive the message.
+                  This can be a simple protocol name such as ``UUCP'' or a pro-
+                  tocol and hostname, such as ``UUCP:ucbvax''.
+ 
+      --qq[_t_i_m_e]    Processed saved messages in the queue at given intervals.  If
+                  _t_i_m_e is omitted, process the queue once.  Time is given as a
+                  tagged number, with `s' being seconds, `m' being minutes, `h'
+                  being hours, `d' being days, and `w' being weeks.  For exam-
+                  ple, `-q1h30m' or `-q90m' would both set the timeout to one
+                  hour thirty minutes.  If _t_i_m_e is specified, sseennddmmaaiill will run
+                  in background.  This option can be used safely with --bbdd.
+ 
+      --qqII_s_u_b_s_t_r   Limit processed jobs to those containing _s_u_b_s_t_r as a sub-
+                  string of the queue id.
+ 
+      --qqRR_s_u_b_s_t_r   Limit processed jobs to those containing _s_u_b_s_t_r as a sub-
+                  string of one of the recipients.
+ 
+      --qqSS_s_u_b_s_t_r   Limit processed jobs to those containing _s_u_b_s_t_r as a sub-
+                  string of the sender.
+ 
+      --RR _r_e_t_u_r_n   Set the amount of the message to be returned if the message
+                  bounces.  The _r_e_t_u_r_n parameter can be `full' to return the
+ 
+                  entire message or `hdrs' to return only the headers.
+ 
+      --rr_n_a_m_e      An alternate and obsolete form of the --ff flag.
+ 
+      --tt          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 _n_o_t receive
+                  copies even if listed in the message header.
+ 
+      --UU          Initial (user) submission.  This should _a_l_w_a_y_s be set when
+                  called from a user agent such as MMaaiill or eexxmmhh and _n_e_v_e_r be
+                  set when called by a network delivery agent such as rrmmaaiill.
+ 
+      --VV _e_n_v_i_d    Set the original envelope id.  This is propogated across SMTP
+                  to servers that support DSNs and is returned in DSN-compliant
+                  error messages.
+ 
+      --vv          Go into verbose mode.  Alias expansions will be announced,
+                  etc.
+ 
+      --XX _l_o_g_f_i_l_e  Log all traffic in and out of mailers in the indicated log
+                  file.  This should only be used as a last resort for debug-
+                  ging mailer bugs.  It will log a lot of data very quickly.
+ 
+    OOppttiioonnss
+      There are also a number of processing options that may be set.  Normally
+      these will only be used by a system administrator.  Options may be set
+      either on the command line using the --oo flag (for short names), the --OO
+      flag (for long names), or in the configuration file.  This is a partial
+      list limited to those options that are likely to be useful on the command
+      line and only shows the long names; for a complete list (and details),
+      consult the _S_e_n_d_m_a_i_l _I_n_s_t_a_l_l_a_t_i_o_n _a_n_d _O_p_e_r_a_t_i_o_n _G_u_i_d_e. The options are:
+ 
+      AliasFile=_f_i_l_e
+                  Use alternate alias file.
+ 
+      HoldExpensive
+                  On mailers that are considered ``expensive'' to connect to,
+                  don't initiate immediate connection.  This requires queueing.
+ 
+      CheckpointInterval=_N
+                  Checkpoint the queue file after every _N successful deliveries
+                  (default 10).  This avoids excessive duplicate deliveries
+                  when sending to long mailing lists interrupted by system
+                  crashes.
+ 
+      DeliveryMode=_x
+                  Set the delivery mode to _x. Delivery modes are `i' for inter-
+                  active (synchronous) delivery, `b' for background (asyn-
+                  chronous) delivery, `q' for queue only - i.e., actual deliv-
+                  ery is done the next time the queue is run, and `d' for de-
+                  ferred - the same as `q' except that database lookups (no-
+                  tably DNS and NIS lookups) are avoided.
+ 
+      ErrorMode=_x
+                  Set error processing to mode _x. Valid modes are `m' to mail
+                  back the error message, `w' to ``write'' back the error mes-
+                  sage (or mail it back if the sender is not logged in), `p' to
+                  print the errors on the terminal (default), `q' to throw away
+                  error messages (only exit status is returned), and `e' to do
+                  special processing for the BerkNet.  If the text of the mes-
+                  sage is not mailed back by modes `m' or `w' and if the sender
+                  is local to this machine, a copy of the message is appended
+ 
+ 
+                  to the file _d_e_a_d_._l_e_t_t_e_r in the sender's home directory.
+ 
+      SaveFromLine
+                  Save UNIX-style From lines at the front of messages.
+ 
+      MaxHopCount= _N
+                  The maximum number of times a message is allowed to ``hop''
+                  before we decide it is in a loop.
+ 
+      IgnoreDots  Do not take dots on a line by themselves as a message termi-
+                  nator.
+ 
+      SendMimeErrors
+                  Send error messages in MIME format.  If not set, the DSN (De-
+                  livery Status Notification) SMTP extension is disabled.
+ 
+      ConnectionCacheTimeout=_t_i_m_e_o_u_t
+                  Set connection cache timeout.
+ 
+      ConnectionCacheSize=_N
+                  Set connection cache size.
+ 
+      LogLevel=_n  The log level.
+ 
+      MeToo       Send to ``me'' (the sender) also if I am in an alias expan-
+                  sion.
+ 
+      CheckAliases
+                  Validate the right hand side of aliases during a newalias-
+                  es(1) command.
+ 
+      OldStyleHeaders
+                  If set, this message may have old style headers.  If not set,
+                  this message is guaranteed to have new style headers (i.e.,
+                  commas instead of spaces between addresses).  If set, an
+                  adaptive algorithm is used that will correctly determine the
+                  header format in most cases.
+ 
+      QueueDirectory=_q_u_e_u_e_d_i_r
+                  Select the directory in which to queue messages.
+ 
+      StatusFile=_f_i_l_e
+                  Save statistics in the named file.
+ 
+      Timeout.queuereturn=_t_i_m_e
+                  Set the timeout on undelivered messages in the queue to the
+                  specified time.  After delivery has failed (e.g., because of
+                  a host being down) for this amount of time, failed messages
+                  will be returned to the sender.  The default is five days.
+ 
+      UserDatabaseSpec=_u_s_e_r_d_a_t_a_b_a_s_e
+                  If set, a user database is consulted to get forwarding infor-
+                  mation.  You can consider this an adjunct to the aliasing
+                  mechanism, except that the database is intended to be dis-
+                  tributed; aliases are local to a particular host.  This may
+                  not be available if your sendmail does not have the USERDB
+                  option compiled in.
+ 
+      ForkEachJob
+                  Fork each job during queue runs.  May be convenient on memo-
+                  ry-poor machines.
+ 
+      SevenBitInput
+                  Strip incoming messages to seven bits.
+ 
+      EightBitMode=_m_o_d_e
+                  Set the handling of eight bit input to seven bit destinations
+                  to _m_o_d_e: m (mimefy) will convert to seven-bit MIME format, p
+                  (pass) will pass it as eight bits (but violates protocols),
+                  and s (strict) will bounce the message.
+ 
+      MinQueueAge=_t_i_m_e_o_u_t
+                  Sets how long a job must ferment in the queue between at-
+                  tempts to send it.
+ 
+      DefaultCharSet=_c_h_a_r_s_e_t
+                  Sets the default character set used to label 8-bit data that
+                  is not otherwise labelled.
+ 
+      DialDelay=_s_l_e_e_p_t_i_m_e
+                  If opening a connection fails, sleep for _s_l_e_e_p_t_i_m_e seconds
+                  and try again.  Useful on dial-on-demand sites.
+ 
+      NoRecipientAction=_a_c_t_i_o_n
+                  Set the behaviour when there are no recipient headers (To:,
+                  Cc: or Bcc:) in the message to _a_c_t_i_o_n: none leaves the mes-
+                  sage unchanged, add-to adds a To: header with the envelope
+                  recipients, add-apparently-to adds an Apparently-To: header
+                  with the envelope recipients, add-bcc adds an empty Bcc:
+                  header, and add-to-undisclosed adds a header reading `To:
+                  undisclosed-recipients:;'.
+ 
+      MaxDaemonChildren=_N
+                  Sets the maximum number of children that an incoming SMTP
+                  daemon will allow to spawn at any time to _N.
+ 
+      ConnectionRateThrottle=_N
+                  Sets the maximum number of connections per second to the SMTP
+                  port to _N.
+ 
+      In aliases, the first character of a name may be a vertical bar to cause
+      interpretation of the rest of the name as a command to pipe the mail to.
+      It may be necessary to quote the name to keep sseennddmmaaiill from suppressing
+      the blanks from between arguments.  For example, a common alias is:
+ 
+            msgs: "|/usr/bin/msgs -s"
+ 
+      Aliases may also have the syntax ``:include:_f_i_l_e_n_a_m_e'' to ask sendmail to
+      read the named file for a list of recipients.  For example, an alias such
+      as:
+ 
+            poets: ":include:/usr/local/lib/poets.list"
+ 
+      would read _/_u_s_r_/_l_o_c_a_l_/_l_i_b_/_p_o_e_t_s_._l_i_s_t for the list of addresses making up
+      the group.
+ 
+      SSeennddmmaaiill returns an exit status describing what it did.  The codes are
+      defined in <_s_y_s_e_x_i_t_s_._h>:
+            EX_OK           Successful completion on all addresses.
+            EX_NOUSER       User name not recognized.
+            EX_UNAVAILABLE  Catchall meaning necessary resources were not
+                            available.
+            EX_SYNTAX       Syntax error in address.
+            EX_SOFTWARE     Internal software error, including bad arguments.
+            EX_OSERR        Temporary operating system error, such as ``cannot
+                            fork''.
+            EX_NOHOST       Host name not recognized.
+            EX_TEMPFAIL     Message could not be sent immediately, but was
+                            queued.
+ 
+      If invoked as nneewwaalliiaasseess, sseennddmmaaiill will rebuild the alias database.  If
+      invoked as mmaaiillqq, sseennddmmaaiill will print the contents of the mail queue.
+ 
+ FFIILLEESS
+      Except for the file _/_e_t_c_/_s_e_n_d_m_a_i_l_._c_f itself, the following pathnames are
+      all specified in _/_e_t_c_/_s_e_n_d_m_a_i_l_._c_f_. Thus, these values are only approxima-
+      tions.
+ 
+      /etc/aliases          raw data for alias names
+      /etc/aliases.db       data base of alias names
+      /etc/sendmail.cf      configuration file
+      /etc/sendmail.hf      help file
+      /var/log/sendmail.st  collected statistics
+      /var/spool/mqueue/*   temp files
+      /var/run/sendmail.pid
+                            The process id of the daemon
+ 
+ SSEEEE AALLSSOO
+      binmail(1),  mail(1),  rmail(1),  syslog(3),  aliases(5),  mailaddr(7),
+      rc(8);
+ 
+      DARPA Internet Request For Comments _R_F_C_8_1_9, _R_F_C_8_2_1, _R_F_C_8_2_2.
+ 
+      _S_e_n_d_m_a_i_l _- _A_n _I_n_t_e_r_n_e_t_w_o_r_k _M_a_i_l _R_o_u_t_e_r, No. 9, SMM.
+ 
+      _S_e_n_d_m_a_i_l _I_n_s_t_a_l_l_a_t_i_o_n _a_n_d _O_p_e_r_a_t_i_o_n _G_u_i_d_e, No. 8, SMM.
+ 
+ HHIISSTTOORRYY
+      The sseennddmmaaiill command appeared in 4.2BSD.
+ 
+ 4th Berkeley Distribution     September 20, 1996                             6
diff -Ncr sendmail-8.8.5/src/sendmail.8 sendmail-8.8.6/src/sendmail.8
*** sendmail-8.8.5/src/sendmail.8	Thu Jan 16 15:26:10 1997
--- sendmail-8.8.6/src/sendmail.8	Sat Feb  1 16:24:50 1997
***************
*** 1,3 ****
--- 1,4 ----
+ .\" Copyright (c) 1983, 1997 Eric P. Allman
  .\" Copyright (c) 1988, 1991, 1993
  .\"	The Regents of the University of California.  All rights reserved.
  .\"
***************
*** 29,37 ****
  .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  .\" SUCH DAMAGE.
  .\"
! .\"     @(#)sendmail.8	8.11 (Berkeley) 1/16/97
  .\"
! .Dd January 16, 1997
  .Dt SENDMAIL 8
  .Os BSD 4
  .Sh NAME
--- 30,38 ----
  .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  .\" SUCH DAMAGE.
  .\"
! .\"     @(#)sendmail.8	8.12 (Berkeley) 2/1/97
  .\"
! .Dd February 1, 1997
  .Dt SENDMAIL 8
  .Os BSD 4
  .Sh NAME
diff -Ncr sendmail-8.8.5/src/sendmail.h sendmail-8.8.6/src/sendmail.h
*** sendmail-8.8.5/src/sendmail.h	Tue Jan 14 17:51:49 1997
--- sendmail-8.8.6/src/sendmail.h	Thu Jun  5 09:24:45 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 31,37 ****
   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   *
!  *	@(#)sendmail.h	8.219 (Berkeley) 1/14/97
   */
  
  /*
--- 31,37 ----
   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   *
!  *	@(#)sendmail.h	8.236 (Berkeley) 6/5/97
   */
  
  /*
***************
*** 41,47 ****
  # ifdef _DEFINE
  # define EXTERN
  # ifndef lint
! static char SmailSccsId[] =	"@(#)sendmail.h	8.219		1/14/97";
  # endif
  # else /*  _DEFINE */
  # define EXTERN extern
--- 41,47 ----
  # ifdef _DEFINE
  # define EXTERN
  # ifndef lint
! static char SmailSccsId[] =	"@(#)sendmail.h	8.236		6/5/97";
  # endif
  # else /*  _DEFINE */
  # define EXTERN extern
***************
*** 87,92 ****
--- 87,99 ----
  # include <netccitt/x25.h>
  # endif
  
+ #if NAMED_BIND
+ # include <arpa/nameser.h>
+ # ifdef NOERROR
+ #  undef NOERROR		/* avoid <sys/streams.h> conflict */
+ # endif
+ #endif
+ 
  
  
  /* forward references for prototypes */
***************
*** 391,396 ****
--- 398,404 ----
  {
  	char	*hi_field;	/* the name of the field */
  	u_short	hi_flags;	/* status bits, see below */
+ 	char	*hi_ruleset;	/* validity check ruleset */
  };
  
  extern struct hdrinfo	HdrInfo[];
***************
*** 726,732 ****
  #define MCF_OPTFILE	0x0008		/* file name is optional */
  
  /* functions */
! extern char	*map_rewrite __P((MAP *, char *, int, char **));
  extern MAP	*makemapentry __P((char *));
  extern void	initmaps __P((bool, ENVELOPE *));
  /*
--- 734,740 ----
  #define MCF_OPTFILE	0x0008		/* file name is optional */
  
  /* functions */
! extern char	*map_rewrite __P((MAP *, const char *, int, char **));
  extern MAP	*makemapentry __P((char *));
  extern void	initmaps __P((bool, ENVELOPE *));
  /*
***************
*** 752,757 ****
--- 760,766 ----
  		NAMECANON	sv_namecanon;	/* canonical name cache */
  		int		sv_macro;	/* macro name => id mapping */
  		int		sv_ruleset;	/* ruleset index */
+ 		struct hdrinfo	sv_header;	/* header metainfo */
  		char		*sv_service[MAXMAPSTACK]; /* service switch */
  	}	s_value;
  };
***************
*** 771,776 ****
--- 780,786 ----
  # define ST_MACRO	9	/* macro name to id mapping */
  # define ST_RULESET	10	/* ruleset index */
  # define ST_SERVICE	11	/* service switch entry */
+ # define ST_HEADER	12	/* special header flags */
  # define ST_MCI		16	/* mailer connection info (offset) */
  
  # define s_class	s_value.sv_class
***************
*** 785,790 ****
--- 795,801 ----
  # define s_macro	s_value.sv_macro
  # define s_ruleset	s_value.sv_ruleset
  # define s_service	s_value.sv_service
+ # define s_header	s_value.sv_header
  
  extern STAB		*stab __P((char *, int, int));
  extern void		stabapply __P((void (*)(STAB *, int), int));
***************
*** 916,921 ****
--- 927,933 ----
  #define PRIV_NOVRFY		0x0010	/* disallow VRFY command entirely */
  #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_RESTRICTMAILQ	0x1000	/* restrict mailq command */
  #define PRIV_RESTRICTQRUN	0x2000	/* restrict queue run */
  #define PRIV_GOAWAY		0x0fff	/* don't give no info, anyway, anyhow */
***************
*** 943,949 ****
  
  
  /*
! **  Flags passed to safefile.
  */
  
  #define SFF_ANYFILE		0	/* no special restrictions */
--- 955,961 ----
  
  
  /*
! **  Flags passed to safefile/safedirpath.
  */
  
  #define SFF_ANYFILE		0	/* no special restrictions */
***************
*** 955,966 ****
  #define SFF_SETUIDOK		0x0020	/* setuid files are ok */
  #define SFF_CREAT		0x0040	/* ok to create file if necessary */
  #define SFF_REGONLY		0x0080	/* regular files only */
  
! /* flags that are actually specific to safefopen */
  #define SFF_OPENASROOT		0x1000	/* open as root instead of real user */
  
  /* functions */
  extern int	safefile __P((char *, UID_T, GID_T, char *, int, int, struct stat *));
  
  
  /*
--- 967,991 ----
  #define SFF_SETUIDOK		0x0020	/* setuid files are ok */
  #define SFF_CREAT		0x0040	/* ok to create file if necessary */
  #define SFF_REGONLY		0x0080	/* regular files only */
+ #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 */
  
! /* 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 */
+ 
+ /* pseudo-flags */
+ #define SFF_NOLINK		(SFF_NOHLINK|SFF_NOSLINK)
  
  /* functions */
  extern int	safefile __P((char *, UID_T, GID_T, char *, int, int, struct stat *));
+ 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));
  
  
  /*
***************
*** 1077,1083 ****
  EXTERN bool	MeToo;		/* send to the sender also */
  EXTERN bool	IgnrDot;	/* don't let dot end messages */
  EXTERN bool	SaveFrom;	/* save leading "From" lines */
- EXTERN bool	Verbose;	/* set if blow-by-blow desired */
  EXTERN bool	GrabTo;		/* if set, get recipients from msg */
  EXTERN bool	SuprErrs;	/* set if we are suppressing errors */
  EXTERN bool	HoldErrs;	/* only output errors to transcript */
--- 1102,1107 ----
***************
*** 1102,1107 ****
--- 1126,1132 ----
  EXTERN gid_t	DefGid;		/* default gid to run as */
  EXTERN char	*DefUser;	/* default user to run as (from DefUid) */
  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) */
  EXTERN int	ExitStat;	/* exit status code */
  EXTERN int	LineNumber;	/* line number in current input */
***************
*** 1123,1128 ****
--- 1148,1154 ----
  EXTERN char	*CurHostName;	/* current host we are dealing with */
  EXTERN jmp_buf	TopFrame;	/* branch-to-top-of-loop-on-error frame */
  EXTERN bool	QuickAbort;	/*  .... but only if we want a quick abort */
+ EXTERN bool	OnlyOneError;	/*  .... or only want to give one SMTP reply */
  EXTERN bool	LogUsrErrs;	/* syslog user errors (e.g., SMTP RCPT cmd) */
  EXTERN bool	SendMIMEErrors;	/* send error messages in MIME format */
  EXTERN bool	MatchGecos;	/* look for user names in gecos field */
***************
*** 1163,1173 ****
  EXTERN int	DefaultNotify;	/* default DSN notification flags */
  EXTERN bool	AllowBogusHELO;	/* allow syntax errors on HELO command */
  EXTERN bool	UserSubmission;	/* initial (user) mail submission */
  EXTERN uid_t	RunAsUid;	/* UID to become for bulk of run */
  EXTERN gid_t	RunAsGid;	/* GID to become for bulk of run */
! #ifdef _FFR_DSN_RRT
  EXTERN bool	RrtImpliesDsn;	/* turn Return-Receipt-To: into DSN */
  #endif
  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 */
--- 1189,1204 ----
  EXTERN int	DefaultNotify;	/* default DSN notification flags */
  EXTERN bool	AllowBogusHELO;	/* allow syntax errors on HELO command */
  EXTERN bool	UserSubmission;	/* initial (user) mail submission */
+ EXTERN char	*RunAsUserName;	/* user to become for bulk of run */
  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 */
! #if _FFR_DSN_RRT_OPTION
  EXTERN bool	RrtImpliesDsn;	/* turn Return-Receipt-To: into DSN */
  #endif
+ 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 */
***************
*** 1194,1199 ****
--- 1225,1231 ----
  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 */
***************
*** 1249,1254 ****
--- 1281,1292 ----
  */
  
  
+ /*
+ **  The "no queue id" queue id for sm_syslog
+ */
+ 
+ #define NOQID		"*~*"
+ 
  
  /*
  **  Some in-line functions
***************
*** 1272,1278 ****
  */
  
  extern char	*xalloc __P((int));
- extern FILE	*dfopen __P((char *, int, int));
  extern char	*sfgets __P((char *, int, FILE *, time_t, char *));
  extern char	*queuename __P((ENVELOPE *, int));
  extern time_t	curtime __P(());
--- 1310,1315 ----
***************
*** 1295,1301 ****
  extern void	readaliases __P((MAP *, FILE *, bool, bool));
  extern void	finis __P(());
  extern void	setsender __P((char *, ENVELOPE *, char **, int, bool));
- extern FILE	*safefopen __P((char *, int, int, int));
  extern void	xputs __P((const char *));
  extern void	logsender __P((ENVELOPE *, char *));
  extern void	smtprset __P((MAILER *, MCI *, ENVELOPE *));
--- 1332,1337 ----
***************
*** 1303,1309 ****
  extern void	setuserenv __P((const char *, const char *));
  extern char	*getextenv __P((const char *));
  extern void	disconnect __P((int, ENVELOPE *));
! extern void	putxline __P((char *, MCI *, int));
  extern void	dumpfd __P((int, bool, bool));
  extern void	makemailer __P((char *));
  extern void	putfromline __P((MCI *, ENVELOPE *));
--- 1339,1345 ----
  extern void	setuserenv __P((const char *, const char *));
  extern char	*getextenv __P((const char *));
  extern void	disconnect __P((int, ENVELOPE *));
! extern void	putxline __P((char *, size_t, MCI *, int));
  extern void	dumpfd __P((int, bool, bool));
  extern void	makemailer __P((char *));
  extern void	putfromline __P((MCI *, ENVELOPE *));
***************
*** 1328,1334 ****
  extern void	buffer_errors __P((void));
  extern void	flush_errors __P((bool));
  extern void	putline __P((char *, MCI *));
- extern void	putxline __P((char *, MCI *, int));
  extern bool	xtextok __P((char *));
  extern char	*xtextify __P((char *, char *));
  extern char	*xuntextify __P((char *));
--- 1364,1369 ----
***************
*** 1341,1347 ****
  extern void	fixcrlf __P((char *, bool));
  extern int	dofork __P((void));
  extern void	initsys __P((ENVELOPE *));
! extern void	collect __P((FILE *, bool, bool, HDR **, ENVELOPE *));
  extern void	stripquotes __P((char *));
  extern int	include __P((char *, bool, ADDRESS *, ADDRESS **, int, ENVELOPE  *));
  extern void	unlockqueue __P((ENVELOPE *));
--- 1376,1382 ----
  extern void	fixcrlf __P((char *, bool));
  extern int	dofork __P((void));
  extern void	initsys __P((ENVELOPE *));
! extern void	collect __P((FILE *, bool, HDR **, ENVELOPE *));
  extern void	stripquotes __P((char *));
  extern int	include __P((char *, bool, ADDRESS *, ADDRESS **, int, ENVELOPE  *));
  extern void	unlockqueue __P((ENVELOPE *));
***************
*** 1385,1390 ****
--- 1420,1426 ----
  extern void		message(const char *, ...);
  extern void		nmessage(const char *, ...);
  extern void		setproctitle(const char *fmt, ...);
+ extern void		sm_syslog(int, const char *, const char *, ...);
  #else
  extern void		auth_warning();
  extern void		syserr();
***************
*** 1392,1397 ****
--- 1428,1434 ----
  extern void		message();
  extern void		nmessage();
  extern void		setproctitle();
+ extern void		sm_syslog();
  #endif
  
  #if !HASSNPRINTF
diff -Ncr sendmail-8.8.5/src/sendmail.hf sendmail-8.8.6/src/sendmail.hf
*** sendmail-8.8.5/src/sendmail.hf	Wed Sep 11 14:56:20 1996
--- sendmail-8.8.6/src/sendmail.hf	Sat Feb  1 16:24:50 1997
***************
*** 1,9 ****
  cpyr
! cpyr	Copyright (c) 1983, 1995, 1996 Eric P. Allman
  cpyr	Copyright (c) 1988, 1993
  cpyr	    The Regents of the University of California.  All rights reserved.
  cpyr	
! cpyr	@(#)sendmail.hf	8.11 (Berkeley) 9/11/96
  cpyr
  smtp	Topics:
  smtp		HELO	EHLO	MAIL	RCPT	DATA
--- 1,9 ----
  cpyr
! cpyr	Copyright (c) 1983, 1995-1997 Eric P. Allman
  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
  smtp	Topics:
  smtp		HELO	EHLO	MAIL	RCPT	DATA
diff -Ncr sendmail-8.8.5/src/srvrsmtp.c sendmail-8.8.6/src/srvrsmtp.c
*** sendmail-8.8.5/src/srvrsmtp.c	Fri Jan 17 10:02:46 1997
--- sendmail-8.8.6/src/srvrsmtp.c	Thu Jun 12 12:00:20 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 36,44 ****
  
  #ifndef lint
  #if SMTP
! static char sccsid[] = "@(#)srvrsmtp.c	8.136 (Berkeley) 1/17/97 (with SMTP)";
  #else
! static char sccsid[] = "@(#)srvrsmtp.c	8.136 (Berkeley) 1/17/97 (without SMTP)";
  #endif
  #endif /* not lint */
  
--- 36,44 ----
  
  #ifndef lint
  #if SMTP
! static char sccsid[] = "@(#)srvrsmtp.c	8.146 (Berkeley) 6/11/97 (with SMTP)";
  #else
! static char sccsid[] = "@(#)srvrsmtp.c	8.146 (Berkeley) 6/11/97 (without SMTP)";
  #endif
  #endif /* not lint */
  
***************
*** 153,158 ****
--- 153,159 ----
  	volatile int n_noop = 0;	/* count of NOOP/VERB/ONEX etc cmds */
  	volatile int n_helo = 0;	/* count of HELO/EHLO commands */
  	bool ok;
+ 	int lognullconnection = TRUE;
  	char inp[MAXLINE];
  	char cmdbuf[MAXLINE];
  	extern ENVELOPE BlankEnvelope;
***************
*** 160,166 ****
  	extern void settime __P((ENVELOPE *));
  	extern bool enoughdiskspace __P((long));
  	extern int runinchild __P((char *, ENVELOPE *));
! 	extern void checksmtpattack __P((volatile int *, int, char *));
  
  	if (fileno(OutChannel) != fileno(stdout))
  	{
--- 161,167 ----
  	extern void settime __P((ENVELOPE *));
  	extern bool enoughdiskspace __P((long));
  	extern int runinchild __P((char *, ENVELOPE *));
! 	extern void checksmtpattack __P((volatile int *, int, char *, ENVELOPE *));
  
  	if (fileno(OutChannel) != fileno(stdout))
  	{
***************
*** 177,187 ****
  		CurSmtpClient = CurHostName;
  
  	setproctitle("server %s startup", CurSmtpClient);
! #if defined(LOG) && DAEMON
  	if (LogLevel > 11)
  	{
  		/* log connection information */
! 		syslog(LOG_INFO, "SMTP connect from %.100s (%.100s)",
  			CurSmtpClient, anynet_ntoa(&RealHostAddr));
  	}
  #endif
--- 178,189 ----
  		CurSmtpClient = CurHostName;
  
  	setproctitle("server %s startup", CurSmtpClient);
! #if DAEMON
  	if (LogLevel > 11)
  	{
  		/* log connection information */
! 		sm_syslog(LOG_INFO, NOQID,
! 			"SMTP connect from %.100s (%.100s)",
  			CurSmtpClient, anynet_ntoa(&RealHostAddr));
  	}
  #endif
***************
*** 231,237 ****
--- 233,241 ----
  		}
  		QuickAbort = FALSE;
  		HoldErrs = FALSE;
+ 		SuprErrs = FALSE;
  		LogUsrErrs = FALSE;
+ 		OnlyOneError = TRUE;
  		e->e_flags &= ~(EF_VRFYONLY|EF_GLOBALERRS);
  
  		/* setup for the read */
***************
*** 252,262 ****
  			disconnect(1, e);
  			message("421 %s Lost input channel from %s",
  				MyHostName, CurSmtpClient);
- #ifdef LOG
  			if (LogLevel > (gotmail ? 1 : 19))
! 				syslog(LOG_NOTICE, "lost input channel from %.100s",
  					CurSmtpClient);
- #endif
  			if (InChild)
  				ExitStat = EX_QUIT;
  			finis();
--- 256,265 ----
  			disconnect(1, e);
  			message("421 %s Lost input channel from %s",
  				MyHostName, CurSmtpClient);
  			if (LogLevel > (gotmail ? 1 : 19))
! 				sm_syslog(LOG_NOTICE, e->e_id,
! 					"lost input channel from %.100s",
  					CurSmtpClient);
  			if (InChild)
  				ExitStat = EX_QUIT;
  			finis();
***************
*** 269,278 ****
  		if (e->e_xfp != NULL)
  			fprintf(e->e_xfp, "<<< %s\n", inp);
  
- #ifdef LOG
  		if (LogLevel >= 15)
! 			syslog(LOG_INFO, "<-- %s", inp);
! #endif
  
  		if (e->e_id == NULL)
  			setproctitle("%s: %.80s", CurSmtpClient, inp);
--- 272,281 ----
  		if (e->e_xfp != NULL)
  			fprintf(e->e_xfp, "<<< %s\n", inp);
  
  		if (LogLevel >= 15)
! 			sm_syslog(LOG_INFO, e->e_id,
! 				"<-- %s",
! 				inp);
  
  		if (e->e_id == NULL)
  			setproctitle("%s: %.80s", CurSmtpClient, inp);
***************
*** 324,330 ****
  			  default:
  				if (++badcommands > MAXBADCOMMANDS)
  					sleep(1);
! 				message("550 Access denied");
  				continue;
  			}
  		}
--- 327,333 ----
  			  default:
  				if (++badcommands > MAXBADCOMMANDS)
  					sleep(1);
! 				usrerr("550 Access denied");
  				continue;
  			}
  		}
***************
*** 332,337 ****
--- 335,349 ----
  		/* non-null server */
  		switch (c->cmdcode)
  		{
+ 		  case CMDMAIL:
+ 		  case CMDEXPN:
+ 		  case CMDVRFY:
+ 		  case CMDETRN:
+ 			lognullconnection = FALSE;
+ 		}
+ 
+ 		switch (c->cmdcode)
+ 		{
  		  case CMDHELO:		/* hello -- introduce yourself */
  		  case CMDEHLO:		/* extended hello */
  			if (c->cmdcode == CMDEHLO)
***************
*** 346,357 ****
  			}
  
  			/* avoid denial-of-service */
! 			checksmtpattack(&n_helo, MAXHELOCOMMANDS, "HELO/EHLO");
  
  			/* check for duplicate HELO/EHLO per RFC 1651 4.2 */
  			if (gothello)
  			{
! 				message("503 %s Duplicate HELO/EHLO",
  					MyHostName);
  				break;
  			}
--- 358,369 ----
  			}
  
  			/* avoid denial-of-service */
! 			checksmtpattack(&n_helo, MAXHELOCOMMANDS, "HELO/EHLO", e);
  
  			/* check for duplicate HELO/EHLO per RFC 1651 4.2 */
  			if (gothello)
  			{
! 				usrerr("503 %s Duplicate HELO/EHLO",
  					MyHostName);
  				break;
  			}
***************
*** 359,365 ****
  			/* check for valid domain name (re 1123 5.2.5) */
  			if (*p == '\0' && !AllowBogusHELO)
  			{
! 				message("501 %s requires domain address",
  					cmdbuf);
  				break;
  			}
--- 371,377 ----
  			/* check for valid domain name (re 1123 5.2.5) */
  			if (*p == '\0' && !AllowBogusHELO)
  			{
! 				usrerr("501 %s requires domain address",
  					cmdbuf);
  				break;
  			}
***************
*** 384,390 ****
  				if (*q != '\0')
  				{
  					if (!AllowBogusHELO)
! 						message("501 Invalid domain name");
  					else
  					{
  						message("250 %s Invalid domain name, accepting anyway",
--- 396,402 ----
  				if (*q != '\0')
  				{
  					if (!AllowBogusHELO)
! 						usrerr("501 Invalid domain name");
  					else
  					{
  						message("250 %s Invalid domain name, accepting anyway",
***************
*** 442,454 ****
  
  				if (bitset(PRIV_NEEDMAILHELO, PrivacyFlags))
  				{
! 					message("503 Polite people say HELO first");
  					break;
  				}
  			}
  			if (gotmail)
  			{
! 				message("503 Sender already specified");
  				if (InChild)
  					finis();
  				break;
--- 454,466 ----
  
  				if (bitset(PRIV_NEEDMAILHELO, PrivacyFlags))
  				{
! 					usrerr("503 Polite people say HELO first");
  					break;
  				}
  			}
  			if (gotmail)
  			{
! 				usrerr("503 Sender already specified");
  				if (InChild)
  					finis();
  				break;
***************
*** 578,584 ****
  				
  			if (!enoughdiskspace(e->e_msgsize))
  			{
! 				message("452 Insufficient disk space; try again later");
  				break;
  			}
  			message("250 Sender ok");
--- 590,596 ----
  				
  			if (!enoughdiskspace(e->e_msgsize))
  			{
! 				usrerr("452 Insufficient disk space; try again later");
  				break;
  			}
  			message("250 Sender ok");
***************
*** 600,605 ****
--- 612,624 ----
  			QuickAbort = TRUE;
  			LogUsrErrs = TRUE;
  
+ 			/* limit flooding of our machine */
+ 			if (MaxRcptPerMsg > 0 && nrcpts >= MaxRcptPerMsg)
+ 			{
+ 				usrerr("450 Too many recipients");
+ 				break;
+ 			}
+ 
  			if (e->e_sendmode != SM_DELIVER)
  				e->e_flags |= EF_VRFYONLY;
  
***************
*** 674,694 ****
  			else
  			{
  				/* punt -- should keep message in ADDRESS.... */
! 				message("550 Addressee unknown");
  			}
- 			e->e_to = NULL;
  			break;
  
  		  case CMDDATA:		/* data -- text of mail */
  			SmtpPhase = "server DATA";
  			if (!gotmail)
  			{
! 				message("503 Need MAIL command");
  				break;
  			}
  			else if (nrcpts <= 0)
  			{
! 				message("503 Need RCPT (recipient)");
  				break;
  			}
  
--- 693,712 ----
  			else
  			{
  				/* punt -- should keep message in ADDRESS.... */
! 				usrerr("550 Addressee unknown");
  			}
  			break;
  
  		  case CMDDATA:		/* data -- text of mail */
  			SmtpPhase = "server DATA";
  			if (!gotmail)
  			{
! 				usrerr("503 Need MAIL command");
  				break;
  			}
  			else if (nrcpts <= 0)
  			{
! 				usrerr("503 Need RCPT (recipient)");
  				break;
  			}
  
***************
*** 713,719 ****
  			/* collect the text of the message */
  			SmtpPhase = "collect";
  			buffer_errors();
! 			collect(InChannel, TRUE, doublequeue, NULL, e);
  			flush_errors(TRUE);
  			if (Errors != 0)
  				goto abortmessage;
--- 731,737 ----
  			/* collect the text of the message */
  			SmtpPhase = "collect";
  			buffer_errors();
! 			collect(InChannel, TRUE, NULL, e);
  			flush_errors(TRUE);
  			if (Errors != 0)
  				goto abortmessage;
***************
*** 785,791 ****
  			break;
  
  		  case CMDRSET:		/* rset -- reset state */
! 			message("250 Reset state");
  
  			/* arrange to ignore any current send list */
  			e->e_sendqueue = NULL;
--- 803,812 ----
  			break;
  
  		  case CMDRSET:		/* rset -- reset state */
! 			if (tTd(94, 100))
! 				message("451 Test failure");
! 			else
! 				message("250 Reset state");
  
  			/* arrange to ignore any current send list */
  			e->e_sendqueue = NULL;
***************
*** 795,800 ****
--- 816,822 ----
  
  			/* clean up a bit */
  			gotmail = FALSE;
+ 			SuprErrs = TRUE;
  			dropenvelope(e, TRUE);
  			CurEnv = e = newenvelope(e, CurEnv);
  			break;
***************
*** 802,808 ****
  		  case CMDVRFY:		/* vrfy -- verify address */
  		  case CMDEXPN:		/* expn -- expand address */
  			checksmtpattack(&nverifies, MAXVRFYCOMMANDS,
! 				c->cmdcode == CMDVRFY ? "VRFY" : "EXPN");
  			vrfy = c->cmdcode == CMDVRFY;
  			if (bitset(vrfy ? PRIV_NOVRFY : PRIV_NOEXPN,
  						PrivacyFlags))
--- 824,830 ----
  		  case CMDVRFY:		/* vrfy -- verify address */
  		  case CMDEXPN:		/* expn -- expand address */
  			checksmtpattack(&nverifies, MAXVRFYCOMMANDS,
! 				c->cmdcode == CMDVRFY ? "VRFY" : "EXPN", e);
  			vrfy = c->cmdcode == CMDVRFY;
  			if (bitset(vrfy ? PRIV_NOVRFY : PRIV_NOEXPN,
  						PrivacyFlags))
***************
*** 811,849 ****
  					message("252 Cannot VRFY user; try RCPT to attempt delivery (or try finger)");
  				else
  					message("502 Sorry, we do not allow this operation");
- #ifdef LOG
  				if (LogLevel > 5)
! 					syslog(LOG_INFO, "%.100s: %s [rejected]",
  						CurSmtpClient,
  						shortenstring(inp, 203));
- #endif
  				break;
  			}
  			else if (!gothello &&
  				 bitset(vrfy ? PRIV_NEEDVRFYHELO : PRIV_NEEDEXPNHELO,
  						PrivacyFlags))
  			{
! 				message("503 I demand that you introduce yourself first");
  				break;
  			}
  			if (runinchild(vrfy ? "SMTP-VRFY" : "SMTP-EXPN", e) > 0)
  				break;
- #ifdef LOG
  			if (LogLevel > 5)
! 				syslog(LOG_INFO, "%.100s: %s",
  					CurSmtpClient,
  					shortenstring(inp, 203));
- #endif
  			vrfyqueue = NULL;
- 			QuickAbort = TRUE;
  			if (vrfy)
  				e->e_flags |= EF_VRFYONLY;
  			while (*p != '\0' && isascii(*p) && isspace(*p))
  				p++;
  			if (*p == '\0')
  			{
! 				message("501 Argument required");
! 				Errors++;
  			}
  			else
  			{
--- 833,867 ----
  					message("252 Cannot VRFY user; try RCPT to attempt delivery (or try finger)");
  				else
  					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, 203));
  				break;
  			}
  			else if (!gothello &&
  				 bitset(vrfy ? PRIV_NEEDVRFYHELO : PRIV_NEEDEXPNHELO,
  						PrivacyFlags))
  			{
! 				usrerr("503 I demand that you introduce yourself first");
  				break;
  			}
  			if (runinchild(vrfy ? "SMTP-VRFY" : "SMTP-EXPN", e) > 0)
  				break;
  			if (LogLevel > 5)
! 				sm_syslog(LOG_INFO, e->e_id,
! 					"%.100s: %s",
  					CurSmtpClient,
  					shortenstring(inp, 203));
  			vrfyqueue = NULL;
  			if (vrfy)
  				e->e_flags |= EF_VRFYONLY;
  			while (*p != '\0' && isascii(*p) && isspace(*p))
  				p++;
  			if (*p == '\0')
  			{
! 				usrerr("501 Argument required");
  			}
  			else
  			{
***************
*** 857,863 ****
  			}
  			if (vrfyqueue == NULL)
  			{
! 				message("554 Nothing to %s", vrfy ? "VRFY" : "EXPN");
  			}
  			while (vrfyqueue != NULL)
  			{
--- 875,881 ----
  			}
  			if (vrfyqueue == NULL)
  			{
! 				usrerr("554 Nothing to %s", vrfy ? "VRFY" : "EXPN");
  			}
  			while (vrfyqueue != NULL)
  			{
***************
*** 878,901 ****
  		  case CMDETRN:		/* etrn -- force queue flush */
  			if (strlen(p) <= 0)
  			{
! 				message("500 Parameter required");
  				break;
  			}
  
  			/* crude way to avoid denial-of-service attacks */
! 			checksmtpattack(&n_etrn, MAXETRNCOMMANDS, "ETRN");
  
  			id = p;
  			if (*id == '@')
  				id++;
  			else
  				*--id = '@';
- #ifdef LOG
  			if (LogLevel > 5)
! 				syslog(LOG_INFO, "%.100s: ETRN %s",
  					CurSmtpClient,
  					shortenstring(id, 203));
- #endif
  			QueueLimitRecipient = id;
  			ok = runqueue(TRUE, TRUE);
  			QueueLimitRecipient = NULL;
--- 896,918 ----
  		  case CMDETRN:		/* etrn -- force queue flush */
  			if (strlen(p) <= 0)
  			{
! 				usrerr("500 Parameter required");
  				break;
  			}
  
  			/* crude way to avoid denial-of-service attacks */
! 			checksmtpattack(&n_etrn, MAXETRNCOMMANDS, "ETRN", e);
  
  			id = p;
  			if (*id == '@')
  				id++;
  			else
  				*--id = '@';
  			if (LogLevel > 5)
! 				sm_syslog(LOG_INFO, e->e_id,
! 					"%.100s: ETRN %s",
  					CurSmtpClient,
  					shortenstring(id, 203));
  			QueueLimitRecipient = id;
  			ok = runqueue(TRUE, TRUE);
  			QueueLimitRecipient = NULL;
***************
*** 908,914 ****
  			break;
  
  		  case CMDNOOP:		/* noop -- do nothing */
! 			checksmtpattack(&n_noop, MAXNOOPCOMMANDS, "NOOP");
  			message("250 OK");
  			break;
  
--- 925,931 ----
  			break;
  
  		  case CMDNOOP:		/* noop -- do nothing */
! 			checksmtpattack(&n_noop, MAXNOOPCOMMANDS, "NOOP", e);
  			message("250 OK");
  			break;
  
***************
*** 924,929 ****
--- 941,950 ----
  
  			if (InChild)
  				ExitStat = EX_QUIT;
+ 			if (lognullconnection && LogLevel > 5)
+ 				sm_syslog(LOG_INFO, NULL,
+ 					"Null connection from %.100s",
+ 					CurSmtpClient);
  			finis();
  
  		  case CMDVERB:		/* set verbose mode */
***************
*** 933,952 ****
  				message("502 Verbose unavailable");
  				break;
  			}
! 			checksmtpattack(&n_noop, MAXNOOPCOMMANDS, "VERB");
! 			Verbose = TRUE;
  			e->e_sendmode = SM_DELIVER;
  			message("250 Verbose mode");
  			break;
  
  		  case CMDONEX:		/* doing one transaction only */
! 			checksmtpattack(&n_noop, MAXNOOPCOMMANDS, "ONEX");
  			OneXact = TRUE;
  			message("250 Only one transaction");
  			break;
  
  		  case CMDXUSR:		/* initial (user) submission */
! 			checksmtpattack(&n_noop, MAXNOOPCOMMANDS, "XUSR");
  			UserSubmission = TRUE;
  			message("250 Initial submission");
  			break;
--- 954,973 ----
  				message("502 Verbose unavailable");
  				break;
  			}
! 			checksmtpattack(&n_noop, MAXNOOPCOMMANDS, "VERB", e);
! 			Verbose = 1;
  			e->e_sendmode = SM_DELIVER;
  			message("250 Verbose mode");
  			break;
  
  		  case CMDONEX:		/* doing one transaction only */
! 			checksmtpattack(&n_noop, MAXNOOPCOMMANDS, "ONEX", e);
  			OneXact = TRUE;
  			message("250 Only one transaction");
  			break;
  
  		  case CMDXUSR:		/* initial (user) submission */
! 			checksmtpattack(&n_noop, MAXNOOPCOMMANDS, "XUSR", e);
  			UserSubmission = TRUE;
  			message("250 Initial submission");
  			break;
***************
*** 968,980 ****
  		  case CMDDBGDEBUG:	/* set debug mode */
  # endif /* SMTPDEBUG */
  		  case CMDLOGBOGUS:	/* bogus command */
- # ifdef LOG
  			if (LogLevel > 0)
! 				syslog(LOG_CRIT,
  				    "\"%s\" command from %.100s (%.100s)",
  				    c->cmdname, CurSmtpClient,
  				    anynet_ntoa(&RealHostAddr));
- # endif
  			/* FALL THROUGH */
  
  		  case CMDERROR:	/* unknown command */
--- 989,999 ----
  		  case CMDDBGDEBUG:	/* set debug mode */
  # endif /* SMTPDEBUG */
  		  case CMDLOGBOGUS:	/* bogus command */
  			if (LogLevel > 0)
! 				sm_syslog(LOG_CRIT, e->e_id,
  				    "\"%s\" command from %.100s (%.100s)",
  				    c->cmdname, CurSmtpClient,
  				    anynet_ntoa(&RealHostAddr));
  			/* FALL THROUGH */
  
  		  case CMDERROR:	/* unknown command */
***************
*** 985,991 ****
  				goto doquit;
  			}
  
! 			message("500 Command unrecognized");
  			break;
  
  		  default:
--- 1004,1011 ----
  				goto doquit;
  			}
  
! 			usrerr("500 Command unrecognized: \"%s\"",
! 				shortenstring(inp, 203));
  			break;
  
  		  default:
***************
*** 1003,1008 ****
--- 1023,1029 ----
  **		maxcount -- maximum value for this counter before we
  **			slow down.
  **		cname -- command name for logging.
+ **		e -- the current envelope.
  **
  **	Returns:
  **		none.
***************
*** 1012,1031 ****
  */
  
  void
! checksmtpattack(pcounter, maxcount, cname)
  	volatile int *pcounter;
  	int maxcount;
  	char *cname;
  {
  	if (++(*pcounter) >= maxcount)
  	{
- #ifdef LOG
  		if (*pcounter == maxcount && LogLevel > 5)
  		{
! 			syslog(LOG_INFO, "%.100s: %.40s attack?",
  			       CurSmtpClient, cname);
  		}
- #endif
  		sleep(*pcounter / maxcount);
  	}
  }
--- 1033,1052 ----
  */
  
  void
! checksmtpattack(pcounter, maxcount, cname, e)
  	volatile int *pcounter;
  	int maxcount;
  	char *cname;
+ 	ENVELOPE *e;
  {
  	if (++(*pcounter) >= maxcount)
  	{
  		if (*pcounter == maxcount && LogLevel > 5)
  		{
! 			sm_syslog(LOG_INFO, e->e_id,
! 				"%.100s: %.40s attack?",
  			       CurSmtpClient, cname);
  		}
  		sleep(*pcounter / maxcount);
  	}
  }
***************
*** 1065,1073 ****
  	if (*p != ':')
  	{
  	  syntax:
! 		message("501 Syntax error in parameters scanning \"%s\"",
  			shortenstring(firstp, 203));
- 		Errors++;
  		return (NULL);
  	}
  	*p++ = '\0';
--- 1086,1093 ----
  	if (*p != ':')
  	{
  	  syntax:
! 		usrerr("501 Syntax error in parameters scanning \"%s\"",
  			shortenstring(firstp, 203));
  		return (NULL);
  	}
  	*p++ = '\0';
***************
*** 1411,1417 ****
  	extern char Version[];
  
  
! 	if (HelpFile == NULL || (hf = fopen(HelpFile, "r")) == NULL)
  	{
  		/* no help */
  		errno = 0;
--- 1431,1438 ----
  	extern char Version[];
  
  
! 	if (HelpFile == NULL ||
! 	    (hf = safefopen(HelpFile, O_RDONLY, 0444, SFF_OPENASROOT|SFF_REGONLY|SFF_NOLOCK)) == NULL)
  	{
  		/* no help */
  		errno = 0;
diff -Ncr sendmail-8.8.5/src/stab.c sendmail-8.8.6/src/stab.c
*** sendmail-8.8.5/src/stab.c	Sat Nov 23 09:54:29 1996
--- sendmail-8.8.6/src/stab.c	Sat Apr 19 16:20:43 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)stab.c	8.10 (Berkeley) 11/23/96";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)stab.c	8.13 (Berkeley) 4/19/97";
  #endif /* not lint */
  
  # include "sendmail.h"
***************
*** 131,141 ****
  		printf("entered\n");
  
  	/* determine size of new entry */
! #ifdef _FFR_MEMORY_MISER
! 	if (type >= ST_MCI)
! 		len = sizeof s->s_mci;
! 	else
! 		len = -1;
  	switch (type)
  	{
  	  case ST_CLASS:
--- 131,137 ----
  		printf("entered\n");
  
  	/* determine size of new entry */
! #if _FFR_MEMORY_MISER
  	switch (type)
  	{
  	  case ST_CLASS:
***************
*** 180,190 ****
  	  case ST_SERVICE:
  		len = sizeof s->s_service;
  		break;
! 	}
! 	if (len < 0)
! 	{
! 		syserr("stab: unknown symbol type %d", type);
! 		len = sizeof s->s_value;
  	}
  	len += sizeof *s - sizeof s->s_value;
  #else
--- 176,195 ----
  	  case ST_SERVICE:
  		len = sizeof s->s_service;
  		break;
! 
! 	  case ST_HEADER:
! 		len = sizeof s->s_header;
! 		break;
! 
! 	  default:
! 		if (type >= ST_MCI)
! 			len = sizeof s->s_mci;
! 		else
! 		{
! 			syserr("stab: unknown symbol type %d", type);
! 			len = sizeof s->s_value;
! 		}
! 		break;
  	}
  	len += sizeof *s - sizeof s->s_value;
  #else
diff -Ncr sendmail-8.8.5/src/stats.c sendmail-8.8.6/src/stats.c
*** sendmail-8.8.5/src/stats.c	Wed Feb 21 17:01:21 1996
--- sendmail-8.8.6/src/stats.c	Wed Apr  9 08:03:18 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)stats.c	8.6 (Berkeley) 2/21/96";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)stats.c	8.11 (Berkeley) 4/9/97";
  #endif /* not lint */
  
  # include "sendmail.h"
***************
*** 97,109 ****
  	(void) time(&Stat.stat_itime);
  	Stat.stat_size = sizeof Stat;
  
! 	fd = open(sfile, O_RDWR);
  	if (fd < 0)
  	{
  		errno = 0;
  		return;
  	}
- 	(void) lockfile(fd, sfile, NULL, LOCK_EX);
  	if (read(fd, (char *) &stat, sizeof stat) == sizeof stat &&
  	    stat.stat_size == sizeof stat)
  	{
--- 97,108 ----
  	(void) time(&Stat.stat_itime);
  	Stat.stat_size = sizeof Stat;
  
! 	fd = safeopen(sfile, O_RDWR, 0644, SFF_REGONLY|SFF_NOLINK|SFF_OPENASROOT);
  	if (fd < 0)
  	{
  		errno = 0;
  		return;
  	}
  	if (read(fd, (char *) &stat, sizeof stat) == sizeof stat &&
  	    stat.stat_size == sizeof stat)
  	{
diff -Ncr sendmail-8.8.5/src/sysexits.c sendmail-8.8.6/src/sysexits.c
*** sendmail-8.8.5/src/sysexits.c	Wed Feb 21 17:01:20 1996
--- sendmail-8.8.6/src/sysexits.c	Sat Feb  1 16:24:48 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)sysexits.c	8.6 (Berkeley) 2/21/96";
  #endif /* not lint */
  
  #include <sendmail.h>
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)sysexits.c	8.7 (Berkeley) 2/1/97";
  #endif /* not lint */
  
  #include <sendmail.h>
diff -Ncr sendmail-8.8.5/src/tags sendmail-8.8.6/src/tags
*** sendmail-8.8.5/src/tags	Sun Mar  9 07:14:11 1997
--- sendmail-8.8.6/src/tags	Wed Dec 31 16:00:00 1969
***************
*** 1,412 ****
- CHAR64	mime.c	/^#define CHAR64(c)  (((c) < 0 || (c) > 127) ? -1 : /
- COL_MAX	map.c	/^#define COL_MAX(res)	((res->objects.objects_val)->/
- COL_NAME	map.c	/^#define COL_NAME(res,i)	((res->objects.objects_val/
- DOFORK	deliver.c	/^# define DOFORK(fORKfN) \\$/
- EN_col	map.c	/^#define EN_col(col)	zo_data.objdata_u.en_data.en_c/
- HEXCHAR	mime.c	/^#define HEXCHAR(c)  (((c) < 0 || (c) > 127) ? -1 :/
- KBYTES	stats.c	/^#define KBYTES(x)	(((x) + (ONE_K - 1)) \/ ONE_K)$/
- MACBINDING	main.c	/^#define MACBINDING(name, mid) \\$/
- MAPDEF	conf.c	/^#define MAPDEF(name, ext, flags, parse, open, clos/
- MAX	domain.c	/^# define MAX(a, b)	((a) > (b) ? (a) : (b))$/
- Mmain	main.c	/^main(argc, argv, envp)$/
- PARTIAL_NAME	map.c	/^#define PARTIAL_NAME(x)	((x)[strlen(x) - 1] != '.'/
- PLURAL	convtime.c	/^# define PLURAL(n)	((n) == 1 ? "" : "s")$/
- REPLYCLASS	usersmtp.c	/^#define REPLYCLASS(r)	(((r) \/ 10) % 10)	\/* second /
- REPLYTYPE	usersmtp.c	/^#define REPLYTYPE(r)	((r) \/ 100)		\/* first digit o/
- __P	conf.c	/^setsid __P ((void))$/
- _udb_parsespec	udb.c	/^_udb_parsespec(udbspec, opt, maxopts)$/
- _udbx_init	udb.c	/^_udbx_init()$/
- addheader	headers.c	/^addheader(field, value, hdrlist)$/
- alias	alias.c	/^alias(a, sendq, aliaslevel, e)$/
- aliaslookup	alias.c	/^aliaslookup(name, pstat, e)$/
- aliaswait	alias.c	/^aliaswait(map, ext, isopen)$/
- allocaddr	parseaddr.c	/^allocaddr(a, flags, paddr)$/
- anynet_ntoa	daemon.c	/^anynet_ntoa(sap)$/
- arpadate	arpadate.c	/^arpadate(ud)$/
- atobool	util.c	/^atobool(s)$/
- atooct	util.c	/^atooct(s)$/
- auth_warning	main.c	/^auth_warning(register ENVELOPE *e, const char *msg/
- authtimeout	daemon.c	/^authtimeout()$/
- bestmx_map_lookup	domain.c	/^bestmx_map_lookup(map, name, av, statp)$/
- bitintersect	util.c	/^bitintersect(a, b)$/
- bitzerop	util.c	/^bitzerop(map)$/
- blocksignal	conf.c	/^blocksignal(sig)$/
- bogus_map_lookup	map.c	/^bogus_map_lookup(map, key, args, pstat)$/
- bt_map_open	map.c	/^bt_map_open(map, mode)$/
- buffer_errors	err.c	/^buffer_errors()$/
- buildaddr	parseaddr.c	/^buildaddr(tv, a, flags, e)$/
- buildfname	util.c	/^buildfname(gecos, login, buf, buflen)$/
- callsubr	parseaddr.c	/^callsubr(pvp, reclevel, e)$/
- cataddr	parseaddr.c	/^cataddr(pvp, evp, buf, sz, spacesub)$/
- checkcompat	conf.c	/^checkcompat(to, e)$/
- checkfd012	util.c	/^checkfd012(where)$/
- checkfdopen	util.c	/^checkfdopen(fd, where)$/
- checkfds	util.c	/^checkfds(where)$/
- checksmtpattack	srvrsmtp.c	/^checksmtpattack(pcounter, maxcount, cname)$/
- chompheader	headers.c	/^chompheader(line, def, hdrp, e)$/
- chownsafe	conf.c	/^chownsafe(fd)$/
- cleanstrcpy	util.c	/^cleanstrcpy(t, f, l)$/
- clearenvelope	envelope.c	/^clearenvelope(e, fullclear)$/
- closexscript	envelope.c	/^closexscript(e)$/
- clrdaemon	daemon.c	/^clrdaemon()$/
- clrevent	clock.c	/^clrevent(ev)$/
- collect	collect.c	/^collect(fp, smtpmode, requeueflag, hdrp, e)$/
- collecttimeout	collect.c	/^collecttimeout(timeout)$/
- commaize	headers.c	/^commaize(h, p, oldstyle, mci, e)$/
- connecttimeout	daemon.c	/^connecttimeout()$/
- convtime	convtime.c	/^convtime(p, units)$/
- copyheader	headers.c	/^copyheader(header)$/
- copyplist	util.c	/^copyplist(list, copycont)$/
- copyqueue	util.c	/^copyqueue(addr)$/
- crackaddr	headers.c	/^crackaddr(addr)$/
- curtime	util.c	/^curtime()$/
- datatimeout	usersmtp.c	/^datatimeout()$/
- db_map_close	map.c	/^db_map_close(map)$/
- db_map_lookup	map.c	/^db_map_lookup(map, name, av, statp)$/
- db_map_open	map.c	/^db_map_open(map, mode, dbtype, openinfo)$/
- db_map_store	map.c	/^db_map_store(map, lhs, rhs)$/
- defcharset	mime.c	/^defcharset(e)$/
- define	macro.c	/^define(n, v, e)$/
- deliver	deliver.c	/^deliver(e, firstto)$/
- denlstring	util.c	/^denlstring(s, strict, logattacks)$/
- dequote_init	parseaddr.c	/^dequote_init(map, args)$/
- dequote_map	parseaddr.c	/^dequote_map(map, name, av, statp)$/
- dfopen	util.c	/^dfopen(filename, omode, cmode)$/
- dgux_inet_addr	conf.c	/^dgux_inet_addr(host)$/
- disconnect	main.c	/^disconnect(droplev, e)$/
- dns_getcanonname	domain.c	/^dns_getcanonname(host, hbsize, trymx, statp)$/
- dofork	deliver.c	/^dofork()$/
- dopr	conf.c	/^dopr( buffer, format, args )$/
- dopr_outch	conf.c	/^dopr_outch( c )$/
- dostr	conf.c	/^dostr( str , cut)$/
- dowork	queue.c	/^dowork(id, forkflag, requeueflag, e)$/
- drop_privileges	main.c	/^drop_privileges()$/
- dropenvelope	envelope.c	/^dropenvelope(e, fulldrop)$/
- dsntoexitstat	sysexits.c	/^dsntoexitstat(dsncode)$/
- dump_class	main.c	/^dump_class(s, id)$/
- dumpfd	util.c	/^dumpfd(fd, printclosed, logit)$/
- dumpstate	main.c	/^dumpstate(when)$/
- eatfrom	collect.c	/^eatfrom(fm, e)$/
- eatheader	headers.c	/^eatheader(e, full)$/
- emptyaddr	parseaddr.c	/^emptyaddr(a)$/
- endmailer	deliver.c	/^endmailer(mci, e, pv)$/
- endsleep	clock.c	/^endsleep()$/
- enoughdiskspace	conf.c	/^enoughdiskspace(msize)$/
- errbody	savemail.c	/^errbody(mci, e, separator)$/
- errstring	err.c	/^errstring(errnum)$/
- esmtp_check	usersmtp.c	/^esmtp_check(line, firstline, m, mci, e)$/
- expand	macro.c	/^expand(s, buf, bufsize, e)$/
- extract_canonname	map.c	/^extract_canonname(name, line, cbuf, cbuflen)$/
- fgetfolded	util.c	/^fgetfolded(buf, n, f)$/
- fileclass	readcf.c	/^fileclass(class, filename, fmt, safe, optional)$/
- finduser	recipient.c	/^finduser(name, fuzzyp)$/
- finis	main.c	/^finis()$/
- fixcrlf	util.c	/^fixcrlf(line, stripnl)$/
- flush_errors	err.c	/^flush_errors(print)$/
- fmtmsg	err.c	/^fmtmsg(eb, to, num, eno, fmt, ap)$/
- fmtnum	conf.c	/^fmtnum(  value, base, dosign, ljust, len, zpad )$/
- fmtstr	conf.c	/^fmtstr(  value, ljust, len, zpad, maxwidth )$/
- forward	alias.c	/^forward(user, sendq, aliaslevel, e)$/
- freediskspace	conf.c	/^freediskspace(dir, bsize)$/
- fsync	conf.c	/^fsync(fd)$/
- get_column	util.c	/^get_column(line, col, delim, buf, buflen)$/
- getauthinfo	daemon.c	/^getauthinfo(fd)$/
- getcanonname	map.c	/^getcanonname(host, hbsize, trymx)$/
- getcfname	conf.c	/^getcfname()$/
- getctladdr	recipient.c	/^getctladdr(a)$/
- getdtsize	conf.c	/^getdtsize()$/
- getextenv	main.c	/^getextenv(envar)$/
- gethostalias	domain.c	/^gethostalias(host)$/
- getla	conf.c	/^getla()$/
- getloadavg	conf.c	/^int getloadavg( call_data )$/
- getmxrr	domain.c	/^getmxrr(host, mxhosts, droplocalhost, rcode)$/
- getopt	conf.c	/^getopt(nargc,nargv,ostr)$/
- getrequests	daemon.c	/^getrequests(e)$/
- giveresponse	deliver.c	/^giveresponse(stat, m, mci, ctladdr, xstart, e)$/
- grow_wlist	queue.c	/^grow_wlist()$/
- hard_syslog	conf.c	/^hard_syslog(int pri, XCNST char *msg, ...)$/
- hash_map_open	map.c	/^hash_map_open(map, mode)$/
- helo_options	usersmtp.c	/^helo_options(line, firstline, m, mci, e)$/
- help	srvrsmtp.c	/^help(topic)$/
- hes_map_lookup	map.c	/^hes_map_lookup(map, name, av, statp)$/
- hes_map_open	map.c	/^hes_map_open(map, mode)$/
- hes_udb_get	udb.c	/^hes_udb_get(key, info)$/
- holdsigs	conf.c	/^holdsigs()$/
- host_map_init	conf.c	/^host_map_init(map, args)$/
- host_map_lookup	daemon.c	/^host_map_lookup(map, name, av, statp)$/
- hostnamebyanyaddr	daemon.c	/^hostnamebyanyaddr(sap)$/
- hostsignature	deliver.c	/^hostsignature(m, host, e)$/
- hvalue	headers.c	/^hvalue(field, header)$/
- impl_map_close	map.c	/^impl_map_close(map)$/
- impl_map_lookup	map.c	/^impl_map_lookup(map, name, av, pstat)$/
- impl_map_open	map.c	/^impl_map_open(map, mode)$/
- impl_map_store	map.c	/^impl_map_store(map, lhs, rhs)$/
- include	recipient.c	/^include(fname, forwarding, ctladdr, sendq, aliasle/
- includetimeout	recipient.c	/^includetimeout()$/
- init_md	conf.c	/^init_md(argc, argv)$/
- init_vendor_macros	conf.c	/^init_vendor_macros(e)$/
- initgroups	conf.c	/^initgroups(name, basegid)$/
- inithostmaps	conf.c	/^inithostmaps()$/
- initmacros	main.c	/^initmacros(e)$/
- initmaps	map.c	/^initmaps(rebuild, e)$/
- initsetproctitle	conf.c	/^initsetproctitle(argc, argv, envp)$/
- initsys	envelope.c	/^initsys(e)$/
- inittimeouts	readcf.c	/^inittimeouts(val)$/
- intindebug	main.c	/^intindebug(sig)$/
- intsig	main.c	/^intsig(sig)$/
- invalidaddr	parseaddr.c	/^invalidaddr(addr, delimptr)$/
- isboundary	mime.c	/^isboundary(line, boundaries)$/
- isheader	headers.c	/^isheader(h)$/
- ldap_map_close	map.c	/^ldap_map_close(map)$/
- ldap_map_dequote	map.c	/^ldap_map_dequote(str)$/
- ldap_map_lookup	map.c	/^ldap_map_lookup(map, name, av, statp)$/
- ldap_map_open	map.c	/^ldap_map_open(map, mode)$/
- ldap_map_parseargs	map.c	/^ldap_map_parseargs(map,args)$/
- ldap_map_start	map.c	/^ldap_map_start(map)$/
- load_if_names	conf.c	/^load_if_names()$/
- local_hostname_length	conf.c	/^local_hostname_length(hostname)$/
- lockfile	conf.c	/^lockfile(fd, filename, ext, type)$/
- logdelivery	deliver.c	/^logdelivery(m, mci, stat, ctladdr, xstart, e)$/
- logsender	headers.c	/^logsender(e, msgid)$/
- loseqfile	queue.c	/^loseqfile(e, why)$/
- lower	util.c	/^lower(c)$/
- macid	macro.c	/^macid(p, ep)$/
- macname	macro.c	/^macname(n)$/
- macvalue	macro.c	/^macvalue(n, e)$/
- mail_esmtp_args	srvrsmtp.c	/^mail_esmtp_args(kp, vp, e)$/
- mailfile	deliver.c	/^mailfile(filename, ctladdr, sfflags, e)$/
- makeargv	readcf.c	/^makeargv(p)$/
- makeconnection	daemon.c	/^makeconnection(host, port, mci, e)$/
- makelower	util.c	/^makelower(p)$/
- makemailer	readcf.c	/^makemailer(line)$/
- makemapentry	readcf.c	/^makemapentry(line)$/
- map_init	map.c	/^map_init(s, rebuild)$/
- map_lookup	parseaddr.c	/^map_lookup(map, key, argvect, pstat, e)$/
- map_parseargs	map.c	/^map_parseargs(map, ap)$/
- map_rewrite	map.c	/^map_rewrite(map, s, slen, av)$/
- maplocaluser	parseaddr.c	/^maplocaluser(a, sendq, aliaslevel, e)$/
- markfailure	deliver.c	/^markfailure(e, q, mci, rcode)$/
- markstats	stats.c	/^markstats(e, to)$/
- mci_cache	mci.c	/^mci_cache(mci)$/
- mci_dump	mci.c	/^mci_dump(mci, logit)$/
- mci_dump_all	mci.c	/^mci_dump_all(logit)$/
- mci_flush	mci.c	/^mci_flush(doquit, allbut)$/
- mci_generate_persistent_path	mci.c	/^mci_generate_persistent_path(host, path, pathlen, /
- mci_get	mci.c	/^mci_get(host, m)$/
- mci_load_persistent	mci.c	/^mci_load_persistent(mci)$/
- mci_lock_host	mci.c	/^mci_lock_host(mci)$/
- mci_lock_host_statfile	mci.c	/^mci_lock_host_statfile(mci)$/
- mci_print_persistent	mci.c	/^mci_print_persistent(pathname, hostname)$/
- mci_purge_persistent	mci.c	/^mci_purge_persistent(pathname, hostname)$/
- mci_read_persistent	mci.c	/^mci_read_persistent(fp, mci)$/
- mci_scan	mci.c	/^mci_scan(savemci)$/
- mci_setstat	mci.c	/^mci_setstat(mci, xstat, dstat, rstat)$/
- mci_store_persistent	mci.c	/^mci_store_persistent(mci)$/
- mci_traverse_persistent	mci.c	/^mci_traverse_persistent(action, pathname)$/
- mci_uncache	mci.c	/^mci_uncache(mcislot, doquit)$/
- mci_unlock_host	mci.c	/^mci_unlock_host(mci)$/
- message	err.c	/^message(const char *msg, ...)$/
- mime7to8	mime.c	/^mime7to8(mci, header, e)$/
- mime8to7	mime.c	/^mime8to7(mci, header, e, boundaries, flags)$/
- mime_fromqp	mime.c	/^mime_fromqp(infile, outfile, state, maxlen)$/
- mime_getchar	mime.c	/^mime_getchar(fp, boundaries, btp)$/
- mime_getchar_crlf	mime.c	/^mime_getchar_crlf(fp, boundaries, btp)$/
- mimeboundary	mime.c	/^mimeboundary(line, boundaries)$/
- munchstring	readcf.c	/^munchstring(p, delimptr, delim)$/
- mxrand	domain.c	/^mxrand(host)$/
- myhostname	daemon.c	/^myhostname(hostbuf, size)$/
- ndbm_map_close	map.c	/^ndbm_map_close(map)$/
- ndbm_map_lookup	map.c	/^ndbm_map_lookup(map, name, av, statp)$/
- ndbm_map_open	map.c	/^ndbm_map_open(map, mode)$/
- ndbm_map_store	map.c	/^ndbm_map_store(map, lhs, rhs)$/
- newenvelope	envelope.c	/^newenvelope(e, parent)$/
- ni_getcanonname	map.c	/^ni_getcanonname(name, hbsize, statp)$/
- ni_map_lookup	map.c	/^ni_map_lookup(map, name, av, statp)$/
- ni_map_open	map.c	/^ni_map_open(map, mode)$/
- ni_propval	map.c	/^ni_propval(keydir, keyprop, keyval, valprop, sepch/
- nis_getcanonname	map.c	/^nis_getcanonname(name, hbsize, statp)$/
- nis_map_lookup	map.c	/^nis_map_lookup(map, name, av, statp)$/
- nis_map_open	map.c	/^nis_map_open(map, mode)$/
- nisplus_default_domain	map.c	/^nisplus_default_domain()$/
- nisplus_getcanonname	map.c	/^nisplus_getcanonname(name, hbsize, statp)$/
- nisplus_map_lookup	map.c	/^nisplus_map_lookup(map, name, av, statp)$/
- nisplus_map_open	map.c	/^nisplus_map_open(map, mode)$/
- nmessage	err.c	/^nmessage(const char *msg, ...)$/
- null_map_close	map.c	/^null_map_close(map)$/
- null_map_lookup	map.c	/^null_map_lookup(map, key, args, pstat)$/
- null_map_open	map.c	/^null_map_open(map, mode)$/
- null_map_store	map.c	/^null_map_store(map, key, val)$/
- obsolete	main.c	/^obsolete(argv)$/
- opendaemonsocket	daemon.c	/^opendaemonsocket(firsttime)$/
- openxscript	envelope.c	/^openxscript(e)$/
- orderq	queue.c	/^orderq(doall)$/
- parseaddr	parseaddr.c	/^parseaddr(addr, a, flags, delim, delimptr, e)$/
- path_is_dir	util.c	/^path_is_dir(pathname, createflag)$/
- pintvl	convtime.c	/^pintvl(intvl, brief)$/
- poststats	stats.c	/^poststats(sfile)$/
- prescan	parseaddr.c	/^prescan(addr, delim, pvpbuf, pvpbsize, delimptr, t/
- priencode	headers.c	/^priencode(p)$/
- printaddr	parseaddr.c	/^printaddr(a, follow)$/
- printav	util.c	/^printav(av)$/
- printctladdr	queue.c	/^printctladdr(a, tfp)$/
- printenvflags	envelope.c	/^printenvflags(e)$/
- printmailer	readcf.c	/^printmailer(m)$/
- printopenfds	util.c	/^printopenfds(logit)$/
- printqueue	queue.c	/^printqueue()$/
- printrules	readcf.c	/^printrules()$/
- printvrfyaddr	srvrsmtp.c	/^printvrfyaddr(a, last, vrfy)$/
- proc_list_add	util.c	/^proc_list_add(pid)$/
- proc_list_clear	util.c	/^proc_list_clear()$/
- proc_list_drop	util.c	/^proc_list_drop(pid)$/
- proc_list_probe	util.c	/^proc_list_probe()$/
- prog_map_lookup	map.c	/^prog_map_lookup(map, name, av, statp)$/
- prog_open	util.c	/^prog_open(argv, pfd, e)$/
- pruneroute	savemail.c	/^pruneroute(addr)$/
- put_vanilla_header	headers.c	/^put_vanilla_header(h, v, mci)$/
- putbody	deliver.c	/^putbody(mci, e, separator)$/
- putenv	conf.c	/^putenv(str)$/
- puterrmsg	err.c	/^puterrmsg(msg)$/
- putfromline	deliver.c	/^putfromline(mci, e)$/
- putheader	headers.c	/^putheader(mci, hdr, e)$/
- putline	util.c	/^putline(l, mci)$/
- putoutmsg	err.c	/^putoutmsg(msg, holdmsg, heldmsg)$/
- putxline	util.c	/^putxline(l, mci, pxflags)$/
- queuename	queue.c	/^queuename(e, type)$/
- queueup	queue.c	/^queueup(e, announce)$/
- rcpt_esmtp_args	srvrsmtp.c	/^rcpt_esmtp_args(a, kp, vp, e)$/
- readaliases	alias.c	/^readaliases(map, af, announcestats, logstats)$/
- readcf	readcf.c	/^readcf(cfname, safe, e)$/
- readqf	queue.c	/^readqf(e)$/
- readtimeout	util.c	/^readtimeout(timeout)$/
- reapchild	conf.c	/^reapchild(sig)$/
- rebuildaliases	alias.c	/^rebuildaliases(map, automatic)$/
- recipient	recipient.c	/^recipient(a, sendq, aliaslevel, e)$/
- refuseconnections	conf.c	/^refuseconnections(port)$/
- releasesignal	conf.c	/^releasesignal(sig)$/
- remotename	parseaddr.c	/^remotename(name, m, flags, pstat, e)$/
- reply	usersmtp.c	/^reply(m, mci, e, timeout, pfunc)$/
- resetlimits	conf.c	/^resetlimits()$/
- returntosender	savemail.c	/^returntosender(msg, returnq, flags, e)$/
- rewrite	parseaddr.c	/^rewrite(pvp, ruleset, reclevel, e)$/
- rlsesigs	conf.c	/^rlsesigs()$/
- rscheck	parseaddr.c	/^rscheck(rwset, p1, p2, e)$/
- runinchild	srvrsmtp.c	/^runinchild(label, e)$/
- runqueue	queue.c	/^runqueue(forkflag, verbose)$/
- runqueueevent	queue.c	/^runqueueevent(forkflag)$/
- safefile	util.c	/^safefile(fn, uid, gid, uname, flags, mode, st)$/
- safefopen	util.c	/^safefopen(fn, omode, cmode, sff)$/
- sameaddr	parseaddr.c	/^sameaddr(a, b)$/
- savemail	savemail.c	/^savemail(e, sendbody)$/
- secureware_setup_secure	conf.c	/^secureware_setup_secure(uid)$/
- self_reference	recipient.c	/^self_reference(a, e)$/
- sendall	deliver.c	/^sendall(e, mode)$/
- sendenvelope	deliver.c	/^sendenvelope(e, mode)$/
- sendtoargv	recipient.c	/^sendtoargv(argv, e)$/
- sendtolist	recipient.c	/^sendtolist(list, ctladdr, sendq, aliaslevel, e)$/
- seq_map_close	map.c	/^seq_map_close(map)$/
- seq_map_lookup	map.c	/^seq_map_lookup(map, key, args, pstat)$/
- seq_map_parse	map.c	/^seq_map_parse(map, ap)$/
- seq_map_store	map.c	/^seq_map_store(map, key, val)$/
- setalias	alias.c	/^setalias(spec)$/
- setclass	readcf.c	/^setclass(class, str)$/
- setctluser	queue.c	/^setctluser(user, qfver)$/
- setdaemonoptions	daemon.c	/^setdaemonoptions(p)$/
- setdefaults	conf.c	/^setdefaults(e)$/
- setdefuser	conf.c	/^setdefuser()$/
- setevent	clock.c	/^setevent(intvl, func, arg)$/
- setoption	readcf.c	/^setoption(opt, val, safe, sticky, e)$/
- setproctitle	conf.c	/^setproctitle(const char *fmt, ...)$/
- setsender	envelope.c	/^setsender(from, e, delimptr, delimchar, internal)$/
- setsignal	conf.c	/^setsignal(sig, handler)$/
- settime	envelope.c	/^settime(e)$/
- settimeout	readcf.c	/^settimeout(name, val)$/
- setupmailers	conf.c	/^setupmailers()$/
- setupmaps	conf.c	/^setupmaps()$/
- setuserenv	main.c	/^setuserenv(envar, value)$/
- setvendor	conf.c	/^setvendor(vendor)$/
- sfgets	util.c	/^sfgets(buf, siz, fp, timeout, during)$/
- shorten_hostname	util.c	/^shorten_hostname(host)$/
- shortenstring	util.c	/^shortenstring(s, m)$/
- shouldqueue	conf.c	/^shouldqueue(pri, ctime)$/
- sighup	main.c	/^sighup(sig)$/
- sigmask	clock.c	/^#  define sigmask(s)	(1 << ((s) - 1))$/
- sigusr1	main.c	/^sigusr1(sig)$/
- skipword	srvrsmtp.c	/^skipword(p, w)$/
- sleep	clock.c	/^sleep(intvl)$/
- sm_gethostbyaddr	conf.c	/^sm_gethostbyaddr(addr, len, type)$/
- sm_gethostbyname	conf.c	/^sm_gethostbyname(name)$/
- sm_getpwnam	conf.c	/^sm_getpwnam(user)$/
- sm_getpwuid	conf.c	/^sm_getpwuid(uid)$/
- smtp	srvrsmtp.c	/^smtp(nullserver, e)$/
- smtpdata	usersmtp.c	/^smtpdata(m, mci, e)$/
- smtpgetstat	usersmtp.c	/^smtpgetstat(m, mci, e)$/
- smtpinit	usersmtp.c	/^smtpinit(m, mci, e)$/
- smtpmailfrom	usersmtp.c	/^smtpmailfrom(m, mci, e)$/
- smtpmessage	usersmtp.c	/^smtpmessage(char *f, MAILER *m, MCI *mci, ...)$/
- smtpprobe	usersmtp.c	/^smtpprobe(mci)$/
- smtpquit	usersmtp.c	/^smtpquit(m, mci, e)$/
- smtprcpt	usersmtp.c	/^smtprcpt(to, m, mci, e)$/
- smtprset	usersmtp.c	/^smtprset(m, mci, e)$/
- smtptodsn	savemail.c	/^smtptodsn(smtpstat)$/
- snprintf	conf.c	/^snprintf(char *str, size_t count, const char *fmt,/
- stab	stab.c	/^stab(name, type, op)$/
- stab_map_lookup	map.c	/^stab_map_lookup(map, name, av, pstat)$/
- stab_map_open	map.c	/^stab_map_open(map, mode)$/
- stab_map_store	map.c	/^stab_map_store(map, lhs, rhs)$/
- stabapply	stab.c	/^stabapply(func, arg)$/
- strcontainedin	util.c	/^strcontainedin(a, b)$/
- stripquotes	util.c	/^stripquotes(s)$/
- strstr	conf.c	/^strstr(big, little)$/
- strtol	conf.c	/^strtol(nptr, endptr, base)$/
- strtorwset	readcf.c	/^strtorwset(p, endp, stabmode)$/
- sunet_id_hash	map.c	/^sunet_id_hash(str)$/
- switch_map_find	conf.c	/^switch_map_find(service, maptype, mapreturn)$/
- switch_map_open	map.c	/^switch_map_open(map, mode)$/
- syserr	err.c	/^syserr(const char *fmt, ...)$/
- tTflag	trace.c	/^tTflag(s)$/
- tTsetup	trace.c	/^tTsetup(vect, size, defflags)$/
- tell	conf.c	/^#define tell(s)	if (opterr) {fputs(*nargv,stderr);/
- testmodeline	main.c	/^testmodeline(line, e)$/
- text_getcanonname	map.c	/^text_getcanonname(name, hbsize, statp)$/
- text_map_lookup	map.c	/^text_map_lookup(map, name, av, statp)$/
- text_map_open	map.c	/^text_map_open(map, mode)$/
- tferror	collect.c	/^tferror(tf, e)$/
- tick	clock.c	/^tick(arg)$/
- toomany	readcf.c	/^toomany(id, maxcnt)$/
- transienterror	conf.c	/^transienterror(err)$/
- translate_dollars	readcf.c	/^translate_dollars(bp)$/
- ttypath	conf.c	/^ttypath()$/
- udb_map_lookup	udb.c	/^udb_map_lookup(map, name, av, statp)$/
- udbexpand	udb.c	/^udbexpand(a, sendq, aliaslevel, e)$/
- udbmatch	udb.c	/^udbmatch(user, field)$/
- udbsender	udb.c	/^udbsender(sender)$/
- uname	conf.c	/^uname(name)$/
- unlockqueue	queue.c	/^unlockqueue(e)$/
- unsetenv	conf.c	/^unsetenv(name)$/
- user_map_lookup	map.c	/^user_map_lookup(map, key, av, statp)$/
- user_map_open	map.c	/^user_map_open(map, mode)$/
- username	conf.c	/^username()$/
- usershellok	conf.c	/^usershellok(user, shell)$/
- usrerr	err.c	/^usrerr(const char *fmt, ...)$/
- validate_connection	conf.c	/^validate_connection(sap, hostname, e)$/
- vendor_daemon_setup	conf.c	/^vendor_daemon_setup(e)$/
- vendor_post_defaults	conf.c	/^vendor_post_defaults(e)$/
- vendor_pre_defaults	conf.c	/^vendor_pre_defaults(e)$/
- vendor_set_uid	conf.c	/^vendor_set_uid(uid)$/
- vfprintf	conf.c	/^vfprintf(fp, fmt, ap)$/
- vsnprintf	conf.c	/^vsnprintf(str, count, fmt, args)$/
- vsprintf	conf.c	/^vsprintf(s, fmt, ap)$/
- waitfor	util.c	/^waitfor(pid)$/
- wordinclass	macro.c	/^wordinclass(str, cl)$/
- workcmpf0	queue.c	/^workcmpf0(a, b)$/
- workcmpf1	queue.c	/^workcmpf1(a, b)$/
- workcmpf2	queue.c	/^workcmpf2(a, b)$/
- workcmpf3	queue.c	/^workcmpf3(a, b)$/
- writable	recipient.c	/^writable(filename, ctladdr, flags)$/
- xalloc	util.c	/^xalloc(sz)$/
- xfclose	util.c	/^xfclose(fp, a, b)$/
- xputs	util.c	/^xputs(s)$/
- xtextify	savemail.c	/^xtextify(t, taboo)$/
- xtextok	savemail.c	/^xtextok(s)$/
- xunlink	util.c	/^xunlink(f)$/
- xuntextify	savemail.c	/^xuntextify(t)$/
--- 0 ----
diff -Ncr sendmail-8.8.5/src/trace.c sendmail-8.8.6/src/trace.c
*** sendmail-8.8.5/src/trace.c	Wed Feb 21 17:01:20 1996
--- sendmail-8.8.6/src/trace.c	Sat Feb  1 16:24:48 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)trace.c	8.5 (Berkeley) 2/21/96";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)trace.c	8.6 (Berkeley) 2/1/97";
  #endif /* not lint */
  
  # include "sendmail.h"
diff -Ncr sendmail-8.8.5/src/udb.c sendmail-8.8.6/src/udb.c
*** sendmail-8.8.5/src/udb.c	Fri Dec  6 06:56:42 1996
--- sendmail-8.8.6/src/udb.c	Thu May 29 12:55:52 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 36,44 ****
  
  #ifndef lint
  #if USERDB
! static char sccsid [] = "@(#)udb.c	8.47 (Berkeley) 12/6/96 (with USERDB)";
  #else
! static char sccsid [] = "@(#)udb.c	8.47 (Berkeley) 12/6/96 (without USERDB)";
  #endif
  #endif
  
--- 36,44 ----
  
  #ifndef lint
  #if USERDB
! static char sccsid [] = "@(#)udb.c	8.51 (Berkeley) 5/29/97 (with USERDB)";
  #else
! static char sccsid [] = "@(#)udb.c	8.51 (Berkeley) 5/29/97 (without USERDB)";
  #endif
  #endif
  
***************
*** 120,126 ****
  	char	*val;
  };
  
! extern int _udbx_init __P((void));
  /*
  **  UDBEXPAND -- look up user in database and expand
  **
--- 120,126 ----
  	char	*val;
  };
  
! extern int _udbx_init __P((ENVELOPE *));
  /*
  **  UDBEXPAND -- look up user in database and expand
  **
***************
*** 173,179 ****
  	/* on first call, locate the database */
  	if (!UdbInitialized)
  	{
! 		if (_udbx_init() == EX_TEMPFAIL)
  			return EX_TEMPFAIL;
  	}
  
--- 173,179 ----
  	/* on first call, locate the database */
  	if (!UdbInitialized)
  	{
! 		if (_udbx_init(e) == EX_TEMPFAIL)
  			return EX_TEMPFAIL;
  	}
  
***************
*** 259,272 ****
  				breakout = TRUE;
  				if (info.size >= userleft - 1)
  				{
! 					char *nuser = xalloc(usersize + MEMCHUNKSIZE);
  
  					bcopy(user, nuser, usersize);
  					if (user != userbuf)
  						free(user);
  					user = nuser;
! 					usersize += MEMCHUNKSIZE;
! 					userleft += MEMCHUNKSIZE;
  				}
  				p = &user[strlen(user)];
  				if (p != user)
--- 259,277 ----
  				breakout = TRUE;
  				if (info.size >= userleft - 1)
  				{
! 					char *nuser;
! 					int size = MEMCHUNKSIZE;
! 
! 					if (info.size > MEMCHUNKSIZE)
! 						size = info.size;
! 					nuser = xalloc(usersize + size);
  
  					bcopy(user, nuser, usersize);
  					if (user != userbuf)
  						free(user);
  					user = nuser;
! 					usersize += size;
! 					userleft += size;
  				}
  				p = &user[strlen(user)];
  				if (p != user)
***************
*** 287,298 ****
  				break;
  
  			message("expanded to %s", user);
- #ifdef LOG
  			if (LogLevel >= 10)
! 				syslog(LOG_INFO, "%s: expand %.100s => %s",
! 					e->e_id, e->e_to,
  					shortenstring(user, 203));
- #endif
  			naddrs = sendtolist(user, a, sendq, aliaslevel + 1, e);
  			if (naddrs > 0 && !bitset(QSELFREF, a->q_flags))
  			{
--- 292,302 ----
  				break;
  
  			message("expanded to %s", user);
  			if (LogLevel >= 10)
! 				sm_syslog(LOG_INFO, e->e_id,
! 					"expand %.100s => %s",
! 					e->e_to,
  					shortenstring(user, 203));
  			naddrs = sendtolist(user, a, sendq, aliaslevel + 1, e);
  			if (naddrs > 0 && !bitset(QSELFREF, a->q_flags))
  			{
***************
*** 417,428 ****
  			user[info.size] = '\0';
  
  			message("hesioded to %s", user);
- #ifdef LOG
  			if (LogLevel >= 10)
! 				syslog(LOG_INFO, "%s: hesiod %.100s => %s",
! 					e->e_id, e->e_to,
  					shortenstring(user, 203));
- #endif
  			naddrs = sendtolist(user, a, sendq, aliaslevel + 1, e);
  
  			if (naddrs > 0 && !bitset(QSELFREF, a->q_flags))
--- 421,431 ----
  			user[info.size] = '\0';
  
  			message("hesioded to %s", user);
  			if (LogLevel >= 10)
! 				sm_syslog(LOG_INFO, e->e_id,
! 					"hesiod %.100s => %s",
! 					e->e_to,
  					shortenstring(user, 203));
  			naddrs = sendtolist(user, a, sendq, aliaslevel + 1, e);
  
  			if (naddrs > 0 && !bitset(QSELFREF, a->q_flags))
***************
*** 539,545 ****
  
  	if (!UdbInitialized)
  	{
! 		if (_udbx_init() == EX_TEMPFAIL)
  			return NULL;
  	}
  
--- 542,548 ----
  
  	if (!UdbInitialized)
  	{
! 		if (_udbx_init(CurEnv) == EX_TEMPFAIL)
  			return NULL;
  	}
  
***************
*** 552,558 ****
  		return NULL;
  
  	/* long names can never match and are a pain to deal with */
! 	if ((strlen(user) + strlen(field)) > sizeof keybuf - 4)
  		return NULL;
  
  	/* names beginning with colons indicate metadata */
--- 555,564 ----
  		return NULL;
  
  	/* long names can never match and are a pain to deal with */
! 	i = strlen(field);
! 	if (i < sizeof "maildrop")
! 		i = sizeof "maildrop";
! 	if ((strlen(user) + i) > sizeof keybuf - 4)
  		return NULL;
  
  	/* names beginning with colons indicate metadata */
***************
*** 785,791 ****
  **  _UDBX_INIT -- parse the UDB specification, opening any valid entries.
  **
  **	Parameters:
! **		none.
  **
  **	Returns:
  **		EX_TEMPFAIL -- if it appeared it couldn't get hold of a
--- 791,797 ----
  **  _UDBX_INIT -- parse the UDB specification, opening any valid entries.
  **
  **	Parameters:
! **		e -- the current envelope.
  **
  **	Returns:
  **		EX_TEMPFAIL -- if it appeared it couldn't get hold of a
***************
*** 800,806 ****
  #define MAXUDBOPTS	27
  
  int
! _udbx_init()
  {
  	register char *p;
  	register struct udbent *up;
--- 806,813 ----
  #define MAXUDBOPTS	27
  
  int
! _udbx_init(e)
! 	ENVELOPE *e;
  {
  	register char *p;
  	register struct udbent *up;
***************
*** 957,975 ****
  				{
  					int saveerrno = errno;
  
! 					printf("dbopen(%s): %s",
  						up->udb_dbname,
  						errstring(errno));
  					errno = saveerrno;
  				}
  				if (errno != ENOENT && errno != EACCES)
  				{
- #ifdef LOG
  					if (LogLevel > 2)
! 						syslog(LOG_ERR, "dbopen(%s): %s",
  							up->udb_dbname,
  							errstring(errno));
- #endif
  					up->udb_type = UDB_EOLIST;
  					if (up->udb_dbname != spec)
  						free(up->udb_dbname);
--- 964,981 ----
  				{
  					int saveerrno = errno;
  
! 					printf("dbopen(%s): %s\n",
  						up->udb_dbname,
  						errstring(errno));
  					errno = saveerrno;
  				}
  				if (errno != ENOENT && errno != EACCES)
  				{
  					if (LogLevel > 2)
! 						sm_syslog(LOG_ERR, e->e_id,
! 							"dbopen(%s): %s",
  							up->udb_dbname,
  							errstring(errno));
  					up->udb_type = UDB_EOLIST;
  					if (up->udb_dbname != spec)
  						free(up->udb_dbname);
diff -Ncr sendmail-8.8.5/src/useful.h sendmail-8.8.6/src/useful.h
*** sendmail-8.8.5/src/useful.h	Wed Feb 21 17:01:21 1996
--- sendmail-8.8.6/src/useful.h	Thu May 29 12:55:51 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 31,45 ****
   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   *
!  *	@(#)useful.h	8.5 (Berkeley) 2/21/96
   */
  
  # include <sys/types.h>
  
  /* support for bool type */
  typedef int	bool;
  # define TRUE	1
  # define FALSE	0
  
  # ifndef NULL
  # define NULL	0
--- 31,47 ----
   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   *
!  *	@(#)useful.h	8.7 (Berkeley) 5/29/97
   */
  
  # include <sys/types.h>
  
  /* support for bool type */
  typedef int	bool;
+ #ifndef TRUE
  # define TRUE	1
  # define FALSE	0
+ #endif
  
  # ifndef NULL
  # define NULL	0
diff -Ncr sendmail-8.8.5/src/usersmtp.c sendmail-8.8.6/src/usersmtp.c
*** sendmail-8.8.5/src/usersmtp.c	Sat Jan 18 09:55:16 1997
--- sendmail-8.8.6/src/usersmtp.c	Thu Jun  5 08:29:51 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 36,44 ****
  
  #ifndef lint
  #if SMTP
! static char sccsid[] = "@(#)usersmtp.c	8.80 (Berkeley) 1/18/97 (with SMTP)";
  #else
! static char sccsid[] = "@(#)usersmtp.c	8.80 (Berkeley) 1/18/97 (without SMTP)";
  #endif
  #endif /* not lint */
  
--- 36,44 ----
  
  #ifndef lint
  #if SMTP
! static char sccsid[] = "@(#)usersmtp.c	8.87 (Berkeley) 6/3/97 (with SMTP)";
  #else
! static char sccsid[] = "@(#)usersmtp.c	8.87 (Berkeley) 6/3/97 (without SMTP)";
  #endif
  #endif /* not lint */
  
***************
*** 389,395 ****
  		    !bitset(EF_DONT_MIME, e->e_flags) &&
  		    !bitnset(M_8BITS, m->m_flags))
  			bodytype = "8BITMIME";
! 		if (bodytype != NULL)
  		{
  			strcat(optbuf, " BODY=");
  			strcat(optbuf, bodytype);
--- 389,395 ----
  		    !bitset(EF_DONT_MIME, e->e_flags) &&
  		    !bitnset(M_8BITS, m->m_flags))
  			bodytype = "8BITMIME";
! 		if (bodytype != NULL && strlen(bodytype) + 7 < l)
  		{
  			strcat(optbuf, " BODY=");
  			strcat(optbuf, bodytype);
***************
*** 524,529 ****
--- 524,531 ----
  	{
  		/* exceeded storage allocation */
  		mci_setstat(mci, EX_NOTSTICKY, "5.2.2", SmtpReplyBuffer);
+ 		if (bitset(MCIF_SIZE, mci->mci_flags))
+ 			e->e_flags |= EF_NO_BODY_RETN;
  		return EX_UNAVAILABLE;
  	}
  	else if (REPLYTYPE(r) == 5)
***************
*** 533,546 ****
  		return EX_UNAVAILABLE;
  	}
  
- #ifdef LOG
  	if (LogLevel > 1)
  	{
! 		syslog(LOG_CRIT, "%s: %.100s: SMTP MAIL protocol error: %s",
! 			e->e_id, mci->mci_host,
  			shortenstring(SmtpReplyBuffer, 403));
  	}
- #endif
  
  	/* protocol error -- close up */
  	mci_setstat(mci, EX_PROTOCOL, "5.5.1", SmtpReplyBuffer);
--- 535,547 ----
  		return EX_UNAVAILABLE;
  	}
  
  	if (LogLevel > 1)
  	{
! 		sm_syslog(LOG_CRIT, e->e_id,
! 			"%.100s: SMTP MAIL protocol error: %s",
! 			mci->mci_host,
  			shortenstring(SmtpReplyBuffer, 403));
  	}
  
  	/* protocol error -- close up */
  	mci_setstat(mci, EX_PROTOCOL, "5.5.1", SmtpReplyBuffer);
***************
*** 651,664 ****
  		return EX_UNAVAILABLE;
  	}
  
- #ifdef LOG
  	if (LogLevel > 1)
  	{
! 		syslog(LOG_CRIT, "%s: %.100s: SMTP RCPT protocol error: %s",
! 			e->e_id, mci->mci_host,
  			shortenstring(SmtpReplyBuffer, 403));
  	}
- #endif
  
  	mci_setstat(mci, EX_PROTOCOL, "5.5.1", SmtpReplyBuffer);
  	return EX_PROTOCOL;
--- 652,664 ----
  		return EX_UNAVAILABLE;
  	}
  
  	if (LogLevel > 1)
  	{
! 		sm_syslog(LOG_CRIT, e->e_id,
! 			"%.100s: SMTP RCPT protocol error: %s",
! 			mci->mci_host,
  			shortenstring(SmtpReplyBuffer, 403));
  	}
  
  	mci_setstat(mci, EX_PROTOCOL, "5.5.1", SmtpReplyBuffer);
  	return EX_PROTOCOL;
***************
*** 718,731 ****
  	}
  	else if (r != 354)
  	{
- #ifdef LOG
  		if (LogLevel > 1)
  		{
! 			syslog(LOG_CRIT, "%s: %.100s: SMTP DATA-1 protocol error: %s",
! 				e->e_id, mci->mci_host,
  				shortenstring(SmtpReplyBuffer, 403));
  		}
- #endif
  		smtprset(m, mci, e);
  		mci_setstat(mci, EX_PROTOCOL, "5.5.1", SmtpReplyBuffer);
  		return (EX_PROTOCOL);
--- 718,730 ----
  	}
  	else if (r != 354)
  	{
  		if (LogLevel > 1)
  		{
! 			sm_syslog(LOG_CRIT, e->e_id,
! 				"%.100s: SMTP DATA-1 protocol error: %s",
! 				mci->mci_host,
  				shortenstring(SmtpReplyBuffer, 403));
  		}
  		smtprset(m, mci, e);
  		mci_setstat(mci, EX_PROTOCOL, "5.5.1", SmtpReplyBuffer);
  		return (EX_PROTOCOL);
***************
*** 800,807 ****
  	xstat = EX_NOTSTICKY;
  	if (r == 452)
  		rstat = EX_TEMPFAIL;
- 	else if (r == 552)
- 		rstat = EX_UNAVAILABLE;
  	else if (REPLYTYPE(r) == 4)
  		rstat = xstat = EX_TEMPFAIL;
  	else if (REPLYCLASS(r) != 5)
--- 799,804 ----
***************
*** 809,815 ****
  	else if (REPLYTYPE(r) == 2)
  		rstat = xstat = EX_OK;
  	else if (REPLYTYPE(r) == 5)
! 		rstat = xstat = EX_UNAVAILABLE;
  	else
  		rstat = EX_PROTOCOL;
  	mci_setstat(mci, xstat, smtptodsn(r), SmtpReplyBuffer);
--- 806,812 ----
  	else if (REPLYTYPE(r) == 2)
  		rstat = xstat = EX_OK;
  	else if (REPLYTYPE(r) == 5)
! 		rstat = EX_UNAVAILABLE;
  	else
  		rstat = EX_PROTOCOL;
  	mci_setstat(mci, xstat, smtptodsn(r), SmtpReplyBuffer);
***************
*** 818,831 ****
  	e->e_statmsg = newstr(&SmtpReplyBuffer[4]);
  	if (rstat != EX_PROTOCOL)
  		return rstat;
- #ifdef LOG
  	if (LogLevel > 1)
  	{
! 		syslog(LOG_CRIT, "%s: %.100s: SMTP DATA-2 protocol error: %s",
! 			e->e_id, mci->mci_host,
  			shortenstring(SmtpReplyBuffer, 403));
  	}
- #endif
  	return rstat;
  }
  
--- 815,827 ----
  	e->e_statmsg = newstr(&SmtpReplyBuffer[4]);
  	if (rstat != EX_PROTOCOL)
  		return rstat;
  	if (LogLevel > 1)
  	{
! 		sm_syslog(LOG_CRIT, e->e_id,
! 			"%.100s: SMTP DATA-2 protocol error: %s",
! 			mci->mci_host,
  			shortenstring(SmtpReplyBuffer, 403));
  	}
  	return rstat;
  }
  
***************
*** 877,890 ****
  	else if (REPLYTYPE(r) == 5)
  		stat = EX_UNAVAILABLE;
  	mci_setstat(mci, stat, smtptodsn(r), SmtpReplyBuffer);
- #ifdef LOG
  	if (LogLevel > 1 && stat == EX_PROTOCOL)
  	{
! 		syslog(LOG_CRIT, "%s: %.100s: SMTP DATA-3 protocol error: %s",
! 			e->e_id, mci->mci_host,
  			shortenstring(SmtpReplyBuffer, 403));
  	}
- #endif
  	return stat;
  }
  
--- 873,885 ----
  	else if (REPLYTYPE(r) == 5)
  		stat = EX_UNAVAILABLE;
  	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,
  			shortenstring(SmtpReplyBuffer, 403));
  	}
  	return stat;
  }
  
***************
*** 929,938 ****
  		(void) reply(m, mci, e, TimeOuts.to_quit, NULL);
  		SuprErrs = oldSuprErrs;
  		if (mci->mci_state == MCIS_CLOSED)
- 		{
- 			SuprErrs = oldSuprErrs;
  			return;
- 		}
  	}
  
  	/* now actually close the connection and pick up the zombie */
--- 924,930 ----
***************
*** 1025,1031 ****
  	**  Read the input line, being careful not to hang.
  	*/
  
! 	for (bufp = SmtpReplyBuffer;; bufp = junkbuf)
  	{
  		register char *p;
  		extern time_t curtime();
--- 1017,1024 ----
  	**  Read the input line, being careful not to hang.
  	*/
  
! 	bufp = SmtpReplyBuffer;
! 	for (;;)
  	{
  		register char *p;
  		extern time_t curtime();
***************
*** 1120,1145 ****
  		if (Verbose)
  			nmessage("050 %s", bufp);
  
  		/* process the line */
  		if (pfunc != NULL)
  			(*pfunc)(bufp, firstline, m, mci, e);
  
  		firstline = FALSE;
  
- 		/* if continuation is required, we can go on */
- 		if (bufp[3] == '-')
- 			continue;
- 
- 		/* ignore improperly formated input */
- 		if (!(isascii(bufp[0]) && isdigit(bufp[0])))
- 			continue;
- 
  		/* decode the reply code */
  		r = atoi(bufp);
  
  		/* extra semantics: 0xx codes are "informational" */
! 		if (r >= 100)
  			break;
  	}
  
  	/*
--- 1113,1144 ----
  		if (Verbose)
  			nmessage("050 %s", bufp);
  
+ 		/* ignore improperly formated input */
+ 		if (!(isascii(bufp[0]) && isdigit(bufp[0])) ||
+ 		    !(isascii(bufp[1]) && isdigit(bufp[1])) ||
+ 		    !(isascii(bufp[2]) && isdigit(bufp[2])) ||
+ 		    !(bufp[3] == ' ' || bufp[3] == '-'))
+ 			continue;
+ 
  		/* process the line */
  		if (pfunc != NULL)
  			(*pfunc)(bufp, firstline, m, mci, e);
  
  		firstline = FALSE;
  
  		/* decode the reply code */
  		r = atoi(bufp);
  
  		/* extra semantics: 0xx codes are "informational" */
! 		if (r < 100)
! 			continue;
! 
! 		/* if no continuation lines, return this line */
! 		if (bufp[3] != '-')
  			break;
+ 
+ 		/* first line of real reply -- ignore rest */
+ 		bufp = junkbuf;
  	}
  
  	/*
diff -Ncr sendmail-8.8.5/src/util.c sendmail-8.8.6/src/util.c
*** sendmail-8.8.5/src/util.c	Sun Jan  5 08:46:04 1997
--- sendmail-8.8.6/src/util.c	Wed Jun 11 16:26:44 1997
***************
*** 1,5 ****
  /*
!  * Copyright (c) 1983, 1995, 1996 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
--- 1,5 ----
  /*
!  * Copyright (c) 1983, 1995-1997 Eric P. Allman
   * Copyright (c) 1988, 1993
   *	The Regents of the University of California.  All rights reserved.
   *
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)util.c	8.115 (Berkeley) 1/5/97";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)util.c	8.129 (Berkeley) 6/11/97";
  #endif /* not lint */
  
  # include "sendmail.h"
***************
*** 449,800 ****
  	*bp = '\0';
  }
  /*
- **  SAFEFILE -- return true if a file exists and is safe for a user.
- **
- **	Parameters:
- **		fn -- filename to check.
- **		uid -- user id to compare against.
- **		gid -- group id to compare against.
- **		uname -- user name to compare against (used for group
- **			sets).
- **		flags -- modifiers:
- **			SFF_MUSTOWN -- "uid" must own this file.
- **			SFF_NOSLINK -- file cannot be a symbolic link.
- **		mode -- mode bits that must match.
- **		st -- if set, points to a stat structure that will
- **			get the stat info for the file.
- **
- **	Returns:
- **		0 if fn exists, is owned by uid, and matches mode.
- **		An errno otherwise.  The actual errno is cleared.
- **
- **	Side Effects:
- **		none.
- */
- 
- #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
- 
- #define ST_MODE_NOFILE	0171147		/* unlikely to occur */
- 
- int
- safefile(fn, uid, gid, uname, flags, mode, st)
- 	char *fn;
- 	UID_T uid;
- 	GID_T gid;
- 	char *uname;
- 	int flags;
- 	int mode;
- 	struct stat *st;
- {
- 	register char *p;
- 	register struct group *gr = NULL;
- 	int file_errno = 0;
- 	struct stat stbuf;
- 	struct stat fstbuf;
- 
- 	if (tTd(44, 4))
- 		printf("safefile(%s, uid=%d, gid=%d, flags=%x, mode=%o):\n",
- 			fn, (int) uid, (int) gid, flags, mode);
- 	errno = 0;
- 	if (st == NULL)
- 		st = &fstbuf;
- 
- 	/* first check to see if the file exists at all */
- #ifdef HASLSTAT
- 	if ((bitset(SFF_NOSLINK, flags) ? lstat(fn, st)
- 					: stat(fn, st)) < 0)
- #else
- 	if (stat(fn, st) < 0)
- #endif
- 	{
- 		file_errno = errno;
- 	}
- 	else if (bitset(SFF_SETUIDOK, flags) &&
- 		 !bitset(S_IXUSR|S_IXGRP|S_IXOTH, st->st_mode) &&
- 		 S_ISREG(st->st_mode))
- 	{
- 		/*
- 		**  If final file is setuid, run as the owner of that
- 		**  file.  Gotta be careful not to reveal anything too
- 		**  soon here!
- 		*/
- 
- #ifdef SUID_ROOT_FILES_OK
- 		if (bitset(S_ISUID, st->st_mode))
- #else
- 		if (bitset(S_ISUID, st->st_mode) && st->st_uid != 0)
- #endif
- 		{
- 			uid = st->st_uid;
- 			uname = NULL;
- 		}
- #ifdef SUID_ROOT_FILES_OK
- 		if (bitset(S_ISGID, st->st_mode))
- #else
- 		if (bitset(S_ISGID, st->st_mode) && st->st_gid != 0)
- #endif
- 			gid = st->st_gid;
- 	}
- 
- 	if (!bitset(SFF_NOPATHCHECK, flags) ||
- 	    (uid == 0 && !bitset(SFF_ROOTOK, flags)))
- 	{
- 		/* check the path to the file for acceptability */
- 		for (p = fn; (p = strchr(++p, '/')) != NULL; *p = '/')
- 		{
- 			*p = '\0';
- 			if (stat(fn, &stbuf) < 0)
- 				break;
- 			if (uid == 0 && bitset(S_IWGRP|S_IWOTH, stbuf.st_mode))
- 				message("051 WARNING: writable directory %s",
- 					fn);
- 			if (uid == 0 && !bitset(SFF_ROOTOK, flags))
- 			{
- 				if (bitset(S_IXOTH, stbuf.st_mode))
- 					continue;
- 				break;
- 			}
- 			if (stbuf.st_uid == uid &&
- 			    bitset(S_IXUSR, stbuf.st_mode))
- 				continue;
- 			if (stbuf.st_gid == gid &&
- 			    bitset(S_IXGRP, stbuf.st_mode))
- 				continue;
- #ifndef NO_GROUP_SET
- 			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 != NULL; gp++)
- 					if (strcmp(*gp, uname) == 0)
- 						break;
- 				if (gp != NULL && *gp != NULL &&
- 				    bitset(S_IXGRP, stbuf.st_mode))
- 					continue;
- 			}
- #endif
- 			if (!bitset(S_IXOTH, stbuf.st_mode))
- 				break;
- 		}
- 		if (p != NULL)
- 		{
- 			int ret = errno;
- 
- 			if (ret == 0)
- 				ret = EACCES;
- 			if (tTd(44, 4))
- 				printf("\t[dir %s] %s\n", fn, errstring(ret));
- 			*p = '/';
- 			return ret;
- 		}
- 	}
- 
- 	/*
- 	**  If the target file doesn't exist, check the directory to
- 	**  ensure that it is writable by this user.
- 	*/
- 
- 	if (file_errno != 0)
- 	{
- 		int ret = file_errno;
- 
- 		if (tTd(44, 4))
- 			printf("\t%s\n", errstring(ret));
- 
- 		errno = 0;
- 		if (!bitset(SFF_CREAT, flags))
- 			return ret;
- 
- 		/* check to see if legal to create the file */
- 		p = strrchr(fn, '/');
- 		if (p == NULL)
- 			return ENOTDIR;
- 		*p = '\0';
- 		if (stat(fn, &stbuf) >= 0)
- 		{
- 			int md = S_IWRITE|S_IEXEC;
- 			if (stbuf.st_uid != uid)
- 				md >>= 6;
- 			if ((stbuf.st_mode & md) != md)
- 				errno = EACCES;
- 		}
- 		ret = errno;
- 		if (tTd(44, 4))
- 			printf("\t[final dir %s uid %d mode %lo] %s\n",
- 				fn, (int) stbuf.st_uid, (u_long) stbuf.st_mode,
- 				errstring(ret));
- 		*p = '/';
- 		st->st_mode = ST_MODE_NOFILE;
- 		return ret;
- 	}
- 
- #ifdef S_ISLNK
- 	if (bitset(SFF_NOSLINK, flags) && S_ISLNK(st->st_mode))
- 	{
- 		if (tTd(44, 4))
- 			printf("\t[slink mode %o]\tEPERM\n", st->st_mode);
- 		return EPERM;
- 	}
- #endif
- 	if (bitset(SFF_REGONLY, flags) && !S_ISREG(st->st_mode))
- 	{
- 		if (tTd(44, 4))
- 			printf("\t[non-reg mode %o]\tEPERM\n", st->st_mode);
- 		return EPERM;
- 	}
- 	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]\tEPERM]\n", st->st_mode);
- 		return EPERM;
- 	}
- 	if (st->st_nlink > 1)
- 	{
- 		if (tTd(44, 4))
- 			printf("\t[link count %d]\tEPERM\n", st->st_nlink);
- 		return EPERM;
- 	}
- 
- 	if (uid == 0 && bitset(SFF_OPENASROOT, flags))
- 		;
- 	else if (uid == 0 && !bitset(SFF_ROOTOK, flags))
- 		mode >>= 6;
- 	else if (st->st_uid != uid)
- 	{
- 		mode >>= 3;
- 		if (st->st_gid == gid)
- 			;
- #ifndef NO_GROUP_SET
- 		else if (uname != NULL && !DontInitGroups &&
- 			 ((gr != NULL && gr->gr_gid == st->st_gid) ||
- 			  (gr = getgrgid(st->st_gid)) != NULL))
- 		{
- 			register char **gp;
- 
- 			for (gp = gr->gr_mem; *gp != NULL; gp++)
- 				if (strcmp(*gp, uname) == 0)
- 					break;
- 			if (*gp == NULL)
- 				mode >>= 3;
- 		}
- #endif
- 		else
- 			mode >>= 3;
- 	}
- 	if (tTd(44, 4))
- 		printf("\t[uid %d, nlink %d, stat %lo, mode %lo] ",
- 			(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 ||
- 	     !bitset(SFF_MUSTOWN, flags)) &&
- 	    (st->st_mode & mode) == mode)
- 	{
- 		if (tTd(44, 4))
- 			printf("\tOK\n");
- 		return 0;
- 	}
- 	if (tTd(44, 4))
- 		printf("\tEACCES\n");
- 	return EACCES;
- }
- /*
- **  SAFEFOPEN -- do a file open with extra checking
- **
- **	Parameters:
- **		fn -- the file name to open.
- **		omode -- the open-style mode flags.
- **		cmode -- the create-style mode flags.
- **		sff -- safefile flags.
- **
- **	Returns:
- **		Same as fopen.
- */
- 
- #ifndef O_ACCMODE
- # define O_ACCMODE	(O_RDONLY|O_WRONLY|O_RDWR)
- #endif
- 
- FILE *
- safefopen(fn, omode, cmode, sff)
- 	char *fn;
- 	int omode;
- 	int cmode;
- 	int sff;
- {
- 	int rval;
- 	FILE *fp;
- 	int smode;
- 	struct stat stb, sta;
- 
- 	if (bitset(O_CREAT, omode))
- 		sff |= SFF_CREAT;
- 	smode = 0;
- 	switch (omode & O_ACCMODE)
- 	{
- 	  case O_RDONLY:
- 		smode = S_IREAD;
- 		break;
- 
- 	  case O_WRONLY:
- 		smode = S_IWRITE;
- 		break;
- 
- 	  case O_RDWR:
- 		smode = S_IREAD|S_IWRITE;
- 		break;
- 
- 	  default:
- 		smode = 0;
- 		break;
- 	}
- 	if (bitset(SFF_OPENASROOT, sff))
- 		rval = safefile(fn, 0, 0, NULL, sff, smode, &stb);
- 	else
- 		rval = safefile(fn, RealUid, RealGid, RealUserName,
- 				sff, smode, &stb);
- 	if (rval != 0)
- 	{
- 		errno = rval;
- 		return NULL;
- 	}
- 	if (stb.st_mode == ST_MODE_NOFILE)
- 		omode |= O_EXCL;
- 
- 	fp = dfopen(fn, omode, cmode);
- 	if (fp == NULL)
- 		return NULL;
- 	if (bitset(O_EXCL, omode))
- 		return fp;
- 	if (fstat(fileno(fp), &sta) < 0 ||
- 	    sta.st_nlink != stb.st_nlink ||
- 	    sta.st_dev != stb.st_dev ||
- 	    sta.st_ino != stb.st_ino ||
- 	    sta.st_uid != stb.st_uid ||
- 	    sta.st_gid != stb.st_gid)
- 	{
- 		syserr("554 cannot open: file %s changed after open", fn);
- 		fclose(fp);
- 		errno = EPERM;
- 		return NULL;
- 	}
- 	return fp;
- }
- /*
  **  FIXCRLF -- fix <CR><LF> in line.
  **
  **	Looks for the <CR><LF> combination and turns it into the
--- 449,454 ----
***************
*** 830,909 ****
  	*p = '\0';
  }
  /*
- **  DFOPEN -- determined file open
- **
- **	This routine has the semantics of fopen, except that it will
- **	keep trying a few times to make this happen.  The idea is that
- **	on very loaded systems, we may run out of resources (inodes,
- **	whatever), so this tries to get around it.
- */
- 
- struct omodes
- {
- 	int	mask;
- 	int	mode;
- 	char	*farg;
- } OpenModes[] =
- {
- 	{ O_ACCMODE,		O_RDONLY,		"r"	},
- 	{ O_ACCMODE|O_APPEND,	O_WRONLY,		"w"	},
- 	{ O_ACCMODE|O_APPEND,	O_WRONLY|O_APPEND,	"a"	},
- 	{ O_TRUNC,		0,			"w+"	},
- 	{ O_APPEND,		O_APPEND,		"a+"	},
- 	{ 0,			0,			"r+"	},
- };
- 
- FILE *
- dfopen(filename, omode, cmode)
- 	char *filename;
- 	int omode;
- 	int cmode;
- {
- 	register int tries;
- 	int fd;
- 	register struct omodes *om;
- 	struct stat st;
- 
- 	for (om = OpenModes; om->mask != 0; om++)
- 		if ((omode & om->mask) == om->mode)
- 			break;
- 
- 	for (tries = 0; tries < 10; tries++)
- 	{
- 		sleep((unsigned) (10 * tries));
- 		errno = 0;
- 		fd = open(filename, omode, cmode);
- 		if (fd >= 0)
- 			break;
- 		switch (errno)
- 		{
- 		  case ENFILE:		/* system file table full */
- 		  case EINTR:		/* interrupted syscall */
- #ifdef ETXTBSY
- 		  case ETXTBSY:		/* Apollo: net file locked */
- #endif
- 			continue;
- 		}
- 		break;
- 	}
- 	if (fd >= 0 && fstat(fd, &st) >= 0 && S_ISREG(st.st_mode))
- 	{
- 		int locktype;
- 
- 		/* lock the file to avoid accidental conflicts */
- 		if ((omode & O_ACCMODE) != O_RDONLY)
- 			locktype = LOCK_EX;
- 		else
- 			locktype = LOCK_SH;
- 		(void) lockfile(fd, filename, NULL, locktype);
- 		errno = 0;
- 	}
- 	if (fd < 0)
- 		return NULL;
- 	else
- 		return fdopen(fd, om->farg);
- }
- /*
  **  PUTLINE -- put a line like fputs obeying SMTP conventions
  **
  **	This routine always guarantees outputing a newline (or CRLF,
--- 484,489 ----
***************
*** 925,931 ****
  	register char *l;
  	register MCI *mci;
  {
! 	putxline(l, mci, PXLF_MAPFROM);
  }
  /*
  **  PUTXLINE -- putline with flags bits.
--- 505,511 ----
  	register char *l;
  	register MCI *mci;
  {
! 	putxline(l, strlen(l), mci, PXLF_MAPFROM);
  }
  /*
  **  PUTXLINE -- putline with flags bits.
***************
*** 935,940 ****
--- 515,521 ----
  **
  **	Parameters:
  **		l -- line to put.
+ **		len -- the length of the line.
  **		mci -- the mailer connection information.
  **		pxflags -- flag bits:
  **		    PXLF_MAPFROM -- map From_ to >From_.
***************
*** 948,959 ****
  */
  
  void
! putxline(l, mci, pxflags)
  	register char *l;
  	register MCI *mci;
  	int pxflags;
  {
! 	register char *p;
  	register char svchar;
  	int slop = 0;
  
--- 529,541 ----
  */
  
  void
! putxline(l, len, mci, pxflags)
  	register char *l;
+ 	size_t len;
  	register MCI *mci;
  	int pxflags;
  {
! 	register char *p, *end;
  	register char svchar;
  	int slop = 0;
  
***************
*** 966,977 ****
  				*p = svchar &~ 0200;
  	}
  
  	do
  	{
  		/* find the end of the line */
! 		p = strchr(l, '\n');
  		if (p == NULL)
! 			p = &l[strlen(l)];
  
  		if (TrafficLogFile != NULL)
  			fprintf(TrafficLogFile, "%05d >>> ", (int) getpid());
--- 548,560 ----
  				*p = svchar &~ 0200;
  	}
  
+ 	end = l + len;
  	do
  	{
  		/* find the end of the line */
! 		p = memchr(l, '\n', end - l);
  		if (p == NULL)
! 			p = end;
  
  		if (TrafficLogFile != NULL)
  			fprintf(TrafficLogFile, "%05d >>> ", (int) getpid());
***************
*** 1005,1012 ****
  			fputs(mci->mci_mailer->m_eol, mci->mci_out);
  			(void) putc(' ', mci->mci_out);
  			if (TrafficLogFile != NULL)
! 				fprintf(TrafficLogFile, "%s!\n%05d >>>  ",
! 					l, (int) getpid());
  			*q = svchar;
  			l = q;
  			slop = 1;
--- 588,599 ----
  			fputs(mci->mci_mailer->m_eol, mci->mci_out);
  			(void) putc(' ', mci->mci_out);
  			if (TrafficLogFile != NULL)
! 			{
! 				for ( ; l < q; ++l)	
! 					(void) putc(*l, TrafficLogFile);
! 				fprintf(TrafficLogFile, "!\n%05d >>>  ",
! 					(int) getpid());
! 			}
  			*q = svchar;
  			l = q;
  			slop = 1;
***************
*** 1029,1038 ****
  			if (TrafficLogFile != NULL)
  				(void) putc('>', TrafficLogFile);
  		}
- 		if (TrafficLogFile != NULL)
- 			fprintf(TrafficLogFile, "%.*s\n", p - l, l);
  		for ( ; l < p; ++l)
  			(void) putc(*l, mci->mci_out);
  		fputs(mci->mci_mailer->m_eol, mci->mci_out);
  		if (*l == '\n')
  		{
--- 616,629 ----
  			if (TrafficLogFile != NULL)
  				(void) putc('>', TrafficLogFile);
  		}
  		for ( ; l < p; ++l)
+ 		{
+ 			if (TrafficLogFile != NULL)
+ 				(void) putc(*l, TrafficLogFile);
  			(void) putc(*l, mci->mci_out);
+ 		}
+ 		if (TrafficLogFile != NULL)
+ 			(void) putc('\n', TrafficLogFile);
  		fputs(mci->mci_mailer->m_eol, mci->mci_out);
  		if (*l == '\n')
  		{
***************
*** 1043,1049 ****
  					(void) putc(' ', TrafficLogFile);
  			}
  		}
! 	} while (l[0] != '\0');
  }
  /*
  **  XUNLINK -- unlink a file, doing logging as appropriate.
--- 634,640 ----
  					(void) putc(' ', TrafficLogFile);
  			}
  		}
! 	} while (l < end);
  }
  /*
  **  XUNLINK -- unlink a file, doing logging as appropriate.
***************
*** 1064,1079 ****
  {
  	register int i;
  
- # ifdef LOG
  	if (LogLevel > 98)
! 		syslog(LOG_DEBUG, "%s: unlink %s", CurEnv->e_id, f);
! # endif /* LOG */
  
  	i = unlink(f);
- # ifdef LOG
  	if (i < 0 && LogLevel > 97)
! 		syslog(LOG_DEBUG, "%s: unlink-fail %d", f, errno);
! # endif /* LOG */
  }
  /*
  **  XFCLOSE -- close a file, doing logging as appropriate.
--- 655,670 ----
  {
  	register int i;
  
  	if (LogLevel > 98)
! 		sm_syslog(LOG_DEBUG, CurEnv->e_id,
! 			"unlink %s",
! 			f);
  
  	i = unlink(f);
  	if (i < 0 && LogLevel > 97)
! 		sm_syslog(LOG_DEBUG, CurEnv->e_id,
! 			"%s: unlink-fail %d",
! 			f, errno);
  }
  /*
  **  XFCLOSE -- close a file, doing logging as appropriate.
***************
*** 1147,1166 ****
  	{
  		if (setjmp(CtxReadTimeout) != 0)
  		{
- # ifdef LOG
  			if (LogLevel > 1)
! 				syslog(LOG_NOTICE,
  				       "timeout waiting for input from %.100s during %s",
  				       CurHostName ? CurHostName : "local",
  				       during);
- # endif
  			errno = 0;
- 			usrerr("451 timeout waiting for input during %s",
- 				during);
  			buf[0] = '\0';
  #if XDEBUG
  			checkfd012(during);
  #endif
  			return (NULL);
  		}
  		ev = setevent(timeout, readtimeout, 0);
--- 738,756 ----
  	{
  		if (setjmp(CtxReadTimeout) != 0)
  		{
  			if (LogLevel > 1)
! 				sm_syslog(LOG_NOTICE, CurEnv->e_id,
  				       "timeout waiting for input from %.100s during %s",
  				       CurHostName ? CurHostName : "local",
  				       during);
  			errno = 0;
  			buf[0] = '\0';
  #if XDEBUG
  			checkfd012(during);
  #endif
+ 			if (TrafficLogFile != NULL)
+ 				fprintf(TrafficLogFile, "%05d <<< [TIMEOUT]\n",
+ 					(int) getpid());
  			return (NULL);
  		}
  		ev = setevent(timeout, readtimeout, 0);
***************
*** 1365,1410 ****
  	return (i);
  }
  /*
- **  WAITFOR -- wait for a particular process id.
- **
- **	Parameters:
- **		pid -- process id to wait for.
- **
- **	Returns:
- **		status of pid.
- **		-1 if pid never shows up.
- **
- **	Side Effects:
- **		none.
- */
- 
- int
- waitfor(pid)
- 	pid_t pid;
- {
- #ifdef WAITUNION
- 	union wait st;
- #else
- 	auto int st;
- #endif
- 	pid_t i;
- 
- 	do
- 	{
- 		errno = 0;
- 		i = wait(&st);
- 		if (i > 0)
- 			proc_list_drop(i);
- 	} while ((i >= 0 || errno == EINTR) && i != pid);
- 	if (i < 0)
- 		return -1;
- #ifdef WAITUNION
- 	return st.w_status;
- #else
- 	return st;
- #endif
- }
- /*
  **  BITINTERSECT -- tell if two bitmaps intersect
  **
  **	Parameters:
--- 955,960 ----
***************
*** 1606,1612 ****
  			continue;
  		if (printhdr)
  		{
! 			syslog(LOG_DEBUG, "%s: changed fds:", where);
  			printhdr = FALSE;
  		}
  		dumpfd(fd, TRUE, TRUE);
--- 1156,1164 ----
  			continue;
  		if (printhdr)
  		{
! 			sm_syslog(LOG_DEBUG, CurEnv->e_id,
! 				"%s: changed fds:",
! 				where);
  			printhdr = FALSE;
  		}
  		dumpfd(fd, TRUE, TRUE);
***************
*** 1772,1782 ****
  	}
  
  printit:
- #ifdef LOG
  	if (logit)
! 		syslog(LOG_DEBUG, "%.800s", buf);
  	else
- #endif
  		printf("%s\n", buf);
  }
  /*
--- 1324,1333 ----
  	}
  
  printit:
  	if (logit)
! 		sm_syslog(LOG_DEBUG, CurEnv->e_id,
! 			"%.800s", buf);
  	else
  		printf("%s\n", buf);
  }
  /*
***************
*** 2084,2093 ****
  	register char *f;
  	int l;
  {
- #ifdef LOG
  	/* check for newlines and log if necessary */
  	(void) denlstring(f, TRUE, TRUE);
- #endif
  
  	l--;
  	while (l > 0 && *f != '\0')
--- 1635,1642 ----
***************
*** 2146,2165 ****
  	for (p = bp; (p = strchr(p, '\n')) != NULL; )
  		*p++ = ' ';
  
- #ifdef LOG
  	if (logattacks)
  	{
! 		syslog(LOG_NOTICE, "POSSIBLE ATTACK from %.100s: newline in string \"%s\"",
  			RealHostName == NULL ? "[UNKNOWN]" : RealHostName,
  			shortenstring(bp, 203));
  	}
- #endif
  
  	return bp;
  }
  /*
  **  PATH_IS_DIR -- check to see if file exists and is a directory.
  **
  **	Parameters:
  **		pathname -- pathname to check for directory-ness.
  **		createflag -- if set, create directory if needed.
--- 1695,1717 ----
  	for (p = bp; (p = strchr(p, '\n')) != NULL; )
  		*p++ = ' ';
  
  	if (logattacks)
  	{
! 		sm_syslog(LOG_NOTICE, CurEnv->e_id,
! 			"POSSIBLE ATTACK from %.100s: newline in string \"%s\"",
  			RealHostName == NULL ? "[UNKNOWN]" : RealHostName,
  			shortenstring(bp, 203));
  	}
  
  	return bp;
  }
  /*
  **  PATH_IS_DIR -- check to see if file exists and is a directory.
  **
+ **	There are some additional checks for security violations in
+ **	here.  This routine is intended to be used for the host status
+ **	support.
+ **
  **	Parameters:
  **		pathname -- pathname to check for directory-ness.
  **		createflag -- if set, create directory if needed.
***************
*** 2176,2182 ****
--- 1728,1738 ----
  {
  	struct stat statbuf;
  
+ #if HASLSTAT
+ 	if (lstat(pathname, &statbuf) < 0)
+ #else
  	if (stat(pathname, &statbuf) < 0)
+ #endif
  	{
  		if (errno != ENOENT || !createflag)
  			return FALSE;
***************
*** 2189,2194 ****
--- 1745,1758 ----
  		errno = ENOTDIR;
  		return FALSE;
  	}
+ 
+ 	/* security: don't allow writable directories */
+ 	if (bitset(S_IWGRP|S_IWOTH, statbuf.st_mode))
+ 	{
+ 		errno = EACCES;
+ 		return FALSE;
+ 	}
+ 
  	return TRUE;
  }
  /*
***************
*** 2320,2334 ****
  			continue;
  		if (kill(ProcListVec[i], 0) < 0)
  		{
- #ifdef LOG
  			if (LogLevel > 3)
! 				syslog(LOG_DEBUG, "proc_list_probe: lost pid %d",
  					ProcListVec[i]);
- #endif
  			ProcListVec[i] = NO_PID;
  			CurChildren--;
  		}
  	}
  	if (CurChildren < 0)
  		CurChildren = 0;
  }
--- 1884,2013 ----
  			continue;
  		if (kill(ProcListVec[i], 0) < 0)
  		{
  			if (LogLevel > 3)
! 				sm_syslog(LOG_DEBUG, CurEnv->e_id,
! 					"proc_list_probe: lost pid %d",
  					ProcListVec[i]);
  			ProcListVec[i] = NO_PID;
  			CurChildren--;
  		}
  	}
  	if (CurChildren < 0)
  		CurChildren = 0;
+ }
+ /*
+ **  SM_STRCASECMP -- 8-bit clean version of strcasecmp
+ **
+ **	Thank you, vendors, for making this all necessary.
+ */
+ 
+ /*
+  * Copyright (c) 1987, 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.
+  */
+ 
+ #if defined(LIBC_SCCS) && !defined(lint)
+ static char sccsid[] = "@(#)strcasecmp.c	8.1 (Berkeley) 6/4/93";
+ #endif /* LIBC_SCCS and not lint */
+ 
+ /*
+  * This array is designed for mapping upper and lower case letter
+  * together for a case independent comparison.  The mappings are
+  * based upon ascii character sequences.
+  */
+ static const u_char charmap[] = {
+ 	0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007,
+ 	0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017,
+ 	0020, 0021, 0022, 0023, 0024, 0025, 0026, 0027,
+ 	0030, 0031, 0032, 0033, 0034, 0035, 0036, 0037,
+ 	0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047,
+ 	0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057,
+ 	0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067,
+ 	0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077,
+ 	0100, 0141, 0142, 0143, 0144, 0145, 0146, 0147,
+ 	0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157,
+ 	0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167,
+ 	0170, 0171, 0172, 0133, 0134, 0135, 0136, 0137,
+ 	0140, 0141, 0142, 0143, 0144, 0145, 0146, 0147,
+ 	0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157,
+ 	0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167,
+ 	0170, 0171, 0172, 0173, 0174, 0175, 0176, 0177,
+ 	0200, 0201, 0202, 0203, 0204, 0205, 0206, 0207,
+ 	0210, 0211, 0212, 0213, 0214, 0215, 0216, 0217,
+ 	0220, 0221, 0222, 0223, 0224, 0225, 0226, 0227,
+ 	0230, 0231, 0232, 0233, 0234, 0235, 0236, 0237,
+ 	0240, 0241, 0242, 0243, 0244, 0245, 0246, 0247,
+ 	0250, 0251, 0252, 0253, 0254, 0255, 0256, 0257,
+ 	0260, 0261, 0262, 0263, 0264, 0265, 0266, 0267,
+ 	0270, 0271, 0272, 0273, 0274, 0275, 0276, 0277,
+ 	0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307,
+ 	0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317,
+ 	0320, 0321, 0322, 0323, 0324, 0325, 0326, 0327,
+ 	0330, 0331, 0332, 0333, 0334, 0335, 0336, 0337,
+ 	0340, 0341, 0342, 0343, 0344, 0345, 0346, 0347,
+ 	0350, 0351, 0352, 0353, 0354, 0355, 0356, 0357,
+ 	0360, 0361, 0362, 0363, 0364, 0365, 0366, 0367,
+ 	0370, 0371, 0372, 0373, 0374, 0375, 0376, 0377,
+ };
+ 
+ int
+ sm_strcasecmp(s1, s2)
+ 	const char *s1, *s2;
+ {
+ 	register const u_char *cm = charmap,
+ 			*us1 = (const u_char *)s1,
+ 			*us2 = (const u_char *)s2;
+ 
+ 	while (cm[*us1] == cm[*us2++])
+ 		if (*us1++ == '\0')
+ 			return (0);
+ 	return (cm[*us1] - cm[*--us2]);
+ }
+ 
+ int
+ sm_strncasecmp(s1, s2, n)
+ 	const char *s1, *s2;
+ 	register size_t n;
+ {
+ 	if (n != 0) {
+ 		register const u_char *cm = charmap,
+ 				*us1 = (const u_char *)s1,
+ 				*us2 = (const u_char *)s2;
+ 
+ 		do {
+ 			if (cm[*us1] != cm[*us2++])
+ 				return (cm[*us1] - cm[*--us2]);
+ 			if (*us1++ == '\0')
+ 				break;
+ 		} while (--n != 0);
+ 	}
+ 	return (0);
  }
diff -Ncr sendmail-8.8.5/src/version.c sendmail-8.8.6/src/version.c
*** sendmail-8.8.5/src/version.c	Tue Jan 21 07:48:10 1997
--- sendmail-8.8.6/src/version.c	Sat Jun 14 08:21:52 1997
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)version.c	8.8.5.3 (Berkeley) 1/21/97";
  #endif /* not lint */
  
! char	Version[] = "8.8.5";
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)version.c	8.8.6.1 (Berkeley) 6/14/97";
  #endif /* not lint */
  
! char	Version[] = "8.8.6";
diff -Ncr sendmail-8.8.5/test/Results sendmail-8.8.6/test/Results
*** sendmail-8.8.5/test/Results	Fri Nov 29 13:34:21 1996
--- sendmail-8.8.6/test/Results	Fri Apr 11 09:53:45 1997
***************
*** 47,52 ****
--- 47,53 ----
  IRIX	5.2	OK	94.12.06  Mark Andrews <mandrews@alias.com>
  IRIX	5.3	OK	94.12.06  Mark Andrews <mandrews@alias.com>
  IRIX	6.2	OK	96.09.16  Kari E. Hurtta <Kari.Hurtta@ozone.FMI.FI>
+ IRIX	6.3	OK	97.02.10  Mark Andrews <mandrews@aw.sgi.com>
  
  SCO	3.2v4.0	OK	93.10.02  Peter Wemm (with -lsocket from 3.2v4 devsys)
  
***************
*** 86,91 ****
--- 87,93 ----
  IRIX	5.2	OK	95.12.01  Mark Andrews <mandrews@aw.sgi.com>
  IRIX	5.3	OK	95.12.01  Mark Andrews <mandrews@aw.sgi.com>
  IRIX	6.2	OK	96.09.16  Kari E. Hurtta <Kari.Hurtta@ozone.FMI.FI>
+ IRIX	6.3	OK	97.02.10  Mark Andrews <mandrews@aw.sgi.com>
  
  FreeBSD	2.1-sta	OK	96.04.14  Jaye Mathisen <mrcpu@cdsnet.net>
  
***************
*** 95,97 ****
--- 97,156 ----
  OSF/1	4.0	OK	96.09.18  Gregory Neil Shapiro <gshapiro@wpi.edu>
  
  CxOS	11.5	FAIL	96.07.08  Eric Schnoebelen <eric@cirr.com>
+ 
+ 
+ The following are the results of running t_pathconf.c.  Safe means that
+ the underlying filesystem (in NFS, the filesystem on the server) does not
+ permit regular (non-root) users to chown their files to another user.
+ Unsafe means that they can.  Typically, BSD-based systems do not permit
+ giveaway and System V-based systems do.  However, some systems (e.g.,
+ Solaris) can set this on a per-system or per-filesystem basis.  Entries
+ are the return value of pathconf, the errno value, and a * if chown
+ disagreed with the result of the pathconf call, and a ? if the test has
+ not been run.  A mark of [R] means that the local filesystem has
+ chown set to be restricted, [U] means that it is set to be unrestricted.
+ 
+ 			     Safe Filesystem	     Unsafe Filesystem
+ SYSTEM		LOCAL	    NFS-V2	NFS-V3	    NFS-V2	 NFS-V3
+ 
+ SunOS 4.1.3_U1	1/0	    -1/EINVAL*	n/a	    -1/EINVAL?	 n/a
+ SunOS 4.1.4	1/0	    -1/EINVAL*	n/a	    -1/EINVAL	 n/a
+ 
+ AIX 3.2		0/0	    0/0
+ 
+ Solaris 2.4	1/0	    -1/EINVAL*
+ Solaris 2.5	1/0	    -1/EINVAL*	1/0			 0/0?
+ Solaris 2.5.1	1/0	    -1/EINVAL*	0/0
+ 
+ DEC OSF1 3.0	0/0	    0/0
+ DEC OSF1 3.2D-2	0/0	    0/0		0/0
+ DEC OSF1 4.0A	0/0	    0/0		0/0
+ DEC OSF 4.0B	0/0	    0/0		0/0
+ 
+ Ultrix 4.3	0/0	    0/0		n/a			 n/a
+ Ultrix 4.5	1/0	    1/0
+ 
+ HP-UX 9.05	-1/0	    -1/EOPNOTSUPP*	    -1/EOPNOTSUPP
+ HP-UX 9.05[R]	1/0	    -1/EOPNOTSUPP*	    -1/EOPNOTSUPP*
+ HP-UX 10.10	-1/0	    -1/EOPNOTSUPP*	    -1/EOPNOTSUPP
+ HP-UX 10.20		    -1/EOPNOTSUPP?			 -1/EOPNOTSUPP?
+ HP-UX 10.30	-1/0	    -1/EOPNOTSUPP	    -1/EOPNOTSUPP
+ 
+ BSD/OS 2.1	1/0
+ 
+ FreeBSD 2.1.7	1/0	    -1/EINVAL*		    -1/EINVAL
+ 
+ Irix 5.3		    -1/0*		    -1/0
+ Irix 6.2		    1/0			    -1/0	 0/0*
+ Irix 6.2	-1/0	    -1/0
+ Irix 6.3 R10000	-1/0				    -1/0	 0/0*
+ 
+ A/UX 3.1.1	1/0
+ 
+ DomainOS [R]	-1/0*
+ DomainOS [U]	-1/0
+ 
+ NCR MP-RAS 2	-1/0
+ NCR MP-RAS 3	-1/0
+ 
+ Linux 2.0.27	1/0	    1/0
diff -Ncr sendmail-8.8.5/test/t_pathconf.c sendmail-8.8.6/test/t_pathconf.c
*** sendmail-8.8.5/test/t_pathconf.c	Wed Dec 31 16:00:00 1969
--- sendmail-8.8.6/test/t_pathconf.c	Tue Apr  8 14:30:27 1997
***************
*** 0 ****
--- 1,63 ----
+ /*
+ **  The following test program tries the pathconf(2) routine.  It should
+ **  be run in a non-NFS-mounted directory (e.g., /tmp) and on remote (NFS)
+ **  mounted directories running both NFS-v2 and NFS-v3 from systems that
+ **  both do and do not permit file giveaway.
+ */
+ 
+ #include <unistd.h>
+ #include <errno.h>
+ #include <sys/types.h>
+ #include <fcntl.h>
+ #include <sysexits.h>
+ 
+ main()
+ {
+ 	int fd;
+ 	int i;
+ 	char tbuf[100];
+ 	extern int errno;
+ 
+ 	if (geteuid() == 0)
+ 	{
+ 		printf("*** Run me as a non-root user! ***\n");
+ 		exit(EX_USAGE);
+ 	}
+ 
+ 	strcpy(tbuf, "TXXXXXX");
+ 	fd = mkstemp(tbuf);
+ 	if (fd < 0)
+ 	{
+ 		printf("*** Could not create test file %s\n", tbuf);
+ 		exit(EX_CANTCREAT);
+ 	}
+ 	errno = 0;
+ 	i = pathconf(".", _PC_CHOWN_RESTRICTED);
+ 	printf("pathconf(.) returns %2d, errno = %d\n", i, errno);
+ 	errno = 0;
+ 	i = pathconf(tbuf, _PC_CHOWN_RESTRICTED);
+ 	printf("pathconf(%s) returns %2d, errno = %d\n", tbuf, i, errno);
+ 	errno = 0;
+ 	i = fpathconf(fd, _PC_CHOWN_RESTRICTED);
+ 	printf("fpathconf(%s) returns %2d, errno = %d\n", tbuf, i, errno);
+ 	if (errno == 0 && i >= 0)
+ 	{
+ 		/* so it claims that it doesn't work -- try anyhow */
+ 		printf("  fpathconf claims that chown is safe ");
+ 		if (fchown(fd, 1, 1) >= 0)
+ 			printf("*** but fchown works anyhow! ***\n");
+ 		else
+ 			printf("and fchown agrees\n");
+ 	}
+ 	else
+ 	{
+ 		/* well, let's see what really happens */
+ 		printf("  fpathconf claims that chown is not safe ");
+ 		if (fchown(fd, 1, 1) >= 0)
+ 			printf("as indeed it is not\n");
+ 		else
+ 			printf("*** but in fact it is safe ***\n");
+ 	}
+ 	unlink(tbuf);
+ 	exit(EX_OK);
+ }
