diff -rc sendmail-8.8.0/KNOWNBUGS sendmail-8.8.1/KNOWNBUGS
*** sendmail-8.8.0/KNOWNBUGS	Mon May 13 11:39:31 1996
--- sendmail-8.8.1/KNOWNBUGS	Tue Oct 15 13:33:31 1996
***************
*** 74,79 ****
--- 74,81 ----
    not in the sendmail source code, so I assume it is also a bug
    in the sockets emulation.  (Errno 22 is EINVAL "Invalid Argument"
    on all the systems I have available, including Solaris 2.x.)
+   Apparently, this problem is due to linking -lc before -lsocket;
+   if you are having this problem, check your Makefile.
  
  * Excessive mailing list nesting can run out of file descriptors.
  
***************
*** 104,107 ****
    allow for 8->7 bit MIME conversions either.
  
  
! (Version 8.22, last updated 5/13/96)
--- 106,109 ----
    allow for 8->7 bit MIME conversions either.
  
  
! (Version 8.23, last updated 10/15/96)
diff -rc sendmail-8.8.0/RELEASE_NOTES sendmail-8.8.1/RELEASE_NOTES
*** sendmail-8.8.0/RELEASE_NOTES	Thu Sep 26 10:35:13 1996
--- sendmail-8.8.1/RELEASE_NOTES	Thu Oct 17 08:44:24 1996
***************
*** 1,10 ****
  			SENDMAIL RELEASE NOTES
! 	     @(#)RELEASE_NOTES	8.8 (Berkeley) 9/26/96
  
  
  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.0/8.8.0	96/09/26
  	Under some circumstances, Bcc: headers would not be properly
--- 1,63 ----
  			SENDMAIL RELEASE NOTES
! 	     @(#)RELEASE_NOTES	8.8.1.1 (Berkeley) 10/17/96
  
  
  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.1/8.8.1	96/10/17
+ 	SECURITY: unset all environment variables that the resolver will
+ 		examine during queue runs and daemon mode.  Problem noted
+ 		by Dan Bernstein of the University of Illinois at Chicago.
+ 	SECURITY: in some cases an illegal 7-bit MIME-encoded text/plain
+ 		message could overflow a buffer if it was converted back
+ 		to 8 bits.  This caused core dumps and has the potential
+ 		for a remote attack.  Problem first noted by Gregory Shapiro
+ 		of WPI.
+ 	Avoid duplicate deliveries of error messages on systems that don't
+ 		have flock(2) support.  Patch from Motonori Nakamura of
+ 		Kyoto University.
+ 	Ignore null FallBackMX (V) options.  If this option is null (as
+ 		opposed to undefined) it can cause "null signature" syserrs
+ 		on illegal host names.
+ 	If a Base64 encoded text/plain message has no trailing newline in
+ 		the encoded text, conversion back to 8 bits will drop the
+ 		final line.  Problem noted by Pierre David.
+ 	If running with a RunAsUser, sendmail would give bogus "cannot
+ 		setuid" (or seteuid, or setreuid) messages on some systems.
+ 		Problem pointed out by Jordan Mendelson of Web Services, Inc.
+ 	Always print error messages in -bv mode -- previously, -bv would
+ 		be absolutely silent on errors if the error mode was sent
+ 		to (say) mail-back.  Problem noted by Kyle Jones of UUNET.
+ 	If -qI/R/S is set (or the ETRN command is used), ignore all long
+ 		term host status.  This is necessary because it is common
+ 		to do this when you know a host has just come back up.
+ 	Disallow duplicate HELO/EHLO commands as required by RFC 1651 section
+ 		4.2.  Excessive permissiveness noted by Lee Flight of the
+ 		University of Leicester.
+ 	If a service (such as NIS) is specified as the last entry in the
+ 		service switch, but that service is not compiled in, sendmail
+ 		would return a temporary failure when an entry was not found
+ 		in the map.  This caused the message to be queued instead of
+ 		bouncing immediately.  Problem noted by Harry Edmon of the
+ 		University of Washington.
+ 	PORTABILITY FIXES:
+ 		Solaris 2.3 had compilation problems in conf.c.  Several
+ 			people pointed this out.
+ 		NetBSD from Charles Hannum of MIT.
+ 		AIX4 improvements based on info from Steve Bauer of South
+ 			Dakota School of Mines & Technology.
+ 	CONFIG: ``error:code message'' syntax was broken in virtusertable.
+ 		Patch from Gil Kloepfer Jr.
+ 	CONFIG: if FEATURE(nocanonify) was specified, hosts in $=M (set
+ 		using MASQUERADE_DOMAIN) were not masqueraded unless they
+ 		were also in $=w.  Problem noted by Zoltan Basti of
+ 		Softec.
+ 	MAIL.LOCAL: patches to compile and link cleanly on AIX.  Based
+ 		on a patch from Eric Hagberg of Morgan Stanley.
+ 	MAIL.LOCAL: patches to compile on NEXTSTEP.  From Patrick Nolan
+ 		of Stanford via Robert La Ferla.
  
  8.8.0/8.8.0	96/09/26
  	Under some circumstances, Bcc: headers would not be properly
diff -rc sendmail-8.8.0/cf/README sendmail-8.8.1/cf/README
*** sendmail-8.8.0/cf/README	Wed Sep 25 07:55:54 1996
--- sendmail-8.8.1/cf/README	Sat Oct 12 09:27:28 1996
***************
*** 4,10 ****
  
  		Eric Allman <eric@CS.Berkeley.EDU>
  
! 		@(#)README	8.104 (Berkeley) 9/25/96
  
  
  This document describes the sendmail configuration files being used
--- 4,10 ----
  
  		Eric Allman <eric@CS.Berkeley.EDU>
  
! 		@(#)README	8.106 (Berkeley) 10/12/96
  
  
  This document describes the sendmail configuration files being used
***************
*** 13,19 ****
  
  These configuration files are probably not as general as previous
  versions, and don't handle as many of the weird cases automagically.
! I was able to simplify by them for two reasons.  First, the network
  has become more consistent -- for example, at this point, everyone
  on the internet is supposed to be running a name server, so hacks to
  handle NIC-registered hosts can go away.  Second, I assumed that a
--- 13,19 ----
  
  These configuration files are probably not as general as previous
  versions, and don't handle as many of the weird cases automagically.
! I was able to simplify them for two reasons.  First, the network
  has become more consistent -- for example, at this point, everyone
  on the internet is supposed to be running a name server, so hacks to
  handle NIC-registered hosts can go away.  Second, I assumed that a
***************
*** 1006,1012 ****
  
  	define(`MAIL_HUB', mailer:hostname)
  
! Again, ``mailer:'' defaults to "smtp".  If you define both LOCAL_RELAY
  and MAIL_HUB _AND_ you have FEATURE(stickyhost), unqualified names will
  be sent to the LOCAL_RELAY and other local names will be sent to MAIL_HUB.
  Names in $=L will be delivered locally, so you MUST have aliases or
--- 1006,1012 ----
  
  	define(`MAIL_HUB', mailer:hostname)
  
! Again, ``mailer:'' defaults to "relay".  If you define both LOCAL_RELAY
  and MAIL_HUB _AND_ you have FEATURE(stickyhost), unqualified names will
  be sent to the LOCAL_RELAY and other local names will be sent to MAIL_HUB.
  Names in $=L will be delivered locally, so you MUST have aliases or
***************
*** 1232,1238 ****
    version.
  
  * Make sure that other files that sendmail reads, such as the
!   mailertable, is only writable by trusted system personnel.
  
  * The queue directory should not be world writable PARTICULARLY
    if your system allows "file giveaways" (that is, if a non-root
--- 1232,1238 ----
    version.
  
  * Make sure that other files that sendmail reads, such as the
!   mailertable, are only writable by trusted system personnel.
  
  * The queue directory should not be world writable PARTICULARLY
    if your system allows "file giveaways" (that is, if a non-root
***************
*** 1433,1439 ****
  					the list of trusted users.  This list
  					always includes root, uucp, and daemon.
  					See also FEATURE(use_ct_file).
! confSMTP_MAILER		-		[smtp] The mailer name used when
  					SMTP connectivity is required.
  					One of "smtp", "smtp8", or "esmtp".
  confUUCP_MAILER		-		[uucp-old] The mailer to be used by
--- 1433,1439 ----
  					the list of trusted users.  This list
  					always includes root, uucp, and daemon.
  					See also FEATURE(use_ct_file).
! confSMTP_MAILER		-		[esmtp] The mailer name used when
  					SMTP connectivity is required.
  					One of "smtp", "smtp8", or "esmtp".
  confUUCP_MAILER		-		[uucp-old] The mailer to be used by
diff -rc sendmail-8.8.0/cf/m4/nullrelay.m4 sendmail-8.8.1/cf/m4/nullrelay.m4
*** sendmail-8.8.0/cf/m4/nullrelay.m4	Fri Aug 23 10:07:32 1996
--- sendmail-8.8.1/cf/m4/nullrelay.m4	Sat Oct 12 18:27:40 1996
***************
*** 34,40 ****
  #
  divert(0)
  
! VERSIONID(`@(#)nullrelay.m4	8.11 (Berkeley) 8/23/96')
  
  #
  #  This configuration applies only to relay-only hosts.  They send
--- 34,40 ----
  #
  divert(0)
  
! VERSIONID(`@(#)nullrelay.m4	8.12 (Berkeley) 10/12/96')
  
  #
  #  This configuration applies only to relay-only hosts.  They send
***************
*** 74,83 ****
  R$@			$@ :; <@>
  
  # basic textual canonicalization -- note RFC733 heuristic here
! R$*<$*>$*<$*>$*		$2$3<$4>$5			strip multiple <> <>
! R$*<$*<$+>$*>$*		<$3>$5				2-level <> nesting
! R$*<>$*			$@ <@>				MAIL FROM:<> case
! R$*<$+>$*		$2				basic RFC821/822 parsing
  
  ifdef(`_NO_CANONIFY_', `dnl',
  `# eliminate local host if present
--- 74,84 ----
  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 <>
  
  ifdef(`_NO_CANONIFY_', `dnl',
  `# eliminate local host if present
diff -rc sendmail-8.8.0/cf/m4/proto.m4 sendmail-8.8.1/cf/m4/proto.m4
*** sendmail-8.8.0/cf/m4/proto.m4	Wed Sep 18 15:31:06 1996
--- sendmail-8.8.1/cf/m4/proto.m4	Sun Oct 13 13:45:36 1996
***************
*** 34,40 ****
  #
  divert(0)
  
! VERSIONID(`@(#)proto.m4	8.132 (Berkeley) 9/18/96')
  
  MAILER(local)dnl
  
--- 34,40 ----
  #
  divert(0)
  
! VERSIONID(`@(#)proto.m4	8.134 (Berkeley) 10/13/96')
  
  MAILER(local)dnl
  
***************
*** 596,613 ****
  R$* < @ $+ . UUCP > $*		$: $1 < @ $[ $2 $] . UUCP . > $3
  R$* < @ $+ . . UUCP . > $*		$@ $1 < @ $2 . > $3')
  ')
! ifdef(`_NO_CANONIFY_', `dnl',
! `# pass to name server to make hostname canonical
! R$* < @ $* $~P > $*		$: $1 < @ $[ $2 $3 $] > $4')
  
  # local host aliases and pseudo-domains are always canonical
  R$* < @ $=w > $*		$: $1 < @ $2 . > $3
  R$* < @ $* $=P > $*		$: $1 < @ $2 $3 . > $4
  R$* < @ $* . . > $*		$1 < @ $2 . > $3
  
- # if this is the local hostname, make sure we treat is as canonical
- R$* < @ $j > $*			$: $1 < @ $j . > $2
- 
  
  ##################################################
  ###  Ruleset 4 -- Final Output Post-rewriting  ###
--- 596,612 ----
  R$* < @ $+ . UUCP > $*		$: $1 < @ $[ $2 $] . UUCP . > $3
  R$* < @ $+ . . UUCP . > $*		$@ $1 < @ $2 . > $3')
  ')
! # pass to name server to make hostname canonical
! ifdef(`_NO_CANONIFY_', `#')dnl
! R$* < @ $* $~P > $*		$: $1 < @ $[ $2 $3 $] > $4
  
  # 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
  
  
  ##################################################
  ###  Ruleset 4 -- Final Output Post-rewriting  ###
***************
*** 686,692 ****
  X`'R$+ < @ $=w . > 	$: < $(virtuser $1 @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
  X`'R< @ > $+ < @ $+ . >	$: < $(virtuser @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
  X`'R< @ > $+		$: $1
! X`'Rerror : $- $+  	$#error $@ $1 $: $2
  X`'R< $+ > $+ < @ $+ >	$: $>97 $1
  undefine(`X')dnl
  
--- 685,691 ----
  X`'R$+ < @ $=w . > 	$: < $(virtuser $1 @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
  X`'R< @ > $+ < @ $+ . >	$: < $(virtuser @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
  X`'R< @ > $+		$: $1
! X`'R< error : $- $+ > $* 	$#error $@ $1 $: $2
  X`'R< $+ > $+ < @ $+ >	$: $>97 $1
  undefine(`X')dnl
  
diff -rc sendmail-8.8.0/cf/m4/version.m4 sendmail-8.8.1/cf/m4/version.m4
*** sendmail-8.8.0/cf/m4/version.m4	Thu Sep 26 09:37:29 1996
--- sendmail-8.8.1/cf/m4/version.m4	Thu Oct 17 08:38:00 1996
***************
*** 32,39 ****
  # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  # SUCH DAMAGE.
  #
! VERSIONID(`@(#)version.m4	8.8 (Berkeley) 9/26/96')
  #
  divert(0)
  # Configuration version number
! DZ8.8.0`'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.1.1 (Berkeley) 10/17/96')
  #
  divert(0)
  # Configuration version number
! DZ8.8.1`'ifdef(`confCF_VERSION', `/confCF_VERSION')
diff -rc sendmail-8.8.0/doc/op/op.me sendmail-8.8.1/doc/op/op.me
*** sendmail-8.8.0/doc/op/op.me	Fri Sep 20 11:16:51 1996
--- sendmail-8.8.1/doc/op/op.me	Mon Oct 14 07:38:20 1996
***************
*** 30,36 ****
  .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  .\" SUCH DAMAGE.
  .\"
! .\"	@(#)op.me	8.93 (Berkeley) 9/20/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.96 (Berkeley) 10/14/96
  .\"
  .\" eqn op.me | pic | troff -me
  .eh 'SMM:08-%''Sendmail Installation and Operation Guide'
***************
*** 68,74 ****
  InReference, Inc.
  eric@Sendmail.ORG
  .sp
! Version 8.93
  .sp
  For Sendmail Version 8.8
  .)l
--- 68,74 ----
  InReference, Inc.
  eric@Sendmail.ORG
  .sp
! Version 8.96
  .sp
  For Sendmail Version 8.8
  .)l
***************
*** 1692,1698 ****
  for this run only;
  the equivalent line using the long option name is
  .(b
! /usr/\*(SD/sendmail -OQueueTimeout=2m
  .)b
  .pp
  Some options have security implications.
--- 1692,1698 ----
  for this run only;
  the equivalent line using the long option name is
  .(b
! /usr/\*(SD/sendmail -OTimeout.queuereturn=2m
  .)b
  .pp
  Some options have security implications.
***************
*** 4277,4283 ****
  The exit status may be numeric or one of the values
  USAGE, NOUSER, NOHOST, UNAVAILABLE, SOFTWARE, TEMPFAIL, PROTOCOL, or CONFIG
  to return the corresponding EX_ exit code,
! or an enhanced error code as described in RFC 1983,
  .ul
  Enhanced Mail System Status Codes.
  For example, the entry:
--- 4277,4283 ----
  The exit status may be numeric or one of the values
  USAGE, NOUSER, NOHOST, UNAVAILABLE, SOFTWARE, TEMPFAIL, PROTOCOL, or CONFIG
  to return the corresponding EX_ exit code,
! or an enhanced error code as described in RFC 1893,
  .ul
  Enhanced Mail System Status Codes.
  For example, the entry:
***************
*** 4637,4643 ****
  .ip ConnectionRateThrottle=\fIN\fP
  [no short name]
  If set to a positive value,
! allow now more than
  .i N
  incoming daemon connections in a one second period.
  This is intended to flatten out peaks
--- 4637,4643 ----
  .ip ConnectionRateThrottle=\fIN\fP
  [no short name]
  If set to a positive value,
! allow no more than
  .i N
  incoming daemon connections in a one second period.
  This is intended to flatten out peaks
***************
*** 4915,4920 ****
--- 4915,4938 ----
  This requires that queueing be compiled in,
  since it will depend on a queue run process to
  actually send the mail.
+ .ip HostsFile=\fIpath\fP
+ [no short name]
+ The path to the hosts database,
+ normally
+ .q /etc/hosts .
+ This option is only consulted when sendmail
+ is canonifying addresses,
+ and then only when
+ .q files
+ is in the
+ .q hosts
+ service switch entry.
+ In particular, this file is
+ .i never
+ used when looking up host addresses;
+ that is under the control of the system
+ .i gethostbyname (3)
+ routine.
  .ip HostStatusDirectory=\fIpath\fP
  [no short name]
  The location of the long term host status information.
***************
*** 4990,4995 ****
--- 5008,5018 ----
  For example, if a host is found to be down,
  connections to that host will not be retried for this interval.
  The units default to minutes.
+ .ip MaxMessageSize=\fIN\fP
+ [no short name]
+ Specify the maximum message size
+ to be advertised in the ESMTP EHLO response.
+ Messages larger than this will be rejected.
  .ip MaxQueueRunSize=\fIN\fP
  [no short name]
  The maximum number of jobs that will be processed
***************
*** 5005,5015 ****
  this should be set as high as possible to avoid
  .q losing
  jobs that happen to fall late in the queue directory.
- .ip MaxMessageSize=\fIN\fP
- [no short name]
- Specify the maximum message size
- to be advertised in the ESMTP EHLO response.
- Messages larger than this will be rejected.
  .ip MeToo
  [m]
  Send to me too,
--- 5028,5033 ----
***************
*** 5042,5048 ****
  .ip NoRecipientAction
  [no short name]
  The action to take when you receive a message that has no valid
! recipient headers (To:, Cc:, Bcc:).
  It can be
  .b None
  to pass the message on unmodified,
--- 5060,5068 ----
  .ip NoRecipientAction
  [no short name]
  The action to take when you receive a message that has no valid
! recipient headers (To:, Cc:, Bcc:, or Apparently-To: \(em
! the last included for back compatibility with old
! .i sendmail s).
  It can be
  .b None
  to pass the message on unmodified,
***************
*** 5193,5198 ****
--- 5213,5225 ----
  before smaller, personal mail,
  but may have applicability on some hosts with very fast connections.
  Priority ordering is the default.
+ .ip QueueTimeout=\fItimeout\fP
+ [T]
+ A synonym for
+ .q Timeout.queuereturn .
+ Use that form instead of the
+ .q QueueTimeout
+ form.
  .ip ResolverOptions=\fIoptions\fP
  [I]
  Set resolver options.
***************
*** 5276,5369 ****
  However, it should be useful on firewalls and other
  places where users don't have accounts and the aliases file is
  well constrained.
- .ip SingleLineFromHeader
- [no short name]
- If set, From: lines that have embedded newlines are unwrapped
- onto one line.
- This is to get around a botch in Lotus Notes
- that apparently cannot understand legally wrapped RFC822 headers.
- .ip SingleThreadDelivery
- [no short name]
- If set, a client machine will never try to open two SMTP connections
- to a single server machine at the same time,
- even in different processes.
- That is, if another
- .i sendmail
- is already talking to some host a new
- .i sendmail
- will not open another connection.
- This property is of mixed value;
- although this reduces the load on the other machine,
- it can cause mail to be delayed
- (for example, if one
- .i sendmail
- is delivering a huge message, other
- .i sendmail s
- won't be able to send even small messages).
- Also, it requires another file descriptor
- (for the lock file)
- per connection, so you may have to reduce the
- .b ConnectionCacheSize
- option to avoid running out of per-process file descriptors.
- Requires the
- .b HostStatusDirectory
- option.
- .ip SmtpGreetingMessage=\fImessage\fP
- [$e macro]
- The message printed when the SMTP server starts up.
- Defaults to
- .q "$j Sendmail $v ready at $b".
- .ip Timeout.\fItype\fP=\|\fItimeout\fP
- [r; subsumes old T option as well]
- Set timeout values.
- The actual timeout is indicated by the
- .i type .
- The recognized timeouts and their default values, and their
- minimum values specified in RFC 1123 section 5.3.2 are:
- .(b
- .ta \w'datafinal'u+3n
- initial	wait for initial greeting message [5m, 5m]
- helo	reply to HELO or EHLO command [5m, none]
- mail	reply to MAIL command [10m, 5m]
- rcpt	reply to RCPT command [1h, 5m]
- datainit	reply to DATA command [5m, 2m]
- datablock	data block read [1h, 3m]
- datafinal	reply to final ``.'' in data [1h, 10m]
- rset	reply to RSET command [5m, none]
- quit	reply to QUIT command [2m, none]
- misc	reply to NOOP and VERB commands [2m, none]
- ident	IDENT protocol timeout [30s, none]
- fileopen\(dg	timeout on opening .forward and :include: files [60s, none]
- command\(dg	command read [1h, 5m]
- queuereturn\(dg	how long until a message is returned [5d, 5d]
- queuewarn\(dg	how long until a warning is sent [none, none]
- hoststatus\(dg	how long until host status is ``stale'' [30m, none]
- .)b
- All but those marked with a dagger (\(dg)
- apply to client SMTP.
- If the message is submitted using the
- .sm NOTIFY
- .sm SMTP
- extension,
- warning messages will only be sent if
- .sm NOTIFY=DELAY
- is specified.
- The queuereturn and queuewarn timeouts
- can be further qualified with a tag based on the Precedence: field
- in the message;
- they must be one of
- .q urgent
- (indicating a positive non-zero precedence)
- .q normal
- (indicating a zero precedence), or
- .q non-urgent
- (indicating negative precedences).
- For example, setting
- .q Timeout.queuewarn.urgent=1h
- sets the warning timeout for urgent messages only
- to one hour.
- The default if no precedence is indicated
- is to set the timeout for all precedences.
  .ip RecipientFactor=\fIfact\fP
  [y]
  The indicated
--- 5303,5308 ----
***************
*** 5392,5397 ****
--- 5331,5359 ----
  In most environments this should be positive,
  since hosts that are down are all too often down for a long time.
  Defaults to 90000.
+ .ip SafeFileEnvironment=\fIdir\fP
+ [no short name]
+ If this option is set,
+ .i sendmail
+ will do a
+ .i chroot (2)
+ call into the indicated
+ .i dir ectory
+ before doing any file writes.
+ If the file name specified by the user begins with
+ .i dir ,
+ that partial path name will be stripped off before writing,
+ so (for example)
+ if the SafeFileEnvironment variable is set to
+ .q /safe
+ then aliases of
+ .q /safe/logs/file
+ and
+ .q /logs/file
+ actually indicate the same file.
+ Additionally, if this option is set,
+ .i sendmail
+ refuses to deliver to symbolic links.
  .ip SaveFromLine
  [f]
  Save
***************
*** 5448,5453 ****
--- 5410,5452 ----
  [7]
  Strip input to seven bits for compatibility with old systems.
  This shouldn't be necessary.
+ .ip SingleLineFromHeader
+ [no short name]
+ If set, From: lines that have embedded newlines are unwrapped
+ onto one line.
+ This is to get around a botch in Lotus Notes
+ that apparently cannot understand legally wrapped RFC822 headers.
+ .ip SingleThreadDelivery
+ [no short name]
+ If set, a client machine will never try to open two SMTP connections
+ to a single server machine at the same time,
+ even in different processes.
+ That is, if another
+ .i sendmail
+ is already talking to some host a new
+ .i sendmail
+ will not open another connection.
+ This property is of mixed value;
+ although this reduces the load on the other machine,
+ it can cause mail to be delayed
+ (for example, if one
+ .i sendmail
+ is delivering a huge message, other
+ .i sendmail s
+ won't be able to send even small messages).
+ Also, it requires another file descriptor
+ (for the lock file)
+ per connection, so you may have to reduce the
+ .b ConnectionCacheSize
+ option to avoid running out of per-process file descriptors.
+ Requires the
+ .b HostStatusDirectory
+ option.
+ .ip SmtpGreetingMessage=\fImessage\fP
+ [$e macro]
+ The message printed when the SMTP server starts up.
+ Defaults to
+ .q "$j Sendmail $v ready at $b".
  .ip StatusFile=\fIfile\fP
  [S]
  Log summary statistics in the named
***************
*** 5476,5481 ****
--- 5475,5531 ----
  The file mode for queue files.
  It is interpreted in octal by default.
  Defaults to 0600.
+ .ip Timeout.\fItype\fP=\|\fItimeout\fP
+ [r; subsumes old T option as well]
+ Set timeout values.
+ The actual timeout is indicated by the
+ .i type .
+ The recognized timeouts and their default values, and their
+ minimum values specified in RFC 1123 section 5.3.2 are:
+ .(b
+ .ta \w'datafinal'u+3n
+ initial	wait for initial greeting message [5m, 5m]
+ helo	reply to HELO or EHLO command [5m, none]
+ mail	reply to MAIL command [10m, 5m]
+ rcpt	reply to RCPT command [1h, 5m]
+ datainit	reply to DATA command [5m, 2m]
+ datablock	data block read [1h, 3m]
+ datafinal	reply to final ``.'' in data [1h, 10m]
+ rset	reply to RSET command [5m, none]
+ quit	reply to QUIT command [2m, none]
+ misc	reply to NOOP and VERB commands [2m, none]
+ ident	IDENT protocol timeout [30s, none]
+ fileopen\(dg	timeout on opening .forward and :include: files [60s, none]
+ command\(dg	command read [1h, 5m]
+ queuereturn\(dg	how long until a message is returned [5d, 5d]
+ queuewarn\(dg	how long until a warning is sent [none, none]
+ hoststatus\(dg	how long until host status is ``stale'' [30m, none]
+ .)b
+ All but those marked with a dagger (\(dg)
+ apply to client SMTP.
+ If the message is submitted using the
+ .sm NOTIFY
+ .sm SMTP
+ extension,
+ warning messages will only be sent if
+ .sm NOTIFY=DELAY
+ is specified.
+ The queuereturn and queuewarn timeouts
+ can be further qualified with a tag based on the Precedence: field
+ in the message;
+ they must be one of
+ .q urgent
+ (indicating a positive non-zero precedence)
+ .q normal
+ (indicating a zero precedence), or
+ .q non-urgent
+ (indicating negative precedences).
+ For example, setting
+ .q Timeout.queuewarn.urgent=1h
+ sets the warning timeout for urgent messages only
+ to one hour.
+ The default if no precedence is indicated
+ is to set the timeout for all precedences.
  .ip TimeZoneSpec=\fItzinfo\fP
  [t]
  Set the local time zone info to
***************
*** 7317,7323 ****
  many to support new features,
  others to allow tuning that was previously available
  only by recompiling.
! They are described in detail in Section 5.1.5.
  Briefly,
  .nr ii 0.5i
  .ip b
--- 7367,7373 ----
  many to support new features,
  others to allow tuning that was previously available
  only by recompiling.
! They are described in detail in Section 5.6.
  Briefly,
  .nr ii 0.5i
  .ip b
***************
*** 8059,8065 ****
  .\"Eric Allman
  .\"InReference, Inc.
  .\".sp
! .\"Version 8.93
  .\".ce 0
  .bp 2
  .rs
--- 8109,8115 ----
  .\"Eric Allman
  .\"InReference, Inc.
  .\".sp
! .\"Version 8.96
  .\".ce 0
  .bp 2
  .rs
diff -rc sendmail-8.8.0/mail.local/mail.local.c sendmail-8.8.1/mail.local/mail.local.c
*** sendmail-8.8.0/mail.local/mail.local.c	Fri Sep 13 09:39:13 1996
--- sendmail-8.8.1/mail.local/mail.local.c	Wed Oct  9 13:15:32 1996
***************
*** 38,44 ****
  #endif /* not lint */
  
  #ifndef lint
! static char sccsid[] = "@(#)mail.local.c	8.28 (Berkeley) 9/13/96";
  #endif /* not lint */
  
  /*
--- 38,44 ----
  #endif /* not lint */
  
  #ifndef lint
! static char sccsid[] = "@(#)mail.local.c	8.30 (Berkeley) 10/9/96";
  #endif /* not lint */
  
  /*
***************
*** 79,89 ****
  #endif
  
  #if (defined(sun) && defined(__svr4__)) || defined(__SVR4)
! # define USE_LOCKF
! # define USE_SETEUID
  # define _PATH_MAILDIR	"/var/mail"
  #endif
  
  /*
   * If you don't have flock, you could try using lockf instead.
   */
--- 79,110 ----
  #endif
  
  #if (defined(sun) && defined(__svr4__)) || defined(__SVR4)
! # define USE_LOCKF	1
! # define USE_SETEUID	1
  # define _PATH_MAILDIR	"/var/mail"
  #endif
  
+ #if defined(_AIX)
+ # define USE_LOCKF	1
+ # define USE_VSYSLOG	0
+ #endif
+ 
+ #if defined(ultrix)
+ # define USE_VSYSLOG	0
+ #endif
+ 
+ #if defined(__osf__)
+ # define USE_VSYSLOG	0
+ #endif
+ 
+ #if defined(NeXT)
+ # include <libc.h>
+ # define _PATH_MAILDIR	"/usr/spool/mail"
+ # define __dead		/* empty */
+ # define S_IRUSR	S_IREAD
+ # define S_IWUSR	S_IWRITE
+ #endif
+ 
  /*
   * If you don't have flock, you could try using lockf instead.
   */
***************
*** 93,98 ****
--- 114,123 ----
  # define LOCK_EX	F_LOCK
  #endif
  
+ #ifndef USE_VSYSLOG
+ # define USE_VSYSLOG	1
+ #endif
+ 
  #ifndef LOCK_EX
  # include <sys/file.h>
  #endif
***************
*** 614,620 ****
  	(void)vfprintf(stderr, fmt, ap);
  	(void)fprintf(stderr, "\n");
  
! #if !defined(ultrix) && !defined(__osf__)
  	/* Log the message to syslog. */
  	vsyslog(LOG_ERR, fmt, ap);
  #else
--- 639,645 ----
  	(void)vfprintf(stderr, fmt, ap);
  	(void)fprintf(stderr, "\n");
  
! #if USE_VSYSLOG
  	/* Log the message to syslog. */
  	vsyslog(LOG_ERR, fmt, ap);
  #else
Only in sendmail-8.8.1/src/Makefiles: Makefile.AIX.4
diff -rc sendmail-8.8.0/src/Makefiles/Makefile.ULTRIX sendmail-8.8.1/src/Makefiles/Makefile.ULTRIX
*** sendmail-8.8.0/src/Makefiles/Makefile.ULTRIX	Fri Sep 20 07:35:44 1996
--- sendmail-8.8.1/src/Makefiles/Makefile.ULTRIX	Wed Oct  2 08:54:51 1996
***************
*** 7,20 ****
  #
  #	This has been tested on Ultrix 4.2A and 4.3A.
  #
! #	@(#)Makefile.ULTRIX	8.12 (Berkeley) 9/20/96
  #
  
  # use O=-O (usual) or O=-g (debugging)
  O=	-O
  
  # native compiler requires -Olimit to optimize properly
! CC=	cc -Olimit 900
  
  # define the database mechanisms available for map & alias lookups:
  #	-DNDBM -- use new DBM
--- 7,20 ----
  #
  #	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)
  O=	-O
  
  # native compiler requires -Olimit to optimize properly
! CC=	cc -Olimit 950
  
  # define the database mechanisms available for map & alias lookups:
  #	-DNDBM -- use new DBM
diff -rc sendmail-8.8.0/src/READ_ME sendmail-8.8.1/src/READ_ME
*** sendmail-8.8.0/src/READ_ME	Fri Sep 20 13:07:03 1996
--- sendmail-8.8.1/src/READ_ME	Sat Oct 12 10:12:23 1996
***************
*** 30,36 ****
  # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  # SUCH DAMAGE.
  #
! #	@(#)READ_ME	8.123 (Berkeley) 9/20/96
  #
  
  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.124 (Berkeley) 10/12/96
  #
  
  This directory contains the source files for sendmail.
***************
*** 543,549 ****
  
  Some people have had a problem with BIND 4.9; it uses some routines
  that it expects to be externally defined such as strerror().  It may
! help to link with "-l44bsd" to solve this problem.
  
  !PLEASE! be sure to link with the same version of the resolver as
  the header files you used -- some people have used the 4.9 headers
--- 543,552 ----
  
  Some people have had a problem with BIND 4.9; it uses some routines
  that it expects to be externally defined such as strerror().  It may
! help to link with "-l44bsd" to solve this problem.  This has apparently
! been fixed in later versions of BIND, starting around 4.9.3.  In other
! words, if you use 4.9.0 through 4.9.2, you need -l44bsd; for earlier or
! later versions, you do not.
  
  !PLEASE! be sure to link with the same version of the resolver as
  the header files you used -- some people have used the 4.9 headers
***************
*** 615,620 ****
--- 618,630 ----
  	vendor location rather than changing the location in the sendmail
  	binary.
  
+ ld: fatal: library -l44bsd: not found
+ 	Most of the Makefiles include -l44bsd in the LIBS= definition;
+ 	this is because several versions of BIND (4.9.0, 4.9.1, 4.9.2)
+ 	require this library.  If you are running one of these versions,
+ 	install this library.  Otherwise, just delete "-l44bsd" from the
+ 	LIBS= line in the Makefile.
+ 
  SunOS 4.x (Solaris 1.x)
  	You may have to use -lresolv on SunOS.  However, beware that
  	this links in a new version of gethostbyname that does not
***************
*** 1328,1331 ****
  
  Eric Allman
  
! (Version 8.123, last update 9/20/96 12:07:02)
--- 1338,1341 ----
  
  Eric Allman
  
! (Version 8.124, last update 10/12/96 09:12:22)
diff -rc sendmail-8.8.0/src/conf.c sendmail-8.8.1/src/conf.c
*** sendmail-8.8.0/src/conf.c	Mon Sep 23 07:52:09 1996
--- sendmail-8.8.1/src/conf.c	Thu Oct 17 07:52:56 1996
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)conf.c	8.306 (Berkeley) 9/20/96";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)conf.c	8.312 (Berkeley) 10/17/96";
  #endif /* not lint */
  
  # include "sendmail.h"
***************
*** 786,792 ****
  		/* (re)read service switch */
  		register FILE *fp;
  
! 		ServiceCacheTime = now;
  		fp = fopen(ServiceSwitchFile, "r");
  		if (fp != NULL)
  		{
--- 786,793 ----
  		/* (re)read service switch */
  		register FILE *fp;
  
! 		if (ConfigFileRead)
! 			ServiceCacheTime = now;
  		fp = fopen(ServiceSwitchFile, "r");
  		if (fp != NULL)
  		{
***************
*** 1259,1267 ****
  #  define FSHIFT	10
  # endif
  
- # if defined(_AIX3)
- #  define FSHIFT	16
- # endif
  #endif
  
  #ifndef FSHIFT
--- 1260,1265 ----
***************
*** 1336,1342 ****
  		Nl[1].n_name[0] = '\0';
  #endif
  
! #ifdef _AIX3
  		if (knlist(Nl, 1, sizeof Nl[0]) < 0)
  #else
  		if (nlist(_PATH_UNIX, Nl) < 0)
--- 1334,1340 ----
  		Nl[1].n_name[0] = '\0';
  #endif
  
! #if defined(_AIX3) || defined(_AIX4)
  		if (knlist(Nl, 1, sizeof Nl[0]) < 0)
  #else
  		if (nlist(_PATH_UNIX, Nl) < 0)
***************
*** 1956,1967 ****
  	}
  	else if (MaxChildren > 0 && CurChildren >= MaxChildren)
  	{
! 		setproctitle("rejecting connections on port %d: maximum children: %d",
! 			port, CurChildren);
  #ifdef LOG
  		if (LogLevel >= 14)
! 			syslog(LOG_INFO, "rejecting connections on port %d: maximum children: %d",
! 				port, CurChildren);
  #endif
  	}
  	else
--- 1954,1965 ----
  	}
  	else if (MaxChildren > 0 && CurChildren >= MaxChildren)
  	{
! 		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
  	}
  	else
***************
*** 2187,2196 ****
  	int sig;
  {
  	int olderrno = errno;
  # ifdef HASWAITPID
  	auto int status;
  	int count;
- 	int pid;
  
  	count = 0;
  	while ((pid = waitpid(-1, &status, WNOHANG)) > 0)
--- 2185,2194 ----
  	int sig;
  {
  	int olderrno = errno;
+ 	pid_t pid;
  # ifdef HASWAITPID
  	auto int status;
  	int count;
  
  	count = 0;
  	while ((pid = waitpid(-1, &status, WNOHANG)) > 0)
***************
*** 2205,2223 ****
  #endif
  			break;
  		}
! 		CurChildren--;
  	}
  # else
  # ifdef WNOHANG
  	union wait status;
  
! 	while (wait3(&status, WNOHANG, (struct rusage *) NULL) > 0)
! 		CurChildren--;
  # else /* WNOHANG */
  	auto int status;
  
! 	while (wait(&status) > 0)
! 		CurChildren--;
  # endif /* WNOHANG */
  # endif
  # ifdef SYS5SIGNALS
--- 2203,2221 ----
  #endif
  			break;
  		}
! 		proc_list_drop(pid);
  	}
  # else
  # ifdef WNOHANG
  	union wait status;
  
! 	while ((pid = wait3(&status, WNOHANG, (struct rusage *) NULL)) > 0)
! 		proc_list_drop(pid);
  # else /* WNOHANG */
  	auto int status;
  
! 	while ((pid = wait(&status)) > 0)
! 		proc_list_drop(pid);
  # endif /* WNOHANG */
  # endif
  # ifdef SYS5SIGNALS
***************
*** 3007,3013 ****
  #  define _PATH_SHELLS	"/etc/shells"
  # endif
  
! # ifdef _AIX3
  #  include <userconf.h>
  #  include <usersec.h>
  # endif
--- 3005,3011 ----
  #  define _PATH_SHELLS	"/etc/shells"
  # endif
  
! # if defined(_AIX3) || defined(_AIX4)
  #  include <userconf.h>
  #  include <usersec.h>
  # endif
***************
*** 3035,3041 ****
  	"/bin/posix/sh",
  # endif
  #endif
! #ifdef _AIX3
  	"/bin/ksh",		/* Korn shell */
  	"/usr/bin/ksh",
  	"/bin/tsh",		/* trusted shell */
--- 3033,3039 ----
  	"/bin/posix/sh",
  # endif
  #endif
! #if defined(_AIX3) || defined(_AIX4)
  	"/bin/ksh",		/* Korn shell */
  	"/usr/bin/ksh",
  	"/bin/tsh",		/* trusted shell */
***************
*** 4058,4064 ****
  #if (SOLARIS > 10000 && SOLARIS < 20400) || (defined(SOLARIS) && SOLARIS < 204)
  # if SOLARIS == 20300 || SOLARIS == 203
  	static struct hostent hp;
- 	static struct hostent hp;
  	static char buf[1000];
  	extern struct hostent *_switch_gethostbyaddr_r();
  
--- 4056,4061 ----
***************
*** 4244,4254 ****
  
  		/* extract IP address from the list*/
  		ia = (((struct sockaddr_in *) sa)->sin_addr);
  
  		/* save IP address in text from */
  		(void) snprintf(ip_addr, sizeof ip_addr, "[%.*s]",
  			sizeof ip_addr - 3,
! 			inet_ntoa(((struct sockaddr_in *) sa)->sin_addr));
  		if (!wordinclass(ip_addr, 'w'))
  		{
  			setclass('w', ip_addr);
--- 4241,4257 ----
  
  		/* extract IP address from the list*/
  		ia = (((struct sockaddr_in *) sa)->sin_addr);
+ 		if (ia.s_addr == INADDR_ANY || ia.s_addr == INADDR_NONE)
+ 		{
+ 			message("WARNING: interface %s is UP with %s address",
+ 				ifr->ifr_name, inet_ntoa(ia));
+ 			continue;
+ 		}
  
  		/* save IP address in text from */
  		(void) snprintf(ip_addr, sizeof ip_addr, "[%.*s]",
  			sizeof ip_addr - 3,
! 			inet_ntoa(ia));
  		if (!wordinclass(ip_addr, 'w'))
  		{
  			setclass('w', ip_addr);
diff -rc sendmail-8.8.0/src/conf.h sendmail-8.8.1/src/conf.h
*** sendmail-8.8.0/src/conf.h	Thu Sep 26 08:13:02 1996
--- sendmail-8.8.1/src/conf.h	Thu Oct 17 07:52:56 1996
***************
*** 31,37 ****
   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   *
!  *	@(#)conf.h	8.264 (Berkeley) 9/26/96
   */
  
  /*
--- 31,37 ----
   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   *
!  *	@(#)conf.h	8.266 (Berkeley) 10/17/96
   */
  
  /*
***************
*** 211,216 ****
--- 211,226 ----
  
  
  /*
+ **  IBM AIX 4.x
+ */
+ 
+ #ifdef _AIX4
+ # define _AIX3		1	/* pull in AIX3 stuff */
+ # define HASSETREUID	1	/* setreuid(2) works */
+ #endif
+ 
+ 
+ /*
  **  IBM AIX 3.x -- actually tested for 3.2.3
  */
  
***************
*** 226,231 ****
--- 236,242 ----
  # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
  # define SPT_PADCHAR	'\0'	/* pad process title with nulls */
  # define LA_TYPE	LA_INT
+ # define FSHIFT		16
  # define LA_AVENRUN	"avenrun"
  #endif
  
***************
*** 682,688 ****
  # if defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1)
  #  undef SPT_TYPE
  #  define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
- #  define setreuid	__setreuid
  # endif
  # if defined(__FreeBSD__)
  #  undef SPT_TYPE
--- 693,698 ----
diff -rc sendmail-8.8.0/src/daemon.c sendmail-8.8.1/src/daemon.c
*** sendmail-8.8.0/src/daemon.c	Wed Sep 18 07:15:05 1996
--- sendmail-8.8.1/src/daemon.c	Sat Oct 12 13:35:11 1996
***************
*** 37,45 ****
  
  #ifndef lint
  #ifdef DAEMON
! static char sccsid[] = "@(#)daemon.c	8.144 (Berkeley) 9/18/96 (with daemon mode)";
  #else
! static char sccsid[] = "@(#)daemon.c	8.144 (Berkeley) 9/18/96 (without daemon mode)";
  #endif
  #endif /* not lint */
  
--- 37,45 ----
  
  #ifndef lint
  #ifdef DAEMON
! static char sccsid[] = "@(#)daemon.c	8.145 (Berkeley) 10/12/96 (with daemon mode)";
  #else
! static char sccsid[] = "@(#)daemon.c	8.145 (Berkeley) 10/12/96 (without daemon mode)";
  #endif
  #endif /* not lint */
  
***************
*** 338,344 ****
  			return FALSE;
  		}
  
! 		CurChildren++;
  
  		/* close the port so that others will hang (for a while) */
  		(void) close(t);
--- 338,345 ----
  			return FALSE;
  		}
  
! 		/* parent -- keep track of children */
! 		proc_list_add(pid);
  
  		/* close the port so that others will hang (for a while) */
  		(void) close(t);
diff -rc sendmail-8.8.0/src/deliver.c sendmail-8.8.1/src/deliver.c
*** sendmail-8.8.0/src/deliver.c	Thu Sep 26 09:00:28 1996
--- sendmail-8.8.1/src/deliver.c	Thu Oct 17 07:54:08 1996
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)deliver.c	8.243 (Berkeley) 9/26/96";
  #endif /* not lint */
  
  #include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)deliver.c	8.246 (Berkeley) 10/17/96";
  #endif /* not lint */
  
  #include "sendmail.h"
***************
*** 579,585 ****
  		for (ee = splitenv; ee != NULL; ee = e->e_sibling)
  			(void) dowork(ee->e_id, FALSE, FALSE, ee);
  		(void) dowork(e->e_id, FALSE, FALSE, e);
! 		return;
  # endif /* !HASFLOCK */
  	}
  
--- 579,585 ----
  		for (ee = splitenv; ee != NULL; ee = e->e_sibling)
  			(void) dowork(ee->e_id, FALSE, FALSE, ee);
  		(void) dowork(e->e_id, FALSE, FALSE, e);
! 		finis();
  # endif /* !HASFLOCK */
  	}
  
***************
*** 1585,1596 ****
  			{
  				vendor_set_uid(new_euid);
  #if USESETEUID
! 				if (seteuid(new_euid) < 0)
  					syserr("openmailer: seteuid(%ld) failed",
  						(long) new_euid);
  #else
  # if HASSETREUID
! 				if (setreuid(new_ruid, new_euid) < 0)
  					syserr("openmailer: setreuid(%ld, %ld) failed",
  						(long) new_ruid, (long) new_euid);
  # else
--- 1585,1596 ----
  			{
  				vendor_set_uid(new_euid);
  #if USESETEUID
! 				if (seteuid(new_euid) < 0 && suidwarn)
  					syserr("openmailer: seteuid(%ld) failed",
  						(long) new_euid);
  #else
  # if HASSETREUID
! 				if (setreuid(new_ruid, new_euid) < 0 && suidwarn)
  					syserr("openmailer: setreuid(%ld, %ld) failed",
  						(long) new_ruid, (long) new_euid);
  # else
***************
*** 2134,2140 ****
  	if (mci->mci_pid == 0)
  		return (EX_OK);
  
! #ifdef FOR_VERSION_8_9
  	put a timeout around the wait
  #endif
  
--- 2134,2140 ----
  	if (mci->mci_pid == 0)
  		return (EX_OK);
  
! #ifdef FFR_TIMEOUT_WAIT
  	put a timeout around the wait
  #endif
  
diff -rc sendmail-8.8.0/src/main.c sendmail-8.8.1/src/main.c
*** sendmail-8.8.0/src/main.c	Thu Sep 26 09:00:27 1996
--- sendmail-8.8.1/src/main.c	Sat Oct 12 17:19:41 1996
***************
*** 39,45 ****
  #endif /* not lint */
  
  #ifndef lint
! static char sccsid[] = "@(#)main.c	8.207 (Berkeley) 9/26/96";
  #endif /* not lint */
  
  #define	_DEFINE
--- 39,45 ----
  #endif /* not lint */
  
  #ifndef lint
! static char sccsid[] = "@(#)main.c	8.211 (Berkeley) 10/12/96";
  #endif /* not lint */
  
  #define	_DEFINE
***************
*** 137,151 ****
  	bool nullserver;
  	char jbuf[MAXHOSTNAMELEN];	/* holds MyHostName */
  	static char rnamebuf[MAXNAME];	/* holds RealUserName */
  	extern int DtableSize;
  	extern int optind;
  	extern int opterr;
  	extern time_t convtime();
  	extern void intsig();
  	extern struct hostent *myhostname();
  	extern char *getauthinfo();
  	extern char *getcfname();
- 	extern char *optarg;
  	extern void sigusr1();
  	extern void sighup();
  	extern void initmacros __P((ENVELOPE *));
--- 137,153 ----
  	bool nullserver;
  	char jbuf[MAXHOSTNAMELEN];	/* holds MyHostName */
  	static char rnamebuf[MAXNAME];	/* holds RealUserName */
+ 	char *emptyenviron[1];
  	extern int DtableSize;
  	extern int optind;
  	extern int opterr;
+ 	extern char *optarg;
+ 	extern char **environ;
  	extern time_t convtime();
  	extern void intsig();
  	extern struct hostent *myhostname();
  	extern char *getauthinfo();
  	extern char *getcfname();
  	extern void sigusr1();
  	extern void sighup();
  	extern void initmacros __P((ENVELOPE *));
***************
*** 369,374 ****
--- 371,381 ----
  	/* initialize for setproctitle */
  	initsetproctitle(argc, argv, envp);
  
+ 	/* clear sendmail's environment */
+ 	ExternalEnviron = environ;
+ 	emptyenviron[0] = NULL;
+ 	environ = emptyenviron;
+ 
  	/* prime the child environment */
  	setuserenv("AGENT", "sendmail");
  
***************
*** 378,384 ****
  	(void) setsignal(SIGPIPE, SIG_IGN);
  	OldUmask = umask(022);
  	OpMode = MD_DELIVER;
! 	FullName = getenv("NAME");
  
  #if NAMED_BIND
  	if (tTd(8, 8))
--- 385,391 ----
  	(void) setsignal(SIGPIPE, SIG_IGN);
  	OldUmask = umask(022);
  	OpMode = MD_DELIVER;
! 	FullName = getextenv("NAME");
  
  #if NAMED_BIND
  	if (tTd(8, 8))
***************
*** 512,518 ****
  					usrerr("Permission denied");
  					exit(EX_USAGE);
  				}
- 				(void) unsetenv("HOSTALIASES");
  				vendor_daemon_setup(CurEnv);
  				/* fall through ... */
  # else
--- 519,524 ----
***************
*** 526,535 ****
  				ExitStat = EX_USAGE;
  				break;
  # endif /* SMTP */
  			  case MD_DELIVER:
  			  case MD_VERIFY:
  			  case MD_TEST:
- 			  case MD_INITALIAS:
  			  case MD_PRINT:
  			  case MD_HOSTSTAT:
  			  case MD_PURGESTAT:
--- 532,544 ----
  				ExitStat = EX_USAGE;
  				break;
  # endif /* SMTP */
+ 
+ 			  case MD_INITALIAS:
+ 				/* fall through ... */
+ 
  			  case MD_DELIVER:
  			  case MD_VERIFY:
  			  case MD_TEST:
  			  case MD_PRINT:
  			  case MD_HOSTSTAT:
  			  case MD_PURGESTAT:
***************
*** 649,655 ****
  
  		  case 'q':	/* run queue files at intervals */
  # ifdef QUEUE
- 			(void) unsetenv("HOSTALIASES");
  			FullName = NULL;
  			queuemode = TRUE;
  			switch (optarg[0])
--- 658,663 ----
***************
*** 792,797 ****
--- 800,806 ----
  #endif
  	vendor_pre_defaults(CurEnv);
  	readcf(getcfname(), safecf, CurEnv);
+ 	ConfigFileRead = TRUE;
  	vendor_post_defaults(CurEnv);
  
  	/* avoid denial-of-service attacks */
***************
*** 1363,1370 ****
  	if (OpMode == MD_VERIFY)
  	{
  		CurEnv->e_sendmode = SM_VERIFY;
! 		CurEnv->e_errormode = EM_QUIET;
  		PostMasterCopy = NULL;
  	}
  	else
  	{
--- 1372,1380 ----
  	if (OpMode == MD_VERIFY)
  	{
  		CurEnv->e_sendmode = SM_VERIFY;
! 		CurEnv->e_errormode = EM_PRINT;
  		PostMasterCopy = NULL;
+ 		HoldErrs = FALSE;
  	}
  	else
  	{
***************
*** 1816,1821 ****
--- 1826,1856 ----
  	}
  }
  /*
+ **  GETEXTENV -- get from external environment
+ **
+ **	Parameters:
+ **		envar -- the name of the variable to retrieve
+ **
+ **	Returns:
+ **		The value, if any.
+ */
+ 
+ char *
+ getextenv(envar)
+ 	const char *envar;
+ {
+ 	char **envp;
+ 	int l;
+ 
+ 	l = strlen(envar);
+ 	for (envp = ExternalEnviron; *envp != NULL; envp++)
+ 	{
+ 		if (strncmp(*envp, envar, l) == 0 && (*envp)[l] == '=')
+ 			return &(*envp)[l + 1];
+ 	}
+ 	return NULL;
+ }
+ /*
  **  SETUSERENV -- set an environment in the propogated environment
  **
  **	Parameters:
***************
*** 1840,1846 ****
  
  	if (value == NULL)
  	{
! 		value = getenv(envar);
  		if (value == NULL)
  			return;
  	}
--- 1875,1881 ----
  
  	if (value == NULL)
  	{
! 		value = getextenv(envar);
  		if (value == NULL)
  			return;
  	}
diff -rc sendmail-8.8.0/src/map.c sendmail-8.8.1/src/map.c
*** sendmail-8.8.0/src/map.c	Wed Sep 25 09:48:50 1996
--- sendmail-8.8.1/src/map.c	Sat Oct 12 10:12:11 1996
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)map.c	8.139 (Berkeley) 9/25/96";
  #endif /* not lint */
  
  #include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)map.c	8.140 (Berkeley) 10/12/96";
  #endif /* not lint */
  
  #include "sendmail.h"
***************
*** 643,652 ****
  		printf("getcanonname(%s), failed, stat=%d\n", host, stat);
  
  #if NAMED_BIND
! 	if (stat == EX_NOHOST && !got_tempfail)
! 		h_errno = HOST_NOT_FOUND;
! 	else
  		h_errno = TRY_AGAIN;
  #endif
  
  	return FALSE;
--- 643,652 ----
  		printf("getcanonname(%s), failed, stat=%d\n", host, stat);
  
  #if NAMED_BIND
! 	if (got_tempfail)
  		h_errno = TRY_AGAIN;
+ 	else
+ 		h_errno = HOST_NOT_FOUND;
  #endif
  
  	return FALSE;
diff -rc sendmail-8.8.0/src/mci.c sendmail-8.8.1/src/mci.c
*** sendmail-8.8.0/src/mci.c	Fri Sep 20 09:54:45 1996
--- sendmail-8.8.1/src/mci.c	Wed Oct  9 11:48:43 1996
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)mci.c	8.42 (Berkeley) 9/20/96";
  #endif /* not lint */
  
  #include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)mci.c	8.44 (Berkeley) 10/9/96";
  #endif /* not lint */
  
  #include "sendmail.h"
***************
*** 705,711 ****
--- 705,713 ----
  		goto cleanup;
  	}
  
+ 	FileName = fname;
  	(void) mci_read_persistent(fp, mci);
+ 	FileName = NULL;
  	fclose(fp);
  
  cleanup:
***************
*** 798,804 ****
  			return 0;
  
  		  default:
! 			syserr("Unknown host status line %s", buf);
  			return -1;
  		}
  	}
--- 800,806 ----
  			return 0;
  
  		  default:
! 			syserr("Unknown host status line \"%s\"", buf);
  			return -1;
  		}
  	}
***************
*** 854,862 ****
  	fprintf(mci->mci_statfile, "H%d\n", mci->mci_herrno);
  	fprintf(mci->mci_statfile, "S%d\n", mci->mci_exitstat);
  	if (mci->mci_status != NULL)
! 		fprintf(mci->mci_statfile, "D%.80s\n", mci->mci_status);
  	if (mci->mci_rstatus != NULL)
! 		fprintf(mci->mci_statfile, "R%.80s\n", mci->mci_rstatus);
  	fprintf(mci->mci_statfile, "U%ld\n", mci->mci_lastuse);
  	fprintf(mci->mci_statfile, ".\n");
  
--- 856,866 ----
  	fprintf(mci->mci_statfile, "H%d\n", mci->mci_herrno);
  	fprintf(mci->mci_statfile, "S%d\n", mci->mci_exitstat);
  	if (mci->mci_status != NULL)
! 		fprintf(mci->mci_statfile, "D%.80s\n",
! 			denlstring(mci->mci_status, TRUE, FALSE));
  	if (mci->mci_rstatus != NULL)
! 		fprintf(mci->mci_statfile, "R%.80s\n",
! 			denlstring(mci->mci_rstatus, TRUE, FALSE));
  	fprintf(mci->mci_statfile, "U%ld\n", mci->mci_lastuse);
  	fprintf(mci->mci_statfile, ".\n");
  
***************
*** 901,910 ****
  
  	if (pathname == NULL)
  		pathname = HostStatDir;
  
  	if (tTd(56, 1))
! 		printf("mci_traverse: pathname is %s\n",
! 		       pathname == NULL ? "[NULL]" : pathname);
  
  	ret = stat(pathname, &statbuf);
  	if (ret < 0)
--- 905,915 ----
  
  	if (pathname == NULL)
  		pathname = HostStatDir;
+ 	if (pathname == NULL)
+ 		return -1;
  
  	if (tTd(56, 1))
! 		printf("mci_traverse: pathname is %s\n", pathname);
  
  	ret = stat(pathname, &statbuf);
  	if (ret < 0)
diff -rc sendmail-8.8.0/src/mime.c sendmail-8.8.1/src/mime.c
*** sendmail-8.8.0/src/mime.c	Sun Sep 15 11:46:31 1996
--- sendmail-8.8.1/src/mime.c	Thu Oct 17 08:35:25 1996
***************
*** 36,42 ****
  # include <string.h>
  
  #ifndef lint
! static char sccsid[] = "@(#)mime.c	8.44 (Berkeley) 9/15/96";
  #endif /* not lint */
  
  /*
--- 36,42 ----
  # include <string.h>
  
  #ifndef lint
! static char sccsid[] = "@(#)mime.c	8.47 (Berkeley) 10/17/96";
  #endif /* not lint */
  
  /*
***************
*** 947,954 ****
  	u_char *obp;
  	u_char ch, *fbufp, *obufp;
  	char buf[MAXLINE];
! 	u_char obuf[MAXLINE];
! 	u_char fbuf[MAXLINE];
  	char pvpbuf[MAXLINE];
  	extern u_char MimeTokenTab[256];
  
--- 947,954 ----
  	u_char *obp;
  	u_char ch, *fbufp, *obufp;
  	char buf[MAXLINE];
! 	u_char obuf[MAXLINE + 1];
! 	u_char fbuf[MAXLINE + 1];
  	char pvpbuf[MAXLINE];
  	extern u_char MimeTokenTab[256];
  
***************
*** 1004,1016 ****
  			while ((ch = *obufp++) != '\0')
  			{
  				*fbufp++ = ch;
! 				if(ch == '\n')
  				{
  					*fbufp = '\0';
  					putline((char *) fbuf, mci);
  					fbufp = fbuf;
  				}
  			}
  		}
  	}
  	else
--- 1004,1023 ----
  			while ((ch = *obufp++) != '\0')
  			{
  				*fbufp++ = ch;
! 				if (ch == '\n' || fbufp >= &fbuf[MAXLINE])
  				{
  					*fbufp = '\0';
  					putline((char *) fbuf, mci);
  					fbufp = fbuf;
  				}
  			}
+ 
+ 			/* force out partial last line */
+ 			if (fbufp > fbuf)
+ 			{
+ 				*fbufp = '\0';
+ 				putline((char *) fbuf, mci);
+ 			}
  		}
  	}
  	else
***************
*** 1019,1033 ****
  		obp = obuf;
  		while (fgets(buf, sizeof buf, e->e_dfp) != NULL)
  		{
! 			if (mime_fromqp((u_char *) buf, &obp, 0, MAXLINE) == 0)
  				continue;
  
  			putline((char *) obuf, mci);
  			obp = obuf;
  		}
- 		if (tTd(43, 3))
- 			printf("\t\t\tmime7to8 => %s to 8bit done\n", cte);
  	}
  }
  /*
  **  The following is based on Borenstein's "codes.c" module, with simplifying
--- 1026,1040 ----
  		obp = obuf;
  		while (fgets(buf, sizeof buf, e->e_dfp) != NULL)
  		{
! 			if (mime_fromqp((u_char *) buf, &obp, 0, &obp[MAXLINE] - obp) == 0)
  				continue;
  
  			putline((char *) obuf, mci);
  			obp = obuf;
  		}
  	}
+ 	if (tTd(43, 3))
+ 		printf("\t\t\tmime7to8 => %s to 8bit done\n", cte);
  }
  /*
  **  The following is based on Borenstein's "codes.c" module, with simplifying
diff -rc sendmail-8.8.0/src/queue.c sendmail-8.8.1/src/queue.c
*** sendmail-8.8.0/src/queue.c	Thu Sep 26 09:00:28 1996
--- sendmail-8.8.1/src/queue.c	Sat Oct 12 13:35:12 1996
***************
*** 36,44 ****
  
  #ifndef lint
  #ifdef QUEUE
! static char sccsid[] = "@(#)queue.c	8.123 (Berkeley) 9/26/96 (with queueing)";
  #else
! static char sccsid[] = "@(#)queue.c	8.123 (Berkeley) 9/26/96 (without queueing)";
  #endif
  #endif /* not lint */
  
--- 36,44 ----
  
  #ifndef lint
  #ifdef QUEUE
! static char sccsid[] = "@(#)queue.c	8.125 (Berkeley) 10/12/96 (with queueing)";
  #else
! static char sccsid[] = "@(#)queue.c	8.125 (Berkeley) 10/12/96 (without queueing)";
  #endif
  #endif /* not lint */
  
***************
*** 589,595 ****
  #ifndef SIGCHLD
  			(void) waitfor(pid);
  #else
! 			CurChildren++;
  #endif /* SIGCHLD */
  			if (QueueIntvl != 0)
  				(void) setevent(QueueIntvl, runqueue, TRUE);
--- 589,595 ----
  #ifndef SIGCHLD
  			(void) waitfor(pid);
  #else
! 			proc_list_add(pid);
  #endif /* SIGCHLD */
  			if (QueueIntvl != 0)
  				(void) setevent(QueueIntvl, runqueue, TRUE);
***************
*** 638,643 ****
--- 638,652 ----
  	*/
  
  	initmaps(FALSE, e);
+ 
+ 	/*
+ 	**  If we are running part of the queue, always ignore stored
+ 	**  host status.
+ 	*/
+ 
+ 	if (QueueLimitId != NULL || QueueLimitSender != NULL ||
+ 	    QueueLimitRecipient != NULL)
+ 		HostStatDir = NULL;
  
  	/*
  	**  Start making passes through the queue.
diff -rc sendmail-8.8.0/src/readcf.c sendmail-8.8.1/src/readcf.c
*** sendmail-8.8.0/src/readcf.c	Fri Sep 20 09:56:34 1996
--- sendmail-8.8.1/src/readcf.c	Wed Oct  9 11:46:22 1996
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)readcf.c	8.173 (Berkeley) 9/20/96";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)readcf.c	8.174 (Berkeley) 10/9/96";
  #endif /* not lint */
  
  # include "sendmail.h"
***************
*** 2044,2050 ****
  		goto g_opt;
  
  	  case 'V':		/* fallback MX host */
! 		FallBackMX = newstr(val);
  		break;
  
  	  case 'v':		/* run in verbose mode */
--- 2044,2051 ----
  		goto g_opt;
  
  	  case 'V':		/* fallback MX host */
! 		if (val[0] != '\0')
! 			FallBackMX = newstr(val);
  		break;
  
  	  case 'v':		/* run in verbose mode */
diff -rc sendmail-8.8.0/src/savemail.c sendmail-8.8.1/src/savemail.c
*** sendmail-8.8.0/src/savemail.c	Thu Sep 26 09:00:27 1996
--- sendmail-8.8.1/src/savemail.c	Fri Sep 27 13:17:09 1996
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)savemail.c	8.99 (Berkeley) 9/26/96";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)savemail.c	8.100 (Berkeley) 9/27/96";
  #endif /* not lint */
  
  # include "sendmail.h"
***************
*** 691,697 ****
  	bool sendbody;
  	bool pm_notify;
  	char buf[MAXLINE];
- 	extern char *xuntextify();
  
  	if (bitset(MCIF_INHEADER, mci->mci_flags))
  	{
--- 691,696 ----
***************
*** 1241,1254 ****
  **
  **	Parameters:
  **		t -- the text to convert.
  **
  **	Returns:
  **		The xtext-ified version of the same string.
  */
  
  char *
! xtextify(t)
  	register char *t;
  {
  	register char *p;
  	int l;
--- 1240,1255 ----
  **
  **	Parameters:
  **		t -- the text to convert.
+ **		taboo -- additional characters that must be encoded.
  **
  **	Returns:
  **		The xtext-ified version of the same string.
  */
  
  char *
! xtextify(t, taboo)
  	register char *t;
+ 	char *taboo;
  {
  	register char *p;
  	int l;
***************
*** 1256,1261 ****
--- 1257,1265 ----
  	static char *bp = NULL;
  	static int bplen = 0;
  
+ 	if (taboo == NULL)
+ 		taboo = "";
+ 
  	/* figure out how long this xtext will have to be */
  	nbogus = l = 0;
  	for (p = t; *p != '\0'; p++)
***************
*** 1263,1269 ****
  		register int c = (*p & 0xff);
  
  		/* ASCII dependence here -- this is the way the spec words it */
! 		if (c < '!' || c > '~' || c == '+' || c == '\\' || c == '(')
  			nbogus++;
  		l++;
  	}
--- 1267,1274 ----
  		register int c = (*p & 0xff);
  
  		/* ASCII dependence here -- this is the way the spec words it */
! 		if (c < '!' || c > '~' || c == '+' || c == '\\' || c == '(' ||
! 		    strchr(taboo, c) != NULL)
  			nbogus++;
  		l++;
  	}
***************
*** 1286,1292 ****
  		register int c = (*t++ & 0xff);
  
  		/* ASCII dependence here -- this is the way the spec words it */
! 		if (c < '!' || c > '~' || c == '+' || c == '\\' || c == '(')
  		{
  			*p++ = '+';
  			*p++ = "0123456789abcdef"[c >> 4];
--- 1291,1298 ----
  		register int c = (*t++ & 0xff);
  
  		/* ASCII dependence here -- this is the way the spec words it */
! 		if (c < '!' || c > '~' || c == '+' || c == '\\' || c == '(' ||
! 		    strchr(taboo, c) != NULL)
  		{
  			*p++ = '+';
  			*p++ = "0123456789abcdef"[c >> 4];
***************
*** 1375,1380 ****
--- 1381,1387 ----
  			c -= 'a' - 10;
  		*p++ |= c;
  	}
+ 	*p = '\0';
  	return bp;
  }
  /*
diff -rc sendmail-8.8.0/src/sendmail.h sendmail-8.8.1/src/sendmail.h
*** sendmail-8.8.0/src/sendmail.h	Thu Sep 26 09:00:27 1996
--- sendmail-8.8.1/src/sendmail.h	Tue Oct 15 10:01:30 1996
***************
*** 31,37 ****
   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   *
!  *	@(#)sendmail.h	8.200 (Berkeley) 9/26/96
   */
  
  /*
--- 31,37 ----
   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   *
!  *	@(#)sendmail.h	8.205 (Berkeley) 10/15/96
   */
  
  /*
***************
*** 41,47 ****
  # ifdef _DEFINE
  # define EXTERN
  # ifndef lint
! static char SmailSccsId[] =	"@(#)sendmail.h	8.200		9/26/96";
  # endif
  # else /*  _DEFINE */
  # define EXTERN extern
--- 41,47 ----
  # ifdef _DEFINE
  # define EXTERN
  # ifndef lint
! static char SmailSccsId[] =	"@(#)sendmail.h	8.205		10/15/96";
  # endif
  # else /*  _DEFINE */
  # define EXTERN extern
***************
*** 187,192 ****
--- 187,193 ----
  
  /* functions */
  extern ADDRESS	*parseaddr __P((char *, ADDRESS *, int, int, char **, ENVELOPE *));
+ extern ADDRESS	*buildaddr __P((char **, ADDRESS *, int, ENVELOPE *));
  extern ADDRESS	*recipient __P((ADDRESS *, ADDRESS **, int, ENVELOPE *));
  extern char	**prescan __P((char *, int, char[], int, char **, u_char *));
  extern int	rewrite __P((char **, int, int, ENVELOPE *));
***************
*** 731,737 ****
  struct symtab
  {
  	char		*s_name;	/* name to be entered */
! 	char		s_type;		/* general type (see below) */
  	struct symtab	*s_next;	/* pointer to next in chain */
  	union
  	{
--- 732,739 ----
  struct symtab
  {
  	char		*s_name;	/* name to be entered */
! 	short		s_type;		/* general type (see below) */
! 	short		s_len;		/* length of this entry */
  	struct symtab	*s_next;	/* pointer to next in chain */
  	union
  	{
***************
*** 1082,1087 ****
--- 1084,1090 ----
  EXTERN bool	UseHesiod;	/* using Hesiod -- interpret Hesiod errors */
  EXTERN bool	SevenBitInput;	/* force 7-bit data on input */
  EXTERN bool	HasEightBits;	/* has at least one eight bit input byte */
+ EXTERN bool	ConfigFileRead;	/* configuration file has been read */
  EXTERN time_t	SafeAlias;	/* interval to wait until @:@ in alias file */
  EXTERN FILE	*InChannel;	/* input connection */
  EXTERN FILE	*OutChannel;	/* output connection */
***************
*** 1180,1185 ****
--- 1183,1189 ----
  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 char	**ExternalEnviron;	/* input environment */
  EXTERN char	*UserEnviron[MAXUSERENVIRON + 1];
  					/* saved user environment */
  extern int	errno;
***************
*** 1286,1291 ****
--- 1290,1296 ----
  extern void	smtprset __P((MAILER *, MCI *, ENVELOPE *));
  extern void	smtpquit __P((MAILER *, MCI *, ENVELOPE *));
  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));
***************
*** 1305,1316 ****
  extern void	xfclose __P((FILE *, char *, char *));
  extern int	switch_map_find __P((char *, char *[], short []));
  extern void	shorten_hostname __P((char []));
! extern int	waitfor __P((int));
  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 void	cleanstrcpy __P((char *, char *, int));
  extern int	getmxrr __P((char *, char **, bool, int *));
  extern int	strtorwset __P((char *, char **, int));
--- 1310,1325 ----
  extern void	xfclose __P((FILE *, char *, char *));
  extern int	switch_map_find __P((char *, char *[], short []));
  extern void	shorten_hostname __P((char []));
! extern int	waitfor __P((pid_t));
! extern void	proc_list_add __P((pid_t));
! extern void	proc_list_drop __P((pid_t));
  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 *));
  extern void	cleanstrcpy __P((char *, char *, int));
  extern int	getmxrr __P((char *, char **, bool, int *));
  extern int	strtorwset __P((char *, char **, int));
diff -rc sendmail-8.8.0/src/srvrsmtp.c sendmail-8.8.1/src/srvrsmtp.c
*** sendmail-8.8.0/src/srvrsmtp.c	Thu Sep 26 09:00:27 1996
--- sendmail-8.8.1/src/srvrsmtp.c	Sat Oct 12 10:11:08 1996
***************
*** 36,44 ****
  
  #ifndef lint
  #ifdef SMTP
! static char sccsid[] = "@(#)srvrsmtp.c	8.122 (Berkeley) 9/26/96 (with SMTP)";
  #else
! static char sccsid[] = "@(#)srvrsmtp.c	8.122 (Berkeley) 9/26/96 (without SMTP)";
  #endif
  #endif /* not lint */
  
--- 36,44 ----
  
  #ifndef lint
  #ifdef SMTP
! static char sccsid[] = "@(#)srvrsmtp.c	8.123 (Berkeley) 10/12/96 (with SMTP)";
  #else
! static char sccsid[] = "@(#)srvrsmtp.c	8.123 (Berkeley) 10/12/96 (without SMTP)";
  #endif
  #endif /* not lint */
  
***************
*** 358,363 ****
--- 358,371 ----
  							MyHostName);
  					break;
  				}
+ 			}
+ 
+ 			/* check for duplicate HELO/EHLO per RFC 1651 4.2 */
+ 			if (gothello)
+ 			{
+ 				message("503 %s Duplicate HELO/EHLO",
+ 					MyHostName);
+ 				break;
  			}
  
  			sendinghost = newstr(p);
diff -rc sendmail-8.8.0/src/stab.c sendmail-8.8.1/src/stab.c
*** sendmail-8.8.0/src/stab.c	Wed Feb 21 17:01:26 1996
--- sendmail-8.8.1/src/stab.c	Thu Oct 17 07:53:18 1996
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)stab.c	8.7 (Berkeley) 2/21/96";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)stab.c	8.9 (Berkeley) 10/17/96";
  #endif /* not lint */
  
  # include "sendmail.h"
***************
*** 71,76 ****
--- 71,77 ----
  	register STAB **ps;
  	register int hfunc;
  	register char *p;
+ 	int len;
  	extern char lower();
  
  	if (tTd(36, 5))
***************
*** 129,139 ****
  	if (tTd(36, 5))
  		printf("entered\n");
  
  	/* make new entry */
! 	s = (STAB *) xalloc(sizeof *s);
! 	bzero((char *) s, sizeof *s);
  	s->s_name = newstr(name);
  	s->s_type = type;
  
  	/* link it in */
  	*ps = s;
--- 130,202 ----
  	if (tTd(36, 5))
  		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:
+ 		len = sizeof s->s_class;
+ 		break;
+ 
+ 	  case ST_ADDRESS:
+ 		len = sizeof s->s_address;
+ 		break;
+ 
+ 	  case ST_MAILER:
+ 		len = sizeof s->s_mailer;
+ 
+ 	  case ST_ALIAS:
+ 		len = sizeof s->s_alias;
+ 		break;
+ 
+ 	  case ST_MAPCLASS:
+ 		len = sizeof s->s_mapclass;
+ 		break;
+ 
+ 	  case ST_MAP:
+ 		len = sizeof s->s_map;
+ 		break;
+ 
+ 	  case ST_HOSTSIG:
+ 		len = sizeof s->s_hostsig;
+ 		break;
+ 
+ 	  case ST_NAMECANON:
+ 		len = sizeof s->s_namecanon;
+ 		break;
+ 
+ 	  case ST_MACRO:
+ 		len = sizeof s->s_macro;
+ 		break;
+ 
+ 	  case ST_RULESET:
+ 		len = sizeof s->s_ruleset;
+ 		break;
+ 
+ 	  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
+ 	len = sizeof *s;
+ #endif
+ 
  	/* make new entry */
! 	s = (STAB *) xalloc(len);
! 	bzero((char *) s, len);
  	s->s_name = newstr(name);
  	s->s_type = type;
+ 	s->s_len = len;
  
  	/* link it in */
  	*ps = s;
diff -rc sendmail-8.8.0/src/util.c sendmail-8.8.1/src/util.c
*** sendmail-8.8.0/src/util.c	Fri Sep 20 09:56:58 1996
--- sendmail-8.8.1/src/util.c	Sat Oct 12 13:35:11 1996
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)util.c	8.104 (Berkeley) 9/20/96";
  #endif /* not lint */
  
  # include "sendmail.h"
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)util.c	8.105 (Berkeley) 10/12/96";
  #endif /* not lint */
  
  # include "sendmail.h"
***************
*** 1363,1381 ****
  
  int
  waitfor(pid)
! 	int pid;
  {
  #ifdef WAITUNION
  	union wait st;
  #else
  	auto int st;
  #endif
! 	int i;
  
  	do
  	{
  		errno = 0;
  		i = wait(&st);
  	} while ((i >= 0 || errno == EINTR) && i != pid);
  	if (i < 0)
  		return -1;
--- 1363,1383 ----
  
  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;
***************
*** 2171,2174 ****
--- 2173,2251 ----
  		return FALSE;
  	}
  	return TRUE;
+ }
+ /*
+ **  PROC_LIST_ADD -- add process id to list of our children
+ **
+ **	Parameters:
+ **		pid -- pid to add to list.
+ **
+ **	Returns:
+ **		none
+ */
+ 
+ static pid_t	*ProcListVec	= NULL;
+ static int	ProcListSize	= 0;
+ 
+ #define NO_PID		((pid_t) 0)
+ #ifndef PROC_LIST_SEG
+ # define PROC_LIST_SEG	32		/* number of pids to alloc at a time */
+ #endif
+ 
+ void
+ proc_list_add(pid)
+ 	pid_t pid;
+ {
+ 	int i;
+ 
+ 	for (i = 0; i < ProcListSize; i++)
+ 	{
+ 		if (ProcListVec[i] == NO_PID)
+ 			break;
+ 	}
+ 	if (i >= ProcListSize)
+ 	{
+ 		/* grow process list */
+ 		pid_t *npv;
+ 
+ 		npv = (pid_t *) xalloc(sizeof (pid_t) * (ProcListSize + PROC_LIST_SEG));
+ 		if (ProcListSize > 0)
+ 		{
+ 			bcopy(ProcListVec, npv, ProcListSize * sizeof (pid_t));
+ 			free(ProcListVec);
+ 		}
+ 		for (i = ProcListSize; i < ProcListSize + PROC_LIST_SEG; i++)
+ 			npv[i] = NO_PID;
+ 		i = ProcListSize;
+ 		ProcListSize += PROC_LIST_SEG;
+ 		ProcListVec = npv;
+ 	}
+ 	ProcListVec[i] = pid;
+ 	CurChildren++;
+ }
+ /*
+ **  PROC_LIST_DROP -- drop pid from process list
+ **
+ **	Parameters:
+ **		pid -- pid to drop
+ **
+ **	Returns:
+ **		none.
+ */
+ 
+ void
+ proc_list_drop(pid)
+ 	pid_t pid;
+ {
+ 	int i;
+ 
+ 	for (i = 0; i < ProcListSize; i++)
+ 	{
+ 		if (ProcListVec[i] == pid)
+ 		{
+ 			ProcListVec[i] = NO_PID;
+ 			CurChildren--;
+ 			break;
+ 		}
+ 	}
  }
diff -rc sendmail-8.8.0/src/version.c sendmail-8.8.1/src/version.c
*** sendmail-8.8.0/src/version.c	Thu Sep 26 09:37:52 1996
--- sendmail-8.8.1/src/version.c	Thu Oct 17 08:37:26 1996
***************
*** 33,39 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)version.c	8.8 (Berkeley) 9/26/96";
  #endif /* not lint */
  
! char	Version[] = "8.8.0";
--- 33,39 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)version.c	8.8.1.1 (Berkeley) 10/17/96";
  #endif /* not lint */
  
! char	Version[] = "8.8.1";
diff -rc sendmail-8.8.0/test/Results sendmail-8.8.1/test/Results
*** sendmail-8.8.0/test/Results	Fri Sep 20 07:18:10 1996
--- sendmail-8.8.1/test/Results	Wed Oct 16 10:01:48 1996
***************
*** 39,44 ****
--- 39,45 ----
  AIX	3.2.3e	FAIL	93.07.26  Steve Bauer <sbauer@silver.sdsmt.edu>
  AIX	3.2.4	FAIL	93.10.07  David J. N. Begley
  AIX	3.2.5	FAIL	94.05.17  Steve Bauer <sbauer@hpcmmib.hpc.sdsmt.edu>
+ AIX	4.2	OK	96.10.16  Steve Bauer <sbauer@krypton.hpc.sdsmt.edu>
  
  IRIX	4.0.4	OK	93.09.25  Robert Elz
  IRIX	5.2	OK	94.12.06  Mark Andrews <mandrews@alias.com>
