This commit was generated by cvs2svn to compensate for changes in r66494,
which included commits to RCS files with non-trunk default branches.
This commit is contained in:
commit
a9ff8c001c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=66495
@ -1,7 +1,6 @@
|
||||
|
||||
|
||||
K N O W N B U G S I N S E N D M A I L
|
||||
(for 8.9.3)
|
||||
|
||||
|
||||
The following are bugs or deficiencies in sendmail that I am aware of
|
||||
@ -13,6 +12,20 @@ distribution).
|
||||
|
||||
This list is not guaranteed to be complete.
|
||||
|
||||
* Delivery to programs that generate too much output may cause problems
|
||||
(8.10, 8.11)
|
||||
|
||||
If e-mail is delivered to a program which generates too much
|
||||
output, then sendmail may issue an error:
|
||||
|
||||
timeout waiting for input from local during Draining Input
|
||||
|
||||
Make sure that the program does not generate output beyond a
|
||||
status message (corresponding to the exit status). This may
|
||||
require a wrapper around the actual program to redirect output
|
||||
to /dev/null.
|
||||
|
||||
Such a problem has been reported for bulk_mailer.
|
||||
|
||||
* Null bytes are not handled properly in headers.
|
||||
|
||||
@ -198,4 +211,4 @@ This list is not guaranteed to be complete.
|
||||
state. This option and it's use is deprecated and will be removed from a
|
||||
future version of sendmail.
|
||||
|
||||
$Revision: 8.43 $, Last updated $Date: 1999/11/17 18:56:09 $
|
||||
$Revision: 8.43.16.1 $, Last updated $Date: 2000/09/28 00:45:37 $
|
||||
|
@ -1,11 +1,119 @@
|
||||
SENDMAIL RELEASE NOTES
|
||||
$Id: RELEASE_NOTES,v 8.561.2.5.2.80 2000/07/19 20:40:57 gshapiro Exp $
|
||||
$Id: RELEASE_NOTES,v 8.561.2.5.2.125 2000/09/27 06:25:28 gshapiro Exp $
|
||||
|
||||
|
||||
This listing shows the version of the sendmail binary, the version
|
||||
of the sendmail configuration files, the date of release, and a
|
||||
summary of the changes in that release.
|
||||
|
||||
8.11.1/8.11.1 2000/09/27
|
||||
Fix SMTP EXPN command output if the address expands to a single
|
||||
name. Fix from John Beck of Sun Microsystems.
|
||||
Don't try STARTTLS in the client if the PRNG has not been properly
|
||||
seeded. This problem only occurs on systems without
|
||||
/dev/urandom. Problem detected by Jan Krueger of
|
||||
digitalanswers communications consulting gmbh and
|
||||
Neil Rickert of Northern Illinois University.
|
||||
Don't use the . and .. directories when expanding QueueDirectory
|
||||
wildcards.
|
||||
Do not try to cache LDAP connections across processes as a parent
|
||||
process may close the connection before the child process
|
||||
has completed. Problem noted by Lai Yiu Fai of the Hong
|
||||
Kong University of Science and Technology and Wolfgang
|
||||
Hottgenroth of UUNET.
|
||||
Use Timeout.fileopen to limit the amount of time spent trying to
|
||||
read the LDAP secret from a file.
|
||||
Prevent SIGTERM from removing a command line submitted item after
|
||||
the user submits the message and before the first delivery
|
||||
attempt completes. Problem noted by Max France of AlphaNet.
|
||||
Fix from Neil Rickert of Northern Illinois University.
|
||||
Deal correctly with MaxMessageSize restriction if message size is
|
||||
greater than 2^31.
|
||||
Turn off queue checkpointing if CheckpointInterval is set to zero.
|
||||
Treat an empty home directory (from getpw*() or $HOME) as
|
||||
non-existent instead of treating it as /. Problem noted by
|
||||
Todd C. Miller of Courtesan Consulting.
|
||||
Don't drop duplicate headers when reading a queued item. Problem
|
||||
noted by Motonori Nakamura of Kyoto University.
|
||||
Avoid bogus error text when logging the savemail panic "cannot
|
||||
save rejected email anywhere". Problem noted by Marc G.
|
||||
Fournier of Acadia University.
|
||||
If an LDAP search fails because the LDAP server went down, close
|
||||
the map so subsequent searches reopen the map. If there are
|
||||
multiple LDAP servers, the down server will be skipped and
|
||||
one of the others may be able to take over.
|
||||
Set the ${load_avg} macro to the current load average, not the
|
||||
previous load average query result.
|
||||
If a non-optional map used in a check_* ruleset can't be opened,
|
||||
return a temporary failure to the remote SMTP client
|
||||
instead of ignoring the map. Problem noted by Allan E
|
||||
Johannesen of Worcester Polytechnic Institute.
|
||||
Avoid a race condition when queuing up split envelopes by saving
|
||||
the split envelopes before the original envelope.
|
||||
Fix a bug in the PH_MAP code which caused mail to bounce instead of
|
||||
defer if the PH server could not be contacted. From Mark
|
||||
Roth of the University of Illinois at Urbana-Champaign.
|
||||
Prevent QueueSortOrder=Filename from interfering with -qR, -qS, and
|
||||
ETRN. Problem noted by Erik R. Leo of SoVerNet.
|
||||
Change error code for unrecognized parameters to the SMTP MAIL and
|
||||
RCPT commands from 501 to 555 per RFC 1869. Problem
|
||||
reported to Postfix by Robert Norris of Monash University.
|
||||
Prevent overwriting the argument of -B on certain OS. Problem
|
||||
noted by Matteo Gelosa of I.NET S.p.A.
|
||||
Use the proper routine for freeing memory with Netscape's LDAP
|
||||
client libraries. Patch from Paul Hilchey of the
|
||||
University of British Columbia.
|
||||
Portability:
|
||||
Move the NETINET6 define to devtools/OS/SunOS.5.{8,9}
|
||||
instead of defining it in conf.h so users can
|
||||
override the setting. Suggested by
|
||||
Henrik Nordstrom of Ericsson.
|
||||
On HP-UX 10.X and 11.X, use /usr/sbin/sendmail instead of
|
||||
/usr/lib/sendmail for rmail and vacation. From
|
||||
Jeff A. Earickson of Colby College.
|
||||
On HP-UX 11.X, use /usr/sbin instead of /usr/libexec (which
|
||||
does not exist). From Jeff A. Earickson of Colby
|
||||
College.
|
||||
Avoid using the UCB subsystem on NCR MP-RAS 3.x. From
|
||||
Tom Moore of NCR.
|
||||
NeXT 3.X and 4.X installs man pages in /usr/man. From
|
||||
Hisanori Gogota of NTT/InterCommunicationCenter.
|
||||
Solaris 8 and later include /var/run. The default PID file
|
||||
location is now /var/run/sendmail.pid. From John
|
||||
Beck of Sun Microsystems.
|
||||
SFIO includes snprintf() for those operating systems
|
||||
which do not. From Todd C. Miller of Courtesan
|
||||
Consulting.
|
||||
CONFIG: Use the result of _CERT_REGEX_SUBJECT_ not {cert_subject}.
|
||||
Problem noted by Kaspar Brand of futureLab AG.
|
||||
CONFIG: Change 553 SMTP reply code to 501 to avoid problems with
|
||||
errors in the MAIL address.
|
||||
CONFIG: Fix FEATURE(nouucp) usage in example .mc files. Problem
|
||||
noted by Ron Jarrell of Virginia Tech.
|
||||
CONFIG: Add support for Solaris 8 (and later) as OSTYPE(solaris8).
|
||||
Contributed by John Beck of Sun Microsystems.
|
||||
CONFIG: Set confFROM_HEADER such that the mail hub can possibly add
|
||||
GECOS information for an address. This more closely
|
||||
matches pre-8.10 nullclient behavior. From Per Hedeland of
|
||||
Ericsson.
|
||||
CONFIG: Fix MODIFY_MAILER_FLAGS(): apply the flag modifications for
|
||||
SMTP to all *smtp* mailers and those for RELAY to the relay
|
||||
mailer as described in cf/README.
|
||||
MAIL.LOCAL: Open the mailbox as the recipient not root so quotas
|
||||
are obeyed. Problem noted by Damian Kuczynski of NIK.
|
||||
MAKEMAP: Do not change a map's owner to the TrustedUser if using
|
||||
makemap to 'unmake' the map.
|
||||
RMAIL: Avoid overflowing the list of recipients being passed to
|
||||
sendmail.
|
||||
RMAIL: Invoke sendmail with '-G' to indicate this is a gateway
|
||||
submission. Problem noted by Kari Hurtta of the Finnish
|
||||
Meteorological Institute.
|
||||
VACATION: Read the complete message to avoid "broken pipe" signals.
|
||||
VACATION: Do not cut off vacation.msg files which have a single
|
||||
dot as the only character on the line.
|
||||
New Files:
|
||||
cf/ostype/solaris8.m4
|
||||
|
||||
8.11.0/8.11.0 2000/07/19
|
||||
SECURITY: If sendmail is installed as a non-root set-user-ID binary
|
||||
(not the normal case), some operating systems will still
|
||||
@ -144,7 +252,7 @@ summary of the changes in that release.
|
||||
fails and the socket needs to be reopened. Patch
|
||||
from Tom Moore of NCR.
|
||||
NetBSD uses a .0 extension of formatted man pages. From
|
||||
Andrew Brown of Graffiti World Wide, Inc.
|
||||
Andrew Brown of Crossbar Security.
|
||||
Return to using the IPv6 AI_DEFAULT flag instead of AI_V4MAPPED
|
||||
for calls to getipnodebyname(). The Linux
|
||||
implementation is broken so AI_ADDRCONFIG is stripped
|
||||
|
@ -6,7 +6,7 @@ requires a post-V7 version of m4; if you are running the 4.2bsd, SysV.2, or
|
||||
7th Edition version. SunOS's /usr/5bin/m4 or BSD-Net/2's m4 both work.
|
||||
GNU m4 version 1.1 or later also works. Unfortunately, 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://ftp.gnu.org/pub/gnu/m4-1.4.tar.gz (check for the
|
||||
available from ftp://ftp.gnu.org/pub/gnu/m4/m4-1.4.tar.gz (check for the
|
||||
latset version). EXCEPTIONS: DEC's m4 on Digital UNIX 4.x is broken (3.x
|
||||
is fine). Use GNU m4 on this platform.
|
||||
|
||||
@ -309,13 +309,13 @@ SMTP_MAILER_MAX [undefined] The maximum size of messages that will
|
||||
SMTP_MAILER_MAXMSGS [undefined] If defined, the maximum number of
|
||||
messages to deliver in a single connection for the
|
||||
smtp, smtp8, esmtp, or dsmtp mailers.
|
||||
SMTP_MAILER_ARGS [IPC $h] The arguments passed to the smtp mailer.
|
||||
SMTP_MAILER_ARGS [TCP $h] The arguments passed to the smtp mailer.
|
||||
About the only reason you would want to change this
|
||||
would be to change the default port.
|
||||
ESMTP_MAILER_ARGS [IPC $h] The arguments passed to the esmtp mailer.
|
||||
SMTP8_MAILER_ARGS [IPC $h] The arguments passed to the smtp8 mailer.
|
||||
DSMTP_MAILER_ARGS [IPC $h] The arguments passed to the dsmtp mailer.
|
||||
RELAY_MAILER_ARGS [IPC $h] The arguments passed to the relay mailer.
|
||||
ESMTP_MAILER_ARGS [TCP $h] The arguments passed to the esmtp mailer.
|
||||
SMTP8_MAILER_ARGS [TCP $h] The arguments passed to the smtp8 mailer.
|
||||
DSMTP_MAILER_ARGS [TCP $h] The arguments passed to the dsmtp mailer.
|
||||
RELAY_MAILER_ARGS [TCP $h] The arguments passed to the relay mailer.
|
||||
RELAY_MAILER_MAXMSGS [undefined] If defined, the maximum number of
|
||||
messages to deliver in a single connection for the
|
||||
relay mailer.
|
||||
@ -488,7 +488,7 @@ smtp The Simple Mail Transport Protocol mailer. This does
|
||||
demand delivery, and "relay" for transmission to the
|
||||
RELAY_HOST, LUSER_RELAY, or MAIL_HUB.
|
||||
|
||||
uucp The Unix-to-Unix Copy Program mailer. Actually, this
|
||||
uucp The UNIX-to-UNIX Copy Program mailer. Actually, this
|
||||
defines two mailers, "uucp-old" (a.k.a. "uucp") and
|
||||
"uucp-new" (a.k.a. "suucp"). The latter is for when you
|
||||
know that the UUCP mailer at the other end can handle
|
||||
@ -1227,7 +1227,7 @@ Examples:
|
||||
On host grasp.insa-lyon.fr (UUCP host name "grasp"), the following
|
||||
summarizes the sender rewriting for various mailers.
|
||||
|
||||
Mailer sender rewriting in the envelope
|
||||
Mailer sender rewriting in the envelope
|
||||
------ ------ -------------------------
|
||||
uucp-{old,new} wolf grasp!wolf
|
||||
uucp-dom wolf wolf@grasp.insa-lyon.fr
|
||||
@ -1712,9 +1712,10 @@ The value part of the map can contain:
|
||||
is used for recipients, it affects only
|
||||
the designated recipients, not the whole
|
||||
message.
|
||||
### any text where ### is an RFC 821 compliant error code
|
||||
and "any text" is a message to return for
|
||||
the command.
|
||||
### any text where ### is an RFC 821 compliant error code and
|
||||
"any text" is a message to return for the command.
|
||||
The string should be quoted to avoid surprises,
|
||||
e.g., sendmail may remove spaces otherwise.
|
||||
ERROR:### any text
|
||||
as above, but useful to mark error messages as such.
|
||||
ERROR:D.S.N:### any text
|
||||
@ -1723,7 +1724,7 @@ The value part of the map can contain:
|
||||
|
||||
For example:
|
||||
|
||||
cyberspammer.com 550 We don't accept mail from spammers
|
||||
cyberspammer.com ERROR:"550 We don't accept mail from spammers"
|
||||
okay.cyberspammer.com OK
|
||||
sendmail.org RELAY
|
||||
128.32 RELAY
|
||||
@ -1761,7 +1762,7 @@ hosts listed in class {R} to be fully qualified host names.
|
||||
You can also use the access database to block sender addresses based on
|
||||
the username portion of the address. For example:
|
||||
|
||||
FREE.STEALTH.MAILER@ 550 Spam not accepted
|
||||
FREE.STEALTH.MAILER@ ERROR:550 Spam not accepted
|
||||
|
||||
Note that you must include the @ after the username to signify that
|
||||
this database entry is for checking only the username portion of the
|
||||
@ -1774,9 +1775,9 @@ If you use:
|
||||
then you can add entries to the map for local users, hosts in your
|
||||
domains, or addresses in your domain which should not receive mail:
|
||||
|
||||
badlocaluser@ 550 Mailbox disabled for this username
|
||||
host.mydomain.com 550 That host does not accept mail
|
||||
user@otherhost.mydomain.com 550 Mailbox disabled for this recipient
|
||||
badlocaluser@ ERROR:550 Mailbox disabled for this username
|
||||
host.mydomain.com ERROR:550 That host does not accept mail
|
||||
user@otherhost.mydomain.com ERROR:550 Mailbox disabled for this recipient
|
||||
|
||||
This would prevent a recipient of badlocaluser@mydomain.com, any
|
||||
user at host.mydomain.com, and the single address
|
||||
@ -1979,9 +1980,9 @@ probably not be used in production.
|
||||
# Otherwise, reject the mail
|
||||
R$* $#error $: 553 Header Error
|
||||
|
||||
+--------------------------------+
|
||||
| STARTTLS |
|
||||
+--------------------------------+
|
||||
+----------+
|
||||
| STARTTLS |
|
||||
+----------+
|
||||
|
||||
In this text, cert will be used as an abreviation for X.509 certificate,
|
||||
DN is the distinguished name of a cert, and CA is a certification authority.
|
||||
@ -2099,9 +2100,9 @@ extra line:
|
||||
|
||||
(using ${tls_version} with cipher ${cipher} (${cipher_bits} bits) verified ${verify})
|
||||
|
||||
+--------------------------------+
|
||||
| SMTP AUTHENTICATION |
|
||||
+--------------------------------+
|
||||
+---------------------+
|
||||
| SMTP AUTHENTICATION |
|
||||
+---------------------+
|
||||
|
||||
The macros ${auth_authen}, ${auth_author}, and ${auth_type} can be
|
||||
used in anti-relay rulesets to allow relaying for those users that
|
||||
@ -2300,13 +2301,15 @@ database version of the mailertable is built using:
|
||||
|
||||
The semantics are simple. Any LHS entry that does not begin with
|
||||
a dot matches the full host name indicated. LHS entries beginning
|
||||
with a dot match anything ending with that domain name -- that is,
|
||||
they can be thought of as having a leading "*" wildcard. Matching
|
||||
is done in order of most-to-least qualified -- for example, even
|
||||
though ".my.domain" is listed first in the above example, an entry
|
||||
of "uuhost1.my.domain" will match the second entry since it is
|
||||
more explicit. Note: e-mail to "user@my.domain" does not match
|
||||
any entry in the above table. You need to have something like:
|
||||
with a dot match anything ending with that domain name (including
|
||||
the leading dot) -- that is, they can be thought of as having a
|
||||
leading ".+" regular expression pattern for a non-empty sequence of
|
||||
characters. Matching is done in order of most-to-least qualified
|
||||
-- for example, even though ".my.domain" is listed first in the
|
||||
above example, an entry of "uuhost1.my.domain" will match the second
|
||||
entry since it is more explicit. Note: e-mail to "user@my.domain"
|
||||
does not match any entry in the above table. You need to have
|
||||
something like:
|
||||
|
||||
my.domain esmtp:host.my.domain
|
||||
|
||||
@ -2356,7 +2359,7 @@ To build the internal form of the user database, use:
|
||||
|
||||
As a general rule, it is an extremely bad idea to using full names
|
||||
as e-mail addresses, since they are not in any sense unique. For
|
||||
example, the Unix software-development community has at least two
|
||||
example, the UNIX software-development community has at least two
|
||||
well-known Peter Deutsches, and at one time Bell Labs had two
|
||||
Stephen R. Bournes with offices along the same hallway. Which one
|
||||
will be forced to suffer the indignity of being Stephen_R_Bourne_2?
|
||||
@ -3016,10 +3019,11 @@ confCLIENT_KEY ClientKeyFile [undefined] File containing the
|
||||
confDH_PARAMETERS DHParameters [undefined] File containing the
|
||||
DH parameters.
|
||||
confRAND_FILE RandFile [undefined] File containing random
|
||||
data or the name of the Unix socket
|
||||
if EGD is used. STARTTLS requires
|
||||
this option if the compile flag
|
||||
HASURANDOM is not set (see
|
||||
data (use prefix file:) or the
|
||||
name of the UNIX socket if EGD is
|
||||
used (use prefix egd:). STARTTLS
|
||||
requires this option if the compile
|
||||
flag HASURANDOM is not set (see
|
||||
sendmail/README).
|
||||
|
||||
See also the description of OSTYPE for some parameters that can be
|
||||
@ -3097,7 +3101,7 @@ domain Definitions describing a particular domain, referenced
|
||||
site dependent; for example, "CS.Berkeley.EDU.m4"
|
||||
describes hosts in the CS.Berkeley.EDU subdomain.
|
||||
|
||||
mailer Descriptions of mailers. These are referenced using
|
||||
mailer Descriptions of mailers. These are referenced using
|
||||
the MAILER macro in the .mc file.
|
||||
|
||||
sh Shell files used when building the .cf file from the
|
||||
@ -3231,4 +3235,4 @@ M4 DIVERSIONS
|
||||
8 DNS based blacklists
|
||||
9 special local rulesets (1 and 2)
|
||||
|
||||
$Revision: 8.383.2.1.2.15 $, Last updated $Date: 2000/07/19 22:27:29 $
|
||||
$Revision: 8.383.2.1.2.24 $, Last updated $Date: 2000/09/24 02:05:54 $
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# Makefile for configuration files.
|
||||
#
|
||||
# $Id: Makefile,v 8.40 2000/02/01 22:07:15 gshapiro Exp $
|
||||
# $Id: Makefile,v 8.40.8.3 2000/08/08 22:23:30 gshapiro Exp $
|
||||
#
|
||||
|
||||
#
|
||||
@ -150,6 +150,7 @@ M4FILES=\
|
||||
${CFDIR}/ostype/solaris2.m4 \
|
||||
${CFDIR}/ostype/solaris2.ml.m4 \
|
||||
${CFDIR}/ostype/solaris2.pre5.m4 \
|
||||
${CFDIR}/ostype/solaris8.m4 \
|
||||
${CFDIR}/ostype/sunos3.5.m4 \
|
||||
${CFDIR}/ostype/sunos4.1.m4 \
|
||||
${CFDIR}/ostype/svr4.m4 \
|
||||
|
@ -1,6 +1,6 @@
|
||||
divert(-1)
|
||||
#
|
||||
# Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
|
||||
# Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 1983 Eric P. Allman. All rights reserved.
|
||||
# Copyright (c) 1988, 1993
|
||||
@ -26,8 +26,8 @@ divert(-1)
|
||||
#
|
||||
|
||||
divert(0)dnl
|
||||
VERSIONID(`$Id: tcpproto.mc,v 8.13 1999/02/07 07:26:05 gshapiro Exp $')
|
||||
OSTYPE(unknown)
|
||||
FEATURE(nouucp)
|
||||
MAILER(local)
|
||||
MAILER(smtp)
|
||||
VERSIONID(`$Id: tcpproto.mc,v 8.13.22.1 2000/08/03 15:25:20 ca Exp $')
|
||||
OSTYPE(`unknown')
|
||||
FEATURE(`nouucp', `reject')
|
||||
MAILER(`local')
|
||||
MAILER(`smtp')
|
||||
|
@ -1,6 +1,6 @@
|
||||
divert(-1)
|
||||
#
|
||||
# Copyright (c) 1999, 2000 Sendmail, Inc. and its suppliers.
|
||||
# Copyright (c) 1999-2000 Sendmail, Inc. and its suppliers.
|
||||
# All rights reserved.
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
@ -10,7 +10,7 @@ divert(-1)
|
||||
#
|
||||
|
||||
divert(0)
|
||||
VERSIONID(`$Id: no_default_msa.m4,v 8.1 2000/02/01 15:56:30 ca Exp $')
|
||||
VERSIONID(`$Id: no_default_msa.m4,v 8.1.10.1 2000/09/17 17:04:22 gshapiro Exp $')
|
||||
divert(-1)
|
||||
|
||||
define(`_NO_MSA_', `1')
|
||||
|
@ -1,6 +1,6 @@
|
||||
divert(-1)
|
||||
#
|
||||
# Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
|
||||
# Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 1983 Eric P. Allman. All rights reserved.
|
||||
# Copyright (c) 1988, 1993
|
||||
@ -22,13 +22,14 @@ ifelse(defn(`_ARG_'), `', `errprint(`Feature "nullclient" requires argument')',
|
||||
#
|
||||
|
||||
divert(0)
|
||||
VERSIONID(`$Id: nullclient.m4,v 8.21.16.1 2000/05/26 18:08:41 gshapiro Exp $')
|
||||
VERSIONID(`$Id: nullclient.m4,v 8.21.16.3 2000/09/17 17:04:22 gshapiro Exp $')
|
||||
divert(-1)
|
||||
|
||||
undefine(`ALIAS_FILE')
|
||||
define(`MAIL_HUB', _NULL_CLIENT_)
|
||||
define(`SMART_HOST', _NULL_CLIENT_)
|
||||
define(`confFORWARD_PATH', `')
|
||||
ifdef(`confFROM_HEADER',, `define(`confFROM_HEADER', `<$g>')')
|
||||
define(`_DEF_LOCAL_MAILER_FLAGS', `lsDFM5q')
|
||||
MASQUERADE_AS(_NULL_CLIENT_)
|
||||
FEATURE(`allmasquerade')
|
||||
|
@ -13,7 +13,7 @@ divert(-1)
|
||||
#
|
||||
divert(0)
|
||||
|
||||
VERSIONID(`$Id: proto.m4,v 8.446.2.5.2.12 2000/07/19 21:41:19 gshapiro Exp $')
|
||||
VERSIONID(`$Id: proto.m4,v 8.446.2.5.2.29 2000/09/15 04:45:14 gshapiro Exp $')
|
||||
|
||||
MAILER(local)dnl
|
||||
|
||||
@ -160,8 +160,11 @@ ifdef(`_ACCEPT_UNRESOLVABLE_DOMAINS_',`dnl',`dnl
|
||||
# Resolve map (to check if a host exists in check_mail)
|
||||
Kresolve host -a<OK> -T<TEMP>')
|
||||
|
||||
ifdef(`_FFR_5_', `# macro storage map
|
||||
Kmacro macro')
|
||||
|
||||
ifdef(`confCR_FILE', `dnl
|
||||
# Hosts that will permit relaying ($=R)
|
||||
# Hosts for which relaying is permitted ($=R)
|
||||
FR`'confCR_FILE',
|
||||
`dnl')
|
||||
|
||||
@ -314,7 +317,9 @@ ifelse(defn(`confDAEMON_OPTIONS'), `', `dnl',
|
||||
`errprint(WARNING: `confDAEMON_OPTIONS' is no longer valid. See cf/README for more information.
|
||||
)'dnl
|
||||
`DAEMON_OPTIONS(`confDAEMON_OPTIONS')')
|
||||
ifelse(defn(`_DPO_'), `', `O DaemonPortOptions=Name=MTA', `_DPO_')
|
||||
ifelse(defn(`_DPO_'), `',
|
||||
`ifdef(`_NETINET6_', `O DaemonPortOptions=Name=MTA-IPv4, Family=inet
|
||||
O DaemonPortOptions=Name=MTA-IPv6, Family=inet6',`O DaemonPortOptions=Name=MTA')', `_DPO_')
|
||||
ifdef(`_NO_MSA_', `dnl', `O DaemonPortOptions=Port=587, Name=MSA, M=E')
|
||||
|
||||
# SMTP client options
|
||||
@ -857,26 +862,26 @@ R$* $: $>Parse1 $1 final parsing
|
||||
|
||||
SParse0
|
||||
R<@> $@ <@> special case error msgs
|
||||
R$* : $* ; <@> $#error $@ 5.1.3 $: "553 List:; syntax illegal for recipient addresses"
|
||||
R$* : $* ; <@> $#error $@ 5.1.3 $: "501 List:; syntax illegal for recipient addresses"
|
||||
R@ <@ $* > < @ $1 > catch "@@host" bogosity
|
||||
R<@ $+> $#error $@ 5.1.3 $: "553 User address required"
|
||||
R<@ $+> $#error $@ 5.1.3 $: "501 User address required"
|
||||
R$* $: <> $1
|
||||
R<> $* < @ [ $+ ] > $* $1 < @ [ $2 ] > $3
|
||||
R<> $* <$* : $* > $* $#error $@ 5.1.3 $: "553 Colon illegal in host name part"
|
||||
R<> $* <$* : $* > $* $#error $@ 5.1.3 $: "501 Colon illegal in host name part"
|
||||
R<> $* $1
|
||||
R$* < @ . $* > $* $#error $@ 5.1.2 $: "553 Invalid host name"
|
||||
R$* < @ $* .. $* > $* $#error $@ 5.1.2 $: "553 Invalid host name"
|
||||
R$* < @ . $* > $* $#error $@ 5.1.2 $: "501 Invalid host name"
|
||||
R$* < @ $* .. $* > $* $#error $@ 5.1.2 $: "501 Invalid host name"
|
||||
dnl comma only allowed before @; this check is not complete
|
||||
R$* , $~O $* $#error $@ 5.1.2 $: "553 Invalid route address"
|
||||
R$* , $~O $* $#error $@ 5.1.2 $: "501 Invalid route address"
|
||||
|
||||
# now delete the local info -- note $=O to find characters that cause forwarding
|
||||
R$* < @ > $* $@ $>Parse0 $>canonify $1 user@ => user
|
||||
R< @ $=w . > : $* $@ $>Parse0 $>canonify $2 @here:... -> ...
|
||||
R$- < @ $=w . > $: $(dequote $1 $) < @ $2 . > dequote "foo"@here
|
||||
R< @ $+ > $#error $@ 5.1.3 $: "553 User address required"
|
||||
R< @ $+ > $#error $@ 5.1.3 $: "501 User address required"
|
||||
R$* $=O $* < @ $=w . > $@ $>Parse0 $>canonify $1 $2 $3 ...@here -> ...
|
||||
R$- $: $(dequote $1 $) < @ *LOCAL* > dequote "foo"
|
||||
R< @ *LOCAL* > $#error $@ 5.1.3 $: "553 User address required"
|
||||
R< @ *LOCAL* > $#error $@ 5.1.3 $: "501 User address required"
|
||||
R$* $=O $* < @ *LOCAL* >
|
||||
$@ $>Parse0 $>canonify $1 $2 $3 ...@*LOCAL* -> ...
|
||||
R$* < @ *LOCAL* > $: $1
|
||||
@ -891,7 +896,6 @@ ifdef(`_LDAP_ROUTING_', `dnl
|
||||
R$+ < @ $={LDAPRoute} . > $: $>LDAPExpand <$1 < @ $2 . >> <$1 @ $2>',
|
||||
`dnl')
|
||||
|
||||
|
||||
ifdef(`_MAILER_smtp_',
|
||||
`# handle numeric address spec
|
||||
dnl there is no check whether this is really an IP number
|
||||
@ -932,6 +936,8 @@ R< $+ > $+ < @ $+ > $: $>Recurse $1',
|
||||
# short circuit local delivery so forwarded email works
|
||||
ifdef(`_MAILER_usenet_', `dnl
|
||||
R$+ . USENET < @ $=w . > $#usenet $@ usenet $: $1 handle usenet specially', `dnl')
|
||||
|
||||
|
||||
ifdef(`_STICKY_LOCAL_DOMAIN_',
|
||||
`R$+ < @ $=w . > $: < $H > $1 < @ $2 . > first try hub
|
||||
R< $+ > $+ < $+ > $>MailerToTriple < $1 > $2 < $3 > yep ....
|
||||
@ -1002,7 +1008,7 @@ R$* < @ $* > $* $: $>MailerToTriple < $S > $1 < @ $2 > $3 glue on smarthost nam
|
||||
# deal with other remote names
|
||||
ifdef(`_MAILER_smtp_',
|
||||
`R$* < @$* > $* $#_SMTP_ $@ $2 $: $1 < @ $2 > $3 user@host.domain',
|
||||
`R$* < @$* > $* $#error $@ 5.1.2 $: "553 Unrecognized host name " $2')
|
||||
`R$* < @$* > $* $#error $@ 5.1.2 $: "501 Unrecognized host name " $2')
|
||||
|
||||
# handle locally delivered names
|
||||
R$=L $#_LOCAL_ $: @ $1 special local names
|
||||
@ -1018,31 +1024,44 @@ R$+ $: $1 $| $>"Local_localaddr" $1
|
||||
R$+ $| $#$* $#$2
|
||||
R$+ $| $* $: $1
|
||||
|
||||
# deal with plussed users so aliases work nicely
|
||||
R$+ + * $#_LOCAL_ $@ $&h $: $1
|
||||
R$+ + $* $#_LOCAL_ $@ + $2 $: $1 + *
|
||||
ifdef(`_FFR_5_', `
|
||||
# Preserve host in a macro
|
||||
R$+ $: $(macro {LocalAddrHost} $) $1
|
||||
R$+ @ $+ $: $(macro {LocalAddrHost} $@ @ $2 $) $1')
|
||||
|
||||
ifdef(`_PRESERVE_LOCAL_PLUS_DETAIL_', `', `
|
||||
# deal with plussed users so aliases work nicely
|
||||
R$+ + * $#_LOCAL_ $@ $&h $: $1`'ifdef(`_FFR_5_', ` $&{LocalAddrHost}')
|
||||
R$+ + $* $#_LOCAL_ $@ + $2 $: $1 + *`'ifdef(`_FFR_5_', ` $&{LocalAddrHost}')
|
||||
')
|
||||
# prepend an empty "forward host" on the front
|
||||
R$+ $: <> $1
|
||||
|
||||
ifdef(`LUSER_RELAY', `dnl
|
||||
# send unrecognized local users to a relay host
|
||||
ifdef(`_PRESERVE_LOCAL_PLUS_DETAIL_', `
|
||||
R< > $+ + $* $: < ? $L > <+ $2> $(user $1 $) look up user+
|
||||
R< > $+ $: < ? $L > < > $(user $1 $) look up user
|
||||
R< ? $* > < $* > $+ <> $: < > $3 $2 found; strip $L
|
||||
R< ? $* > < $* > $+ $: < $1 > $3 $2 not found', `
|
||||
R< > $+ $: < $L > $(user $1 $) look up user
|
||||
R< $* > $+ <> $: < > $2 found; strip $L',
|
||||
R< $* > $+ <> $: < > $2 found; strip $L')',
|
||||
`dnl')
|
||||
|
||||
# see if we have a relay or a hub
|
||||
R< > $+ $: < $H > $1 try hub
|
||||
R< > $+ $: < $R > $1 try relay
|
||||
ifdef(`_PRESERVE_LOCAL_PLUS_DETAIL_', `
|
||||
R< > $+ $@ $1', `
|
||||
R< > $+ $: < > < $1 <> $&h > nope, restore +detail
|
||||
R< > < $+ <> + $* > $: < > < $1 + $2 > check whether +detail
|
||||
R< > < $+ <> $* > $: < > < $1 > else discard
|
||||
R< > < $+ + $* > $* < > < $1 > + $2 $3 find the user part
|
||||
R< > < $+ > + $* $#_LOCAL_ $@ $2 $: @ $1 strip the extra +
|
||||
R< > < $+ > + $* $#_LOCAL_ $@ $2 $: @ $1`'ifdef(`_FFR_5_', ` $&{LocalAddrHost}') strip the extra +
|
||||
R< > < $+ > $@ $1 no +detail
|
||||
R$+ $: $1 <> $&h add +detail back in
|
||||
R$+ <> + $* $: $1 + $2 check whether +detail
|
||||
R$+ <> $* $: $1 else discard
|
||||
R$+ <> $* $: $1 else discard')
|
||||
R< local : $* > $* $: $>MailerToTriple < local : $1 > $2 no host extension
|
||||
R< error : $* > $* $: $>MailerToTriple < error : $1 > $2 no host extension
|
||||
R< $- : $+ > $+ $: $>MailerToTriple < $1 : $2 > $3 < @ $2 >
|
||||
@ -1401,17 +1420,22 @@ R< d > $* $@ deferred
|
||||
R< $* > $* $: $2
|
||||
|
||||
ifdef(`_ACCESS_TABLE_', `dnl
|
||||
dnl workspace: {client_name} $| {client_addr}
|
||||
R$+ $| $+ $: $>LookUpDomain < $1 > <?> < $2 > <+Connect>
|
||||
dnl workspace: <result-of-lookup> <{client_addr}>
|
||||
R<?> <$+> $: $>LookUpAddress < $1 > <?> < $1 > <+Connect> no: another lookup
|
||||
dnl workspace: <result-of-lookup> <{client_addr}>
|
||||
R<?> < $+ > $: $1 found nothing
|
||||
R<$={Accept}> < $* > $@ $1
|
||||
dnl workspace: <result-of-lookup> <{client_addr}>
|
||||
dnl or {client_addr}
|
||||
R<$={Accept}> < $* > $@ $1 return value of lookup
|
||||
R<REJECT> $* $#error ifdef(`confREJECT_MSG', `$: "confREJECT_MSG"', `$@ 5.7.1 $: "550 Access denied"')
|
||||
R<DISCARD> $* $#discard $: discard
|
||||
dnl error tag
|
||||
R<ERROR:$-.$-.$-:$+> $* $#error $@ $1.$2.$3 $: $4
|
||||
R<ERROR:$+> $* $#error $: $1
|
||||
R<ERROR:$-.$-.$-:$+> <$*> $#error $@ $1.$2.$3 $: $4
|
||||
R<ERROR:$+> <$*> $#error $: $1
|
||||
dnl generic error from access map
|
||||
R<$+> $* $#error $: $1', `dnl')
|
||||
R<$+> <$*> $#error $: $1', `dnl')
|
||||
|
||||
ifdef(`_RBL_',`dnl
|
||||
# DNS based IP address spam list
|
||||
@ -1491,7 +1515,7 @@ dnl workspace: < ? $&{client_name} > <user@localhost|host>
|
||||
dnl or: <address>
|
||||
dnl or: <?> <address> (thanks to u in ${daemon_flags})
|
||||
R<? $=w> $* $: $2 local client: ok
|
||||
R<? $+> <$+> $#error $@ 5.5.4 $: "553 Real domain name required"
|
||||
R<? $+> <$+> $#error $@ 5.5.4 $: "501 Real domain name required for sender address"
|
||||
dnl remove <?> (happens only if ${client_name} == "" or u in ${daemon_flags})
|
||||
R<?> $* $: $1')
|
||||
dnl workspace: address (or <address>)
|
||||
@ -1541,7 +1565,7 @@ dnl remove daemon_flags
|
||||
R$* $| $* $: $2
|
||||
R<?> $* $: < ? $&{client_name} > $1
|
||||
R<?> $* $@ <OK> ...local unqualed ok
|
||||
R<? $+> $* $#error $@ 5.5.4 $: "553 Domain name required"
|
||||
R<? $+> $* $#error $@ 5.5.4 $: "501 Domain name required for sender address " $&f
|
||||
...remote is not')
|
||||
# check results
|
||||
R<?> $* $: @ $1 mark address: nothing known about it
|
||||
@ -2046,7 +2070,7 @@ R$* $| RELAY $# RELAYCERTISSUER
|
||||
ifdef(`_CERT_REGEX_SUBJECT_', `dnl
|
||||
R$* $| SUBJECT $: $1 $| <@> $(CERTSubject $&{cert_subject} $)',
|
||||
`R$* $| SUBJECT $: $1 $| <@> $&{cert_subject}')
|
||||
R$* $| <@> $+ $: $1 $| <@> $(access CERTSUBJECT:$&{cert_subject} $)
|
||||
R$* $| <@> $+ $: $1 $| <@> $(access CERTSUBJECT:$2 $)
|
||||
R$* $| <@> RELAY $# RELAYCERTSUBJECT
|
||||
R$* $| $* $: $1', `dnl')
|
||||
|
||||
@ -2070,3 +2094,4 @@ _MAIL_FILTERS_')
|
||||
######################################################################
|
||||
######################################################################
|
||||
undivert(7)dnl MAILER_DEFINITIONS
|
||||
|
||||
|
@ -11,8 +11,8 @@ divert(-1)
|
||||
# the sendmail distribution.
|
||||
#
|
||||
#
|
||||
VERSIONID(`$Id: version.m4,v 8.39.4.10 2000/07/19 20:40:59 gshapiro Exp $')
|
||||
VERSIONID(`$Id: version.m4,v 8.39.4.14 2000/09/19 07:28:06 gshapiro Exp $')
|
||||
#
|
||||
divert(0)
|
||||
# Configuration version number
|
||||
DZ8.11.0`'ifdef(`confCF_VERSION', `/confCF_VERSION')
|
||||
DZ8.11.1`'ifdef(`confCF_VERSION', `/confCF_VERSION')
|
||||
|
@ -1,6 +1,6 @@
|
||||
PUSHDIVERT(-1)
|
||||
#
|
||||
# Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
|
||||
# Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 1983 Eric P. Allman. All rights reserved.
|
||||
# Copyright (c) 1988, 1993
|
||||
@ -27,7 +27,7 @@ POPDIVERT
|
||||
### Local and Program Mailer specification ###
|
||||
##################################################
|
||||
|
||||
VERSIONID(`$Id: local.m4,v 8.50.16.1 2000/06/12 18:25:40 gshapiro Exp $')
|
||||
VERSIONID(`$Id: local.m4,v 8.50.16.2 2000/09/17 17:04:22 gshapiro Exp $')
|
||||
|
||||
#
|
||||
# Envelope sender rewriting
|
||||
|
@ -24,7 +24,7 @@ POPDIVERT
|
||||
### SMTP Mailer specification ###
|
||||
#####################################
|
||||
|
||||
VERSIONID(`$Id: smtp.m4,v 8.56.2.1.2.2 2000/07/18 15:31:24 gshapiro Exp $')
|
||||
VERSIONID(`$Id: smtp.m4,v 8.56.2.1.2.3 2000/09/25 13:53:27 ca Exp $')
|
||||
|
||||
#
|
||||
# common sender and masquerading recipient rewriting
|
||||
@ -103,15 +103,15 @@ R$+ $: $>MasqHdr $1
|
||||
Msmtp, P=[IPC], F=_MODMF_(CONCAT(_DEF_SMTP_MAILER_FLAGS, SMTP_MAILER_FLAGS), `SMTP'), S=EnvFromSMTP/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `EnvToSMTP/HdrFromSMTP', `EnvToSMTP'), E=\r\n, L=990,
|
||||
_OPTINS(`SMTP_MAILER_MAX', `M=', `, ')_OPTINS(`SMTP_MAILER_MAXMSGS', `m=', `, ')_OPTINS(`SMTP_MAILER_MAXRCPTS', `r=', `, ')_OPTINS(`SMTP_MAILER_CHARSET', `C=', `, ')T=DNS/RFC822/SMTP,
|
||||
A=SMTP_MAILER_ARGS
|
||||
Mesmtp, P=[IPC], F=CONCAT(_DEF_SMTP_MAILER_FLAGS, `a', SMTP_MAILER_FLAGS), S=EnvFromSMTP/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `EnvToSMTP/HdrFromSMTP', `EnvToSMTP'), E=\r\n, L=990,
|
||||
Mesmtp, P=[IPC], F=_MODMF_(CONCAT(_DEF_SMTP_MAILER_FLAGS, `a', SMTP_MAILER_FLAGS), `SMTP'), S=EnvFromSMTP/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `EnvToSMTP/HdrFromSMTP', `EnvToSMTP'), E=\r\n, L=990,
|
||||
_OPTINS(`SMTP_MAILER_MAX', `M=', `, ')_OPTINS(`SMTP_MAILER_MAXMSGS', `m=', `, ')_OPTINS(`SMTP_MAILER_MAXRCPTS', `r=', `, ')_OPTINS(`SMTP_MAILER_CHARSET', `C=', `, ')T=DNS/RFC822/SMTP,
|
||||
A=ESMTP_MAILER_ARGS
|
||||
Msmtp8, P=[IPC], F=CONCAT(_DEF_SMTP_MAILER_FLAGS, `8', SMTP_MAILER_FLAGS), S=EnvFromSMTP/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `EnvToSMTP/HdrFromSMTP', `EnvToSMTP'), E=\r\n, L=990,
|
||||
Msmtp8, P=[IPC], F=_MODMF_(CONCAT(_DEF_SMTP_MAILER_FLAGS, `8', SMTP_MAILER_FLAGS), `SMTP'), S=EnvFromSMTP/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `EnvToSMTP/HdrFromSMTP', `EnvToSMTP'), E=\r\n, L=990,
|
||||
_OPTINS(`SMTP_MAILER_MAX', `M=', `, ')_OPTINS(`SMTP_MAILER_MAXMSGS', `m=', `, ')_OPTINS(`SMTP_MAILER_MAXRCPTS', `r=', `, ')_OPTINS(`SMTP_MAILER_CHARSET', `C=', `, ')T=DNS/RFC822/SMTP,
|
||||
A=SMTP8_MAILER_ARGS
|
||||
Mdsmtp, P=[IPC], F=CONCAT(_DEF_SMTP_MAILER_FLAGS, `a%', SMTP_MAILER_FLAGS), S=EnvFromSMTP/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `EnvToSMTP/HdrFromSMTP', `EnvToSMTP'), E=\r\n, L=990,
|
||||
Mdsmtp, P=[IPC], F=_MODMF_(CONCAT(_DEF_SMTP_MAILER_FLAGS, `a%', SMTP_MAILER_FLAGS), `SMTP'), S=EnvFromSMTP/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `EnvToSMTP/HdrFromSMTP', `EnvToSMTP'), E=\r\n, L=990,
|
||||
_OPTINS(`SMTP_MAILER_MAX', `M=', `, ')_OPTINS(`SMTP_MAILER_MAXMSGS', `m=', `, ')_OPTINS(`SMTP_MAILER_MAXRCPTS', `r=', `, ')_OPTINS(`SMTP_MAILER_CHARSET', `C=', `, ')T=DNS/RFC822/SMTP,
|
||||
A=DSMTP_MAILER_ARGS
|
||||
Mrelay, P=[IPC], F=CONCAT(_DEF_SMTP_MAILER_FLAGS, `a8', RELAY_MAILER_FLAGS), S=EnvFromSMTP/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `MasqSMTP/MasqRelay', `MasqSMTP'), E=\r\n, L=2040,
|
||||
Mrelay, P=[IPC], F=_MODMF_(CONCAT(_DEF_SMTP_MAILER_FLAGS, `a8', RELAY_MAILER_FLAGS), `RELAY'), S=EnvFromSMTP/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `MasqSMTP/MasqRelay', `MasqSMTP'), E=\r\n, L=2040,
|
||||
_OPTINS(`RELAY_MAILER_CHARSET', `C=', `, ')_OPTINS(`RELAY_MAILER_MAXMSGS', `m=', `, ')_OPTINS(`SMTP_MAILER_MAXRCPTS', `r=', `, ')T=DNS/RFC822/SMTP,
|
||||
A=RELAY_MAILER_ARGS
|
||||
|
@ -1,6 +1,6 @@
|
||||
divert(-1)
|
||||
#
|
||||
# Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
|
||||
# Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 1983 Eric P. Allman. All rights reserved.
|
||||
# Copyright (c) 1988, 1993
|
||||
@ -13,7 +13,7 @@ divert(-1)
|
||||
#
|
||||
|
||||
divert(0)
|
||||
VERSIONID(`$Id: linux.m4,v 8.11.16.1 2000/05/09 18:48:58 gshapiro Exp $')
|
||||
VERSIONID(`$Id: linux.m4,v 8.11.16.2 2000/09/17 17:04:22 gshapiro Exp $')
|
||||
define(`confEBINDIR', `/usr/sbin')
|
||||
ifdef(`PROCMAIL_MAILER_PATH',,
|
||||
define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail'))
|
||||
|
25
contrib/sendmail/cf/ostype/solaris8.m4
Normal file
25
contrib/sendmail/cf/ostype/solaris8.m4
Normal file
@ -0,0 +1,25 @@
|
||||
divert(-1)
|
||||
#
|
||||
# Copyright (c) 2000 Sendmail, Inc. and its suppliers.
|
||||
# All rights reserved.
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
# the sendmail distribution.
|
||||
#
|
||||
#
|
||||
# This ostype file is suitable for use on Solaris 8 and later systems,
|
||||
# taking advantage of mail.local's LMTP support, the existence of
|
||||
# /var/run and support for IPv6, all of which where introduced in
|
||||
# Solaris 8.
|
||||
#
|
||||
|
||||
divert(0)
|
||||
VERSIONID(`$Id: solaris8.m4,v 8.1.2.2 2000/08/23 16:10:01 gshapiro Exp $')
|
||||
divert(-1)
|
||||
|
||||
ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g $h!rmail ($u)')')
|
||||
define(`confEBINDIR', `/usr/lib')dnl
|
||||
define(`confPID_FILE', `/var/run/sendmail.pid')dnl
|
||||
define(`_NETINET6_')dnl
|
||||
FEATURE(`local_lmtp')dnl
|
@ -58,7 +58,7 @@ divert(-1)changequote(<<, >>)<<
|
||||
ifdef(`_DOMAIN_MAP_',`',`dnl
|
||||
LOCAL_RULE_0
|
||||
# do mapping for domains where applicable
|
||||
R$* $=O $* <@ $={MappedDomain} .> $@ $>97 $1 $2 $3 Strip extraneous routing
|
||||
R$* $=O $* <@ $={MappedDomain} .> $@ $>Recurse $1 $2 $3 Strip extraneous routing
|
||||
R$+ <@ $={MappedDomain} .> $>DomainMapLookup $1 <@ $2 .> domain mapping
|
||||
|
||||
LOCAL_RULESETS
|
||||
@ -69,20 +69,21 @@ LOCAL_RULESETS
|
||||
SDomainMapLookup
|
||||
R $=L <@ $=w .> $@ $1 <@ $2 .> weed out local users, in case
|
||||
# Cw contains a mapped domain
|
||||
R $+ <@ $+ .> $1 <@ $2 > strip trailing dot
|
||||
R $+ <@ $+ . $+ > $1 <@ $(dequote $2 "_" $3 $) >
|
||||
R $+ <@ $+> $: $1 <@ $2 > < $2 > find domain
|
||||
R $+ <$+> <$+ . $+> $1 <$2> < $(dequote $3 "_" $4 $) >
|
||||
# change "." to "_"
|
||||
R $+ <@ $+ > $: $1 <@ $(dequote "domain_" $2 $) >
|
||||
R $+ <$+> <$+ .> $: $1 <$2> < $(dequote "domain_" $3 $) >
|
||||
# prepend "domain_"
|
||||
R $+ + $+ <@ $*> $1 <@ $3 > <+> $2 handle user+list syntax
|
||||
R $+ <@ $* > $* $( $2 $1 $: <ERROR> $) $3
|
||||
R $+ <$+> <$+> $: $1 <$2> <$3> $1 find user name
|
||||
R $+ <$+> <$+> $+ + $* $: $1 <$2> <$3> $4 handle user+detail syntax
|
||||
R $+ <$+> <$+> $+ $: $1 <$2> $( $3 $4 $: <ERROR> $)
|
||||
# do actual domain map lookup
|
||||
R <ERROR> $* $#error $@ 5.1.1 $: "550 email address lookup in domain map failed"
|
||||
R $* <TEMP> $* $#error $@ 4.3.0 $: "450 domain map temporarily unavailable"
|
||||
R $+ @ $+ <+> $+ $1 + $3 @ $2 reset original user+list
|
||||
R $+ <+> $* $1 paranoid check - remove <+>
|
||||
R $+ @ $+ . $1 @ $2 strip trailing dot
|
||||
R $+ @ $+ $@ $>97 $1 @ $2 recanonify
|
||||
R $+ <$+> <ERROR> $#error $@ 5.1.1 $: "550 email address lookup in domain map failed"
|
||||
R $+ <@ $+> $* <TEMP> $* $#dsmtp $@ localhost $: $1 @ $2
|
||||
# queue it up for later delivery
|
||||
R $+ + $* <$+> $+ @ $+ $: $1 + $2 <$3> $4 + $2 @ $5
|
||||
# reset original user+detail
|
||||
R $+ <$+> $+ $@ $>Recurse $3 recanonify
|
||||
define(`_DOMAIN_MAP_',`1')')
|
||||
|
||||
LOCAL_CONFIG
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/usr/bin/env perl
|
||||
##
|
||||
## Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
|
||||
## Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
|
||||
## All rights reserved.
|
||||
##
|
||||
## $Id: qtool.pl,v 8.15.16.1 2000/04/25 03:44:31 gshapiro Exp $
|
||||
## $Id: qtool.pl,v 8.15.16.2 2000/09/17 17:04:22 gshapiro Exp $
|
||||
##
|
||||
use strict;
|
||||
use File::Basename;
|
||||
|
@ -9,7 +9,7 @@
|
||||
.\" the sendmail distribution.
|
||||
.\"
|
||||
.\"
|
||||
.\" $Id: op.me,v 8.317.4.25 2000/07/19 18:42:01 ca Exp $
|
||||
.\" $Id: op.me,v 8.317.4.39 2000/09/22 15:01:37 ca Exp $
|
||||
.\"
|
||||
.\" eqn op.me | pic | troff -me
|
||||
.eh 'SMM:08-%''Sendmail Installation and Operation Guide'
|
||||
@ -54,7 +54,7 @@ eric@Sendmail.COM
|
||||
.de Ve
|
||||
Version \\$2
|
||||
..
|
||||
.Ve $Revision: 8.317.4.25 $
|
||||
.Ve $Revision: 8.317.4.39 $
|
||||
.rm Ve
|
||||
.sp
|
||||
For Sendmail Version 8.11
|
||||
@ -911,6 +911,10 @@ The number of envelope recipients for this message
|
||||
The message id of the message (from the header).
|
||||
.ip proto
|
||||
The protocol used to receive this message (e.g., ESMTP or UUCP)
|
||||
.ip daemon
|
||||
The daemon name from the
|
||||
.b DaemonPortOptions
|
||||
setting.
|
||||
.ip relay
|
||||
The machine from which it was received.
|
||||
.lp
|
||||
@ -933,6 +937,8 @@ The amount of time needed in this delivery attempt
|
||||
The name of the mailer used to deliver to this recipient.
|
||||
.ip relay
|
||||
The name of the host that actually accepted (or rejected) this recipient.
|
||||
.ip dsn
|
||||
The enhanced error code (RFC2034) if available.
|
||||
.ip stat
|
||||
The delivery status.
|
||||
.lp
|
||||
@ -1512,6 +1518,7 @@ If this file exists,
|
||||
.i sendmail
|
||||
redirects mail for that user
|
||||
to the list of addresses listed in the .forward file.
|
||||
Note that aliases are fully expanded before forward files are referenced.
|
||||
For example, if the home directory for user
|
||||
.q mckusick
|
||||
has a .forward file with contents:
|
||||
@ -1823,7 +1830,7 @@ in the current directory.
|
||||
gives up its setuid root permissions
|
||||
when you use this flag, so it is common to use a publicly writable directory
|
||||
(such as /tmp)
|
||||
as the spool directory (QueueDirectory or Q option) while testing.
|
||||
as the queue directory (QueueDirectory or Q option) while testing.
|
||||
.sh 2 "Logging Traffic"
|
||||
.pp
|
||||
Many SMTP implementations do not fully implement the protocol.
|
||||
@ -2687,7 +2694,7 @@ No special handling.
|
||||
Assume that the
|
||||
.i chown
|
||||
system call is restricted to root.
|
||||
Since some versions of Unix permit regular users
|
||||
Since some versions of UNIX permit regular users
|
||||
to give away their files to other users on some filesystems,
|
||||
.i sendmail
|
||||
often cannot assume that a given file was created by the owner,
|
||||
@ -2707,6 +2714,25 @@ for non-existent forward files.
|
||||
Allow the file named in the
|
||||
.b ErrorHeader
|
||||
option to be in an unsafe directory.
|
||||
.ip FileDeliveryToHardLink
|
||||
Allow delivery to files that are hard links.
|
||||
.ip FileDeliveryToSymLink
|
||||
Allow delivery to files that are symbolic links.
|
||||
.ip ForwardFileInGroupWritableDirPath
|
||||
Allow
|
||||
.i \&.forward
|
||||
files in group writable directories.
|
||||
.ip ForwardFileInUnsafeDirPath
|
||||
Allow
|
||||
.i \&.forward
|
||||
files in unsafe directories.
|
||||
.ip ForwardFileInUnsafeDirPathSafe
|
||||
Allow a
|
||||
.i \&.forward
|
||||
file that is in an unsafe directory to include references
|
||||
to program and files.
|
||||
.ip GroupWritableAliasFile
|
||||
Allow group-writable alias files.
|
||||
.ip GroupWritableDirPathSafe
|
||||
Change the definition of
|
||||
.q "unsafe directory"
|
||||
@ -2715,40 +2741,23 @@ World-writable directories are always unsafe.
|
||||
.ip GroupWritableForwardFileSafe
|
||||
Accept group-writable
|
||||
.i \&.forward
|
||||
files.
|
||||
files as safe for program and file delivery.
|
||||
.ip GroupWritableIncludeFileSafe
|
||||
Accept group-writable
|
||||
.i :include:
|
||||
files.
|
||||
.ip GroupWritableAliasFile
|
||||
Allow group-writable alias files.
|
||||
files as safe for program and file delivery.
|
||||
.ip HelpFileInUnsafeDirPath
|
||||
Allow the file named in the
|
||||
.b HelpFile
|
||||
option to be in an unsafe directory.
|
||||
.ip WorldWritableAliasFile
|
||||
Accept world-writable alias files.
|
||||
.ip ForwardFileInGroupWritableDirPath
|
||||
Allow
|
||||
.i \&.forward
|
||||
files in group writable directories.
|
||||
.ip IncludeFileInGroupWritableDirPath
|
||||
Allow
|
||||
.i :include:
|
||||
files in group writable directories.
|
||||
.ip ForwardFileInUnsafeDirPath
|
||||
Allow
|
||||
.i \&.forward
|
||||
files in unsafe directories.
|
||||
.ip IncludeFileInUnsafeDirPath
|
||||
Allow
|
||||
.i :include:
|
||||
files in unsafe directories.
|
||||
.ip ForwardFileInUnsafeDirPathSafe
|
||||
Allow a
|
||||
.i \&.forward
|
||||
file that is in an unsafe directory to include references
|
||||
to program and files.
|
||||
.ip IncludeFileInUnsafeDirPathSafe
|
||||
Allow a
|
||||
.i :include:
|
||||
@ -2757,14 +2766,6 @@ to program and files.
|
||||
.ip InsufficientEntropy
|
||||
Try to use STARTTLS even if the PRNG for OpenSSL is not properly seeded
|
||||
despite the security problems.
|
||||
.ip MapInUnsafeDirPath
|
||||
Allow maps (e.g.,
|
||||
.i hash ,
|
||||
.i btree ,
|
||||
and
|
||||
.i dbm
|
||||
files)
|
||||
in unsafe directories.
|
||||
.ip LinkedAliasFileInWritableDir
|
||||
Allow an alias file that is a link in a writable directory.
|
||||
.ip LinkedClassFileInWritableDir
|
||||
@ -2782,14 +2783,28 @@ Allow map files that are links in writable directories.
|
||||
.ip LinkedServiceSwitchFileInWritableDir
|
||||
Allow the service switch file to be a link
|
||||
even if the directory is writable.
|
||||
.ip FileDeliveryToHardLink
|
||||
Allow delivery to files that are hard links.
|
||||
.ip FileDeliveryToSymLink
|
||||
Allow delivery to files that are symbolic links.
|
||||
.ip MapInUnsafeDirPath
|
||||
Allow maps (e.g.,
|
||||
.i hash ,
|
||||
.i btree ,
|
||||
and
|
||||
.i dbm
|
||||
files)
|
||||
in unsafe directories.
|
||||
.ip NonRootSafeAddr
|
||||
Do not mark file and program deliveries as unsafe
|
||||
if sendmail is not running with root privileges.
|
||||
.ip RunProgramInUnsafeDirPath
|
||||
Go ahead and run programs that are in writable directories.
|
||||
.ip RunWritableProgram
|
||||
Go ahead and run programs that are group- or world-writable.
|
||||
.ip TrustStickyBit
|
||||
Allow group or world writable directories
|
||||
if the sticky bit is set on the directory.
|
||||
Do not set this on systems which do not honor
|
||||
the sticky bit on directories.
|
||||
.ip WorldWritableAliasFile
|
||||
Accept world-writable alias files.
|
||||
.ip WriteMapToHardLink
|
||||
Allow writes to maps that are hard links.
|
||||
.ip WriteMapToSymLink
|
||||
@ -2798,14 +2813,6 @@ Allow writes to maps that are symbolic links.
|
||||
Allow the status file to be a hard link.
|
||||
.ip WriteStatsToSymLink
|
||||
Allow the status file to be a symbolic link.
|
||||
.ip TrustStickyBit
|
||||
Allow group or world writable directories
|
||||
if the sticky bit is set on the directory.
|
||||
Do not set this on systems which do not honor
|
||||
the sticky bit on directories.
|
||||
.ip NonRootSafeAddr
|
||||
Do not mark file and program deliveries as unsafe
|
||||
if sendmail is not running with root privileges.
|
||||
.sh 2 "Connection Caching"
|
||||
.pp
|
||||
When processing the queue,
|
||||
@ -3820,6 +3827,8 @@ it should not be used lightly.
|
||||
.pp
|
||||
Macros are named with a single character
|
||||
or with a word in {braces}.
|
||||
The names ``x'' and ``{x}'' denote the same macro
|
||||
for every single character ``x''.
|
||||
Single character names may be selected from the entire ASCII set,
|
||||
but user-defined macros
|
||||
should be selected from the set of upper case letters only.
|
||||
@ -4170,12 +4179,17 @@ the name of the header.
|
||||
.ip ${if_addr}
|
||||
The IP address of the interface of an incoming connection
|
||||
unless it is in the loopback net.
|
||||
.ip ${if_family}
|
||||
The IP family of the interface of an incoming connection
|
||||
unless it is in the loopback net.
|
||||
.ip ${if_name}
|
||||
The name of the interface of an incoming connection.
|
||||
This macro can be used for
|
||||
SmtpGreetingMessage and HReceived for virtual hosting.
|
||||
For example:
|
||||
O SmtpGreetingMessage=$?{if_name}${if_name}$|$j$. Sendmail $v/$Z; $b
|
||||
.(b
|
||||
O SmtpGreetingMessage=$?{if_name}${if_name}$|$j$. MTA
|
||||
.)b
|
||||
.ip ${mail_addr}
|
||||
The address part of the resolved triple of the address given for the
|
||||
.sm "SMTP MAIL"
|
||||
@ -4191,6 +4205,13 @@ The mailer from the resolved triple of the address given for the
|
||||
.sm "SMTP MAIL"
|
||||
command.
|
||||
Defined in the SMTP server only.
|
||||
.ip ${msg_size}
|
||||
The value of the SIZE= parameter,
|
||||
i.e., usually the size of the message (in an ESMTP dialogue),
|
||||
before the message has been collected, thereafter
|
||||
the message size as computed by
|
||||
.i sendmail
|
||||
(and can be used in check_compat).
|
||||
.ip ${ntries}
|
||||
The number of delivery attempts.
|
||||
.ip ${opMode}
|
||||
@ -5261,6 +5282,9 @@ to discard the message
|
||||
(as with the other
|
||||
.b check_ *
|
||||
rulesets).
|
||||
The ruleset receives the header field-body as argument,
|
||||
i.e., not the header field-name; see also
|
||||
${hdr_name} and ${currHeader}.
|
||||
The header is treated as a structured field,
|
||||
that is,
|
||||
comments (in parentheses) are deleted before processing,
|
||||
@ -6428,10 +6452,10 @@ Use that form instead of the
|
||||
form.
|
||||
.ip RandFile
|
||||
[no short name]
|
||||
Name of file containing random data or the name of the Unix socket
|
||||
Name of file containing random data or the name of the UNIX socket
|
||||
if EGD is used.
|
||||
A (required) prefix "egd:" or "file:" specifies the type.
|
||||
STARTTLS requires this filename if the compile flag HASURANDOM is not set
|
||||
STARTTLS requires this filename if the compile flag HASURANDOMDEV is not set
|
||||
(see sendmail/README).
|
||||
.ip ResolverOptions=\fIoptions\fP
|
||||
[I]
|
||||
@ -6582,7 +6606,7 @@ refuses to deliver to symbolic links.
|
||||
.ip SaveFromLine
|
||||
[f]
|
||||
Save
|
||||
Unix-style
|
||||
UNIX-style
|
||||
.q From
|
||||
lines at the front of headers.
|
||||
Normally they are assumed redundant
|
||||
@ -7988,6 +8012,7 @@ is seven atoms.
|
||||
.ip "MAXMAILERS [25]"
|
||||
The maximum number of mailers that may be defined
|
||||
in the configuration file.
|
||||
This value is defined in include/sendmail/sendmail.h.
|
||||
.ip "MAXRWSETS [200]"
|
||||
The maximum number of rewriting sets
|
||||
that may be defined.
|
||||
@ -8670,7 +8695,7 @@ Depending on the TLS library you use, it may be required to explicitly
|
||||
initialize the PRNG with random data.
|
||||
OpenSSL makes use of
|
||||
.b /dev/urandom(4)
|
||||
if available (this corresponds to the compile flag HASURANDOM).
|
||||
if available (this corresponds to the compile flag HASURANDOMDEV).
|
||||
On systems which lack this support, a random file must be specified in the
|
||||
.i sendmail.cf
|
||||
file using the option RandFile.
|
||||
@ -9075,7 +9100,7 @@ Encoded second
|
||||
.ip N
|
||||
Envelope number
|
||||
.ip PPPPP
|
||||
First five digits of the process ID
|
||||
At least five digits of the process ID
|
||||
.pp
|
||||
All files with the same id collectively define one message.
|
||||
If memory-buffered files are available,
|
||||
@ -9234,26 +9259,31 @@ Glance over it to get an idea;
|
||||
nothing can replace looking at what your own system generates.
|
||||
.)f
|
||||
.(b
|
||||
P835771
|
||||
T404261372
|
||||
V4
|
||||
T711358135
|
||||
K904446490
|
||||
N0
|
||||
P2100941
|
||||
$_eric@localhost
|
||||
${daemon_flags}
|
||||
Seric
|
||||
Ceric:sendmail@vangogh.CS.Berkeley.EDU
|
||||
Reric@mammoth.Berkeley.EDU
|
||||
Rbostic@okeeffe.CS.Berkeley.EDU
|
||||
H?P?Return-path: <owner-sendmail@vangogh.CS.Berkeley.EDU>
|
||||
HReceived: by vangogh.CS.Berkeley.EDU (5.108/2.7) id AAA06703;
|
||||
Ceric:100:1000:sendmail@vangogh.CS.Berkeley.EDU
|
||||
RPFD:eric@mammoth.Berkeley.EDU
|
||||
RPFD:bostic@okeeffe.CS.Berkeley.EDU
|
||||
H?P?Return-path: <^g>
|
||||
H??Received: by vangogh.CS.Berkeley.EDU (5.108/2.7) id AAA06703;
|
||||
Fri, 17 Jul 1992 00:28:55 -0700
|
||||
HReceived: from mail.CS.Berkeley.EDU by vangogh.CS.Berkeley.EDU (5.108/2.7)
|
||||
H??Received: from mail.CS.Berkeley.EDU by vangogh.CS.Berkeley.EDU (5.108/2.7)
|
||||
id AAA06698; Fri, 17 Jul 1992 00:28:54 -0700
|
||||
HReceived: from [128.32.31.21] by mail.CS.Berkeley.EDU (5.96/2.5)
|
||||
H??Received: from [128.32.31.21] by mail.CS.Berkeley.EDU (5.96/2.5)
|
||||
id AA22777; Fri, 17 Jul 1992 03:29:14 -0400
|
||||
HReceived: by foo.bar.baz.de (5.57/Ultrix3.0-C)
|
||||
H??Received: by foo.bar.baz.de (5.57/Ultrix3.0-C)
|
||||
id AA22757; Fri, 17 Jul 1992 09:31:25 GMT
|
||||
H?F?From: eric@foo.bar.baz.de (Eric Allman)
|
||||
H?x?Full-name: Eric Allman
|
||||
HMessage-id: <9207170931.AA22757@foo.bar.baz.de>
|
||||
HTo: sendmail@vangogh.CS.Berkeley.EDU
|
||||
HSubject: this is an example message
|
||||
H??Message-id: <9207170931.AA22757@foo.bar.baz.de>
|
||||
H??To: sendmail@vangogh.CS.Berkeley.EDU
|
||||
H??Subject: this is an example message
|
||||
.)b
|
||||
This shows
|
||||
the person who sent the message,
|
||||
@ -9351,7 +9381,7 @@ replace it with a blank sheet for double-sided output.
|
||||
.\".sz 10
|
||||
.\"Eric Allman
|
||||
.\".sp
|
||||
.\"Version $Revision: 8.317.4.25 $
|
||||
.\"Version $Revision: 8.317.4.39 $
|
||||
.\".ce 0
|
||||
.bp 3
|
||||
.ce
|
||||
|
@ -7,7 +7,7 @@
|
||||
* the sendmail distribution.
|
||||
*
|
||||
*
|
||||
* $Id: mfapi.h,v 8.13.4.11 2000/07/11 21:45:56 geir Exp $
|
||||
* $Id: mfapi.h,v 8.13.4.12 2000/09/09 02:11:48 ca Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -128,6 +128,7 @@ LIBMILTER_API int smfi_main __P((void));
|
||||
LIBMILTER_API int smfi_setdbg __P((int));
|
||||
LIBMILTER_API int smfi_settimeout __P((int));
|
||||
LIBMILTER_API int smfi_setconn __P((char *));
|
||||
LIBMILTER_API int smfi_stop __P((void));
|
||||
|
||||
/*
|
||||
** Continue processing message/connection.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999 Sendmail, Inc. and its suppliers.
|
||||
* Copyright (c) 1999-2000 Sendmail, Inc. and its suppliers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
@ -7,7 +7,7 @@
|
||||
* the sendmail distribution.
|
||||
*
|
||||
*
|
||||
* $Id: milter.h,v 8.24.16.6 2000/06/08 22:13:39 gshapiro Exp $
|
||||
* $Id: milter.h,v 8.24.16.8 2000/09/17 17:04:24 gshapiro Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -74,8 +74,8 @@
|
||||
|
||||
/* socket and thread portability */
|
||||
# include <pthread.h>
|
||||
typedef pthread_t sthread_t;
|
||||
typedef int socket_t;
|
||||
typedef pthread_t sthread_t;
|
||||
typedef int socket_t;
|
||||
|
||||
# define MAX_MACROS_ENTRIES 4 /* max size of macro pointer array */
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
** forth in the LICENSE file which can be found at the top level of
|
||||
** the sendmail distribution.
|
||||
**
|
||||
** $Id: smdb.h,v 8.29.2.1 2000/04/08 20:40:42 ca Exp $
|
||||
** $Id: smdb.h,v 8.29.2.1.2.1 2000/08/24 17:08:00 gshapiro Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SMDB_H_
|
||||
@ -189,6 +189,7 @@ typedef int (*db_set_owner_func) __P((SMDB_DATABASE *db, uid_t uid,
|
||||
typedef int (*db_cursor_func) __P((SMDB_DATABASE *db,
|
||||
SMDB_CURSOR **cursor, u_int flags));
|
||||
|
||||
typedef int (*db_lockfd_func) __P((SMDB_DATABASE *db));
|
||||
|
||||
struct database_struct
|
||||
{
|
||||
@ -200,6 +201,7 @@ struct database_struct
|
||||
db_sync_func smdb_sync;
|
||||
db_set_owner_func smdb_set_owner;
|
||||
db_cursor_func smdb_cursor;
|
||||
db_lockfd_func smdb_lockfd;
|
||||
void *smdb_impl;
|
||||
};
|
||||
|
||||
@ -376,4 +378,6 @@ extern int smdb_filechanged __P((char *, char *, int,
|
||||
struct stat *));
|
||||
extern void smdb_print_available_types __P((void));
|
||||
extern char *smdb_db_definition __P((SMDB_DBTYPE));
|
||||
extern int smdb_lock_map __P((SMDB_DATABASE *, int));
|
||||
extern int smdb_unlock_map __P((SMDB_DATABASE *));
|
||||
#endif /* ! _SMDB_H_ */
|
||||
|
@ -9,7 +9,7 @@
|
||||
* the sendmail distribution.
|
||||
*
|
||||
*
|
||||
* $Id: pathnames.h,v 8.16.8.5 2000/06/09 18:16:13 geir Exp $
|
||||
* $Id: pathnames.h,v 8.16.8.7 2000/08/25 18:36:57 geir Exp $
|
||||
*/
|
||||
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
* the sendmail distribution.
|
||||
*
|
||||
*
|
||||
* $Id: sendmail.h,v 8.34.4.4 2000/07/15 17:35:17 gshapiro Exp $
|
||||
* $Id: sendmail.h,v 8.34.4.5 2000/09/14 23:32:26 gshapiro Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -150,8 +150,14 @@ extern bool filechanged __P((char *, int, struct stat *));
|
||||
#define DBS_DONTWARNFORWARDFILEINUNSAFEDIRPATH 33
|
||||
#define DBS_INSUFFICIENTENTROPY 34
|
||||
#if _FFR_UNSAFE_SASL
|
||||
#define DBS_GROUPREADABLESASLFILE 35
|
||||
# define DBS_GROUPREADABLESASLFILE 35
|
||||
#endif /* _FFR_UNSAFE_SASL */
|
||||
#if _FFR_UNSAFE_WRITABLE_INCLUDE
|
||||
# define DBS_GROUPWRITABLEFORWARDFILE 36
|
||||
# define DBS_GROUPWRITABLEINCLUDEFILE 37
|
||||
# define DBS_WORLDWRITABLEFORWARDFILE 38
|
||||
# define DBS_WORLDWRITABLEINCLUDEFILE 39
|
||||
#endif /* _FFR_UNSAFE_WRITABLE_INCLUDE */
|
||||
|
||||
/* struct defining such things */
|
||||
struct dbsval
|
||||
|
@ -71,6 +71,9 @@ IPv4 socket on port 3333 of localhost. The current flags (F=) are:
|
||||
R Reject connection if filter unavailable
|
||||
T Temporary fail connection if filter unavailable
|
||||
|
||||
If neither F=R nor F=T is specified, the message is passed through sendmail
|
||||
as if the filter were not present.
|
||||
|
||||
Finally, you can override the default timeouts used by sendmail when
|
||||
talking to the filters using the T= equate. There are three fields inside
|
||||
of the T= equate:
|
||||
@ -88,13 +91,17 @@ T=S:10s;R:10s;E:5m
|
||||
|
||||
where 's' is seconds and 'm' is minutes.
|
||||
|
||||
Actual sequencing is handled by the InputMailFilters option which is set
|
||||
automatically according to the order of the INPUT_MAIL_FILTER commands
|
||||
in your .mc file. Alternatively, you can reset its value by setting
|
||||
confINPUT_MAIL_FILTERS in your .mc file. This options causes the three
|
||||
filters to be called in the same order they were specified. It allows
|
||||
for possible future filtering on output (although this is not intended
|
||||
for this release).
|
||||
Which filters are invoked and their sequencing is handled by the
|
||||
InputMailFilters option.
|
||||
|
||||
O InputMailFilters=filter1, filter2, filter3
|
||||
|
||||
This is is set automatically according to the order of the
|
||||
INPUT_MAIL_FILTER commands in your .mc file. Alternatively, you can
|
||||
reset its value by setting confINPUT_MAIL_FILTERS in your .mc file.
|
||||
This options causes the three filters to be called in the same order
|
||||
they were specified. It allows for possible future filtering on output
|
||||
(although this is not intended for this release).
|
||||
|
||||
Also note that a filter can be defined without adding it to the input
|
||||
filter list by using MAIL_FILTER() instead of INPUT_MAIL_FILTER() in your
|
||||
@ -134,7 +141,7 @@ connected via one of these options, the session can be continued through
|
||||
the use of standard SMTP commands.
|
||||
|
||||
% sendmail -bs
|
||||
220 test.sendmail.com ESMTP Sendmail 8.10.0.Beta8/8.10.0.Beta8; Mon, 6 Dec 1999 19:34:23 -0800 (PST)
|
||||
220 test.sendmail.com ESMTP Sendmail 8.11.0/8.11.0; Tue, 10 Nov 1970 13:05:23 -0500 (EST)
|
||||
HELO localhost
|
||||
250 test.sendmail.com Hello testy@localhost, pleased to meet you
|
||||
MAIL From:<testy>
|
||||
@ -405,4 +412,4 @@ main(argc, argv)
|
||||
|
||||
/* eof */
|
||||
|
||||
$Revision: 8.9.2.1.2.8 $, Last updated $Date: 2000/07/18 15:43:26 $
|
||||
$Revision: 8.9.2.1.2.12 $, Last updated $Date: 2000/09/19 19:40:13 $
|
||||
|
@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: comm.c,v 8.30.4.3 2000/06/12 14:53:01 ca Exp $";
|
||||
static char id[] = "@(#)$Id: comm.c,v 8.30.4.5 2000/08/14 09:04:47 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#if _FFR_MILTER
|
||||
@ -71,7 +71,7 @@ mi_rd_cmd(sd, timeout, cmd, rlen, name)
|
||||
*cmd = SMFIC_SELECT;
|
||||
return NULL;
|
||||
}
|
||||
if ((len = read(sd, data + i, sizeof data - i)) < 0)
|
||||
if ((len = MI_SOCK_READ(sd, data + i, sizeof data - i)) < 0)
|
||||
{
|
||||
smi_log(SMI_LOG_ERR,
|
||||
"%s, mi_rd_cmd: read returned %d: %s",
|
||||
@ -131,7 +131,7 @@ mi_rd_cmd(sd, timeout, cmd, rlen, name)
|
||||
free(buf);
|
||||
return NULL;
|
||||
}
|
||||
if ((len = read(sd, buf + i, expl - i)) < 0)
|
||||
if ((len = MI_SOCK_READ(sd, buf + i, expl - i)) < 0)
|
||||
{
|
||||
smi_log(SMI_LOG_ERR,
|
||||
"%s: mi_rd_cmd: read returned %d: %s",
|
||||
@ -217,7 +217,8 @@ mi_wr_cmd(sd, timeout, cmd, buf, len)
|
||||
i = 0;
|
||||
sl = MILTER_LEN_BYTES + 1;
|
||||
|
||||
do {
|
||||
do
|
||||
{
|
||||
FD_ZERO(&wrtset);
|
||||
FD_SET((u_int) sd, &wrtset);
|
||||
if ((ret = select(sd + 1, NULL, &wrtset, NULL, timeout)) == 0)
|
||||
@ -227,7 +228,8 @@ mi_wr_cmd(sd, timeout, cmd, buf, len)
|
||||
return MI_FAILURE;
|
||||
|
||||
/* use writev() instead to send the whole stuff at once? */
|
||||
while ((l = write(sd, (void *) (data + i), sl - i)) < (ssize_t) sl)
|
||||
while ((l = MI_SOCK_WRITE(sd, (void *) (data + i),
|
||||
sl - i)) < (ssize_t) sl)
|
||||
{
|
||||
if (l < 0)
|
||||
return MI_FAILURE;
|
||||
@ -241,7 +243,8 @@ mi_wr_cmd(sd, timeout, cmd, buf, len)
|
||||
return MI_SUCCESS;
|
||||
i = 0;
|
||||
sl = len;
|
||||
do {
|
||||
do
|
||||
{
|
||||
FD_ZERO(&wrtset);
|
||||
FD_SET((u_int) sd, &wrtset);
|
||||
if ((ret = select(sd + 1, NULL, &wrtset, NULL, timeout)) == 0)
|
||||
@ -249,7 +252,8 @@ mi_wr_cmd(sd, timeout, cmd, buf, len)
|
||||
} while (ret < 0 && errno == EINTR);
|
||||
if (ret < 0)
|
||||
return MI_FAILURE;
|
||||
while ((l = write(sd, (void *) (buf + i), sl - i)) < (ssize_t) sl)
|
||||
while ((l = MI_SOCK_WRITE(sd, (void *) (buf + i),
|
||||
sl - i)) < (ssize_t) sl)
|
||||
{
|
||||
if (l < 0)
|
||||
return MI_FAILURE;
|
||||
|
@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: engine.c,v 8.67.4.12 2000/07/14 06:16:57 msk Exp $";
|
||||
static char id[] = "@(#)$Id: engine.c,v 8.67.4.14 2000/08/14 08:27:30 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#if _FFR_MILTER
|
||||
@ -208,7 +208,8 @@ mi_engine(ctx)
|
||||
fi_abort = ctx->ctx_smfi->xxfi_abort;
|
||||
mi_clr_macros(ctx, 0);
|
||||
fix_stm(ctx);
|
||||
do {
|
||||
do
|
||||
{
|
||||
/* call abort only if in a mail transaction */
|
||||
call_abort = ST_IN_MAIL(curstate);
|
||||
timeout.tv_sec = ctx->ctx_timeout;
|
||||
@ -226,7 +227,7 @@ mi_engine(ctx)
|
||||
cmd < SMFIC_VALIDCMD)
|
||||
{
|
||||
if (ctx->ctx_dbg > 5)
|
||||
dprintf("[%d] error (%x)\n",
|
||||
dprintf("[%d] mi_engine: mi_rd_cmd error (%x)\n",
|
||||
(int) ctx->ctx_id, (int) cmd);
|
||||
|
||||
/*
|
||||
@ -958,7 +959,8 @@ trans_ok(old, new)
|
||||
int s, n;
|
||||
|
||||
s = old;
|
||||
do {
|
||||
do
|
||||
{
|
||||
/* is this state transition allowed? */
|
||||
if ((MASK(new) & next_states[s]) != 0)
|
||||
return TRUE;
|
||||
|
@ -17,7 +17,7 @@
|
||||
# define EXTERN
|
||||
# define INIT(x) = x
|
||||
# ifndef lint
|
||||
static char MilterlId[] = "@(#)$Id: libmilter.h,v 8.3.6.4 2000/06/09 07:12:13 gshapiro Exp $";
|
||||
static char MilterlId[] = "@(#)$Id: libmilter.h,v 8.3.6.9 2000/09/01 00:49:04 ca Exp $";
|
||||
# endif /* ! lint */
|
||||
#else /* _DEFINE */
|
||||
# define EXTERN extern
|
||||
@ -37,6 +37,9 @@ static char MilterlId[] = "@(#)$Id: libmilter.h,v 8.3.6.4 2000/06/09 07:12:13 gs
|
||||
#include "sendmail/useful.h"
|
||||
|
||||
# define ValidSocket(sd) ((sd) >= 0)
|
||||
# define INVALID_SOCKET -1
|
||||
# define MI_SOCK_READ(s, b, l) (read(s, b, l))
|
||||
# define MI_SOCK_WRITE(s, b, l) (write(s, b, l))
|
||||
|
||||
# define thread_create(ptid,wr,arg) pthread_create(ptid, NULL, wr, arg)
|
||||
# define sthread_get_id() pthread_self()
|
||||
@ -51,6 +54,12 @@ static char MilterlId[] = "@(#)$Id: libmilter.h,v 8.3.6.4 2000/06/09 07:12:13 gs
|
||||
#define MI_TIMEOUT 1800 /* default timeout for read/write */
|
||||
#define MI_CHK_TIME 5 /* checking whether to terminate */
|
||||
|
||||
#if SOMAXCONN > 20
|
||||
# define MI_SOMAXCONN SOMAXCONN
|
||||
#else /* SOMAXCONN */
|
||||
# define MI_SOMAXCONN 20
|
||||
#endif /* SOMAXCONN */
|
||||
|
||||
/* maximum number of repeated failures in mi_listener() */
|
||||
#define MAX_FAILS_M 16 /* malloc() */
|
||||
#define MAX_FAILS_T 16 /* thread creation */
|
||||
@ -74,8 +83,6 @@ static char MilterlId[] = "@(#)$Id: libmilter.h,v 8.3.6.4 2000/06/09 07:12:13 gs
|
||||
#define SMI_LOG_INFO LOG_INFO
|
||||
#define SMI_LOG_DEBUG LOG_DEBUG
|
||||
|
||||
#define MI_INVALID_SOCKET (-1)
|
||||
|
||||
/* stop? */
|
||||
#define MILTER_CONT 0
|
||||
#define MILTER_STOP 1
|
||||
@ -84,13 +91,14 @@ static char MilterlId[] = "@(#)$Id: libmilter.h,v 8.3.6.4 2000/06/09 07:12:13 gs
|
||||
/* functions */
|
||||
extern int mi_handle_session __P((SMFICTX_PTR));
|
||||
extern int mi_engine __P((SMFICTX_PTR));
|
||||
extern int mi_listener __P((char *, int, smfiDesc_ptr, time_t));
|
||||
extern int mi_listener __P((char *, int, smfiDesc_ptr, time_t, int));
|
||||
extern void mi_clr_macros __P((SMFICTX_PTR, int));
|
||||
extern int mi_stop __P((void));
|
||||
extern int mi_control_startup __P((char *));
|
||||
extern void mi_stop_milters __P((int));
|
||||
extern void mi_clean_signals __P((void));
|
||||
extern struct hostent *mi_gethostbyname __P((char *, int));
|
||||
extern void mi_closener __P((void));
|
||||
|
||||
/* communication functions */
|
||||
extern char *mi_rd_cmd __P((socket_t, struct timeval *, char *, size_t *, char *));
|
||||
|
@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: listener.c,v 8.38.2.1.2.7 2000/05/25 21:44:26 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: listener.c,v 8.38.2.1.2.11 2000/09/01 00:49:04 ca Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#if _FFR_MILTER
|
||||
@ -35,14 +35,14 @@ static char id[] = "@(#)$Id: listener.c,v 8.38.2.1.2.7 2000/05/25 21:44:26 gshap
|
||||
** socket upon success, error code otherwise.
|
||||
*/
|
||||
|
||||
static int
|
||||
static socket_t
|
||||
mi_milteropen(conn, backlog, socksize, name)
|
||||
char *conn;
|
||||
int backlog;
|
||||
SOCKADDR_LEN_T *socksize;
|
||||
char *name;
|
||||
{
|
||||
int sock = 0;
|
||||
socket_t sock;
|
||||
int sockopt = 1;
|
||||
char *p;
|
||||
char *colon;
|
||||
@ -54,7 +54,7 @@ mi_milteropen(conn, backlog, socksize, name)
|
||||
{
|
||||
smi_log(SMI_LOG_ERR, "%s: empty or missing socket information",
|
||||
name);
|
||||
return MI_INVALID_SOCKET;
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
(void) memset(&addr, '\0', sizeof addr);
|
||||
|
||||
@ -86,7 +86,7 @@ mi_milteropen(conn, backlog, socksize, name)
|
||||
smi_log(SMI_LOG_ERR,
|
||||
"%s: no valid socket protocols available",
|
||||
name);
|
||||
return MI_INVALID_SOCKET;
|
||||
return INVALID_SOCKET;
|
||||
# endif /* NETINET6 */
|
||||
# endif /* NETINET */
|
||||
#endif /* NETUNIX */
|
||||
@ -117,7 +117,7 @@ mi_milteropen(conn, backlog, socksize, name)
|
||||
{
|
||||
smi_log(SMI_LOG_ERR, "%s: unknown socket type %s",
|
||||
name, p);
|
||||
return MI_INVALID_SOCKET;
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
*colon++ = ':';
|
||||
}
|
||||
@ -141,7 +141,7 @@ mi_milteropen(conn, backlog, socksize, name)
|
||||
# else /* NETINET6 */
|
||||
smi_log(SMI_LOG_ERR, "%s: unknown socket type %s",
|
||||
name, p);
|
||||
return MI_INVALID_SOCKET;
|
||||
return INVALID_SOCKET;
|
||||
# endif /* NETINET6 */
|
||||
# endif /* NETINET */
|
||||
#endif /* NETUNIX */
|
||||
@ -162,7 +162,7 @@ mi_milteropen(conn, backlog, socksize, name)
|
||||
errno = EINVAL;
|
||||
smi_log(SMI_LOG_ERR, "%s: UNIX socket name %s too long",
|
||||
name, colon);
|
||||
return MI_INVALID_SOCKET;
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
# if 0
|
||||
errno = safefile(colon, RunAsUid, RunAsGid, RunAsUserName, sff,
|
||||
@ -174,7 +174,7 @@ mi_milteropen(conn, backlog, socksize, name)
|
||||
smi_log(SMI_LOG_ERR,
|
||||
"%s: UNIX socket name %s unsafe",
|
||||
name, colon);
|
||||
return MI_INVALID_SOCKET;
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
# endif /* 0 */
|
||||
|
||||
@ -225,7 +225,7 @@ mi_milteropen(conn, backlog, socksize, name)
|
||||
# ifdef NO_GETSERVBYNAME
|
||||
smi_log(SMI_LOG_ERR, "%s: invalid port number %s",
|
||||
name, colon);
|
||||
return MI_INVALID_SOCKET;
|
||||
return INVALID_SOCKET;
|
||||
# else /* NO_GETSERVBYNAME */
|
||||
register struct servent *sp;
|
||||
|
||||
@ -235,7 +235,7 @@ mi_milteropen(conn, backlog, socksize, name)
|
||||
smi_log(SMI_LOG_ERR,
|
||||
"%s: unknown port name %s",
|
||||
name, colon);
|
||||
return MI_INVALID_SOCKET;
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
port = sp->s_port;
|
||||
# endif /* NO_GETSERVBYNAME */
|
||||
@ -286,7 +286,7 @@ mi_milteropen(conn, backlog, socksize, name)
|
||||
smi_log(SMI_LOG_ERR,
|
||||
"%s: Invalid numeric domain spec \"%s\"",
|
||||
name, at);
|
||||
return MI_INVALID_SOCKET;
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -294,7 +294,7 @@ mi_milteropen(conn, backlog, socksize, name)
|
||||
smi_log(SMI_LOG_ERR,
|
||||
"%s: Invalid numeric domain spec \"%s\"",
|
||||
name, at);
|
||||
return MI_INVALID_SOCKET;
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -305,7 +305,7 @@ mi_milteropen(conn, backlog, socksize, name)
|
||||
smi_log(SMI_LOG_ERR,
|
||||
"%s: Unknown host name %s",
|
||||
name, at);
|
||||
return MI_INVALID_SOCKET;
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
addr.sa.sa_family = hp->h_addrtype;
|
||||
switch (hp->h_addrtype)
|
||||
@ -332,7 +332,7 @@ mi_milteropen(conn, backlog, socksize, name)
|
||||
smi_log(SMI_LOG_ERR,
|
||||
"%s: Unknown protocol for %s (%d)",
|
||||
name, at, hp->h_addrtype);
|
||||
return MI_INVALID_SOCKET;
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -361,7 +361,7 @@ mi_milteropen(conn, backlog, socksize, name)
|
||||
smi_log(SMI_LOG_ERR,
|
||||
"%s: Unable to create new socket: %s",
|
||||
name, strerror(errno));
|
||||
return MI_INVALID_SOCKET;
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &sockopt,
|
||||
@ -370,7 +370,7 @@ mi_milteropen(conn, backlog, socksize, name)
|
||||
smi_log(SMI_LOG_ERR,
|
||||
"%s: Unable to setsockopt: %s", name, strerror(errno));
|
||||
(void) close(sock);
|
||||
return MI_INVALID_SOCKET;
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
if (bind(sock, &addr.sa, *socksize) < 0)
|
||||
@ -379,7 +379,7 @@ mi_milteropen(conn, backlog, socksize, name)
|
||||
"%s: Unable to bind to port %s: %s",
|
||||
name, conn, strerror(errno));
|
||||
(void) close(sock);
|
||||
return MI_INVALID_SOCKET;
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
if (listen(sock, backlog) < 0)
|
||||
@ -387,7 +387,7 @@ mi_milteropen(conn, backlog, socksize, name)
|
||||
smi_log(SMI_LOG_ERR,
|
||||
"%s: listen call failed: %s", name, strerror(errno));
|
||||
(void) close(sock);
|
||||
return MI_INVALID_SOCKET;
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
return sock;
|
||||
@ -409,8 +409,30 @@ mi_thread_handle_wrapper(arg)
|
||||
return (void *) mi_handle_session(arg);
|
||||
}
|
||||
|
||||
static socket_t listenfd = INVALID_SOCKET;
|
||||
|
||||
/*
|
||||
** MI_MILTER_LISTENER -- Generic listener harness
|
||||
** MI_CLOSENER -- close listen socket
|
||||
**
|
||||
** Parameters:
|
||||
** none.
|
||||
**
|
||||
** Returns:
|
||||
** none.
|
||||
*/
|
||||
|
||||
void
|
||||
mi_closener()
|
||||
{
|
||||
if (ValidSocket(listenfd))
|
||||
{
|
||||
(void) close(listenfd);
|
||||
listenfd = INVALID_SOCKET;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** MI_LISTENER -- Generic listener harness
|
||||
**
|
||||
** Open up listen port
|
||||
** Wait for connections
|
||||
@ -428,14 +450,14 @@ mi_thread_handle_wrapper(arg)
|
||||
*/
|
||||
|
||||
int
|
||||
mi_listener(conn, dbg, smfi, timeout)
|
||||
mi_listener(conn, dbg, smfi, timeout, backlog)
|
||||
char *conn;
|
||||
int dbg;
|
||||
smfiDesc_ptr smfi;
|
||||
time_t timeout;
|
||||
int backlog;
|
||||
{
|
||||
int connfd = -1;
|
||||
int listenfd = -1;
|
||||
socket_t connfd = INVALID_SOCKET;
|
||||
int sockopt = 1;
|
||||
int r;
|
||||
int ret = MI_SUCCESS;
|
||||
@ -453,8 +475,8 @@ mi_listener(conn, dbg, smfi, timeout)
|
||||
smi_log(SMI_LOG_DEBUG,
|
||||
"%s: Opening listen socket on conn %s",
|
||||
smfi->xxfi_name, conn);
|
||||
if ((listenfd = mi_milteropen(conn, SOMAXCONN, &socksize,
|
||||
smfi->xxfi_name)) < 0)
|
||||
listenfd = mi_milteropen(conn, backlog, &socksize, smfi->xxfi_name);
|
||||
if (!ValidSocket(listenfd))
|
||||
{
|
||||
smi_log(SMI_LOG_FATAL,
|
||||
"%s: Unable to create listening socket on conn %s",
|
||||
@ -498,7 +520,7 @@ mi_listener(conn, dbg, smfi, timeout)
|
||||
connfd = accept(listenfd, (struct sockaddr *) &cliaddr,
|
||||
&clilen);
|
||||
|
||||
if (connfd < 0)
|
||||
if (!ValidSocket(connfd))
|
||||
{
|
||||
smi_log(SMI_LOG_ERR,
|
||||
"%s: accept() returned invalid socket",
|
||||
|
@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: main.c,v 8.34.4.5 2000/07/14 06:16:57 msk Exp $";
|
||||
static char id[] = "@(#)$Id: main.c,v 8.34.4.9 2000/09/09 02:23:03 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#if _FFR_MILTER
|
||||
@ -43,7 +43,7 @@ smfi_register(smfilter)
|
||||
if (smfi == NULL)
|
||||
return MI_FAILURE;
|
||||
}
|
||||
(void)memcpy(smfi, &smfilter, sizeof *smfi);
|
||||
(void) memcpy(smfi, &smfilter, sizeof *smfi);
|
||||
if (smfilter.xxfi_name == NULL)
|
||||
smfilter.xxfi_name = "Unknown";
|
||||
|
||||
@ -67,9 +67,27 @@ smfi_register(smfilter)
|
||||
return MI_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
** SMFI_STOP -- stop milter
|
||||
**
|
||||
** Parameters:
|
||||
** none.
|
||||
**
|
||||
** Returns:
|
||||
** success.
|
||||
*/
|
||||
|
||||
int
|
||||
smfi_stop()
|
||||
{
|
||||
mi_stop_milters(MILTER_STOP);
|
||||
return MI_SUCCESS;
|
||||
}
|
||||
|
||||
static int dbg = 0;
|
||||
static char *conn = NULL;
|
||||
static int timeout = MI_TIMEOUT;
|
||||
static int backlog= MI_SOMAXCONN;
|
||||
|
||||
int
|
||||
smfi_setdbg(odbg)
|
||||
@ -103,6 +121,16 @@ smfi_setconn(oconn)
|
||||
return MI_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
smfi_setbacklog(obacklog)
|
||||
int obacklog;
|
||||
{
|
||||
if (obacklog <= 0)
|
||||
return MI_FAILURE;
|
||||
backlog = obacklog;
|
||||
return MI_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
smfi_main()
|
||||
{
|
||||
@ -124,7 +152,7 @@ smfi_main()
|
||||
}
|
||||
|
||||
/* Startup the listener */
|
||||
if (mi_listener(conn, dbg, smfi, timeout) != MI_SUCCESS)
|
||||
if (mi_listener(conn, dbg, smfi, timeout, backlog) != MI_SUCCESS)
|
||||
return MI_FAILURE;
|
||||
|
||||
return MI_SUCCESS;
|
||||
|
@ -9,21 +9,21 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: signal.c,v 8.10.4.4 2000/07/14 06:16:57 msk Exp $";
|
||||
static char id[] = "@(#)$Id: signal.c,v 8.10.4.7 2000/09/01 00:49:04 ca Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#if _FFR_MILTER
|
||||
#include "libmilter.h"
|
||||
|
||||
typedef pthread_mutex_t smutex_t;
|
||||
#define smutex_init(mp) (pthread_mutex_init(mp, NULL) == 0)
|
||||
#define smutex_destroy(mp) (pthread_mutex_destroy(mp) == 0)
|
||||
#define smutex_lock(mp) (pthread_mutex_lock(mp) == 0)
|
||||
#define smutex_unlock(mp) (pthread_mutex_unlock(mp) == 0)
|
||||
#define smutex_trylock(mp) (pthread_mutex_trylock(mp) == 0)
|
||||
# define smutex_init(mp) (pthread_mutex_init(mp, NULL) == 0)
|
||||
# define smutex_destroy(mp) (pthread_mutex_destroy(mp) == 0)
|
||||
# define smutex_lock(mp) (pthread_mutex_lock(mp) == 0)
|
||||
# define smutex_unlock(mp) (pthread_mutex_unlock(mp) == 0)
|
||||
# define smutex_trylock(mp) (pthread_mutex_trylock(mp) == 0)
|
||||
|
||||
/*
|
||||
** thread to handle signals
|
||||
** thread to handle signals
|
||||
*/
|
||||
|
||||
static smutex_t M_Mutex;
|
||||
@ -62,6 +62,9 @@ mi_stop_milters(v)
|
||||
(void) smutex_lock(&M_Mutex);
|
||||
if (MilterStop < v)
|
||||
MilterStop = v;
|
||||
|
||||
/* close listen socket */
|
||||
mi_closener();
|
||||
(void) smutex_unlock(&M_Mutex);
|
||||
}
|
||||
/*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999 Sendmail, Inc. and its suppliers.
|
||||
* Copyright (c) 1999-2000 Sendmail, Inc. and its suppliers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: sm_gethost.c,v 8.7 2000/01/20 21:51:52 geir Exp $";
|
||||
static char id[] = "@(#)$Id: sm_gethost.c,v 8.7.8.2 2000/09/17 17:04:24 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#if _FFR_MILTER
|
||||
@ -39,7 +39,7 @@ static char id[] = "@(#)$Id: sm_gethost.c,v 8.7 2000/01/20 21:51:52 geir Exp $";
|
||||
# endif /* ! AI_ALL */
|
||||
|
||||
static struct hostent *
|
||||
mi_getipnodebyname(name, family, flags, err)
|
||||
getipnodebyname(name, family, flags, err)
|
||||
char *name;
|
||||
int family;
|
||||
int flags;
|
||||
@ -87,7 +87,7 @@ mi_gethostbyname(name, family)
|
||||
# endif /* NETINET6 */
|
||||
|
||||
# if NETINET6
|
||||
h = mi_getipnodebyname(name, family, AI_V4MAPPED|AI_ALL, &err);
|
||||
h = getipnodebyname(name, family, AI_V4MAPPED|AI_ALL, &err);
|
||||
h_errno = err;
|
||||
# else /* NETINET6 */
|
||||
h = gethostbyname(name);
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: smdb.c,v 8.37.4.1 2000/05/25 18:56:09 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: smdb.c,v 8.37.4.2 2000/08/24 17:08:00 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <fcntl.h>
|
||||
@ -62,6 +62,107 @@ smdb_free_database(database)
|
||||
free(database);
|
||||
}
|
||||
|
||||
/*
|
||||
** SMDB_LOCKFILE -- lock a file using flock or (shudder) fcntl locking
|
||||
**
|
||||
** Parameters:
|
||||
** fd -- the file descriptor of the file.
|
||||
** type -- type of the lock. Bits can be:
|
||||
** LOCK_EX -- exclusive lock.
|
||||
** LOCK_NB -- non-blocking.
|
||||
**
|
||||
** Returns:
|
||||
** TRUE if the lock was acquired.
|
||||
** FALSE otherwise.
|
||||
*/
|
||||
|
||||
static bool
|
||||
smdb_lockfile(fd, type)
|
||||
int fd;
|
||||
int type;
|
||||
{
|
||||
int i;
|
||||
int save_errno;
|
||||
#if !HASFLOCK
|
||||
int action;
|
||||
struct flock lfd;
|
||||
|
||||
memset(&lfd, '\0', sizeof lfd);
|
||||
if (bitset(LOCK_UN, type))
|
||||
lfd.l_type = F_UNLCK;
|
||||
else if (bitset(LOCK_EX, type))
|
||||
lfd.l_type = F_WRLCK;
|
||||
else
|
||||
lfd.l_type = F_RDLCK;
|
||||
|
||||
if (bitset(LOCK_NB, type))
|
||||
action = F_SETLK;
|
||||
else
|
||||
action = F_SETLKW;
|
||||
|
||||
while ((i = fcntl(fd, action, &lfd)) < 0 && errno == EINTR)
|
||||
continue;
|
||||
if (i >= 0)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
save_errno = errno;
|
||||
|
||||
/*
|
||||
** On SunOS, if you are testing using -oQ/tmp/mqueue or
|
||||
** -oA/tmp/aliases or anything like that, and /tmp is mounted
|
||||
** as type "tmp" (that is, served from swap space), the
|
||||
** previous fcntl will fail with "Invalid argument" errors.
|
||||
** Since this is fairly common during testing, we will assume
|
||||
** that this indicates that the lock is successfully grabbed.
|
||||
*/
|
||||
|
||||
if (save_errno == EINVAL)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (!bitset(LOCK_NB, type) ||
|
||||
(save_errno != EACCES && save_errno != EAGAIN))
|
||||
{
|
||||
int omode = -1;
|
||||
# ifdef F_GETFL
|
||||
(void) fcntl(fd, F_GETFL, &omode);
|
||||
errno = save_errno;
|
||||
# endif /* F_GETFL */
|
||||
# if 0
|
||||
syslog(LOG_ERR, "cannot lockf(%s%s, fd=%d, type=%o, omode=%o, euid=%d)",
|
||||
filename, ext, fd, type, omode, geteuid());
|
||||
# endif /* 0 */
|
||||
return FALSE;
|
||||
}
|
||||
#else /* !HASFLOCK */
|
||||
|
||||
while ((i = flock(fd, type)) < 0 && errno == EINTR)
|
||||
continue;
|
||||
if (i >= 0)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
save_errno = errno;
|
||||
|
||||
if (!bitset(LOCK_NB, type) || save_errno != EWOULDBLOCK)
|
||||
{
|
||||
int omode = -1;
|
||||
# ifdef F_GETFL
|
||||
(void) fcntl(fd, F_GETFL, &omode);
|
||||
errno = save_errno;
|
||||
# endif /* F_GETFL */
|
||||
# if 0
|
||||
syslog(LOG_ERR, "cannot flock(%s%s, fd=%d, type=%o, omode=%o, euid=%d)",
|
||||
filename, ext, fd, type, omode, geteuid());
|
||||
# endif /* 0 */
|
||||
return FALSE;
|
||||
}
|
||||
#endif /* !HASFLOCK */
|
||||
errno = save_errno;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
** SMDB_OPEN_DATABASE -- Opens a database.
|
||||
@ -267,6 +368,59 @@ smdb_unlock_file(lock_fd)
|
||||
return SMDBE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** SMDB_LOCK_MAP -- Locks a database.
|
||||
**
|
||||
** Parameters:
|
||||
** database -- database description.
|
||||
** type -- type of the lock. Bits can be:
|
||||
** LOCK_EX -- exclusive lock.
|
||||
** LOCK_NB -- non-blocking.
|
||||
**
|
||||
** Returns:
|
||||
** SMDBE_OK -- Success, otherwise errno.
|
||||
*/
|
||||
|
||||
int
|
||||
smdb_lock_map(database, type)
|
||||
SMDB_DATABASE *database;
|
||||
int type;
|
||||
{
|
||||
int fd;
|
||||
|
||||
fd = database->smdb_lockfd(database);
|
||||
if (fd < 0)
|
||||
return SMDBE_NOT_FOUND;
|
||||
if (!smdb_lockfile(fd, type))
|
||||
return SMDBE_LOCK_NOT_GRANTED;
|
||||
return SMDBE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** SMDB_UNLOCK_MAP -- Unlocks a database
|
||||
**
|
||||
** Parameters:
|
||||
** database -- database description.
|
||||
**
|
||||
** Returns:
|
||||
** SMDBE_OK -- Success, otherwise errno.
|
||||
*/
|
||||
|
||||
int
|
||||
smdb_unlock_map(database)
|
||||
SMDB_DATABASE *database;
|
||||
{
|
||||
int fd;
|
||||
|
||||
fd = database->smdb_lockfd(database);
|
||||
if (fd < 0)
|
||||
return SMDBE_NOT_FOUND;
|
||||
if (!smdb_lockfile(fd, LOCK_UN))
|
||||
return SMDBE_LOCK_NOT_HELD;
|
||||
return SMDBE_OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** SMDB_SETUP_FILE -- Gets db file ready for use.
|
||||
**
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: smdb1.c,v 8.43 2000/03/17 07:32:43 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: smdb1.c,v 8.43.4.1 2000/08/24 17:08:00 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <unistd.h>
|
||||
@ -193,6 +193,16 @@ smdb1_fd(database, fd)
|
||||
return SMDBE_OK;
|
||||
}
|
||||
|
||||
int
|
||||
smdb1_lockfd(database)
|
||||
SMDB_DATABASE *database;
|
||||
{
|
||||
SMDB_DB1_DATABASE *db1 = (SMDB_DB1_DATABASE *) database->smdb_impl;
|
||||
|
||||
return db1->smdb1_lock_fd;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
smdb1_get(database, key, data, flags)
|
||||
SMDB_DATABASE *database;
|
||||
@ -482,6 +492,7 @@ smdb_db_open(database, db_name, mode, mode_mask, sff, type, user_info,
|
||||
smdb_db->smdb_close = smdb1_close;
|
||||
smdb_db->smdb_del = smdb1_del;
|
||||
smdb_db->smdb_fd = smdb1_fd;
|
||||
smdb_db->smdb_lockfd = smdb1_lockfd;
|
||||
smdb_db->smdb_get = smdb1_get;
|
||||
smdb_db->smdb_put = smdb1_put;
|
||||
smdb_db->smdb_set_owner = smdb1_set_owner;
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: smdb2.c,v 8.53.2.1.2.1 2000/05/25 18:56:10 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: smdb2.c,v 8.53.2.1.2.2 2000/08/24 17:08:00 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <fcntl.h>
|
||||
@ -264,6 +264,16 @@ smdb2_fd(database, fd)
|
||||
return db2_error_to_smdb(db->fd(db, fd));
|
||||
}
|
||||
|
||||
int
|
||||
smdb2_lockfd(database)
|
||||
SMDB_DATABASE *database;
|
||||
{
|
||||
SMDB_DB2_DATABASE *db2 = (SMDB_DB2_DATABASE *) database->smdb_impl;
|
||||
|
||||
return db2->smdb2_lock_fd;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
smdb2_get(database, key, data, flags)
|
||||
SMDB_DATABASE *database;
|
||||
@ -621,6 +631,7 @@ smdb_db_open(database, db_name, mode, mode_mask, sff, type, user_info, db_params
|
||||
smdb_db->smdb_close = smdb2_close;
|
||||
smdb_db->smdb_del = smdb2_del;
|
||||
smdb_db->smdb_fd = smdb2_fd;
|
||||
smdb_db->smdb_lockfd = smdb2_lockfd;
|
||||
smdb_db->smdb_get = smdb2_get;
|
||||
smdb_db->smdb_put = smdb2_put;
|
||||
smdb_db->smdb_set_owner = smdb2_set_owner;
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: smndbm.c,v 8.40 2000/03/19 05:03:30 ca Exp $";
|
||||
static char id[] = "@(#)$Id: smndbm.c,v 8.40.4.1 2000/08/24 17:08:00 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <fcntl.h>
|
||||
@ -156,6 +156,15 @@ smdbm_fd(database, fd)
|
||||
return SMDBE_OK;
|
||||
}
|
||||
|
||||
int
|
||||
smdbm_lockfd(database)
|
||||
SMDB_DATABASE *database;
|
||||
{
|
||||
SMDB_DBM_DATABASE *db = (SMDB_DBM_DATABASE *) database->smdb_impl;
|
||||
|
||||
return db->smndbm_lock_fd;
|
||||
}
|
||||
|
||||
int
|
||||
smdbm_get(database, key, data, flags)
|
||||
SMDB_DATABASE *database;
|
||||
@ -555,6 +564,7 @@ smdb_ndbm_open(database, db_name, mode, mode_mask, sff, type, user_info,
|
||||
smdb_db->smdb_close = smdbm_close;
|
||||
smdb_db->smdb_del = smdbm_del;
|
||||
smdb_db->smdb_fd = smdbm_fd;
|
||||
smdb_db->smdb_lockfd = smdbm_lockfd;
|
||||
smdb_db->smdb_get = smdbm_get;
|
||||
smdb_db->smdb_put = smdbm_put;
|
||||
smdb_db->smdb_set_owner = smndbm_set_owner;
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: safefile.c,v 8.81.4.5 2000/07/17 22:33:37 ca Exp $";
|
||||
static char id[] = "@(#)$Id: safefile.c,v 8.81.4.7 2000/09/01 21:09:23 ca Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <sendmail.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
|
||||
* Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 1997 Eric P. Allman. All rights reserved.
|
||||
* Copyright (c) 1988, 1993
|
||||
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: snprintf.c,v 8.27.16.1 2000/07/15 17:35:18 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: snprintf.c,v 8.27.16.2 2000/09/17 17:04:24 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <sendmail.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999 Sendmail, Inc. and its suppliers.
|
||||
* Copyright (c) 1999-2000 Sendmail, Inc. and its suppliers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: strl.c,v 8.5.14.1 2000/05/12 20:46:17 ca Exp $";
|
||||
static char id[] = "@(#)$Id: strl.c,v 8.5.14.2 2000/09/17 17:04:24 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <sendmail.h>
|
||||
|
@ -1,10 +1,14 @@
|
||||
include(confBUILDTOOLSDIR`/M4/switch.m4')
|
||||
|
||||
# sendmail dir
|
||||
SMSRCDIR= ifdef(`confSMSRCDIR', `confSMSRCDIR', `${SRCDIR}/sendmail')
|
||||
PREPENDDEF(`confENVDEF', `confMAPDEF')
|
||||
PREPENDDEF(`confINCDIRS', `-I${SMSRCDIR} ')
|
||||
|
||||
bldPRODUCT_START(`executable', `mail.local')
|
||||
define(`bldNO_INSTALL')
|
||||
define(`bldSOURCES', `mail.local.c ')
|
||||
bldPUSH_SMLIB(`smutil')
|
||||
PREPENDDEF(`confENVDEF', `confMAPDEF')
|
||||
bldPRODUCT_END
|
||||
|
||||
bldPRODUCT_START(`manpage', `mail.local')
|
||||
@ -25,5 +29,3 @@ install-mail.local: mail.local
|
||||
divert
|
||||
|
||||
bldFINISH
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
|
||||
.\" Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
|
||||
.\" All rights reserved.
|
||||
.\" Copyright (c) 1988, 1991, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
@ -8,7 +8,7 @@
|
||||
.\" the sendmail distribution.
|
||||
.\"
|
||||
.\"
|
||||
.\" $Id: makemap.8,v 8.21.16.1 2000/05/10 20:31:35 ca Exp $
|
||||
.\" $Id: makemap.8,v 8.21.16.2 2000/09/17 17:04:26 gshapiro Exp $
|
||||
.\"
|
||||
.TH MAKEMAP 8 "November 16, 1992"
|
||||
.SH NAME
|
||||
|
@ -1,6 +1,9 @@
|
||||
include(confBUILDTOOLSDIR`/M4/switch.m4')
|
||||
|
||||
# sendmail dir
|
||||
SMSRCDIR= ifdef(`confSMSRCDIR', `confSMSRCDIR', `${SRCDIR}/sendmail')
|
||||
PREPENDDEF(`confENVDEF', `confMAPDEF')
|
||||
PREPENDDEF(`confINCDIRS', `-I${SMSRCDIR} ')
|
||||
|
||||
bldPRODUCT_START(`executable', `rmail')
|
||||
define(`bldNO_INSTALL')
|
||||
|
@ -37,11 +37,11 @@ ifdef(`confNO_HELPFILE_INSTALL',, `bldPUSH_INSTALL_TARGET(`install-hf')')
|
||||
ifdef(`confNO_STATISTICS_INSTALL',, `bldPUSH_INSTALL_TARGET(`install-st')')
|
||||
divert(bldTARGETS_SECTION)
|
||||
install-hf:
|
||||
if [ ! -d ${DESTDIR}${HFDIR} ]; then mkdir -p ${DESTDIR}${HFDIR}; fi
|
||||
if [ ! -d ${DESTDIR}${HFDIR} ]; then mkdir -p ${DESTDIR}${HFDIR}; else :; fi
|
||||
${INSTALL} -c -o ${UBINOWN} -g ${UBINGRP} -m 444 helpfile ${DESTDIR}${HFFILE}
|
||||
|
||||
install-st: statistics
|
||||
if [ ! -d ${DESTDIR}${STDIR} ]; then mkdir -p ${DESTDIR}${STDIR}; fi
|
||||
if [ ! -d ${DESTDIR}${STDIR} ]; then mkdir -p ${DESTDIR}${STDIR}; else :; fi
|
||||
${INSTALL} -c -o ${SBINOWN} -g ${UBINGRP} -m 644 statistics ${DESTDIR}${STFILE}
|
||||
divert(0)
|
||||
bldPRODUCT_END
|
||||
|
@ -9,7 +9,7 @@
|
||||
# the sendmail distribution.
|
||||
#
|
||||
#
|
||||
# $Id: README,v 8.263.2.1.2.19 2000/07/15 17:35:18 gshapiro Exp $
|
||||
# $Id: README,v 8.263.2.1.2.21 2000/09/27 16:36:26 ca Exp $
|
||||
#
|
||||
|
||||
This directory contains the source files for sendmail(TM).
|
||||
@ -580,6 +580,8 @@ EGD Define this if your system has EGD installed, see
|
||||
seed the PRNG for STARTTLS if HASURANDOMDEV is not defined.
|
||||
STARTTLS Enables SMTP STARTTLS (RFC 2487). This requires OpenSSL
|
||||
(http://www.OpenSSL.org/) and sfio (see below).
|
||||
Use OpenSSL 0.9.5a or later (if compatible with this
|
||||
version), do not use 0.9.3.
|
||||
See STARTTLS COMPILATION AND CONFIGURATION for further
|
||||
information.
|
||||
TLS_NO_RSA Turn off support for RSA algorithms in STARTTLS.
|
||||
@ -1236,7 +1238,7 @@ AIX 4.3.3
|
||||
Date: Sun, 02 Jul 2000 03:58:02 -0400
|
||||
|
||||
Under AIX 4.3.3, after applying bos.adt.include 4.3.3.12 to close the
|
||||
BIND 8.2.2 security holes, you can no lonber build with -DNETINET6
|
||||
BIND 8.2.2 security holes, you can no longer build with -DNETINET6
|
||||
because they changed the value of __RES in resolv.h but failed to
|
||||
actually provide the API changes that the change implied.
|
||||
|
||||
@ -1465,6 +1467,8 @@ OpenSSL
|
||||
OpenSSL versions prior to 0.9.6 use a macro named Free which
|
||||
conflicts with existing macro names on some platforms, such as
|
||||
AIX.
|
||||
Do not use 0.9.3, but OpenSSL 0.9.5a or later if compatible with
|
||||
0.9.5a.
|
||||
|
||||
PH
|
||||
PH support is provided by Mark Roth <roth@uiuc.edu>. The map is
|
||||
@ -1619,4 +1623,4 @@ util.c Some general purpose routines used by sendmail.
|
||||
version.c The version number and information about this
|
||||
version of sendmail.
|
||||
|
||||
(Version $Revision: 8.263.2.1.2.19 $, last update $Date: 2000/07/15 17:35:18 $ )
|
||||
(Version $Revision: 8.263.2.1.2.21 $, last update $Date: 2000/09/27 16:36:26 $ )
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <sendmail.h>
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: alias.c,v 8.142.4.1 2000/05/25 18:56:12 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: alias.c,v 8.142.4.3 2000/09/21 21:52:16 ca Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
# define SEPARATOR ':'
|
||||
@ -837,11 +837,11 @@ readaliases(map, af, announcestats, logstats)
|
||||
CurEnv->e_to = NULL;
|
||||
FileName = NULL;
|
||||
if (Verbose || announcestats)
|
||||
message("%s: %d aliases, longest %d bytes, %d bytes total",
|
||||
message("%s: %ld aliases, longest %ld bytes, %ld bytes total",
|
||||
map->map_file, naliases, longest, bytes);
|
||||
if (LogLevel > 7 && logstats)
|
||||
sm_syslog(LOG_INFO, NOQID,
|
||||
"%s: %d aliases, longest %d bytes, %d bytes total",
|
||||
"%s: %ld aliases, longest %ld bytes, %ld bytes total",
|
||||
map->map_file, naliases, longest, bytes);
|
||||
}
|
||||
/*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999 Sendmail, Inc. and its suppliers.
|
||||
* Copyright (c) 1999-2000 Sendmail, Inc. and its suppliers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: bf_torek.c,v 8.19.18.1 2000/07/18 16:52:26 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: bf_torek.c,v 8.19.18.2 2000/09/17 17:04:26 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#if SFIO
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
|
||||
* Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
|
||||
* Copyright (c) 1988, 1993
|
||||
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: clock.c,v 8.52.18.2 2000/05/25 23:33:30 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: clock.c,v 8.52.18.3 2000/09/17 17:04:26 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <sendmail.h>
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: collect.c,v 8.136.4.3 2000/06/22 22:13:45 geir Exp $";
|
||||
static char id[] = "@(#)$Id: collect.c,v 8.136.4.6 2000/09/21 21:52:16 ca Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <sendmail.h>
|
||||
@ -195,9 +195,14 @@ collect(fp, smtpmode, hdrp, e)
|
||||
{
|
||||
errno = 0;
|
||||
c = getc(fp);
|
||||
if (errno != EINTR)
|
||||
break;
|
||||
clearerr(fp);
|
||||
|
||||
if (c == EOF && errno == EINTR)
|
||||
{
|
||||
/* Interrupted, retry */
|
||||
clearerr(fp);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
CollectProgress = TRUE;
|
||||
if (TrafficLogFile != NULL && !headeronly)
|
||||
@ -286,13 +291,22 @@ collect(fp, smtpmode, hdrp, e)
|
||||
|
||||
bufferchar:
|
||||
if (!headeronly)
|
||||
e->e_msgsize++;
|
||||
{
|
||||
/* no overflow? */
|
||||
if (e->e_msgsize >= 0)
|
||||
{
|
||||
e->e_msgsize++;
|
||||
if (MaxMessageSize > 0 &&
|
||||
!bitset(EF_TOOBIG, e->e_flags) &&
|
||||
e->e_msgsize > MaxMessageSize)
|
||||
e->e_flags |= EF_TOOBIG;
|
||||
}
|
||||
}
|
||||
switch (mstate)
|
||||
{
|
||||
case MS_BODY:
|
||||
/* just put the character out */
|
||||
if (MaxMessageSize <= 0 ||
|
||||
e->e_msgsize <= MaxMessageSize)
|
||||
if (!bitset(EF_TOOBIG, e->e_flags))
|
||||
(void) putc(c, df);
|
||||
|
||||
/* FALLTHROUGH */
|
||||
@ -384,7 +398,7 @@ collect(fp, smtpmode, hdrp, e)
|
||||
clearerr(fp);
|
||||
errno = 0;
|
||||
c = getc(fp);
|
||||
} while (errno == EINTR);
|
||||
} while (c == EOF && errno == EINTR);
|
||||
if (c != EOF)
|
||||
(void) ungetc(c, fp);
|
||||
if (c == ' ' || c == '\t')
|
||||
@ -436,8 +450,7 @@ collect(fp, smtpmode, hdrp, e)
|
||||
}
|
||||
|
||||
/* if not a blank separator, write it out */
|
||||
if (MaxMessageSize <= 0 ||
|
||||
e->e_msgsize <= MaxMessageSize)
|
||||
if (!bitset(EF_TOOBIG, e->e_flags))
|
||||
{
|
||||
while (*bp != '\0')
|
||||
(void) putc(*bp++, df);
|
||||
@ -504,7 +517,7 @@ collect(fp, smtpmode, hdrp, e)
|
||||
st.st_size = -1;
|
||||
errno = EEXIST;
|
||||
syserr("collect: bfcommit(%s): already on disk, size = %ld",
|
||||
dfile, st.st_size);
|
||||
dfile, (long) st.st_size);
|
||||
dfd = fileno(df);
|
||||
if (dfd >= 0)
|
||||
dumpfd(dfd, TRUE, TRUE);
|
||||
@ -650,7 +663,7 @@ collect(fp, smtpmode, hdrp, e)
|
||||
}
|
||||
|
||||
/* check for message too large */
|
||||
if (MaxMessageSize > 0 && e->e_msgsize > MaxMessageSize)
|
||||
if (bitset(EF_TOOBIG, e->e_flags))
|
||||
{
|
||||
e->e_flags |= EF_NO_BODY_RETN|EF_CLRQUEUE;
|
||||
e->e_status = "5.2.3";
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
|
||||
* Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: control.c,v 8.44.14.7 2000/07/03 21:49:05 geir Exp $";
|
||||
static char id[] = "@(#)$Id: control.c,v 8.44.14.8 2000/09/17 17:04:26 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <sendmail.h>
|
||||
|
@ -16,9 +16,9 @@
|
||||
|
||||
#ifndef lint
|
||||
# ifdef DAEMON
|
||||
static char id[] = "@(#)$Id: daemon.c,v 8.401.4.14 2000/07/14 04:15:00 gshapiro Exp $ (with daemon mode)";
|
||||
static char id[] = "@(#)$Id: daemon.c,v 8.401.4.18 2000/09/21 21:52:16 ca Exp $ (with daemon mode)";
|
||||
# else /* DAEMON */
|
||||
static char id[] = "@(#)$Id: daemon.c,v 8.401.4.14 2000/07/14 04:15:00 gshapiro Exp $ (without daemon mode)";
|
||||
static char id[] = "@(#)$Id: daemon.c,v 8.401.4.18 2000/09/21 21:52:16 ca Exp $ (without daemon mode)";
|
||||
# endif /* DAEMON */
|
||||
#endif /* ! lint */
|
||||
|
||||
@ -39,6 +39,10 @@ static char id[] = "@(#)$Id: daemon.c,v 8.401.4.14 2000/07/14 04:15:00 gshapiro
|
||||
|
||||
#if DAEMON
|
||||
|
||||
# if STARTTLS
|
||||
# include <openssl/rand.h>
|
||||
# endif /* STARTTLS */
|
||||
|
||||
# include <sys/time.h>
|
||||
|
||||
# if IP_SRCROUTE && NETINET
|
||||
@ -221,6 +225,10 @@ getrequests(e)
|
||||
bool control = FALSE;
|
||||
int save_errno;
|
||||
int pipefd[2];
|
||||
# if STARTTLS
|
||||
long seed;
|
||||
time_t timenow;
|
||||
# endif /* STARTTLS */
|
||||
|
||||
/* see if we are rejecting connections */
|
||||
(void) blocksignal(SIGALRM);
|
||||
@ -264,10 +272,10 @@ getrequests(e)
|
||||
/* log only if not logged before */
|
||||
if (LogLevel >= 9)
|
||||
sm_syslog(LOG_INFO, NOQID,
|
||||
"rejecting new messages: min free: %d",
|
||||
"rejecting new messages: min free: %ld",
|
||||
MinBlocksFree);
|
||||
sm_setproctitle(TRUE, e,
|
||||
"rejecting new messages: min free: %d",
|
||||
"rejecting new messages: min free: %ld",
|
||||
MinBlocksFree);
|
||||
setbitn(D_ETRNONLY, Daemons[idx].d_flags);
|
||||
}
|
||||
@ -509,7 +517,16 @@ getrequests(e)
|
||||
** of a queue directory (and other things, e.g., MX selection)
|
||||
** are not "really" random.
|
||||
*/
|
||||
# if STARTTLS
|
||||
seed = get_random();
|
||||
RAND_seed((void *) &last_disk_space_check,
|
||||
sizeof last_disk_space_check);
|
||||
timenow = curtime();
|
||||
RAND_seed((void *) &timenow, sizeof timenow);
|
||||
RAND_seed((void *) &seed, sizeof seed);
|
||||
# else /* STARTTLS */
|
||||
(void) get_random();
|
||||
# endif /* STARTTLS */
|
||||
|
||||
/*
|
||||
** Create a pipe to keep the child from writing to the
|
||||
@ -1252,7 +1269,7 @@ setsockaddroptions(p, d)
|
||||
if (!(isascii(*h) && isspace(*h)))
|
||||
{
|
||||
if (flags != d->d_mflags)
|
||||
*f++ = ' ';
|
||||
*flags++ = ' ';
|
||||
*flags++ = *h;
|
||||
if (isupper(*h))
|
||||
*flags++ = *h;
|
||||
@ -2399,7 +2416,7 @@ getauthinfo(fd, may_be_forged)
|
||||
int fd;
|
||||
bool *may_be_forged;
|
||||
{
|
||||
u_short port = 0;
|
||||
volatile u_short port = 0;
|
||||
SOCKADDR_LEN_T falen;
|
||||
register char *volatile p = NULL;
|
||||
SOCKADDR la;
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: deliver.c,v 8.600.2.1.2.31 2000/07/18 02:24:43 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: deliver.c,v 8.600.2.1.2.44 2000/09/21 21:52:17 ca Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <sendmail.h>
|
||||
@ -484,10 +484,16 @@ sendall(e, mode)
|
||||
(mode != SM_VERIFY && SuperSafe)) &&
|
||||
(!bitset(EF_INQUEUE, e->e_flags) || splitenv != NULL))
|
||||
{
|
||||
/* be sure everything is instantiated in the queue */
|
||||
queueup(e, mode == SM_QUEUE || mode == SM_DEFER);
|
||||
/*
|
||||
** Be sure everything is instantiated in the queue.
|
||||
** Split envelopes first in case the machine crashes.
|
||||
** If the original were done first, we may lose
|
||||
** recipients.
|
||||
*/
|
||||
|
||||
for (ee = splitenv; ee != NULL; ee = ee->e_sibling)
|
||||
queueup(ee, mode == SM_QUEUE || mode == SM_DEFER);
|
||||
queueup(e, mode == SM_QUEUE || mode == SM_DEFER);
|
||||
}
|
||||
#endif /* QUEUE */
|
||||
|
||||
@ -627,6 +633,15 @@ sendall(e, mode)
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
** Since we have accepted responsbility for the message,
|
||||
** change the SIGTERM handler. intsig() (the old handler)
|
||||
** would remove the envelope if this was a command line
|
||||
** message submission.
|
||||
*/
|
||||
|
||||
(void) setsignal(SIGTERM, SIG_DFL);
|
||||
|
||||
/* double fork to avoid zombies */
|
||||
pid = fork();
|
||||
if (pid > 0)
|
||||
@ -787,7 +802,8 @@ sendenvelope(e, mode)
|
||||
** Checkpoint the send list every few addresses
|
||||
*/
|
||||
|
||||
if (e->e_nsent >= CheckpointInterval)
|
||||
if (CheckpointInterval > 0 &&
|
||||
e->e_nsent >= CheckpointInterval)
|
||||
{
|
||||
queueup(e, FALSE);
|
||||
e->e_nsent = 0;
|
||||
@ -1196,9 +1212,11 @@ deliver(e, firstto)
|
||||
/*
|
||||
** Check to see that these people are allowed to
|
||||
** talk to each other.
|
||||
** Check also for overflow of e_msgsize.
|
||||
*/
|
||||
|
||||
if (m->m_maxsize != 0 && e->e_msgsize > m->m_maxsize)
|
||||
if (m->m_maxsize != 0 &&
|
||||
(e->e_msgsize > m->m_maxsize || e->e_msgsize < 0))
|
||||
{
|
||||
e->e_flags |= EF_NO_BODY_RETN;
|
||||
if (bitnset(M_LOCALMAILER, to->q_mailer->m_flags))
|
||||
@ -2254,10 +2272,30 @@ deliver(e, firstto)
|
||||
bool usetls;
|
||||
bool saveQuickAbort = QuickAbort;
|
||||
bool saveSuprErrs = SuprErrs;
|
||||
# if _FFR_TLS_CLT1
|
||||
char *p;
|
||||
# endif /* _FFR_TLS_CLT1 */
|
||||
extern SOCKADDR CurHostAddr;
|
||||
|
||||
rcode = EX_OK;
|
||||
usetls = bitset(MCIF_TLS, mci->mci_flags);
|
||||
# if _FFR_TLS_CLT1
|
||||
if (usetls &&
|
||||
(p = macvalue(macid("{client_flags}", NULL), e))
|
||||
!= NULL)
|
||||
{
|
||||
for (; *p != '\0'; p++)
|
||||
{
|
||||
/* look for just this one flag */
|
||||
if (*p == D_CLTNOTLS)
|
||||
{
|
||||
usetls = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
# endif /* _FFR_TLS_CLT1 */
|
||||
|
||||
hasdot = CurHostName[strlen(CurHostName) - 1] == '.';
|
||||
if (hasdot)
|
||||
CurHostName[strlen(CurHostName) - 1] = '\0';
|
||||
@ -2667,20 +2705,23 @@ deliver(e, firstto)
|
||||
rcode = smtpgetstat(m, mci, e);
|
||||
if (rcode == EX_OK)
|
||||
{
|
||||
#if !_FFR_DYNAMIC_TOBUF
|
||||
#if _FFR_DYNAMIC_TOBUF
|
||||
(void) strlcat(tobuf, ",", tobufsize);
|
||||
(void) strlcat(tobuf, to->q_paddr, tobufsize);
|
||||
#else /* _FFR_DYNAMIC_TOBUF */
|
||||
if (strlen(to->q_paddr) +
|
||||
strlen(tobuf) + 2 > sizeof tobuf)
|
||||
{
|
||||
syserr("LMTP tobuf overflow");
|
||||
}
|
||||
else
|
||||
#endif /* !_FFR_DYNAMIC_TOBUF */
|
||||
{
|
||||
(void) strlcat(tobuf, ",",
|
||||
sizeof tobuf);
|
||||
(void) strlcat(tobuf, to->q_paddr,
|
||||
sizeof tobuf);
|
||||
}
|
||||
#endif /* _FFR_DYNAMIC_TOBUF */
|
||||
anyok = TRUE;
|
||||
}
|
||||
else
|
||||
@ -2716,7 +2757,7 @@ deliver(e, firstto)
|
||||
** Checkpoint the send list every few addresses
|
||||
*/
|
||||
|
||||
if (e->e_nsent >= CheckpointInterval)
|
||||
if (CheckpointInterval > 0 && e->e_nsent >= CheckpointInterval)
|
||||
{
|
||||
queueup(e, FALSE);
|
||||
e->e_nsent = 0;
|
||||
@ -3012,9 +3053,9 @@ endmailer(mci, e, pv)
|
||||
endwaittimeout, 0);
|
||||
else
|
||||
{
|
||||
syserr("endmailer %s: wait timeout (%d)",
|
||||
syserr("endmailer %s: wait timeout (%ld)",
|
||||
mci->mci_mailer->m_name,
|
||||
mci->mci_mailer->m_wait);
|
||||
(long) mci->mci_mailer->m_wait);
|
||||
return EX_TEMPFAIL;
|
||||
}
|
||||
}
|
||||
@ -3454,7 +3495,7 @@ logdelivery(m, mci, dsn, status, ctladdr, xstart, e)
|
||||
|
||||
sm_syslog(LOG_INFO, e->e_id,
|
||||
"to=%.*s [more]%s",
|
||||
++q - p, p, buf);
|
||||
(int) (++q - p), p, buf);
|
||||
p = q;
|
||||
}
|
||||
#if _FFR_DYNAMIC_TOBUF
|
||||
@ -3487,7 +3528,7 @@ logdelivery(m, mci, dsn, status, ctladdr, xstart, e)
|
||||
|
||||
sm_syslog(LOG_INFO, e->e_id,
|
||||
"to=%.*s [more]",
|
||||
++q - p, p);
|
||||
(int) (++q - p), p);
|
||||
p = q;
|
||||
}
|
||||
#if _FFR_DYNAMIC_TOBUF
|
||||
@ -4997,9 +5038,12 @@ starttls(m, mci, e)
|
||||
ENVELOPE *e;
|
||||
{
|
||||
int smtpresult;
|
||||
int result;
|
||||
int result = 0;
|
||||
int rfd, wfd;
|
||||
SSL *clt_ssl = NULL;
|
||||
|
||||
if (clt_ctx == NULL && !initclttls())
|
||||
return EX_TEMPFAIL;
|
||||
smtpmessage("STARTTLS", m, mci);
|
||||
|
||||
/* get the reply */
|
||||
@ -5018,8 +5062,6 @@ starttls(m, mci, e)
|
||||
|
||||
if (LogLevel > 13)
|
||||
sm_syslog(LOG_INFO, e->e_id, "TLS: start client");
|
||||
if (clt_ctx == NULL && !initclttls())
|
||||
return EX_SOFTWARE;
|
||||
|
||||
/* start connection */
|
||||
if ((clt_ssl = SSL_new(clt_ctx)) == NULL)
|
||||
@ -5034,9 +5076,13 @@ starttls(m, mci, e)
|
||||
return EX_SOFTWARE;
|
||||
}
|
||||
|
||||
rfd = fileno(mci->mci_in);
|
||||
wfd = fileno(mci->mci_out);
|
||||
|
||||
/* SSL_clear(clt_ssl); ? */
|
||||
if ((result = SSL_set_rfd(clt_ssl, fileno(mci->mci_in))) != 1 ||
|
||||
(result = SSL_set_wfd(clt_ssl, fileno(mci->mci_out))) != 1)
|
||||
if (rfd < 0 || wfd < 0 ||
|
||||
(result = SSL_set_rfd(clt_ssl, rfd)) <= 0 ||
|
||||
(result = SSL_set_wfd(clt_ssl, wfd)) <= 0)
|
||||
{
|
||||
if (LogLevel > 5)
|
||||
{
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: envelope.c,v 8.180.14.3 2000/06/29 05:30:23 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: envelope.c,v 8.180.14.4 2000/08/22 18:22:39 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <sendmail.h>
|
||||
@ -811,7 +811,9 @@ setsender(from, e, delimptr, delimchar, internal)
|
||||
*/
|
||||
|
||||
/* extract home directory */
|
||||
if (strcmp(pw->pw_dir, "/") == 0)
|
||||
if (*pw->pw_dir == '\0')
|
||||
e->e_from.q_home = NULL;
|
||||
else if (strcmp(pw->pw_dir, "/") == 0)
|
||||
e->e_from.q_home = newstr("");
|
||||
else
|
||||
e->e_from.q_home = newstr(pw->pw_dir);
|
||||
@ -844,9 +846,13 @@ setsender(from, e, delimptr, delimchar, internal)
|
||||
if (e->e_from.q_home == NULL)
|
||||
{
|
||||
e->e_from.q_home = getenv("HOME");
|
||||
if (e->e_from.q_home != NULL &&
|
||||
strcmp(e->e_from.q_home, "/") == 0)
|
||||
e->e_from.q_home++;
|
||||
if (e->e_from.q_home != NULL)
|
||||
{
|
||||
if (*e->e_from.q_home == '\0')
|
||||
e->e_from.q_home = NULL;
|
||||
else if (strcmp(e->e_from.q_home, "/") == 0)
|
||||
e->e_from.q_home++;
|
||||
}
|
||||
}
|
||||
e->e_from.q_uid = RealUid;
|
||||
e->e_from.q_gid = RealGid;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#vers 2
|
||||
cpyr
|
||||
cpyr Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
|
||||
cpyr Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
|
||||
cpyr All rights reserved.
|
||||
cpyr Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
|
||||
cpyr Copyright (c) 1988, 1993
|
||||
@ -11,7 +11,7 @@ cpyr By using this file, you agree to the terms and conditions set
|
||||
cpyr forth in the LICENSE file which can be found at the top level of
|
||||
cpyr the sendmail distribution.
|
||||
cpyr
|
||||
cpyr $$Id: helpfile,v 8.31.16.3 2000/07/19 18:54:55 gshapiro Exp $$
|
||||
cpyr $$Id: helpfile,v 8.31.16.4 2000/09/17 14:21:00 ca Exp $$
|
||||
cpyr
|
||||
smtp This is sendmail version $v
|
||||
smtp Topics:
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
|
||||
* Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
|
||||
* Copyright (c) 1988, 1993
|
||||
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: macro.c,v 8.40.16.1 2000/05/25 18:56:15 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: macro.c,v 8.40.16.2 2000/09/17 17:04:26 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <sendmail.h>
|
||||
|
@ -21,7 +21,7 @@ static char copyright[] =
|
||||
#endif /* ! lint */
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: main.c,v 8.485.4.19 2000/06/29 01:31:02 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: main.c,v 8.485.4.27 2000/09/26 01:30:38 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#define _DEFINE
|
||||
@ -99,6 +99,7 @@ static sasl_callback_t srvcallbacks[] =
|
||||
{ SASL_CB_PROXY_POLICY, &proxy_policy, NULL },
|
||||
{ SASL_CB_LIST_END, NULL, NULL }
|
||||
};
|
||||
|
||||
#endif /* SASL */
|
||||
|
||||
int SubmitMode;
|
||||
@ -134,6 +135,9 @@ main(argc, argv, envp)
|
||||
char jbuf[MAXHOSTNAMELEN]; /* holds MyHostName */
|
||||
static char rnamebuf[MAXNAME]; /* holds RealUserName */
|
||||
char *emptyenviron[1];
|
||||
# if STARTTLS
|
||||
bool tls_ok;
|
||||
# endif /* STARTTLS */
|
||||
QUEUE_CHAR *new;
|
||||
extern int DtableSize;
|
||||
extern int optind;
|
||||
@ -308,7 +312,6 @@ main(argc, argv, envp)
|
||||
#endif /* LOG */
|
||||
}
|
||||
|
||||
|
||||
/* set up the blank envelope */
|
||||
BlankEnvelope.e_puthdr = putheader;
|
||||
BlankEnvelope.e_putbody = putbody;
|
||||
@ -697,13 +700,13 @@ main(argc, argv, envp)
|
||||
break;
|
||||
|
||||
case 'B': /* body type */
|
||||
CurEnv->e_bodytype = optarg;
|
||||
CurEnv->e_bodytype = newstr(optarg);
|
||||
break;
|
||||
|
||||
case 'C': /* select configuration file (already done) */
|
||||
if (RealUid != 0)
|
||||
warn_C_flag = TRUE;
|
||||
ConfFile = optarg;
|
||||
ConfFile = newstr(optarg);
|
||||
dp = drop_privileges(TRUE);
|
||||
setstat(dp);
|
||||
safecf = FALSE;
|
||||
@ -1451,6 +1454,7 @@ main(argc, argv, envp)
|
||||
milter_parse_list(InputFilterList, InputFilters, MAXFILTERS);
|
||||
#endif /* _FFR_MILTER */
|
||||
|
||||
|
||||
/* if we've had errors so far, exit now */
|
||||
if (ExitStat != EX_OK && OpMode != MD_TEST)
|
||||
finis(FALSE, ExitStat);
|
||||
@ -1577,7 +1581,7 @@ main(argc, argv, envp)
|
||||
# endif /* 0 */
|
||||
|
||||
/* initialize PRNG */
|
||||
tls_rand_init(RandFile, 7);
|
||||
tls_ok = tls_rand_init(RandFile, 7);
|
||||
|
||||
# endif /* STARTTLS */
|
||||
#endif /* SMTP */
|
||||
@ -1591,6 +1595,8 @@ main(argc, argv, envp)
|
||||
{
|
||||
# if SMTP
|
||||
# if STARTTLS
|
||||
if (tls_ok
|
||||
)
|
||||
{
|
||||
/* init TLS for client, ignore result for now */
|
||||
(void) initclttls();
|
||||
@ -1756,8 +1762,9 @@ main(argc, argv, envp)
|
||||
|
||||
#if SASL
|
||||
/* give a syserr or just disable AUTH ? */
|
||||
if (sasl_server_init(srvcallbacks, "Sendmail") != SASL_OK)
|
||||
syserr("!sasl_server_init failed!");
|
||||
if ((i = sasl_server_init(srvcallbacks, "Sendmail")) != SASL_OK)
|
||||
syserr("!sasl_server_init failed! [%s]",
|
||||
sasl_errstring(i, NULL, NULL));
|
||||
#endif /* SASL */
|
||||
|
||||
if (OpMode == MD_DAEMON)
|
||||
@ -2755,6 +2762,11 @@ testmodeline(line, e)
|
||||
#if _FFR_ADDR_TYPE
|
||||
define(macid("{addr_type}", NULL), "e r", e);
|
||||
#endif /* _FFR_ADDR_TYPE */
|
||||
|
||||
/* skip leading spaces */
|
||||
while (*line == ' ')
|
||||
line++;
|
||||
|
||||
switch (line[0])
|
||||
{
|
||||
case '#':
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: map.c,v 8.414.4.13 2000/07/14 16:48:21 ca Exp $";
|
||||
static char id[] = "@(#)$Id: map.c,v 8.414.4.24 2000/09/27 04:11:29 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <sendmail.h>
|
||||
@ -568,6 +568,7 @@ openmap(map)
|
||||
map->map_class = &BogusMapClass;
|
||||
map->map_mflags |= MF_OPEN;
|
||||
map->map_pid = getpid();
|
||||
MapOpenErr = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -626,7 +627,6 @@ map_close(s, unused)
|
||||
|
||||
if (!bitset(MF_VALID, map->map_mflags) ||
|
||||
!bitset(MF_OPEN, map->map_mflags) ||
|
||||
bitset(MF_SHARED, map->map_mflags) ||
|
||||
map->map_pid != getpid())
|
||||
return;
|
||||
|
||||
@ -2810,7 +2810,7 @@ ldapmap_open(map, mode)
|
||||
STAB *s;
|
||||
|
||||
if (tTd(38, 2))
|
||||
dprintf("ldapmap_open(%s, %d)\n", map->map_mname, mode);
|
||||
dprintf("ldapmap_open(%s, %d): ", map->map_mname, mode);
|
||||
|
||||
mode &= O_ACCMODE;
|
||||
|
||||
@ -2841,10 +2841,14 @@ ldapmap_open(map, mode)
|
||||
{
|
||||
/* Already have a connection open to this LDAP server */
|
||||
lmap->ldap_ld = s->s_ldap;
|
||||
map->map_mflags |= MF_SHARED;
|
||||
if (tTd(38, 2))
|
||||
dprintf("using cached connection\n");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (tTd(38, 2))
|
||||
dprintf("opening new connection\n");
|
||||
|
||||
/* No connection yet, connect */
|
||||
if (!ldapmap_start(map))
|
||||
return FALSE;
|
||||
@ -3142,7 +3146,7 @@ ldapmap_lookup(map, name, av, statp)
|
||||
if (q[1] == 's')
|
||||
{
|
||||
snprintf(fp, SPACELEFT(filter, fp), "%.*s%s",
|
||||
q - p, p, keybuf);
|
||||
(int) (q - p), p, keybuf);
|
||||
fp += strlen(fp);
|
||||
p = q + 2;
|
||||
}
|
||||
@ -3151,7 +3155,7 @@ ldapmap_lookup(map, name, av, statp)
|
||||
char *k = keybuf;
|
||||
|
||||
snprintf(fp, SPACELEFT(filter, fp), "%.*s",
|
||||
q - p, p);
|
||||
(int) (q - p), p);
|
||||
fp += strlen(fp);
|
||||
p = q + 2;
|
||||
|
||||
@ -3179,7 +3183,7 @@ ldapmap_lookup(map, name, av, statp)
|
||||
else
|
||||
{
|
||||
snprintf(fp, SPACELEFT(filter, fp), "%.*s",
|
||||
q - p + 1, p);
|
||||
(int) (q - p + 1), p);
|
||||
p = q + (q[1] == '%' ? 2 : 1);
|
||||
fp += strlen(fp);
|
||||
}
|
||||
@ -3200,13 +3204,24 @@ ldapmap_lookup(map, name, av, statp)
|
||||
if (!bitset(MF_OPTIONAL, map->map_mflags))
|
||||
{
|
||||
if (bitset(MF_NODEFER, map->map_mflags))
|
||||
syserr("Error in ldap_search_st using %s in map %s",
|
||||
syserr("Error in ldap_search using %s in map %s",
|
||||
filter, map->map_mname);
|
||||
else
|
||||
syserr("421 4.0.0 Error in ldap_search_st using %s in map %s",
|
||||
syserr("421 4.0.0 Error in ldap_search using %s in map %s",
|
||||
filter, map->map_mname);
|
||||
}
|
||||
*statp = EX_TEMPFAIL;
|
||||
#ifdef LDAP_SERVER_DOWN
|
||||
if (errno == LDAP_SERVER_DOWN)
|
||||
{
|
||||
int save_errno = errno;
|
||||
|
||||
/* server disappeared, try reopen on next search */
|
||||
map->map_class->map_close(map);
|
||||
map->map_mflags &= ~(MF_OPEN|MF_WRITABLE);
|
||||
errno = save_errno;
|
||||
}
|
||||
#endif /* LDAP_SERVER_DOWN */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -3309,7 +3324,7 @@ ldapmap_lookup(map, name, av, statp)
|
||||
}
|
||||
*statp = EX_TEMPFAIL;
|
||||
# if USING_NETSCAPE_LDAP
|
||||
ldap_mem_free(attr);
|
||||
ldap_memfree(attr);
|
||||
# endif /* USING_NETSCAPE_LDAP */
|
||||
if (lmap->ldap_res != NULL)
|
||||
{
|
||||
@ -3355,7 +3370,7 @@ ldapmap_lookup(map, name, av, statp)
|
||||
{
|
||||
vp = newstr(attr);
|
||||
# if USING_NETSCAPE_LDAP
|
||||
ldap_mem_free(attr);
|
||||
ldap_memfree(attr);
|
||||
# endif /* USING_NETSCAPE_LDAP */
|
||||
break;
|
||||
}
|
||||
@ -3364,7 +3379,7 @@ ldapmap_lookup(map, name, av, statp)
|
||||
{
|
||||
ldap_value_free(vals);
|
||||
# if USING_NETSCAPE_LDAP
|
||||
ldap_mem_free(attr);
|
||||
ldap_memfree(attr);
|
||||
# endif /* USING_NETSCAPE_LDAP */
|
||||
continue;
|
||||
}
|
||||
@ -3372,7 +3387,7 @@ ldapmap_lookup(map, name, av, statp)
|
||||
vp = newstr(vals[0]);
|
||||
ldap_value_free(vals);
|
||||
# if USING_NETSCAPE_LDAP
|
||||
ldap_mem_free(attr);
|
||||
ldap_memfree(attr);
|
||||
# endif /* USING_NETSCAPE_LDAP */
|
||||
break;
|
||||
}
|
||||
@ -3394,7 +3409,7 @@ ldapmap_lookup(map, name, av, statp)
|
||||
vp = tmp;
|
||||
}
|
||||
# if USING_NETSCAPE_LDAP
|
||||
ldap_mem_free(attr);
|
||||
ldap_memfree(attr);
|
||||
# endif /* USING_NETSCAPE_LDAP */
|
||||
continue;
|
||||
}
|
||||
@ -3424,7 +3439,7 @@ ldapmap_lookup(map, name, av, statp)
|
||||
|
||||
ldap_value_free(vals);
|
||||
# if USING_NETSCAPE_LDAP
|
||||
ldap_mem_free(attr);
|
||||
ldap_memfree(attr);
|
||||
# endif /* USING_NETSCAPE_LDAP */
|
||||
if (vp == NULL)
|
||||
{
|
||||
@ -3595,8 +3610,10 @@ ldapmap_lookup(map, name, av, statp)
|
||||
** LDAPMAP_FINDCONN -- find an LDAP connection to the server
|
||||
**
|
||||
** Cache LDAP connections based on the host, port, bind DN,
|
||||
** and secret so we don't have multiple connections open to
|
||||
** the same server for different maps.
|
||||
** secret, and PID so we don't have multiple connections open to
|
||||
** the same server for different maps. Need a separate connection
|
||||
** per PID since a parent process may close the map before the
|
||||
** child is done with it.
|
||||
**
|
||||
** Parameters:
|
||||
** lmap -- LDAP map information
|
||||
@ -3619,16 +3636,17 @@ ldapmap_findconn(lmap)
|
||||
(lmap->ldap_binddn == NULL ? 0 : strlen(lmap->ldap_binddn)) +
|
||||
1 +
|
||||
(lmap->ldap_secret == NULL ? 0 : strlen(lmap->ldap_secret)) +
|
||||
1;
|
||||
8 + 1;
|
||||
nbuf = xalloc(len);
|
||||
snprintf(nbuf, len, "%s%c%d%c%s%c%s",
|
||||
snprintf(nbuf, len, "%s%c%d%c%s%c%s%d",
|
||||
(lmap->ldap_host == NULL ? "localhost" : lmap->ldap_host),
|
||||
CONDELSE,
|
||||
lmap->ldap_port,
|
||||
CONDELSE,
|
||||
(lmap->ldap_binddn == NULL ? "" : lmap->ldap_binddn),
|
||||
CONDELSE,
|
||||
(lmap->ldap_secret == NULL ? "" : lmap->ldap_secret));
|
||||
(lmap->ldap_secret == NULL ? "" : lmap->ldap_secret),
|
||||
getpid());
|
||||
s = stab(nbuf, ST_LDAP, ST_ENTER);
|
||||
free(nbuf);
|
||||
return s;
|
||||
@ -4127,7 +4145,8 @@ ldapmap_parseargs(map, args)
|
||||
return FALSE;
|
||||
}
|
||||
lmap->ldap_secret = sfgets(m_tmp, LDAPMAP_MAX_PASSWD,
|
||||
sfd, 0, "ldapmap_parseargs");
|
||||
sfd, TimeOuts.to_fileopen,
|
||||
"ldapmap_parseargs");
|
||||
(void) fclose(sfd);
|
||||
if (lmap->ldap_secret != NULL &&
|
||||
strlen(m_tmp) > 0)
|
||||
@ -4607,6 +4626,23 @@ ph_map_open(map, mode)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (CurEnv != NULL && CurEnv->e_sendmode == SM_DEFER &&
|
||||
bitset(MF_DEFER, map->map_mflags))
|
||||
{
|
||||
if (tTd(9, 1))
|
||||
dprintf("ph_map_open(%s) => DEFERRED\n",
|
||||
map->map_mname);
|
||||
|
||||
/*
|
||||
** Unset MF_DEFER here so that map_lookup() returns
|
||||
** a temporary failure using the bogus map and
|
||||
** map->map_tapp instead of the default permanent error.
|
||||
*/
|
||||
|
||||
map->map_mflags &= ~MF_DEFER;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pmap = (PH_MAP_STRUCT *)map->map_db1;
|
||||
|
||||
hostlist = newstr(pmap->ph_servers);
|
||||
@ -4626,7 +4662,7 @@ ph_map_open(map, mode)
|
||||
# ifdef ETIMEDOUT
|
||||
errno = ETIMEDOUT;
|
||||
# else /* ETIMEDOUT */
|
||||
errno = 0;
|
||||
errno = EAGAIN;
|
||||
# endif /* ETIMEDOUT */
|
||||
goto ph_map_open_abort;
|
||||
}
|
||||
@ -4683,15 +4719,17 @@ ph_map_open(map, mode)
|
||||
#if !_FFR_PHMAP_TIMEOUT
|
||||
errno = save_errno;
|
||||
#endif /* !_FFR_PHMAP_TIMEOUT */
|
||||
if (!bitset(MF_OPTIONAL, map->map_mflags))
|
||||
if (bitset(MF_NODEFER, map->map_mflags))
|
||||
{
|
||||
if (errno == 0 && !bitset(MF_NODEFER,map->map_mflags))
|
||||
if (errno == 0)
|
||||
errno = EAGAIN;
|
||||
syserr("ph_map_open: cannot connect to PH server");
|
||||
syserr("ph_map_open: %s: cannot connect to PH server",
|
||||
map->map_mname);
|
||||
}
|
||||
else if (LogLevel > 1)
|
||||
else if (!bitset(MF_OPTIONAL, map->map_mflags) && LogLevel > 1)
|
||||
sm_syslog(LOG_NOTICE, CurEnv->e_id,
|
||||
"ph_map_open: cannot connect to PH server");
|
||||
"ph_map_open: %s: cannot connect to PH server",
|
||||
map->map_mname);
|
||||
free(hostlist);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: milter.c,v 8.50.4.30 2000/07/18 07:24:51 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: milter.c,v 8.50.4.33 2000/09/19 19:40:15 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#if _FFR_MILTER
|
||||
@ -208,7 +208,7 @@ milter_sysread(m, buf, sz, to, e)
|
||||
time_t to;
|
||||
ENVELOPE *e;
|
||||
{
|
||||
time_t readstart;
|
||||
time_t readstart = 0;
|
||||
ssize_t len, curl;
|
||||
|
||||
curl = 0;
|
||||
@ -288,7 +288,7 @@ milter_read(m, cmd, rlen, to, e)
|
||||
time_t to;
|
||||
ENVELOPE *e;
|
||||
{
|
||||
time_t readstart;
|
||||
time_t readstart = 0;
|
||||
ssize_t expl;
|
||||
mi_int32 i;
|
||||
char *buf;
|
||||
@ -939,6 +939,8 @@ milter_open(m, parseonly, e)
|
||||
|
||||
/* couldn't connect.... try next address */
|
||||
save_errno = errno;
|
||||
p = CurHostName;
|
||||
CurHostName = at;
|
||||
if (tTd(64, 5))
|
||||
dprintf("milter_open(%s): %s failed: %s\n",
|
||||
m->mf_name, at, errstring(save_errno));
|
||||
@ -946,6 +948,7 @@ milter_open(m, parseonly, e)
|
||||
sm_syslog(LOG_INFO, e->e_id,
|
||||
"milter_open(%s): %s failed: %s",
|
||||
m->mf_name, at, errstring(save_errno));
|
||||
CurHostName = p;
|
||||
(void) close(sock);
|
||||
|
||||
/* try next address */
|
||||
@ -1016,7 +1019,7 @@ milter_setup(line)
|
||||
register struct milter *m;
|
||||
STAB *s;
|
||||
|
||||
/* collect the mailer name */
|
||||
/* collect the filter name */
|
||||
for (p = line;
|
||||
*p != '\0' && *p != ',' && !(isascii(*p) && isspace(*p));
|
||||
p++)
|
||||
@ -1061,7 +1064,7 @@ milter_setup(line)
|
||||
/* p now points to the field body */
|
||||
p = munchstring(p, &delimptr, ',');
|
||||
|
||||
/* install the field into the mailer struct */
|
||||
/* install the field into the filter struct */
|
||||
switch (fcode)
|
||||
{
|
||||
case 'S': /* socket */
|
||||
@ -1094,7 +1097,7 @@ milter_setup(line)
|
||||
/* early check for errors */
|
||||
(void) milter_open(m, TRUE, CurEnv);
|
||||
|
||||
/* enter the mailer into the symbol table */
|
||||
/* enter the filter into the symbol table */
|
||||
s = stab(m->mf_name, ST_MILTER, ST_ENTER);
|
||||
if (s->s_milter != NULL)
|
||||
syserr("X%s: duplicate filter definition", m->mf_name);
|
||||
@ -1206,7 +1209,7 @@ milter_parse_timeouts(spec, m)
|
||||
/* p now points to the field body */
|
||||
p = munchstring(p, &delimptr, ';');
|
||||
|
||||
/* install the field into the mailer struct */
|
||||
/* install the field into the filter struct */
|
||||
switch (fcode)
|
||||
{
|
||||
case 'S':
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: parseaddr.c,v 8.234.4.1 2000/05/25 18:56:16 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: parseaddr.c,v 8.234.4.5 2000/09/25 07:53:29 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <sendmail.h>
|
||||
@ -2721,7 +2721,12 @@ rscheck(rwset, p1, p2, e, rmcomm, cnt, logl)
|
||||
*/
|
||||
goto finis;
|
||||
}
|
||||
|
||||
MapOpenErr = FALSE;
|
||||
(void) rewrite(pvp, rsno, 0, e);
|
||||
if (MapOpenErr)
|
||||
usrerrenh("4.3.0", "451 Temporary failure");
|
||||
|
||||
if (pvp[0] == NULL || (pvp[0][0] & 0377) != CANONNET ||
|
||||
pvp[1] == NULL || (strcmp(pvp[1], "error") != 0 &&
|
||||
strcmp(pvp[1], "discard") != 0))
|
||||
|
@ -16,9 +16,9 @@
|
||||
|
||||
#ifndef lint
|
||||
# if QUEUE
|
||||
static char id[] = "@(#)$Id: queue.c,v 8.343.4.11 2000/07/14 05:55:51 gshapiro Exp $ (with queueing)";
|
||||
static char id[] = "@(#)$Id: queue.c,v 8.343.4.17 2000/09/15 03:34:51 gshapiro Exp $ (with queueing)";
|
||||
# else /* QUEUE */
|
||||
static char id[] = "@(#)$Id: queue.c,v 8.343.4.11 2000/07/14 05:55:51 gshapiro Exp $ (without queueing)";
|
||||
static char id[] = "@(#)$Id: queue.c,v 8.343.4.17 2000/09/15 03:34:51 gshapiro Exp $ (without queueing)";
|
||||
# endif /* QUEUE */
|
||||
#endif /* ! lint */
|
||||
|
||||
@ -1056,7 +1056,7 @@ orderq(queuedir, doall)
|
||||
|
||||
WorkQ = nw;
|
||||
free(w->w_name);
|
||||
if (w->w_host)
|
||||
if (w->w_host != NULL)
|
||||
free(w->w_host);
|
||||
free((char *) w);
|
||||
w = nw;
|
||||
@ -1149,7 +1149,9 @@ orderq(queuedir, doall)
|
||||
}
|
||||
|
||||
/* avoid work if possible */
|
||||
if (QueueSortOrder == QSO_BYFILENAME)
|
||||
if (QueueSortOrder == QSO_BYFILENAME &&
|
||||
QueueLimitSender == NULL &&
|
||||
QueueLimitRecipient == NULL)
|
||||
{
|
||||
w->w_name = newstr(d->d_name);
|
||||
w->w_host = NULL;
|
||||
@ -2034,7 +2036,7 @@ readqf(e)
|
||||
break;
|
||||
|
||||
case 'H': /* header */
|
||||
(void) chompheader(&bp[1], 0, NULL, e);
|
||||
(void) chompheader(&bp[1], CHHDR_QUEUE, NULL, e);
|
||||
hdrsize += strlen(&bp[1]);
|
||||
break;
|
||||
|
||||
@ -2840,7 +2842,9 @@ setctluser(user, qfver)
|
||||
}
|
||||
else if ((pw = sm_getpwnam(user)) != NULL)
|
||||
{
|
||||
if (strcmp(pw->pw_dir, "/") == 0)
|
||||
if (*pw->pw_dir == '\0')
|
||||
a->q_home = NULL;
|
||||
else if (strcmp(pw->pw_dir, "/") == 0)
|
||||
a->q_home = "";
|
||||
else
|
||||
a->q_home = newstr(pw->pw_dir);
|
||||
@ -3029,6 +3033,10 @@ chkqdir(name, sff)
|
||||
struct stat statb;
|
||||
int i;
|
||||
|
||||
/* skip over . and .. directories */
|
||||
if (name[0] == '.' &&
|
||||
(name[1] == '\0' || (name[2] == '.' && name[3] == '\0')))
|
||||
return FALSE;
|
||||
# if HASLSTAT
|
||||
if (lstat(name, &statb) < 0)
|
||||
# else /* HASLSTAT */
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: readcf.c,v 8.382.4.14 2000/07/12 00:00:27 geir Exp $";
|
||||
static char id[] = "@(#)$Id: readcf.c,v 8.382.4.27 2000/09/28 01:31:16 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <sendmail.h>
|
||||
@ -1134,18 +1134,18 @@ makemailer(line)
|
||||
|
||||
if (strcmp(m->m_mailer, "[TCP]") == 0)
|
||||
{
|
||||
#if _FFR_REMOVE_TCP_PATH
|
||||
#if _FFR_REMOVE_TCP_MAILER_PATH
|
||||
syserr("M%s: P=[TCP] is deprecated, use P=[IPC] instead\n",
|
||||
m->m_name);
|
||||
#else /* _FFR_REMOVE_TCP_PATH */
|
||||
#else /* _FFR_REMOVE_TCP_MAILER_PATH */
|
||||
printf("M%s: Warning: P=[TCP] is deprecated, use P=[IPC] instead\n",
|
||||
m->m_name);
|
||||
#endif /* _FFR_REMOVE_TCP_PATH */
|
||||
#endif /* _FFR_REMOVE_TCP_MAILER_PATH */
|
||||
}
|
||||
|
||||
if (strcmp(m->m_mailer, "[IPC]") == 0 ||
|
||||
if (strcmp(m->m_mailer, "[IPC]") == 0
|
||||
#if !_FFR_REMOVE_TCP_MAILER_PATH
|
||||
strcmp(m->m_mailer, "[TCP]") == 0
|
||||
|| strcmp(m->m_mailer, "[TCP]") == 0
|
||||
#endif /* !_FFR_REMOVE_TCP_MAILER_PATH */
|
||||
)
|
||||
{
|
||||
@ -1156,12 +1156,12 @@ makemailer(line)
|
||||
syserr("M%s: too few parameters for %s mailer",
|
||||
m->m_name, m->m_mailer);
|
||||
}
|
||||
if (strcmp(m->m_argv[0], "TCP") != 0 &&
|
||||
if (strcmp(m->m_argv[0], "TCP") != 0
|
||||
#if NETUNIX
|
||||
strcmp(m->m_argv[0], "FILE") != 0 &&
|
||||
&& strcmp(m->m_argv[0], "FILE") != 0
|
||||
#endif /* NETUNIX */
|
||||
#if !_FFR_DEPRECATE_IPC_MAILER_ARG
|
||||
strcmp(m->m_argv[0], "IPC") != 0
|
||||
&& strcmp(m->m_argv[0], "IPC") != 0
|
||||
#endif /* !_FFR_DEPRECATE_IPC_MAILER_ARG */
|
||||
)
|
||||
{
|
||||
@ -2190,9 +2190,13 @@ setoption(opt, val, safe, sticky, e)
|
||||
|
||||
case 'Q': /* queue directory */
|
||||
if (val[0] == '\0')
|
||||
{
|
||||
QueueDir = "mqueue";
|
||||
}
|
||||
else
|
||||
{
|
||||
QueueDir = newstr(val);
|
||||
}
|
||||
if (RealUid != 0 && !safe)
|
||||
Warn_Q_option = TRUE;
|
||||
break;
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: recipient.c,v 8.231.14.5 2000/06/27 20:15:46 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: recipient.c,v 8.231.14.8 2000/09/14 23:32:27 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <sendmail.h>
|
||||
@ -718,7 +718,9 @@ recipient(a, sendq, aliaslevel, e)
|
||||
(void) strlcpy(buf, pw->pw_name, buflen);
|
||||
goto trylocaluser;
|
||||
}
|
||||
if (strcmp(pw->pw_dir, "/") == 0)
|
||||
if (*pw->pw_dir == '\0')
|
||||
a->q_home = NULL;
|
||||
else if (strcmp(pw->pw_dir, "/") == 0)
|
||||
a->q_home = "";
|
||||
else
|
||||
a->q_home = newstr(pw->pw_dir);
|
||||
@ -1134,6 +1136,23 @@ include(fname, forwarding, ctladdr, sendq, aliaslevel, e)
|
||||
dprintf("include: old uid = %d/%d\n",
|
||||
(int) getuid(), (int) geteuid());
|
||||
|
||||
#if _FFR_UNSAFE_WRITABLE_INCLUDE
|
||||
if (forwarding)
|
||||
{
|
||||
if (!bitnset(DBS_GROUPWRITABLEFORWARDFILE, DontBlameSendmail))
|
||||
sfflags |= SFF_NOGWFILES;
|
||||
if (!bitnset(DBS_WORLDWRITABLEFORWARDFILE, DontBlameSendmail))
|
||||
sfflags |= SFF_NOWWFILES;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!bitnset(DBS_GROUPWRITABLEINCLUDEFILE, DontBlameSendmail))
|
||||
sfflags |= SFF_NOGWFILES;
|
||||
if (!bitnset(DBS_WORLDWRITABLEINCLUDEFILE, DontBlameSendmail))
|
||||
sfflags |= SFF_NOWWFILES;
|
||||
}
|
||||
#endif /* _FFR_UNSAFE_WRITABLE_INCLUDE */
|
||||
|
||||
if (forwarding)
|
||||
sfflags |= SFF_MUSTOWN|SFF_ROOTOK|SFF_NOWLINK;
|
||||
|
||||
@ -1497,7 +1516,11 @@ include(fname, forwarding, ctladdr, sendq, aliaslevel, e)
|
||||
isascii(p[-1]) && isspace(p[-1]) &&
|
||||
(p[3] == '\0' || (isascii(p[3]) && isspace(p[3]))))
|
||||
{
|
||||
p[-1] = '\0';
|
||||
--p;
|
||||
while (p > buf && isascii(p[-1]) &&
|
||||
isspace(p[-1]))
|
||||
--p;
|
||||
p[0] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
#ifdef _DEFINE
|
||||
# define EXTERN
|
||||
# ifndef lint
|
||||
static char SmailId[] = "@(#)$Id: sendmail.h,v 8.517.4.28 2000/07/18 02:24:44 gshapiro Exp $";
|
||||
static char SmailId[] = "@(#)$Id: sendmail.h,v 8.517.4.37 2000/09/25 07:53:29 gshapiro Exp $";
|
||||
# endif /* ! lint */
|
||||
#else /* _DEFINE */
|
||||
# define EXTERN extern
|
||||
@ -542,6 +542,7 @@ extern struct hdrinfo HdrInfo[];
|
||||
#define CHHDR_DEF 0x0001 /* default header */
|
||||
#define CHHDR_CHECK 0x0002 /* call ruleset for header */
|
||||
#define CHHDR_USER 0x0004 /* header from user */
|
||||
#define CHHDR_QUEUE 0x0008 /* header from qf file */
|
||||
|
||||
/* functions */
|
||||
extern void addheader __P((char *, char *, int, HDR **));
|
||||
@ -589,6 +590,12 @@ struct envelope
|
||||
char **e_fromdomain; /* the domain part of the sender */
|
||||
ADDRESS *e_sendqueue; /* list of message recipients */
|
||||
ADDRESS *e_errorqueue; /* the queue for error responses */
|
||||
|
||||
/*
|
||||
** Overflow detection is based on < 0, so don't change this
|
||||
** to unsigned. We don't use unsigned and == ULONG_MAX because
|
||||
** some libc's don't have strtoul(), see mail_esmtp_args().
|
||||
*/
|
||||
long e_msgsize; /* size of the message in bytes */
|
||||
long e_flags; /* flags, see below */
|
||||
int e_nrcpts; /* number of recipients */
|
||||
@ -656,6 +663,7 @@ struct envelope
|
||||
#define EF_IS_MIME 0x0400000L /* really is a MIME message */
|
||||
#define EF_DONT_MIME 0x0800000L /* never MIME this message */
|
||||
#define EF_DISCARD 0x1000000L /* discard the message */
|
||||
#define EF_TOOBIG 0x2000000L /* message is too big */
|
||||
|
||||
/* values for e_if_macros */
|
||||
#define EIF_ADDR 0 /* ${if_addr} */
|
||||
@ -868,7 +876,6 @@ MAP
|
||||
#define MF_DEFER 0x00080000 /* don't lookup map in defer mode */
|
||||
#define MF_SINGLEMATCH 0x00100000 /* successful only if match one key */
|
||||
#define MF_NOREWRITE 0x00200000 /* don't rewrite result, return as-is */
|
||||
#define MF_SHARED 0x00400000 /* map connection is shared */
|
||||
|
||||
#define DYNOPENMAP(map) if (!bitset(MF_OPEN, (map)->map_mflags)) \
|
||||
{ \
|
||||
@ -1421,12 +1428,15 @@ struct termescape
|
||||
*/
|
||||
|
||||
/* d_flags, see daemon.c */
|
||||
/* generic rule: lower case: required, upper case: No */
|
||||
/* general rule: lower case: required, upper case: No */
|
||||
#define D_AUTHREQ 'a' /* authentication required */
|
||||
#define D_BINDIF 'b' /* use if_addr for outgoing connection */
|
||||
#define D_CANONREQ 'c' /* canonification required (cf) */
|
||||
#define D_IFNHELO 'h' /* use if name for HELO */
|
||||
#define D_FQMAIL 'f' /* fq sender address required (cf) */
|
||||
#if _FFR_TLS_CLT1
|
||||
#define D_CLTNOTLS 'S' /* don't use STARTTLS in client */
|
||||
#endif /* _FFR_TLS_CLT1 */
|
||||
#define D_FQRCPT 'r' /* fq recipient address required (cf) */
|
||||
#define D_UNQUALOK 'u' /* unqualified address is ok (cf) */
|
||||
#define D_NOCANON 'C' /* no canonification (cf) */
|
||||
@ -1664,6 +1674,7 @@ EXTERN bool IgnoreHostStatus; /* ignore long term host status files */
|
||||
EXTERN bool IgnrDot; /* don't let dot end messages */
|
||||
EXTERN bool InChild; /* true if running in an SMTP subprocess */
|
||||
EXTERN bool LogUsrErrs; /* syslog user errors (e.g., SMTP RCPT cmd) */
|
||||
EXTERN bool MapOpenErr; /* error opening a non-optional map */
|
||||
EXTERN bool MatchGecos; /* look for user names in gecos field */
|
||||
EXTERN bool MeToo; /* send to the sender also */
|
||||
EXTERN bool NoAlias; /* suppress aliasing */
|
||||
@ -1863,7 +1874,7 @@ extern int tls_get_info __P((SSL *, ENVELOPE *, bool, char *));
|
||||
extern int endtls __P((SSL *, char *));
|
||||
extern int endtlsclt __P((MCI *));
|
||||
extern void tlslogerr __P((void));
|
||||
extern void tls_rand_init __P((char *, int));
|
||||
extern bool tls_rand_init __P((char *, int));
|
||||
#endif /* STARTTLS */
|
||||
|
||||
/* Transcript file */
|
||||
|
@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: sfsasl.c,v 8.17.4.7 2000/07/18 18:44:51 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: sfsasl.c,v 8.17.4.8 2000/09/14 00:14:13 ca Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#if SFIO
|
||||
@ -297,6 +297,8 @@ sfdctls(fin, fout, con)
|
||||
Tlsdisc_t *tlsin, *tlsout;
|
||||
# if !SFIO
|
||||
FILE *fp;
|
||||
# else /* !SFIO */
|
||||
int rfd, wfd;
|
||||
# endif /* !SFIO */
|
||||
|
||||
if (con == NULL)
|
||||
@ -323,8 +325,15 @@ sfdctls(fin, fout, con)
|
||||
tlsout->disc.exceptf = NULL;
|
||||
tlsout->con = con;
|
||||
|
||||
SSL_set_rfd(con, fileno(fin)); /* fileno or sffileno? XXX */
|
||||
SSL_set_wfd(con, fileno(fout));
|
||||
rfd = fileno(fin);
|
||||
wfd = fileno(fout);
|
||||
if (rfd < 0 || wfd < 0 ||
|
||||
SSL_set_rfd(con, rfd) <= 0 || SSL_set_wfd(con, wfd) <= 0)
|
||||
{
|
||||
free(tlsin);
|
||||
free(tlsout);
|
||||
return -1;
|
||||
}
|
||||
if (sfdisc(fin, (Sfdisc_t *) tlsin) != (Sfdisc_t *) tlsin ||
|
||||
sfdisc(fout, (Sfdisc_t *) tlsout) != (Sfdisc_t *) tlsout)
|
||||
{
|
||||
|
@ -16,14 +16,16 @@
|
||||
|
||||
#ifndef lint
|
||||
# if SMTP
|
||||
static char id[] = "@(#)$Id: srvrsmtp.c,v 8.471.2.2.2.40 2000/07/18 02:24:45 gshapiro Exp $ (with SMTP)";
|
||||
static char id[] = "@(#)$Id: srvrsmtp.c,v 8.471.2.2.2.58 2000/09/21 21:52:18 ca Exp $ (with SMTP)";
|
||||
# else /* SMTP */
|
||||
static char id[] = "@(#)$Id: srvrsmtp.c,v 8.471.2.2.2.40 2000/07/18 02:24:45 gshapiro Exp $ (without SMTP)";
|
||||
static char id[] = "@(#)$Id: srvrsmtp.c,v 8.471.2.2.2.58 2000/09/21 21:52:18 ca Exp $ (without SMTP)";
|
||||
# endif /* SMTP */
|
||||
#endif /* ! lint */
|
||||
|
||||
#if SMTP
|
||||
# include "sfsasl.h"
|
||||
# if SASL || STARTTLS
|
||||
# include "sfsasl.h"
|
||||
# endif /* SASL || STARTTLS */
|
||||
# if SASL
|
||||
# define ENC64LEN(l) (((l) + 2) * 4 / 3 + 1)
|
||||
static int saslmechs __P((sasl_conn_t *, char **));
|
||||
@ -112,6 +114,11 @@ struct cmd
|
||||
# define CMDDBGQSHOW 24 /* showq -- show send queue */
|
||||
# define CMDDBGDEBUG 25 /* debug -- set debug mode */
|
||||
|
||||
/*
|
||||
** Note: If you change this list,
|
||||
** remember to update 'helpfile'
|
||||
*/
|
||||
|
||||
static struct cmd CmdTab[] =
|
||||
{
|
||||
{ "mail", CMDMAIL },
|
||||
@ -232,6 +239,7 @@ smtp(nullserver, d_flags, e)
|
||||
# endif /* SASL */
|
||||
# if STARTTLS
|
||||
int r;
|
||||
int rfd, wfd;
|
||||
volatile bool usetls = TRUE;
|
||||
volatile bool tls_active = FALSE;
|
||||
bool saveQuickAbort;
|
||||
@ -435,7 +443,7 @@ smtp(nullserver, d_flags, e)
|
||||
else
|
||||
snprintf(cmdbuf, sizeof cmdbuf,
|
||||
"%s-%%.*s ESMTP%%s", greetcode);
|
||||
message(cmdbuf, id - inp, inp, id);
|
||||
message(cmdbuf, (int) (id - inp), inp, id);
|
||||
|
||||
/* output remaining lines */
|
||||
while ((id = p) != NULL && (p = strchr(id, '\n')) != NULL)
|
||||
@ -1001,8 +1009,11 @@ smtp(nullserver, d_flags, e)
|
||||
message("454 4.3.3 TLS not available: error generating SSL handle");
|
||||
break;
|
||||
}
|
||||
if (SSL_set_rfd(srv_ssl, fileno(InChannel)) <= 0 ||
|
||||
SSL_set_wfd(srv_ssl, fileno(OutChannel)) <= 0)
|
||||
rfd = fileno(InChannel);
|
||||
wfd = fileno(OutChannel);
|
||||
if (rfd < 0 || wfd < 0 ||
|
||||
SSL_set_rfd(srv_ssl, rfd) <= 0 ||
|
||||
SSL_set_wfd(srv_ssl, wfd) <= 0)
|
||||
{
|
||||
message("454 4.3.3 TLS not available: error set fd");
|
||||
SSL_free(srv_ssl);
|
||||
@ -1252,7 +1263,14 @@ smtp(nullserver, d_flags, e)
|
||||
break;
|
||||
}
|
||||
|
||||
/* print EHLO features list */
|
||||
/*
|
||||
** print EHLO features list
|
||||
**
|
||||
** Note: If you change this list,
|
||||
** remember to update 'helpfile'
|
||||
*/
|
||||
|
||||
|
||||
message("250-ENHANCEDSTATUSCODES");
|
||||
if (!bitset(PRIV_NOEXPN, PrivacyFlags))
|
||||
{
|
||||
@ -1506,7 +1524,8 @@ smtp(nullserver, d_flags, e)
|
||||
Errors > 0)
|
||||
goto undo_subproc_no_pm;
|
||||
|
||||
if (MaxMessageSize > 0 && e->e_msgsize > MaxMessageSize)
|
||||
if (MaxMessageSize > 0 &&
|
||||
(e->e_msgsize > MaxMessageSize || e->e_msgsize < 0))
|
||||
{
|
||||
usrerr("552 5.2.3 Message size exceeds fixed maximum message size (%ld)",
|
||||
MaxMessageSize);
|
||||
@ -1544,7 +1563,7 @@ smtp(nullserver, d_flags, e)
|
||||
break;
|
||||
|
||||
case SMFIR_TEMPFAIL:
|
||||
usrerr("451 4.7.1 Try again later");
|
||||
usrerr("451 4.7.1 Please try again later");
|
||||
break;
|
||||
}
|
||||
if (response != NULL)
|
||||
@ -1722,7 +1741,7 @@ smtp(nullserver, d_flags, e)
|
||||
break;
|
||||
|
||||
case SMFIR_TEMPFAIL:
|
||||
usrerr("451 4.7.1 Try again later");
|
||||
usrerr("451 4.7.1 Please try again later");
|
||||
break;
|
||||
}
|
||||
if (response != NULL)
|
||||
@ -1824,7 +1843,7 @@ smtp(nullserver, d_flags, e)
|
||||
break;
|
||||
|
||||
case SMFIR_TEMPFAIL:
|
||||
usrerr("451 4.7.1 Try again later");
|
||||
usrerr("451 4.7.1 Please try again later");
|
||||
break;
|
||||
}
|
||||
if (response != NULL)
|
||||
@ -2079,7 +2098,7 @@ smtp(nullserver, d_flags, e)
|
||||
/* see if there is more in the vrfy list */
|
||||
a = vrfyqueue;
|
||||
while ((a = a->q_next) != NULL &&
|
||||
(!QS_IS_UNDELIVERED(vrfyqueue->q_state)))
|
||||
(!QS_IS_UNDELIVERED(a->q_state)))
|
||||
continue;
|
||||
printvrfyaddr(vrfyqueue, a == NULL, vrfy);
|
||||
vrfyqueue = a;
|
||||
@ -2429,11 +2448,12 @@ mail_esmtp_args(kp, vp, e)
|
||||
/* NOTREACHED */
|
||||
}
|
||||
define(macid("{msg_size}", NULL), newstr(vp), e);
|
||||
# if defined(__STDC__) && !defined(BROKEN_ANSI_LIBRARY)
|
||||
e->e_msgsize = strtoul(vp, (char **) NULL, 10);
|
||||
# else /* defined(__STDC__) && !defined(BROKEN_ANSI_LIBRARY) */
|
||||
e->e_msgsize = strtol(vp, (char **) NULL, 10);
|
||||
# endif /* defined(__STDC__) && !defined(BROKEN_ANSI_LIBRARY) */
|
||||
e->e_msgsize = strtol(vp, (char **) NULL, 10);
|
||||
if (e->e_msgsize == LONG_MAX && errno == ERANGE)
|
||||
{
|
||||
usrerr("552 5.2.3 Message size exceeds maximum value");
|
||||
/* NOTREACHED */
|
||||
}
|
||||
}
|
||||
else if (strcasecmp(kp, "body") == 0)
|
||||
{
|
||||
@ -2587,7 +2607,7 @@ mail_esmtp_args(kp, vp, e)
|
||||
# endif /* SASL */
|
||||
else
|
||||
{
|
||||
usrerr("501 5.5.4 %s parameter unrecognized", kp);
|
||||
usrerr("555 5.5.4 %s parameter unrecognized", kp);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
}
|
||||
@ -2676,7 +2696,7 @@ rcpt_esmtp_args(a, kp, vp, e)
|
||||
}
|
||||
else
|
||||
{
|
||||
usrerr("501 5.5.4 %s parameter unrecognized", kp);
|
||||
usrerr("555 5.5.4 %s parameter unrecognized", kp);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
}
|
||||
@ -2949,7 +2969,7 @@ get_dh512()
|
||||
** logl -- loglevel
|
||||
**
|
||||
** Returns:
|
||||
** None. (not yet, maybe it should return success/failure?)
|
||||
** success/failure
|
||||
**
|
||||
** Side Effects:
|
||||
** initializes PRNG for tls library.
|
||||
@ -2957,26 +2977,37 @@ get_dh512()
|
||||
|
||||
#define MIN_RAND_BYTES 16 /* 128 bits */
|
||||
|
||||
void
|
||||
bool
|
||||
tls_rand_init(randfile, logl)
|
||||
char *randfile;
|
||||
int logl;
|
||||
{
|
||||
# ifndef HASURANDOMDEV
|
||||
# ifndef HASURANDOMDEV
|
||||
/* not required if /dev/urandom exists, OpenSSL does it internally */
|
||||
|
||||
#define RF_OK 0 /* randfile OK */
|
||||
#define RF_MISS 1 /* randfile == NULL || *randfile == '\0' */
|
||||
#define RF_UNKNOWN 2 /* unknown prefix for randfile */
|
||||
|
||||
#define RI_NONE 0 /* no init yet */
|
||||
#define RI_SUCCESS 1 /* init was successful */
|
||||
#define RI_FAIL 2 /* init failed */
|
||||
|
||||
bool ok;
|
||||
int randdef;
|
||||
static int done = RI_NONE;
|
||||
|
||||
/*
|
||||
** initialize PRNG
|
||||
*/
|
||||
|
||||
/* did we try this before? if yes: return old value */
|
||||
if (done != RI_NONE)
|
||||
return done == RI_SUCCESS;
|
||||
|
||||
/* set default values */
|
||||
ok = FALSE;
|
||||
done = RI_FAIL;
|
||||
randdef = (randfile == NULL || *randfile == '\0') ? RF_MISS : RF_OK;
|
||||
# if EGD
|
||||
if (randdef == RF_OK && strncasecmp(randfile, "egd:", 4) == 0)
|
||||
@ -3104,8 +3135,13 @@ tls_rand_init(randfile, logl)
|
||||
if (LogLevel > logl)
|
||||
sm_syslog(LOG_WARNING, NOQID,
|
||||
"TLS: Warning: random number generator not properly seeded");
|
||||
ok = TRUE;
|
||||
}
|
||||
# endif /* !HASURANDOMDEV */
|
||||
done = ok ? RI_SUCCESS : RI_FAIL;
|
||||
return ok;
|
||||
# else /* !HASURANDOMDEV */
|
||||
return TRUE;
|
||||
# endif /* !HASURANDOMDEV */
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3288,6 +3324,12 @@ inittls(ctx, req, srv, certfile, keyfile, cacertpath, cacertfile, dhparam)
|
||||
/* already initialized? (we could re-init...) */
|
||||
if (*ctx != NULL)
|
||||
return TRUE;
|
||||
|
||||
/* PRNG seeded? */
|
||||
if (!tls_rand_init(RandFile, 10))
|
||||
return FALSE;
|
||||
|
||||
/* let's start with the assumption it will work */
|
||||
ok = TRUE;
|
||||
|
||||
# if _FFR_TLS_1
|
||||
@ -3362,12 +3404,11 @@ inittls(ctx, req, srv, certfile, keyfile, cacertpath, cacertfile, dhparam)
|
||||
sm_syslog(LOG_WARNING, NOQID,
|
||||
"TLS: error: illegal value '%s' for DHParam",
|
||||
dhparam);
|
||||
free(dhparam);
|
||||
dhparam = NULL;
|
||||
}
|
||||
}
|
||||
if (dhparam == NULL)
|
||||
dhparam = srv ? newstr("1") : newstr("5");
|
||||
dhparam = srv ? "1" : "5";
|
||||
else if (*dhparam == '/')
|
||||
{
|
||||
TLS_OK_F(dhparam, "DHParameters",
|
||||
@ -3810,9 +3851,9 @@ tls_get_info(ssl, e, srv, host)
|
||||
cert = SSL_get_peer_certificate(ssl);
|
||||
if (LogLevel >= 14)
|
||||
sm_syslog(LOG_INFO, e->e_id,
|
||||
"TLS: get_verify in %s: %d get_peer: 0x%x",
|
||||
"TLS: get_verify in %s: %ld get_peer: 0x%lx",
|
||||
srv ? "srv" : "clt",
|
||||
SSL_get_verify_result(ssl), cert);
|
||||
SSL_get_verify_result(ssl), (u_long) cert);
|
||||
if (cert != NULL)
|
||||
{
|
||||
char buf[MAXNAME];
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
|
||||
* Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
|
||||
* Copyright (c) 1988, 1993
|
||||
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: stats.c,v 8.36.14.2 2000/05/25 23:33:34 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: stats.c,v 8.36.14.3 2000/09/17 17:04:27 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <sendmail.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
|
||||
* Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
|
||||
* Copyright (c) 1988, 1993
|
||||
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: trace.c,v 8.20.22.1 2000/05/25 18:56:18 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: trace.c,v 8.20.22.2 2000/09/17 17:04:27 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <sendmail.h>
|
||||
|
@ -15,9 +15,9 @@
|
||||
|
||||
#ifndef lint
|
||||
# if SMTP
|
||||
static char id[] = "@(#)$Id: usersmtp.c,v 8.245.4.12 2000/07/17 19:55:08 ca Exp $ (with SMTP)";
|
||||
static char id[] = "@(#)$Id: usersmtp.c,v 8.245.4.13 2000/09/26 00:46:21 gshapiro Exp $ (with SMTP)";
|
||||
# else /* SMTP */
|
||||
static char id[] = "@(#)$Id: usersmtp.c,v 8.245.4.12 2000/07/17 19:55:08 ca Exp $ (without SMTP)";
|
||||
static char id[] = "@(#)$Id: usersmtp.c,v 8.245.4.13 2000/09/26 00:46:21 gshapiro Exp $ (without SMTP)";
|
||||
# endif /* SMTP */
|
||||
#endif /* ! lint */
|
||||
|
||||
@ -906,13 +906,13 @@ saslgetrealm(context, id, availrealms, result)
|
||||
{
|
||||
if (LogLevel > 12)
|
||||
sm_syslog(LOG_INFO, NOQID, "saslgetrealm: realm %s available realms %s",
|
||||
context,
|
||||
availrealms == NULL ? "<No Realms>" : *availrealms);
|
||||
context == NULL ? "<No Context>" : (char *) context,
|
||||
(availrealms == NULL || *availrealms == NULL) ? "<No Realms>" : *availrealms);
|
||||
if (context == NULL)
|
||||
return SASL_FAIL;
|
||||
|
||||
/* check whether context is in list? */
|
||||
if (availrealms != NULL)
|
||||
if (availrealms != NULL && *availrealms != NULL)
|
||||
{
|
||||
if (iteminlist(context, (char *)(*availrealms + 1), " ,}") ==
|
||||
NULL)
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: version.c,v 8.43.4.11 2000/07/19 20:40:59 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: version.c,v 8.43.4.16 2000/09/21 04:12:23 geir Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
char Version[] = "8.11.0";
|
||||
char Version[] = "8.11.1";
|
||||
|
@ -21,7 +21,7 @@ static char copyright[] =
|
||||
#endif /* ! lint */
|
||||
|
||||
#ifndef lint
|
||||
static char id[] = "@(#)$Id: vacation.c,v 8.68.4.4 2000/07/18 05:10:29 gshapiro Exp $";
|
||||
static char id[] = "@(#)$Id: vacation.c,v 8.68.4.7 2000/09/05 21:48:45 gshapiro Exp $";
|
||||
#endif /* ! lint */
|
||||
|
||||
#include <ctype.h>
|
||||
@ -106,6 +106,13 @@ static void debuglog __P((int, const char *, ...));
|
||||
# define msglog syslog
|
||||
#endif /* _FFR_DEBUG */
|
||||
|
||||
static void eatmsg __P((void));
|
||||
|
||||
/* exit after reading input */
|
||||
#define EXITIT(excode) { \
|
||||
eatmsg(); \
|
||||
exit(excode); \
|
||||
}
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
@ -118,6 +125,7 @@ main(argc, argv)
|
||||
int mfail = 0, ufail = 0;
|
||||
int ch;
|
||||
int result;
|
||||
long sff;
|
||||
time_t interval;
|
||||
struct passwd *pw;
|
||||
ALIAS *cur;
|
||||
@ -135,6 +143,19 @@ main(argc, argv)
|
||||
extern void setreply __P((char *, time_t));
|
||||
extern void sendmessage __P((char *, char *, bool));
|
||||
extern void xclude __P((FILE *));
|
||||
#if _FFR_LISTDB
|
||||
#define EXITM(excode) { \
|
||||
if (!iflag && !lflag) \
|
||||
eatmsg(); \
|
||||
exit(excode); \
|
||||
}
|
||||
#else /* _FFR_LISTDB */
|
||||
#define EXITM(excode) { \
|
||||
if (!iflag) \
|
||||
eatmsg(); \
|
||||
exit(excode); \
|
||||
}
|
||||
#endif /* _FFR_LISTDB */
|
||||
|
||||
/* Vars needed to link with smutil */
|
||||
clrbitmap(DontBlameSendmail);
|
||||
@ -261,7 +282,7 @@ main(argc, argv)
|
||||
{
|
||||
msglog(LOG_NOTICE,
|
||||
"vacation: can't allocate memory for alias.\n");
|
||||
exit(EX_TEMPFAIL);
|
||||
EXITM(EX_TEMPFAIL);
|
||||
}
|
||||
if (ufail != 0)
|
||||
usage();
|
||||
@ -278,7 +299,7 @@ main(argc, argv)
|
||||
{
|
||||
msglog(LOG_ERR,
|
||||
"vacation: no such user uid %u.\n", getuid());
|
||||
exit(EX_NOUSER);
|
||||
EXITM(EX_NOUSER);
|
||||
}
|
||||
}
|
||||
#if _FFR_BLACKBOX
|
||||
@ -287,14 +308,14 @@ main(argc, argv)
|
||||
else if ((pw = getpwnam(*argv)) == NULL)
|
||||
{
|
||||
msglog(LOG_ERR, "vacation: no such user %s.\n", *argv);
|
||||
exit(EX_NOUSER);
|
||||
EXITM(EX_NOUSER);
|
||||
}
|
||||
name = pw->pw_name;
|
||||
if (chdir(pw->pw_dir) != 0)
|
||||
{
|
||||
msglog(LOG_NOTICE,
|
||||
"vacation: no such directory %s.\n", pw->pw_dir);
|
||||
exit(EX_NOINPUT);
|
||||
EXITM(EX_NOINPUT);
|
||||
}
|
||||
#endif /* _FFR_BLACKBOX */
|
||||
user_info.smdbu_id = pw->pw_uid;
|
||||
@ -302,15 +323,23 @@ main(argc, argv)
|
||||
(void) strlcpy(user_info.smdbu_name, pw->pw_name,
|
||||
SMDB_MAX_USER_NAME_LEN);
|
||||
|
||||
sff = SFF_CREAT;
|
||||
#if _FFR_BLACKBOX
|
||||
if (getegid() != getgid())
|
||||
RunAsGid = user_info.smdbu_group_id = getegid();
|
||||
|
||||
sff |= SFF_NOPATHCHECK|SFF_OPENASROOT;
|
||||
#endif /* _FFR_BLACKBOX */
|
||||
|
||||
result = smdb_open_database(&Db, dbfilename,
|
||||
O_CREAT|O_RDWR | (iflag ? O_TRUNC : 0),
|
||||
S_IRUSR|S_IWUSR, SFF_CREAT,
|
||||
S_IRUSR|S_IWUSR, sff,
|
||||
SMDB_TYPE_DEFAULT, &user_info, NULL);
|
||||
if (result != SMDBE_OK)
|
||||
{
|
||||
msglog(LOG_NOTICE, "vacation: %s: %s\n", dbfilename,
|
||||
errstring(result));
|
||||
exit(EX_DATAERR);
|
||||
EXITM(EX_DATAERR);
|
||||
}
|
||||
|
||||
#if _FFR_LISTDB
|
||||
@ -338,14 +367,14 @@ main(argc, argv)
|
||||
{
|
||||
xclude(stdin);
|
||||
result = Db->smdb_close(Db);
|
||||
exit(EX_OK);
|
||||
EXITM(EX_OK);
|
||||
}
|
||||
|
||||
if ((cur = (ALIAS *)malloc((u_int)sizeof(ALIAS))) == NULL)
|
||||
{
|
||||
msglog(LOG_NOTICE,
|
||||
"vacation: can't allocate memory for username.\n");
|
||||
exit(EX_OSERR);
|
||||
EXITM(EX_OSERR);
|
||||
}
|
||||
cur->name = name;
|
||||
cur->next = Names;
|
||||
@ -368,6 +397,27 @@ main(argc, argv)
|
||||
return EX_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** EATMSG -- read stdin till EOF
|
||||
**
|
||||
** Parameters:
|
||||
** none.
|
||||
**
|
||||
** Returns:
|
||||
** nothing.
|
||||
**
|
||||
*/
|
||||
static void
|
||||
eatmsg()
|
||||
{
|
||||
/*
|
||||
** read the rest of the e-mail and ignore it to avoid problems
|
||||
** with EPIPE in sendmail
|
||||
*/
|
||||
while (getc(stdin) != EOF)
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
** READHEADERS -- read mail headers
|
||||
**
|
||||
@ -377,6 +427,9 @@ main(argc, argv)
|
||||
** Returns:
|
||||
** nothing.
|
||||
**
|
||||
** Side Effects:
|
||||
** may exit().
|
||||
**
|
||||
*/
|
||||
void
|
||||
readheaders()
|
||||
@ -410,7 +463,7 @@ readheaders()
|
||||
{
|
||||
msglog(LOG_NOTICE,
|
||||
"vacation: badly formatted \"From \" line.\n");
|
||||
exit(EX_DATAERR);
|
||||
EXITIT(EX_DATAERR);
|
||||
}
|
||||
}
|
||||
else if (*p == '"')
|
||||
@ -425,7 +478,7 @@ readheaders()
|
||||
{
|
||||
msglog(LOG_NOTICE,
|
||||
"vacation: badly formatted \"From \" line.\n");
|
||||
exit(EX_DATAERR);
|
||||
EXITIT(EX_DATAERR);
|
||||
}
|
||||
*p = '\0';
|
||||
|
||||
@ -436,7 +489,7 @@ readheaders()
|
||||
if ((p = strchr(buf + 5, '\n')) != NULL)
|
||||
*p = '\0';
|
||||
if (junkmail(buf + 5))
|
||||
exit(EX_OK);
|
||||
EXITIT(EX_OK);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -456,7 +509,7 @@ readheaders()
|
||||
if (strncasecmp(p, "junk", 4) == 0 ||
|
||||
strncasecmp(p, "bulk", 4) == 0 ||
|
||||
strncasecmp(p, "list", 4) == 0)
|
||||
exit(EX_OK);
|
||||
EXITIT(EX_OK);
|
||||
break;
|
||||
|
||||
case 'C': /* "Cc:" */
|
||||
@ -487,11 +540,11 @@ readheaders()
|
||||
}
|
||||
}
|
||||
if (!tome)
|
||||
exit(EX_OK);
|
||||
EXITIT(EX_OK);
|
||||
if (*From == '\0')
|
||||
{
|
||||
msglog(LOG_NOTICE, "vacation: no initial \"From \" line.\n");
|
||||
exit(EX_DATAERR);
|
||||
EXITIT(EX_DATAERR);
|
||||
}
|
||||
}
|
||||
|
||||
@ -801,8 +854,8 @@ sendmessage(myname, msgfn, emptysender)
|
||||
(void) fclose(mfp);
|
||||
if (emptysender)
|
||||
myname = "<>";
|
||||
(void) execl(_PATH_SENDMAIL, "sendmail", "-f", myname, "--",
|
||||
From, NULL);
|
||||
(void) execl(_PATH_SENDMAIL, "sendmail", "-oi",
|
||||
"-f", myname, "--", From, NULL);
|
||||
msglog(LOG_ERR, "vacation: can't exec %s: %s",
|
||||
_PATH_SENDMAIL, errstring(errno));
|
||||
exit(EX_UNAVAILABLE);
|
||||
|
Loading…
Reference in New Issue
Block a user