SENDMAIL RELEASE NOTES
- @(#)RELEASE_NOTES 8.8.4.4 (Berkeley) 12/2/96
+ @(#)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,
+ even if RunAsUser is specified.
+ SECURITY: Make purgestat (-bH) be root-only. This is not in response
+ to any known attack, but it's best to be conservative.
+ Suggested by Peter Wemm of DIALix.
+ SECURITY: Fix buffer overrun problem in MIME code that has possible
+ security implications. Patch from Alex Garthwaite of the
+ University of Pennsylvania.
+ Use of a -f flag with a phrase attached (e.g., "-f 'Full Name <addr>'")
+ would truncate the address after "Full". Although the -f
+ syntax is incorrect (since it is in the envelope, it
+ shouldn't have comments and full names), the failure mode
+ was unnecessarily awful.
+ Fix a possible null pointer dereference when converting 8-bit data
+ to a 7-bit format. Problem noted by Jim Hutchins of
+ Sandia National Labs and David James of British Telecom.
+ Clear out stale state that affected F=9 on SMTP mailers in queue
+ runs. Although this really shouldn't be used (F=9 is for
+ final delivery only, and using it on an SMTP mailer makes
+ it possible for a message to be converted from 8->7->8->7
+ bits several times), it shouldn't have failed with a syserr.
+ Problem noted by Eric Hagberg of Morgan Stanley.
+ _Really_ fix the multiple :maildrop code in the user database
+ module. Patch from Roy Mongiovi of Georgia Tech.
+ Let F lines in the configuration file actually read root-only
+ files if the configuration file is safe. Based on a
+ patch from Keith Reynolds of SCO.
+ ETRN followed by QUIT would hold the connection open until the queue
+ run completed. Problem noted by Truck Lewis of TDK
+ Semiconductor Corp.
+ It turns out that despite the documentation, the TCP wrappers library
+ does _not_ log rejected connections. Do the logging ourselves.
+ Problem noted by Fletcher Mattox of the University of Texas
+ at Austin.
+ If sendmail finds a qf file in its queue directory that is an unknown
+ version (e.g., when backing out to an old version), the
+ error is reported on every queue run. Change it to only
+ give the error once (and rename the qf => Qf). Patch from
+ William A. Gianopoulos of Raytheon Company.
+ Start a new session when doing background delivery; currently it
+ ignored signals but didn't start a new signal, that caused
+ some problems if a background process tried to send mail
+ under certain circumstances. Problem noted by Eric Hagberg
+ of Morgan Stanley; fix from Kari Hurtta.
+ Simplify test for skipping a queue run to just check if the current
+ load average is >= the queueing load average. Previously
+ the check factored in some other parameters that caused it
+ to essentially never skip the queue run. Patch from Bryan
+ Costales.
+ If the SMTP server is running in "nullserver" mode (that is, it is
+ rejecting all commands), start sleeping after MAXBADCOMMAND
+ (25) commands; this helps prevent a bad guy from putting
+ you into a tight loop as a denial-of-service attack. Based
+ on an e-mail conversation with Brad Knowles of AOL.
+ Slow down when too many "light weight" commands have been issued;
+ this helps prevent a class of denial-of-service attacks.
+ The current values and defaults are:
+ MAXNOOPCOMMANDS 20 NOOP, VERB, ONEX, XUSR
+ MAXHELOCOMMANDS 3 HELO, EHLO
+ MAXVRFYCOMMANDS 6 VRFY, EXPN
+ MAXETRNCOMMANDS 8 ETRN
+ These will probably be configurable in a future release.
+ On systems that have uid_t typedefed to be an unsigned short, programs
+ that had the F=S flag and no U= equate would be invoked with
+ the real uid set to 65535 rather than being left unchanged.
+ In some cases, NOTIFY=NEVER was not being honored. Problem noted
+ by Steve Hubert of the University of Washington, Seattle.
+ Mail that was Quoted-Printable encoded and had a soft line break on
+ the last line (i.e., an incomplete continuation) had the last
+ line dropped. Since this appears to be illegal it isn't
+ clear what to do with it, but flushing the last line seems
+ to be a better "fail soft" approach. Based on a patch from
+ Eric Hagberg.
+ If AllowBogusHELO and PrivacyOptions=needmailhelo are both set, a
+ bogus HELO command still causes the "Polite people say HELO
+ first" error message. Problem pointed out by Chris Thomas
+ of UCLA; patch from John Beck of SunSoft.
+ Handle "sendmail -bp -qSfoobar" properly if restrictqrun is set
+ in PrivacyFlags. The -q shouldn't turn this command off.
+ Problem noted by Murray Kucherawy of Pacific Bell Internet;
+ based on a patch from Gregory Neil Shapiro of WPI.
+ Don't consider SMTP reply codes 452 or 552 (exceeded storage allocation)
+ in a DATA transaction to be sticky; these can occur because
+ a message is too large, and smaller messages should still go
+ through. Problem noted by Matt Dillon of Best Internet
+ Communications.
+ In some cases bounces were saved in /var/tmp/dead.letter even if they
+ had been successfully delivered to the envelope sender.
+ Problem noted Eric Hagberg of Morgan Stanley; solution from
+ Gregory Neil Shapiro of WPI.
+ 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.
+ SunOS with LDAP support: compile problems with struct timeval.
+ Patch from Nick Cuccia of TCSI Corporation.
+ SCO: from Keith Reynolds of SCO.
+ Solaris: kstat load average computation wasn't being used.
+ Fixes from Michael Ju. Tokarev of Telecom Service, JSC
+ (Moscow).
+ OpenBSD: from Jason Downs of teeny.org.
+ Altos System V: from Tim Rice.
+ Solaris 2.5: from Alan Perry of SunSoft.
+ Solaris 2.6: from John Beck of SunSoft.
+ Harris Nighthawk PowerUX (mh6000 box): from Bob Miorelli
+ of Pratt & Whitney <miorelli@pweh.com>.
+ CONFIG: It seems that I hadn't gotten the Received: line syntax
+ _just_right_ yet. Tweak it again. I'll omit the names
+ of the "contributors" (quantity two) in this one case.
+ As of now, NO MORE DISCUSSION about the syntax of the
+ Received: line.
+ CONFIG: Although FEATURE(nullclient) uses EXPOSED_USER (class $=E),
+ it never inserts that class into the output file. Fix it
+ so it will honor EXPOSED_USER but will _not_ include root
+ automatically in this class. Problem noted by Ronan KERYELL
+ of Centre de Recherche en Informatique de l'École Nationale
+ Supérieure des Mines de Paris (CRI-ENSMP).
+ CONFIG: Clean up handling of "local:" syntax in relay specifications
+ such as LUSER_RELAY. This change permits the following
+ syntaxes: ``local:'' will send to the same user on the
+ local machine (e.g., in a mailertable entry for "host",
+ ``local:'' will cause an address addressed to user@host to
+ go to user on the local machone). ``local:user'' will send
+ 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
+ of the \" so that the resulting string is properly quoted.
+ Problem noted by Gregory Neil Shapiro of WPI.
+ OP.ME: documentation was inconsistent about whether sendmail did a
+ NOOP or a RSET to probe the connection (it does a RSET).
+ Inconsistency noted by Deeran Peethamparam.
+ OP.ME: insert additional blank pages so it will print properly on
+ a duplex printer. From Matthew Black of Cal State University,
+ Long Beach.
+
8.8.4/8.8.4 96/12/02
SECURITY: under some circumstances, an attacker could get additional
permissions by hard linking to files that were group
Eric Allman <eric@CS.Berkeley.EDU>
- @(#)README 8.108 (Berkeley) 11/16/96
+ @(#)README 8.111 (Berkeley) 1/16/97
This document describes the sendmail configuration files being used
4.2bsd, SysV.2, or 7th Edition version, I suggest finding a friend with
a newer version. You can m4-expand on their system, then run locally.
SunOS's /usr/5bin/m4 or BSD-Net/2's m4 both work. GNU m4 version 1.1
-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.
+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.
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.
+ ``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.
+ the Procmail mailer. This is NOT used by
+ FEATURE(local_procmail); tweak LOCAL_MAILER_ARGS
+ instead.
PROCMAIL_MAILER_MAX [undefined] If set, the maximum size message that
will be accepted by the procmail mailer.
MAIL11_MAILER_PATH [/usr/etc/mail11] The path to the mail11 mailer.
normally the +indicator is just tossed, but by default
it is passed as the -a argument to procmail. The
argument to this feature is the pathname of procmail,
- which defaults to PROCMAIL_MAILER_PATH.
+ which defaults to PROCMAIL_MAILER_PATH. Note that this
+ does NOT use PROCMAIL_MAILER_FLAGS or PROCMAIL_MAILER_ARGS
+ for the local mailer; tweak LOCAL_MAILER_FLAGS and
+ LOCAL_MAILER_ARGS instead.
bestmx_is_local Accept mail as though locally addressed for any host that
lists us as the best possible MX record. This generates
public version out "later this week" [as of 3/1/93]. The following
blurb is direct from Sam:
- $Header: /home/cvs/src/usr.sbin/sendmail/cf/Attic/README,v 1.3 1996/12/14 21:15:15 downsj Exp $
+ $Header: /home/cvs/src/usr.sbin/sendmail/cf/Attic/README,v 1.4 1997/01/22 01:06:47 downsj Exp $
How To Obtain This Software (in case all you get is this file)
--------------------------------------------------------------
confFROM_HEADER From: [$?x$x <$g>$|$g$.] The format of an
internally generated From: address.
confRECEIVED_HEADER Received:
- [.$?_($?s$|from $.$_) $.by $j ($v/$Z)$?r with $r$. id $i$?u for $u$.; $b]
+ [$?sfrom $s .$?_($?s$|from $.$_)
+ $.by $j ($v/$Z)$?r with $r$. id $i$?u
+ for $u$.;
+ $b]
The format of the Received: header
in messages passed through this host.
It is unwise to try to change this.
-# $OpenBSD: Makefile,v 1.6 1997/01/21 00:53:19 niklas Exp $
-# @(#)Makefile 8.17 (Berkeley) 9/12/95
+# $OpenBSD: Makefile,v 1.7 1997/01/22 01:06:49 downsj Exp $
+# @(#)Makefile 8.19 (Berkeley) 1/14/97
#
# This Makefile uses the new Berkeley "make" program. See Makefile.dist
# for a more vanilla version.
#
-# Configuration files are created using "m4 file.mc > file.cf";
+# Create configuration files using "m4 ../m4/cf.m4 file.mc > file.cf";
# this may be easier than tweaking the Makefile. You do need to
# have a fairly modern M4 available (GNU m4 works). On SunOS, use
# /usr/5bin/m4.
#
# Makefile for configuration files.
#
-# @(#)Makefile.dist 8.9 (Berkeley) 9/12/95
+# @(#)Makefile.dist 8.11 (Berkeley) 1/14/97
#
#
-# Configuration files are created using "m4 file.mc > file.cf";
+# Create configuration files using "m4 ../m4/cf.m4 file.mc > file.cf";
# this may be easier than tweaking the Makefile. You do need to
# have a fairly modern M4 available (GNU m4 works). On SunOS, use
# /usr/5bin/m4.
cs-sunos4.1.cf cs-ultrix4.cf \
s2k-osf1.cf s2k-ultrix4.cf \
chez.cs.cf huginn.cs.cf mail.cs.cf mail.eecs.cf mailspool.cs.cf \
- python.cs.cf ucbarpa.cf ucbvax.cf vangogh.cs.cf
+ python.cs.cf ucbarpa.cf ucbvax.cf vangogh.cs.cf knecht.cf
all: $(ALL)
CONCAT(C, $3, $'1`))')
sinclude(_CF_DIR_`'siteconfig/$1.m4)')
define(`EXPOSED_USER', `PUSHDIVERT(5)CE$1
-POPDIVERT`'dnl')
+POPDIVERT`'dnl`'')
define(`LOCAL_USER', `PUSHDIVERT(5)CL$1
-POPDIVERT`'dnl')
+POPDIVERT`'dnl`'')
define(`MASQUERADE_AS', `define(`MASQUERADE_NAME', $1)')
define(`MASQUERADE_DOMAIN', `PUSHDIVERT(5)CM$1
-POPDIVERT`'dnl')
+POPDIVERT`'dnl`'')
define(`MASQUERADE_DOMAIN_FILE', `PUSHDIVERT(5)FM$1
-POPDIVERT`'dnl')
+POPDIVERT`'dnl`'')
define(`GENERICS_DOMAIN', `PUSHDIVERT(5)CG$1
-POPDIVERT`'dnl')
+POPDIVERT`'dnl`'')
define(`GENERICS_DOMAIN_FILE', `PUSHDIVERT(5)FG$1
-POPDIVERT`'dnl')
+POPDIVERT`'dnl`'')
define(`_OPTINS', `ifdef(`$1', `$2$1$3')')
m4wrap(`include(_CF_DIR_`m4/proto.m4')')
define(`confOPERATORS', `.:%@!^/[]+')
define(`confSMTP_LOGIN_MSG', `$j Sendmail $v/$Z; $b')
define(`confRECEIVED_HEADER', `$?sfrom $s $.$?_($?s$|from $.$_)
- $.by $j ($v/$Z)$?r with $r$.
- id $i$?u for $u$.; $b')
+ $.by $j ($v/$Z)$?r with $r$. id $i$?u
+ for $u; $|;
+ $.$b')
define(`confSEVEN_BIT_INPUT', `False')
define(`confEIGHT_BIT_HANDLING', `pass8')
define(`confALIAS_WAIT', `10')
define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward')
divert(0)dnl
-VERSIONID(`@(#)cfhead.m4 8.7 (Berkeley) 11/20/96')
+VERSIONID(`@(#)cfhead.m4 8.9 (Berkeley) 1/18/97')
#
divert(0)
-VERSIONID(`@(#)proto.m4 8.136 (Berkeley) 11/24/96')
+VERSIONID(`@(#)proto.m4 8.139 (Berkeley) 12/31/96')
MAILER(local)dnl
# who gets all local email traffic ($R has precedence for unqualified names)
DH`'ifdef(`MAIL_HUB', MAIL_HUB)
-# class L: names that should be delivered locally, even if we have a relay
+# dequoting map
+Kdequote dequote
+
+divert(0)dnl # end of nullclient diversion
# class E: names that should be exposed as from this host, even if we masquerade
+ifdef(`_NULL_CLIENT_ONLY_', `#',
+`# class L: names that should be delivered locally, even if we have a relay
# class M: domains that should be converted to $M
#CL root
-CE root
+')CE root
undivert(5)dnl
-# dequoting map
-Kdequote dequote
-
-divert(0)dnl # end of nullclient diversion
# who I masquerade as (null for no masquerading) (see also $=M)
DM`'ifdef(`MASQUERADE_NAME', MASQUERADE_NAME)
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< error : $- $+ > $* $#error $@ $( dequote $1 $) $: $2
X`'R< $+ > $+ < @ $+ > $: $>97 $1
undefine(`X')dnl
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 >
R< $+ > $+ $@ $>95 < $1 > $2 < @ $1 >
S95
R< > $* $@ $1 strip off null relay
-R< error : $- $+ > $* $#error $@ $1 $: $2 special case errors
-R< local : > $* < @ $* > $#local $@ $1@$2 $: $1 no host: use old user
-R< local : $+ > $* <@ $* . > $* $#local $@ $2@$3 $: $1 special case local
+R< error : $- $+ > $* $#error $@ $( dequote $1 $) $: $2
+R< local : $* > $* $>CanonLocal < $1 > $2
R< $- : $+ @ $+ > $*<$*>$* $# $1 $@ $3 $: $2<@$3> use literal user
R< $- : $+ > $* $# $1 $@ $2 $: $3 try qualified mailer
R< $=w > $* $@ $2 delete local host
R< $+ > $* $#_RELAY_ $@ $1 $: $2 use unqualified mailer
+###################################################################
+### Ruleset CanonLocal -- canonify local: syntax ###
+###################################################################
+
+SCanonLocal
+# strip trailing dot from any host name that may appear
+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 ###
###################################################################
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-VERSIONID(`@(#)version.m4 8.8.4.2 (Berkeley) 11/26/96')
+VERSIONID(`@(#)version.m4 8.8.5.3 (Berkeley) 1/21/97')
#
divert(0)
# Configuration version number
-DZ8.8.4`'ifdef(`confCF_VERSION', `/confCF_VERSION')
+DZ8.8.5`'ifdef(`confCF_VERSION', `/confCF_VERSION')
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)op.me 8.100 (Berkeley) 12/1/96
+.\" @(#)op.me 8.103 (Berkeley) 12/13/96
.\"
.\" eqn op.me | pic | troff -me
.eh 'SMM:08-%''Sendmail Installation and Operation Guide'
.sp
.r
Eric Allman
-InReference, Inc.
eric@Sendmail.ORG
.sp
-Version 8.100
+Version 8.103
.sp
For Sendmail Version 8.8
.)l
You should not attempt to use this document
for prior versions of
.i sendmail .
+.bp
+.rs
+.sp |4i
+.ce 2
+This page intentionally left blank;
+replace it with a blank sheet for double-sided output.
.bp 7
.sh 1 "BASIC INSTALLATION"
.pp
the cache is first searched.
If an open connection is found, it is probed to see if it is still active
by sending a
-.sm NOOP
+.sm RSET
command.
It is not an error if this fails;
instead, the connection is closed and reopened.
used during queue file rebuild.
.ip /var/spool/mqueue/xf*
A transcript of the current session.
+.if e \
+\{\
+. bp
+. rs
+. sp |4i
+. ce 2
+This page intentionally left blank;
+replace it with a blank sheet for double-sided output.
+.\}
.\".ro
.\".ls 1
.\".tp
.\".sp
.\".sz 10
.\"Eric Allman
-.\"InReference, Inc.
.\".sp
-.\"Version 8.100
+.\"Version 8.103
.\".ce 0
-.bp 2
-.rs
-.sp |4i
-.ce 2
-This page intentionally left blank;
-replace it with a blank sheet for double-sided output.
.bp 3
.ce
.sz 12
# 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.4 (Berkeley) 9/1/95
+# @(#)Makefile.dist 8.5 (Berkeley) 12/18/96
#
# use O=-O (usual) or O=-g (debugging)
makemap.0: makemap.8
${NROFF} ${MANDOC} makemap.8 > makemap.0
+INSTALL=install
+
install: install-makemap install-docs
install-makemap: makemap
- install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} makemap ${BINDIR}
+ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} makemap ${BINDIR}
# doesn't actually install them -- you may want to install pre-nroff versions
install-docs: makemap.0
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# @(#)READ_ME 8.132 (Berkeley) 12/1/96
+# @(#)READ_ME 8.135 (Berkeley) 1/21/97
#
This directory contains the source files for sendmail.
XDEBUG Do additional internal checking. These don't cost too
much; you might as well leave this on.
TCPWRAPPERS Turns on support for the TCP wrappers library (-lwrap).
- This library is available on ftp.win.tue.nl in /pub/security;
- grab tcp_wrappers_<VER>.tar.gz (where <VER> is the highest
- numbered version).
+ See below for further information.
SECUREWARE Enable calls to the SecureWare luid enabling/changing routines.
SecureWare is a C2 security package added to several UNIX's
(notably ConvexOS) to get a C2 Secure system. This
>>
>> here, path 2 would be the first used.
+Solaris 2.6 (SunOS 5.6)
+ If you built sendmail 8.8.1 through 8.8.4 inclusive on a Solaris 2.5
+ system, that binary will not run on Solaris 2.6, due to problems with
+ 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
/usr/include/resolv.h:208: warning: `__P' redefined
cdefs.h:58: warning: this is the location of the previous definition
- If you are running with this patch, create a file in the
+ If you are running with this patch, create a resolv.h file in the
obj.SunOS.5.5.1.* directory that reads:
#undef __P
send them along.
TCP Wrappers
- If you are using -DTCPWRAPPERS to get TCP Wrappers support, you will
- also need to install libwrap.a (you can get it from ftp.win.tue.nl)
- and modify the Makefile to include -lwrap in the LIBS line.
+ If you are using -DTCPWRAPPERS to get TCP Wrappers support you will
+ also need to install libwrap.a and modify the Makefile to include
+ -lwrap in the LIBS line (make sure that INCDIRS and LIBDIRS point
+ to where the tcpd.h and libwrap.a can be found).
+
+ TCP Wrappers is available on ftp.win.tue.nl in /pub/security;
+ grab tcp_wrappers_<VER>.tar.gz (where <VER> is the highest
+ numbered version).
If you have alternate MX sites for your site, be sure that all of
your MX sites reject the same set of hosts. If not, a bad guy whom
you reject will connect to your site, fail, and move on to the next
- MX site, which will accept the mail for your and forward it on to you.
+ MX site, which will accept the mail for you and forward it on to you.
+--------------+
Eric Allman
-(Version 8.132, last update 12/1/96 09:34:37)
+(Version 8.135, last update 1/21/97 07:47:02)
# include "sendmail.h"
#ifndef lint
-static char sccsid[] = "@(#)alias.c 8.66 (Berkeley) 9/20/96";
+static char sccsid[] = "@(#)alias.c 8.67 (Berkeley) 1/18/97";
#endif /* not lint */
while (fgets(line, sizeof (line), af) != NULL)
{
int lhssize, rhssize;
+ int c;
LineNumber++;
p = strchr(line, '\n');
if (p != NULL)
*p = '\0';
+ else if (!feof(af))
+ {
+ syserr("554 alias line too long");
+
+ /* flush to end of line */
+ while ((c = getc(af)) != EOF && c != '\n')
+ continue;
+
+ /* skip any continuation lines */
+ skipping = TRUE;
+ continue;
+ }
switch (line[0])
{
case '#':
rhs = p;
for (;;)
{
- register char c;
register char *nlp;
nlp = &p[strlen(p)];
LineNumber++;
/* check for line overflow */
- if (strchr(p, '\n') == NULL)
+ if (strchr(p, '\n') == NULL && !feof(af))
{
usrerr("554 alias too long");
+ while ((c = fgetc(af)) != EOF && c != '\n')
+ continue;
+ skipping = TRUE;
break;
}
}
+
+ if (skipping)
+ continue;
+
if (!bitnset(M_ALIASABLE, al.q_mailer->m_flags))
{
syserr("554 %s... cannot alias non-local names",
*/
#ifndef lint
-static char sccsid[] = "@(#)clock.c 8.16 (Berkeley) 11/27/96";
+static char sccsid[] = "@(#)clock.c 8.18 (Berkeley) 12/31/96";
#endif /* not lint */
# include "sendmail.h"
** none.
*/
-static void tick __P((int));
+static SIGFUNC_DECL tick __P((int));
EVENT *
setevent(intvl, func, arg)
** calls the next function in EventQueue.
*/
-static void
+static SIGFUNC_DECL
tick(arg)
int arg;
{
register EVENT *ev;
int mypid = getpid();
int olderrno = errno;
-#ifdef SIG_UNBLOCK
- sigset_t ss;
-#endif
(void) setsignal(SIGALRM, SIG_IGN);
(void) alarm(0);
if (EventQueue != NULL)
(void) alarm((unsigned) (EventQueue->ev_time - now));
errno = olderrno;
+ return SIGFUNC_RETURN;
}
\f/*
** SLEEP -- a version of sleep that works with this stuff
*/
#ifndef lint
-static char sccsid[] = "@(#)collect.c 8.61 (Berkeley) 11/24/96";
+static char sccsid[] = "@(#)collect.c 8.62 (Berkeley) 12/11/96";
#endif /* not lint */
# include <errno.h>
markstats(e, (ADDRESS *) NULL);
}
+#ifdef _FFR_DSN_RRT
+ /*
+ ** If we have a Return-Receipt-To:, turn it into a DSN.
+ */
+
+ if (RrtImpliesDsn && hvalue("return-receipt-to", e->e_header) != NULL)
+ {
+ ADDRESS *q;
+
+ for (q = e->e_sendqueue; q != NULL; q = q->q_next)
+ if (!bitset(QHASNOTIFY, q->q_flags))
+ q->q_flags |= QHASNOTIFY|QPINGONSUCCESS;
+ }
+#endif
+
/*
** Add an Apparently-To: line if we have no recipient lines.
*/
*/
#ifndef lint
-static char sccsid[] = "@(#)conf.c 8.325 (Berkeley) 12/1/96";
+static char sccsid[] = "@(#)conf.c 8.333 (Berkeley) 1/21/97";
#endif /* not lint */
# include "sendmail.h"
-/*
-** Location of system files/databases/etc.
-*/
-
-char *PidFile = _PATH_SENDMAILPID; /* stores daemon proc id */
-
-
-
/*
** Privacy values
*/
ServiceSwitchFile = "/etc/service.switch";
ServiceCacheMaxAge = (time_t) 10;
HostsFile = _PATH_HOSTS;
+ PidFile = newstr(_PATH_SENDMAILPID);
MustQuoteChars = "@,;:\\()[].'";
MciInfoTimeout = 30 MINUTES;
MaxRuleRecursion = MAXRULERECURSION;
int
getla()
{
- kstat_ctl_t *kc;
- kstat_t *ksp;
+ static kstat_ctl_t *kc = NULL;
+ static kstat_t *ksp = NULL;
kstat_named_t *ksn;
int la;
- kc = kstat_open();
+ if (kc == NULL) /* if not initialized before */
+ kc = kstat_open();
if (kc == NULL)
{
if (tTd(3, 1))
errstring(errno));
return -1;
}
- ksp = kstat_lookup(kc, "unix", 0, "system_misc"); /* NULL on error */
+ if (ksp == NULL)
+ ksp = kstat_lookup(kc, "unix", 0, "system_misc");
if (ksp == NULL)
{
if (tTd(3, 1))
printf("getla: kstat_lookup(): %s\n",
- errstring(errno);
+ errstring(errno));
return -1;
}
if (kstat_read(kc, ksp, NULL) < 0)
{
if (tTd(3, 1))
printf("getla: kstat_read(): %s\n",
- errstring(errno);
+ errstring(errno));
return -1;
}
ksn = (kstat_named_t *) kstat_data_lookup(ksp, "avenrun_1min");
- la = (ksn->value.ul + FSCALE/2) >> FSHIFT;
- kstat_close(kc);
+ la = ((double)ksn->value.ul + FSCALE/2) / FSCALE;
+ /* kstat_close(kc); /o do not close for fast access */
return la;
}
/* Non Apollo stuff removed by Don Lewis 11/15/93 */
#ifndef lint
-static char rcsid[] = "@(#)$Id: conf.c,v 1.5 1996/12/14 21:17:07 downsj Exp $";
+static char rcsid[] = "@(#)$Id: conf.c,v 1.6 1997/01/22 01:07:03 downsj Exp $";
#endif /* !lint */
#ifdef apollo
** Picks up extant zombies.
*/
-void
+SIGFUNC_DECL
reapchild(sig)
int sig;
{
(void) setsignal(SIGCHLD, reapchild);
# endif
errno = olderrno;
+ return SIGFUNC_RETURN;
}
\f/*
** PUTENV -- emulation of putenv() in terms of setenv()
if(!*place) { /* update scanning pointer */
if (optind >= nargc || *(place = nargv[optind]) != '-' || !*++place) {
atend++;
- return(EOF);
+ return -1;
}
if (*place == '-') { /* found "--" */
++optind;
atend++;
- return(EOF);
+ return -1;
}
} /* option letter okay? */
if ((optopt = (int)*place++) == (int)':' || !(oli = strchr(ostr,optopt))) {
* causing nast effects.
**************************************************************/
-/*static char _id[] = "$Id: conf.c,v 1.5 1996/12/14 21:17:07 downsj Exp $";*/
+/*static char _id[] = "$Id: conf.c,v 1.6 1997/01/22 01:07:03 downsj Exp $";*/
static void dopr();
static char *end;
static int SnprfOverflow;
# endif
syserr("cannot lockf(%s%s, fd=%d, type=%o, omode=%o, euid=%d)",
filename, ext, fd, type, omode, geteuid());
+ dumpfd(fd, TRUE, TRUE);
}
# else
if (ext == NULL)
# endif
syserr("cannot flock(%s%s, fd=%d, type=%o, omode=%o, euid=%d)",
filename, ext, fd, type, omode, geteuid());
+ dumpfd(fd, TRUE, TRUE);
}
# endif
if (tTd(55, 60))
#if TCPWRAPPERS
# include <tcpd.h>
+
+/* tcpwrappers does no logging, but you still have to declare these -- ugh */
int allow_severity = LOG_INFO;
-int deny_severity = LOG_WARNING;
+int deny_severity = LOG_NOTICE;
#endif
#if DAEMON
#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
return TRUE;
}
int s;
int i;
struct ifconf ifc;
- char interfacebuf[1024];
+ char interfacebuf[10240];
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s == -1)
#if USE_SA_SIGACTION
"USE_SA_SIGACTION",
#endif
+#if USE_SIGLONGJMP
+ "USE_SIGLONGJMP",
+#endif
#if USESETEUID
"USESETEUID",
#endif
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)conf.h 8.279 (Berkeley) 12/1/96
+ * @(#)conf.h 8.288 (Berkeley) 1/17/97
*/
/*
#if defined(sun) && !defined(BSD)
+# include <sys/time.h>
# define HASINITGROUPS 1 /* has initgroups(3) call */
# define HASUNAME 1 /* use System V uname(2) system call */
# 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 */
-# ifndef LA_TYPE
-# define LA_TYPE LA_INT
-# endif
# ifdef SOLARIS_2_3
# define SOLARIS 20300 /* for back compat only -- use -DSOLARIS=20300 */
# ifndef __svr4__
# define __svr4__ /* use all System V Releae 4 defines below */
# endif
-# include <sys/time.h>
# define GIDSET_T gid_t
# define USE_SA_SIGACTION 1 /* use sa_sigaction field */
# ifndef _PATH_UNIX
# define USESETEUID 1 /* seteuid works as of 2.3 */
# endif
# if SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205)
-# define HASSNPRINTF 1 /* has snprintf starting in 2.5 */
# define HASSETREUID 1 /* setreuid works as of 2.5 */
-# if SOLARIS == 20500 || SOLARIS == 205
-# define snprintf __snprintf /* but names it oddly in 2.5 */
-# define vsnprintf __vsnprintf
-# endif
# ifndef LA_TYPE
# define LA_TYPE LA_KSTAT /* use kstat(3k) -- may work in < 2.5 */
# endif
# endif
+# if SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206)
+# define HASSNPRINTF 1 /* has snprintf starting in 2.6 */
+# endif
# ifndef HASGETUSERSHELL
# define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */
# endif
# endif
# endif
-#endif
+
+# ifndef LA_TYPE
+# define LA_TYPE LA_INT
+# endif
+
+#endif /* sun && !BSD */
/*
** DG/UX
# undef SPT_TYPE
# define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */
# endif
-# if defined(__OpenBSD__)
-# undef SPT_TYPE
-# define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */
-# endif
# if defined(__FreeBSD__)
# undef SPT_TYPE
# if __FreeBSD__ == 2
# define SPT_PADCHAR '\0' /* pad process title with nulls */
# endif
# endif
+# if defined(__OpenBSD__)
+# undef SPT_TYPE
+# define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */
+# endif
#endif
# define SYSTEM5 1 /* include all the System V defines */
# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
# define NOFTRUNCATE 0 /* has (simulated) ftruncate call */
+# define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */
# define MAXPATHLEN PATHSIZE
# define SFS_TYPE SFS_4ARGS /* use <sys/statfs.h> 4-arg impl */
# define SFS_BAVAIL f_bfree /* alternate field name */
# define WAITUNION 1 /* use "union wait" as wait argument type */
# define NEEDFSYNC 1 /* no fsync(2) in system library */
# define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */
+# define NOFTRUNCATE 1 /* do not have ftruncate(2) */
# define MAXPATHLEN PATH_MAX
# define LA_TYPE LA_SHORT
# define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
typedef unsigned short uid_t;
typedef unsigned short gid_t;
typedef short pid_t;
+typedef unsigned long mode_t;
/* some stuff that should have been in the include files */
# include <grp.h>
extern int errno;
typedef int pid_t;
-#define SIGFUNC_DEFINED
+#define SIGFUNC_DEFINED
+#define SIGFUNC_RETURN (0)
+#define SIGFUNC_DECL int
typedef int (*sigfunc_t)();
extern char *getenv();
extern void *malloc();
# 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
# define IDENTPROTO 0 /* TCP/IP implementation is broken */
# endif
# define RLIMIT_NEEDS_SYS_TIME_H 1
+# if defined(NGROUPS_MAX) && !NGROUPS_MAX
+# undef NGROUPS_MAX
+# endif
#endif
typedef int pid_t;
typedef int (*sigfunc_t)();
# define SIGFUNC_DEFINED
+# define SIGFUNC_RETURN (0)
+# define SIGFUNC_DECL int
# else
/* NEWS-OS 6.0.3 with /bin/cc */
typedef int pid_t;
typedef int (*sigfunc_t)();
# define SIGFUNC_DEFINED
+# define SIGFUNC_RETURN (0)
+# define SIGFUNC_DECL int
extern char *getenv();
extern int errno;
# define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
#endif
+/*
+** Harris Nighthawk PowerUX (nh6000 box)
+**
+** Contributed by Bob Miorelli, Pratt & Whitney <miorelli@pweh.com>
+*/
+
+#ifdef _PowerUX
+# ifndef __svr4__
+# define __svr4__
+# endif
+# define _PATH_VENDOR_CF "/etc/mail/sendmail.cf"
+# ifndef _PATH_SENDMAILPID
+# define _PATH_SENDMAILPID "/etc/mail/sendmail.pid"
+# endif
+# define SYSLOG_BUFSIZE 1024
+# define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */
+# define LA_TYPE LA_ZERO
+typedef struct msgb mblk_t;
+# undef offsetof /* avoid stddefs.h and sys/sysmacros.h conflict */
+#endif
+
+
/**********************************************************************
** End of Per-Operating System defines
**********************************************************************/
# define SFS_TYPE SFS_STATVFS
# endif
-/* SVr4 uses different routines for setjmp/longjmp with signal support */
-# define jmp_buf sigjmp_buf
-# define setjmp(env) sigsetjmp(env, 1)
-# define longjmp(env, val) siglongjmp(env, val)
+# define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */
#endif
/* general System V defines */
# define SECUREWARE 0 /* assume no SecureWare C2 auditing hooks */
#endif
+#ifndef USE_SIGLONGJMP
+# define USE_SIGLONGJMP 0 /* assume setjmp handles signals properly */
+#endif
+
/*
** If no type for argument two of getgroups call is defined, assume
** it's an integer -- unfortunately, there seem to be several choices
#ifndef SIGFUNC_DEFINED
typedef void (*sigfunc_t) __P((int));
#endif
+#ifndef SIGFUNC_RETURN
+# define SIGFUNC_RETURN
+#endif
+#ifndef SIGFUNC_DECL
+# define SIGFUNC_DECL void
+#endif
/* size of syslog buffer */
#ifndef SYSLOG_BUFSIZE
#ifndef SCANF
# define SCANF 1
#endif
+
+/*
+** SVr4 and similar systems use different routines for setjmp/longjmp
+** with signal support
+*/
+
+#if USE_SIGLONGJMP
+/* Silly SCO /usr/include/setjmp.h file has #define setjmp(env) setjmp(env) */
+# ifdef setjmp
+# undef setjmp
+# endif
+# define jmp_buf sigjmp_buf
+# define setjmp(env) sigsetjmp(env, 1)
+# define longjmp(env, val) siglongjmp(env, val)
+#endif
+
+#if !defined(NGROUPS_MAX) && defined(NGROUPS)
+# define NGROUPS_MAX NGROUPS /* POSIX naming convention */
+#endif
#ifndef lint
#ifdef DAEMON
-static char sccsid[] = "@(#)daemon.c 8.156 (Berkeley) 12/1/96 (with daemon mode)";
+static char sccsid[] = "@(#)daemon.c 8.159 (Berkeley) 1/14/97 (with daemon mode)";
#else
-static char sccsid[] = "@(#)daemon.c 8.156 (Berkeley) 12/1/96 (without daemon mode)";
+static char sccsid[] = "@(#)daemon.c 8.159 (Berkeley) 1/14/97 (without daemon mode)";
#endif
#endif /* not lint */
(void) setsignal(SIGCHLD, reapchild);
/* write the pid to the log file for posterity */
- pidf = fopen(PidFile, "w");
+ pidf = safefopen(PidFile, O_WRONLY|O_CREAT|O_TRUNC, 0644,
+ SFF_NOSLINK|SFF_ROOTOK|SFF_REGONLY|SFF_CREAT);
if (pidf != NULL)
{
extern char *CommandLineArgs;
if (pid == 0)
{
char *p;
- extern void intsig();
+ extern SIGFUNC_DECL intsig __P((int));
FILE *inchannel, *outchannel;
bool nullconn;
*/
#ifndef lint
-static char sccsid[] = "@(#)deliver.c 8.260 (Berkeley) 12/1/96";
+static char sccsid[] = "@(#)deliver.c 8.266 (Berkeley) 1/17/97";
#endif /* not lint */
#include "sendmail.h"
ee->e_errorqueue = copyqueue(e->e_errorqueue);
ee->e_flags = e->e_flags & ~(EF_INQUEUE|EF_CLRQUEUE|EF_FATALERRS|EF_SENDRECEIPT|EF_RET_PARAM);
ee->e_flags |= EF_NORECEIPT;
- setsender(owner, ee, NULL, TRUE);
+ setsender(owner, ee, NULL, '\0', TRUE);
if (tTd(13, 5))
{
printf("sendall(split): QDONTSEND ");
if (owner != NULL)
{
- setsender(owner, e, NULL, TRUE);
+ setsender(owner, e, NULL, '\0', TRUE);
if (tTd(13, 5))
{
printf("sendall(owner): QDONTSEND ");
queueonly:
if (e->e_nrcpts > 0)
e->e_flags |= EF_INQUEUE;
+ dropenvelope(e, FALSE);
+ for (ee = splitenv; ee != NULL; ee = ee->e_sibling)
+ {
+ if (ee->e_nrcpts > 0)
+ ee->e_flags |= EF_INQUEUE;
+ dropenvelope(ee, FALSE);
+ }
return;
case SM_FORK:
exit(EX_OK);
/* be sure we are immune from the terminal */
- disconnect(1, e);
+ disconnect(2, e);
/* prevent parent from waiting if there was an error */
if (pid < 0)
*/
#ifndef NO_UID
-# define NO_UID ((uid_t) -1)
+# define NO_UID -1
#endif
#ifndef NO_GID
-# define NO_GID ((gid_t) -1)
+# define NO_GID -1
#endif
int
{
int i;
int saveerrno;
- uid_t new_euid = NO_UID;
- uid_t new_ruid = NO_UID;
- gid_t new_gid = NO_GID;
+ int new_euid = NO_UID;
+ int new_ruid = NO_UID;
+ int new_gid = NO_GID;
struct stat stb;
extern int DtableSize;
}
#endif
+ /* clear out per-message flags from connection structure */
+ mci->mci_flags &= ~(MCIF_CVT7TO8|MCIF_CVT8TO7);
+
if (bitset(EF_HAS8BIT, e->e_flags) &&
!bitset(EF_DONT_MIME, e->e_flags) &&
bitnset(M_7BITS, m->m_flags))
mci->mci_flags |= MCIF_CVT8TO7;
- else
- mci->mci_flags &= ~MCIF_CVT8TO7;
#if MIME7TO8
if (bitnset(M_MAKE8BIT, m->m_flags) &&
e->e_statmsg = NULL;
/* reset the mci state for the next transaction */
- if (mci->mci_state == MCIS_ACTIVE)
+ if (mci != NULL && mci->mci_state == MCIS_ACTIVE)
mci->mci_state = MCIS_OPEN;
}
# endif
#if SMTP
/* now close the connection */
- if (clever && mci->mci_state != MCIS_CLOSED &&
+ if (clever && mci != NULL && mci->mci_state != MCIS_CLOSED &&
!bitset(MCIF_CACHED, mci->mci_flags))
smtpquit(m, mci, e);
#endif
*/
#ifndef lint
-static char sccsid[] = "@(#)envelope.c 8.99 (Berkeley) 12/1/96";
+static char sccsid[] = "@(#)envelope.c 8.101 (Berkeley) 12/16/96";
#endif /* not lint */
#include "sendmail.h"
if (bitset(EF_FATALERRS, e->e_flags) && !failure_return)
{
- failure_return = TRUE;
for (q = e->e_sendqueue; q != NULL; q = q->q_next)
{
- if (!bitset(QDONTSEND, q->q_flags))
+ if (!bitset(QDONTSEND, q->q_flags) &&
+ bitset(QPINGONFAILURE, q->q_flags))
+ {
+ failure_return = TRUE;
q->q_flags |= QBADADDR;
+ }
}
}
** e -- the envelope in which we would like the sender set.
** delimptr -- if non-NULL, set to the location of the
** trailing delimiter.
+** delimchar -- the character that will delimit the sender
+** address.
** internal -- set if this address is coming from an internal
** source such as an owner alias.
**
*/
void
-setsender(from, e, delimptr, internal)
+setsender(from, e, delimptr, delimchar, internal)
char *from;
register ENVELOPE *e;
char **delimptr;
+ int delimchar;
bool internal;
{
register char **pvp;
char *realname = NULL;
register struct passwd *pw;
- char delimchar;
char *bp;
char buf[MAXNAME + 2];
char pvpbuf[PSBUFSIZE];
if (ConfigLevel < 2)
SuprErrs = TRUE;
- delimchar = internal ? '\0' : ' ';
e->e_from.q_flags = QBADADDR;
if (from == NULL ||
parseaddr(from, &e->e_from, RF_COPYALL|RF_SENDERADDR,
*/
#ifndef lint
-static char sccsid[] = "@(#)headers.c 8.101 (Berkeley) 11/23/96";
+static char sccsid[] = "@(#)headers.c 8.103 (Berkeley) 12/11/96";
#endif /* not lint */
# include <errno.h>
if (tTd(32, 2))
printf("eatheader: setsender(*%s == %s)\n",
hi->hi_field, p);
- setsender(p, e, NULL, TRUE);
+ setsender(p, e, NULL, '\0', TRUE);
}
}
/* 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))
+#endif
{
if (tTd(34, 11))
printf(" (skipped (receipt))\n");
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 8.223 (Berkeley) 12/1/96";
+static char sccsid[] = "@(#)main.c 8.230 (Berkeley) 1/17/97";
#endif /* not lint */
#define _DEFINE
extern char *optarg;
extern char **environ;
extern time_t convtime();
- extern void intsig();
+ extern SIGFUNC_DECL intsig __P((int));
extern struct hostent *myhostname();
extern char *getauthinfo();
extern char *getcfname();
- extern void sigusr1();
- extern void sighup();
+ extern SIGFUNC_DECL sigusr1 __P((int));
+ extern SIGFUNC_DECL sighup __P((int));
extern void initmacros __P((ENVELOPE *));
extern void init_md __P((int, char **));
extern int getdtsize __P((void));
/* drop group id privileges (RunAsUser not yet set) */
drop_privileges();
+ /* drop group id privileges (RunAsUser not yet set) */
+ drop_privileges();
+
/* Handle any non-getoptable constructions. */
obsolete(argv);
printf("Warning: HostStatusDirectory required for SingleThreadDelivery\n");
}
+ /* 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);
+ }
+
if (MeToo)
BlankEnvelope.e_flags |= EF_METOO;
/* fall through ... */
case MD_DAEMON:
- /* check for permissions */
- if (RealUid != 0)
- {
-#ifdef LOG
- if (LogLevel > 1)
- syslog(LOG_ALERT, "user %d attempted to run daemon",
- RealUid);
-#endif
- usrerr("Permission denied");
- exit(EX_USAGE);
- }
vendor_daemon_setup(CurEnv);
/* remove things that don't make sense in daemon mode */
Verbose = TRUE;
/* fall through... */
+ case MD_PRINT:
+ /* to handle sendmail -bp -qSfoobar properly */
+ queuemode = FALSE;
+ /* fall through... */
+
default:
/* arrange to exit cleanly on hangup signal */
if (setsignal(SIGHUP, SIG_IGN) == (sigfunc_t) SIG_DFL)
if (OpMode == MD_TEST)
{
char buf[MAXLINE];
- void intindebug();
+ SIGFUNC_DECL intindebug __P((int));
if (isatty(fileno(stdin)))
Verbose = TRUE;
if (warn_f_flag != '\0' && !wordinclass(RealUserName, 't'))
auth_warning(CurEnv, "%s set sender to %s using -%c",
RealUserName, from, warn_f_flag);
- setsender(from, CurEnv, NULL, FALSE);
+ setsender(from, CurEnv, NULL, '\0', FALSE);
if (macvalue('s', CurEnv) == NULL)
define('s', RealHostName, CurEnv);
}
-void
-intindebug()
+SIGFUNC_DECL
+intindebug(sig)
+ int sig;
{
longjmp(TopFrame, 1);
+ return SIGFUNC_RETURN;
}
** Unlocks the current job.
*/
-void
-intsig()
+SIGFUNC_DECL
+intsig(sig)
+ int sig;
{
#ifdef LOG
if (LogLevel > 79)
}
-void
-sigusr1()
+SIGFUNC_DECL
+sigusr1(sig)
+ int sig;
{
dumpstate("user signal");
+ return SIGFUNC_RETURN;
}
-void
-sighup()
+SIGFUNC_DECL
+sighup(sig)
+ int sig;
{
if (SaveArgv[0][0] != '/')
{
\f/*
** DROP_PRIVILEGES -- reduce privileges to those of the RunAsUser option
**
-** Parameters:
-** none.
+** Parameters:
+** none.
**
-** Returns:
-** none.
+** Returns:
+** none.
*/
void
/* reset group permissions; these can be set later */
GIDSET_T emptygidset[NGROUPS_MAX];
- emptygidset[0] = RunAsGid == 0 ? geteuid() : RunAsGid;
+ emptygidset[0] = RunAsGid == 0 ? getegid() : RunAsGid;
(void) setgroups(1, emptygidset);
#endif
if (RunAsGid != 0)
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# @(#)makesendmail 8.42 (Berkeley) 11/10/96
+# @(#)makesendmail 8.43 (Berkeley) 12/14/96
#
#
os="UXPDS"
rel=`uname -v | sed -e 's/\(V.*\)L.*/\1/'`
fi;;
+ SINIX-?) os=SINIX;;
esac
# get "base part" of operating system release
*/
#ifndef lint
-static char sccsid[] = "@(#)map.c 8.146 (Berkeley) 11/24/96";
+static char sccsid[] = "@(#)map.c 8.147 (Berkeley) 1/17/97";
#endif /* not lint */
#include "sendmail.h"
#ifdef NISPLUS
-#undef NIS /* symbol conflict in nis.h */
+#undef NIS /* symbol conflict in nis.h */
+#undef T_UNSPEC /* symbol conflict in nis.h -> ... -> sys/tiuser.h */
#include <rpcsvc/nis.h>
#include <rpcsvc/nislib.h>
# include <string.h>
#ifndef lint
-static char sccsid[] = "@(#)mime.c 8.51 (Berkeley) 11/24/96";
+static char sccsid[] = "@(#)mime.c 8.54 (Berkeley) 1/14/97";
#endif /* not lint */
/*
register char *p;
char *cte;
char **pvp;
- u_char *obp;
u_char *fbufp;
char buf[MAXLINE];
- u_char obuf[MAXLINE + 1];
u_char fbuf[MAXLINE + 1];
char pvpbuf[MAXLINE];
extern u_char MimeTokenTab[256];
c2 = CHAR64(c2);
*fbufp = (c1 << 2) | ((c2 & 0x30) >> 4);
- if (*fbufp++ == '\n' || fbuf >= &fbuf[MAXLINE])
+ if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE])
{
- if (*--fbufp != '\n' || *--fbufp != '\r')
+ if (*--fbufp != '\n' ||
+ (fbufp > fbuf && *--fbufp != '\r'))
fbufp++;
*fbufp = '\0';
putline((char *) fbuf, mci);
continue;
c3 = CHAR64(c3);
*fbufp = ((c2 & 0x0f) << 4) | ((c3 & 0x3c) >> 2);
- if (*fbufp++ == '\n' || fbuf >= &fbuf[MAXLINE])
+ if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE])
{
- if (*--fbufp != '\n' || *--fbufp != '\r')
+ if (*--fbufp != '\n' ||
+ (fbufp > fbuf && *--fbufp != '\r'))
fbufp++;
*fbufp = '\0';
putline((char *) fbuf, mci);
continue;
c4 = CHAR64(c4);
*fbufp = ((c3 & 0x03) << 6) | c4;
- if (*fbufp++ == '\n' || fbuf >= &fbuf[MAXLINE])
+ if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE])
{
- if (*--fbufp != '\n' || *--fbufp != '\r')
+ if (*--fbufp != '\n' ||
+ (fbufp > fbuf && *--fbufp != '\r'))
fbufp++;
*fbufp = '\0';
putline((char *) fbuf, mci);
fbufp = fbuf;
}
}
-
- /* force out partial last line */
- if (fbufp > fbuf)
- {
- *fbufp = '\0';
- putline((char *) fbuf, mci);
- }
}
else
{
/* quoted-printable */
- obp = obuf;
+ fbufp = fbuf;
while (fgets(buf, sizeof buf, e->e_dfp) != NULL)
{
- if (mime_fromqp((u_char *) buf, &obp, 0, &obuf[MAXLINE] - obp) == 0)
+ if (mime_fromqp((u_char *) buf, &fbufp, 0,
+ &fbuf[MAXLINE] - fbufp) == 0)
continue;
- putline((char *) obuf, mci);
- obp = obuf;
+ putline((char *) fbuf, mci);
+ fbufp = fbuf;
}
}
+
+ /* force out partial last line */
+ if (fbufp > fbuf)
+ {
+ *fbufp = '\0';
+ putline((char *) fbuf, mci);
+ }
if (tTd(43, 3))
printf("\t\t\tmime7to8 => %s to 8bit done\n", cte);
}
#ifndef lint
#if QUEUE
-static char sccsid[] = "@(#)queue.c 8.145 (Berkeley) 12/2/96 (with queueing)";
+static char sccsid[] = "@(#)queue.c 8.153 (Berkeley) 1/14/97 (with queueing)";
#else
-static char sccsid[] = "@(#)queue.c 8.145 (Berkeley) 12/2/96 (without queueing)";
+static char sccsid[] = "@(#)queue.c 8.153 (Berkeley) 1/14/97 (without queueing)";
#endif
#endif /* not lint */
#define QF_VERSION 2 /* version number of this queue format */
-#if !defined(NGROUPS_MAX) && defined(NGROUPS)
-# define NGROUPS_MAX NGROUPS /* POSIX naming convention */
-#endif
-
extern int orderq __P((bool));
\f/*
** QUEUEUP -- queue a message up for future transmission.
CurrentLA = getla(); /* get load average */
- if (shouldqueue(0L, curtime()))
+ if (CurrentLA >= QueueLA)
{
char *msg = "Skipping queue run -- load average too high";
if (forkflag)
{
pid_t pid;
- extern void intsig();
+ extern SIGFUNC_DECL intsig __P((int));
#ifdef SIGCHLD
- extern void reapchild();
+ extern SIGFUNC_DECL reapchild __P((int));
blocksignal(SIGCHLD);
(void) setsignal(SIGCHLD, reapchild);
(void) setsignal(SIGCHLD, SIG_DFL);
#endif /* SIGCHLD */
(void) setsignal(SIGHUP, intsig);
- Verbose = FALSE;
}
setproctitle("running queue: %s", QueueDir);
e = newenvelope(&QueueEnvelope, CurEnv);
e->e_flags = BlankEnvelope.e_flags;
+ /* make sure we have disconnected from parent */
+ if (forkflag)
+ disconnect(1, e);
+
/*
** Make sure the alias database is open.
*/
{
case 'V': /* queue file version number */
qfver = atoi(&bp[1]);
- if (qfver > QF_VERSION)
- {
- syserr("Version number in qf (%d) greater than max (%d)",
- qfver, QF_VERSION);
- }
- break;
+ if (qfver <= QF_VERSION)
+ break;
+ syserr("Version number in qf (%d) greater than max (%d)",
+ qfver, QF_VERSION);
+ fclose(qfp);
+ loseqfile(e, "unsupported qf file version");
+ return FALSE;
case 'C': /* specify controlling user */
ctladdr = setctluser(&bp[1], qfver);
break;
case 'S': /* sender */
- setsender(newstr(&bp[1]), e, NULL, TRUE);
+ setsender(newstr(&bp[1]), e, NULL, '\0', TRUE);
break;
case 'B': /* body type */
*/
#ifndef lint
-static char sccsid[] = "@(#)readcf.c 8.181 (Berkeley) 12/1/96";
+static char sccsid[] = "@(#)readcf.c 8.184 (Berkeley) 1/14/97";
#endif /* not lint */
# include "sendmail.h"
{ "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 }
};
}
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
+
default:
if (tTd(37, 1))
{
*/
#ifndef lint
-static char sccsid[] = "@(#)savemail.c 8.101 (Berkeley) 11/24/96";
+static char sccsid[] = "@(#)savemail.c 8.103 (Berkeley) 1/18/97";
#endif /* not lint */
# include "sendmail.h"
markstats(ee, NULLADDR);
/* actually deliver the error message */
- sendall(ee, SM_DEFAULT);
+ sendall(ee, SM_DELIVER);
/* restore state */
dropenvelope(ee, TRUE);
** XTEXTOK -- check if a string is legal xtext
**
** Xtext is used in Delivery Status Notifications. The spec was
-** taken from draft-ietf-notary-mime-delivery-04.txt.
+** taken from RFC 1891, ``SMTP Service Extension for Delivery
+** Status Notifications''.
**
** Parameters:
** s -- the string to check.
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)sendmail.8 8.10 (Berkeley) 9/20/96
+.\" @(#)sendmail.8 8.11 (Berkeley) 1/16/97
.\"
-.Dd September 20, 1996
+.Dd January 16, 1997
.Dt SENDMAIL 8
.Os BSD 4
.Sh NAME
.Nm rmail .
.It Fl V Ar envid
Set the original envelope id.
-This is propogated across SMTP to servers that support DSNs
+This is propagated across SMTP to servers that support DSNs
and is returned in DSN-compliant error messages.
.It Fl v
Go into verbose mode.
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)sendmail.h 8.216 (Berkeley) 12/1/96
+ * @(#)sendmail.h 8.219 (Berkeley) 1/14/97
*/
/*
# ifdef _DEFINE
# define EXTERN
# ifndef lint
-static char SmailSccsId[] = "@(#)sendmail.h 8.216 12/1/96";
+static char SmailSccsId[] = "@(#)sendmail.h 8.219 1/14/97";
# endif
# else /* _DEFINE */
# define EXTERN extern
EXTERN char SpaceSub; /* substitution for <lwsp> */
EXTERN int PrivacyFlags; /* privacy flags */
EXTERN char *ConfFile; /* location of configuration file [conf.c] */
-extern char *PidFile; /* location of proc id file [conf.c] */
+EXTERN char *PidFile; /* location of proc id file [conf.c] */
extern ADDRESS NullAddress; /* a null (template) address [main.c] */
EXTERN long WkClassFact; /* multiplier for message class -> priority */
EXTERN long WkRecipFact; /* multiplier for # of recipients -> priority */
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 */
extern void rebuildaliases __P((MAP *, bool));
extern void readaliases __P((MAP *, FILE *, bool, bool));
extern void finis __P(());
-extern void setsender __P((char *, ENVELOPE *, char **, bool));
+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 *));
#ifndef lint
#if SMTP
-static char sccsid[] = "@(#)srvrsmtp.c 8.131 (Berkeley) 12/1/96 (with SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.136 (Berkeley) 1/17/97 (with SMTP)";
#else
-static char sccsid[] = "@(#)srvrsmtp.c 8.131 (Berkeley) 12/1/96 (without SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.136 (Berkeley) 1/17/97 (without SMTP)";
#endif
#endif /* not lint */
static char *skipword();
-#define MAXBADCOMMANDS 25 /* maximum number of bad commands */
+#define MAXBADCOMMANDS 25 /* maximum number of bad commands */
+#define MAXNOOPCOMMANDS 20 /* max "noise" commands before slowdown */
+#define MAXHELOCOMMANDS 3 /* max HELO/EHLO commands before slowdown */
+#define MAXVRFYCOMMANDS 6 /* max VRFY/EXPN commands before slowdown */
+#define MAXETRNCOMMANDS 8 /* max ETRN commands before slowdown */
void
smtp(nullserver, e)
volatile int badcommands = 0; /* count of bad commands */
volatile int nverifies = 0; /* count of VRFY/EXPN commands */
volatile int n_etrn = 0; /* count of ETRN commands */
+ volatile int n_noop = 0; /* count of NOOP/VERB/ONEX etc cmds */
+ volatile int n_helo = 0; /* count of HELO/EHLO commands */
bool ok;
char inp[MAXLINE];
char cmdbuf[MAXLINE];
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))
{
** to everything.
*/
- if (nullserver && c->cmdcode != CMDQUIT)
+ if (nullserver)
{
- message("550 Access denied");
- continue;
+ switch (c->cmdcode)
+ {
+ case CMDQUIT:
+ case CMDHELO:
+ case CMDEHLO:
+ case CMDNOOP:
+ /* process normally */
+ break;
+
+ default:
+ if (++badcommands > MAXBADCOMMANDS)
+ sleep(1);
+ message("550 Access denied");
+ continue;
+ }
}
/* non-null server */
SmtpPhase = "server HELO";
}
+ /* 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;
+ }
+
/* check for valid domain name (re 1123 5.2.5) */
if (*p == '\0' && !AllowBogusHELO)
{
if (!AllowBogusHELO)
message("501 Invalid domain name");
else
+ {
message("250 %s Invalid domain name, accepting anyway",
MyHostName);
+ gothello = TRUE;
+ }
break;
}
}
- /* check for duplicate HELO/EHLO per RFC 1651 4.2 */
- if (gothello)
- {
- message("503 %s Duplicate HELO/EHLO",
- MyHostName);
- break;
- }
-
sendinghost = newstr(p);
gothello = TRUE;
if (c->cmdcode != CMDEHLO)
/* must parse sender first */
delimptr = NULL;
- setsender(p, e, &delimptr, FALSE);
+ setsender(p, e, &delimptr, ' ', FALSE);
if (delimptr != NULL && *delimptr != '\0')
*delimptr++ = '\0';
case CMDVRFY: /* vrfy -- verify address */
case CMDEXPN: /* expn -- expand address */
- if (++nverifies >= MAXBADCOMMANDS)
- {
-#ifdef LOG
- if (nverifies == MAXBADCOMMANDS &&
- LogLevel > 5)
- {
- syslog(LOG_INFO, "%.100s: VRFY attack?",
- CurSmtpClient);
- }
-#endif
- sleep(1);
- }
+ checksmtpattack(&nverifies, MAXVRFYCOMMANDS,
+ c->cmdcode == CMDVRFY ? "VRFY" : "EXPN");
vrfy = c->cmdcode == CMDVRFY;
if (bitset(vrfy ? PRIV_NOVRFY : PRIV_NOEXPN,
PrivacyFlags))
}
/* crude way to avoid denial-of-service attacks */
- if (n_etrn++ >= 3)
- sleep(3);
+ checksmtpattack(&n_etrn, MAXETRNCOMMANDS, "ETRN");
+
id = p;
if (*id == '@')
id++;
break;
case CMDNOOP: /* noop -- do nothing */
+ checksmtpattack(&n_noop, MAXNOOPCOMMANDS, "NOOP");
message("250 OK");
break;
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;
}
}
\f/*
+** CHECKSMTPATTACK -- check for denial-of-service attack by repetition
+**
+** Parameters:
+** pcounter -- pointer to a counter for this command.
+** maxcount -- maximum value for this counter before we
+** slow down.
+** cname -- command name for logging.
+**
+** Returns:
+** none.
+**
+** Side Effects:
+** Slows down if we seem to be under attack.
+*/
+
+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);
+ }
+}
+\f/*
** SKIPWORD -- skip a fixed word.
**
** Parameters:
#ifndef lint
#if USERDB
-static char sccsid [] = "@(#)udb.c 8.46 (Berkeley) 12/1/96 (with USERDB)";
+static char sccsid [] = "@(#)udb.c 8.47 (Berkeley) 12/6/96 (with USERDB)";
#else
-static char sccsid [] = "@(#)udb.c 8.46 (Berkeley) 12/1/96 (without USERDB)";
+static char sccsid [] = "@(#)udb.c 8.47 (Berkeley) 12/6/96 (without USERDB)";
#endif
#endif
userleft--;
}
bcopy(info.data, p, info.size);
- user[info.size] = '\0';
+ p[info.size] = '\0';
userleft -= info.size;
/* get the next record */
#ifndef lint
#if SMTP
-static char sccsid[] = "@(#)usersmtp.c 8.79 (Berkeley) 12/1/96 (with SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.80 (Berkeley) 1/18/97 (with SMTP)";
#else
-static char sccsid[] = "@(#)usersmtp.c 8.79 (Berkeley) 12/1/96 (without SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.80 (Berkeley) 1/18/97 (without SMTP)";
#endif
#endif /* not lint */
smtpquit(m, mci, e);
return EX_TEMPFAIL;
}
+ else if (r == 452 && bitset(MCIF_SIZE, mci->mci_flags) &&
+ e->e_msgsize > 0)
+ {
+ mci_setstat(mci, EX_NOTSTICKY, smtptodsn(r), SmtpReplyBuffer);
+ return EX_TEMPFAIL;
+ }
else if (REPLYTYPE(r) == 4)
{
mci_setstat(mci, EX_TEMPFAIL, smtptodsn(r), SmtpReplyBuffer);
register int r;
register EVENT *ev;
int rstat;
+ int xstat;
time_t timeout;
/*
return EX_TEMPFAIL;
}
mci->mci_state = MCIS_OPEN;
- if (REPLYTYPE(r) == 4)
+ 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)
- rstat = EX_PROTOCOL;
+ rstat = xstat = EX_PROTOCOL;
else if (REPLYTYPE(r) == 2)
- rstat = EX_OK;
+ rstat = xstat = EX_OK;
else if (REPLYTYPE(r) == 5)
- rstat = EX_UNAVAILABLE;
+ rstat = xstat = EX_UNAVAILABLE;
else
rstat = EX_PROTOCOL;
- mci_setstat(mci, rstat, smtptodsn(r), SmtpReplyBuffer);
+ mci_setstat(mci, xstat, smtptodsn(r), SmtpReplyBuffer);
if (e->e_statmsg != NULL)
free(e->e_statmsg);
e->e_statmsg = newstr(&SmtpReplyBuffer[4]);
*/
#ifndef lint
-static char sccsid[] = "@(#)util.c 8.113 (Berkeley) 11/24/96";
+static char sccsid[] = "@(#)util.c 8.115 (Berkeley) 1/5/97";
#endif /* not lint */
# include "sendmail.h"
{
if (bitset(0200, *s))
printf("{%s}", macname(*s++ & 0377));
- else
+ else if (*s != '\0')
printf("%c", *s++);
}
if (mp->metaname != '\0')
return EPERM;
}
- if (uid == 0 && !bitset(SFF_ROOTOK, flags))
+ if (uid == 0 && bitset(SFF_OPENASROOT, flags))
+ ;
+ else if (uid == 0 && !bitset(SFF_ROOTOK, flags))
mode >>= 6;
else if (st->st_uid != uid)
{
*/
#ifndef lint
-static char sccsid[] = "@(#)version.c 8.8.4.4 (Berkeley) 12/2/96";
+static char sccsid[] = "@(#)version.c 8.8.5.3 (Berkeley) 1/21/97";
#endif /* not lint */
-char Version[] = "8.8.4";
+char Version[] = "8.8.5";