xref: /freebsd/contrib/sendmail/cf/README (revision 5b0945b57059d1cde0831d3afea7ec56c7d79508)
1c2aa98e2SPeter Wemm
206f25ae9SGregory Neil Shapiro		SENDMAIL CONFIGURATION FILES
3c2aa98e2SPeter Wemm
440266059SGregory Neil ShapiroThis document describes the sendmail configuration files.  It
540266059SGregory Neil Shapiroexplains how to create a sendmail.cf file for use with sendmail.
640266059SGregory Neil ShapiroIt also describes how to set options for sendmail which are explained
740266059SGregory Neil Shapiroin the Sendmail Installation and Operation guide (doc/op/op.me).
8c2aa98e2SPeter Wemm
940266059SGregory Neil ShapiroTo get started, you may want to look at tcpproto.mc (for TCP-only
1040266059SGregory Neil Shapirosites) and clientproto.mc (for clusters of clients using a single
1140266059SGregory Neil Shapiromail host), or the generic-*.mc files as operating system-specific
1240266059SGregory Neil Shapiroexamples.
13c2aa98e2SPeter Wemm
1440266059SGregory Neil ShapiroTable of Content:
1540266059SGregory Neil Shapiro
1640266059SGregory Neil ShapiroINTRODUCTION AND EXAMPLE
1740266059SGregory Neil ShapiroA BRIEF INTRODUCTION TO M4
1840266059SGregory Neil ShapiroFILE LOCATIONS
1940266059SGregory Neil ShapiroOSTYPE
2040266059SGregory Neil ShapiroDOMAINS
2140266059SGregory Neil ShapiroMAILERS
2240266059SGregory Neil ShapiroFEATURES
2340266059SGregory Neil ShapiroHACKS
2440266059SGregory Neil ShapiroSITE CONFIGURATION
2540266059SGregory Neil ShapiroUSING UUCP MAILERS
2640266059SGregory Neil ShapiroTWEAKING RULESETS
2740266059SGregory Neil ShapiroMASQUERADING AND RELAYING
2840266059SGregory Neil ShapiroUSING LDAP FOR ALIASES, MAPS, AND CLASSES
2940266059SGregory Neil ShapiroLDAP ROUTING
3040266059SGregory Neil ShapiroANTI-SPAM CONFIGURATION CONTROL
31e92d3f3fSGregory Neil ShapiroCONNECTION CONTROL
3240266059SGregory Neil ShapiroSTARTTLS
3340266059SGregory Neil ShapiroSMTP AUTHENTICATION
3440266059SGregory Neil ShapiroADDING NEW MAILERS OR RULESETS
3540266059SGregory Neil ShapiroADDING NEW MAIL FILTERS
3640266059SGregory Neil ShapiroQUEUE GROUP DEFINITIONS
3740266059SGregory Neil ShapiroNON-SMTP BASED CONFIGURATIONS
3840266059SGregory Neil ShapiroWHO AM I?
3940266059SGregory Neil ShapiroACCEPTING MAIL FOR MULTIPLE NAMES
4040266059SGregory Neil ShapiroUSING MAILERTABLES
4140266059SGregory Neil ShapiroUSING USERDB TO MAP FULL NAMES
4240266059SGregory Neil ShapiroMISCELLANEOUS SPECIAL FEATURES
4340266059SGregory Neil ShapiroSECURITY NOTES
4440266059SGregory Neil ShapiroTWEAKING CONFIGURATION OPTIONS
4540266059SGregory Neil ShapiroMESSAGE SUBMISSION PROGRAM
4640266059SGregory Neil ShapiroFORMAT OF FILES AND MAPS
4740266059SGregory Neil ShapiroDIRECTORY LAYOUT
4840266059SGregory Neil ShapiroADMINISTRATIVE DETAILS
49c2aa98e2SPeter Wemm
50c2aa98e2SPeter Wemm
51c2aa98e2SPeter Wemm+--------------------------+
52c2aa98e2SPeter Wemm| INTRODUCTION AND EXAMPLE |
53c2aa98e2SPeter Wemm+--------------------------+
54c2aa98e2SPeter Wemm
55c2aa98e2SPeter WemmConfiguration files are contained in the subdirectory "cf", with a
56c2aa98e2SPeter Wemmsuffix ".mc".  They must be run through "m4" to produce a ".cf" file.
57c2aa98e2SPeter WemmYou must pre-load "cf.m4":
58c2aa98e2SPeter Wemm
59c2aa98e2SPeter Wemm	m4 ${CFDIR}/m4/cf.m4 config.mc > config.cf
60c2aa98e2SPeter Wemm
6106f25ae9SGregory Neil ShapiroAlternatively, you can simply:
6206f25ae9SGregory Neil Shapiro
6306f25ae9SGregory Neil Shapiro	cd ${CFDIR}/cf
6406f25ae9SGregory Neil Shapiro	./Build config.cf
6506f25ae9SGregory Neil Shapiro
66c2aa98e2SPeter Wemmwhere ${CFDIR} is the root of the cf directory and config.mc is the
67c2aa98e2SPeter Wemmname of your configuration file.  If you are running a version of M4
68c2aa98e2SPeter Wemmthat understands the __file__ builtin (versions of GNU m4 >= 0.75 do
69c2aa98e2SPeter Wemmthis, but the versions distributed with 4.4BSD and derivatives do not)
70c2aa98e2SPeter Wemmor the -I flag (ditto), then ${CFDIR} can be in an arbitrary directory.
71c2aa98e2SPeter WemmFor "traditional" versions, ${CFDIR} ***MUST*** be "..", or you MUST
72c2aa98e2SPeter Wemmuse -D_CF_DIR_=/path/to/cf/dir/ -- note the trailing slash!  For example:
73c2aa98e2SPeter Wemm
74c2aa98e2SPeter Wemm	m4 -D_CF_DIR_=${CFDIR}/ ${CFDIR}/m4/cf.m4 config.mc > config.cf
75c2aa98e2SPeter Wemm
76c2aa98e2SPeter WemmLet's examine a typical .mc file:
77c2aa98e2SPeter Wemm
78c2aa98e2SPeter Wemm	divert(-1)
79c2aa98e2SPeter Wemm	#
805dd76dd0SGregory Neil Shapiro	# Copyright (c) 1998-2005 Proofpoint, Inc. and its suppliers.
8106f25ae9SGregory Neil Shapiro	#	All rights reserved.
82c2aa98e2SPeter Wemm	# Copyright (c) 1983 Eric P. Allman.  All rights reserved.
83c2aa98e2SPeter Wemm	# Copyright (c) 1988, 1993
84c2aa98e2SPeter Wemm	#	The Regents of the University of California.  All rights reserved.
85c2aa98e2SPeter Wemm	#
86c2aa98e2SPeter Wemm	# By using this file, you agree to the terms and conditions set
87c2aa98e2SPeter Wemm	# forth in the LICENSE file which can be found at the top level of
88c2aa98e2SPeter Wemm	# the sendmail distribution.
89c2aa98e2SPeter Wemm	#
90c2aa98e2SPeter Wemm
91c2aa98e2SPeter Wemm	#
92c2aa98e2SPeter Wemm	#  This is a Berkeley-specific configuration file for HP-UX 9.x.
93c2aa98e2SPeter Wemm	#  It applies only to the Computer Science Division at Berkeley,
94c2aa98e2SPeter Wemm	#  and should not be used elsewhere.   It is provided on the sendmail
95c2aa98e2SPeter Wemm	#  distribution as a sample only.  To create your own configuration
96c2aa98e2SPeter Wemm	#  file, create an appropriate domain file in ../domain, change the
97c2aa98e2SPeter Wemm	#  `DOMAIN' macro below to reference that file, and copy the result
98c2aa98e2SPeter Wemm	#  to a name of your own choosing.
99c2aa98e2SPeter Wemm	#
100c2aa98e2SPeter Wemm	divert(0)
101c2aa98e2SPeter Wemm
102c2aa98e2SPeter WemmThe divert(-1) will delete the crud in the resulting output file.
103c2aa98e2SPeter WemmThe copyright notice can be replaced by whatever your lawyers require;
10406f25ae9SGregory Neil Shapiroour lawyers require the one that is included in these files.  A copyleft
105c2aa98e2SPeter Wemmis a copyright by another name.  The divert(0) restores regular output.
106c2aa98e2SPeter Wemm
107c2aa98e2SPeter Wemm	VERSIONID(`<SCCS or RCS version id>')
108c2aa98e2SPeter Wemm
109c2aa98e2SPeter WemmVERSIONID is a macro that stuffs the version information into the
11006f25ae9SGregory Neil Shapiroresulting file.  You could use SCCS, RCS, CVS, something else, or
111c2aa98e2SPeter Wemmomit it completely.  This is not the same as the version id included
112c2aa98e2SPeter Wemmin SMTP greeting messages -- this is defined in m4/version.m4.
113c2aa98e2SPeter Wemm
11406f25ae9SGregory Neil Shapiro	OSTYPE(`hpux9')dnl
115c2aa98e2SPeter Wemm
116c2aa98e2SPeter WemmYou must specify an OSTYPE to properly configure things such as the
117c2aa98e2SPeter Wemmpathname of the help and status files, the flags needed for the local
118c2aa98e2SPeter Wemmmailer, and other important things.  If you omit it, you will get an
119c2aa98e2SPeter Wemmerror when you try to build the configuration.  Look at the ostype
120c2aa98e2SPeter Wemmdirectory for the list of known operating system types.
121c2aa98e2SPeter Wemm
12206f25ae9SGregory Neil Shapiro	DOMAIN(`CS.Berkeley.EDU')dnl
123c2aa98e2SPeter Wemm
124c2aa98e2SPeter WemmThis example is specific to the Computer Science Division at Berkeley.
12506f25ae9SGregory Neil ShapiroYou can use "DOMAIN(`generic')" to get a sufficiently bland definition
126c2aa98e2SPeter Wemmthat may well work for you, or you can create a customized domain
127c2aa98e2SPeter Wemmdefinition appropriate for your environment.
128c2aa98e2SPeter Wemm
12906f25ae9SGregory Neil Shapiro	MAILER(`local')
13006f25ae9SGregory Neil Shapiro	MAILER(`smtp')
131c2aa98e2SPeter Wemm
13240266059SGregory Neil ShapiroThese describe the mailers used at the default CS site.  The local
13340266059SGregory Neil Shapiromailer is always included automatically.  Beware: MAILER declarations
134e92d3f3fSGregory Neil Shapiroshould only be followed by LOCAL_* sections.  The general rules are
135e92d3f3fSGregory Neil Shapirothat the order should be:
136c2aa98e2SPeter Wemm
137c2aa98e2SPeter Wemm	VERSIONID
138c2aa98e2SPeter Wemm	OSTYPE
139c2aa98e2SPeter Wemm	DOMAIN
140c2aa98e2SPeter Wemm	FEATURE
141c2aa98e2SPeter Wemm	local macro definitions
142c2aa98e2SPeter Wemm	MAILER
14340266059SGregory Neil Shapiro	LOCAL_CONFIG
14406f25ae9SGregory Neil Shapiro	LOCAL_RULE_*
14506f25ae9SGregory Neil Shapiro	LOCAL_RULESETS
14606f25ae9SGregory Neil Shapiro
14706f25ae9SGregory Neil ShapiroThere are a few exceptions to this rule.  Local macro definitions which
14806f25ae9SGregory Neil Shapiroinfluence a FEATURE() should be done before that feature.  For example,
14906f25ae9SGregory Neil Shapiroa define(`PROCMAIL_MAILER_PATH', ...) should be done before
15006f25ae9SGregory Neil ShapiroFEATURE(`local_procmail').
151c2aa98e2SPeter Wemm
15240266059SGregory Neil Shapiro*******************************************************************
15340266059SGregory Neil Shapiro***  BE SURE YOU CUSTOMIZE THESE FILES!  They have some		***
15440266059SGregory Neil Shapiro***  Berkeley-specific assumptions built in, such as the name	***
15540266059SGregory Neil Shapiro***  of their UUCP-relay.  You'll want to create your own	***
15640266059SGregory Neil Shapiro***  domain description, and use that in place of		***
15740266059SGregory Neil Shapiro***  domain/Berkeley.EDU.m4.					***
15840266059SGregory Neil Shapiro*******************************************************************
15940266059SGregory Neil Shapiro
160c2aa98e2SPeter Wemm
161da7d7b9cSGregory Neil ShapiroNote:
162da7d7b9cSGregory Neil ShapiroSome rulesets, features, and options are only useful if the sendmail
163da7d7b9cSGregory Neil Shapirobinary has been compiled with the appropriate options, e.g., the
164da7d7b9cSGregory Neil Shapiroruleset tls_server is only invoked if sendmail has been compiled
165da7d7b9cSGregory Neil Shapirowith STARTTLS. This is usually obvious from the context and hence
166da7d7b9cSGregory Neil Shapironot further specified here.
167da7d7b9cSGregory Neil ShapiroThere are also so called "For Future Releases" (FFR) compile time
168da7d7b9cSGregory Neil Shapirooptions which might be included in a subsequent version or might
169da7d7b9cSGregory Neil Shapirosimply be removed as they turned out not to be really useful.
170da7d7b9cSGregory Neil ShapiroThese are generally not documented but if they are, then the required
171da7d7b9cSGregory Neil Shapirocompile time options are listed in doc/op/op.* for rulesets and
172da7d7b9cSGregory Neil Shapiromacros, and for mc/cf specific options they are usually listed here.
173da7d7b9cSGregory Neil ShapiroIn addition to compile time options for the sendmail binary, there
174da7d7b9cSGregory Neil Shapirocan also be FFRs for mc/cf which in general can be enabled when the
175da7d7b9cSGregory Neil Shapiroconfiguration file is generated by defining them at the top of your
176da7d7b9cSGregory Neil Shapiro.mc file:
177da7d7b9cSGregory Neil Shapiro
178da7d7b9cSGregory Neil Shapirodefine(`_FFR_NAME_HERE', 1)
179da7d7b9cSGregory Neil Shapiro
180da7d7b9cSGregory Neil Shapiro
181c2aa98e2SPeter Wemm+----------------------------+
182c2aa98e2SPeter Wemm| A BRIEF INTRODUCTION TO M4 |
183c2aa98e2SPeter Wemm+----------------------------+
184c2aa98e2SPeter Wemm
185c2aa98e2SPeter WemmSendmail uses the M4 macro processor to ``compile'' the configuration
186c2aa98e2SPeter Wemmfiles.  The most important thing to know is that M4 is stream-based,
187c2aa98e2SPeter Wemmthat is, it doesn't understand about lines.  For this reason, in some
188c2aa98e2SPeter Wemmplaces you may see the word ``dnl'', which stands for ``delete
189c2aa98e2SPeter Wemmthrough newline''; essentially, it deletes all characters starting
190c2aa98e2SPeter Wemmat the ``dnl'' up to and including the next newline character.  In
191c2aa98e2SPeter Wemmmost cases sendmail uses this only to avoid lots of unnecessary
192c2aa98e2SPeter Wemmblank lines in the output.
193c2aa98e2SPeter Wemm
194c2aa98e2SPeter WemmOther important directives are define(A, B) which defines the macro
195c2aa98e2SPeter Wemm``A'' to have value ``B''.  Macros are expanded as they are read, so
196c2aa98e2SPeter Wemmone normally quotes both values to prevent expansion.  For example,
197c2aa98e2SPeter Wemm
198c2aa98e2SPeter Wemm	define(`SMART_HOST', `smart.foo.com')
199c2aa98e2SPeter Wemm
200c2aa98e2SPeter WemmOne word of warning:  M4 macros are expanded even in lines that appear
201c2aa98e2SPeter Wemmto be comments.  For example, if you have
202c2aa98e2SPeter Wemm
20306f25ae9SGregory Neil Shapiro	# See FEATURE(`foo') above
204c2aa98e2SPeter Wemm
20506f25ae9SGregory Neil Shapiroit will not do what you expect, because the FEATURE(`foo') will be
206c2aa98e2SPeter Wemmexpanded.  This also applies to
207c2aa98e2SPeter Wemm
208c2aa98e2SPeter Wemm	# And then define the $X macro to be the return address
209c2aa98e2SPeter Wemm
210c2aa98e2SPeter Wemmbecause ``define'' is an M4 keyword.  If you want to use them, surround
211c2aa98e2SPeter Wemmthem with directed quotes, `like this'.
212c2aa98e2SPeter Wemm
21313bd1963SGregory Neil ShapiroSince m4 uses single quotes (opening "`" and closing "'") to quote
21413bd1963SGregory Neil Shapiroarguments, those quotes can't be used in arguments.  For example,
21513bd1963SGregory Neil Shapiroit is not possible to define a rejection message containing a single
21613bd1963SGregory Neil Shapiroquote. Usually there are simple workarounds by changing those
21713bd1963SGregory Neil Shapiromessages; in the worst case it might be ok to change the value
21813bd1963SGregory Neil Shapirodirectly in the generated .cf file, which however is not advised.
21913bd1963SGregory Neil Shapiro
22040266059SGregory Neil Shapiro
22140266059SGregory Neil ShapiroNotice:
22240266059SGregory Neil Shapiro-------
22340266059SGregory Neil Shapiro
22440266059SGregory Neil ShapiroThis package requires a post-V7 version of m4; if you are running the
22540266059SGregory Neil Shapiro4.2bsd, SysV.2, or 7th Edition version.  SunOS's /usr/5bin/m4 or
22640266059SGregory Neil ShapiroBSD-Net/2's m4 both work.  GNU m4 version 1.1 or later also works.
22740266059SGregory Neil ShapiroUnfortunately, the M4 on BSDI 1.0 doesn't work -- you'll have to use a
22840266059SGregory Neil ShapiroNet/2 or GNU version.  GNU m4 is available from
22940266059SGregory Neil Shapiroftp://ftp.gnu.org/pub/gnu/m4/m4-1.4.tar.gz (check for the latest version).
23040266059SGregory Neil ShapiroEXCEPTIONS: DEC's m4 on Digital UNIX 4.x is broken (3.x is fine).  Use GNU
23140266059SGregory Neil Shapirom4 on this platform.
23240266059SGregory Neil Shapiro
23340266059SGregory Neil Shapiro
234c2aa98e2SPeter Wemm+----------------+
235c2aa98e2SPeter Wemm| FILE LOCATIONS |
236c2aa98e2SPeter Wemm+----------------+
237c2aa98e2SPeter Wemm
238c2aa98e2SPeter Wemmsendmail 8.9 has introduced a new configuration directory for sendmail
239c2aa98e2SPeter Wemmrelated files, /etc/mail.  The new files available for sendmail 8.9 --
24006f25ae9SGregory Neil Shapirothe class {R} /etc/mail/relay-domains and the access database
24106f25ae9SGregory Neil Shapiro/etc/mail/access -- take advantage of this new directory.  Beginning with
24206f25ae9SGregory Neil Shapiro8.10, all files will use this directory by default (some options may be
24306f25ae9SGregory Neil Shapiroset by OSTYPE() files).  This new directory should help to restore
24406f25ae9SGregory Neil Shapirouniformity to sendmail's file locations.
24506f25ae9SGregory Neil Shapiro
24606f25ae9SGregory Neil ShapiroBelow is a table of some of the common changes:
24706f25ae9SGregory Neil Shapiro
24806f25ae9SGregory Neil ShapiroOld filename			New filename
24906f25ae9SGregory Neil Shapiro------------			------------
25006f25ae9SGregory Neil Shapiro/etc/bitdomain			/etc/mail/bitdomain
25106f25ae9SGregory Neil Shapiro/etc/domaintable		/etc/mail/domaintable
25206f25ae9SGregory Neil Shapiro/etc/genericstable		/etc/mail/genericstable
25306f25ae9SGregory Neil Shapiro/etc/uudomain			/etc/mail/uudomain
25406f25ae9SGregory Neil Shapiro/etc/virtusertable		/etc/mail/virtusertable
25506f25ae9SGregory Neil Shapiro/etc/userdb			/etc/mail/userdb
25606f25ae9SGregory Neil Shapiro
25706f25ae9SGregory Neil Shapiro/etc/aliases			/etc/mail/aliases
25806f25ae9SGregory Neil Shapiro/etc/sendmail/aliases		/etc/mail/aliases
25906f25ae9SGregory Neil Shapiro/etc/ucbmail/aliases		/etc/mail/aliases
26006f25ae9SGregory Neil Shapiro/usr/adm/sendmail/aliases	/etc/mail/aliases
26106f25ae9SGregory Neil Shapiro/usr/lib/aliases		/etc/mail/aliases
26206f25ae9SGregory Neil Shapiro/usr/lib/mail/aliases		/etc/mail/aliases
26306f25ae9SGregory Neil Shapiro/usr/ucblib/aliases		/etc/mail/aliases
26406f25ae9SGregory Neil Shapiro
26506f25ae9SGregory Neil Shapiro/etc/sendmail.cw		/etc/mail/local-host-names
26606f25ae9SGregory Neil Shapiro/etc/mail/sendmail.cw		/etc/mail/local-host-names
26706f25ae9SGregory Neil Shapiro/etc/sendmail/sendmail.cw	/etc/mail/local-host-names
26806f25ae9SGregory Neil Shapiro
26906f25ae9SGregory Neil Shapiro/etc/sendmail.ct		/etc/mail/trusted-users
27006f25ae9SGregory Neil Shapiro
27106f25ae9SGregory Neil Shapiro/etc/sendmail.oE		/etc/mail/error-header
27206f25ae9SGregory Neil Shapiro
27306f25ae9SGregory Neil Shapiro/etc/sendmail.hf		/etc/mail/helpfile
27406f25ae9SGregory Neil Shapiro/etc/mail/sendmail.hf		/etc/mail/helpfile
27506f25ae9SGregory Neil Shapiro/usr/ucblib/sendmail.hf		/etc/mail/helpfile
27606f25ae9SGregory Neil Shapiro/etc/ucbmail/sendmail.hf	/etc/mail/helpfile
27706f25ae9SGregory Neil Shapiro/usr/lib/sendmail.hf		/etc/mail/helpfile
27806f25ae9SGregory Neil Shapiro/usr/share/lib/sendmail.hf	/etc/mail/helpfile
27906f25ae9SGregory Neil Shapiro/usr/share/misc/sendmail.hf	/etc/mail/helpfile
28006f25ae9SGregory Neil Shapiro/share/misc/sendmail.hf		/etc/mail/helpfile
28106f25ae9SGregory Neil Shapiro
28206f25ae9SGregory Neil Shapiro/etc/service.switch		/etc/mail/service.switch
28306f25ae9SGregory Neil Shapiro
28406f25ae9SGregory Neil Shapiro/etc/sendmail.st		/etc/mail/statistics
28506f25ae9SGregory Neil Shapiro/etc/mail/sendmail.st		/etc/mail/statistics
28606f25ae9SGregory Neil Shapiro/etc/mailer/sendmail.st		/etc/mail/statistics
28706f25ae9SGregory Neil Shapiro/etc/sendmail/sendmail.st	/etc/mail/statistics
28806f25ae9SGregory Neil Shapiro/usr/lib/sendmail.st		/etc/mail/statistics
28906f25ae9SGregory Neil Shapiro/usr/ucblib/sendmail.st		/etc/mail/statistics
29006f25ae9SGregory Neil Shapiro
29106f25ae9SGregory Neil ShapiroNote that all of these paths actually use a new m4 macro MAIL_SETTINGS_DIR
29206f25ae9SGregory Neil Shapiroto create the pathnames.  The default value of this variable is
29306f25ae9SGregory Neil Shapiro`/etc/mail/'.  If you set this macro to a different value, you MUST include
29406f25ae9SGregory Neil Shapiroa trailing slash.
295c2aa98e2SPeter Wemm
29613058a91SGregory Neil ShapiroNotice: all filenames used in a .mc (or .cf) file should be absolute
29713058a91SGregory Neil Shapiro(starting at the root, i.e., with '/').  Relative filenames most
29813058a91SGregory Neil Shapirolikely cause surprises during operations (unless otherwise noted).
29913058a91SGregory Neil Shapiro
30013058a91SGregory Neil Shapiro
301c2aa98e2SPeter Wemm+--------+
302c2aa98e2SPeter Wemm| OSTYPE |
303c2aa98e2SPeter Wemm+--------+
304c2aa98e2SPeter Wemm
305c2aa98e2SPeter WemmYou MUST define an operating system environment, or the configuration
306c2aa98e2SPeter Wemmfile build will puke.  There are several environments available; look
307c2aa98e2SPeter Wemmat the "ostype" directory for the current list.  This macro changes
308c2aa98e2SPeter Wemmthings like the location of the alias file and queue directory.  Some
309c2aa98e2SPeter Wemmof these files are identical to one another.
310c2aa98e2SPeter Wemm
311c2aa98e2SPeter WemmIt is IMPERATIVE that the OSTYPE occur before any MAILER definitions.
312c2aa98e2SPeter WemmIn general, the OSTYPE macro should go immediately after any version
313c2aa98e2SPeter Wemminformation, and MAILER definitions should always go last.
314c2aa98e2SPeter Wemm
315c2aa98e2SPeter WemmOperating system definitions are usually easy to write.  They may define
316c2aa98e2SPeter Wemmthe following variables (everything defaults, so an ostype file may be
317c2aa98e2SPeter Wemmempty).  Unfortunately, the list of configuration-supported systems is
318c2aa98e2SPeter Wemmnot as broad as the list of source-supported systems, since many of
319c2aa98e2SPeter Wemmthe source contributors do not include corresponding ostype files.
320c2aa98e2SPeter Wemm
32106f25ae9SGregory Neil ShapiroALIAS_FILE		[/etc/mail/aliases] The location of the text version
322c2aa98e2SPeter Wemm			of the alias file(s).  It can be a comma-separated
323c2aa98e2SPeter Wemm			list of names (but be sure you quote values with
324c2aa98e2SPeter Wemm			commas in them -- for example, use
325c2aa98e2SPeter Wemm				define(`ALIAS_FILE', `a,b')
326c2aa98e2SPeter Wemm			to get "a" and "b" both listed as alias files;
327c2aa98e2SPeter Wemm			otherwise the define() primitive only sees "a").
32806f25ae9SGregory Neil ShapiroHELP_FILE		[/etc/mail/helpfile] The name of the file
329c2aa98e2SPeter Wemm			containing information printed in response to
330c2aa98e2SPeter Wemm			the SMTP HELP command.
331c2aa98e2SPeter WemmQUEUE_DIR		[/var/spool/mqueue] The directory containing
33206f25ae9SGregory Neil Shapiro			queue files.  To use multiple queues, supply
33306f25ae9SGregory Neil Shapiro			a value ending with an asterisk.  For
334602a2b1bSGregory Neil Shapiro			example, /var/spool/mqueue/qd* will use all of the
33506f25ae9SGregory Neil Shapiro			directories or symbolic links to directories
336602a2b1bSGregory Neil Shapiro			beginning with 'qd' in /var/spool/mqueue as queue
33706f25ae9SGregory Neil Shapiro			directories.  The names 'qf', 'df', and 'xf' are
338602a2b1bSGregory Neil Shapiro			reserved as specific subdirectories for the
339602a2b1bSGregory Neil Shapiro			corresponding queue file types as explained in
34040266059SGregory Neil Shapiro			doc/op/op.me.  See also QUEUE GROUP DEFINITIONS.
34140266059SGregory Neil ShapiroMSP_QUEUE_DIR		[/var/spool/clientmqueue] The directory containing
34240266059SGregory Neil Shapiro			queue files for the MSP (Mail Submission Program,
34340266059SGregory Neil Shapiro			see sendmail/SECURITY).
34406f25ae9SGregory Neil ShapiroSTATUS_FILE		[/etc/mail/statistics] The file containing status
345c2aa98e2SPeter Wemm			information.
346c2aa98e2SPeter WemmLOCAL_MAILER_PATH	[/bin/mail] The program used to deliver local mail.
34706f25ae9SGregory Neil ShapiroLOCAL_MAILER_FLAGS	[Prmn9] The flags used by the local mailer.  The
34806f25ae9SGregory Neil Shapiro			flags lsDFMAw5:/|@q are always included.
349c2aa98e2SPeter WemmLOCAL_MAILER_ARGS	[mail -d $u] The arguments passed to deliver local
350c2aa98e2SPeter Wemm			mail.
351c2aa98e2SPeter WemmLOCAL_MAILER_MAX	[undefined] If defined, the maximum size of local
352c2aa98e2SPeter Wemm			mail that you are willing to accept.
35306f25ae9SGregory Neil ShapiroLOCAL_MAILER_MAXMSGS	[undefined] If defined, the maximum number of
35406f25ae9SGregory Neil Shapiro			messages to deliver in a single connection.  Only
35506f25ae9SGregory Neil Shapiro			useful for LMTP local mailers.
356c2aa98e2SPeter WemmLOCAL_MAILER_CHARSET	[undefined] If defined, messages containing 8-bit data
357c2aa98e2SPeter Wemm			that ARRIVE from an address that resolves to the
358c2aa98e2SPeter Wemm			local mailer and which are converted to MIME will be
359c2aa98e2SPeter Wemm			labeled with this character set.
36006f25ae9SGregory Neil ShapiroLOCAL_MAILER_EOL	[undefined] If defined, the string to use as the
36106f25ae9SGregory Neil Shapiro			end of line for the local mailer.
36206f25ae9SGregory Neil ShapiroLOCAL_MAILER_DSN_DIAGNOSTIC_CODE
36306f25ae9SGregory Neil Shapiro			[X-Unix] The DSN Diagnostic-Code value for the
36406f25ae9SGregory Neil Shapiro			local mailer.  This should be changed with care.
365c2aa98e2SPeter WemmLOCAL_SHELL_PATH	[/bin/sh] The shell used to deliver piped email.
366c2aa98e2SPeter WemmLOCAL_SHELL_FLAGS	[eu9] The flags used by the shell mailer.  The
367c2aa98e2SPeter Wemm			flags lsDFM are always included.
368c2aa98e2SPeter WemmLOCAL_SHELL_ARGS	[sh -c $u] The arguments passed to deliver "prog"
369c2aa98e2SPeter Wemm			mail.
370c2aa98e2SPeter WemmLOCAL_SHELL_DIR		[$z:/] The directory search path in which the
371c2aa98e2SPeter Wemm			shell should run.
37240266059SGregory Neil ShapiroLOCAL_MAILER_QGRP	[undefined] The queue group for the local mailer.
373c2aa98e2SPeter WemmUSENET_MAILER_PATH	[/usr/lib/news/inews] The name of the program
374c2aa98e2SPeter Wemm			used to submit news.
37506f25ae9SGregory Neil ShapiroUSENET_MAILER_FLAGS	[rsDFMmn] The mailer flags for the usenet mailer.
376c2aa98e2SPeter WemmUSENET_MAILER_ARGS	[-m -h -n] The command line arguments for the
37740266059SGregory Neil Shapiro			usenet mailer.  NOTE: Some versions of inews
37840266059SGregory Neil Shapiro			(such as those shipped with newer versions of INN)
37940266059SGregory Neil Shapiro			use different flags.  Double check the defaults
38040266059SGregory Neil Shapiro			against the inews man page.
381959366dcSGregory Neil ShapiroUSENET_MAILER_MAX	[undefined] The maximum size of messages that will
382c2aa98e2SPeter Wemm			be accepted by the usenet mailer.
38340266059SGregory Neil ShapiroUSENET_MAILER_QGRP	[undefined] The queue group for the usenet mailer.
384c2aa98e2SPeter WemmSMTP_MAILER_FLAGS	[undefined] Flags added to SMTP mailer.  Default
38506f25ae9SGregory Neil Shapiro			flags are `mDFMuX' for all SMTP-based mailers; the
38606f25ae9SGregory Neil Shapiro			"esmtp" mailer adds `a'; "smtp8" adds `8'; and
38706f25ae9SGregory Neil Shapiro			"dsmtp" adds `%'.
38806f25ae9SGregory Neil ShapiroRELAY_MAILER_FLAGS	[undefined] Flags added to the relay mailer.  Default
38906f25ae9SGregory Neil Shapiro			flags are `mDFMuX' for all SMTP-based mailers; the
39006f25ae9SGregory Neil Shapiro			relay mailer adds `a8'.  If this is not defined,
39106f25ae9SGregory Neil Shapiro			then SMTP_MAILER_FLAGS is used.
392c2aa98e2SPeter WemmSMTP_MAILER_MAX		[undefined] The maximum size of messages that will
39306f25ae9SGregory Neil Shapiro			be transported using the smtp, smtp8, esmtp, or dsmtp
394c2aa98e2SPeter Wemm			mailers.
39506f25ae9SGregory Neil ShapiroSMTP_MAILER_MAXMSGS	[undefined] If defined, the maximum number of
39606f25ae9SGregory Neil Shapiro			messages to deliver in a single connection for the
39706f25ae9SGregory Neil Shapiro			smtp, smtp8, esmtp, or dsmtp mailers.
398605302a5SGregory Neil ShapiroSMTP_MAILER_MAXRCPTS	[undefined] If defined, the maximum number of
399*5b0945b5SGregory Neil Shapiro			recipients to deliver in a single envelope for the
400605302a5SGregory Neil Shapiro			smtp, smtp8, esmtp, or dsmtp mailers.
40142e5d165SGregory Neil ShapiroSMTP_MAILER_ARGS	[TCP $h] The arguments passed to the smtp mailer.
402c2aa98e2SPeter Wemm			About the only reason you would want to change this
403c2aa98e2SPeter Wemm			would be to change the default port.
40442e5d165SGregory Neil ShapiroESMTP_MAILER_ARGS	[TCP $h] The arguments passed to the esmtp mailer.
40542e5d165SGregory Neil ShapiroSMTP8_MAILER_ARGS	[TCP $h] The arguments passed to the smtp8 mailer.
40642e5d165SGregory Neil ShapiroDSMTP_MAILER_ARGS	[TCP $h] The arguments passed to the dsmtp mailer.
40742e5d165SGregory Neil ShapiroRELAY_MAILER_ARGS	[TCP $h] The arguments passed to the relay mailer.
40840266059SGregory Neil ShapiroSMTP_MAILER_QGRP	[undefined] The queue group for the smtp mailer.
40940266059SGregory Neil ShapiroESMTP_MAILER_QGRP	[undefined] The queue group for the esmtp mailer.
41040266059SGregory Neil ShapiroSMTP8_MAILER_QGRP	[undefined] The queue group for the smtp8 mailer.
41140266059SGregory Neil ShapiroDSMTP_MAILER_QGRP	[undefined] The queue group for the dsmtp mailer.
41240266059SGregory Neil ShapiroRELAY_MAILER_QGRP	[undefined] The queue group for the relay mailer.
41306f25ae9SGregory Neil ShapiroRELAY_MAILER_MAXMSGS	[undefined] If defined, the maximum number of
41406f25ae9SGregory Neil Shapiro			messages to deliver in a single connection for the
41506f25ae9SGregory Neil Shapiro			relay mailer.
416c2aa98e2SPeter WemmSMTP_MAILER_CHARSET	[undefined] If defined, messages containing 8-bit data
417c2aa98e2SPeter Wemm			that ARRIVE from an address that resolves to one of
418c2aa98e2SPeter Wemm			the SMTP mailers and which are converted to MIME will
419c2aa98e2SPeter Wemm			be labeled with this character set.
420da7d7b9cSGregory Neil ShapiroRELAY_MAILER_CHARSET	[undefined] If defined, messages containing 8-bit data
421da7d7b9cSGregory Neil Shapiro			that ARRIVE from an address that resolves to the
422da7d7b9cSGregory Neil Shapiro			relay mailers and which are converted to MIME will
423da7d7b9cSGregory Neil Shapiro			be labeled with this character set.
424d0cef73dSGregory Neil ShapiroSMTP_MAILER_LL		[990] The maximum line length for SMTP mailers
425d0cef73dSGregory Neil Shapiro			(except the relay mailer).
426d0cef73dSGregory Neil ShapiroRELAY_MAILER_LL		[2040] The maximum line length for the relay mailer.
427c2aa98e2SPeter WemmUUCP_MAILER_PATH	[/usr/bin/uux] The program used to send UUCP mail.
428c2aa98e2SPeter WemmUUCP_MAILER_FLAGS	[undefined] Flags added to UUCP mailer.  Default
429c2aa98e2SPeter Wemm			flags are `DFMhuU' (and `m' for uucp-new mailer,
430c2aa98e2SPeter Wemm			minus `U' for uucp-dom mailer).
431c2aa98e2SPeter WemmUUCP_MAILER_ARGS	[uux - -r -z -a$g -gC $h!rmail ($u)] The arguments
432c2aa98e2SPeter Wemm			passed to the UUCP mailer.
433c2aa98e2SPeter WemmUUCP_MAILER_MAX		[100000] The maximum size message accepted for
434c2aa98e2SPeter Wemm			transmission by the UUCP mailers.
435c2aa98e2SPeter WemmUUCP_MAILER_CHARSET	[undefined] If defined, messages containing 8-bit data
436c2aa98e2SPeter Wemm			that ARRIVE from an address that resolves to one of
437c2aa98e2SPeter Wemm			the UUCP mailers and which are converted to MIME will
438c2aa98e2SPeter Wemm			be labeled with this character set.
43940266059SGregory Neil ShapiroUUCP_MAILER_QGRP	[undefined] The queue group for the UUCP mailers.
440c2aa98e2SPeter WemmFAX_MAILER_PATH		[/usr/local/lib/fax/mailfax] The program used to
441c2aa98e2SPeter Wemm			submit FAX messages.
442c2aa98e2SPeter WemmFAX_MAILER_ARGS		[mailfax $u $h $f] The arguments passed to the FAX
443c2aa98e2SPeter Wemm			mailer.
444c2aa98e2SPeter WemmFAX_MAILER_MAX		[100000] The maximum size message accepted for
445c2aa98e2SPeter Wemm			transmission by FAX.
446c2aa98e2SPeter WemmPOP_MAILER_PATH		[/usr/lib/mh/spop] The pathname of the POP mailer.
44706f25ae9SGregory Neil ShapiroPOP_MAILER_FLAGS	[Penu] Flags added to POP mailer.  Flags lsDFMq
448c2aa98e2SPeter Wemm			are always added.
449c2aa98e2SPeter WemmPOP_MAILER_ARGS		[pop $u] The arguments passed to the POP mailer.
45040266059SGregory Neil ShapiroPOP_MAILER_QGRP		[undefined] The queue group for the pop mailer.
451c2aa98e2SPeter WemmPROCMAIL_MAILER_PATH	[/usr/local/bin/procmail] The path to the procmail
4522e43090eSPeter Wemm			program.  This is also used by
4532e43090eSPeter Wemm			FEATURE(`local_procmail').
454c2aa98e2SPeter WemmPROCMAIL_MAILER_FLAGS	[SPhnu9] Flags added to Procmail mailer.  Flags
45506f25ae9SGregory Neil Shapiro			DFM are always set.  This is NOT used by
4562e43090eSPeter Wemm			FEATURE(`local_procmail'); tweak LOCAL_MAILER_FLAGS
457c2aa98e2SPeter Wemm			instead.
458c2aa98e2SPeter WemmPROCMAIL_MAILER_ARGS	[procmail -Y -m $h $f $u] The arguments passed to
459c2aa98e2SPeter Wemm			the Procmail mailer.  This is NOT used by
4602e43090eSPeter Wemm			FEATURE(`local_procmail'); tweak LOCAL_MAILER_ARGS
461c2aa98e2SPeter Wemm			instead.
462c2aa98e2SPeter WemmPROCMAIL_MAILER_MAX	[undefined] If set, the maximum size message that
463c2aa98e2SPeter Wemm			will be accepted by the procmail mailer.
46440266059SGregory Neil ShapiroPROCMAIL_MAILER_QGRP	[undefined] The queue group for the procmail mailer.
465c2aa98e2SPeter WemmMAIL11_MAILER_PATH	[/usr/etc/mail11] The path to the mail11 mailer.
466c2aa98e2SPeter WemmMAIL11_MAILER_FLAGS	[nsFx] Flags for the mail11 mailer.
467c2aa98e2SPeter WemmMAIL11_MAILER_ARGS	[mail11 $g $x $h $u] Arguments passed to the mail11
468c2aa98e2SPeter Wemm			mailer.
46940266059SGregory Neil ShapiroMAIL11_MAILER_QGRP	[undefined] The queue group for the mail11 mailer.
470c2aa98e2SPeter WemmPH_MAILER_PATH		[/usr/local/etc/phquery] The path to the phquery
471c2aa98e2SPeter Wemm			program.
47206f25ae9SGregory Neil ShapiroPH_MAILER_FLAGS		[ehmu] Flags for the phquery mailer.  Flags nrDFM
47306f25ae9SGregory Neil Shapiro			are always set.
474c2aa98e2SPeter WemmPH_MAILER_ARGS		[phquery -- $u] -- arguments to the phquery mailer.
47540266059SGregory Neil ShapiroPH_MAILER_QGRP		[undefined] The queue group for the ph mailer.
47606f25ae9SGregory Neil ShapiroCYRUS_MAILER_FLAGS	[Ah5@/:|] The flags used by the cyrus mailer.  The
477c2aa98e2SPeter Wemm			flags lsDFMnPq are always included.
478c2aa98e2SPeter WemmCYRUS_MAILER_PATH	[/usr/cyrus/bin/deliver] The program used to deliver
479c2aa98e2SPeter Wemm			cyrus mail.
480c2aa98e2SPeter WemmCYRUS_MAILER_ARGS	[deliver -e -m $h -- $u] The arguments passed
481c2aa98e2SPeter Wemm			to deliver cyrus mail.
482c2aa98e2SPeter WemmCYRUS_MAILER_MAX	[undefined] If set, the maximum size message that
483c2aa98e2SPeter Wemm			will be accepted by the cyrus mailer.
484c2aa98e2SPeter WemmCYRUS_MAILER_USER	[cyrus:mail] The user and group to become when
485c2aa98e2SPeter Wemm			running the cyrus mailer.
48640266059SGregory Neil ShapiroCYRUS_MAILER_QGRP	[undefined] The queue group for the cyrus mailer.
48706f25ae9SGregory Neil ShapiroCYRUS_BB_MAILER_FLAGS	[u] The flags used by the cyrusbb mailer.
48806f25ae9SGregory Neil Shapiro			The flags lsDFMnP are always included.
489c2aa98e2SPeter WemmCYRUS_BB_MAILER_ARGS	[deliver -e -m $u] The arguments passed
490c2aa98e2SPeter Wemm			to deliver cyrusbb mail.
49194c01205SGregory Neil ShapiroCYRUSV2_MAILER_FLAGS	[A@/:|m] The flags used by the cyrusv2 mailer.  The
49294c01205SGregory Neil Shapiro			flags lsDFMnqXz are always included.
49394c01205SGregory Neil ShapiroCYRUSV2_MAILER_MAXMSGS	[undefined] If defined, the maximum number of
49494c01205SGregory Neil Shapiro			messages to deliver in a single connection for the
49594c01205SGregory Neil Shapiro			cyrusv2 mailer.
49694c01205SGregory Neil ShapiroCYRUSV2_MAILER_MAXRCPTS	[undefined] If defined, the maximum number of
49794c01205SGregory Neil Shapiro			recipients to deliver in a single connection for the
49894c01205SGregory Neil Shapiro			cyrusv2 mailer.
49994c01205SGregory Neil ShapiroCYRUSV2_MAILER_ARGS	[FILE /var/imap/socket/lmtp] The arguments passed
50094c01205SGregory Neil Shapiro			to the cyrusv2 mailer.  This can be used to
50194c01205SGregory Neil Shapiro			change the name of the Unix domain socket, or
50294c01205SGregory Neil Shapiro			to switch to delivery via TCP (e.g., `TCP $h lmtp')
50394c01205SGregory Neil ShapiroCYRUSV2_MAILER_QGRP	[undefined] The queue group for the cyrusv2 mailer.
50413bd1963SGregory Neil ShapiroCYRUSV2_MAILER_CHARSET	[undefined] If defined, messages containing 8-bit data
50513bd1963SGregory Neil Shapiro			that ARRIVE from an address that resolves to one the
50613bd1963SGregory Neil Shapiro			Cyrus mailer and which are converted to MIME will
50713bd1963SGregory Neil Shapiro			be labeled with this character set.
508c2aa98e2SPeter WemmconfEBINDIR		[/usr/libexec] The directory for executables.
5092e43090eSPeter Wemm			Currently used for FEATURE(`local_lmtp') and
5102e43090eSPeter Wemm			FEATURE(`smrsh').
51106f25ae9SGregory Neil ShapiroQPAGE_MAILER_FLAGS	[mDFMs] The flags used by the qpage mailer.
51206f25ae9SGregory Neil ShapiroQPAGE_MAILER_PATH	[/usr/local/bin/qpage] The program used to deliver
51306f25ae9SGregory Neil Shapiro			qpage mail.
51406f25ae9SGregory Neil ShapiroQPAGE_MAILER_ARGS	[qpage -l0 -m -P$u] The arguments passed
51506f25ae9SGregory Neil Shapiro			to deliver qpage mail.
51606f25ae9SGregory Neil ShapiroQPAGE_MAILER_MAX	[4096] If set, the maximum size message that
51706f25ae9SGregory Neil Shapiro			will be accepted by the qpage mailer.
51840266059SGregory Neil ShapiroQPAGE_MAILER_QGRP	[undefined] The queue group for the qpage mailer.
51940266059SGregory Neil ShapiroLOCAL_PROG_QGRP		[undefined] The queue group for the prog mailer.
520c2aa98e2SPeter Wemm
52106f25ae9SGregory Neil ShapiroNote: to tweak Name_MAILER_FLAGS use the macro MODIFY_MAILER_FLAGS:
5224e4196cbSGregory Neil ShapiroMODIFY_MAILER_FLAGS(`Name', `change') where Name is the first part
5234e4196cbSGregory Neil Shapiroof the macro Name_MAILER_FLAGS (note: that means Name is entirely in
5244e4196cbSGregory Neil Shapiroupper case) and change can be: flags that should be used directly
5254e4196cbSGregory Neil Shapiro(thus overriding the default value), or if it starts with `+' (`-')
5264e4196cbSGregory Neil Shapirothen those flags are added to (removed from) the default value.
5274e4196cbSGregory Neil ShapiroExample:
52806f25ae9SGregory Neil Shapiro
52906f25ae9SGregory Neil Shapiro	MODIFY_MAILER_FLAGS(`LOCAL', `+e')
53006f25ae9SGregory Neil Shapiro
53140266059SGregory Neil Shapirowill add the flag `e' to LOCAL_MAILER_FLAGS.  Notice: there are
53240266059SGregory Neil Shapiroseveral smtp mailers all of which are manipulated individually.
53340266059SGregory Neil ShapiroSee the section MAILERS for the available mailer names.
53406f25ae9SGregory Neil ShapiroWARNING: The FEATUREs local_lmtp and local_procmail set LOCAL_MAILER_FLAGS
53506f25ae9SGregory Neil Shapirounconditionally, i.e., without respecting any definitions in an
53606f25ae9SGregory Neil ShapiroOSTYPE setting.
537c2aa98e2SPeter Wemm
538c2aa98e2SPeter Wemm
539c2aa98e2SPeter Wemm+---------+
540c2aa98e2SPeter Wemm| DOMAINS |
541c2aa98e2SPeter Wemm+---------+
542c2aa98e2SPeter Wemm
543c2aa98e2SPeter WemmYou will probably want to collect domain-dependent defines into one
54406f25ae9SGregory Neil Shapirofile, referenced by the DOMAIN macro.  For example, the Berkeley
545c2aa98e2SPeter Wemmdomain file includes definitions for several internal distinguished
546c2aa98e2SPeter Wemmhosts:
547c2aa98e2SPeter Wemm
548c2aa98e2SPeter WemmUUCP_RELAY	The host that will accept UUCP-addressed email.
549c2aa98e2SPeter Wemm		If not defined, all UUCP sites must be directly
550c2aa98e2SPeter Wemm		connected.
551c2aa98e2SPeter WemmBITNET_RELAY	The host that will accept BITNET-addressed email.
552c2aa98e2SPeter Wemm		If not defined, the .BITNET pseudo-domain won't work.
553c2aa98e2SPeter WemmDECNET_RELAY	The host that will accept DECNET-addressed email.
554c2aa98e2SPeter Wemm		If not defined, the .DECNET pseudo-domain and addresses
555c2aa98e2SPeter Wemm		of the form node::user will not work.
556c2aa98e2SPeter WemmFAX_RELAY	The host that will accept mail to the .FAX pseudo-domain.
557c2aa98e2SPeter Wemm		The "fax" mailer overrides this value.
558193538b7SGregory Neil ShapiroLOCAL_RELAY	The site that will handle unqualified names -- that
559193538b7SGregory Neil Shapiro		is, names without an @domain extension.
560193538b7SGregory Neil Shapiro		Normally MAIL_HUB is preferred for this function.
561193538b7SGregory Neil Shapiro		LOCAL_RELAY is mostly useful in conjunction with
56240266059SGregory Neil Shapiro		FEATURE(`stickyhost') -- see the discussion of
563193538b7SGregory Neil Shapiro		stickyhost below.  If not set, they are assumed to
564193538b7SGregory Neil Shapiro		belong on this machine.  This allows you to have a
565193538b7SGregory Neil Shapiro		central site to store a company- or department-wide
566193538b7SGregory Neil Shapiro		alias database.  This only works at small sites,
567193538b7SGregory Neil Shapiro		and only with some user agents.
568c2aa98e2SPeter WemmLUSER_RELAY	The site that will handle lusers -- that is, apparently
56906f25ae9SGregory Neil Shapiro		local names that aren't local accounts or aliases.  To
57006f25ae9SGregory Neil Shapiro		specify a local user instead of a site, set this to
57106f25ae9SGregory Neil Shapiro		``local:username''.
572c2aa98e2SPeter Wemm
573c2aa98e2SPeter WemmAny of these can be either ``mailer:hostname'' (in which case the
574c2aa98e2SPeter Wemmmailer is the internal mailer name, such as ``uucp-new'' and the hostname
575c2aa98e2SPeter Wemmis the name of the host as appropriate for that mailer) or just a
576c2aa98e2SPeter Wemm``hostname'', in which case a default mailer type (usually ``relay'',
577c2aa98e2SPeter Wemma variant on SMTP) is used.  WARNING: if you have a wildcard MX
578c2aa98e2SPeter Wemmrecord matching your domain, you probably want to define these to
579c2aa98e2SPeter Wemmhave a trailing dot so that you won't get the mail diverted back
580c2aa98e2SPeter Wemmto yourself.
581c2aa98e2SPeter Wemm
582c2aa98e2SPeter WemmThe domain file can also be used to define a domain name, if needed
583c2aa98e2SPeter Wemm(using "DD<domain>") and set certain site-wide features.  If all hosts
584c2aa98e2SPeter Wemmat your site masquerade behind one email name, you could also use
585c2aa98e2SPeter WemmMASQUERADE_AS here.
586c2aa98e2SPeter Wemm
587c2aa98e2SPeter WemmYou do not have to define a domain -- in particular, if you are a
588c2aa98e2SPeter Wemmsingle machine sitting off somewhere, it is probably more work than
589c2aa98e2SPeter Wemmit's worth.  This is just a mechanism for combining "domain dependent
590c2aa98e2SPeter Wemmknowledge" into one place.
591c2aa98e2SPeter Wemm
59240266059SGregory Neil Shapiro
593c2aa98e2SPeter Wemm+---------+
594c2aa98e2SPeter Wemm| MAILERS |
595c2aa98e2SPeter Wemm+---------+
596c2aa98e2SPeter Wemm
597c2aa98e2SPeter WemmThere are fewer mailers supported in this version than the previous
598c2aa98e2SPeter Wemmversion, owing mostly to a simpler world.  As a general rule, put the
59940266059SGregory Neil ShapiroMAILER definitions last in your .mc file.
600c2aa98e2SPeter Wemm
601c2aa98e2SPeter Wemmlocal		The local and prog mailers.  You will almost always
602c2aa98e2SPeter Wemm		need these; the only exception is if you relay ALL
603c2aa98e2SPeter Wemm		your mail to another site.  This mailer is included
604c2aa98e2SPeter Wemm		automatically.
605c2aa98e2SPeter Wemm
606c2aa98e2SPeter Wemmsmtp		The Simple Mail Transport Protocol mailer.  This does
607c2aa98e2SPeter Wemm		not hide hosts behind a gateway or another other
608c2aa98e2SPeter Wemm		such hack; it assumes a world where everyone is
609c2aa98e2SPeter Wemm		running the name server.  This file actually defines
61006f25ae9SGregory Neil Shapiro		five mailers: "smtp" for regular (old-style) SMTP to
611c2aa98e2SPeter Wemm		other servers, "esmtp" for extended SMTP to other
612c2aa98e2SPeter Wemm		servers, "smtp8" to do SMTP to other servers without
613c2aa98e2SPeter Wemm		converting 8-bit data to MIME (essentially, this is
614c2aa98e2SPeter Wemm		your statement that you know the other end is 8-bit
61506f25ae9SGregory Neil Shapiro		clean even if it doesn't say so), "dsmtp" to do on
61606f25ae9SGregory Neil Shapiro		demand delivery, and "relay" for transmission to the
61706f25ae9SGregory Neil Shapiro		RELAY_HOST, LUSER_RELAY, or MAIL_HUB.
618c2aa98e2SPeter Wemm
61942e5d165SGregory Neil Shapirouucp		The UNIX-to-UNIX Copy Program mailer.  Actually, this
620c2aa98e2SPeter Wemm		defines two mailers, "uucp-old" (a.k.a. "uucp") and
621c2aa98e2SPeter Wemm		"uucp-new" (a.k.a. "suucp").  The latter is for when you
622c2aa98e2SPeter Wemm		know that the UUCP mailer at the other end can handle
623c2aa98e2SPeter Wemm		multiple recipients in one transfer.  If the smtp mailer
62440266059SGregory Neil Shapiro		is included in your configuration, two other mailers
62540266059SGregory Neil Shapiro		("uucp-dom" and "uucp-uudom") are also defined [warning: you
62640266059SGregory Neil Shapiro		MUST specify MAILER(`smtp') before MAILER(`uucp')].  When you
627c2aa98e2SPeter Wemm		include the uucp mailer, sendmail looks for all names in
62806f25ae9SGregory Neil Shapiro		class {U} and sends them to the uucp-old mailer; all
62906f25ae9SGregory Neil Shapiro		names in class {Y} are sent to uucp-new; and all
63006f25ae9SGregory Neil Shapiro		names in class {Z} are sent to uucp-uudom.  Note that
631c2aa98e2SPeter Wemm		this is a function of what version of rmail runs on
632c2aa98e2SPeter Wemm		the receiving end, and hence may be out of your control.
633c2aa98e2SPeter Wemm		See the section below describing UUCP mailers in more
634c2aa98e2SPeter Wemm		detail.
635c2aa98e2SPeter Wemm
636c2aa98e2SPeter Wemmusenet		Usenet (network news) delivery.  If this is specified,
637c2aa98e2SPeter Wemm		an extra rule is added to ruleset 0 that forwards all
638c2aa98e2SPeter Wemm		local email for users named ``group.usenet'' to the
639c2aa98e2SPeter Wemm		``inews'' program.  Note that this works for all groups,
640c2aa98e2SPeter Wemm		and may be considered a security problem.
641c2aa98e2SPeter Wemm
642c2aa98e2SPeter Wemmfax		Facsimile transmission.  This is experimental and based
643c2aa98e2SPeter Wemm		on Sam Leffler's HylaFAX software.  For more information,
644193538b7SGregory Neil Shapiro		see http://www.hylafax.org/.
645c2aa98e2SPeter Wemm
646c2aa98e2SPeter Wemmpop		Post Office Protocol.
647c2aa98e2SPeter Wemm
648c2aa98e2SPeter Wemmprocmail	An interface to procmail (does not come with sendmail).
649c2aa98e2SPeter Wemm		This is designed to be used in mailertables.  For example,
650c2aa98e2SPeter Wemm		a common question is "how do I forward all mail for a given
651c2aa98e2SPeter Wemm		domain to a single person?".  If you have this mailer
652c2aa98e2SPeter Wemm		defined, you could set up a mailertable reading:
653c2aa98e2SPeter Wemm
654c2aa98e2SPeter Wemm			host.com	procmail:/etc/procmailrcs/host.com
655c2aa98e2SPeter Wemm
656c2aa98e2SPeter Wemm		with the file /etc/procmailrcs/host.com reading:
657c2aa98e2SPeter Wemm
658c2aa98e2SPeter Wemm			:0	# forward mail for host.com
659c2aa98e2SPeter Wemm			! -oi -f $1 person@other.host
660c2aa98e2SPeter Wemm
661c2aa98e2SPeter Wemm		This would arrange for (anything)@host.com to be sent
662d9986b26SGregory Neil Shapiro		to person@other.host.  In a procmail script, $1 is the
663d9986b26SGregory Neil Shapiro		name of the sender and $2 is the name of the recipient.
6642e43090eSPeter Wemm		If you use this with FEATURE(`local_procmail'), the FEATURE
665c2aa98e2SPeter Wemm		should be listed first.
666c2aa98e2SPeter Wemm
66740266059SGregory Neil Shapiro		Of course there are other ways to solve this particular
66840266059SGregory Neil Shapiro		problem, e.g., a catch-all entry in a virtusertable.
66940266059SGregory Neil Shapiro
670c2aa98e2SPeter Wemmmail11		The DECnet mail11 mailer, useful only if you have the mail11
671c2aa98e2SPeter Wemm		program from gatekeeper.dec.com:/pub/DEC/gwtools (and
672c2aa98e2SPeter Wemm		DECnet, of course).  This is for Phase IV DECnet support;
673c2aa98e2SPeter Wemm		if you have Phase V at your site you may have additional
674c2aa98e2SPeter Wemm		problems.
675c2aa98e2SPeter Wemm
676c2aa98e2SPeter Wemmphquery		The phquery program.  This is somewhat counterintuitively
677c2aa98e2SPeter Wemm		referenced as the "ph" mailer internally.  It can be used
678c2aa98e2SPeter Wemm		to do CCSO name server lookups.  The phquery program, which
679c2aa98e2SPeter Wemm		this mailer uses, is distributed with the ph client.
680c2aa98e2SPeter Wemm
681c2aa98e2SPeter Wemmcyrus		The cyrus and cyrusbb mailers.  The cyrus mailer delivers to
682c2aa98e2SPeter Wemm		a local cyrus user.  this mailer can make use of the
68340266059SGregory Neil Shapiro		"user+detail@local.host" syntax (see
68440266059SGregory Neil Shapiro		FEATURE(`preserve_local_plus_detail')); it will deliver the
68540266059SGregory Neil Shapiro		mail to the user's "detail" mailbox if the mailbox's ACL
68640266059SGregory Neil Shapiro		permits.  The cyrusbb mailer delivers to a system-wide
68740266059SGregory Neil Shapiro		cyrus mailbox if the mailbox's ACL permits.  The cyrus
68840266059SGregory Neil Shapiro		mailer must be defined after the local mailer.
689c2aa98e2SPeter Wemm
69094c01205SGregory Neil Shapirocyrusv2		The mailer for Cyrus v2.x.  The cyrusv2 mailer delivers to
69194c01205SGregory Neil Shapiro		local cyrus users via LMTP.  This mailer can make use of the
69294c01205SGregory Neil Shapiro		"user+detail@local.host" syntax (see
69394c01205SGregory Neil Shapiro		FEATURE(`preserve_local_plus_detail')); it will deliver the
69494c01205SGregory Neil Shapiro		mail to the user's "detail" mailbox if the mailbox's ACL
69594c01205SGregory Neil Shapiro		permits.  The cyrusv2 mailer must be defined after the
69694c01205SGregory Neil Shapiro		local mailer.
69794c01205SGregory Neil Shapiro
69806f25ae9SGregory Neil Shapiroqpage		A mailer for QuickPage, a pager interface.  See
69906f25ae9SGregory Neil Shapiro		http://www.qpage.org/ for further information.
700c2aa98e2SPeter Wemm
701c2aa98e2SPeter WemmThe local mailer accepts addresses of the form "user+detail", where
702c2aa98e2SPeter Wemmthe "+detail" is not used for mailbox matching but is available
7032e43090eSPeter Wemmto certain local mail programs (in particular, see
7042e43090eSPeter WemmFEATURE(`local_procmail')).  For example, "eric", "eric+sendmail", and
7052e43090eSPeter Wemm"eric+sww" all indicate the same user, but additional arguments <null>,
7062e43090eSPeter Wemm"sendmail", and "sww" may be provided for use in sorting mail.
707c2aa98e2SPeter Wemm
708c2aa98e2SPeter Wemm
709c2aa98e2SPeter Wemm+----------+
710c2aa98e2SPeter Wemm| FEATURES |
711c2aa98e2SPeter Wemm+----------+
712c2aa98e2SPeter Wemm
713c2aa98e2SPeter WemmSpecial features can be requested using the "FEATURE" macro.  For
714c2aa98e2SPeter Wemmexample, the .mc line:
715c2aa98e2SPeter Wemm
7162e43090eSPeter Wemm	FEATURE(`use_cw_file')
717c2aa98e2SPeter Wemm
71806f25ae9SGregory Neil Shapirotells sendmail that you want to have it read an /etc/mail/local-host-names
71940266059SGregory Neil Shapirofile to get values for class {w}.  A FEATURE may contain up to 9
72006f25ae9SGregory Neil Shapirooptional parameters -- for example:
721c2aa98e2SPeter Wemm
7222e43090eSPeter Wemm	FEATURE(`mailertable', `dbm /usr/lib/mailertable')
723c2aa98e2SPeter Wemm
724c2aa98e2SPeter WemmThe default database map type for the table features can be set with
725c2aa98e2SPeter Wemm
726c2aa98e2SPeter Wemm	define(`DATABASE_MAP_TYPE', `dbm')
727c2aa98e2SPeter Wemm
728c2aa98e2SPeter Wemmwhich would set it to use ndbm databases.  The default is the Berkeley DB
729c2aa98e2SPeter Wemmhash database format.  Note that you must still declare a database map type
730c2aa98e2SPeter Wemmif you specify an argument to a FEATURE.  DATABASE_MAP_TYPE is only used
73106f25ae9SGregory Neil Shapiroif no argument is given for the FEATURE.  It must be specified before any
73206f25ae9SGregory Neil Shapirofeature that uses a map.
733c2aa98e2SPeter Wemm
73440266059SGregory Neil ShapiroAlso, features which can take a map definition as an argument can also take
73540266059SGregory Neil Shapirothe special keyword `LDAP'.  If that keyword is used, the map will use the
73640266059SGregory Neil ShapiroLDAP definition described in the ``USING LDAP FOR ALIASES, MAPS, AND
73740266059SGregory Neil ShapiroCLASSES'' section below.
73840266059SGregory Neil Shapiro
739c2aa98e2SPeter WemmAvailable features are:
740c2aa98e2SPeter Wemm
74106f25ae9SGregory Neil Shapirouse_cw_file	Read the file /etc/mail/local-host-names file to get
74206f25ae9SGregory Neil Shapiro		alternate names for this host.  This might be used if you
74306f25ae9SGregory Neil Shapiro		were on a host that MXed for a dynamic set of other hosts.
74406f25ae9SGregory Neil Shapiro		If the set is static, just including the line "Cw<name1>
74506f25ae9SGregory Neil Shapiro		<name2> ..." (where the names are fully qualified domain
74606f25ae9SGregory Neil Shapiro		names) is probably superior.  The actual filename can be
74706f25ae9SGregory Neil Shapiro		overridden by redefining confCW_FILE.
748c2aa98e2SPeter Wemm
74906f25ae9SGregory Neil Shapirouse_ct_file	Read the file /etc/mail/trusted-users file to get the
75006f25ae9SGregory Neil Shapiro		names of users that will be ``trusted'', that is, able to
75106f25ae9SGregory Neil Shapiro		set their envelope from address using -f without generating
75206f25ae9SGregory Neil Shapiro		a warning message.  The actual filename can be overridden
75306f25ae9SGregory Neil Shapiro		by redefining confCT_FILE.
754c2aa98e2SPeter Wemm
755c2aa98e2SPeter Wemmredirect	Reject all mail addressed to "address.REDIRECT" with
75606f25ae9SGregory Neil Shapiro		a ``551 User has moved; please try <address>'' message.
757c2aa98e2SPeter Wemm		If this is set, you can alias people who have left
758c2aa98e2SPeter Wemm		to their new address with ".REDIRECT" appended.
759c2aa98e2SPeter Wemm
76006f25ae9SGregory Neil Shapironouucp		Don't route UUCP addresses.  This feature takes one
76106f25ae9SGregory Neil Shapiro		parameter:
76206f25ae9SGregory Neil Shapiro		`reject': reject addresses which have "!" in the local
76306f25ae9SGregory Neil Shapiro			part unless it originates from a system
76406f25ae9SGregory Neil Shapiro			that is allowed to relay.
76506f25ae9SGregory Neil Shapiro		`nospecial': don't do anything special with "!".
76640266059SGregory Neil Shapiro		Warnings: 1. See the notice in the anti-spam section.
76706f25ae9SGregory Neil Shapiro		2. don't remove "!" from OperatorChars if `reject' is
76806f25ae9SGregory Neil Shapiro		given as parameter.
769c2aa98e2SPeter Wemm
770da7d7b9cSGregory Neil Shapironopercenthack	Don't treat % as routing character.  This feature takes one
771da7d7b9cSGregory Neil Shapiro		parameter:
772da7d7b9cSGregory Neil Shapiro		`reject': reject addresses which have % in the local
773da7d7b9cSGregory Neil Shapiro			part unless it originates from a system
774da7d7b9cSGregory Neil Shapiro			that is allowed to relay.
775da7d7b9cSGregory Neil Shapiro		`nospecial': don't do anything special with %.
776da7d7b9cSGregory Neil Shapiro		Warnings: 1. See the notice in the anti-spam section.
777da7d7b9cSGregory Neil Shapiro		2. Don't remove % from OperatorChars if `reject' is
778da7d7b9cSGregory Neil Shapiro		given as parameter.
779da7d7b9cSGregory Neil Shapiro
78006f25ae9SGregory Neil Shapironocanonify	Don't pass addresses to $[ ... $] for canonification
781193538b7SGregory Neil Shapiro		by default, i.e., host/domain names are considered canonical,
782193538b7SGregory Neil Shapiro		except for unqualified names, which must not be used in this
783193538b7SGregory Neil Shapiro		mode (violation of the standard).  It can be changed by
784193538b7SGregory Neil Shapiro		setting the DaemonPortOptions modifiers (M=).  That is,
78506f25ae9SGregory Neil Shapiro		FEATURE(`nocanonify') will be overridden by setting the
78606f25ae9SGregory Neil Shapiro		'c' flag.  Conversely, if FEATURE(`nocanonify') is not used,
78706f25ae9SGregory Neil Shapiro		it can be emulated by setting the 'C' flag
78806f25ae9SGregory Neil Shapiro		(DaemonPortOptions=Modifiers=C).  This would generally only
78906f25ae9SGregory Neil Shapiro		be used by sites that only act as mail gateways or which have
79006f25ae9SGregory Neil Shapiro		user agents that do full canonification themselves.  You may
79106f25ae9SGregory Neil Shapiro		also want to use
79206f25ae9SGregory Neil Shapiro		"define(`confBIND_OPTS', `-DNSRCH -DEFNAMES')" to turn off
79306f25ae9SGregory Neil Shapiro		the usual resolver options that do a similar thing.
79406f25ae9SGregory Neil Shapiro
79506f25ae9SGregory Neil Shapiro		An exception list for FEATURE(`nocanonify') can be
79606f25ae9SGregory Neil Shapiro		specified with CANONIFY_DOMAIN or CANONIFY_DOMAIN_FILE,
79706f25ae9SGregory Neil Shapiro		i.e., a list of domains which are nevertheless passed to
79806f25ae9SGregory Neil Shapiro		$[ ... $] for canonification.  This is useful to turn on
79906f25ae9SGregory Neil Shapiro		canonification for local domains, e.g., use
80006f25ae9SGregory Neil Shapiro		CANONIFY_DOMAIN(`my.domain my') to canonify addresses
80106f25ae9SGregory Neil Shapiro		which end in "my.domain" or "my".
80206f25ae9SGregory Neil Shapiro		Another way to require canonification in the local
80306f25ae9SGregory Neil Shapiro		domain is CANONIFY_DOMAIN(`$=m').
80406f25ae9SGregory Neil Shapiro
80506f25ae9SGregory Neil Shapiro		A trailing dot is added to addresses with more than
80606f25ae9SGregory Neil Shapiro		one component in it such that other features which
80706f25ae9SGregory Neil Shapiro		expect a trailing dot (e.g., virtusertable) will
80806f25ae9SGregory Neil Shapiro		still work.
80906f25ae9SGregory Neil Shapiro
81006f25ae9SGregory Neil Shapiro		If `canonify_hosts' is specified as parameter, i.e.,
81106f25ae9SGregory Neil Shapiro		FEATURE(`nocanonify', `canonify_hosts'), then
81206f25ae9SGregory Neil Shapiro		addresses which have only a hostname, e.g.,
81306f25ae9SGregory Neil Shapiro		<user@host>, will be canonified (and hopefully fully
81406f25ae9SGregory Neil Shapiro		qualified), too.
815c2aa98e2SPeter Wemm
816193538b7SGregory Neil Shapirostickyhost	This feature is sometimes used with LOCAL_RELAY,
817193538b7SGregory Neil Shapiro		although it can be used for a different effect with
818193538b7SGregory Neil Shapiro		MAIL_HUB.
819193538b7SGregory Neil Shapiro
820602a2b1bSGregory Neil Shapiro		When used without MAIL_HUB, email sent to
821193538b7SGregory Neil Shapiro		"user@local.host" are marked as "sticky" -- that
822193538b7SGregory Neil Shapiro		is, the local addresses aren't matched against UDB,
823193538b7SGregory Neil Shapiro		don't go through ruleset 5, and are not forwarded to
824193538b7SGregory Neil Shapiro		the LOCAL_RELAY (if defined).
825193538b7SGregory Neil Shapiro
826193538b7SGregory Neil Shapiro		With MAIL_HUB, mail addressed to "user@local.host"
827193538b7SGregory Neil Shapiro		is forwarded to the mail hub, with the envelope
828193538b7SGregory Neil Shapiro		address still remaining "user@local.host".
829193538b7SGregory Neil Shapiro		Without stickyhost, the envelope would be changed
830193538b7SGregory Neil Shapiro		to "user@mail_hub", in order to protect against
831193538b7SGregory Neil Shapiro		mailing loops.
832c2aa98e2SPeter Wemm
833c2aa98e2SPeter Wemmmailertable	Include a "mailer table" which can be used to override
83406f25ae9SGregory Neil Shapiro		routing for particular domains (which are not in class {w},
83506f25ae9SGregory Neil Shapiro		i.e.  local host names).  The argument of the FEATURE may be
83606f25ae9SGregory Neil Shapiro		the key definition.  If none is specified, the definition
83706f25ae9SGregory Neil Shapiro		used is:
8382e43090eSPeter Wemm
83906f25ae9SGregory Neil Shapiro			hash /etc/mail/mailertable
8402e43090eSPeter Wemm
841c2aa98e2SPeter Wemm		Keys in this database are fully qualified domain names
842c2aa98e2SPeter Wemm		or partial domains preceded by a dot -- for example,
84306f25ae9SGregory Neil Shapiro		"vangogh.CS.Berkeley.EDU" or ".CS.Berkeley.EDU".  As a
84406f25ae9SGregory Neil Shapiro		special case of the latter, "." matches any domain not
84506f25ae9SGregory Neil Shapiro		covered by other keys.  Values must be of the form:
846c2aa98e2SPeter Wemm			mailer:domain
847c2aa98e2SPeter Wemm		where "mailer" is the internal mailer name, and "domain"
848c2aa98e2SPeter Wemm		is where to send the message.  These maps are not
849c2aa98e2SPeter Wemm		reflected into the message header.  As a special case,
850c2aa98e2SPeter Wemm		the forms:
851c2aa98e2SPeter Wemm			local:user
852c2aa98e2SPeter Wemm		will forward to the indicated user using the local mailer,
853c2aa98e2SPeter Wemm			local:
854c2aa98e2SPeter Wemm		will forward to the original user in the e-mail address
855c2aa98e2SPeter Wemm		using the local mailer, and
856c2aa98e2SPeter Wemm			error:code message
85706f25ae9SGregory Neil Shapiro			error:D.S.N:code message
85806f25ae9SGregory Neil Shapiro		will give an error message with the indicated SMTP reply
85906f25ae9SGregory Neil Shapiro		code and message, where D.S.N is an RFC 1893 compliant
86006f25ae9SGregory Neil Shapiro		error code.
861c2aa98e2SPeter Wemm
862c2aa98e2SPeter Wemmdomaintable	Include a "domain table" which can be used to provide
863c2aa98e2SPeter Wemm		domain name mapping.  Use of this should really be
864c2aa98e2SPeter Wemm		limited to your own domains.  It may be useful if you
865c2aa98e2SPeter Wemm		change names (e.g., your company changes names from
866c2aa98e2SPeter Wemm		oldname.com to newname.com).  The argument of the
867c2aa98e2SPeter Wemm		FEATURE may be the key definition.  If none is specified,
868c2aa98e2SPeter Wemm		the definition used is:
8692e43090eSPeter Wemm
87006f25ae9SGregory Neil Shapiro			hash /etc/mail/domaintable
8712e43090eSPeter Wemm
872c2aa98e2SPeter Wemm		The key in this table is the domain name; the value is
873c2aa98e2SPeter Wemm		the new (fully qualified) domain.  Anything in the
874c2aa98e2SPeter Wemm		domaintable is reflected into headers; that is, this
875c2aa98e2SPeter Wemm		is done in ruleset 3.
876c2aa98e2SPeter Wemm
877c2aa98e2SPeter Wemmbitdomain	Look up bitnet hosts in a table to try to turn them into
878c2aa98e2SPeter Wemm		internet addresses.  The table can be built using the
879c2aa98e2SPeter Wemm		bitdomain program contributed by John Gardiner Myers.
880c2aa98e2SPeter Wemm		The argument of the FEATURE may be the key definition; if
881c2aa98e2SPeter Wemm		none is specified, the definition used is:
8822e43090eSPeter Wemm
88306f25ae9SGregory Neil Shapiro			hash /etc/mail/bitdomain
8842e43090eSPeter Wemm
885c2aa98e2SPeter Wemm		Keys are the bitnet hostname; values are the corresponding
886c2aa98e2SPeter Wemm		internet hostname.
887c2aa98e2SPeter Wemm
888c2aa98e2SPeter Wemmuucpdomain	Similar feature for UUCP hosts.  The default map definition
889c2aa98e2SPeter Wemm		is:
8902e43090eSPeter Wemm
89106f25ae9SGregory Neil Shapiro			hash /etc/mail/uudomain
8922e43090eSPeter Wemm
893c2aa98e2SPeter Wemm		At the moment there is no automagic tool to build this
894c2aa98e2SPeter Wemm		database.
895c2aa98e2SPeter Wemm
896c2aa98e2SPeter Wemmalways_add_domain
897c2aa98e2SPeter Wemm		Include the local host domain even on locally delivered
898c2aa98e2SPeter Wemm		mail.  Normally it is not added on unqualified names.
899c2aa98e2SPeter Wemm		However, if you use a shared message store but do not use
900c2aa98e2SPeter Wemm		the same user name space everywhere, you may need the host
90140266059SGregory Neil Shapiro		name on local names.  An optional argument specifies
90240266059SGregory Neil Shapiro		another domain to be added than the local.
903c2aa98e2SPeter Wemm
904c2aa98e2SPeter Wemmallmasquerade	If masquerading is enabled (using MASQUERADE_AS), this
905c2aa98e2SPeter Wemm		feature will cause recipient addresses to also masquerade
906c2aa98e2SPeter Wemm		as being from the masquerade host.  Normally they get
907c2aa98e2SPeter Wemm		the local hostname.  Although this may be right for
908c2aa98e2SPeter Wemm		ordinary users, it can break local aliases.  For example,
909c2aa98e2SPeter Wemm		if you send to "localalias", the originating sendmail will
910c2aa98e2SPeter Wemm		find that alias and send to all members, but send the
911c2aa98e2SPeter Wemm		message with "To: localalias@masqueradehost".  Since that
912c2aa98e2SPeter Wemm		alias likely does not exist, replies will fail.  Use this
913c2aa98e2SPeter Wemm		feature ONLY if you can guarantee that the ENTIRE
914c2aa98e2SPeter Wemm		namespace on your masquerade host supersets all the
915c2aa98e2SPeter Wemm		local entries.
916c2aa98e2SPeter Wemm
917c2aa98e2SPeter Wemmlimited_masquerade
91806f25ae9SGregory Neil Shapiro		Normally, any hosts listed in class {w} are masqueraded.  If
91906f25ae9SGregory Neil Shapiro		this feature is given, only the hosts listed in class {M} (see
92006f25ae9SGregory Neil Shapiro		below:  MASQUERADE_DOMAIN) are masqueraded.  This is useful
92106f25ae9SGregory Neil Shapiro		if you have several domains with disjoint namespaces hosted
92206f25ae9SGregory Neil Shapiro		on the same machine.
923c2aa98e2SPeter Wemm
924c2aa98e2SPeter Wemmmasquerade_entire_domain
925c2aa98e2SPeter Wemm		If masquerading is enabled (using MASQUERADE_AS) and
926c2aa98e2SPeter Wemm		MASQUERADE_DOMAIN (see below) is set, this feature will
927c2aa98e2SPeter Wemm		cause addresses to be rewritten such that the masquerading
928c2aa98e2SPeter Wemm		domains are actually entire domains to be hidden.  All
929c2aa98e2SPeter Wemm		hosts within the masquerading domains will be rewritten
930c2aa98e2SPeter Wemm		to the masquerade name (used in MASQUERADE_AS).  For example,
931c2aa98e2SPeter Wemm		if you have:
932c2aa98e2SPeter Wemm
93306f25ae9SGregory Neil Shapiro			MASQUERADE_AS(`masq.com')
93406f25ae9SGregory Neil Shapiro			MASQUERADE_DOMAIN(`foo.org')
93506f25ae9SGregory Neil Shapiro			MASQUERADE_DOMAIN(`bar.com')
936c2aa98e2SPeter Wemm
937c2aa98e2SPeter Wemm		then *foo.org and *bar.com are converted to masq.com.  Without
938c2aa98e2SPeter Wemm		this feature, only foo.org and bar.com are masqueraded.
939c2aa98e2SPeter Wemm
940c2aa98e2SPeter Wemm		    NOTE: only domains within your jurisdiction and
941c2aa98e2SPeter Wemm		    current hierarchy should be masqueraded using this.
942c2aa98e2SPeter Wemm
94340266059SGregory Neil Shapirolocal_no_masquerade
94440266059SGregory Neil Shapiro		This feature prevents the local mailer from masquerading even
94540266059SGregory Neil Shapiro		if MASQUERADE_AS is used.  MASQUERADE_AS will only have effect
94640266059SGregory Neil Shapiro		on addresses of mail going outside the local domain.
94740266059SGregory Neil Shapiro
94813bd1963SGregory Neil Shapiromasquerade_envelope
94913bd1963SGregory Neil Shapiro		If masquerading is enabled (using MASQUERADE_AS) or the
95013bd1963SGregory Neil Shapiro		genericstable is in use, this feature will cause envelope
95113bd1963SGregory Neil Shapiro		addresses to also masquerade as being from the masquerade
95213bd1963SGregory Neil Shapiro		host.  Normally only the header addresses are masqueraded.
95313bd1963SGregory Neil Shapiro
95406f25ae9SGregory Neil Shapirogenericstable	This feature will cause unqualified addresses (i.e., without
95506f25ae9SGregory Neil Shapiro		a domain) and addresses with a domain listed in class {G}
95606f25ae9SGregory Neil Shapiro		to be looked up in a map and turned into another ("generic")
95706f25ae9SGregory Neil Shapiro		form, which can change both the domain name and the user name.
95840266059SGregory Neil Shapiro		Notice: if you use an MSP (as it is default starting with
95940266059SGregory Neil Shapiro		8.12), the MTA will only receive qualified addresses from the
96040266059SGregory Neil Shapiro		MSP (as required by the RFCs).  Hence you need to add your
96140266059SGregory Neil Shapiro		domain to class {G}.  This feature is similar to the userdb
96240266059SGregory Neil Shapiro		functionality.  The same types of addresses as for
96340266059SGregory Neil Shapiro		masquerading are looked up, i.e., only header sender
96440266059SGregory Neil Shapiro		addresses unless the allmasquerade and/or masquerade_envelope
96540266059SGregory Neil Shapiro		features are given.  Qualified addresses must have the domain
96640266059SGregory Neil Shapiro		part in class {G}; entries can be added to this class by the
96740266059SGregory Neil Shapiro		macros GENERICS_DOMAIN or GENERICS_DOMAIN_FILE (analogously
96840266059SGregory Neil Shapiro		to MASQUERADE_DOMAIN and MASQUERADE_DOMAIN_FILE, see below).
969c2aa98e2SPeter Wemm
9702e43090eSPeter Wemm		The argument of FEATURE(`genericstable') may be the map
971c2aa98e2SPeter Wemm		definition; the default map definition is:
972c2aa98e2SPeter Wemm
97306f25ae9SGregory Neil Shapiro			hash /etc/mail/genericstable
974c2aa98e2SPeter Wemm
97506f25ae9SGregory Neil Shapiro		The key for this table is either the full address, the domain
97606f25ae9SGregory Neil Shapiro		(with a leading @; the localpart is passed as first argument)
97706f25ae9SGregory Neil Shapiro		or the unqualified username (tried in the order mentioned);
97806f25ae9SGregory Neil Shapiro		the value is the new user address.  If the new user address
97906f25ae9SGregory Neil Shapiro		does not include a domain, it will be qualified in the standard
98006f25ae9SGregory Neil Shapiro		manner, i.e., using $j or the masquerade name.  Note that the
981c2aa98e2SPeter Wemm		address being looked up must be fully qualified.  For local
9822e43090eSPeter Wemm		mail, it is necessary to use FEATURE(`always_add_domain')
9832e43090eSPeter Wemm		for the addresses to be qualified.
98406f25ae9SGregory Neil Shapiro		The "+detail" of an address is passed as %1, so entries like
98506f25ae9SGregory Neil Shapiro
98606f25ae9SGregory Neil Shapiro			old+*@foo.org	new+%1@example.com
98706f25ae9SGregory Neil Shapiro			gen+*@foo.org	%1@example.com
98806f25ae9SGregory Neil Shapiro
98906f25ae9SGregory Neil Shapiro		and other forms are possible.
99006f25ae9SGregory Neil Shapiro
99106f25ae9SGregory Neil Shapirogenerics_entire_domain
99206f25ae9SGregory Neil Shapiro		If the genericstable is enabled and GENERICS_DOMAIN or
99306f25ae9SGregory Neil Shapiro		GENERICS_DOMAIN_FILE is used, this feature will cause
99406f25ae9SGregory Neil Shapiro		addresses to be searched in the map if their domain
99506f25ae9SGregory Neil Shapiro		parts are subdomains of elements in class {G}.
996c2aa98e2SPeter Wemm
997c2aa98e2SPeter Wemmvirtusertable	A domain-specific form of aliasing, allowing multiple
998c2aa98e2SPeter Wemm		virtual domains to be hosted on one machine.  For example,
9994e4196cbSGregory Neil Shapiro		if the virtuser table contains:
1000c2aa98e2SPeter Wemm
1001c2aa98e2SPeter Wemm			info@foo.com	foo-info
1002c2aa98e2SPeter Wemm			info@bar.com	bar-info
100340266059SGregory Neil Shapiro			joe@bar.com	error:nouser 550 No such user here
100440266059SGregory Neil Shapiro			jax@bar.com	error:5.7.0:550 Address invalid
100506f25ae9SGregory Neil Shapiro			@baz.org	jane@example.net
1006c2aa98e2SPeter Wemm
1007c2aa98e2SPeter Wemm		then mail addressed to info@foo.com will be sent to the
1008c2aa98e2SPeter Wemm		address foo-info, mail addressed to info@bar.com will be
100906f25ae9SGregory Neil Shapiro		delivered to bar-info, and mail addressed to anyone at baz.org
101006f25ae9SGregory Neil Shapiro		will be sent to jane@example.net, mail to joe@bar.com will
101106f25ae9SGregory Neil Shapiro		be rejected with the specified error message, and mail to
101206f25ae9SGregory Neil Shapiro		jax@bar.com will also have a RFC 1893 compliant error code
101340266059SGregory Neil Shapiro		5.7.0.
1014c2aa98e2SPeter Wemm
101506f25ae9SGregory Neil Shapiro		The username from the original address is passed
101606f25ae9SGregory Neil Shapiro		as %1 allowing:
1017c2aa98e2SPeter Wemm
101806f25ae9SGregory Neil Shapiro			@foo.org	%1@example.com
101906f25ae9SGregory Neil Shapiro
102006f25ae9SGregory Neil Shapiro		meaning someone@foo.org will be sent to someone@example.com.
102106f25ae9SGregory Neil Shapiro		Additionally, if the local part consists of "user+detail"
102240266059SGregory Neil Shapiro		then "detail" is passed as %2 and "+detail" is passed as %3
102340266059SGregory Neil Shapiro		when a match against user+* is attempted, so entries like
102406f25ae9SGregory Neil Shapiro
102506f25ae9SGregory Neil Shapiro			old+*@foo.org	new+%2@example.com
102606f25ae9SGregory Neil Shapiro			gen+*@foo.org	%2@example.com
102740266059SGregory Neil Shapiro			+*@foo.org	%1%3@example.com
102840266059SGregory Neil Shapiro			X++@foo.org	Z%3@example.com
102940266059SGregory Neil Shapiro			@bar.org	%1%3
103006f25ae9SGregory Neil Shapiro
103106f25ae9SGregory Neil Shapiro		and other forms are possible.  Note: to preserve "+detail"
103240266059SGregory Neil Shapiro		for a default case (@domain) %1%3 must be used as RHS.
103340266059SGregory Neil Shapiro		There are two wildcards after "+": "+" matches only a non-empty
103440266059SGregory Neil Shapiro		detail, "*" matches also empty details, e.g., user+@foo.org
103540266059SGregory Neil Shapiro		matches +*@foo.org but not ++@foo.org.  This can be used
103640266059SGregory Neil Shapiro		to ensure that the parameters %2 and %3 are not empty.
1037c2aa98e2SPeter Wemm
1038c2aa98e2SPeter Wemm		All the host names on the left hand side (foo.com, bar.com,
103940266059SGregory Neil Shapiro		and baz.org) must be in class {w} or class {VirtHost}.  The
104006f25ae9SGregory Neil Shapiro		latter can be defined by the macros VIRTUSER_DOMAIN or
104106f25ae9SGregory Neil Shapiro		VIRTUSER_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
104206f25ae9SGregory Neil Shapiro		MASQUERADE_DOMAIN_FILE, see below).  If VIRTUSER_DOMAIN or
104306f25ae9SGregory Neil Shapiro		VIRTUSER_DOMAIN_FILE is used, then the entries of class
104406f25ae9SGregory Neil Shapiro		{VirtHost} are added to class {R}, i.e., relaying is allowed
1045e3793f76SGregory Neil Shapiro		to (and from) those domains, which by default includes also
1046e3793f76SGregory Neil Shapiro		all subdomains (see relay_hosts_only).  The default map
1047e3793f76SGregory Neil Shapiro		definition is:
1048c2aa98e2SPeter Wemm
104906f25ae9SGregory Neil Shapiro			hash /etc/mail/virtusertable
1050c2aa98e2SPeter Wemm
1051c2aa98e2SPeter Wemm		A new definition can be specified as the second argument of
1052c2aa98e2SPeter Wemm		the FEATURE macro, such as
1053c2aa98e2SPeter Wemm
105406f25ae9SGregory Neil Shapiro			FEATURE(`virtusertable', `dbm /etc/mail/virtusers')
1055c2aa98e2SPeter Wemm
105606f25ae9SGregory Neil Shapirovirtuser_entire_domain
105706f25ae9SGregory Neil Shapiro		If the virtusertable is enabled and VIRTUSER_DOMAIN or
105806f25ae9SGregory Neil Shapiro		VIRTUSER_DOMAIN_FILE is used, this feature will cause
105906f25ae9SGregory Neil Shapiro		addresses to be searched in the map if their domain
106006f25ae9SGregory Neil Shapiro		parts are subdomains of elements in class {VirtHost}.
106106f25ae9SGregory Neil Shapiro
106206f25ae9SGregory Neil Shapiroldap_routing	Implement LDAP-based e-mail recipient routing according to
106306f25ae9SGregory Neil Shapiro		the Internet Draft draft-lachman-laser-ldap-mail-routing-01.
106406f25ae9SGregory Neil Shapiro		This provides a method to re-route addresses with a
106506f25ae9SGregory Neil Shapiro		domain portion in class {LDAPRoute} to either a
106606f25ae9SGregory Neil Shapiro		different mail host or a different address.  Hosts can
106706f25ae9SGregory Neil Shapiro		be added to this class using LDAPROUTE_DOMAIN and
106806f25ae9SGregory Neil Shapiro		LDAPROUTE_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
106906f25ae9SGregory Neil Shapiro		MASQUERADE_DOMAIN_FILE, see below).
107006f25ae9SGregory Neil Shapiro
107106f25ae9SGregory Neil Shapiro		See the LDAP ROUTING section below for more information.
107206f25ae9SGregory Neil Shapiro
107306f25ae9SGregory Neil Shapironullclient	This is a special case -- it creates a configuration file
107406f25ae9SGregory Neil Shapiro		containing nothing but support for forwarding all mail to a
107506f25ae9SGregory Neil Shapiro		central hub via a local SMTP-based network.  The argument
107606f25ae9SGregory Neil Shapiro		is the name of that hub.
1077c2aa98e2SPeter Wemm
1078c2aa98e2SPeter Wemm		The only other feature that should be used in conjunction
107906f25ae9SGregory Neil Shapiro		with this one is FEATURE(`nocanonify').  No mailers
1080c2aa98e2SPeter Wemm		should be defined.  No aliasing or forwarding is done.
1081c2aa98e2SPeter Wemm
1082c2aa98e2SPeter Wemmlocal_lmtp	Use an LMTP capable local mailer.  The argument to this
1083c2aa98e2SPeter Wemm		feature is the pathname of an LMTP capable mailer.  By
1084c2aa98e2SPeter Wemm		default, mail.local is used.  This is expected to be the
1085c2aa98e2SPeter Wemm		mail.local which came with the 8.9 distribution which is
1086c2aa98e2SPeter Wemm		LMTP capable.  The path to mail.local is set by the
1087c2aa98e2SPeter Wemm		confEBINDIR m4 variable -- making the default
1088c2aa98e2SPeter Wemm		LOCAL_MAILER_PATH /usr/libexec/mail.local.
1089e92d3f3fSGregory Neil Shapiro		If a different LMTP capable mailer is used, its pathname
1090e92d3f3fSGregory Neil Shapiro		can be specified as second parameter and the arguments
1091e92d3f3fSGregory Neil Shapiro		passed to it (A=) as third parameter, e.g.,
1092e92d3f3fSGregory Neil Shapiro
1093e92d3f3fSGregory Neil Shapiro			FEATURE(`local_lmtp', `/usr/local/bin/lmtp', `lmtp')
1094e92d3f3fSGregory Neil Shapiro
109506f25ae9SGregory Neil Shapiro		WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally,
109606f25ae9SGregory Neil Shapiro		i.e., without respecting any definitions in an OSTYPE setting.
1097c2aa98e2SPeter Wemm
109806f25ae9SGregory Neil Shapirolocal_procmail	Use procmail or another delivery agent as the local mailer.
109906f25ae9SGregory Neil Shapiro		The argument to this feature is the pathname of the
110006f25ae9SGregory Neil Shapiro		delivery agent, which defaults to PROCMAIL_MAILER_PATH.
110106f25ae9SGregory Neil Shapiro		Note that this does NOT use PROCMAIL_MAILER_FLAGS or
110206f25ae9SGregory Neil Shapiro		PROCMAIL_MAILER_ARGS for the local mailer; tweak
110306f25ae9SGregory Neil Shapiro		LOCAL_MAILER_FLAGS and LOCAL_MAILER_ARGS instead, or
110406f25ae9SGregory Neil Shapiro		specify the appropriate parameters.  When procmail is used,
110506f25ae9SGregory Neil Shapiro		the local mailer can make use of the
110606f25ae9SGregory Neil Shapiro		"user+indicator@local.host" syntax; normally the +indicator
110706f25ae9SGregory Neil Shapiro		is just tossed, but by default it is passed as the -a
110806f25ae9SGregory Neil Shapiro		argument to procmail.
110906f25ae9SGregory Neil Shapiro
111006f25ae9SGregory Neil Shapiro		This feature can take up to three arguments:
111106f25ae9SGregory Neil Shapiro
111206f25ae9SGregory Neil Shapiro		1. Path to the mailer program
111306f25ae9SGregory Neil Shapiro		   [default: /usr/local/bin/procmail]
111406f25ae9SGregory Neil Shapiro		2. Argument vector including name of the program
111506f25ae9SGregory Neil Shapiro		   [default: procmail -Y -a $h -d $u]
111606f25ae9SGregory Neil Shapiro		3. Flags for the mailer [default: SPfhn9]
111706f25ae9SGregory Neil Shapiro
111806f25ae9SGregory Neil Shapiro		Empty arguments cause the defaults to be taken.
111913bd1963SGregory Neil Shapiro		Note that if you are on a system with a broken
112013bd1963SGregory Neil Shapiro		setreuid() call, you may need to add -f $f to the procmail
112113bd1963SGregory Neil Shapiro		argument vector to pass the proper sender to procmail.
112206f25ae9SGregory Neil Shapiro
112306f25ae9SGregory Neil Shapiro		For example, this allows it to use the maildrop
112406f25ae9SGregory Neil Shapiro		(http://www.flounder.net/~mrsam/maildrop/) mailer instead
112506f25ae9SGregory Neil Shapiro		by specifying:
112606f25ae9SGregory Neil Shapiro
112706f25ae9SGregory Neil Shapiro		FEATURE(`local_procmail', `/usr/local/bin/maildrop',
112806f25ae9SGregory Neil Shapiro		 `maildrop -d $u')
112906f25ae9SGregory Neil Shapiro
113006f25ae9SGregory Neil Shapiro		or scanmails using:
113106f25ae9SGregory Neil Shapiro
113206f25ae9SGregory Neil Shapiro		FEATURE(`local_procmail', `/usr/local/bin/scanmails')
113306f25ae9SGregory Neil Shapiro
113406f25ae9SGregory Neil Shapiro		WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally,
113506f25ae9SGregory Neil Shapiro		i.e.,  without respecting any definitions in an OSTYPE setting.
1136c2aa98e2SPeter Wemm
1137c2aa98e2SPeter Wemmbestmx_is_local	Accept mail as though locally addressed for any host that
1138c2aa98e2SPeter Wemm		lists us as the best possible MX record.  This generates
1139c2aa98e2SPeter Wemm		additional DNS traffic, but should be OK for low to
1140c2aa98e2SPeter Wemm		medium traffic hosts.  The argument may be a set of
1141c2aa98e2SPeter Wemm		domains, which will limit the feature to only apply to
1142c2aa98e2SPeter Wemm		these domains -- this will reduce unnecessary DNS
1143c2aa98e2SPeter Wemm		traffic.  THIS FEATURE IS FUNDAMENTALLY INCOMPATIBLE WITH
1144c2aa98e2SPeter Wemm		WILDCARD MX RECORDS!!!  If you have a wildcard MX record
1145c2aa98e2SPeter Wemm		that matches your domain, you cannot use this feature.
1146c2aa98e2SPeter Wemm
1147c2aa98e2SPeter Wemmsmrsh		Use the SendMail Restricted SHell (smrsh) provided
1148c2aa98e2SPeter Wemm		with the distribution instead of /bin/sh for mailing
1149c2aa98e2SPeter Wemm		to programs.  This improves the ability of the local
1150c2aa98e2SPeter Wemm		system administrator to control what gets run via
1151c2aa98e2SPeter Wemm		e-mail.  If an argument is provided it is used as the
1152c2aa98e2SPeter Wemm		pathname to smrsh; otherwise, the path defined by
1153c2aa98e2SPeter Wemm		confEBINDIR is used for the smrsh binary -- by default,
1154c2aa98e2SPeter Wemm		/usr/libexec/smrsh is assumed.
1155c2aa98e2SPeter Wemm
1156c2aa98e2SPeter Wemmpromiscuous_relay
1157c2aa98e2SPeter Wemm		By default, the sendmail configuration files do not permit
1158c2aa98e2SPeter Wemm		mail relaying (that is, accepting mail from outside your
115906f25ae9SGregory Neil Shapiro		local host (class {w}) and sending it to another host than
116006f25ae9SGregory Neil Shapiro		your local host).  This option sets your site to allow
116106f25ae9SGregory Neil Shapiro		mail relaying from any site to any site.  In almost all
116206f25ae9SGregory Neil Shapiro		cases, it is better to control relaying more carefully
116306f25ae9SGregory Neil Shapiro		with the access map, class {R}, or authentication.  Domains
116406f25ae9SGregory Neil Shapiro		can be added to class {R} by the macros RELAY_DOMAIN or
116506f25ae9SGregory Neil Shapiro		RELAY_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
116606f25ae9SGregory Neil Shapiro		MASQUERADE_DOMAIN_FILE, see below).
1167c2aa98e2SPeter Wemm
1168c2aa98e2SPeter Wemmrelay_entire_domain
116994c01205SGregory Neil Shapiro		This option allows any host in your domain as defined by
117094c01205SGregory Neil Shapiro		class {m} to use your server for relaying.  Notice: make
117194c01205SGregory Neil Shapiro		sure that your domain is not just a top level domain,
117294c01205SGregory Neil Shapiro		e.g., com.  This can happen if you give your host a name
117394c01205SGregory Neil Shapiro		like example.com instead of host.example.com.
1174c2aa98e2SPeter Wemm
1175c2aa98e2SPeter Wemmrelay_hosts_only
1176c2aa98e2SPeter Wemm		By default, names that are listed as RELAY in the access
117794c01205SGregory Neil Shapiro		db and class {R} are treated as domain names, not host names.
1178c2aa98e2SPeter Wemm		For example, if you specify ``foo.com'', then mail to or
1179c2aa98e2SPeter Wemm		from foo.com, abc.foo.com, or a.very.deep.domain.foo.com
1180c2aa98e2SPeter Wemm		will all be accepted for relaying.  This feature changes
1181c2aa98e2SPeter Wemm		the behaviour to look up individual host names only.
1182c2aa98e2SPeter Wemm
1183c2aa98e2SPeter Wemmrelay_based_on_MX
1184c2aa98e2SPeter Wemm		Turns on the ability to allow relaying based on the MX
1185065a643dSPeter Wemm		records of the host portion of an incoming recipient; that
1186065a643dSPeter Wemm		is, if an MX record for host foo.com points to your site,
1187065a643dSPeter Wemm		you will accept and relay mail addressed to foo.com.  See
1188c2aa98e2SPeter Wemm		description below for more information before using this
1189065a643dSPeter Wemm		feature.  Also, see the KNOWNBUGS entry regarding bestmx
1190065a643dSPeter Wemm		map lookups.
1191065a643dSPeter Wemm
11922e43090eSPeter Wemm		FEATURE(`relay_based_on_MX') does not necessarily allow
1193065a643dSPeter Wemm		routing of these messages which you expect to be allowed,
1194065a643dSPeter Wemm		if route address syntax (or %-hack syntax) is used.  If
1195065a643dSPeter Wemm		this is a problem, add entries to the access-table or use
11962e43090eSPeter Wemm		FEATURE(`loose_relay_check').
1197c2aa98e2SPeter Wemm
119806f25ae9SGregory Neil Shapirorelay_mail_from
119906f25ae9SGregory Neil Shapiro		Allows relaying if the mail sender is listed as RELAY in
120013bd1963SGregory Neil Shapiro		the access map.  If an optional argument `domain' (this
120113bd1963SGregory Neil Shapiro		is the literal word `domain', not a placeholder) is given,
120240266059SGregory Neil Shapiro		relaying can be allowed just based on the domain portion
120340266059SGregory Neil Shapiro		of the sender address.  This feature should only be used if
120440266059SGregory Neil Shapiro		absolutely necessary as the sender address can be easily
120594c01205SGregory Neil Shapiro		forged.  Use of this feature requires the "From:" tag to
120694c01205SGregory Neil Shapiro		be used for the key in the access map; see the discussion
120740266059SGregory Neil Shapiro		of tags and FEATURE(`relay_mail_from') in the section on
120840266059SGregory Neil Shapiro		anti-spam configuration control.
120906f25ae9SGregory Neil Shapiro
1210c2aa98e2SPeter Wemmrelay_local_from
1211c2aa98e2SPeter Wemm		Allows relaying if the domain portion of the mail sender
1212c2aa98e2SPeter Wemm		is a local host.  This should only be used if absolutely
1213065a643dSPeter Wemm		necessary as it opens a window for spammers.  Specifically,
1214065a643dSPeter Wemm		they can send mail to your mail server that claims to be
1215065a643dSPeter Wemm		from your domain (either directly or via a routed address),
1216065a643dSPeter Wemm		and you will go ahead and relay it out to arbitrary hosts
1217065a643dSPeter Wemm		on the Internet.
1218c2aa98e2SPeter Wemm
1219c2aa98e2SPeter Wemmaccept_unqualified_senders
1220c2aa98e2SPeter Wemm		Normally, MAIL FROM: commands in the SMTP session will be
1221c2aa98e2SPeter Wemm		refused if the connection is a network connection and the
1222c2aa98e2SPeter Wemm		sender address does not include a domain name.  If your
122306f25ae9SGregory Neil Shapiro		setup sends local mail unqualified (i.e., MAIL FROM:<joe>),
1224c2aa98e2SPeter Wemm		you will need to use this feature to accept unqualified
122506f25ae9SGregory Neil Shapiro		sender addresses.  Setting the DaemonPortOptions modifier
122606f25ae9SGregory Neil Shapiro		'u' overrides the default behavior, i.e., unqualified
122706f25ae9SGregory Neil Shapiro		addresses are accepted even without this FEATURE.
122806f25ae9SGregory Neil Shapiro		If this FEATURE is not used, the DaemonPortOptions modifier
122906f25ae9SGregory Neil Shapiro		'f' can be used to enforce fully qualified addresses.
1230c2aa98e2SPeter Wemm
1231c2aa98e2SPeter Wemmaccept_unresolvable_domains
1232c2aa98e2SPeter Wemm		Normally, MAIL FROM: commands in the SMTP session will be
123306f25ae9SGregory Neil Shapiro		refused if the host part of the argument to MAIL FROM:
123406f25ae9SGregory Neil Shapiro		cannot be located in the host name service (e.g., an A or
123506f25ae9SGregory Neil Shapiro		MX record in DNS).  If you are inside a firewall that has
123606f25ae9SGregory Neil Shapiro		only a limited view of the Internet host name space, this
123706f25ae9SGregory Neil Shapiro		could cause problems.  In this case you probably want to
123806f25ae9SGregory Neil Shapiro		use this feature to accept all domains on input, even if
123906f25ae9SGregory Neil Shapiro		they are unresolvable.
1240c2aa98e2SPeter Wemm
1241c2aa98e2SPeter Wemmaccess_db	Turns on the access database feature.  The access db gives
1242c2aa98e2SPeter Wemm		you the ability to allow or refuse to accept mail from
124340266059SGregory Neil Shapiro		specified domains for administrative reasons.  Moreover,
124440266059SGregory Neil Shapiro		it can control the behavior of sendmail in various situations.
124540266059SGregory Neil Shapiro		By default, the access database specification is:
12462e43090eSPeter Wemm
124740266059SGregory Neil Shapiro			hash -T<TMPF> /etc/mail/access
12482e43090eSPeter Wemm
124940266059SGregory Neil Shapiro		See the anti-spam configuration control section for further
125040266059SGregory Neil Shapiro		important information about this feature.  Notice:
125140266059SGregory Neil Shapiro		"-T<TMPF>" is meant literal, do not replace it by anything.
1252c2aa98e2SPeter Wemm
1253*5b0945b5SGregory Neil Shapiroblocklist_recipients
1254c2aa98e2SPeter Wemm		Turns on the ability to block incoming mail for certain
1255c2aa98e2SPeter Wemm		recipient usernames, hostnames, or addresses.  For
1256c2aa98e2SPeter Wemm		example, you can block incoming mail to user nobody,
1257c2aa98e2SPeter Wemm		host foo.mydomain.com, or guest@bar.mydomain.com.
1258c2aa98e2SPeter Wemm		These specifications are put in the access db as
125906f25ae9SGregory Neil Shapiro		described in the anti-spam configuration control section
126006f25ae9SGregory Neil Shapiro		later in this document.
1261c2aa98e2SPeter Wemm
1262193538b7SGregory Neil Shapirodelay_checks	The rulesets check_mail and check_relay will not be called
1263193538b7SGregory Neil Shapiro		when a client connects or issues a MAIL command, respectively.
1264193538b7SGregory Neil Shapiro		Instead, those rulesets will be called by the check_rcpt
1265193538b7SGregory Neil Shapiro		ruleset; they will be skipped under certain circumstances.
126640266059SGregory Neil Shapiro		See "Delay all checks" in the anti-spam configuration control
126740266059SGregory Neil Shapiro		section.  Note: this feature is incompatible to the versions
126840266059SGregory Neil Shapiro		in 8.10 and 8.11.
1269c2aa98e2SPeter Wemm
1270e92d3f3fSGregory Neil Shapirouse_client_ptr	If this feature is enabled then check_relay will override
1271e92d3f3fSGregory Neil Shapiro		its first argument with $&{client_ptr}.  This is useful for
1272e92d3f3fSGregory Neil Shapiro		rejections based on the unverified hostname of client,
1273e92d3f3fSGregory Neil Shapiro		which turns on the same behavior as in earlier sendmail
1274e92d3f3fSGregory Neil Shapiro		versions when delay_checks was not in use.  See doc/op/op.*
1275e92d3f3fSGregory Neil Shapiro		about check_relay, {client_name}, and {client_ptr}.
1276e92d3f3fSGregory Neil Shapiro
1277d0cef73dSGregory Neil Shapirodnsbl		Turns on rejection, discarding, or quarantining of hosts
1278d0cef73dSGregory Neil Shapiro		found in a DNS based list.  The first argument is used as
1279d0cef73dSGregory Neil Shapiro		the domain in which blocked hosts are listed.  A second
1280d0cef73dSGregory Neil Shapiro		argument can be used to change the default error message,
1281d0cef73dSGregory Neil Shapiro		or select one of the operations `discard' and `quarantine'.
1282d0cef73dSGregory Neil Shapiro		Without that second argument, the error message will be
1283d0cef73dSGregory Neil Shapiro
1284739ac4d4SGregory Neil Shapiro			Rejected: IP-ADDRESS listed at SERVER
1285d0cef73dSGregory Neil Shapiro
128640266059SGregory Neil Shapiro		where IP-ADDRESS and SERVER are replaced by the appropriate
128740266059SGregory Neil Shapiro		information.  By default, temporary lookup failures are
128840266059SGregory Neil Shapiro		ignored.  This behavior can be changed by specifying a
128940266059SGregory Neil Shapiro		third argument, which must be either `t' or a full error
129040266059SGregory Neil Shapiro		message.  See the anti-spam configuration control section for
129140266059SGregory Neil Shapiro		an example.  The dnsbl feature can be included several times
129240266059SGregory Neil Shapiro		to query different DNS based rejection lists.  See also
129340266059SGregory Neil Shapiro		enhdnsbl for an enhanced version.
129406f25ae9SGregory Neil Shapiro
129513bd1963SGregory Neil Shapiro		Set the DNSBL_MAP mc option to change the default map
129613bd1963SGregory Neil Shapiro		definition from `host'.  Set the DNSBL_MAP_OPT mc option
129713bd1963SGregory Neil Shapiro		to add additional options to the map specification used.
129813bd1963SGregory Neil Shapiro
129994c01205SGregory Neil Shapiro		Some DNS based rejection lists cause failures if asked
130094c01205SGregory Neil Shapiro		for AAAA records. If your sendmail version is compiled
130194c01205SGregory Neil Shapiro		with IPv6 support (NETINET6) and you experience this
130294c01205SGregory Neil Shapiro		problem, add
130394c01205SGregory Neil Shapiro
130494c01205SGregory Neil Shapiro			define(`DNSBL_MAP', `dns -R A')
130594c01205SGregory Neil Shapiro
130694c01205SGregory Neil Shapiro		before the first use of this feature.  Alternatively you
1307d9986b26SGregory Neil Shapiro		can use enhdnsbl instead (see below).  Moreover, this
1308d9986b26SGregory Neil Shapiro		statement can be used to reduce the number of DNS retries,
1309d9986b26SGregory Neil Shapiro		e.g.,
1310d9986b26SGregory Neil Shapiro
1311d9986b26SGregory Neil Shapiro			define(`DNSBL_MAP', `dns -R A -r2')
1312d9986b26SGregory Neil Shapiro
1313d9986b26SGregory Neil Shapiro		See below (EDNSBL_TO) for an explanation.
131494c01205SGregory Neil Shapiro
131540266059SGregory Neil Shapiroenhdnsbl	Enhanced version of dnsbl (see above).  Further arguments
131640266059SGregory Neil Shapiro		(up to 5) can be used to specify specific return values
131740266059SGregory Neil Shapiro		from lookups.  Temporary lookup failures are ignored unless
131840266059SGregory Neil Shapiro		a third argument is given, which must be either `t' or a full
131940266059SGregory Neil Shapiro		error message.  By default, any successful lookup will
132040266059SGregory Neil Shapiro		generate an error.  Otherwise the result of the lookup is
132140266059SGregory Neil Shapiro		compared with the supplied argument(s), and only if a match
132240266059SGregory Neil Shapiro		occurs an error is generated.  For example,
132340266059SGregory Neil Shapiro
132440266059SGregory Neil Shapiro		FEATURE(`enhdnsbl', `dnsbl.example.com', `', `t', `127.0.0.2.')
132540266059SGregory Neil Shapiro
132640266059SGregory Neil Shapiro		will reject the e-mail if the lookup returns the value
132740266059SGregory Neil Shapiro		``127.0.0.2.'', or generate a 451 response if the lookup
132840266059SGregory Neil Shapiro		temporarily failed.  The arguments can contain metasymbols
132940266059SGregory Neil Shapiro		as they are allowed in the LHS of rules.  As the example
133040266059SGregory Neil Shapiro		shows, the default values are also used if an empty argument,
133140266059SGregory Neil Shapiro		i.e., `', is specified.  This feature requires that sendmail
133240266059SGregory Neil Shapiro		has been compiled with the flag DNSMAP (see sendmail/README).
133340266059SGregory Neil Shapiro
133413bd1963SGregory Neil Shapiro		Set the EDNSBL_TO mc option to change the DNS retry count
1335d9986b26SGregory Neil Shapiro		from the default value of 5, this can be very useful when
1336d9986b26SGregory Neil Shapiro		a DNS server is not responding, which in turn may cause
1337d9986b26SGregory Neil Shapiro		clients to time out (an entry stating
1338d9986b26SGregory Neil Shapiro
1339d9986b26SGregory Neil Shapiro			did not issue MAIL/EXPN/VRFY/ETRN
1340d9986b26SGregory Neil Shapiro
1341d9986b26SGregory Neil Shapiro		will be logged).
134213bd1963SGregory Neil Shapiro
1343e92d3f3fSGregory Neil Shapiroratecontrol	Enable simple ruleset to do connection rate control
1344e92d3f3fSGregory Neil Shapiro		checking.  This requires entries in access_db of the form
1345e92d3f3fSGregory Neil Shapiro
1346e92d3f3fSGregory Neil Shapiro			ClientRate:IP.ADD.RE.SS		LIMIT
1347e92d3f3fSGregory Neil Shapiro
1348e92d3f3fSGregory Neil Shapiro		The RHS specifies the maximum number of connections
1349e92d3f3fSGregory Neil Shapiro		(an integer number) over the time interval defined
1350e92d3f3fSGregory Neil Shapiro		by ConnectionRateWindowSize, where 0 means unlimited.
1351e92d3f3fSGregory Neil Shapiro
1352e92d3f3fSGregory Neil Shapiro		Take the following example:
1353e92d3f3fSGregory Neil Shapiro
1354e92d3f3fSGregory Neil Shapiro			ClientRate:10.1.2.3		4
1355e92d3f3fSGregory Neil Shapiro			ClientRate:127.0.0.1		0
1356e92d3f3fSGregory Neil Shapiro			ClientRate:			10
1357e92d3f3fSGregory Neil Shapiro
1358e92d3f3fSGregory Neil Shapiro		10.1.2.3 can only make up to 4 connections, the
1359e92d3f3fSGregory Neil Shapiro		general limit it 10, and 127.0.0.1 can make an unlimited
1360e92d3f3fSGregory Neil Shapiro		number of connections per ConnectionRateWindowSize.
1361e92d3f3fSGregory Neil Shapiro
1362e92d3f3fSGregory Neil Shapiro		See also CONNECTION CONTROL.
1363e92d3f3fSGregory Neil Shapiro
1364e92d3f3fSGregory Neil Shapiroconncontrol	Enable a simple check of the number of incoming SMTP
1365e92d3f3fSGregory Neil Shapiro		connections.  This requires entries in access_db of the
1366e92d3f3fSGregory Neil Shapiro		form
1367e92d3f3fSGregory Neil Shapiro
1368e92d3f3fSGregory Neil Shapiro			ClientConn:IP.ADD.RE.SS		LIMIT
1369e92d3f3fSGregory Neil Shapiro
1370e92d3f3fSGregory Neil Shapiro		The RHS specifies the maximum number of open connections
1371e92d3f3fSGregory Neil Shapiro		(an integer number).
1372e92d3f3fSGregory Neil Shapiro
1373e92d3f3fSGregory Neil Shapiro		Take the following example:
1374e92d3f3fSGregory Neil Shapiro
1375e92d3f3fSGregory Neil Shapiro			ClientConn:10.1.2.3		4
1376e92d3f3fSGregory Neil Shapiro			ClientConn:127.0.0.1		0
1377e92d3f3fSGregory Neil Shapiro			ClientConn:			10
1378e92d3f3fSGregory Neil Shapiro
1379e92d3f3fSGregory Neil Shapiro		10.1.2.3 can only have up to 4 open connections, the
1380e92d3f3fSGregory Neil Shapiro		general limit it 10, and 127.0.0.1 does not have any
1381e92d3f3fSGregory Neil Shapiro		explicit limit.
1382e92d3f3fSGregory Neil Shapiro
1383e92d3f3fSGregory Neil Shapiro		See also CONNECTION CONTROL.
1384e92d3f3fSGregory Neil Shapiro
1385e92d3f3fSGregory Neil Shapiromtamark		Experimental support for "Marking Mail Transfer Agents in
1386e92d3f3fSGregory Neil Shapiro		Reverse DNS with TXT RRs" (MTAMark), see
1387e92d3f3fSGregory Neil Shapiro		draft-stumpf-dns-mtamark-01.  Optional arguments are:
1388e92d3f3fSGregory Neil Shapiro
1389e92d3f3fSGregory Neil Shapiro		1. Error message, default:
1390e92d3f3fSGregory Neil Shapiro
1391e92d3f3fSGregory Neil Shapiro			550 Rejected: $&{client_addr} not listed as MTA
1392e92d3f3fSGregory Neil Shapiro
1393e92d3f3fSGregory Neil Shapiro		2. Temporary lookup failures are ignored unless a second
1394e92d3f3fSGregory Neil Shapiro		argument is given, which must be either `t' or a full
1395e92d3f3fSGregory Neil Shapiro		error message.
1396e92d3f3fSGregory Neil Shapiro
1397e92d3f3fSGregory Neil Shapiro		3. Lookup prefix, default: _perm._smtp._srv.  This should
1398e92d3f3fSGregory Neil Shapiro		not be changed unless the draft changes it.
1399e92d3f3fSGregory Neil Shapiro
1400e92d3f3fSGregory Neil Shapiro		Example:
1401e92d3f3fSGregory Neil Shapiro
1402e92d3f3fSGregory Neil Shapiro			FEATURE(`mtamark', `', `t')
1403e92d3f3fSGregory Neil Shapiro
140440266059SGregory Neil Shapirolookupdotdomain	Look up also .domain in the access map.  This allows to
140540266059SGregory Neil Shapiro		match only subdomains.  It does not work well with
140640266059SGregory Neil Shapiro		FEATURE(`relay_hosts_only'), because most lookups for
140740266059SGregory Neil Shapiro		subdomains are suppressed by the latter feature.
140840266059SGregory Neil Shapiro
1409c2aa98e2SPeter Wemmloose_relay_check
141006f25ae9SGregory Neil Shapiro		Normally, if % addressing is used for a recipient, e.g.
141106f25ae9SGregory Neil Shapiro		user%site@othersite, and othersite is in class {R}, the
1412c2aa98e2SPeter Wemm		check_rcpt ruleset will strip @othersite and recheck
1413c2aa98e2SPeter Wemm		user@site for relaying.  This feature changes that
1414c2aa98e2SPeter Wemm		behavior.  It should not be needed for most installations.
1415c2aa98e2SPeter Wemm
141640266059SGregory Neil Shapiroauthinfo	Provide a separate map for client side authentication
141740266059SGregory Neil Shapiro		information.  See SMTP AUTHENTICATION for details.
141840266059SGregory Neil Shapiro		By default, the authinfo database specification is:
141940266059SGregory Neil Shapiro
142040266059SGregory Neil Shapiro			hash /etc/mail/authinfo
142140266059SGregory Neil Shapiro
142240266059SGregory Neil Shapiropreserve_luser_host
142340266059SGregory Neil Shapiro		Preserve the name of the recipient host if LUSER_RELAY is
142440266059SGregory Neil Shapiro		used.  Without this option, the domain part of the
142540266059SGregory Neil Shapiro		recipient address will be replaced by the host specified as
142640266059SGregory Neil Shapiro		LUSER_RELAY.  This feature only works if the hostname is
142740266059SGregory Neil Shapiro		passed to the mailer (see mailer triple in op.me).  Note
142840266059SGregory Neil Shapiro		that in the default configuration the local mailer does not
142940266059SGregory Neil Shapiro		receive the hostname, i.e., the mailer triple has an empty
143040266059SGregory Neil Shapiro		hostname.
143140266059SGregory Neil Shapiro
143240266059SGregory Neil Shapiropreserve_local_plus_detail
143340266059SGregory Neil Shapiro		Preserve the +detail portion of the address when passing
143440266059SGregory Neil Shapiro		address to local delivery agent.  Disables alias and
143540266059SGregory Neil Shapiro		.forward +detail stripping (e.g., given user+detail, only
143640266059SGregory Neil Shapiro		that address will be looked up in the alias file; user+* and
143740266059SGregory Neil Shapiro		user will not be looked up).  Only use if the local
143840266059SGregory Neil Shapiro		delivery agent in use supports +detail addressing.
14395dd76dd0SGregory Neil Shapiro		Moreover, this will most likely not work if the 'w' flag
14405dd76dd0SGregory Neil Shapiro		for the local mailer is set as the entire local address
14415dd76dd0SGregory Neil Shapiro		including +detail is passed to the user lookup function.
144240266059SGregory Neil Shapiro
144340266059SGregory Neil Shapirocompat_check	Enable ruleset check_compat to look up pairs of addresses
144440266059SGregory Neil Shapiro		with the Compat: tag --	Compat:sender<@>recipient -- in the
144540266059SGregory Neil Shapiro		access map.  Valid values for the RHS include
144640266059SGregory Neil Shapiro			DISCARD	silently discard recipient
144740266059SGregory Neil Shapiro			TEMP:	return a temporary error
144840266059SGregory Neil Shapiro			ERROR:	return a permanent error
144940266059SGregory Neil Shapiro		In the last two cases, a 4xy/5xy SMTP reply code should
145040266059SGregory Neil Shapiro		follow the colon.
145140266059SGregory Neil Shapiro
145206f25ae9SGregory Neil Shapirono_default_msa	Don't generate the default MSA daemon, i.e.,
145306f25ae9SGregory Neil Shapiro		DAEMON_OPTIONS(`Port=587,Name=MSA,M=E')
145406f25ae9SGregory Neil Shapiro		To define a MSA daemon with other parameters, use this
145506f25ae9SGregory Neil Shapiro		FEATURE and introduce new settings via DAEMON_OPTIONS().
1456c2aa98e2SPeter Wemm
145740266059SGregory Neil Shapiromsp		Defines config file for Message Submission Program.
1458605302a5SGregory Neil Shapiro		See sendmail/SECURITY for details and cf/cf/submit.mc how
1459605302a5SGregory Neil Shapiro		to use it.  An optional argument can be used to override
1460605302a5SGregory Neil Shapiro		the default of `[localhost]' to use as host to send all
1461605302a5SGregory Neil Shapiro		e-mails to.  Note that MX records will be used if the
1462605302a5SGregory Neil Shapiro		specified hostname is not in square brackets (e.g.,
1463605302a5SGregory Neil Shapiro		[hostname]).  If `MSA' is specified as second argument then
1464605302a5SGregory Neil Shapiro		port 587 is used to contact the server.  Example:
146540266059SGregory Neil Shapiro
146640266059SGregory Neil Shapiro			FEATURE(`msp', `', `MSA')
146740266059SGregory Neil Shapiro
146840266059SGregory Neil Shapiro		Some more hints about possible changes can be found below
146940266059SGregory Neil Shapiro		in the section MESSAGE SUBMISSION PROGRAM.
147040266059SGregory Neil Shapiro
147113bd1963SGregory Neil Shapiro		Note: Due to many problems, submit.mc uses
147294c01205SGregory Neil Shapiro
147394c01205SGregory Neil Shapiro			FEATURE(`msp', `[127.0.0.1]')
147494c01205SGregory Neil Shapiro
147513bd1963SGregory Neil Shapiro		by default.  If you have a machine with IPv6 only,
147613bd1963SGregory Neil Shapiro		change it to
147713bd1963SGregory Neil Shapiro
1478da7d7b9cSGregory Neil Shapiro			FEATURE(`msp', `[IPv6:0:0:0:0:0:0:0:1]')
147913bd1963SGregory Neil Shapiro
148013bd1963SGregory Neil Shapiro		If you want to continue using '[localhost]', (the behavior
148113bd1963SGregory Neil Shapiro		up to 8.12.6), use
148213bd1963SGregory Neil Shapiro
148313bd1963SGregory Neil Shapiro			FEATURE(`msp')
148413bd1963SGregory Neil Shapiro
148540266059SGregory Neil Shapiroqueuegroup	A simple example how to select a queue group based
148640266059SGregory Neil Shapiro		on the full e-mail address or the domain of the
148740266059SGregory Neil Shapiro		recipient.  Selection is done via entries in the
148840266059SGregory Neil Shapiro		access map using the tag QGRP:, for example:
148940266059SGregory Neil Shapiro
149040266059SGregory Neil Shapiro			QGRP:example.com	main
149140266059SGregory Neil Shapiro			QGRP:friend@some.org	others
149240266059SGregory Neil Shapiro			QGRP:my.domain		local
149340266059SGregory Neil Shapiro
149440266059SGregory Neil Shapiro		where "main", "others", and "local" are names of
149540266059SGregory Neil Shapiro		queue groups.  If an argument is specified, it is used
149640266059SGregory Neil Shapiro		as default queue group.
149740266059SGregory Neil Shapiro
1498605302a5SGregory Neil Shapiro		Note: please read the warning in doc/op/op.me about
1499605302a5SGregory Neil Shapiro		queue groups and possible queue manipulations.
1500605302a5SGregory Neil Shapiro
1501e92d3f3fSGregory Neil Shapirogreet_pause	Adds the greet_pause ruleset which enables open proxy
1502e92d3f3fSGregory Neil Shapiro		and SMTP slamming protection.  The feature can take an
1503e92d3f3fSGregory Neil Shapiro		argument specifying the milliseconds to wait:
1504e92d3f3fSGregory Neil Shapiro
1505e92d3f3fSGregory Neil Shapiro			FEATURE(`greet_pause', `5000')  dnl 5 seconds
1506e92d3f3fSGregory Neil Shapiro
1507e92d3f3fSGregory Neil Shapiro		If FEATURE(`access_db') is enabled, an access database
1508e92d3f3fSGregory Neil Shapiro		lookup with the GreetPause tag is done using client
1509e92d3f3fSGregory Neil Shapiro		hostname, domain, IP address, or subnet to determine the
1510e92d3f3fSGregory Neil Shapiro		pause time:
1511e92d3f3fSGregory Neil Shapiro
1512e92d3f3fSGregory Neil Shapiro			GreetPause:my.domain	0
1513e92d3f3fSGregory Neil Shapiro			GreetPause:example.com	5000
1514e92d3f3fSGregory Neil Shapiro			GreetPause:10.1.2	2000
1515e92d3f3fSGregory Neil Shapiro			GreetPause:127.0.0.1	0
1516e92d3f3fSGregory Neil Shapiro
1517e92d3f3fSGregory Neil Shapiro		When using FEATURE(`access_db'), the optional
1518e92d3f3fSGregory Neil Shapiro		FEATURE(`greet_pause') argument becomes the default if
1519e92d3f3fSGregory Neil Shapiro		nothing is found in the access database.  A ruleset called
1520e92d3f3fSGregory Neil Shapiro		Local_greet_pause can be used for local modifications, e.g.,
1521e92d3f3fSGregory Neil Shapiro
1522e92d3f3fSGregory Neil Shapiro			LOCAL_RULESETS
1523e92d3f3fSGregory Neil Shapiro			SLocal_greet_pause
1524e92d3f3fSGregory Neil Shapiro			R$*		$: $&{daemon_flags}
1525e92d3f3fSGregory Neil Shapiro			R$* a $*	$# 0
1526e92d3f3fSGregory Neil Shapiro
1527d0cef73dSGregory Neil Shapiroblock_bad_helo	Reject messages from SMTP clients which provide a HELO/EHLO
1528d0cef73dSGregory Neil Shapiro		argument which is either unqualified, or is one of our own
1529d0cef73dSGregory Neil Shapiro		names (i.e., the server name instead of the client name).
1530d0cef73dSGregory Neil Shapiro		This check is performed at RCPT stage and disabled for the
1531d0cef73dSGregory Neil Shapiro		following cases:
1532d0cef73dSGregory Neil Shapiro		- authenticated sessions,
1533d0cef73dSGregory Neil Shapiro		- connections from IP addresses in class $={R}.
1534d0cef73dSGregory Neil Shapiro		Currently access_db lookups can not be used to
1535d0cef73dSGregory Neil Shapiro		(selectively) disable this test, moreover,
1536da7d7b9cSGregory Neil Shapiro
1537d0cef73dSGregory Neil Shapiro		FEATURE(`delay_checks')
1538da7d7b9cSGregory Neil Shapiro
1539da7d7b9cSGregory Neil Shapiro		is required.  Note, the block_bad_helo feature automatically
1540da7d7b9cSGregory Neil Shapiro		adds the IPv6 and IPv4 localhost IP addresses to $={w} (local
1541da7d7b9cSGregory Neil Shapiro		host names) and $={R} (relay permitted).
1542d0cef73dSGregory Neil Shapiro
1543d0cef73dSGregory Neil Shapirorequire_rdns	Reject mail from connecting SMTP clients without proper
1544d0cef73dSGregory Neil Shapiro		rDNS (reverse DNS), functional gethostbyaddr() resolution.
1545d0cef73dSGregory Neil Shapiro		Note: this feature will cause false positives, i.e., there
1546d0cef73dSGregory Neil Shapiro		are legitimate MTAs that do not have proper DNS entries.
1547d0cef73dSGregory Neil Shapiro		Rejecting mails from those MTAs is a local policy decision.
1548d0cef73dSGregory Neil Shapiro
1549d0cef73dSGregory Neil Shapiro		The basic policy is to reject message with a 5xx error if
1550d0cef73dSGregory Neil Shapiro		the IP address fails to resolve.  However, if this is a
1551d0cef73dSGregory Neil Shapiro		temporary failure, a 4xx temporary failure is returned.
1552d0cef73dSGregory Neil Shapiro		If the look-up succeeds, but returns an apparently forged
1553d0cef73dSGregory Neil Shapiro		value, this is treated as a temporary failure with a 4xx
1554d0cef73dSGregory Neil Shapiro		error code.
1555d0cef73dSGregory Neil Shapiro
1556d0cef73dSGregory Neil Shapiro		EXCEPTIONS:
1557d0cef73dSGregory Neil Shapiro
1558d0cef73dSGregory Neil Shapiro		Exceptions based on access entries are discussed below.
1559d0cef73dSGregory Neil Shapiro		Any IP address matched using $=R (the "relay-domains" file)
1560d0cef73dSGregory Neil Shapiro		is excepted from the rules.  Since we have explicitly
1561d0cef73dSGregory Neil Shapiro		allowed relaying for this host, based on IP address, we
1562d0cef73dSGregory Neil Shapiro		ignore the rDNS failure.
1563d0cef73dSGregory Neil Shapiro
1564d0cef73dSGregory Neil Shapiro		The philosophical assumption here is that most users do
1565d0cef73dSGregory Neil Shapiro		not control their rDNS.  They should be able to send mail
1566d0cef73dSGregory Neil Shapiro		through their ISP, whether or not they have valid rDNS.
1567d0cef73dSGregory Neil Shapiro		The class $=R, roughly speaking, contains those IP addresses
1568d0cef73dSGregory Neil Shapiro		and address ranges for which we are the ISP, or are acting
1569d0cef73dSGregory Neil Shapiro		as if the ISP.
1570d0cef73dSGregory Neil Shapiro
1571d0cef73dSGregory Neil Shapiro		If `delay_checks' is in effect (recommended), then any
1572d0cef73dSGregory Neil Shapiro		sender who has authenticated is also excepted from the
1573d0cef73dSGregory Neil Shapiro		restrictions.  This happens because the rules produced by
1574d0cef73dSGregory Neil Shapiro		this FEATURE() will not be applied to authenticated senders
1575d0cef73dSGregory Neil Shapiro		(assuming `delay_checks').
1576d0cef73dSGregory Neil Shapiro
1577d0cef73dSGregory Neil Shapiro		ACCESS MAP ENTRIES:
1578d0cef73dSGregory Neil Shapiro
1579d0cef73dSGregory Neil Shapiro		Entries such as
1580d0cef73dSGregory Neil Shapiro			Connect:1.2.3.4		OK
1581d0cef73dSGregory Neil Shapiro			Connect:1.2		RELAY
1582*5b0945b5SGregory Neil Shapiro		will allowlist IP address 1.2.3.4, so that the rDNS
1583d0cef73dSGregory Neil Shapiro		blocking does apply to that IP address
1584d0cef73dSGregory Neil Shapiro
1585d0cef73dSGregory Neil Shapiro		Entries such as
1586d0cef73dSGregory Neil Shapiro			Connect:1.2.3.4		REJECT
1587d0cef73dSGregory Neil Shapiro		will have the effect of forcing a temporary failure for
1588d0cef73dSGregory Neil Shapiro		that address to be treated as a permanent failure.
1589d0cef73dSGregory Neil Shapiro
1590d0cef73dSGregory Neil Shapirobadmx		Reject envelope sender addresses (MAIL) whose domain part
1591d0cef73dSGregory Neil Shapiro		resolves to a "bad" MX record.  By default these are
1592d0cef73dSGregory Neil Shapiro		MX records which resolve to A records that match the
1593d0cef73dSGregory Neil Shapiro		regular expression:
1594d0cef73dSGregory Neil Shapiro
1595d0cef73dSGregory Neil Shapiro		^(127\.|10\.|0\.0\.0\.0)
1596d0cef73dSGregory Neil Shapiro
1597d0cef73dSGregory Neil Shapiro		This default regular expression can be overridden by
1598d0cef73dSGregory Neil Shapiro		specifying an argument, e.g.,
1599d0cef73dSGregory Neil Shapiro
1600d0cef73dSGregory Neil Shapiro		FEATURE(`badmx', `^127\.0\.0\.1')
1601d0cef73dSGregory Neil Shapiro
1602d0cef73dSGregory Neil Shapiro		Note: this feature requires that the sendmail binary
1603d0cef73dSGregory Neil Shapiro		has been compiled with the options MAP_REGEX and
1604d0cef73dSGregory Neil Shapiro		DNSMAP.
1605d0cef73dSGregory Neil Shapiro
1606c2aa98e2SPeter Wemm+-------+
1607c2aa98e2SPeter Wemm| HACKS |
1608c2aa98e2SPeter Wemm+-------+
1609c2aa98e2SPeter Wemm
1610c2aa98e2SPeter WemmSome things just can't be called features.  To make this clear,
1611c2aa98e2SPeter Wemmthey go in the hack subdirectory and are referenced using the HACK
1612c2aa98e2SPeter Wemmmacro.  These will tend to be site-dependent.  The release
1613c2aa98e2SPeter Wemmincludes the Berkeley-dependent "cssubdomain" hack (that makes
1614c2aa98e2SPeter Wemmsendmail accept local names in either Berkeley.EDU or CS.Berkeley.EDU;
161506f25ae9SGregory Neil Shapirothis is intended as a short-term aid while moving hosts into
1616c2aa98e2SPeter Wemmsubdomains.
1617c2aa98e2SPeter Wemm
1618c2aa98e2SPeter Wemm
1619c2aa98e2SPeter Wemm+--------------------+
1620c2aa98e2SPeter Wemm| SITE CONFIGURATION |
1621c2aa98e2SPeter Wemm+--------------------+
1622c2aa98e2SPeter Wemm
1623c2aa98e2SPeter Wemm    *****************************************************
1624c2aa98e2SPeter Wemm    * This section is really obsolete, and is preserved	*
1625c2aa98e2SPeter Wemm    * only for back compatibility.  You should plan on	*
1626c2aa98e2SPeter Wemm    * using mailertables for new installations.  In	*
1627c2aa98e2SPeter Wemm    * particular, it doesn't work for the newer forms	*
1628c2aa98e2SPeter Wemm    * of UUCP mailers, such as uucp-uudom.		*
1629c2aa98e2SPeter Wemm    *****************************************************
1630c2aa98e2SPeter Wemm
1631c2aa98e2SPeter WemmComplex sites will need more local configuration information, such as
1632c2aa98e2SPeter Wemmlists of UUCP hosts they speak with directly.  This can get a bit more
1633c2aa98e2SPeter Wemmtricky.  For an example of a "complex" site, see cf/ucbvax.mc.
1634c2aa98e2SPeter Wemm
1635c2aa98e2SPeter WemmThe SITECONFIG macro allows you to indirectly reference site-dependent
1636c2aa98e2SPeter Wemmconfiguration information stored in the siteconfig subdirectory.  For
1637c2aa98e2SPeter Wemmexample, the line
1638c2aa98e2SPeter Wemm
163906f25ae9SGregory Neil Shapiro	SITECONFIG(`uucp.ucbvax', `ucbvax', `U')
1640c2aa98e2SPeter Wemm
1641c2aa98e2SPeter Wemmreads the file uucp.ucbvax for local connection information.  The
1642c2aa98e2SPeter Wemmsecond parameter is the local name (in this case just "ucbvax" since
1643c2aa98e2SPeter Wemmit is locally connected, and hence a UUCP hostname).  The third
1644c2aa98e2SPeter Wemmparameter is the name of both a macro to store the local name (in
164506f25ae9SGregory Neil Shapirothis case, {U}) and the name of the class (e.g., {U}) in which to store
1646c2aa98e2SPeter Wemmthe host information read from the file.  Another SITECONFIG line reads
1647c2aa98e2SPeter Wemm
164806f25ae9SGregory Neil Shapiro	SITECONFIG(`uucp.ucbarpa', `ucbarpa.Berkeley.EDU', `W')
1649c2aa98e2SPeter Wemm
1650c2aa98e2SPeter WemmThis says that the file uucp.ucbarpa contains the list of UUCP sites
165106f25ae9SGregory Neil Shapiroconnected to ucbarpa.Berkeley.EDU.  Class {W} will be used to
1652c2aa98e2SPeter Wemmstore this list, and $W is defined to be ucbarpa.Berkeley.EDU, that
1653c2aa98e2SPeter Wemmis, the name of the relay to which the hosts listed in uucp.ucbarpa
165406f25ae9SGregory Neil Shapiroare connected.  [The machine ucbarpa is gone now, but this
165506f25ae9SGregory Neil Shapiroout-of-date configuration file has been left around to demonstrate
165606f25ae9SGregory Neil Shapirohow you might do this.]
1657c2aa98e2SPeter Wemm
1658c2aa98e2SPeter WemmNote that the case of SITECONFIG with a third parameter of ``U'' is
1659c2aa98e2SPeter Wemmspecial; the second parameter is assumed to be the UUCP name of the
1660c2aa98e2SPeter Wemmlocal site, rather than the name of a remote site, and the UUCP name
166106f25ae9SGregory Neil Shapirois entered into class {w} (the list of local hostnames) as $U.UUCP.
1662c2aa98e2SPeter Wemm
1663c2aa98e2SPeter WemmThe siteconfig file (e.g., siteconfig/uucp.ucbvax.m4) contains nothing
1664c2aa98e2SPeter Wemmmore than a sequence of SITE macros describing connectivity.  For
1665c2aa98e2SPeter Wemmexample:
1666c2aa98e2SPeter Wemm
166706f25ae9SGregory Neil Shapiro	SITE(`cnmat')
166806f25ae9SGregory Neil Shapiro	SITE(`sgi olympus')
1669c2aa98e2SPeter Wemm
1670c2aa98e2SPeter WemmThe second example demonstrates that you can use two names on the
1671c2aa98e2SPeter Wemmsame line; these are usually aliases for the same host (or are at
1672c2aa98e2SPeter Wemmleast in the same company).
1673c2aa98e2SPeter Wemm
1674e92d3f3fSGregory Neil ShapiroThe macro LOCAL_UUCP can be used to add rules into the generated
1675e92d3f3fSGregory Neil Shapirocf file at the place where MAILER(`uucp') inserts its rules.  This
1676e92d3f3fSGregory Neil Shapiroshould only be used if really necessary.
1677c2aa98e2SPeter Wemm
1678c2aa98e2SPeter Wemm+--------------------+
1679c2aa98e2SPeter Wemm| USING UUCP MAILERS |
1680c2aa98e2SPeter Wemm+--------------------+
1681c2aa98e2SPeter Wemm
1682c2aa98e2SPeter WemmIt's hard to get UUCP mailers right because of the extremely ad hoc
1683c2aa98e2SPeter Wemmnature of UUCP addressing.  These config files are really designed
1684c2aa98e2SPeter Wemmfor domain-based addressing, even for UUCP sites.
1685c2aa98e2SPeter Wemm
1686c2aa98e2SPeter WemmThere are four UUCP mailers available.  The choice of which one to
1687c2aa98e2SPeter Wemmuse is partly a matter of local preferences and what is running at
1688c2aa98e2SPeter Wemmthe other end of your UUCP connection.  Unlike good protocols that
1689c2aa98e2SPeter Wemmdefine what will go over the wire, UUCP uses the policy that you
1690c2aa98e2SPeter Wemmshould do what is right for the other end; if they change, you have
1691c2aa98e2SPeter Wemmto change.  This makes it hard to do the right thing, and discourages
1692c2aa98e2SPeter Wemmpeople from updating their software.  In general, if you can avoid
1693c2aa98e2SPeter WemmUUCP, please do.
1694c2aa98e2SPeter Wemm
1695c2aa98e2SPeter WemmThe major choice is whether to go for a domainized scheme or a
1696c2aa98e2SPeter Wemmnon-domainized scheme.  This depends entirely on what the other
1697c2aa98e2SPeter Wemmend will recognize.  If at all possible, you should encourage the
1698c2aa98e2SPeter Wemmother end to go to a domain-based system -- non-domainized addresses
1699c2aa98e2SPeter Wemmdon't work entirely properly.
1700c2aa98e2SPeter Wemm
1701c2aa98e2SPeter WemmThe four mailers are:
1702c2aa98e2SPeter Wemm
1703c2aa98e2SPeter Wemm    uucp-old (obsolete name: "uucp")
1704c2aa98e2SPeter Wemm	This is the oldest, the worst (but the closest to UUCP) way of
170513d88268SGregory Neil Shapiro	sending messages across UUCP connections.  It does bangify
1706c2aa98e2SPeter Wemm	everything and prepends $U (your UUCP name) to the sender's
1707c2aa98e2SPeter Wemm	address (which can already be a bang path itself).  It can
1708c2aa98e2SPeter Wemm	only send to one address at a time, so it spends a lot of
1709c2aa98e2SPeter Wemm	time copying duplicates of messages.  Avoid this if at all
1710c2aa98e2SPeter Wemm	possible.
1711c2aa98e2SPeter Wemm
1712c2aa98e2SPeter Wemm    uucp-new (obsolete name: "suucp")
1713c2aa98e2SPeter Wemm	The same as above, except that it assumes that in one rmail
1714c2aa98e2SPeter Wemm	command you can specify several recipients.  It still has a
1715c2aa98e2SPeter Wemm	lot of other problems.
1716c2aa98e2SPeter Wemm
1717c2aa98e2SPeter Wemm    uucp-dom
1718c2aa98e2SPeter Wemm	This UUCP mailer keeps everything as domain addresses.
1719c2aa98e2SPeter Wemm	Basically, it uses the SMTP mailer rewriting rules.  This mailer
172040266059SGregory Neil Shapiro	is only included if MAILER(`smtp') is specified before
172140266059SGregory Neil Shapiro	MAILER(`uucp').
1722c2aa98e2SPeter Wemm
1723c2aa98e2SPeter Wemm	Unfortunately, a lot of UUCP mailer transport agents require
1724c2aa98e2SPeter Wemm	bangified addresses in the envelope, although you can use
1725c2aa98e2SPeter Wemm	domain-based addresses in the message header.  (The envelope
1726c2aa98e2SPeter Wemm	shows up as the From_ line on UNIX mail.)  So....
1727c2aa98e2SPeter Wemm
1728c2aa98e2SPeter Wemm    uucp-uudom
1729c2aa98e2SPeter Wemm	This is a cross between uucp-new (for the envelope addresses)
1730c2aa98e2SPeter Wemm	and uucp-dom (for the header addresses).  It bangifies the
1731c2aa98e2SPeter Wemm	envelope sender (From_ line in messages) without adding the
1732c2aa98e2SPeter Wemm	local hostname, unless there is no host name on the address
1733c2aa98e2SPeter Wemm	at all (e.g., "wolf") or the host component is a UUCP host name
1734c2aa98e2SPeter Wemm	instead of a domain name ("somehost!wolf" instead of
173506f25ae9SGregory Neil Shapiro	"some.dom.ain!wolf").  This is also included only if MAILER(`smtp')
173640266059SGregory Neil Shapiro	is also specified earlier.
1737c2aa98e2SPeter Wemm
1738c2aa98e2SPeter WemmExamples:
1739c2aa98e2SPeter Wemm
174006f25ae9SGregory Neil ShapiroOn host grasp.insa-lyon.fr (UUCP host name "grasp"), the following
174106f25ae9SGregory Neil Shapirosummarizes the sender rewriting for various mailers.
1742c2aa98e2SPeter Wemm
1743c2aa98e2SPeter WemmMailer		sender		rewriting in the envelope
1744c2aa98e2SPeter Wemm------		------		-------------------------
1745c2aa98e2SPeter Wemmuucp-{old,new}	wolf		grasp!wolf
1746c2aa98e2SPeter Wemmuucp-dom	wolf		wolf@grasp.insa-lyon.fr
1747c2aa98e2SPeter Wemmuucp-uudom	wolf		grasp.insa-lyon.fr!wolf
1748c2aa98e2SPeter Wemm
1749c2aa98e2SPeter Wemmuucp-{old,new}	wolf@fr.net	grasp!fr.net!wolf
1750c2aa98e2SPeter Wemmuucp-dom	wolf@fr.net	wolf@fr.net
1751c2aa98e2SPeter Wemmuucp-uudom	wolf@fr.net	fr.net!wolf
1752c2aa98e2SPeter Wemm
1753c2aa98e2SPeter Wemmuucp-{old,new}	somehost!wolf	grasp!somehost!wolf
1754c2aa98e2SPeter Wemmuucp-dom	somehost!wolf	somehost!wolf@grasp.insa-lyon.fr
1755c2aa98e2SPeter Wemmuucp-uudom	somehost!wolf	grasp.insa-lyon.fr!somehost!wolf
1756c2aa98e2SPeter Wemm
1757c2aa98e2SPeter WemmIf you are using one of the domainized UUCP mailers, you really want
1758c2aa98e2SPeter Wemmto convert all UUCP addresses to domain format -- otherwise, it will
1759c2aa98e2SPeter Wemmdo it for you (and probably not the way you expected).  For example,
1760c2aa98e2SPeter Wemmif you have the address foo!bar!baz (and you are not sending to foo),
1761c2aa98e2SPeter Wemmthe heuristics will add the @uucp.relay.name or @local.host.name to
1762c2aa98e2SPeter Wemmthis address.  However, if you map foo to foo.host.name first, it
1763c2aa98e2SPeter Wemmwill not add the local hostname.  You can do this using the uucpdomain
1764c2aa98e2SPeter Wemmfeature.
1765c2aa98e2SPeter Wemm
1766c2aa98e2SPeter Wemm
1767c2aa98e2SPeter Wemm+-------------------+
1768c2aa98e2SPeter Wemm| TWEAKING RULESETS |
1769c2aa98e2SPeter Wemm+-------------------+
1770c2aa98e2SPeter Wemm
1771c2aa98e2SPeter WemmFor more complex configurations, you can define special rules.
1772c2aa98e2SPeter WemmThe macro LOCAL_RULE_3 introduces rules that are used in canonicalizing
1773c2aa98e2SPeter Wemmthe names.  Any modifications made here are reflected in the header.
1774c2aa98e2SPeter Wemm
1775c2aa98e2SPeter WemmA common use is to convert old UUCP addresses to SMTP addresses using
1776c2aa98e2SPeter Wemmthe UUCPSMTP macro.  For example:
1777c2aa98e2SPeter Wemm
1778c2aa98e2SPeter Wemm	LOCAL_RULE_3
177906f25ae9SGregory Neil Shapiro	UUCPSMTP(`decvax',	`decvax.dec.com')
178006f25ae9SGregory Neil Shapiro	UUCPSMTP(`research',	`research.att.com')
1781c2aa98e2SPeter Wemm
1782c2aa98e2SPeter Wemmwill cause addresses of the form "decvax!user" and "research!user"
1783c2aa98e2SPeter Wemmto be converted to "user@decvax.dec.com" and "user@research.att.com"
1784c2aa98e2SPeter Wemmrespectively.
1785c2aa98e2SPeter Wemm
1786c2aa98e2SPeter WemmThis could also be used to look up hosts in a database map:
1787c2aa98e2SPeter Wemm
1788c2aa98e2SPeter Wemm	LOCAL_RULE_3
1789c2aa98e2SPeter Wemm	R$* < @ $+ > $*		$: $1 < @ $(hostmap $2 $) > $3
1790c2aa98e2SPeter Wemm
1791c2aa98e2SPeter WemmThis map would be defined in the LOCAL_CONFIG portion, as shown below.
1792c2aa98e2SPeter Wemm
1793c2aa98e2SPeter WemmSimilarly, LOCAL_RULE_0 can be used to introduce new parsing rules.
1794c2aa98e2SPeter WemmFor example, new rules are needed to parse hostnames that you accept
1795c2aa98e2SPeter Wemmvia MX records.  For example, you might have:
1796c2aa98e2SPeter Wemm
1797c2aa98e2SPeter Wemm	LOCAL_RULE_0
1798c2aa98e2SPeter Wemm	R$+ <@ host.dom.ain.>	$#uucp $@ cnmat $: $1 < @ host.dom.ain.>
1799c2aa98e2SPeter Wemm
1800c2aa98e2SPeter WemmYou would use this if you had installed an MX record for cnmat.Berkeley.EDU
1801c2aa98e2SPeter Wemmpointing at this host; this rule catches the message and forwards it on
1802c2aa98e2SPeter Wemmusing UUCP.
1803c2aa98e2SPeter Wemm
1804c2aa98e2SPeter WemmYou can also tweak rulesets 1 and 2 using LOCAL_RULE_1 and LOCAL_RULE_2.
1805c2aa98e2SPeter WemmThese rulesets are normally empty.
1806c2aa98e2SPeter Wemm
1807c2aa98e2SPeter WemmA similar macro is LOCAL_CONFIG.  This introduces lines added after the
180806f25ae9SGregory Neil Shapiroboilerplate option setting but before rulesets.  Do not declare rulesets in
180906f25ae9SGregory Neil Shapirothe LOCAL_CONFIG section.  It can be used to declare local database maps or
181006f25ae9SGregory Neil Shapirowhatever.  For example:
1811c2aa98e2SPeter Wemm
1812c2aa98e2SPeter Wemm	LOCAL_CONFIG
181306f25ae9SGregory Neil Shapiro	Khostmap hash /etc/mail/hostmap
1814c2aa98e2SPeter Wemm	Kyplocal nis -m hosts.byname
1815c2aa98e2SPeter Wemm
1816c2aa98e2SPeter Wemm
1817c2aa98e2SPeter Wemm+---------------------------+
1818c2aa98e2SPeter Wemm| MASQUERADING AND RELAYING |
1819c2aa98e2SPeter Wemm+---------------------------+
1820c2aa98e2SPeter Wemm
1821c2aa98e2SPeter WemmYou can have your host masquerade as another using
1822c2aa98e2SPeter Wemm
182306f25ae9SGregory Neil Shapiro	MASQUERADE_AS(`host.domain')
1824c2aa98e2SPeter Wemm
1825c2aa98e2SPeter WemmThis causes mail being sent to be labeled as coming from the
1826c2aa98e2SPeter Wemmindicated host.domain, rather than $j.  One normally masquerades as
182706f25ae9SGregory Neil Shapiroone of one's own subdomains (for example, it's unlikely that
182806f25ae9SGregory Neil ShapiroBerkeley would choose to masquerade as an MIT site).  This
182906f25ae9SGregory Neil Shapirobehaviour is modified by a plethora of FEATUREs; in particular, see
183006f25ae9SGregory Neil Shapiromasquerade_envelope, allmasquerade, limited_masquerade, and
183106f25ae9SGregory Neil Shapiromasquerade_entire_domain.
1832c2aa98e2SPeter Wemm
1833c2aa98e2SPeter WemmThe masquerade name is not normally canonified, so it is important
1834c2aa98e2SPeter Wemmthat it be your One True Name, that is, fully qualified and not a
1835c2aa98e2SPeter WemmCNAME.  However, if you use a CNAME, the receiving side may canonify
1836c2aa98e2SPeter Wemmit for you, so don't think you can cheat CNAME mapping this way.
1837c2aa98e2SPeter Wemm
1838c2aa98e2SPeter WemmNormally the only addresses that are masqueraded are those that come
183906f25ae9SGregory Neil Shapirofrom this host (that is, are either unqualified or in class {w}, the list
184006f25ae9SGregory Neil Shapiroof local domain names).  You can augment this list, which is realized
184106f25ae9SGregory Neil Shapiroby class {M} using
1842c2aa98e2SPeter Wemm
184306f25ae9SGregory Neil Shapiro	MASQUERADE_DOMAIN(`otherhost.domain')
1844c2aa98e2SPeter Wemm
1845c2aa98e2SPeter WemmThe effect of this is that although mail to user@otherhost.domain
1846c2aa98e2SPeter Wemmwill not be delivered locally, any mail including any user@otherhost.domain
1847c2aa98e2SPeter Wemmwill, when relayed, be rewritten to have the MASQUERADE_AS address.
1848c2aa98e2SPeter WemmThis can be a space-separated list of names.
1849c2aa98e2SPeter Wemm
1850c2aa98e2SPeter WemmIf these names are in a file, you can use
1851c2aa98e2SPeter Wemm
185206f25ae9SGregory Neil Shapiro	MASQUERADE_DOMAIN_FILE(`filename')
1853c2aa98e2SPeter Wemm
185406f25ae9SGregory Neil Shapiroto read the list of names from the indicated file (i.e., to add
185506f25ae9SGregory Neil Shapiroelements to class {M}).
185606f25ae9SGregory Neil Shapiro
185706f25ae9SGregory Neil ShapiroTo exempt hosts or subdomains from being masqueraded, you can use
185806f25ae9SGregory Neil Shapiro
185906f25ae9SGregory Neil Shapiro	MASQUERADE_EXCEPTION(`host.domain')
186006f25ae9SGregory Neil Shapiro
186106f25ae9SGregory Neil ShapiroThis can come handy if you want to masquerade a whole domain
186240266059SGregory Neil Shapiroexcept for one (or a few) host(s).  If these names are in a file,
186340266059SGregory Neil Shapiroyou can use
186440266059SGregory Neil Shapiro
186540266059SGregory Neil Shapiro	MASQUERADE_EXCEPTION_FILE(`filename')
1866c2aa98e2SPeter Wemm
1867c2aa98e2SPeter WemmNormally only header addresses are masqueraded.  If you want to
1868c2aa98e2SPeter Wemmmasquerade the envelope as well, use
1869c2aa98e2SPeter Wemm
18702e43090eSPeter Wemm	FEATURE(`masquerade_envelope')
1871c2aa98e2SPeter Wemm
1872c2aa98e2SPeter WemmThere are always users that need to be "exposed" -- that is, their
1873c2aa98e2SPeter Wemminternal site name should be displayed instead of the masquerade name.
187406f25ae9SGregory Neil ShapiroRoot is an example (which has been "exposed" by default prior to 8.10).
187506f25ae9SGregory Neil ShapiroYou can add users to this list using
1876c2aa98e2SPeter Wemm
187706f25ae9SGregory Neil Shapiro	EXPOSED_USER(`usernames')
1878c2aa98e2SPeter Wemm
187940266059SGregory Neil ShapiroThis adds users to class {E}; you could also use
1880c2aa98e2SPeter Wemm
188140266059SGregory Neil Shapiro	EXPOSED_USER_FILE(`filename')
1882c2aa98e2SPeter Wemm
1883c2aa98e2SPeter WemmYou can also arrange to relay all unqualified names (that is, names
1884c2aa98e2SPeter Wemmwithout @host) to a relay host.  For example, if you have a central
1885c2aa98e2SPeter Wemmemail server, you might relay to that host so that users don't have
1886c2aa98e2SPeter Wemmto have .forward files or aliases.  You can do this using
1887c2aa98e2SPeter Wemm
18882e43090eSPeter Wemm	define(`LOCAL_RELAY', `mailer:hostname')
1889c2aa98e2SPeter Wemm
1890c2aa98e2SPeter WemmThe ``mailer:'' can be omitted, in which case the mailer defaults to
1891c2aa98e2SPeter Wemm"relay".  There are some user names that you don't want relayed, perhaps
1892c2aa98e2SPeter Wemmbecause of local aliases.  A common example is root, which may be
1893c2aa98e2SPeter Wemmlocally aliased.  You can add entries to this list using
1894c2aa98e2SPeter Wemm
189506f25ae9SGregory Neil Shapiro	LOCAL_USER(`usernames')
1896c2aa98e2SPeter Wemm
189740266059SGregory Neil ShapiroThis adds users to class {L}; you could also use
1898c2aa98e2SPeter Wemm
189940266059SGregory Neil Shapiro	LOCAL_USER_FILE(`filename')
1900c2aa98e2SPeter Wemm
1901c2aa98e2SPeter WemmIf you want all incoming mail sent to a centralized hub, as for a
1902c2aa98e2SPeter Wemmshared /var/spool/mail scheme, use
1903c2aa98e2SPeter Wemm
19042e43090eSPeter Wemm	define(`MAIL_HUB', `mailer:hostname')
1905c2aa98e2SPeter Wemm
1906c2aa98e2SPeter WemmAgain, ``mailer:'' defaults to "relay".  If you define both LOCAL_RELAY
19072e43090eSPeter Wemmand MAIL_HUB _AND_ you have FEATURE(`stickyhost'), unqualified names will
1908c2aa98e2SPeter Wemmbe sent to the LOCAL_RELAY and other local names will be sent to MAIL_HUB.
190906f25ae9SGregory Neil ShapiroNote: there is a (long standing) bug which keeps this combination from
191006f25ae9SGregory Neil Shapiroworking for addresses of the form user+detail.
191106f25ae9SGregory Neil ShapiroNames in class {L} will be delivered locally, so you MUST have aliases or
1912c2aa98e2SPeter Wemm.forward files for them.
1913c2aa98e2SPeter Wemm
1914c2aa98e2SPeter WemmFor example, if you are on machine mastodon.CS.Berkeley.EDU and you have
19152e43090eSPeter WemmFEATURE(`stickyhost'), the following combinations of settings will have the
1916c2aa98e2SPeter Wemmindicated effects:
1917c2aa98e2SPeter Wemm
1918c2aa98e2SPeter Wemmemail sent to....	eric			  eric@mastodon.CS.Berkeley.EDU
1919c2aa98e2SPeter Wemm
1920c2aa98e2SPeter WemmLOCAL_RELAY set to	mail.CS.Berkeley.EDU	  (delivered locally)
1921c2aa98e2SPeter Wemmmail.CS.Berkeley.EDU	  (no local aliasing)	    (aliasing done)
1922c2aa98e2SPeter Wemm
1923c2aa98e2SPeter WemmMAIL_HUB set to		mammoth.CS.Berkeley.EDU	  mammoth.CS.Berkeley.EDU
1924c2aa98e2SPeter Wemmmammoth.CS.Berkeley.EDU	  (aliasing done)	    (aliasing done)
1925c2aa98e2SPeter Wemm
1926c2aa98e2SPeter WemmBoth LOCAL_RELAY and	mail.CS.Berkeley.EDU	  mammoth.CS.Berkeley.EDU
1927c2aa98e2SPeter WemmMAIL_HUB set as above	  (no local aliasing)	    (aliasing done)
1928c2aa98e2SPeter Wemm
19292e43090eSPeter WemmIf you do not have FEATURE(`stickyhost') set, then LOCAL_RELAY and
1930c2aa98e2SPeter WemmMAIL_HUB act identically, with MAIL_HUB taking precedence.
1931c2aa98e2SPeter Wemm
1932c2aa98e2SPeter WemmIf you want all outgoing mail to go to a central relay site, define
1933c2aa98e2SPeter WemmSMART_HOST as well.  Briefly:
1934c2aa98e2SPeter Wemm
1935c2aa98e2SPeter Wemm	LOCAL_RELAY applies to unqualified names (e.g., "eric").
1936c2aa98e2SPeter Wemm	MAIL_HUB applies to names qualified with the name of the
1937c2aa98e2SPeter Wemm		local host (e.g., "eric@mastodon.CS.Berkeley.EDU").
193806f25ae9SGregory Neil Shapiro	SMART_HOST applies to names qualified with other hosts or
193906f25ae9SGregory Neil Shapiro		bracketed addresses (e.g., "eric@mastodon.CS.Berkeley.EDU"
194006f25ae9SGregory Neil Shapiro		or "eric@[127.0.0.1]").
1941c2aa98e2SPeter Wemm
1942c2aa98e2SPeter WemmHowever, beware that other relays (e.g., UUCP_RELAY, BITNET_RELAY,
1943c2aa98e2SPeter WemmDECNET_RELAY, and FAX_RELAY) take precedence over SMART_HOST, so if you
1944c2aa98e2SPeter Wemmreally want absolutely everything to go to a single central site you will
1945c2aa98e2SPeter Wemmneed to unset all the other relays -- or better yet, find or build a
1946c2aa98e2SPeter Wemmminimal config file that does this.
1947c2aa98e2SPeter Wemm
1948c2aa98e2SPeter WemmFor duplicate suppression to work properly, the host name is best
1949c2aa98e2SPeter Wemmspecified with a terminal dot:
1950c2aa98e2SPeter Wemm
1951c2aa98e2SPeter Wemm	define(`MAIL_HUB', `host.domain.')
1952c2aa98e2SPeter Wemm	      note the trailing dot ---^
1953c2aa98e2SPeter Wemm
1954c2aa98e2SPeter Wemm
195540266059SGregory Neil Shapiro+-------------------------------------------+
195640266059SGregory Neil Shapiro| USING LDAP FOR ALIASES, MAPS, AND CLASSES |
195740266059SGregory Neil Shapiro+-------------------------------------------+
195840266059SGregory Neil Shapiro
195940266059SGregory Neil ShapiroLDAP can be used for aliases, maps, and classes by either specifying your
196040266059SGregory Neil Shapiroown LDAP map specification or using the built-in default LDAP map
196140266059SGregory Neil Shapirospecification.  The built-in default specifications all provide lookups
196240266059SGregory Neil Shapirowhich match against either the machine's fully qualified hostname (${j}) or
196340266059SGregory Neil Shapiroa "cluster".  The cluster allows you to share LDAP entries among a large
196440266059SGregory Neil Shapironumber of machines without having to enter each of the machine names into
196540266059SGregory Neil Shapiroeach LDAP entry.  To set the LDAP cluster name to use for a particular
196640266059SGregory Neil Shapiromachine or set of machines, set the confLDAP_CLUSTER m4 variable to a
196740266059SGregory Neil Shapirounique name.  For example:
196840266059SGregory Neil Shapiro
196940266059SGregory Neil Shapiro	define(`confLDAP_CLUSTER', `Servers')
197040266059SGregory Neil Shapiro
197140266059SGregory Neil ShapiroHere, the word `Servers' will be the cluster name.  As an example, assume
197240266059SGregory Neil Shapirothat smtp.sendmail.org, etrn.sendmail.org, and mx.sendmail.org all belong
197340266059SGregory Neil Shapiroto the Servers cluster.
197440266059SGregory Neil Shapiro
197540266059SGregory Neil ShapiroSome of the LDAP LDIF examples below show use of the Servers cluster.
197640266059SGregory Neil ShapiroEvery entry must have either a sendmailMTAHost or sendmailMTACluster
197740266059SGregory Neil Shapiroattribute or it will be ignored.  Be careful as mixing clusters and
197840266059SGregory Neil Shapiroindividual host records can have surprising results (see the CAUTION
197940266059SGregory Neil Shapirosections below).
198040266059SGregory Neil Shapiro
198140266059SGregory Neil ShapiroSee the file cf/sendmail.schema for the actual LDAP schemas.  Note that
198240266059SGregory Neil Shapirothis schema (and therefore the lookups and examples below) is experimental
198340266059SGregory Neil Shapiroat this point as it has had little public review.  Therefore, it may change
19844e4196cbSGregory Neil Shapiroin future versions.  Feedback via sendmail-YYYY@support.sendmail.org is
19854e4196cbSGregory Neil Shapiroencouraged (replace YYYY with the current year, e.g., 2005).
198640266059SGregory Neil Shapiro
198740266059SGregory Neil Shapiro-------
198840266059SGregory Neil ShapiroAliases
198940266059SGregory Neil Shapiro-------
199040266059SGregory Neil Shapiro
199140266059SGregory Neil ShapiroThe ALIAS_FILE (O AliasFile) option can be set to use LDAP for alias
199240266059SGregory Neil Shapirolookups.  To use the default schema, simply use:
199340266059SGregory Neil Shapiro
199440266059SGregory Neil Shapiro	define(`ALIAS_FILE', `ldap:')
199540266059SGregory Neil Shapiro
199640266059SGregory Neil ShapiroBy doing so, you will use the default schema which expands to a map
199740266059SGregory Neil Shapirodeclared as follows:
199840266059SGregory Neil Shapiro
199940266059SGregory Neil Shapiro	ldap -k (&(objectClass=sendmailMTAAliasObject)
200040266059SGregory Neil Shapiro		  (sendmailMTAAliasGrouping=aliases)
200140266059SGregory Neil Shapiro		  (|(sendmailMTACluster=${sendmailMTACluster})
200240266059SGregory Neil Shapiro		    (sendmailMTAHost=$j))
200340266059SGregory Neil Shapiro		  (sendmailMTAKey=%0))
2004e92d3f3fSGregory Neil Shapiro	     -v sendmailMTAAliasValue,sendmailMTAAliasSearch:FILTER:sendmailMTAAliasObject,sendmailMTAAliasURL:URL:sendmailMTAAliasObject
2005e92d3f3fSGregory Neil Shapiro
200640266059SGregory Neil Shapiro
200740266059SGregory Neil ShapiroNOTE: The macros shown above ${sendmailMTACluster} and $j are not actually
200840266059SGregory Neil Shapiroused when the binary expands the `ldap:' token as the AliasFile option is
200940266059SGregory Neil Shapironot actually macro-expanded when read from the sendmail.cf file.
201040266059SGregory Neil Shapiro
201140266059SGregory Neil ShapiroExample LDAP LDIF entries might be:
201240266059SGregory Neil Shapiro
201340266059SGregory Neil Shapiro	dn: sendmailMTAKey=sendmail-list, dc=sendmail, dc=org
201440266059SGregory Neil Shapiro	objectClass: sendmailMTA
201540266059SGregory Neil Shapiro	objectClass: sendmailMTAAlias
201640266059SGregory Neil Shapiro	objectClass: sendmailMTAAliasObject
201740266059SGregory Neil Shapiro	sendmailMTAAliasGrouping: aliases
201840266059SGregory Neil Shapiro	sendmailMTAHost: etrn.sendmail.org
201940266059SGregory Neil Shapiro	sendmailMTAKey: sendmail-list
202040266059SGregory Neil Shapiro	sendmailMTAAliasValue: ca@example.org
202140266059SGregory Neil Shapiro	sendmailMTAAliasValue: eric
202240266059SGregory Neil Shapiro	sendmailMTAAliasValue: gshapiro@example.com
202340266059SGregory Neil Shapiro
202440266059SGregory Neil Shapiro	dn: sendmailMTAKey=owner-sendmail-list, dc=sendmail, dc=org
202540266059SGregory Neil Shapiro	objectClass: sendmailMTA
202640266059SGregory Neil Shapiro	objectClass: sendmailMTAAlias
202740266059SGregory Neil Shapiro	objectClass: sendmailMTAAliasObject
202840266059SGregory Neil Shapiro	sendmailMTAAliasGrouping: aliases
202940266059SGregory Neil Shapiro	sendmailMTAHost: etrn.sendmail.org
203040266059SGregory Neil Shapiro	sendmailMTAKey: owner-sendmail-list
203140266059SGregory Neil Shapiro	sendmailMTAAliasValue: eric
203240266059SGregory Neil Shapiro
203340266059SGregory Neil Shapiro	dn: sendmailMTAKey=postmaster, dc=sendmail, dc=org
203440266059SGregory Neil Shapiro	objectClass: sendmailMTA
203540266059SGregory Neil Shapiro	objectClass: sendmailMTAAlias
203640266059SGregory Neil Shapiro	objectClass: sendmailMTAAliasObject
203740266059SGregory Neil Shapiro	sendmailMTAAliasGrouping: aliases
203840266059SGregory Neil Shapiro	sendmailMTACluster: Servers
203940266059SGregory Neil Shapiro	sendmailMTAKey: postmaster
204040266059SGregory Neil Shapiro	sendmailMTAAliasValue: eric
204140266059SGregory Neil Shapiro
204240266059SGregory Neil ShapiroHere, the aliases sendmail-list and owner-sendmail-list will be available
204340266059SGregory Neil Shapiroonly on etrn.sendmail.org but the postmaster alias will be available on
204440266059SGregory Neil Shapiroevery machine in the Servers cluster (including etrn.sendmail.org).
204540266059SGregory Neil Shapiro
204640266059SGregory Neil ShapiroCAUTION: aliases are additive so that entries like these:
204740266059SGregory Neil Shapiro
204840266059SGregory Neil Shapiro	dn: sendmailMTAKey=bob, dc=sendmail, dc=org
204940266059SGregory Neil Shapiro	objectClass: sendmailMTA
205040266059SGregory Neil Shapiro	objectClass: sendmailMTAAlias
205140266059SGregory Neil Shapiro	objectClass: sendmailMTAAliasObject
205240266059SGregory Neil Shapiro	sendmailMTAAliasGrouping: aliases
205340266059SGregory Neil Shapiro	sendmailMTACluster: Servers
205440266059SGregory Neil Shapiro	sendmailMTAKey: bob
205540266059SGregory Neil Shapiro	sendmailMTAAliasValue: eric
205640266059SGregory Neil Shapiro
2057605302a5SGregory Neil Shapiro	dn: sendmailMTAKey=bobetrn, dc=sendmail, dc=org
205840266059SGregory Neil Shapiro	objectClass: sendmailMTA
205940266059SGregory Neil Shapiro	objectClass: sendmailMTAAlias
206040266059SGregory Neil Shapiro	objectClass: sendmailMTAAliasObject
206140266059SGregory Neil Shapiro	sendmailMTAAliasGrouping: aliases
206240266059SGregory Neil Shapiro	sendmailMTAHost: etrn.sendmail.org
206340266059SGregory Neil Shapiro	sendmailMTAKey: bob
206440266059SGregory Neil Shapiro	sendmailMTAAliasValue: gshapiro
206540266059SGregory Neil Shapiro
206640266059SGregory Neil Shapirowould mean that on all of the hosts in the cluster, mail to bob would go to
206740266059SGregory Neil Shapiroeric EXCEPT on etrn.sendmail.org in which case it would go to BOTH eric and
206840266059SGregory Neil Shapirogshapiro.
206940266059SGregory Neil Shapiro
207040266059SGregory Neil ShapiroIf you prefer not to use the default LDAP schema for your aliases, you can
207140266059SGregory Neil Shapirospecify the map parameters when setting ALIAS_FILE.  For example:
207240266059SGregory Neil Shapiro
207340266059SGregory Neil Shapiro	define(`ALIAS_FILE', `ldap:-k (&(objectClass=mailGroup)(mail=%0)) -v mgrpRFC822MailMember')
207440266059SGregory Neil Shapiro
207540266059SGregory Neil Shapiro----
207640266059SGregory Neil ShapiroMaps
207740266059SGregory Neil Shapiro----
207840266059SGregory Neil Shapiro
207940266059SGregory Neil ShapiroFEATURE()'s which take an optional map definition argument (e.g., access,
208040266059SGregory Neil Shapiromailertable, virtusertable, etc.) can instead take the special keyword
208140266059SGregory Neil Shapiro`LDAP', e.g.:
208240266059SGregory Neil Shapiro
208340266059SGregory Neil Shapiro	FEATURE(`access_db', `LDAP')
208440266059SGregory Neil Shapiro	FEATURE(`virtusertable', `LDAP')
208540266059SGregory Neil Shapiro
208640266059SGregory Neil ShapiroWhen this keyword is given, that map will use LDAP lookups consisting of
208740266059SGregory Neil Shapirothe objectClass sendmailMTAClassObject, the attribute sendmailMTAMapName
208840266059SGregory Neil Shapirowith the map name, a search attribute of sendmailMTAKey, and the value
208940266059SGregory Neil Shapiroattribute sendmailMTAMapValue.
209040266059SGregory Neil Shapiro
209140266059SGregory Neil ShapiroThe values for sendmailMTAMapName are:
209240266059SGregory Neil Shapiro
209340266059SGregory Neil Shapiro	FEATURE()		sendmailMTAMapName
209440266059SGregory Neil Shapiro	---------		------------------
209540266059SGregory Neil Shapiro	access_db		access
209640266059SGregory Neil Shapiro	authinfo		authinfo
209740266059SGregory Neil Shapiro	bitdomain		bitdomain
209840266059SGregory Neil Shapiro	domaintable		domain
209940266059SGregory Neil Shapiro	genericstable		generics
210040266059SGregory Neil Shapiro	mailertable		mailer
210140266059SGregory Neil Shapiro	uucpdomain		uucpdomain
210240266059SGregory Neil Shapiro	virtusertable		virtuser
210340266059SGregory Neil Shapiro
210440266059SGregory Neil ShapiroFor example, FEATURE(`mailertable', `LDAP') would use the map definition:
210540266059SGregory Neil Shapiro
210640266059SGregory Neil Shapiro	Kmailertable ldap -k (&(objectClass=sendmailMTAMapObject)
210740266059SGregory Neil Shapiro			       (sendmailMTAMapName=mailer)
210840266059SGregory Neil Shapiro			       (|(sendmailMTACluster=${sendmailMTACluster})
210940266059SGregory Neil Shapiro				 (sendmailMTAHost=$j))
211040266059SGregory Neil Shapiro			       (sendmailMTAKey=%0))
2111e92d3f3fSGregory Neil Shapiro			  -1 -v sendmailMTAMapValue,sendmailMTAMapSearch:FILTER:sendmailMTAMapObject,sendmailMTAMapURL:URL:sendmailMTAMapObject
211240266059SGregory Neil Shapiro
211340266059SGregory Neil ShapiroAn example LDAP LDIF entry using this map might be:
211440266059SGregory Neil Shapiro
211540266059SGregory Neil Shapiro	dn: sendmailMTAMapName=mailer, dc=sendmail, dc=org
211640266059SGregory Neil Shapiro	objectClass: sendmailMTA
211740266059SGregory Neil Shapiro	objectClass: sendmailMTAMap
211840266059SGregory Neil Shapiro	sendmailMTACluster: Servers
211940266059SGregory Neil Shapiro	sendmailMTAMapName: mailer
212040266059SGregory Neil Shapiro
212140266059SGregory Neil Shapiro	dn: sendmailMTAKey=example.com, sendmailMTAMapName=mailer, dc=sendmail, dc=org
212240266059SGregory Neil Shapiro	objectClass: sendmailMTA
212340266059SGregory Neil Shapiro	objectClass: sendmailMTAMap
212440266059SGregory Neil Shapiro	objectClass: sendmailMTAMapObject
212540266059SGregory Neil Shapiro	sendmailMTAMapName: mailer
212640266059SGregory Neil Shapiro	sendmailMTACluster: Servers
212740266059SGregory Neil Shapiro	sendmailMTAKey: example.com
212840266059SGregory Neil Shapiro	sendmailMTAMapValue: relay:[smtp.example.com]
212940266059SGregory Neil Shapiro
213040266059SGregory Neil ShapiroCAUTION: If your LDAP database contains the record above and *ALSO* a host
213140266059SGregory Neil Shapirospecific record such as:
213240266059SGregory Neil Shapiro
213340266059SGregory Neil Shapiro	dn: sendmailMTAKey=example.com@etrn, sendmailMTAMapName=mailer, dc=sendmail, dc=org
213440266059SGregory Neil Shapiro	objectClass: sendmailMTA
213540266059SGregory Neil Shapiro	objectClass: sendmailMTAMap
213640266059SGregory Neil Shapiro	objectClass: sendmailMTAMapObject
213740266059SGregory Neil Shapiro	sendmailMTAMapName: mailer
213840266059SGregory Neil Shapiro	sendmailMTAHost: etrn.sendmail.org
213940266059SGregory Neil Shapiro	sendmailMTAKey: example.com
214040266059SGregory Neil Shapiro	sendmailMTAMapValue: relay:[mx.example.com]
214140266059SGregory Neil Shapiro
214240266059SGregory Neil Shapirothen these entries will give unexpected results.  When the lookup is done
214340266059SGregory Neil Shapiroon etrn.sendmail.org, the effect is that there is *NO* match at all as maps
214440266059SGregory Neil Shapirorequire a single match.  Since the host etrn.sendmail.org is also in the
214540266059SGregory Neil ShapiroServers cluster, LDAP would return two answers for the example.com map key
214640266059SGregory Neil Shapiroin which case sendmail would treat this as no match at all.
214740266059SGregory Neil Shapiro
214840266059SGregory Neil ShapiroIf you prefer not to use the default LDAP schema for your maps, you can
214940266059SGregory Neil Shapirospecify the map parameters when using the FEATURE().  For example:
215040266059SGregory Neil Shapiro
215140266059SGregory Neil Shapiro	FEATURE(`access_db', `ldap:-1 -k (&(objectClass=mapDatabase)(key=%0)) -v value')
215240266059SGregory Neil Shapiro
215340266059SGregory Neil Shapiro-------
215440266059SGregory Neil ShapiroClasses
215540266059SGregory Neil Shapiro-------
215640266059SGregory Neil Shapiro
215740266059SGregory Neil ShapiroNormally, classes can be filled via files or programs.  As of 8.12, they
215840266059SGregory Neil Shapirocan also be filled via map lookups using a new syntax:
215940266059SGregory Neil Shapiro
216040266059SGregory Neil Shapiro	F{ClassName}mapkey@mapclass:mapspec
216140266059SGregory Neil Shapiro
216240266059SGregory Neil Shapiromapkey is optional and if not provided the map key will be empty.  This can
216340266059SGregory Neil Shapirobe used with LDAP to read classes from LDAP.  Note that the lookup is only
216440266059SGregory Neil Shapirodone when sendmail is initially started.  Use the special value `@LDAP' to
216540266059SGregory Neil Shapirouse the default LDAP schema.  For example:
216640266059SGregory Neil Shapiro
216740266059SGregory Neil Shapiro	RELAY_DOMAIN_FILE(`@LDAP')
216840266059SGregory Neil Shapiro
216940266059SGregory Neil Shapirowould put all of the attribute sendmailMTAClassValue values of LDAP records
217040266059SGregory Neil Shapirowith objectClass sendmailMTAClass and an attribute sendmailMTAClassName of
217140266059SGregory Neil Shapiro'R' into class $={R}.  In other words, it is equivalent to the LDAP map
217240266059SGregory Neil Shapirospecification:
217340266059SGregory Neil Shapiro
217440266059SGregory Neil Shapiro	F{R}@ldap:-k (&(objectClass=sendmailMTAClass)
217540266059SGregory Neil Shapiro		       (sendmailMTAClassName=R)
217640266059SGregory Neil Shapiro		       (|(sendmailMTACluster=${sendmailMTACluster})
217740266059SGregory Neil Shapiro			 (sendmailMTAHost=$j)))
2178e92d3f3fSGregory Neil Shapiro		  -v sendmailMTAClassValue,sendmailMTAClassSearch:FILTER:sendmailMTAClass,sendmailMTAClassURL:URL:sendmailMTAClass
217940266059SGregory Neil Shapiro
218040266059SGregory Neil ShapiroNOTE: The macros shown above ${sendmailMTACluster} and $j are not actually
218140266059SGregory Neil Shapiroused when the binary expands the `@LDAP' token as class declarations are
218240266059SGregory Neil Shapironot actually macro-expanded when read from the sendmail.cf file.
218340266059SGregory Neil Shapiro
218440266059SGregory Neil ShapiroThis can be used with class related commands such as RELAY_DOMAIN_FILE(),
218540266059SGregory Neil ShapiroMASQUERADE_DOMAIN_FILE(), etc:
218640266059SGregory Neil Shapiro
218740266059SGregory Neil Shapiro	Command				sendmailMTAClassName
218840266059SGregory Neil Shapiro	-------				--------------------
218940266059SGregory Neil Shapiro	CANONIFY_DOMAIN_FILE()		Canonify
219040266059SGregory Neil Shapiro	EXPOSED_USER_FILE()		E
219140266059SGregory Neil Shapiro	GENERICS_DOMAIN_FILE()		G
219240266059SGregory Neil Shapiro	LDAPROUTE_DOMAIN_FILE()		LDAPRoute
219340266059SGregory Neil Shapiro	LDAPROUTE_EQUIVALENT_FILE()	LDAPRouteEquiv
219440266059SGregory Neil Shapiro	LOCAL_USER_FILE()		L
219540266059SGregory Neil Shapiro	MASQUERADE_DOMAIN_FILE()	M
219640266059SGregory Neil Shapiro	MASQUERADE_EXCEPTION_FILE()	N
219740266059SGregory Neil Shapiro	RELAY_DOMAIN_FILE()		R
219840266059SGregory Neil Shapiro	VIRTUSER_DOMAIN_FILE()		VirtHost
219940266059SGregory Neil Shapiro
220040266059SGregory Neil ShapiroYou can also add your own as any 'F'ile class of the form:
220140266059SGregory Neil Shapiro
220240266059SGregory Neil Shapiro	F{ClassName}@LDAP
220340266059SGregory Neil Shapiro	  ^^^^^^^^^
220440266059SGregory Neil Shapirowill use "ClassName" for the sendmailMTAClassName.
220540266059SGregory Neil Shapiro
220640266059SGregory Neil ShapiroAn example LDAP LDIF entry would look like:
220740266059SGregory Neil Shapiro
220840266059SGregory Neil Shapiro	dn: sendmailMTAClassName=R, dc=sendmail, dc=org
220940266059SGregory Neil Shapiro	objectClass: sendmailMTA
221040266059SGregory Neil Shapiro	objectClass: sendmailMTAClass
221140266059SGregory Neil Shapiro	sendmailMTACluster: Servers
221240266059SGregory Neil Shapiro	sendmailMTAClassName: R
221340266059SGregory Neil Shapiro	sendmailMTAClassValue: sendmail.org
221440266059SGregory Neil Shapiro	sendmailMTAClassValue: example.com
221540266059SGregory Neil Shapiro	sendmailMTAClassValue: 10.56.23
221640266059SGregory Neil Shapiro
221740266059SGregory Neil ShapiroCAUTION: If your LDAP database contains the record above and *ALSO* a host
221840266059SGregory Neil Shapirospecific record such as:
221940266059SGregory Neil Shapiro
222040266059SGregory Neil Shapiro	dn: sendmailMTAClassName=R@etrn.sendmail.org, dc=sendmail, dc=org
222140266059SGregory Neil Shapiro	objectClass: sendmailMTA
222240266059SGregory Neil Shapiro	objectClass: sendmailMTAClass
222340266059SGregory Neil Shapiro	sendmailMTAHost: etrn.sendmail.org
222440266059SGregory Neil Shapiro	sendmailMTAClassName: R
222540266059SGregory Neil Shapiro	sendmailMTAClassValue: example.com
222640266059SGregory Neil Shapiro
222740266059SGregory Neil Shapirothe result will be similar to the aliases caution above.  When the lookup
222840266059SGregory Neil Shapirois done on etrn.sendmail.org, $={R} would contain all of the entries (from
222940266059SGregory Neil Shapiroboth the cluster match and the host match).  In other words, the effective
223040266059SGregory Neil Shapirois additive.
223140266059SGregory Neil Shapiro
223240266059SGregory Neil ShapiroIf you prefer not to use the default LDAP schema for your classes, you can
223340266059SGregory Neil Shapirospecify the map parameters when using the class command.  For example:
223440266059SGregory Neil Shapiro
223540266059SGregory Neil Shapiro	VIRTUSER_DOMAIN_FILE(`@ldap:-k (&(objectClass=virtHosts)(host=*)) -v host')
223640266059SGregory Neil Shapiro
223740266059SGregory Neil ShapiroRemember, macros can not be used in a class declaration as the binary does
223840266059SGregory Neil Shapironot expand them.
223940266059SGregory Neil Shapiro
224040266059SGregory Neil Shapiro
224106f25ae9SGregory Neil Shapiro+--------------+
224206f25ae9SGregory Neil Shapiro| LDAP ROUTING |
224306f25ae9SGregory Neil Shapiro+--------------+
224406f25ae9SGregory Neil Shapiro
224506f25ae9SGregory Neil ShapiroFEATURE(`ldap_routing') can be used to implement the IETF Internet Draft
224606f25ae9SGregory Neil ShapiroLDAP Schema for Intranet Mail Routing
224706f25ae9SGregory Neil Shapiro(draft-lachman-laser-ldap-mail-routing-01).  This feature enables
224806f25ae9SGregory Neil ShapiroLDAP-based rerouting of a particular address to either a different host
224906f25ae9SGregory Neil Shapiroor a different address.  The LDAP lookup is first attempted on the full
225006f25ae9SGregory Neil Shapiroaddress (e.g., user@example.com) and then on the domain portion
225106f25ae9SGregory Neil Shapiro(e.g., @example.com).  Be sure to setup your domain for LDAP routing using
225206f25ae9SGregory Neil ShapiroLDAPROUTE_DOMAIN(), e.g.:
225306f25ae9SGregory Neil Shapiro
225406f25ae9SGregory Neil Shapiro	LDAPROUTE_DOMAIN(`example.com')
225506f25ae9SGregory Neil Shapiro
225640266059SGregory Neil ShapiroAdditionally, you can specify equivalent domains for LDAP routing using
225740266059SGregory Neil ShapiroLDAPROUTE_EQUIVALENT() and LDAPROUTE_EQUIVALENT_FILE().  'Equivalent'
225840266059SGregory Neil Shapirohostnames are mapped to $M (the masqueraded hostname for the server) before
225940266059SGregory Neil Shapirothe LDAP query.  For example, if the mail is addressed to
226040266059SGregory Neil Shapirouser@host1.example.com, normally the LDAP lookup would only be done for
226140266059SGregory Neil Shapiro'user@host1.example.com' and '@host1.example.com'.   However, if
226240266059SGregory Neil ShapiroLDAPROUTE_EQUIVALENT(`host1.example.com') is used, the lookups would also be
226340266059SGregory Neil Shapirodone on 'user@example.com' and '@example.com' after attempting the
226440266059SGregory Neil Shapirohost1.example.com lookups.
226540266059SGregory Neil Shapiro
226606f25ae9SGregory Neil ShapiroBy default, the feature will use the schemas as specified in the draft
226706f25ae9SGregory Neil Shapiroand will not reject addresses not found by the LDAP lookup.  However,
226806f25ae9SGregory Neil Shapirothis behavior can be changed by giving additional arguments to the FEATURE()
226906f25ae9SGregory Neil Shapirocommand:
227006f25ae9SGregory Neil Shapiro
2271e92d3f3fSGregory Neil Shapiro FEATURE(`ldap_routing', <mailHost>, <mailRoutingAddress>, <bounce>,
2272e92d3f3fSGregory Neil Shapiro		 <detail>, <nodomain>, <tempfail>)
227306f25ae9SGregory Neil Shapiro
227406f25ae9SGregory Neil Shapirowhere <mailHost> is a map definition describing how to look up an alternative
227506f25ae9SGregory Neil Shapiromail host for a particular address; <mailRoutingAddress> is a map definition
227640266059SGregory Neil Shapirodescribing how to look up an alternative address for a particular address;
227706f25ae9SGregory Neil Shapirothe <bounce> argument, if present and not the word "passthru", dictates
227806f25ae9SGregory Neil Shapirothat mail should be bounced if neither a mailHost nor mailRoutingAddress
2279e92d3f3fSGregory Neil Shapirois found, if set to "sendertoo", the sender will be rejected if not
2280e92d3f3fSGregory Neil Shapirofound in LDAP; and <detail> indicates what actions to take if the address
228140266059SGregory Neil Shapirocontains +detail information -- `strip' tries the lookup with the +detail
228240266059SGregory Neil Shapiroand if no matches are found, strips the +detail and tries the lookup again;
228340266059SGregory Neil Shapiro`preserve', does the same as `strip' but if a mailRoutingAddress match is
2284e92d3f3fSGregory Neil Shapirofound, the +detail information is copied to the new address; the <nodomain>
2285e92d3f3fSGregory Neil Shapiroargument, if present, will prevent the @domain lookup if the full
2286e92d3f3fSGregory Neil Shapiroaddress is not found in LDAP; the <tempfail> argument, if set to
2287e92d3f3fSGregory Neil Shapiro"tempfail", instructs the rules to give an SMTP 4XX temporary
2288e92d3f3fSGregory Neil Shapiroerror if the LDAP server gives the MTA a temporary failure, or if set to
2289e92d3f3fSGregory Neil Shapiro"queue" (the default), the MTA will locally queue the mail.
229006f25ae9SGregory Neil Shapiro
229106f25ae9SGregory Neil ShapiroThe default <mailHost> map definition is:
229206f25ae9SGregory Neil Shapiro
2293605302a5SGregory Neil Shapiro	ldap -1 -T<TMPF> -v mailHost -k (&(objectClass=inetLocalMailRecipient)
229406f25ae9SGregory Neil Shapiro				 (mailLocalAddress=%0))
229506f25ae9SGregory Neil Shapiro
229606f25ae9SGregory Neil ShapiroThe default <mailRoutingAddress> map definition is:
229706f25ae9SGregory Neil Shapiro
2298605302a5SGregory Neil Shapiro	ldap -1 -T<TMPF> -v mailRoutingAddress
2299605302a5SGregory Neil Shapiro			 -k (&(objectClass=inetLocalMailRecipient)
230006f25ae9SGregory Neil Shapiro			      (mailLocalAddress=%0))
230106f25ae9SGregory Neil Shapiro
230206f25ae9SGregory Neil ShapiroNote that neither includes the LDAP server hostname (-h server) or base DN
230306f25ae9SGregory Neil Shapiro(-b o=org,c=COUNTRY), both necessary for LDAP queries.  It is presumed that
230406f25ae9SGregory Neil Shapiroyour .mc file contains a setting for the confLDAP_DEFAULT_SPEC option with
230506f25ae9SGregory Neil Shapirothese settings.  If this is not the case, the map definitions should be
2306605302a5SGregory Neil Shapirochanged as described above.  The "-T<TMPF>" is required in any user
2307605302a5SGregory Neil Shapirospecified map definition to catch temporary errors.
230806f25ae9SGregory Neil Shapiro
230906f25ae9SGregory Neil ShapiroThe following possibilities exist as a result of an LDAP lookup on an
231006f25ae9SGregory Neil Shapiroaddress:
231106f25ae9SGregory Neil Shapiro
231206f25ae9SGregory Neil Shapiro	mailHost is	mailRoutingAddress is	Results in
231306f25ae9SGregory Neil Shapiro	-----------	---------------------	----------
231406f25ae9SGregory Neil Shapiro	set to a	set			mail delivered to
231506f25ae9SGregory Neil Shapiro	"local" host				mailRoutingAddress
231606f25ae9SGregory Neil Shapiro
231706f25ae9SGregory Neil Shapiro	set to a	not set			delivered to
231806f25ae9SGregory Neil Shapiro	"local" host				original address
231906f25ae9SGregory Neil Shapiro
232006f25ae9SGregory Neil Shapiro	set to a	set			mailRoutingAddress
232106f25ae9SGregory Neil Shapiro	remote host				relayed to mailHost
232206f25ae9SGregory Neil Shapiro
232306f25ae9SGregory Neil Shapiro	set to a	not set			original address
232406f25ae9SGregory Neil Shapiro	remote host				relayed to mailHost
232506f25ae9SGregory Neil Shapiro
232606f25ae9SGregory Neil Shapiro	not set		set			mail delivered to
232706f25ae9SGregory Neil Shapiro						mailRoutingAddress
232806f25ae9SGregory Neil Shapiro
232906f25ae9SGregory Neil Shapiro	not set		not set			delivered to
233006f25ae9SGregory Neil Shapiro						original address *OR*
233106f25ae9SGregory Neil Shapiro						bounced as unknown user
233206f25ae9SGregory Neil Shapiro
233340266059SGregory Neil ShapiroThe term "local" host above means the host specified is in class {w}.  If
233440266059SGregory Neil Shapirothe result would mean sending the mail to a different host, that host is
233540266059SGregory Neil Shapirolooked up in the mailertable before delivery.
233640266059SGregory Neil Shapiro
233706f25ae9SGregory Neil ShapiroNote that the last case depends on whether the third argument is given
233806f25ae9SGregory Neil Shapiroto the FEATURE() command.  The default is to deliver the message to the
233906f25ae9SGregory Neil Shapirooriginal address.
234006f25ae9SGregory Neil Shapiro
234106f25ae9SGregory Neil ShapiroThe LDAP entries should be set up with an objectClass of
234206f25ae9SGregory Neil ShapiroinetLocalMailRecipient and the address be listed in a mailLocalAddress
234306f25ae9SGregory Neil Shapiroattribute.  If present, there must be only one mailHost attribute and it
234406f25ae9SGregory Neil Shapiromust contain a fully qualified host name as its value.  Similarly, if
234506f25ae9SGregory Neil Shapiropresent, there must be only one mailRoutingAddress attribute and it must
234640266059SGregory Neil Shapirocontain an RFC 822 compliant address.  Some example LDAP records (in LDIF
234706f25ae9SGregory Neil Shapiroformat):
234806f25ae9SGregory Neil Shapiro
234906f25ae9SGregory Neil Shapiro	dn: uid=tom, o=example.com, c=US
235006f25ae9SGregory Neil Shapiro	objectClass: inetLocalMailRecipient
235106f25ae9SGregory Neil Shapiro	mailLocalAddress: tom@example.com
235206f25ae9SGregory Neil Shapiro	mailRoutingAddress: thomas@mailhost.example.com
235306f25ae9SGregory Neil Shapiro
235406f25ae9SGregory Neil ShapiroThis would deliver mail for tom@example.com to thomas@mailhost.example.com.
235506f25ae9SGregory Neil Shapiro
235606f25ae9SGregory Neil Shapiro	dn: uid=dick, o=example.com, c=US
235706f25ae9SGregory Neil Shapiro	objectClass: inetLocalMailRecipient
235806f25ae9SGregory Neil Shapiro	mailLocalAddress: dick@example.com
235906f25ae9SGregory Neil Shapiro	mailHost: eng.example.com
236006f25ae9SGregory Neil Shapiro
236106f25ae9SGregory Neil ShapiroThis would relay mail for dick@example.com to the same address but redirect
236240266059SGregory Neil Shapirothe mail to MX records listed for the host eng.example.com (unless the
236340266059SGregory Neil Shapiromailertable overrides).
236406f25ae9SGregory Neil Shapiro
236506f25ae9SGregory Neil Shapiro	dn: uid=harry, o=example.com, c=US
236606f25ae9SGregory Neil Shapiro	objectClass: inetLocalMailRecipient
236706f25ae9SGregory Neil Shapiro	mailLocalAddress: harry@example.com
236806f25ae9SGregory Neil Shapiro	mailHost: mktmail.example.com
236906f25ae9SGregory Neil Shapiro	mailRoutingAddress: harry@mkt.example.com
237006f25ae9SGregory Neil Shapiro
237106f25ae9SGregory Neil ShapiroThis would relay mail for harry@example.com to the MX records listed for
237206f25ae9SGregory Neil Shapirothe host mktmail.example.com using the new address harry@mkt.example.com
237306f25ae9SGregory Neil Shapirowhen talking to that host.
237406f25ae9SGregory Neil Shapiro
237506f25ae9SGregory Neil Shapiro	dn: uid=virtual.example.com, o=example.com, c=US
237606f25ae9SGregory Neil Shapiro	objectClass: inetLocalMailRecipient
237706f25ae9SGregory Neil Shapiro	mailLocalAddress: @virtual.example.com
237806f25ae9SGregory Neil Shapiro	mailHost: server.example.com
237906f25ae9SGregory Neil Shapiro	mailRoutingAddress: virtual@example.com
238006f25ae9SGregory Neil Shapiro
238106f25ae9SGregory Neil ShapiroThis would send all mail destined for any username @virtual.example.com to
238206f25ae9SGregory Neil Shapirothe machine server.example.com's MX servers and deliver to the address
238306f25ae9SGregory Neil Shapirovirtual@example.com on that relay machine.
238406f25ae9SGregory Neil Shapiro
238506f25ae9SGregory Neil Shapiro
2386c2aa98e2SPeter Wemm+---------------------------------+
2387c2aa98e2SPeter Wemm| ANTI-SPAM CONFIGURATION CONTROL |
2388c2aa98e2SPeter Wemm+---------------------------------+
2389c2aa98e2SPeter Wemm
2390c2aa98e2SPeter WemmThe primary anti-spam features available in sendmail are:
2391c2aa98e2SPeter Wemm
2392c2aa98e2SPeter Wemm* Relaying is denied by default.
2393c2aa98e2SPeter Wemm* Better checking on sender information.
2394c2aa98e2SPeter Wemm* Access database.
2395c2aa98e2SPeter Wemm* Header checks.
2396c2aa98e2SPeter Wemm
239706f25ae9SGregory Neil ShapiroRelaying (transmission of messages from a site outside your host (class
239806f25ae9SGregory Neil Shapiro{w}) to another site except yours) is denied by default.  Note that this
239906f25ae9SGregory Neil Shapirochanged in sendmail 8.9; previous versions allowed relaying by default.
240006f25ae9SGregory Neil ShapiroIf you really want to revert to the old behaviour, you will need to use
240106f25ae9SGregory Neil ShapiroFEATURE(`promiscuous_relay').  You can allow certain domains to relay
240206f25ae9SGregory Neil Shapirothrough your server by adding their domain name or IP address to class
240306f25ae9SGregory Neil Shapiro{R} using RELAY_DOMAIN() and RELAY_DOMAIN_FILE() or via the access database
240440266059SGregory Neil Shapiro(described below).  Note that IPv6 addresses must be prefaced with "IPv6:".
240540266059SGregory Neil ShapiroThe file consists (like any other file based class) of entries listed on
240640266059SGregory Neil Shapiroseparate lines, e.g.,
240706f25ae9SGregory Neil Shapiro
240806f25ae9SGregory Neil Shapiro	sendmail.org
240906f25ae9SGregory Neil Shapiro	128.32
241040266059SGregory Neil Shapiro	IPv6:2002:c0a8:02c7
241140266059SGregory Neil Shapiro	IPv6:2002:c0a8:51d2::23f4
241206f25ae9SGregory Neil Shapiro	host.mydomain.com
241340266059SGregory Neil Shapiro	[UNIX:localhost]
241440266059SGregory Neil Shapiro
241540266059SGregory Neil ShapiroNotice: the last entry allows relaying for connections via a UNIX
241640266059SGregory Neil Shapirosocket to the MTA/MSP.  This might be necessary if your configuration
241740266059SGregory Neil Shapirodoesn't allow relaying by other means in that case, e.g., by having
241840266059SGregory Neil Shapirolocalhost.$m in class {R} (make sure $m is not just a top level
241940266059SGregory Neil Shapirodomain).
2420c2aa98e2SPeter Wemm
2421c2aa98e2SPeter WemmIf you use
2422c2aa98e2SPeter Wemm
24232e43090eSPeter Wemm	FEATURE(`relay_entire_domain')
2424c2aa98e2SPeter Wemm
242506f25ae9SGregory Neil Shapirothen any host in any of your local domains (that is, class {m})
2426065a643dSPeter Wemmwill be relayed (that is, you will accept mail either to or from any
2427065a643dSPeter Wemmhost in your domain).
2428c2aa98e2SPeter Wemm
2429c2aa98e2SPeter WemmYou can also allow relaying based on the MX records of the host
2430c2aa98e2SPeter Wemmportion of an incoming recipient address by using
2431c2aa98e2SPeter Wemm
24322e43090eSPeter Wemm	FEATURE(`relay_based_on_MX')
2433c2aa98e2SPeter Wemm
2434c2aa98e2SPeter WemmFor example, if your server receives a recipient of user@domain.com
2435c2aa98e2SPeter Wemmand domain.com lists your server in its MX records, the mail will be
243640266059SGregory Neil Shapiroaccepted for relay to domain.com.  This feature may cause problems
243740266059SGregory Neil Shapiroif MX lookups for the recipient domain are slow or time out.  In that
243840266059SGregory Neil Shapirocase, mail will be temporarily rejected.  It is usually better to
243940266059SGregory Neil Shapiromaintain a list of hosts/domains for which the server acts as relay.
244040266059SGregory Neil ShapiroNote also that this feature will stop spammers from using your host
244140266059SGregory Neil Shapiroto relay spam but it will not stop outsiders from using your server
244240266059SGregory Neil Shapiroas a relay for their site (that is, they set up an MX record pointing
244340266059SGregory Neil Shapiroto your mail server, and you will relay mail addressed to them
244440266059SGregory Neil Shapirowithout any prior arrangement).  Along the same lines,
2445c2aa98e2SPeter Wemm
24462e43090eSPeter Wemm	FEATURE(`relay_local_from')
2447c2aa98e2SPeter Wemm
2448c2aa98e2SPeter Wemmwill allow relaying if the sender specifies a return path (i.e.
244940266059SGregory Neil ShapiroMAIL FROM:<user@domain>) domain which is a local domain.  This is a
2450c2aa98e2SPeter Wemmdangerous feature as it will allow spammers to spam using your mail
2451c2aa98e2SPeter Wemmserver by simply specifying a return address of user@your.domain.com.
2452c2aa98e2SPeter WemmIt should not be used unless absolutely necessary.
245306f25ae9SGregory Neil ShapiroA slightly better solution is
245406f25ae9SGregory Neil Shapiro
245506f25ae9SGregory Neil Shapiro	FEATURE(`relay_mail_from')
245606f25ae9SGregory Neil Shapiro
245706f25ae9SGregory Neil Shapirowhich allows relaying if the mail sender is listed as RELAY in the
245813bd1963SGregory Neil Shapiroaccess map.  If an optional argument `domain' (this is the literal
245913bd1963SGregory Neil Shapiroword `domain', not a placeholder) is given, the domain portion of
246013bd1963SGregory Neil Shapirothe mail sender is also checked to allowing relaying.  This option
246113bd1963SGregory Neil Shapiroonly works together with the tag From: for the LHS of the access
2462e92d3f3fSGregory Neil Shapiromap entries.  This feature allows spammers to abuse your mail server
2463e92d3f3fSGregory Neil Shapiroby specifying a return address that you enabled in your access file.
2464e92d3f3fSGregory Neil ShapiroThis may be harder to figure out for spammers, but it should not
2465e92d3f3fSGregory Neil Shapirobe used unless necessary.  Instead use SMTP AUTH or STARTTLS to
2466e92d3f3fSGregory Neil Shapiroallow relaying for roaming users.
246706f25ae9SGregory Neil Shapiro
2468c2aa98e2SPeter Wemm
246940266059SGregory Neil ShapiroIf source routing is used in the recipient address (e.g.,
2470c2aa98e2SPeter WemmRCPT TO:<user%site.com@othersite.com>), sendmail will check
2471c2aa98e2SPeter Wemmuser@site.com for relaying if othersite.com is an allowed relay host
247206f25ae9SGregory Neil Shapiroin either class {R}, class {m} if FEATURE(`relay_entire_domain') is used,
24732e43090eSPeter Wemmor the access database if FEATURE(`access_db') is used.  To prevent
2474c2aa98e2SPeter Wemmthe address from being stripped down, use:
2475c2aa98e2SPeter Wemm
24762e43090eSPeter Wemm	FEATURE(`loose_relay_check')
2477c2aa98e2SPeter Wemm
2478c2aa98e2SPeter WemmIf you think you need to use this feature, you probably do not.  This
2479c2aa98e2SPeter Wemmshould only be used for sites which have no control over the addresses
2480c2aa98e2SPeter Wemmthat they provide a gateway for.  Use this FEATURE with caution as it
2481c2aa98e2SPeter Wemmcan allow spammers to relay through your server if not setup properly.
2482c2aa98e2SPeter Wemm
2483da7d7b9cSGregory Neil ShapiroNOTICE: It is possible to relay mail through a system which the
2484da7d7b9cSGregory Neil Shapiroanti-relay rules do not prevent: the case of a system that does use
2485da7d7b9cSGregory Neil ShapiroFEATURE(`nouucp', `nospecial') / FEATURE(`nopercenthack', `nospecial')
2486da7d7b9cSGregory Neil Shapiro(system A) and relays local messages to a mail hub (e.g., via
2487da7d7b9cSGregory Neil ShapiroLOCAL_RELAY or LUSER_RELAY) (system B).  If system B doesn't use the
2488da7d7b9cSGregory Neil Shapirosame feature (nouucp / nopercenthack) at all, addresses of the form
2489da7d7b9cSGregory Neil Shapiro<example.net!user@local.host> / <user%example.net@local.host>
2490da7d7b9cSGregory Neil Shapirowould be relayed to <user@example.net>.
2491da7d7b9cSGregory Neil ShapiroSystem A doesn't recognize `!' / `%' as an address separator and
2492da7d7b9cSGregory Neil Shapirotherefore forwards it to the mail hub which in turns relays it
2493da7d7b9cSGregory Neil Shapirobecause it came from a trusted local host.  So if a mailserver
2494da7d7b9cSGregory Neil Shapiroallows UUCP (bang-format) / %-hack addresses, all systems from which
2495da7d7b9cSGregory Neil Shapiroit allows relaying should do the same or reject those addresses.
249606f25ae9SGregory Neil Shapiro
2497c2aa98e2SPeter WemmAs of 8.9, sendmail will refuse mail if the MAIL FROM: parameter has
2498c2aa98e2SPeter Wemman unresolvable domain (i.e., one that DNS, your local name service,
249940266059SGregory Neil Shapiroor special case rules in ruleset 3 cannot locate).  This also applies
250040266059SGregory Neil Shapiroto addresses that use domain literals, e.g., <user@[1.2.3.4]>, if the
250140266059SGregory Neil ShapiroIP address can't be mapped to a host name.  If you want to continue
250240266059SGregory Neil Shapiroto accept such domains, e.g., because you are inside a firewall that
250340266059SGregory Neil Shapirohas only a limited view of the Internet host name space (note that you
250440266059SGregory Neil Shapirowill not be able to return mail to them unless you have some "smart
250540266059SGregory Neil Shapirohost" forwarder), use
2506c2aa98e2SPeter Wemm
25072e43090eSPeter Wemm	FEATURE(`accept_unresolvable_domains')
2508c2aa98e2SPeter Wemm
250940266059SGregory Neil ShapiroAlternatively, you can allow specific addresses by adding them to
251040266059SGregory Neil Shapirothe access map, e.g.,
251140266059SGregory Neil Shapiro
251240266059SGregory Neil Shapiro	From:unresolvable.domain	OK
251340266059SGregory Neil Shapiro	From:[1.2.3.4]			OK
251440266059SGregory Neil Shapiro	From:[1.2.4]			OK
251540266059SGregory Neil Shapiro
251640266059SGregory Neil ShapiroNotice: domains which are temporarily unresolvable are (temporarily)
251740266059SGregory Neil Shapirorejected with a 451 reply code.  If those domains should be accepted
251840266059SGregory Neil Shapiro(which is discouraged) then you can use
251940266059SGregory Neil Shapiro
252040266059SGregory Neil Shapiro	LOCAL_CONFIG
252140266059SGregory Neil Shapiro	C{ResOk}TEMP
252240266059SGregory Neil Shapiro
2523c2aa98e2SPeter Wemmsendmail will also refuse mail if the MAIL FROM: parameter is not
2524c2aa98e2SPeter Wemmfully qualified (i.e., contains a domain as well as a user).  If you
2525c2aa98e2SPeter Wemmwant to continue to accept such senders, use
2526c2aa98e2SPeter Wemm
25272e43090eSPeter Wemm	FEATURE(`accept_unqualified_senders')
2528c2aa98e2SPeter Wemm
252906f25ae9SGregory Neil ShapiroSetting the DaemonPortOptions modifier 'u' overrides the default behavior,
253006f25ae9SGregory Neil Shapiroi.e., unqualified addresses are accepted even without this FEATURE.  If
253106f25ae9SGregory Neil Shapirothis FEATURE is not used, the DaemonPortOptions modifier 'f' can be used
253240266059SGregory Neil Shapiroto enforce fully qualified domain names.
253306f25ae9SGregory Neil Shapiro
2534c2aa98e2SPeter WemmAn ``access'' database can be created to accept or reject mail from
2535c2aa98e2SPeter Wemmselected domains.  For example, you may choose to reject all mail
2536c2aa98e2SPeter Wemmoriginating from known spammers.  To enable such a database, use
2537c2aa98e2SPeter Wemm
25382e43090eSPeter Wemm	FEATURE(`access_db')
2539c2aa98e2SPeter Wemm
254040266059SGregory Neil ShapiroNotice: the access database is applied to the envelope addresses
254140266059SGregory Neil Shapiroand the connection information, not to the header.
254240266059SGregory Neil Shapiro
254340266059SGregory Neil ShapiroThe FEATURE macro can accept as second parameter the key file
2544c2aa98e2SPeter Wemmdefinition for the database; for example
2545c2aa98e2SPeter Wemm
254640266059SGregory Neil Shapiro	FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access_map')
254740266059SGregory Neil Shapiro
254840266059SGregory Neil ShapiroNotice: If a second argument is specified it must contain the option
2549d0cef73dSGregory Neil Shapiro`-T<TMPF>' as shown above.  The optional parameters may be
2550d0cef73dSGregory Neil Shapiro
2551d0cef73dSGregory Neil Shapiro	`skip'			enables SKIP as value part (see below).
2552d0cef73dSGregory Neil Shapiro	`lookupdotdomain'	another way to enable the feature of the
2553d0cef73dSGregory Neil Shapiro				same name (see above).
2554d0cef73dSGregory Neil Shapiro	`relaytofulladdress'	enable entries of the form
2555d0cef73dSGregory Neil Shapiro				To:user@example.com	RELAY
2556d0cef73dSGregory Neil Shapiro				to allow relaying to just a specific
2557d0cef73dSGregory Neil Shapiro				e-mail address instead of an entire domain.
2558c2aa98e2SPeter Wemm
2559065a643dSPeter WemmRemember, since /etc/mail/access is a database, after creating the text
2560065a643dSPeter Wemmfile as described below, you must use makemap to create the database
2561065a643dSPeter Wemmmap.  For example:
2562065a643dSPeter Wemm
2563065a643dSPeter Wemm	makemap hash /etc/mail/access < /etc/mail/access
2564065a643dSPeter Wemm
2565c2aa98e2SPeter WemmThe table itself uses e-mail addresses, domain names, and network
256640266059SGregory Neil Shapironumbers as keys.  Note that IPv6 addresses must be prefaced with "IPv6:".
256740266059SGregory Neil ShapiroFor example,
2568c2aa98e2SPeter Wemm
2569e92d3f3fSGregory Neil Shapiro	From:spammer@aol.com			REJECT
2570e92d3f3fSGregory Neil Shapiro	From:cyberspammer.com			REJECT
2571e92d3f3fSGregory Neil Shapiro	Connect:cyberspammer.com		REJECT
2572e92d3f3fSGregory Neil Shapiro	Connect:TLD				REJECT
2573e92d3f3fSGregory Neil Shapiro	Connect:192.168.212			REJECT
2574e92d3f3fSGregory Neil Shapiro	Connect:IPv6:2002:c0a8:02c7		RELAY
2575e92d3f3fSGregory Neil Shapiro	Connect:IPv6:2002:c0a8:51d2::23f4	REJECT
2576c2aa98e2SPeter Wemm
2577c2aa98e2SPeter Wemmwould refuse mail from spammer@aol.com, any user from cyberspammer.com
2578605302a5SGregory Neil Shapiro(or any host within the cyberspammer.com domain), any host in the entire
2579605302a5SGregory Neil Shapirotop level domain TLD, 192.168.212.* network, and the IPv6 address
2580605302a5SGregory Neil Shapiro2002:c0a8:51d2::23f4.  It would allow relay for the IPv6 network
2581605302a5SGregory Neil Shapiro2002:c0a8:02c7::/48.
2582c2aa98e2SPeter Wemm
2583e92d3f3fSGregory Neil ShapiroEntries in the access map should be tagged according to their type.
2584e92d3f3fSGregory Neil ShapiroThree tags are available:
2585e92d3f3fSGregory Neil Shapiro
2586e92d3f3fSGregory Neil Shapiro	Connect:	connection information (${client_addr}, ${client_name})
2587e92d3f3fSGregory Neil Shapiro	From:		envelope sender
2588e92d3f3fSGregory Neil Shapiro	To:		envelope recipient
2589e92d3f3fSGregory Neil Shapiro
2590e92d3f3fSGregory Neil ShapiroNotice: untagged entries are deprecated.
2591e92d3f3fSGregory Neil Shapiro
2592e92d3f3fSGregory Neil ShapiroIf the required item is looked up in a map, it will be tried first
2593e92d3f3fSGregory Neil Shapirowith the corresponding tag in front, then (as fallback to enable
2594e92d3f3fSGregory Neil Shapirobackward compatibility) without any tag, unless the specific feature
2595e92d3f3fSGregory Neil Shapirorequires a tag.  For example,
2596e92d3f3fSGregory Neil Shapiro
2597e92d3f3fSGregory Neil Shapiro	From:spammer@some.dom	REJECT
2598e92d3f3fSGregory Neil Shapiro	To:friend.domain	RELAY
2599e92d3f3fSGregory Neil Shapiro	Connect:friend.domain	OK
2600e92d3f3fSGregory Neil Shapiro	Connect:from.domain	RELAY
2601e92d3f3fSGregory Neil Shapiro	From:good@another.dom	OK
2602e92d3f3fSGregory Neil Shapiro	From:another.dom	REJECT
2603e92d3f3fSGregory Neil Shapiro
2604e92d3f3fSGregory Neil ShapiroThis would deny mails from spammer@some.dom but you could still
2605*5b0945b5SGregory Neil Shapirosend mail to that address even if FEATURE(`blocklist_recipients')
2606e92d3f3fSGregory Neil Shapirois enabled.  Your system will allow relaying to friend.domain, but
2607e92d3f3fSGregory Neil Shapironot from it (unless enabled by other means).  Connections from that
2608e92d3f3fSGregory Neil Shapirodomain will be allowed even if it ends up in one of the DNS based
2609e92d3f3fSGregory Neil Shapirorejection lists.  Relaying is enabled from from.domain but not to
2610e92d3f3fSGregory Neil Shapiroit (since relaying is based on the connection information for
2611e92d3f3fSGregory Neil Shapirooutgoing relaying, the tag Connect: must be used; for incoming
2612e92d3f3fSGregory Neil Shapirorelaying, which is based on the recipient address, To: must be
2613e92d3f3fSGregory Neil Shapiroused).  The last two entries allow mails from good@another.dom but
2614e92d3f3fSGregory Neil Shapiroreject mail from all other addresses with another.dom as domain
2615e92d3f3fSGregory Neil Shapiropart.
2616e92d3f3fSGregory Neil Shapiro
2617e92d3f3fSGregory Neil Shapiro
2618c2aa98e2SPeter WemmThe value part of the map can contain:
2619c2aa98e2SPeter Wemm
262040266059SGregory Neil Shapiro	OK		Accept mail even if other rules in the running
262140266059SGregory Neil Shapiro			ruleset would reject it, for example, if the domain
262240266059SGregory Neil Shapiro			name is unresolvable.  "Accept" does not mean
262340266059SGregory Neil Shapiro			"relay", but at most acceptance for local
262440266059SGregory Neil Shapiro			recipients.  That is, OK allows less than RELAY.
2625d0cef73dSGregory Neil Shapiro	RELAY		Accept mail addressed to the indicated domain
2626d0cef73dSGregory Neil Shapiro			(or address if `relaytofulladdress' is set) or
2627065a643dSPeter Wemm			received from the indicated domain for relaying
2628065a643dSPeter Wemm			through your SMTP server.  RELAY also serves as
2629065a643dSPeter Wemm			an implicit OK for the other checks.
2630065a643dSPeter Wemm	REJECT		Reject the sender or recipient with a general
2631c2aa98e2SPeter Wemm			purpose message.
2632065a643dSPeter Wemm	DISCARD		Discard the message completely using the
2633193538b7SGregory Neil Shapiro			$#discard mailer.  If it is used in check_compat,
2634193538b7SGregory Neil Shapiro			it affects only the designated recipient, not
2635193538b7SGregory Neil Shapiro			the whole message as it does in all other cases.
2636193538b7SGregory Neil Shapiro			This should only be used if really necessary.
263740266059SGregory Neil Shapiro	SKIP		This can only be used for host/domain names
263840266059SGregory Neil Shapiro			and IP addresses/nets.  It will abort the current
263940266059SGregory Neil Shapiro			search for this entry without accepting or rejecting
264040266059SGregory Neil Shapiro			it but causing the default action.
264142e5d165SGregory Neil Shapiro	### any text	where ### is an RFC 821 compliant error code and
264242e5d165SGregory Neil Shapiro			"any text" is a message to return for the command.
26434e4196cbSGregory Neil Shapiro			The entire string should be quoted to avoid
26444e4196cbSGregory Neil Shapiro			surprises:
26454e4196cbSGregory Neil Shapiro
26464e4196cbSGregory Neil Shapiro				"### any text"
26474e4196cbSGregory Neil Shapiro
26484e4196cbSGregory Neil Shapiro			Otherwise sendmail formats the text as email
26494e4196cbSGregory Neil Shapiro			addresses, e.g., it may remove spaces.
2650e92d3f3fSGregory Neil Shapiro			This type is deprecated, use one of the two
265140266059SGregory Neil Shapiro			ERROR:  entries below instead.
265206f25ae9SGregory Neil Shapiro	ERROR:### any text
265306f25ae9SGregory Neil Shapiro			as above, but useful to mark error messages as such.
26544e4196cbSGregory Neil Shapiro			If quotes need to be used to avoid modifications
26554e4196cbSGregory Neil Shapiro			(see above), they should be placed like this:
26564e4196cbSGregory Neil Shapiro
26574e4196cbSGregory Neil Shapiro				ERROR:"### any text"
26584e4196cbSGregory Neil Shapiro
265906f25ae9SGregory Neil Shapiro	ERROR:D.S.N:### any text
266006f25ae9SGregory Neil Shapiro			where D.S.N is an RFC 1893 compliant error code
26614e4196cbSGregory Neil Shapiro			and the rest as above.  If quotes need to be used
26624e4196cbSGregory Neil Shapiro			to avoid modifications, they should be placed
26634e4196cbSGregory Neil Shapiro			like this:
26644e4196cbSGregory Neil Shapiro
26654e4196cbSGregory Neil Shapiro				ERROR:D.S.N:"### any text"
26664e4196cbSGregory Neil Shapiro
2667e92d3f3fSGregory Neil Shapiro	QUARANTINE:any text
2668e92d3f3fSGregory Neil Shapiro			Quarantine the message using the given text as the
2669e92d3f3fSGregory Neil Shapiro			quarantining reason.
2670c2aa98e2SPeter Wemm
2671c2aa98e2SPeter WemmFor example:
2672c2aa98e2SPeter Wemm
2673e92d3f3fSGregory Neil Shapiro	From:cyberspammer.com	ERROR:"550 We don't accept mail from spammers"
2674e92d3f3fSGregory Neil Shapiro	From:okay.cyberspammer.com	OK
2675e92d3f3fSGregory Neil Shapiro	Connect:sendmail.org		RELAY
2676e92d3f3fSGregory Neil Shapiro	To:sendmail.org			RELAY
2677e92d3f3fSGregory Neil Shapiro	Connect:128.32			RELAY
2678e92d3f3fSGregory Neil Shapiro	Connect:128.32.2		SKIP
2679e92d3f3fSGregory Neil Shapiro	Connect:IPv6:1:2:3:4:5:6:7	RELAY
2680e92d3f3fSGregory Neil Shapiro	Connect:suspicious.example.com	QUARANTINE:Mail from suspicious host
2681e92d3f3fSGregory Neil Shapiro	Connect:[127.0.0.3]		OK
2682e92d3f3fSGregory Neil Shapiro	Connect:[IPv6:1:2:3:4:5:6:7:8]	OK
2683c2aa98e2SPeter Wemm
2684e92d3f3fSGregory Neil Shapirowould accept mail from okay.cyberspammer.com, but would reject mail
2685e92d3f3fSGregory Neil Shapirofrom all other hosts at cyberspammer.com with the indicated message.
2686e92d3f3fSGregory Neil ShapiroIt would allow relaying mail from and to any hosts in the sendmail.org
2687e92d3f3fSGregory Neil Shapirodomain, and allow relaying from the IPv6 1:2:3:4:5:6:7:* network
2688e92d3f3fSGregory Neil Shapiroand from the 128.32.*.* network except for the 128.32.2.* network,
2689e92d3f3fSGregory Neil Shapirowhich shows how SKIP is useful to exempt subnets/subdomains.  The
2690e92d3f3fSGregory Neil Shapirolast two entries are for checks against ${client_name} if the IP
2691e92d3f3fSGregory Neil Shapiroaddress doesn't resolve to a hostname (or is considered as "may be
2692e92d3f3fSGregory Neil Shapiroforged").  That is, using square brackets means these are host
2693e92d3f3fSGregory Neil Shapironames, not network numbers.
269406f25ae9SGregory Neil Shapiro
269506f25ae9SGregory Neil ShapiroWarning: if you change the RFC 821 compliant error code from the default
269606f25ae9SGregory Neil Shapirovalue of 550, then you should probably also change the RFC 1893 compliant
269706f25ae9SGregory Neil Shapiroerror code to match it.  For example, if you use
269806f25ae9SGregory Neil Shapiro
2699e92d3f3fSGregory Neil Shapiro	To:user@example.com	ERROR:450 mailbox full
270006f25ae9SGregory Neil Shapiro
270140266059SGregory Neil Shapirothe error returned would be "450 5.0.0 mailbox full" which is wrong.
270240266059SGregory Neil ShapiroUse "ERROR:4.2.2:450 mailbox full" instead.
270306f25ae9SGregory Neil Shapiro
270406f25ae9SGregory Neil ShapiroNote, UUCP users may need to add hostname.UUCP to the access database
270540266059SGregory Neil Shapiroor class {R}.
270640266059SGregory Neil Shapiro
270740266059SGregory Neil ShapiroIf you also use:
2708c2aa98e2SPeter Wemm
27092e43090eSPeter Wemm	FEATURE(`relay_hosts_only')
2710c2aa98e2SPeter Wemm
2711c2aa98e2SPeter Wemmthen the above example will allow relaying for sendmail.org, but not
2712c2aa98e2SPeter Wemmhosts within the sendmail.org domain.  Note that this will also require
271306f25ae9SGregory Neil Shapirohosts listed in class {R} to be fully qualified host names.
2714c2aa98e2SPeter Wemm
2715c2aa98e2SPeter WemmYou can also use the access database to block sender addresses based on
2716c2aa98e2SPeter Wemmthe username portion of the address.  For example:
2717c2aa98e2SPeter Wemm
2718e92d3f3fSGregory Neil Shapiro	From:FREE.STEALTH.MAILER@	ERROR:550 Spam not accepted
2719c2aa98e2SPeter Wemm
2720c2aa98e2SPeter WemmNote that you must include the @ after the username to signify that
2721c2aa98e2SPeter Wemmthis database entry is for checking only the username portion of the
2722c2aa98e2SPeter Wemmsender address.
2723c2aa98e2SPeter Wemm
2724c2aa98e2SPeter WemmIf you use:
2725c2aa98e2SPeter Wemm
2726*5b0945b5SGregory Neil Shapiro	FEATURE(`blocklist_recipients')
2727c2aa98e2SPeter Wemm
2728c2aa98e2SPeter Wemmthen you can add entries to the map for local users, hosts in your
2729c2aa98e2SPeter Wemmdomains, or addresses in your domain which should not receive mail:
2730c2aa98e2SPeter Wemm
2731e92d3f3fSGregory Neil Shapiro	To:badlocaluser@	ERROR:550 Mailbox disabled for badlocaluser
2732e92d3f3fSGregory Neil Shapiro	To:host.my.TLD		ERROR:550 That host does not accept mail
2733e92d3f3fSGregory Neil Shapiro	To:user@other.my.TLD	ERROR:550 Mailbox disabled for this recipient
2734c2aa98e2SPeter Wemm
2735e92d3f3fSGregory Neil ShapiroThis would prevent a recipient of badlocaluser in any of the local
2736e92d3f3fSGregory Neil Shapirodomains (class {w}), any user at host.my.TLD, and the single address
2737e92d3f3fSGregory Neil Shapirouser@other.my.TLD from receiving mail.  Please note: a local username
2738e92d3f3fSGregory Neil Shapiromust be now tagged with an @ (this is consistent with the check of
2739e92d3f3fSGregory Neil Shapirothe sender address, and hence it is possible to distinguish between
2740e92d3f3fSGregory Neil Shapirohostnames and usernames).  Enabling this feature will keep you from
2741e92d3f3fSGregory Neil Shapirosending mails to all addresses that have an error message or REJECT
2742e92d3f3fSGregory Neil Shapiroas value part in the access map.  Taking the example from above:
2743065a643dSPeter Wemm
2744065a643dSPeter Wemm	spammer@aol.com		REJECT
2745065a643dSPeter Wemm	cyberspammer.com	REJECT
2746065a643dSPeter Wemm
2747065a643dSPeter WemmMail can't be sent to spammer@aol.com or anyone at cyberspammer.com.
2748e92d3f3fSGregory Neil ShapiroThat's why tagged entries should be used.
2749c2aa98e2SPeter Wemm
2750*5b0945b5SGregory Neil ShapiroThere are several DNS based blocklists which can be found by
2751af9557fdSGregory Neil Shapiroquerying a search engine.  These are databases of spammers
275240266059SGregory Neil Shapiromaintained in DNS.  To use such a database, specify
2753c2aa98e2SPeter Wemm
2754af9557fdSGregory Neil Shapiro	FEATURE(`dnsbl', `dnsbl.example.com')
2755c2aa98e2SPeter Wemm
2756af9557fdSGregory Neil ShapiroThis will cause sendmail to reject mail from any site listed in the
2757*5b0945b5SGregory Neil ShapiroDNS based blocklist.  You must select a DNS based blocklist domain
2758af9557fdSGregory Neil Shapiroto check by specifying an argument to the FEATURE.  The default
2759af9557fdSGregory Neil Shapiroerror message is
276013058a91SGregory Neil Shapiro
2761739ac4d4SGregory Neil Shapiro	Rejected: IP-ADDRESS listed at SERVER
2762193538b7SGregory Neil Shapiro
276340266059SGregory Neil Shapirowhere IP-ADDRESS and SERVER are replaced by the appropriate
276440266059SGregory Neil Shapiroinformation.  A second argument can be used to specify a different
2765d0cef73dSGregory Neil Shapirotext or action.  For example,
2766d0cef73dSGregory Neil Shapiro
2767d0cef73dSGregory Neil Shapiro	FEATURE(`dnsbl', `dnsbl.example.com', `quarantine')
2768d0cef73dSGregory Neil Shapiro
2769d0cef73dSGregory Neil Shapirowould quarantine the message if the client IP address is listed
2770d0cef73dSGregory Neil Shapiroat `dnsbl.example.com'.
2771d0cef73dSGregory Neil Shapiro
2772d0cef73dSGregory Neil ShapiroBy default, temporary lookup failures are ignored
2773d0cef73dSGregory Neil Shapiroand hence cause the connection not to be rejected by the DNS based
2774d0cef73dSGregory Neil Shapirorejection list.  This behavior can be changed by specifying a third
2775d0cef73dSGregory Neil Shapiroargument, which must be either `t' or a full error message.  For
2776d0cef73dSGregory Neil Shapiroexample:
2777193538b7SGregory Neil Shapiro
277840266059SGregory Neil Shapiro	FEATURE(`dnsbl', `dnsbl.example.com', `',
277940266059SGregory Neil Shapiro	`"451 Temporary lookup failure for " $&{client_addr} " in dnsbl.example.com"')
278040266059SGregory Neil Shapiro
278140266059SGregory Neil ShapiroIf `t' is used, the error message is:
278240266059SGregory Neil Shapiro
278340266059SGregory Neil Shapiro	451 Temporary lookup failure of IP-ADDRESS at SERVER
278440266059SGregory Neil Shapiro
278540266059SGregory Neil Shapirowhere IP-ADDRESS and SERVER are replaced by the appropriate
278640266059SGregory Neil Shapiroinformation.
278740266059SGregory Neil Shapiro
278840266059SGregory Neil ShapiroThis FEATURE can be included several times to query different
2789af9557fdSGregory Neil ShapiroDNS based rejection lists.
279040266059SGregory Neil Shapiro
279140266059SGregory Neil ShapiroNotice: to avoid checking your own local domains against those
2792*5b0945b5SGregory Neil Shapiroblocklists, use the access_db feature and add:
279340266059SGregory Neil Shapiro
279440266059SGregory Neil Shapiro	Connect:10.1		OK
279540266059SGregory Neil Shapiro	Connect:127.0.0.1	RELAY
279640266059SGregory Neil Shapiro
279740266059SGregory Neil Shapiroto the access map, where 10.1 is your local network.  You may
279840266059SGregory Neil Shapirowant to use "RELAY" instead of "OK" to allow also relaying
2799*5b0945b5SGregory Neil Shapiroinstead of just disabling the DNS lookups in the blocklists.
280040266059SGregory Neil Shapiro
2801c2aa98e2SPeter Wemm
2802c2aa98e2SPeter WemmThe features described above make use of the check_relay, check_mail,
280313bd1963SGregory Neil Shapiroand check_rcpt rulesets.  Note that check_relay checks the SMTP
280413bd1963SGregory Neil Shapiroclient hostname and IP address when the connection is made to your
280513bd1963SGregory Neil Shapiroserver.  It does not check if a mail message is being relayed to
280613bd1963SGregory Neil Shapiroanother server.  That check is done in check_rcpt.  If you wish to
280713bd1963SGregory Neil Shapiroinclude your own checks, you can put your checks in the rulesets
280813bd1963SGregory Neil ShapiroLocal_check_relay, Local_check_mail, and Local_check_rcpt.  For
280913bd1963SGregory Neil Shapiroexample if you wanted to block senders with all numeric usernames
281013bd1963SGregory Neil Shapiro(i.e. 2312343@bigisp.com), you would use Local_check_mail and the
281113bd1963SGregory Neil Shapiroregex map:
2812c2aa98e2SPeter Wemm
2813c2aa98e2SPeter Wemm	LOCAL_CONFIG
2814c2aa98e2SPeter Wemm	Kallnumbers regex -a@MATCH ^[0-9]+$
2815c2aa98e2SPeter Wemm
2816c2aa98e2SPeter Wemm	LOCAL_RULESETS
2817c2aa98e2SPeter Wemm	SLocal_check_mail
2818c2aa98e2SPeter Wemm	# check address against various regex checks
2819c2aa98e2SPeter Wemm	R$*				$: $>Parse0 $>3 $1
2820c2aa98e2SPeter Wemm	R$+ < @ bigisp.com. > $*	$: $(allnumbers $1 $)
2821c2aa98e2SPeter Wemm	R@MATCH				$#error $: 553 Header Error
2822c2aa98e2SPeter Wemm
2823c2aa98e2SPeter WemmThese rules are called with the original arguments of the corresponding
2824c2aa98e2SPeter Wemmcheck_* ruleset.  If the local ruleset returns $#OK, no further checking
2825e92d3f3fSGregory Neil Shapirois done by the features described above and the mail is accepted.  If
2826e92d3f3fSGregory Neil Shapirothe local ruleset resolves to a mailer (such as $#error or $#discard),
2827e92d3f3fSGregory Neil Shapirothe appropriate action is taken.  Other results starting with $# are
2828e92d3f3fSGregory Neil Shapirointerpreted by sendmail and may lead to unspecified behavior.  Note: do
2829e92d3f3fSGregory Neil ShapiroNOT create a mailer with the name OK.  Return values that do not start
2830e92d3f3fSGregory Neil Shapirowith $# are ignored, i.e., normal processing continues.
283106f25ae9SGregory Neil Shapiro
283206f25ae9SGregory Neil ShapiroDelay all checks
283340266059SGregory Neil Shapiro----------------
283406f25ae9SGregory Neil Shapiro
283506f25ae9SGregory Neil ShapiroBy using FEATURE(`delay_checks') the rulesets check_mail and check_relay
283606f25ae9SGregory Neil Shapirowill not be called when a client connects or issues a MAIL command,
283706f25ae9SGregory Neil Shapirorespectively.  Instead, those rulesets will be called by the check_rcpt
283806f25ae9SGregory Neil Shapiroruleset; they will be skipped if a sender has been authenticated using
283906f25ae9SGregory Neil Shapiroa "trusted" mechanism, i.e., one that is defined via TRUST_AUTH_MECH().
284006f25ae9SGregory Neil ShapiroIf check_mail returns an error then the RCPT TO command will be rejected
284106f25ae9SGregory Neil Shapirowith that error.  If it returns some other result starting with $# then
284206f25ae9SGregory Neil Shapirocheck_relay will be skipped.  If the sender address (or a part of it) is
284306f25ae9SGregory Neil Shapirolisted in the access map and it has a RHS of OK or RELAY, then check_relay
284406f25ae9SGregory Neil Shapirowill be skipped.  This has an interesting side effect: if your domain is
284506f25ae9SGregory Neil Shapiromy.domain and you have
284606f25ae9SGregory Neil Shapiro
284706f25ae9SGregory Neil Shapiro	my.domain	RELAY
284806f25ae9SGregory Neil Shapiro
2849323f6dcbSGregory Neil Shapiroin the access map, then any e-mail with a sender address of
2850323f6dcbSGregory Neil Shapiro<user@my.domain> will not be rejected by check_relay even though
2851323f6dcbSGregory Neil Shapiroit would match the hostname or IP address.  This allows spammers
2852*5b0945b5SGregory Neil Shapiroto get around DNS based blocklist by faking the sender address.  To
285306f25ae9SGregory Neil Shapiroavoid this problem you have to use tagged entries:
285406f25ae9SGregory Neil Shapiro
285506f25ae9SGregory Neil Shapiro	To:my.domain		RELAY
285606f25ae9SGregory Neil Shapiro	Connect:my.domain	RELAY
285706f25ae9SGregory Neil Shapiro
285806f25ae9SGregory Neil Shapiroif you need those entries at all (class {R} may take care of them).
285906f25ae9SGregory Neil Shapiro
286006f25ae9SGregory Neil ShapiroFEATURE(`delay_checks') can take an optional argument:
286106f25ae9SGregory Neil Shapiro
286206f25ae9SGregory Neil Shapiro	FEATURE(`delay_checks', `friend')
286306f25ae9SGregory Neil Shapiro		 enables spamfriend test
286406f25ae9SGregory Neil Shapiro	FEATURE(`delay_checks', `hater')
286506f25ae9SGregory Neil Shapiro		 enables spamhater test
286606f25ae9SGregory Neil Shapiro
2867605302a5SGregory Neil ShapiroIf such an argument is given, the recipient will be looked up in the
2868605302a5SGregory Neil Shapiroaccess map (using the tag Spam:).  If the argument is `friend', then
2869605302a5SGregory Neil Shapirothe default behavior is to apply the other rulesets and make a SPAM
2870605302a5SGregory Neil Shapirofriend the exception.  The rulesets check_mail and check_relay will be
2871605302a5SGregory Neil Shapiroskipped only if the recipient address is found and has RHS FRIEND.  If
2872605302a5SGregory Neil Shapirothe argument is `hater', then the default behavior is to skip the rulesets
2873605302a5SGregory Neil Shapirocheck_mail and check_relay and make a SPAM hater the exception.  The
2874605302a5SGregory Neil Shapiroother two rulesets will be applied only if the recipient address is
2875605302a5SGregory Neil Shapirofound and has RHS HATER.
287606f25ae9SGregory Neil Shapiro
287706f25ae9SGregory Neil ShapiroThis allows for simple exceptions from the tests, e.g., by activating
287840266059SGregory Neil Shapirothe friend option and having
287906f25ae9SGregory Neil Shapiro
288040266059SGregory Neil Shapiro	Spam:abuse@	FRIEND
288106f25ae9SGregory Neil Shapiro
288213bd1963SGregory Neil Shapiroin the access map, mail to abuse@localdomain will get through (where
288313bd1963SGregory Neil Shapiro"localdomain" is any domain in class {w}).  It is also possible to
288413bd1963SGregory Neil Shapirospecify a full address or an address with +detail:
288506f25ae9SGregory Neil Shapiro
288640266059SGregory Neil Shapiro	Spam:abuse@my.domain	FRIEND
288740266059SGregory Neil Shapiro	Spam:me+abuse@		FRIEND
288840266059SGregory Neil Shapiro	Spam:spam.domain	FRIEND
288906f25ae9SGregory Neil Shapiro
289040266059SGregory Neil ShapiroNote: The required tag has been changed in 8.12 from To: to Spam:.
289140266059SGregory Neil ShapiroThis change is incompatible to previous versions.  However, you can
289240266059SGregory Neil Shapiro(for now) simply add the new entries to the access map, the old
289340266059SGregory Neil Shapiroones will be ignored.  As soon as you removed the old entries from
289440266059SGregory Neil Shapirothe access map, specify a third parameter (`n') to this feature and
289540266059SGregory Neil Shapirothe backward compatibility rules will not be in the generated .cf
289640266059SGregory Neil Shapirofile.
289706f25ae9SGregory Neil Shapiro
289806f25ae9SGregory Neil ShapiroHeader Checks
289940266059SGregory Neil Shapiro-------------
2900c2aa98e2SPeter Wemm
2901c2aa98e2SPeter WemmYou can also reject mail on the basis of the contents of headers.
2902c2aa98e2SPeter WemmThis is done by adding a ruleset call to the 'H' header definition command
2903c2aa98e2SPeter Wemmin sendmail.cf.  For example, this can be used to check the validity of
2904c2aa98e2SPeter Wemma Message-ID: header:
2905c2aa98e2SPeter Wemm
290613bd1963SGregory Neil Shapiro	LOCAL_CONFIG
2907c2aa98e2SPeter Wemm	HMessage-Id: $>CheckMessageId
2908c2aa98e2SPeter Wemm
290913bd1963SGregory Neil Shapiro	LOCAL_RULESETS
2910c2aa98e2SPeter Wemm	SCheckMessageId
2911c2aa98e2SPeter Wemm	R< $+ @ $+ >		$@ OK
2912c2aa98e2SPeter Wemm	R$*			$#error $: 553 Header Error
2913c2aa98e2SPeter Wemm
291406f25ae9SGregory Neil ShapiroThe alternative format:
2915065a643dSPeter Wemm
291606f25ae9SGregory Neil Shapiro	HSubject: $>+CheckSubject
2917065a643dSPeter Wemm
291806f25ae9SGregory Neil Shapirothat is, $>+ instead of $>, gives the full Subject: header including
291906f25ae9SGregory Neil Shapirocomments to the ruleset (comments in parentheses () are stripped
292006f25ae9SGregory Neil Shapiroby default).
29212e43090eSPeter Wemm
292206f25ae9SGregory Neil ShapiroA default ruleset for headers which don't have a specific ruleset
292306f25ae9SGregory Neil Shapirodefined for them can be given by:
2924065a643dSPeter Wemm
292506f25ae9SGregory Neil Shapiro	H*: $>CheckHdr
292606f25ae9SGregory Neil Shapiro
292740266059SGregory Neil ShapiroNotice:
292840266059SGregory Neil Shapiro1. All rules act on tokens as explained in doc/op/op.{me,ps,txt}.
2929602a2b1bSGregory Neil ShapiroThat may cause problems with simple header checks due to the
2930602a2b1bSGregory Neil Shapirotokenization.  It might be simpler to use a regex map and apply it
2931602a2b1bSGregory Neil Shapiroto $&{currHeader}.
293240266059SGregory Neil Shapiro2. There are no default rulesets coming with this distribution of
29334e4196cbSGregory Neil Shapirosendmail.  You can write your own, can search the WWW for examples,
29344e4196cbSGregory Neil Shapiroor take a look at cf/cf/knecht.mc.
2935e92d3f3fSGregory Neil Shapiro3. When using a default ruleset for headers, the name of the header
2936e92d3f3fSGregory Neil Shapirocurrently being checked can be found in the $&{hdr_name} macro.
2937602a2b1bSGregory Neil Shapiro
293806f25ae9SGregory Neil ShapiroAfter all of the headers are read, the check_eoh ruleset will be called for
293906f25ae9SGregory Neil Shapiroany final header-related checks.  The ruleset is called with the number of
294006f25ae9SGregory Neil Shapiroheaders and the size of all of the headers in bytes separated by $|.  One
294106f25ae9SGregory Neil Shapiroexample usage is to reject messages which do not have a Message-Id:
294206f25ae9SGregory Neil Shapiroheader.  However, the Message-Id: header is *NOT* a required header and is
294306f25ae9SGregory Neil Shapironot a guaranteed spam indicator.  This ruleset is an example and should
294406f25ae9SGregory Neil Shapiroprobably not be used in production.
294506f25ae9SGregory Neil Shapiro
294606f25ae9SGregory Neil Shapiro	LOCAL_CONFIG
294706f25ae9SGregory Neil Shapiro	Kstorage macro
294806f25ae9SGregory Neil Shapiro	HMessage-Id: $>CheckMessageId
294906f25ae9SGregory Neil Shapiro
295013bd1963SGregory Neil Shapiro	LOCAL_RULESETS
295106f25ae9SGregory Neil Shapiro	SCheckMessageId
295206f25ae9SGregory Neil Shapiro	# Record the presence of the header
295306f25ae9SGregory Neil Shapiro	R$*			$: $(storage {MessageIdCheck} $@ OK $) $1
295406f25ae9SGregory Neil Shapiro	R< $+ @ $+ >		$@ OK
295506f25ae9SGregory Neil Shapiro	R$*			$#error $: 553 Header Error
295606f25ae9SGregory Neil Shapiro
295706f25ae9SGregory Neil Shapiro	Scheck_eoh
295806f25ae9SGregory Neil Shapiro	# Check the macro
295906f25ae9SGregory Neil Shapiro	R$*			$: < $&{MessageIdCheck} >
296006f25ae9SGregory Neil Shapiro	# Clear the macro for the next message
296106f25ae9SGregory Neil Shapiro	R$*			$: $(storage {MessageIdCheck} $) $1
296206f25ae9SGregory Neil Shapiro	# Has a Message-Id: header
296306f25ae9SGregory Neil Shapiro	R< $+ >			$@ OK
296406f25ae9SGregory Neil Shapiro	# Allow missing Message-Id: from local mail
296506f25ae9SGregory Neil Shapiro	R$*			$: < $&{client_name} >
296606f25ae9SGregory Neil Shapiro	R< >			$@ OK
296706f25ae9SGregory Neil Shapiro	R< $=w >		$@ OK
296806f25ae9SGregory Neil Shapiro	# Otherwise, reject the mail
296906f25ae9SGregory Neil Shapiro	R$*			$#error $: 553 Header Error
297006f25ae9SGregory Neil Shapiro
2971e92d3f3fSGregory Neil Shapiro
2972e92d3f3fSGregory Neil Shapiro+--------------------+
2973e92d3f3fSGregory Neil Shapiro| CONNECTION CONTROL |
2974e92d3f3fSGregory Neil Shapiro+--------------------+
2975e92d3f3fSGregory Neil Shapiro
2976e92d3f3fSGregory Neil ShapiroThe features ratecontrol and conncontrol allow to establish connection
2977e92d3f3fSGregory Neil Shapirolimits per client IP address or net.  These features can limit the
2978e92d3f3fSGregory Neil Shapirorate of connections (connections per time unit) or the number of
2979e92d3f3fSGregory Neil Shapiroincoming SMTP connections, respectively.  If enabled, appropriate
2980e92d3f3fSGregory Neil Shapirorulesets are called at the end of check_relay, i.e., after DNS
2981*5b0945b5SGregory Neil Shapiroblocklists and generic access_db operations.  The features require
2982e92d3f3fSGregory Neil ShapiroFEATURE(`access_db') to be listed earlier in the mc file.
2983e92d3f3fSGregory Neil Shapiro
2984e92d3f3fSGregory Neil ShapiroNote: FEATURE(`delay_checks') delays those connection control checks
2985e92d3f3fSGregory Neil Shapiroafter a recipient address has been received, hence making these
2986e92d3f3fSGregory Neil Shapiroconnection control features less useful.  To run the checks as early
2987e92d3f3fSGregory Neil Shapiroas possible, specify the parameter `nodelay', e.g.,
2988e92d3f3fSGregory Neil Shapiro
2989e92d3f3fSGregory Neil Shapiro	FEATURE(`ratecontrol', `nodelay')
2990e92d3f3fSGregory Neil Shapiro
2991e92d3f3fSGregory Neil ShapiroIn that case, FEATURE(`delay_checks') has no effect on connection
2992e92d3f3fSGregory Neil Shapirocontrol (and it must be specified earlier in the mc file).
2993e92d3f3fSGregory Neil Shapiro
2994e92d3f3fSGregory Neil ShapiroAn optional second argument `terminate' specifies whether the
2995e92d3f3fSGregory Neil Shapirorulesets should return the error code 421 which will cause
2996e92d3f3fSGregory Neil Shapirosendmail to terminate the session with that error if it is
2997e92d3f3fSGregory Neil Shapiroreturned from check_relay, i.e., not delayed as explained in
2998e92d3f3fSGregory Neil Shapirothe previous paragraph.  Example:
2999e92d3f3fSGregory Neil Shapiro
3000e92d3f3fSGregory Neil Shapiro	FEATURE(`ratecontrol', `nodelay', `terminate')
3001e92d3f3fSGregory Neil Shapiro
3002e92d3f3fSGregory Neil Shapiro
300342e5d165SGregory Neil Shapiro+----------+
300406f25ae9SGregory Neil Shapiro| STARTTLS |
300542e5d165SGregory Neil Shapiro+----------+
300606f25ae9SGregory Neil Shapiro
300713d88268SGregory Neil ShapiroIn this text, cert will be used as an abbreviation for X.509 certificate,
300840266059SGregory Neil ShapiroDN (CN) is the distinguished (common) name of a cert, and CA is a
300940266059SGregory Neil Shapirocertification authority, which signs (issues) certs.
301006f25ae9SGregory Neil Shapiro
301113058a91SGregory Neil ShapiroFor STARTTLS to be offered by sendmail you need to set at least
301213d88268SGregory Neil Shapirothese variables (the file names and paths are just examples):
301313058a91SGregory Neil Shapiro
301413058a91SGregory Neil Shapiro	define(`confCACERT_PATH', `/etc/mail/certs/')
301513058a91SGregory Neil Shapiro	define(`confCACERT', `/etc/mail/certs/CA.cert.pem')
301613058a91SGregory Neil Shapiro	define(`confSERVER_CERT', `/etc/mail/certs/my.cert.pem')
301713058a91SGregory Neil Shapiro	define(`confSERVER_KEY', `/etc/mail/certs/my.key.pem')
301813058a91SGregory Neil Shapiro
301913058a91SGregory Neil ShapiroOn systems which do not have the compile flag HASURANDOM set (see
302013058a91SGregory Neil Shapirosendmail/README) you also must set confRAND_FILE.
302113058a91SGregory Neil Shapiro
302240266059SGregory Neil ShapiroSee doc/op/op.{me,ps,txt} for more information about these options,
302340266059SGregory Neil Shapiroespecially the sections ``Certificates for STARTTLS'' and ``PRNG for
302413058a91SGregory Neil ShapiroSTARTTLS''.
302513058a91SGregory Neil Shapiro
302606f25ae9SGregory Neil ShapiroMacros related to STARTTLS are:
302706f25ae9SGregory Neil Shapiro
302806f25ae9SGregory Neil Shapiro${cert_issuer} holds the DN of the CA (the cert issuer).
302906f25ae9SGregory Neil Shapiro${cert_subject} holds the DN of the cert (called the cert subject).
303040266059SGregory Neil Shapiro${cn_issuer} holds the CN of the CA (the cert issuer).
303140266059SGregory Neil Shapiro${cn_subject} holds the CN of the cert (called the cert subject).
303206f25ae9SGregory Neil Shapiro${tls_version} the TLS/SSL version used for the connection, e.g., TLSv1,
303340266059SGregory Neil Shapiro	TLSv1/SSLv3, SSLv3, SSLv2.
303406f25ae9SGregory Neil Shapiro${cipher} the cipher used for the connection, e.g., EDH-DSS-DES-CBC3-SHA,
303506f25ae9SGregory Neil Shapiro	EDH-RSA-DES-CBC-SHA, DES-CBC-MD5, DES-CBC3-SHA.
303606f25ae9SGregory Neil Shapiro${cipher_bits} the keylength (in bits) of the symmetric encryption algorithm
303706f25ae9SGregory Neil Shapiro	used for the connection.
303840266059SGregory Neil Shapiro${verify} holds the result of the verification of the presented cert.
303940266059SGregory Neil Shapiro	Possible values are:
304006f25ae9SGregory Neil Shapiro	OK	 verification succeeded.
304106f25ae9SGregory Neil Shapiro	NO	 no cert presented.
304240266059SGregory Neil Shapiro	NOT	 no cert requested.
304340266059SGregory Neil Shapiro	FAIL	 cert presented but could not be verified,
304440266059SGregory Neil Shapiro		 e.g., the cert of the signing CA is missing.
304506f25ae9SGregory Neil Shapiro	NONE	 STARTTLS has not been performed.
304606f25ae9SGregory Neil Shapiro	TEMP	 temporary error occurred.
304740266059SGregory Neil Shapiro	PROTOCOL protocol error occurred (SMTP level).
304806f25ae9SGregory Neil Shapiro	SOFTWARE STARTTLS handshake failed.
304906f25ae9SGregory Neil Shapiro${server_name} the name of the server of the current outgoing SMTP
305006f25ae9SGregory Neil Shapiro	connection.
305106f25ae9SGregory Neil Shapiro${server_addr} the address of the server of the current outgoing SMTP
305206f25ae9SGregory Neil Shapiro	connection.
305306f25ae9SGregory Neil Shapiro
305406f25ae9SGregory Neil ShapiroRelaying
305540266059SGregory Neil Shapiro--------
305606f25ae9SGregory Neil Shapiro
305713bd1963SGregory Neil ShapiroSMTP STARTTLS can allow relaying for remote SMTP clients which have
3058a7ec597cSGregory Neil Shapirosuccessfully authenticated themselves.  If the verification of the cert
3059a7ec597cSGregory Neil Shapirofailed (${verify} != OK), relaying is subject to the usual rules.
3060a7ec597cSGregory Neil ShapiroOtherwise the DN of the issuer is looked up in the access map using the
3061a7ec597cSGregory Neil Shapirotag CERTISSUER.  If the resulting value is RELAY, relaying is allowed.
3062a7ec597cSGregory Neil ShapiroIf it is SUBJECT, the DN of the cert subject is looked up next in the
3063a7ec597cSGregory Neil Shapiroaccess map using the tag CERTSUBJECT.  If the value is RELAY, relaying
3064a7ec597cSGregory Neil Shapirois allowed.
306513bd1963SGregory Neil Shapiro
3066e92d3f3fSGregory Neil ShapiroTo make things a bit more flexible (or complicated), the values for
306706f25ae9SGregory Neil Shapiro${cert_issuer} and ${cert_subject} can be optionally modified by regular
306806f25ae9SGregory Neil Shapiroexpressions defined in the m4 variables _CERT_REGEX_ISSUER_ and
306906f25ae9SGregory Neil Shapiro_CERT_REGEX_SUBJECT_, respectively.  To avoid problems with those macros in
307006f25ae9SGregory Neil Shapirorulesets and map lookups, they are modified as follows: each non-printable
307113bd1963SGregory Neil Shapirocharacter and the characters '<', '>', '(', ')', '"', '+', ' ' are replaced
307213bd1963SGregory Neil Shapiroby their HEX value with a leading '+'.  For example:
307306f25ae9SGregory Neil Shapiro
3074*5b0945b5SGregory Neil Shapiro/C=US/ST=California/O=endmail.org/OU=private/CN=Darth Mail (Cert)/emailAddress=
307506f25ae9SGregory Neil Shapirodarth+cert@endmail.org
307606f25ae9SGregory Neil Shapiro
307706f25ae9SGregory Neil Shapirois encoded as:
307806f25ae9SGregory Neil Shapiro
307906f25ae9SGregory Neil Shapiro/C=US/ST=California/O=endmail.org/OU=private/CN=
3080*5b0945b5SGregory Neil ShapiroDarth+20Mail+20+28Cert+29/emailAddress=darth+2Bcert@endmail.org
308106f25ae9SGregory Neil Shapiro
308206f25ae9SGregory Neil Shapiro(line breaks have been inserted for readability).
308306f25ae9SGregory Neil Shapiro
308413bd1963SGregory Neil ShapiroThe  macros  which are subject to this encoding are ${cert_subject},
308513bd1963SGregory Neil Shapiro${cert_issuer},  ${cn_subject},  and ${cn_issuer}.
308613bd1963SGregory Neil Shapiro
308740266059SGregory Neil ShapiroExamples:
308840266059SGregory Neil Shapiro
308940266059SGregory Neil ShapiroTo allow relaying for everyone who can present a cert signed by
309040266059SGregory Neil Shapiro
309140266059SGregory Neil Shapiro/C=US/ST=California/O=endmail.org/OU=private/CN=
3092*5b0945b5SGregory Neil ShapiroDarth+20Mail+20+28Cert+29/emailAddress=darth+2Bcert@endmail.org
309340266059SGregory Neil Shapiro
309440266059SGregory Neil Shapirosimply use:
309540266059SGregory Neil Shapiro
309613bd1963SGregory Neil ShapiroCertIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN=
3097*5b0945b5SGregory Neil ShapiroDarth+20Mail+20+28Cert+29/emailAddress=darth+2Bcert@endmail.org	RELAY
309840266059SGregory Neil Shapiro
309940266059SGregory Neil ShapiroTo allow relaying only for a subset of machines that have a cert signed by
310040266059SGregory Neil Shapiro
310140266059SGregory Neil Shapiro/C=US/ST=California/O=endmail.org/OU=private/CN=
3102*5b0945b5SGregory Neil ShapiroDarth+20Mail+20+28Cert+29/emailAddress=darth+2Bcert@endmail.org
310340266059SGregory Neil Shapiro
310440266059SGregory Neil Shapirouse:
310540266059SGregory Neil Shapiro
310613bd1963SGregory Neil ShapiroCertIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN=
3107*5b0945b5SGregory Neil ShapiroDarth+20Mail+20+28Cert+29/emailAddress=darth+2Bcert@endmail.org	SUBJECT
310813bd1963SGregory Neil ShapiroCertSubject:/C=US/ST=California/O=endmail.org/OU=private/CN=
3109*5b0945b5SGregory Neil ShapiroDeathStar/emailAddress=deathstar@endmail.org		RELAY
311040266059SGregory Neil Shapiro
3111*5b0945b5SGregory Neil ShapiroNote: line breaks have been inserted after "CN=" for readability,
311240266059SGregory Neil Shapiroeach tagged entry must be one (long) line in the access map.
311340266059SGregory Neil Shapiro
311440266059SGregory Neil ShapiroOf course it is also possible to write a simple ruleset that allows
311506f25ae9SGregory Neil Shapirorelaying for everyone who can present a cert that can be verified, e.g.,
311606f25ae9SGregory Neil Shapiro
311706f25ae9SGregory Neil ShapiroLOCAL_RULESETS
311806f25ae9SGregory Neil ShapiroSLocal_check_rcpt
311906f25ae9SGregory Neil ShapiroR$*	$: $&{verify}
312006f25ae9SGregory Neil ShapiroROK	$# OK
312106f25ae9SGregory Neil Shapiro
312206f25ae9SGregory Neil ShapiroAllowing Connections
312340266059SGregory Neil Shapiro--------------------
312406f25ae9SGregory Neil Shapiro
312540266059SGregory Neil ShapiroThe rulesets tls_server, tls_client, and tls_rcpt are used to decide whether
312640266059SGregory Neil Shapiroan SMTP connection is accepted (or should continue).
312706f25ae9SGregory Neil Shapiro
312806f25ae9SGregory Neil Shapirotls_server is called when sendmail acts as client after a STARTTLS command
312906f25ae9SGregory Neil Shapiro(should) have been issued.  The parameter is the value of ${verify}.
313006f25ae9SGregory Neil Shapiro
313106f25ae9SGregory Neil Shapirotls_client is called when sendmail acts as server, after a STARTTLS command
313206f25ae9SGregory Neil Shapirohas been issued, and from check_mail.  The parameter is the value of
313306f25ae9SGregory Neil Shapiro${verify} and STARTTLS or MAIL, respectively.
313406f25ae9SGregory Neil Shapiro
313506f25ae9SGregory Neil ShapiroBoth rulesets behave the same.  If no access map is in use, the connection
313606f25ae9SGregory Neil Shapirowill be accepted unless ${verify} is SOFTWARE, in which case the connection
313740266059SGregory Neil Shapirois always aborted.  For tls_server/tls_client, ${client_name}/${server_name}
313840266059SGregory Neil Shapirois looked up in the access map using the tag TLS_Srv/TLS_Clt, which is done
313906f25ae9SGregory Neil Shapirowith the ruleset LookUpDomain.  If no entry is found, ${client_addr}
314006f25ae9SGregory Neil Shapiro(${server_addr}) is looked up in the access map (same tag, ruleset
314106f25ae9SGregory Neil ShapiroLookUpAddr).  If this doesn't result in an entry either, just the tag is
314240266059SGregory Neil Shapirolooked up in the access map (included the trailing colon).  Notice:
314340266059SGregory Neil Shapirorequiring that e-mail is sent to a server only encrypted, e.g., via
314440266059SGregory Neil Shapiro
314540266059SGregory Neil ShapiroTLS_Srv:secure.domain	ENCR:112
314640266059SGregory Neil Shapiro
314740266059SGregory Neil Shapirodoesn't necessarily mean that e-mail sent to that domain is encrypted.
314840266059SGregory Neil ShapiroIf the domain has multiple MX servers, e.g.,
314940266059SGregory Neil Shapiro
315040266059SGregory Neil Shapirosecure.domain.	IN MX 10	mail.secure.domain.
315140266059SGregory Neil Shapirosecure.domain.	IN MX 50	mail.other.domain.
315240266059SGregory Neil Shapiro
315340266059SGregory Neil Shapirothen mail to user@secure.domain may go unencrypted to mail.other.domain.
315440266059SGregory Neil Shapirotls_rcpt can be used to address this problem.
315540266059SGregory Neil Shapiro
315640266059SGregory Neil Shapirotls_rcpt is called before a RCPT TO: command is sent.  The parameter is the
315740266059SGregory Neil Shapirocurrent recipient.  This ruleset is only defined if FEATURE(`access_db')
315840266059SGregory Neil Shapirois selected.  A recipient address user@domain is looked up in the access
315940266059SGregory Neil Shapiromap in four formats: TLS_Rcpt:user@domain, TLS_Rcpt:user@, TLS_Rcpt:domain,
316040266059SGregory Neil Shapiroand TLS_Rcpt:; the first match is taken.
316140266059SGregory Neil Shapiro
316240266059SGregory Neil ShapiroThe result of the lookups is then used to call the ruleset TLS_connection,
316340266059SGregory Neil Shapirowhich checks the requirement specified by the RHS in the access map against
316440266059SGregory Neil Shapirothe actual parameters of the current TLS connection, esp. ${verify} and
316506f25ae9SGregory Neil Shapiro${cipher_bits}.  Legal RHSs in the access map are:
316606f25ae9SGregory Neil Shapiro
316706f25ae9SGregory Neil ShapiroVERIFY		verification must have succeeded
316806f25ae9SGregory Neil ShapiroVERIFY:bits	verification must have succeeded and ${cipher_bits} must
316906f25ae9SGregory Neil Shapiro		be greater than or equal bits.
317006f25ae9SGregory Neil ShapiroENCR:bits	${cipher_bits} must be greater than or equal bits.
317106f25ae9SGregory Neil Shapiro
317206f25ae9SGregory Neil ShapiroThe RHS can optionally be prefixed by TEMP+ or PERM+ to select a temporary
317306f25ae9SGregory Neil Shapiroor permanent error.  The default is a temporary error code (403 4.7.0)
317406f25ae9SGregory Neil Shapirounless the macro TLS_PERM_ERR is set during generation of the .cf file.
317506f25ae9SGregory Neil Shapiro
317606f25ae9SGregory Neil ShapiroIf a certain level of encryption is required, then it might also be
317706f25ae9SGregory Neil Shapiropossible that this level is provided by the security layer from a SASL
317806f25ae9SGregory Neil Shapiroalgorithm, e.g., DIGEST-MD5.
317906f25ae9SGregory Neil Shapiro
318040266059SGregory Neil ShapiroFurthermore, there can be a list of extensions added.  Such a list
318140266059SGregory Neil Shapirostarts with '+' and the items are separated by '++'.  Allowed
318240266059SGregory Neil Shapiroextensions are:
318340266059SGregory Neil Shapiro
318440266059SGregory Neil ShapiroCN:name		name must match ${cn_subject}
31859bd497b8SGregory Neil ShapiroCN		${client_name}/${server_name} must match ${cn_subject}
318640266059SGregory Neil ShapiroCS:name		name must match ${cert_subject}
318740266059SGregory Neil ShapiroCI:name		name must match ${cert_issuer}
3188*5b0945b5SGregory Neil ShapiroCITag:MYTag	look up MYTag:${cert_issuer} in access map; the check
3189*5b0945b5SGregory Neil Shapiro		only succeeds if it is found with a RHS of OK.
319040266059SGregory Neil Shapiro
3191c86d5965SGregory Neil ShapiroExample: e-mail sent to secure.example.com should only use an encrypted
319240266059SGregory Neil Shapiroconnection.  E-mail received from hosts within the laptop.example.com domain
319340266059SGregory Neil Shapiroshould only be accepted if they have been authenticated.  The host which
319440266059SGregory Neil Shapiroreceives e-mail for darth@endmail.org must present a cert that uses the
3195*5b0945b5SGregory Neil ShapiroCN smtp.endmail.org.  E-mail sent to safe.example.com must be verified,
3196*5b0945b5SGregory Neil Shapirohave a matching CN, and must present a cert signed by a CA with one of
3197*5b0945b5SGregory Neil Shapirothe listed DNs.
319840266059SGregory Neil Shapiro
319906f25ae9SGregory Neil ShapiroTLS_Srv:secure.example.com	ENCR:112
320006f25ae9SGregory Neil ShapiroTLS_Clt:laptop.example.com	PERM+VERIFY:112
320140266059SGregory Neil ShapiroTLS_Rcpt:darth@endmail.org	ENCR:112+CN:smtp.endmail.org
3202*5b0945b5SGregory Neil ShapiroTLS_Srv:safe.example.net	VERIFY+CN++CITag:MyCA
3203*5b0945b5SGregory Neil ShapiroMyCA:/C=US/ST=CA/O=safe/CN=example.net/		OK
3204*5b0945b5SGregory Neil ShapiroMyCA:/C=US/ST=CA/O=secure/CN=example.net/	OK
320506f25ae9SGregory Neil Shapiro
3206602a2b1bSGregory Neil Shapiro
3207da7d7b9cSGregory Neil ShapiroTLS Options per Session
3208da7d7b9cSGregory Neil Shapiro-----------------------
3209602a2b1bSGregory Neil Shapiro
321040266059SGregory Neil ShapiroBy default STARTTLS is used whenever possible.  However, there are
3211da7d7b9cSGregory Neil ShapiroMTAs with STARTTLS interoperability issues.  To be able to send to
3212da7d7b9cSGregory Neil Shapiro(or receive from) those MTAs several features are available:
3213da7d7b9cSGregory Neil Shapiro
3214da7d7b9cSGregory Neil Shapiro1) Various TLS options be be set per IP/domain.
3215da7d7b9cSGregory Neil Shapiro2) STARTTLS can be turned off for specific IP addresses/domains.
3216da7d7b9cSGregory Neil Shapiro
3217da7d7b9cSGregory Neil ShapiroAbout 1): the rulesets tls_srv_features and tls_clt_features can
3218da7d7b9cSGregory Neil Shapirobe used to return a (semicolon separated) list of TLS related
3219da7d7b9cSGregory Neil Shapirooptions:
3220da7d7b9cSGregory Neil Shapiro
3221da7d7b9cSGregory Neil Shapiro- Options: compare {Server,Client}SSLOptions.
3222da7d7b9cSGregory Neil Shapiro- CipherList: same as the global option.
3223da7d7b9cSGregory Neil Shapiro- CertFile, KeyFile: {Server,Client}{Cert,Key}File
3224*5b0945b5SGregory Neil Shapiro- Flags: see doc/op/op.me for details.
3225da7d7b9cSGregory Neil Shapiro
3226da7d7b9cSGregory Neil ShapiroIf FEATURE(`tls_session_features') is used, then default rulesets
3227da7d7b9cSGregory Neil Shapiroare activated which look up entries in the access map with the tags
3228da7d7b9cSGregory Neil ShapiroTLS_Srv_features and TLS_Clt_features, respectively.
3229da7d7b9cSGregory Neil ShapiroFor example, these entries:
3230da7d7b9cSGregory Neil Shapiro
3231da7d7b9cSGregory Neil Shapiro	TLS_Srv_features:10.0.2.4	CipherList=MEDIUM+aRSA;
3232da7d7b9cSGregory Neil Shapiro	TLS_Clt_features:10.1.0.1	Options=SSL_OP_NO_TLSv1_2; CipherList=ALL:-EXPORT
3233da7d7b9cSGregory Neil Shapiro
3234da7d7b9cSGregory Neil Shapirospecify a cipherlist with MEDIUM strength ciphers that use RSA
3235da7d7b9cSGregory Neil Shapirocertificates only for the client with the IP address 10.0.2.4,
3236da7d7b9cSGregory Neil Shapiroand turn off TLSv1.2 when connecting to the server with the IP
3237da7d7b9cSGregory Neil Shapiroaddress 10.1.0.1 as well as setting a specific cipherlist.
3238da7d7b9cSGregory Neil ShapiroIf FEATURE(`tls_session_features') is not used the user can provide
3239da7d7b9cSGregory Neil Shapirotheir own rulesets which must return the appropriate data.
3240da7d7b9cSGregory Neil ShapiroIf the rulesets are not defined or do not return a value, the
3241da7d7b9cSGregory Neil Shapirodefault TLS options are not modified.
3242da7d7b9cSGregory Neil Shapiro
3243*5b0945b5SGregory Neil ShapiroAbout 2): the ruleset try_tls (srv_features) can be used together
3244*5b0945b5SGregory Neil Shapirowith the access map.  Entries for the access map must be tagged
3245*5b0945b5SGregory Neil Shapirowith Try_TLS (Srv_Features) and refer to the hostname or IP address
3246*5b0945b5SGregory Neil Shapiroof the connecting system.  A default case can be specified by using
3247*5b0945b5SGregory Neil Shapirojust the tag.  For example, the following entries in the access map:
3248602a2b1bSGregory Neil Shapiro
324940266059SGregory Neil Shapiro	Try_TLS:broken.server	NO
325040266059SGregory Neil Shapiro	Srv_Features:my.domain	v
325140266059SGregory Neil Shapiro	Srv_Features:		V
3252602a2b1bSGregory Neil Shapiro
325340266059SGregory Neil Shapirowill turn off STARTTLS when sending to broken.server (or any host
325440266059SGregory Neil Shapiroin that domain), and request a client certificate during the TLS
325540266059SGregory Neil Shapirohandshake only for hosts in my.domain.  The valid entries on the RHS
325640266059SGregory Neil Shapirofor Srv_Features are listed in the Sendmail Installation and
325740266059SGregory Neil ShapiroOperations Guide.
3258602a2b1bSGregory Neil Shapiro
3259602a2b1bSGregory Neil Shapiro
326006f25ae9SGregory Neil ShapiroReceived: Header
326140266059SGregory Neil Shapiro----------------
326206f25ae9SGregory Neil Shapiro
326306f25ae9SGregory Neil ShapiroThe Received: header reveals whether STARTTLS has been used.  It contains an
326406f25ae9SGregory Neil Shapiroextra line:
326506f25ae9SGregory Neil Shapiro
326640266059SGregory Neil Shapiro(version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify})
326740266059SGregory Neil Shapiro
326806f25ae9SGregory Neil Shapiro
326942e5d165SGregory Neil Shapiro+---------------------+
327006f25ae9SGregory Neil Shapiro| SMTP AUTHENTICATION |
327142e5d165SGregory Neil Shapiro+---------------------+
327206f25ae9SGregory Neil Shapiro
327306f25ae9SGregory Neil ShapiroThe macros ${auth_authen}, ${auth_author}, and ${auth_type} can be
327406f25ae9SGregory Neil Shapiroused in anti-relay rulesets to allow relaying for those users that
327506f25ae9SGregory Neil Shapiroauthenticated themselves.  A very simple example is:
327606f25ae9SGregory Neil Shapiro
327706f25ae9SGregory Neil ShapiroSLocal_check_rcpt
327806f25ae9SGregory Neil ShapiroR$*		$: $&{auth_type}
327906f25ae9SGregory Neil ShapiroR$+		$# OK
328006f25ae9SGregory Neil Shapiro
328106f25ae9SGregory Neil Shapirowhich checks whether a user has successfully authenticated using
3282e92d3f3fSGregory Neil Shapiroany available mechanism.  Depending on the setup of the Cyrus SASL
328306f25ae9SGregory Neil Shapirolibrary, more sophisticated rulesets might be required, e.g.,
328406f25ae9SGregory Neil Shapiro
328506f25ae9SGregory Neil ShapiroSLocal_check_rcpt
328606f25ae9SGregory Neil ShapiroR$*		$: $&{auth_type} $| $&{auth_authen}
328706f25ae9SGregory Neil ShapiroRDIGEST-MD5 $| $+@$=w	$# OK
328806f25ae9SGregory Neil Shapiro
328906f25ae9SGregory Neil Shapiroto allow relaying for users that authenticated using DIGEST-MD5
329006f25ae9SGregory Neil Shapiroand have an identity in the local domains.
329106f25ae9SGregory Neil Shapiro
329240266059SGregory Neil ShapiroThe ruleset trust_auth is used to determine whether a given AUTH=
329306f25ae9SGregory Neil Shapiroparameter (that is passed to this ruleset) should be trusted.  This
329406f25ae9SGregory Neil Shapiroruleset may make use of the other ${auth_*} macros.  Only if the
329506f25ae9SGregory Neil Shapiroruleset resolves to the error mailer, the AUTH= parameter is not
329606f25ae9SGregory Neil Shapirotrusted.  A user supplied ruleset Local_trust_auth can be written
329706f25ae9SGregory Neil Shapiroto modify the default behavior, which only trust the AUTH=
329806f25ae9SGregory Neil Shapiroparameter if it is identical to the authenticated user.
329906f25ae9SGregory Neil Shapiro
330006f25ae9SGregory Neil ShapiroPer default, relaying is allowed for any user who authenticated
330106f25ae9SGregory Neil Shapirovia a "trusted" mechanism, i.e., one that is defined via
330206f25ae9SGregory Neil ShapiroTRUST_AUTH_MECH(`list of mechanisms')
3303193538b7SGregory Neil ShapiroFor example:
3304193538b7SGregory Neil ShapiroTRUST_AUTH_MECH(`KERBEROS_V4 DIGEST-MD5')
330506f25ae9SGregory Neil Shapiro
330606f25ae9SGregory Neil ShapiroIf the selected mechanism provides a security layer the number of
330706f25ae9SGregory Neil Shapirobits used for the key of the symmetric cipher is stored in the
330806f25ae9SGregory Neil Shapiromacro ${auth_ssf}.
3309c2aa98e2SPeter Wemm
3310e92d3f3fSGregory Neil ShapiroProviding SMTP AUTH Data when sendmail acts as Client
3311e92d3f3fSGregory Neil Shapiro-----------------------------------------------------
3312e92d3f3fSGregory Neil Shapiro
331340266059SGregory Neil ShapiroIf sendmail acts as client, it needs some information how to
331440266059SGregory Neil Shapiroauthenticate against another MTA.  This information can be provided
331540266059SGregory Neil Shapiroby the ruleset authinfo or by the option DefaultAuthInfo.  The
331640266059SGregory Neil Shapiroauthinfo ruleset looks up {server_name} using the tag AuthInfo: in
331740266059SGregory Neil Shapirothe access map.  If no entry is found, {server_addr} is looked up
331840266059SGregory Neil Shapiroin the same way and finally just the tag AuthInfo: to provide
3319d9986b26SGregory Neil Shapirodefault values.  Note: searches for domain parts or IP nets are
3320d9986b26SGregory Neil Shapiroonly performed if the access map is used; if the authinfo feature
3321d9986b26SGregory Neil Shapirois used then only up to three lookups are performed (two exact
3322d9986b26SGregory Neil Shapiromatches, one default).
332340266059SGregory Neil Shapiro
3324e92d3f3fSGregory Neil ShapiroNote: If your daemon does client authentication when sending, and
3325e92d3f3fSGregory Neil Shapiroif it uses either PLAIN or LOGIN authentication, then you *must*
3326e92d3f3fSGregory Neil Shapiroprevent ordinary users from seeing verbose output.  Do NOT install
3327e92d3f3fSGregory Neil Shapirosendmail set-user-ID.  Use PrivacyOptions to turn off verbose output
3328e92d3f3fSGregory Neil Shapiro("goaway" works for this).
3329e92d3f3fSGregory Neil Shapiro
333040266059SGregory Neil ShapiroNotice: the default configuration file causes the option DefaultAuthInfo
333140266059SGregory Neil Shapiroto fail since the ruleset authinfo is in the .cf file. If you really
333240266059SGregory Neil Shapirowant to use DefaultAuthInfo (it is deprecated) then you have to
333340266059SGregory Neil Shapiroremove the ruleset.
333440266059SGregory Neil Shapiro
333540266059SGregory Neil ShapiroThe RHS for an AuthInfo: entry in the access map should consists of a
333640266059SGregory Neil Shapirolist of tokens, each of which has the form: "TDstring" (including
333740266059SGregory Neil Shapirothe quotes).  T is a tag which describes the item, D is a delimiter,
333840266059SGregory Neil Shapiroeither ':' for simple text or '=' for a base64 encoded string.
333940266059SGregory Neil ShapiroValid values for the tag are:
334040266059SGregory Neil Shapiro
334140266059SGregory Neil Shapiro	U	user (authorization) id
334240266059SGregory Neil Shapiro	I	authentication id
334340266059SGregory Neil Shapiro	P	password
334440266059SGregory Neil Shapiro	R	realm
334540266059SGregory Neil Shapiro	M	list of mechanisms delimited by spaces
334640266059SGregory Neil Shapiro
334740266059SGregory Neil ShapiroExample entries are:
334840266059SGregory Neil Shapiro
334940266059SGregory Neil ShapiroAuthInfo:other.dom "U:user" "I:user" "P:secret" "R:other.dom" "M:DIGEST-MD5"
3350d9986b26SGregory Neil ShapiroAuthInfo:host.more.dom "U:user" "P=c2VjcmV0"
335140266059SGregory Neil Shapiro
3352d9986b26SGregory Neil ShapiroUser id or authentication id must exist as well as the password.  All
335340266059SGregory Neil Shapiroother entries have default values.  If one of user or authentication
335440266059SGregory Neil Shapiroid is missing, the existing value is used for the missing item.
335540266059SGregory Neil ShapiroIf "R:" is not specified, realm defaults to $j.  The list of mechanisms
335640266059SGregory Neil Shapirodefaults to those specified by AuthMechanisms.
335740266059SGregory Neil Shapiro
335840266059SGregory Neil ShapiroSince this map contains sensitive information, either the access
335940266059SGregory Neil Shapiromap must be unreadable by everyone but root (or the trusted user)
336040266059SGregory Neil Shapiroor FEATURE(`authinfo') must be used which provides a separate map.
336140266059SGregory Neil ShapiroNotice: It is not checked whether the map is actually
336240266059SGregory Neil Shapirogroup/world-unreadable, this is left to the user.
336340266059SGregory Neil Shapiro
3364c2aa98e2SPeter Wemm+--------------------------------+
3365c2aa98e2SPeter Wemm| ADDING NEW MAILERS OR RULESETS |
3366c2aa98e2SPeter Wemm+--------------------------------+
3367c2aa98e2SPeter Wemm
3368c2aa98e2SPeter WemmSometimes you may need to add entirely new mailers or rulesets.  They
3369c2aa98e2SPeter Wemmshould be introduced with the constructs MAILER_DEFINITIONS and
3370c2aa98e2SPeter WemmLOCAL_RULESETS respectively.  For example:
3371c2aa98e2SPeter Wemm
3372c2aa98e2SPeter Wemm	MAILER_DEFINITIONS
3373c2aa98e2SPeter Wemm	Mmymailer, ...
3374c2aa98e2SPeter Wemm	...
3375c2aa98e2SPeter Wemm
3376c2aa98e2SPeter Wemm	LOCAL_RULESETS
3377c2aa98e2SPeter Wemm	Smyruleset
3378c2aa98e2SPeter Wemm	...
3379c2aa98e2SPeter Wemm
338040266059SGregory Neil ShapiroLocal additions for the rulesets srv_features, try_tls, tls_rcpt,
338140266059SGregory Neil Shapirotls_client, and tls_server can be made using LOCAL_SRV_FEATURES,
338240266059SGregory Neil ShapiroLOCAL_TRY_TLS, LOCAL_TLS_RCPT, LOCAL_TLS_CLIENT, and LOCAL_TLS_SERVER,
338340266059SGregory Neil Shapirorespectively.  For example, to add a local ruleset that decides
338440266059SGregory Neil Shapirowhether to try STARTTLS in a sendmail client, use:
3385c2aa98e2SPeter Wemm
338640266059SGregory Neil Shapiro	LOCAL_TRY_TLS
338740266059SGregory Neil Shapiro	R...
338840266059SGregory Neil Shapiro
338940266059SGregory Neil ShapiroNote: you don't need to add a name for the ruleset, it is implicitly
339040266059SGregory Neil Shapirodefined by using the appropriate macro.
339140266059SGregory Neil Shapiro
339240266059SGregory Neil Shapiro
3393193538b7SGregory Neil Shapiro+-------------------------+
3394193538b7SGregory Neil Shapiro| ADDING NEW MAIL FILTERS |
3395193538b7SGregory Neil Shapiro+-------------------------+
339606f25ae9SGregory Neil Shapiro
339706f25ae9SGregory Neil ShapiroSendmail supports mail filters to filter incoming SMTP messages according
339806f25ae9SGregory Neil Shapiroto the "Sendmail Mail Filter API" documentation.  These filters can be
339906f25ae9SGregory Neil Shapiroconfigured in your mc file using the two commands:
340006f25ae9SGregory Neil Shapiro
340106f25ae9SGregory Neil Shapiro	MAIL_FILTER(`name', `equates')
340206f25ae9SGregory Neil Shapiro	INPUT_MAIL_FILTER(`name', `equates')
340306f25ae9SGregory Neil Shapiro
340406f25ae9SGregory Neil ShapiroThe first command, MAIL_FILTER(), simply defines a filter with the given
340506f25ae9SGregory Neil Shapironame and equates.  For example:
340606f25ae9SGregory Neil Shapiro
340706f25ae9SGregory Neil Shapiro	MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
340806f25ae9SGregory Neil Shapiro
340906f25ae9SGregory Neil ShapiroThis creates the equivalent sendmail.cf entry:
341006f25ae9SGregory Neil Shapiro
341106f25ae9SGregory Neil Shapiro	Xarchive, S=local:/var/run/archivesock, F=R
341206f25ae9SGregory Neil Shapiro
341306f25ae9SGregory Neil ShapiroThe INPUT_MAIL_FILTER() command performs the same actions as MAIL_FILTER
341406f25ae9SGregory Neil Shapirobut also populates the m4 variable `confINPUT_MAIL_FILTERS' with the name
341506f25ae9SGregory Neil Shapiroof the filter such that the filter will actually be called by sendmail.
341606f25ae9SGregory Neil Shapiro
341706f25ae9SGregory Neil ShapiroFor example, the two commands:
341806f25ae9SGregory Neil Shapiro
341906f25ae9SGregory Neil Shapiro	INPUT_MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
342006f25ae9SGregory Neil Shapiro	INPUT_MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T')
342106f25ae9SGregory Neil Shapiro
342206f25ae9SGregory Neil Shapiroare equivalent to the three commands:
342306f25ae9SGregory Neil Shapiro
342406f25ae9SGregory Neil Shapiro	MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
342506f25ae9SGregory Neil Shapiro	MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T')
342606f25ae9SGregory Neil Shapiro	define(`confINPUT_MAIL_FILTERS', `archive, spamcheck')
342706f25ae9SGregory Neil Shapiro
342806f25ae9SGregory Neil ShapiroIn general, INPUT_MAIL_FILTER() should be used unless you need to define
342906f25ae9SGregory Neil Shapiromore filters than you want to use for `confINPUT_MAIL_FILTERS'.
343006f25ae9SGregory Neil Shapiro
343106f25ae9SGregory Neil ShapiroNote that setting `confINPUT_MAIL_FILTERS' after any INPUT_MAIL_FILTER()
343206f25ae9SGregory Neil Shapirocommands will clear the list created by the prior INPUT_MAIL_FILTER()
343306f25ae9SGregory Neil Shapirocommands.
343406f25ae9SGregory Neil Shapiro
343506f25ae9SGregory Neil Shapiro
343640266059SGregory Neil Shapiro+-------------------------+
343740266059SGregory Neil Shapiro| QUEUE GROUP DEFINITIONS |
343840266059SGregory Neil Shapiro+-------------------------+
343940266059SGregory Neil Shapiro
344040266059SGregory Neil ShapiroIn addition to the queue directory (which is the default queue group
344140266059SGregory Neil Shapirocalled "mqueue"), sendmail can deal with multiple queue groups, which
344240266059SGregory Neil Shapiroare collections of queue directories with the same behaviour.  Queue
344340266059SGregory Neil Shapirogroups can be defined using the command:
344440266059SGregory Neil Shapiro
344540266059SGregory Neil Shapiro	QUEUE_GROUP(`name', `equates')
344640266059SGregory Neil Shapiro
344740266059SGregory Neil ShapiroFor details about queue groups, please see doc/op/op.{me,ps,txt}.
344840266059SGregory Neil Shapiro
3449c2aa98e2SPeter Wemm+-------------------------------+
3450c2aa98e2SPeter Wemm| NON-SMTP BASED CONFIGURATIONS |
3451c2aa98e2SPeter Wemm+-------------------------------+
3452c2aa98e2SPeter Wemm
345306f25ae9SGregory Neil ShapiroThese configuration files are designed primarily for use by
345406f25ae9SGregory Neil ShapiroSMTP-based sites.  They may not be well tuned for UUCP-only or
3455c2aa98e2SPeter WemmUUCP-primarily nodes (the latter is defined as a small local net
345606f25ae9SGregory Neil Shapiroconnected to the rest of the world via UUCP).  However, there is
345706f25ae9SGregory Neil Shapiroone hook to handle some special cases.
3458c2aa98e2SPeter Wemm
3459c2aa98e2SPeter WemmYou can define a ``smart host'' that understands a richer address syntax
3460c2aa98e2SPeter Wemmusing:
3461c2aa98e2SPeter Wemm
34622e43090eSPeter Wemm	define(`SMART_HOST', `mailer:hostname')
3463c2aa98e2SPeter Wemm
3464c2aa98e2SPeter WemmIn this case, the ``mailer:'' defaults to "relay".  Any messages that
3465c2aa98e2SPeter Wemmcan't be handled using the usual UUCP rules are passed to this host.
3466c2aa98e2SPeter Wemm
3467c2aa98e2SPeter WemmIf you are on a local SMTP-based net that connects to the outside
3468c2aa98e2SPeter Wemmworld via UUCP, you can use LOCAL_NET_CONFIG to add appropriate rules.
3469c2aa98e2SPeter WemmFor example:
3470c2aa98e2SPeter Wemm
347106f25ae9SGregory Neil Shapiro	define(`SMART_HOST', `uucp-new:uunet')
3472c2aa98e2SPeter Wemm	LOCAL_NET_CONFIG
3473c2aa98e2SPeter Wemm	R$* < @ $* .$m. > $*	$#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3
3474c2aa98e2SPeter Wemm
3475605302a5SGregory Neil ShapiroThis will cause all names that end in your domain name ($m) to be sent
3476605302a5SGregory Neil Shapirovia SMTP; anything else will be sent via uucp-new (smart UUCP) to uunet.
34772e43090eSPeter WemmIf you have FEATURE(`nocanonify'), you may need to omit the dots after
3478c2aa98e2SPeter Wemmthe $m.  If you are running a local DNS inside your domain which is
3479c2aa98e2SPeter Wemmnot otherwise connected to the outside world, you probably want to
3480c2aa98e2SPeter Wemmuse:
3481c2aa98e2SPeter Wemm
34822e43090eSPeter Wemm	define(`SMART_HOST', `smtp:fire.wall.com')
3483c2aa98e2SPeter Wemm	LOCAL_NET_CONFIG
3484c2aa98e2SPeter Wemm	R$* < @ $* . > $*	$#smtp $@ $2. $: $1 < @ $2. > $3
3485c2aa98e2SPeter Wemm
3486c2aa98e2SPeter WemmThat is, send directly only to things you found in your DNS lookup;
3487c2aa98e2SPeter Wemmanything else goes through SMART_HOST.
3488c2aa98e2SPeter Wemm
3489c2aa98e2SPeter WemmYou may need to turn off the anti-spam rules in order to accept
34902e43090eSPeter WemmUUCP mail with FEATURE(`promiscuous_relay') and
34912e43090eSPeter WemmFEATURE(`accept_unresolvable_domains').
3492c2aa98e2SPeter Wemm
3493c2aa98e2SPeter Wemm
3494c2aa98e2SPeter Wemm+-----------+
3495c2aa98e2SPeter Wemm| WHO AM I? |
3496c2aa98e2SPeter Wemm+-----------+
3497c2aa98e2SPeter Wemm
3498c2aa98e2SPeter WemmNormally, the $j macro is automatically defined to be your fully
3499c2aa98e2SPeter Wemmqualified domain name (FQDN).  Sendmail does this by getting your
3500c2aa98e2SPeter Wemmhost name using gethostname and then calling gethostbyname on the
3501c2aa98e2SPeter Wemmresult.  For example, in some environments gethostname returns
3502c2aa98e2SPeter Wemmonly the root of the host name (such as "foo"); gethostbyname is
3503c2aa98e2SPeter Wemmsupposed to return the FQDN ("foo.bar.com").  In some (fairly rare)
3504c2aa98e2SPeter Wemmcases, gethostbyname may fail to return the FQDN.  In this case
3505c2aa98e2SPeter Wemmyou MUST define confDOMAIN_NAME to be your fully qualified domain
3506c2aa98e2SPeter Wemmname.  This is usually done using:
3507c2aa98e2SPeter Wemm
3508c2aa98e2SPeter Wemm	Dmbar.com
3509c2aa98e2SPeter Wemm	define(`confDOMAIN_NAME', `$w.$m')dnl
3510c2aa98e2SPeter Wemm
3511c2aa98e2SPeter Wemm
351206f25ae9SGregory Neil Shapiro+-----------------------------------+
351306f25ae9SGregory Neil Shapiro| ACCEPTING MAIL FOR MULTIPLE NAMES |
351406f25ae9SGregory Neil Shapiro+-----------------------------------+
351506f25ae9SGregory Neil Shapiro
351606f25ae9SGregory Neil ShapiroIf your host is known by several different names, you need to augment
351706f25ae9SGregory Neil Shapiroclass {w}.  This is a list of names by which your host is known, and
351806f25ae9SGregory Neil Shapiroanything sent to an address using a host name in this list will be
351906f25ae9SGregory Neil Shapirotreated as local mail.  You can do this in two ways:  either create the
352006f25ae9SGregory Neil Shapirofile /etc/mail/local-host-names containing a list of your aliases (one per
352106f25ae9SGregory Neil Shapiroline), and use ``FEATURE(`use_cw_file')'' in the .mc file, or add
352206f25ae9SGregory Neil Shapiro``LOCAL_DOMAIN(`alias.host.name')''.  Be sure you use the fully-qualified
352306f25ae9SGregory Neil Shapironame of the host, rather than a short name.
352406f25ae9SGregory Neil Shapiro
352506f25ae9SGregory Neil ShapiroIf you want to have different address in different domains, take
352606f25ae9SGregory Neil Shapiroa look at the virtusertable feature, which is also explained at
352706f25ae9SGregory Neil Shapirohttp://www.sendmail.org/virtual-hosting.html
352806f25ae9SGregory Neil Shapiro
352906f25ae9SGregory Neil Shapiro
3530c2aa98e2SPeter Wemm+--------------------+
3531c2aa98e2SPeter Wemm| USING MAILERTABLES |
3532c2aa98e2SPeter Wemm+--------------------+
3533c2aa98e2SPeter Wemm
35342e43090eSPeter WemmTo use FEATURE(`mailertable'), you will have to create an external
3535c2aa98e2SPeter Wemmdatabase containing the routing information for various domains.
3536c2aa98e2SPeter WemmFor example, a mailertable file in text format might be:
3537c2aa98e2SPeter Wemm
3538c2aa98e2SPeter Wemm	.my.domain		xnet:%1.my.domain
353906f25ae9SGregory Neil Shapiro	uuhost1.my.domain	uucp-new:uuhost1
3540c2aa98e2SPeter Wemm	.bitnet			smtp:relay.bit.net
3541c2aa98e2SPeter Wemm
354206f25ae9SGregory Neil ShapiroThis should normally be stored in /etc/mail/mailertable.  The actual
3543c2aa98e2SPeter Wemmdatabase version of the mailertable is built using:
3544c2aa98e2SPeter Wemm
354506f25ae9SGregory Neil Shapiro	makemap hash /etc/mail/mailertable < /etc/mail/mailertable
3546c2aa98e2SPeter Wemm
3547c2aa98e2SPeter WemmThe semantics are simple.  Any LHS entry that does not begin with
3548c2aa98e2SPeter Wemma dot matches the full host name indicated.  LHS entries beginning
354942e5d165SGregory Neil Shapirowith a dot match anything ending with that domain name (including
355042e5d165SGregory Neil Shapirothe leading dot) -- that is, they can be thought of as having a
355142e5d165SGregory Neil Shapiroleading ".+" regular expression pattern for a non-empty sequence of
355242e5d165SGregory Neil Shapirocharacters.  Matching is done in order of most-to-least qualified
355342e5d165SGregory Neil Shapiro-- for example, even though ".my.domain" is listed first in the
355442e5d165SGregory Neil Shapiroabove example, an entry of "uuhost1.my.domain" will match the second
355542e5d165SGregory Neil Shapiroentry since it is more explicit.  Note: e-mail to "user@my.domain"
355642e5d165SGregory Neil Shapirodoes not match any entry in the above table.  You need to have
355742e5d165SGregory Neil Shapirosomething like:
355806f25ae9SGregory Neil Shapiro
355906f25ae9SGregory Neil Shapiro	my.domain		esmtp:host.my.domain
3560c2aa98e2SPeter Wemm
3561c2aa98e2SPeter WemmThe RHS should always be a "mailer:host" pair.  The mailer is the
356240266059SGregory Neil Shapiroconfiguration name of a mailer (that is, an M line in the
3563c2aa98e2SPeter Wemmsendmail.cf file).  The "host" will be the hostname passed to
3564c2aa98e2SPeter Wemmthat mailer.  In domain-based matches (that is, those with leading
3565c2aa98e2SPeter Wemmdots) the "%1" may be used to interpolate the wildcarded part of
3566c2aa98e2SPeter Wemmthe host name.  For example, the first line above sends everything
3567c2aa98e2SPeter Wemmaddressed to "anything.my.domain" to that same host name, but using
3568c2aa98e2SPeter Wemmthe (presumably experimental) xnet mailer.
3569c2aa98e2SPeter Wemm
3570c2aa98e2SPeter WemmIn some cases you may want to temporarily turn off MX records,
3571c2aa98e2SPeter Wemmparticularly on gateways.  For example, you may want to MX
3572c2aa98e2SPeter Wemmeverything in a domain to one machine that then forwards it
3573c2aa98e2SPeter Wemmdirectly.  To do this, you might use the DNS configuration:
3574c2aa98e2SPeter Wemm
3575c2aa98e2SPeter Wemm	*.domain.	IN	MX	0	relay.machine
3576c2aa98e2SPeter Wemm
3577c2aa98e2SPeter Wemmand on relay.machine use the mailertable:
3578c2aa98e2SPeter Wemm
3579c2aa98e2SPeter Wemm	.domain		smtp:[gateway.domain]
3580c2aa98e2SPeter Wemm
3581c2aa98e2SPeter WemmThe [square brackets] turn off MX records for this host only.
3582c2aa98e2SPeter WemmIf you didn't do this, the mailertable would use the MX record
3583a7ec597cSGregory Neil Shapiroagain, which would give you an MX loop.  Note that the use of
3584a7ec597cSGregory Neil Shapirowildcard MX records is almost always a bad idea.  Please avoid
3585a7ec597cSGregory Neil Shapirousing them if possible.
3586c2aa98e2SPeter Wemm
3587c2aa98e2SPeter Wemm
3588c2aa98e2SPeter Wemm+--------------------------------+
3589c2aa98e2SPeter Wemm| USING USERDB TO MAP FULL NAMES |
3590c2aa98e2SPeter Wemm+--------------------------------+
3591c2aa98e2SPeter Wemm
3592c2aa98e2SPeter WemmThe user database was not originally intended for mapping full names
3593c2aa98e2SPeter Wemmto login names (e.g., Eric.Allman => eric), but some people are using
359406f25ae9SGregory Neil Shapiroit that way.  (it is recommended that you set up aliases for this
3595c2aa98e2SPeter Wemmpurpose instead -- since you can specify multiple alias files, this
3596c2aa98e2SPeter Wemmis fairly easy.)  The intent was to locate the default maildrop at
3597c2aa98e2SPeter Wemma site, but allow you to override this by sending to a specific host.
3598c2aa98e2SPeter Wemm
3599c2aa98e2SPeter WemmIf you decide to set up the user database in this fashion, it is
36002e43090eSPeter Wemmimperative that you not use FEATURE(`stickyhost') -- otherwise,
3601c2aa98e2SPeter Wemme-mail sent to Full.Name@local.host.name will be rejected.
3602c2aa98e2SPeter Wemm
3603c2aa98e2SPeter WemmTo build the internal form of the user database, use:
3604c2aa98e2SPeter Wemm
360506f25ae9SGregory Neil Shapiro	makemap btree /etc/mail/userdb < /etc/mail/userdb.txt
3606c2aa98e2SPeter Wemm
360706f25ae9SGregory Neil ShapiroAs a general rule, it is an extremely bad idea to using full names
360806f25ae9SGregory Neil Shapiroas e-mail addresses, since they are not in any sense unique.  For
360942e5d165SGregory Neil Shapiroexample, the UNIX software-development community has at least two
361006f25ae9SGregory Neil Shapirowell-known Peter Deutsches, and at one time Bell Labs had two
361106f25ae9SGregory Neil ShapiroStephen R. Bournes with offices along the same hallway.  Which one
361206f25ae9SGregory Neil Shapirowill be forced to suffer the indignity of being Stephen_R_Bourne_2?
361306f25ae9SGregory Neil ShapiroThe less famous of the two, or the one that was hired later?
3614c2aa98e2SPeter Wemm
3615c2aa98e2SPeter WemmFinger should handle full names (and be fuzzy).  Mail should use
361606f25ae9SGregory Neil Shapirohandles, and not be fuzzy.
3617c2aa98e2SPeter Wemm
3618c2aa98e2SPeter Wemm
3619c2aa98e2SPeter Wemm+--------------------------------+
3620c2aa98e2SPeter Wemm| MISCELLANEOUS SPECIAL FEATURES |
3621c2aa98e2SPeter Wemm+--------------------------------+
3622c2aa98e2SPeter Wemm
3623c2aa98e2SPeter WemmPlussed users
3624c2aa98e2SPeter Wemm	Sometimes it is convenient to merge configuration on a
3625c2aa98e2SPeter Wemm	centralized mail machine, for example, to forward all
3626c2aa98e2SPeter Wemm	root mail to a mail server.  In this case it might be
3627c2aa98e2SPeter Wemm	useful to be able to treat the root addresses as a class
3628c2aa98e2SPeter Wemm	of addresses with subtle differences.  You can do this
3629c2aa98e2SPeter Wemm	using plussed users.  For example, a client might include
3630c2aa98e2SPeter Wemm	the alias:
3631c2aa98e2SPeter Wemm
3632c2aa98e2SPeter Wemm		root:  root+client1@server
3633c2aa98e2SPeter Wemm
3634c2aa98e2SPeter Wemm	On the server, this will match an alias for "root+client1".
3635c2aa98e2SPeter Wemm	If that is not found, the alias "root+*" will be tried,
3636c2aa98e2SPeter Wemm	then "root".
3637c2aa98e2SPeter Wemm
3638c2aa98e2SPeter Wemm
3639c2aa98e2SPeter Wemm+----------------+
3640c2aa98e2SPeter Wemm| SECURITY NOTES |
3641c2aa98e2SPeter Wemm+----------------+
3642c2aa98e2SPeter Wemm
3643c2aa98e2SPeter WemmA lot of sendmail security comes down to you.  Sendmail 8 is much
3644c2aa98e2SPeter Wemmmore careful about checking for security problems than previous
3645c2aa98e2SPeter Wemmversions, but there are some things that you still need to watch
3646c2aa98e2SPeter Wemmfor.  In particular:
3647c2aa98e2SPeter Wemm
364894c01205SGregory Neil Shapiro* Make sure the aliases file is not writable except by trusted
3649c2aa98e2SPeter Wemm  system personnel.  This includes both the text and database
3650c2aa98e2SPeter Wemm  version.
3651c2aa98e2SPeter Wemm
3652c2aa98e2SPeter Wemm* Make sure that other files that sendmail reads, such as the
3653c2aa98e2SPeter Wemm  mailertable, are only writable by trusted system personnel.
3654c2aa98e2SPeter Wemm
3655c2aa98e2SPeter Wemm* The queue directory should not be world writable PARTICULARLY
3656c2aa98e2SPeter Wemm  if your system allows "file giveaways" (that is, if a non-root
3657c2aa98e2SPeter Wemm  user can chown any file they own to any other user).
3658c2aa98e2SPeter Wemm
3659*5b0945b5SGregory Neil Shapiro* If your system allows file giveaways, DO NOT create a publicly
3660c2aa98e2SPeter Wemm  writable directory for forward files.  This will allow anyone
3661c2aa98e2SPeter Wemm  to steal anyone else's e-mail.  Instead, create a script that
3662c2aa98e2SPeter Wemm  copies the .forward file from users' home directories once a
3663c2aa98e2SPeter Wemm  night (if you want the non-NFS-mounted forward directory).
3664c2aa98e2SPeter Wemm
3665c2aa98e2SPeter Wemm* If your system allows file giveaways, you'll find that
3666c2aa98e2SPeter Wemm  sendmail is much less trusting of :include: files -- in
3667c2aa98e2SPeter Wemm  particular, you'll have to have /SENDMAIL/ANY/SHELL/ in
3668c2aa98e2SPeter Wemm  /etc/shells before they will be trusted (that is, before
3669c2aa98e2SPeter Wemm  files and programs listed in them will be honored).
3670c2aa98e2SPeter Wemm
3671c2aa98e2SPeter WemmIn general, file giveaways are a mistake -- if you can turn them
367206f25ae9SGregory Neil Shapirooff, do so.
3673c2aa98e2SPeter Wemm
3674c2aa98e2SPeter Wemm
3675c2aa98e2SPeter Wemm+--------------------------------+
3676c2aa98e2SPeter Wemm| TWEAKING CONFIGURATION OPTIONS |
3677c2aa98e2SPeter Wemm+--------------------------------+
3678c2aa98e2SPeter Wemm
3679c2aa98e2SPeter WemmThere are a large number of configuration options that don't normally
3680e92d3f3fSGregory Neil Shapironeed to be changed.  However, if you feel you need to tweak them,
3681e92d3f3fSGregory Neil Shapiroyou can define the following M4 variables. Note that some of these
3682e92d3f3fSGregory Neil Shapirovariables require formats that are defined in RFC 2821 or RFC 2822.
3683e92d3f3fSGregory Neil ShapiroBefore changing them you need to make sure you do not violate those
3684e92d3f3fSGregory Neil Shapiro(and other relevant) RFCs.
3685e92d3f3fSGregory Neil Shapiro
3686e92d3f3fSGregory Neil ShapiroThis list is shown in four columns:  the name you define, the default
3687e92d3f3fSGregory Neil Shapirovalue for that definition, the option or macro that is affected
3688e92d3f3fSGregory Neil Shapiro(either Ox for an option or Dx for a macro), and a brief description.
3689e92d3f3fSGregory Neil ShapiroGreater detail of the semantics can be found in the Installation
3690e92d3f3fSGregory Neil Shapiroand Operations Guide.
3691c2aa98e2SPeter Wemm
3692c2aa98e2SPeter WemmSome options are likely to be deprecated in future versions -- that is,
3693c2aa98e2SPeter Wemmthe option is only included to provide back-compatibility.  These are
3694c2aa98e2SPeter Wemmmarked with "*".
3695c2aa98e2SPeter Wemm
3696c2aa98e2SPeter WemmRemember that these options are M4 variables, and hence may need to
3697c2aa98e2SPeter Wemmbe quoted.  In particular, arguments with commas will usually have to
3698c2aa98e2SPeter Wemmbe ``double quoted, like this phrase'' to avoid having the comma
3699c2aa98e2SPeter Wemmconfuse things.  This is common for alias file definitions and for
3700c2aa98e2SPeter Wemmthe read timeout.
3701c2aa98e2SPeter Wemm
3702e92d3f3fSGregory Neil ShapiroM4 Variable Name	Configuration	[Default] & Description
3703c2aa98e2SPeter Wemm================	=============	=======================
3704c2aa98e2SPeter WemmconfMAILER_NAME		$n macro	[MAILER-DAEMON] The sender name used
3705c2aa98e2SPeter Wemm					for internally generated outgoing
3706c2aa98e2SPeter Wemm					messages.
3707c2aa98e2SPeter WemmconfDOMAIN_NAME		$j macro	If defined, sets $j.  This should
3708c2aa98e2SPeter Wemm					only be done if your system cannot
3709c2aa98e2SPeter Wemm					determine your local domain name,
3710c2aa98e2SPeter Wemm					and then it should be set to
3711c2aa98e2SPeter Wemm					$w.Foo.COM, where Foo.COM is your
3712c2aa98e2SPeter Wemm					domain name.
3713c2aa98e2SPeter WemmconfCF_VERSION		$Z macro	If defined, this is appended to the
3714c2aa98e2SPeter Wemm					configuration version name.
371540266059SGregory Neil ShapiroconfLDAP_CLUSTER	${sendmailMTACluster} macro
371640266059SGregory Neil Shapiro					If defined, this is the LDAP
371740266059SGregory Neil Shapiro					cluster to use for LDAP searches
371840266059SGregory Neil Shapiro					as described above in ``USING LDAP
371940266059SGregory Neil Shapiro					FOR ALIASES, MAPS, AND CLASSES''.
3720c2aa98e2SPeter WemmconfFROM_HEADER		From:		[$?x$x <$g>$|$g$.] The format of an
3721c2aa98e2SPeter Wemm					internally generated From: address.
3722c2aa98e2SPeter WemmconfRECEIVED_HEADER	Received:
3723c2aa98e2SPeter Wemm		[$?sfrom $s $.$?_($?s$|from $.$_)
372406f25ae9SGregory Neil Shapiro			$.$?{auth_type}(authenticated)
3725c2aa98e2SPeter Wemm			$.by $j ($v/$Z)$?r with $r$. id $i$?u
3726c2aa98e2SPeter Wemm			for $u; $|;
3727c2aa98e2SPeter Wemm			$.$b]
3728c2aa98e2SPeter Wemm					The format of the Received: header
3729c2aa98e2SPeter Wemm					in messages passed through this host.
3730c2aa98e2SPeter Wemm					It is unwise to try to change this.
3731e92d3f3fSGregory Neil ShapiroconfMESSAGEID_HEADER	Message-Id:	[<$t.$i@$j>] The format of an
3732e92d3f3fSGregory Neil Shapiro					internally generated Message-Id:
3733e92d3f3fSGregory Neil Shapiro					header.
373406f25ae9SGregory Neil ShapiroconfCW_FILE		Fw class	[/etc/mail/local-host-names] Name
373506f25ae9SGregory Neil Shapiro					of file used to get the local
373606f25ae9SGregory Neil Shapiro					additions to class {w} (local host
373706f25ae9SGregory Neil Shapiro					names).
373806f25ae9SGregory Neil ShapiroconfCT_FILE		Ft class	[/etc/mail/trusted-users] Name of
373906f25ae9SGregory Neil Shapiro					file used to get the local additions
374006f25ae9SGregory Neil Shapiro					to class {t} (trusted users).
3741c2aa98e2SPeter WemmconfCR_FILE		FR class	[/etc/mail/relay-domains] Name of
3742c2aa98e2SPeter Wemm					file used to get the local additions
374306f25ae9SGregory Neil Shapiro					to class {R} (hosts allowed to relay).
3744c2aa98e2SPeter WemmconfTRUSTED_USERS	Ct class	[no default] Names of users to add to
3745c2aa98e2SPeter Wemm					the list of trusted users.  This list
3746c2aa98e2SPeter Wemm					always includes root, uucp, and daemon.
37472e43090eSPeter Wemm					See also FEATURE(`use_ct_file').
374806f25ae9SGregory Neil ShapiroconfTRUSTED_USER	TrustedUser	[no default] Trusted user for file
374906f25ae9SGregory Neil Shapiro					ownership and starting the daemon.
375006f25ae9SGregory Neil Shapiro					Not to be confused with
375106f25ae9SGregory Neil Shapiro					confTRUSTED_USERS (see above).
3752c2aa98e2SPeter WemmconfSMTP_MAILER		-		[esmtp] The mailer name used when
3753c2aa98e2SPeter Wemm					SMTP connectivity is required.
375406f25ae9SGregory Neil Shapiro					One of "smtp", "smtp8",
375506f25ae9SGregory Neil Shapiro					"esmtp", or "dsmtp".
3756c2aa98e2SPeter WemmconfUUCP_MAILER		-		[uucp-old] The mailer to be used by
3757c2aa98e2SPeter Wemm					default for bang-format recipient
3758c2aa98e2SPeter Wemm					addresses.  See also discussion of
375906f25ae9SGregory Neil Shapiro					class {U}, class {Y}, and class {Z}
376006f25ae9SGregory Neil Shapiro					in the MAILER(`uucp') section.
3761c2aa98e2SPeter WemmconfLOCAL_MAILER	-		[local] The mailer name used when
3762c2aa98e2SPeter Wemm					local connectivity is required.
3763c2aa98e2SPeter Wemm					Almost always "local".
3764c2aa98e2SPeter WemmconfRELAY_MAILER	-		[relay] The default mailer name used
3765c2aa98e2SPeter Wemm					for relaying any mail (e.g., to a
3766c2aa98e2SPeter Wemm					BITNET_RELAY, a SMART_HOST, or
3767c2aa98e2SPeter Wemm					whatever).  This can reasonably be
3768c2aa98e2SPeter Wemm					"uucp-new" if you are on a
3769c2aa98e2SPeter Wemm					UUCP-connected site.
3770c2aa98e2SPeter WemmconfSEVEN_BIT_INPUT	SevenBitInput	[False] Force input to seven bits?
3771c2aa98e2SPeter WemmconfEIGHT_BIT_HANDLING	EightBitMode	[pass8] 8-bit data handling
3772c2aa98e2SPeter WemmconfALIAS_WAIT		AliasWait	[10m] Time to wait for alias file
3773c2aa98e2SPeter Wemm					rebuild until you get bored and
3774c2aa98e2SPeter Wemm					decide that the apparently pending
3775c2aa98e2SPeter Wemm					rebuild failed.
3776c2aa98e2SPeter WemmconfMIN_FREE_BLOCKS	MinFreeBlocks	[100] Minimum number of free blocks on
3777c2aa98e2SPeter Wemm					queue filesystem to accept SMTP mail.
3778c2aa98e2SPeter Wemm					(Prior to 8.7 this was minfree/maxsize,
3779c2aa98e2SPeter Wemm					where minfree was the number of free
3780c2aa98e2SPeter Wemm					blocks and maxsize was the maximum
3781c2aa98e2SPeter Wemm					message size.  Use confMAX_MESSAGE_SIZE
3782c2aa98e2SPeter Wemm					for the second value now.)
3783c2aa98e2SPeter WemmconfMAX_MESSAGE_SIZE	MaxMessageSize	[infinite] The maximum size of messages
3784c2aa98e2SPeter Wemm					that will be accepted (in bytes).
3785c2aa98e2SPeter WemmconfBLANK_SUB		BlankSub	[.] Blank (space) substitution
3786c2aa98e2SPeter Wemm					character.
3787c2aa98e2SPeter WemmconfCON_EXPENSIVE	HoldExpensive	[False] Avoid connecting immediately
378806f25ae9SGregory Neil Shapiro					to mailers marked expensive.
3789c2aa98e2SPeter WemmconfCHECKPOINT_INTERVAL	CheckpointInterval
3790c2aa98e2SPeter Wemm					[10] Checkpoint queue files every N
3791c2aa98e2SPeter Wemm					recipients.
3792c2aa98e2SPeter WemmconfDELIVERY_MODE	DeliveryMode	[background] Default delivery mode.
3793c2aa98e2SPeter WemmconfERROR_MODE		ErrorMode	[print] Error message mode.
3794c2aa98e2SPeter WemmconfERROR_MESSAGE	ErrorHeader	[undefined] Error message header/file.
3795065a643dSPeter WemmconfSAVE_FROM_LINES	SaveFromLine	Save extra leading From_ lines.
3796c2aa98e2SPeter WemmconfTEMP_FILE_MODE	TempFileMode	[0600] Temporary file mode.
3797c2aa98e2SPeter WemmconfMATCH_GECOS		MatchGECOS	[False] Match GECOS field.
3798c2aa98e2SPeter WemmconfMAX_HOP		MaxHopCount	[25] Maximum hop count.
379906f25ae9SGregory Neil ShapiroconfIGNORE_DOTS*	IgnoreDots	[False; always False in -bs or -bd
380006f25ae9SGregory Neil Shapiro					mode] Ignore dot as terminator for
380106f25ae9SGregory Neil Shapiro					incoming messages?
3802c2aa98e2SPeter WemmconfBIND_OPTS		ResolverOptions	[undefined] Default options for DNS
3803c2aa98e2SPeter Wemm					resolver.
3804c2aa98e2SPeter WemmconfMIME_FORMAT_ERRORS*	SendMimeErrors	[True] Send error messages as MIME-
3805c2aa98e2SPeter Wemm					encapsulated messages per RFC 1344.
3806c2aa98e2SPeter WemmconfFORWARD_PATH	ForwardPath	[$z/.forward.$w:$z/.forward]
3807c2aa98e2SPeter Wemm					The colon-separated list of places to
3808c2aa98e2SPeter Wemm					search for .forward files.  N.B.: see
3809c2aa98e2SPeter Wemm					the Security Notes section.
3810c2aa98e2SPeter WemmconfMCI_CACHE_SIZE	ConnectionCacheSize
3811c2aa98e2SPeter Wemm					[2] Size of open connection cache.
3812c2aa98e2SPeter WemmconfMCI_CACHE_TIMEOUT	ConnectionCacheTimeout
3813c2aa98e2SPeter Wemm					[5m] Open connection cache timeout.
3814c2aa98e2SPeter WemmconfHOST_STATUS_DIRECTORY HostStatusDirectory
3815c2aa98e2SPeter Wemm					[undefined] If set, host status is kept
3816c2aa98e2SPeter Wemm					on disk between sendmail runs in the
3817c2aa98e2SPeter Wemm					named directory tree.  This need not be
3818c2aa98e2SPeter Wemm					a full pathname, in which case it is
3819c2aa98e2SPeter Wemm					interpreted relative to the queue
3820c2aa98e2SPeter Wemm					directory.
3821c2aa98e2SPeter WemmconfSINGLE_THREAD_DELIVERY  SingleThreadDelivery
3822c2aa98e2SPeter Wemm					[False] If this option and the
3823c2aa98e2SPeter Wemm					HostStatusDirectory option are both
3824c2aa98e2SPeter Wemm					set, single thread deliveries to other
3825c2aa98e2SPeter Wemm					hosts.  That is, don't allow any two
3826c2aa98e2SPeter Wemm					sendmails on this host to connect
3827c2aa98e2SPeter Wemm					simultaneously to any other single
3828c2aa98e2SPeter Wemm					host.  This can slow down delivery in
3829c2aa98e2SPeter Wemm					some cases, in particular since a
3830c2aa98e2SPeter Wemm					cached but otherwise idle connection
3831c2aa98e2SPeter Wemm					to a host will prevent other sendmails
3832c2aa98e2SPeter Wemm					from connecting to the other host.
3833da7d7b9cSGregory Neil ShapiroconfUSE_COMPRESSED_IPV6_ADDRESSES
3834da7d7b9cSGregory Neil Shapiro			UseCompressedIPv6Addresses
3835da7d7b9cSGregory Neil Shapiro					[undefined] If set, use the compressed
3836da7d7b9cSGregory Neil Shapiro					form of IPv6 addresses, such as
3837da7d7b9cSGregory Neil Shapiro					IPV6:::1, instead of the uncompressed
3838da7d7b9cSGregory Neil Shapiro					form, such as IPv6:0:0:0:0:0:0:0:1.
383906f25ae9SGregory Neil ShapiroconfUSE_ERRORS_TO*	UseErrorsTo	[False] Use the Errors-To: header to
3840c2aa98e2SPeter Wemm					deliver error messages.  This should
3841c2aa98e2SPeter Wemm					not be necessary because of general
3842c2aa98e2SPeter Wemm					acceptance of the envelope/header
3843c2aa98e2SPeter Wemm					distinction.
3844c2aa98e2SPeter WemmconfLOG_LEVEL		LogLevel	[9] Log level.
384506f25ae9SGregory Neil ShapiroconfME_TOO		MeToo		[True] Include sender in group
384606f25ae9SGregory Neil Shapiro					expansions.  This option is
384706f25ae9SGregory Neil Shapiro					deprecated and will be removed from
384806f25ae9SGregory Neil Shapiro					a future version.
3849c2aa98e2SPeter WemmconfCHECK_ALIASES	CheckAliases	[False] Check RHS of aliases when
3850c2aa98e2SPeter Wemm					running newaliases.  Since this does
3851c2aa98e2SPeter Wemm					DNS lookups on every address, it can
3852c2aa98e2SPeter Wemm					slow down the alias rebuild process
3853c2aa98e2SPeter Wemm					considerably on large alias files.
3854c2aa98e2SPeter WemmconfOLD_STYLE_HEADERS*	OldStyleHeaders	[True] Assume that headers without
3855c2aa98e2SPeter Wemm					special chars are old style.
3856c2aa98e2SPeter WemmconfPRIVACY_FLAGS	PrivacyOptions	[authwarnings] Privacy flags.
3857c2aa98e2SPeter WemmconfCOPY_ERRORS_TO	PostmasterCopy	[undefined] Address for additional
3858c2aa98e2SPeter Wemm					copies of all error messages.
3859c2aa98e2SPeter WemmconfQUEUE_FACTOR	QueueFactor	[600000] Slope of queue-only function.
386040266059SGregory Neil ShapiroconfQUEUE_FILE_MODE	QueueFileMode	[undefined] Default permissions for
386140266059SGregory Neil Shapiro					queue files (octal).  If not set,
386240266059SGregory Neil Shapiro					sendmail uses 0600 unless its real
386340266059SGregory Neil Shapiro					and effective uid are different in
386440266059SGregory Neil Shapiro					which case it uses 0644.
3865c2aa98e2SPeter WemmconfDONT_PRUNE_ROUTES	DontPruneRoutes	[False] Don't prune down route-addr
3866c2aa98e2SPeter Wemm					syntax addresses to the minimum
3867c2aa98e2SPeter Wemm					possible.
3868c2aa98e2SPeter WemmconfSAFE_QUEUE*		SuperSafe	[True] Commit all messages to disk
3869c2aa98e2SPeter Wemm					before forking.
3870c2aa98e2SPeter WemmconfTO_INITIAL		Timeout.initial	[5m] The timeout waiting for a response
3871c2aa98e2SPeter Wemm					on the initial connect.
3872c2aa98e2SPeter WemmconfTO_CONNECT		Timeout.connect	[0] The timeout waiting for an initial
3873c2aa98e2SPeter Wemm					connect() to complete.  This can only
3874c2aa98e2SPeter Wemm					shorten connection timeouts; the kernel
3875c2aa98e2SPeter Wemm					silently enforces an absolute maximum
3876c2aa98e2SPeter Wemm					(which varies depending on the system).
3877c2aa98e2SPeter WemmconfTO_ICONNECT		Timeout.iconnect
3878c2aa98e2SPeter Wemm					[undefined] Like Timeout.connect, but
3879c2aa98e2SPeter Wemm					applies only to the very first attempt
3880c2aa98e2SPeter Wemm					to connect to a host in a message.
3881c2aa98e2SPeter Wemm					This allows a single very fast pass
3882c2aa98e2SPeter Wemm					followed by more careful delivery
3883c2aa98e2SPeter Wemm					attempts in the future.
388440266059SGregory Neil ShapiroconfTO_ACONNECT		Timeout.aconnect
388540266059SGregory Neil Shapiro					[0] The overall timeout waiting for
388640266059SGregory Neil Shapiro					all connection for a single delivery
388740266059SGregory Neil Shapiro					attempt to succeed.  If 0, no overall
388840266059SGregory Neil Shapiro					limit is applied.
3889c2aa98e2SPeter WemmconfTO_HELO		Timeout.helo	[5m] The timeout waiting for a response
3890c2aa98e2SPeter Wemm					to a HELO or EHLO command.
3891c2aa98e2SPeter WemmconfTO_MAIL		Timeout.mail	[10m] The timeout waiting for a
3892c2aa98e2SPeter Wemm					response to the MAIL command.
3893c2aa98e2SPeter WemmconfTO_RCPT		Timeout.rcpt	[1h] The timeout waiting for a response
3894c2aa98e2SPeter Wemm					to the RCPT command.
3895c2aa98e2SPeter WemmconfTO_DATAINIT		Timeout.datainit
3896c2aa98e2SPeter Wemm					[5m] The timeout waiting for a 354
3897c2aa98e2SPeter Wemm					response from the DATA command.
3898c2aa98e2SPeter WemmconfTO_DATABLOCK	Timeout.datablock
3899c2aa98e2SPeter Wemm					[1h] The timeout waiting for a block
3900c2aa98e2SPeter Wemm					during DATA phase.
3901c2aa98e2SPeter WemmconfTO_DATAFINAL	Timeout.datafinal
3902c2aa98e2SPeter Wemm					[1h] The timeout waiting for a response
3903c2aa98e2SPeter Wemm					to the final "." that terminates a
3904c2aa98e2SPeter Wemm					message.
3905c2aa98e2SPeter WemmconfTO_RSET		Timeout.rset	[5m] The timeout waiting for a response
3906c2aa98e2SPeter Wemm					to the RSET command.
3907c2aa98e2SPeter WemmconfTO_QUIT		Timeout.quit	[2m] The timeout waiting for a response
3908c2aa98e2SPeter Wemm					to the QUIT command.
3909c2aa98e2SPeter WemmconfTO_MISC		Timeout.misc	[2m] The timeout waiting for a response
3910c2aa98e2SPeter Wemm					to other SMTP commands.
391106f25ae9SGregory Neil ShapiroconfTO_COMMAND		Timeout.command	[1h] In server SMTP, the timeout
391206f25ae9SGregory Neil Shapiro					waiting	for a command to be issued.
391306f25ae9SGregory Neil ShapiroconfTO_IDENT		Timeout.ident	[5s] The timeout waiting for a
391406f25ae9SGregory Neil Shapiro					response to an IDENT query.
3915c2aa98e2SPeter WemmconfTO_FILEOPEN		Timeout.fileopen
3916c2aa98e2SPeter Wemm					[60s] The timeout waiting for a file
3917c2aa98e2SPeter Wemm					(e.g., :include: file) to be opened.
391840266059SGregory Neil ShapiroconfTO_LHLO		Timeout.lhlo	[2m] The timeout waiting for a response
391940266059SGregory Neil Shapiro					to an LMTP LHLO command.
392040266059SGregory Neil ShapiroconfTO_AUTH		Timeout.auth	[10m] The timeout waiting for a
392140266059SGregory Neil Shapiro					response in an AUTH dialogue.
392240266059SGregory Neil ShapiroconfTO_STARTTLS		Timeout.starttls
392340266059SGregory Neil Shapiro					[1h] The timeout waiting for a
392440266059SGregory Neil Shapiro					response to an SMTP STARTTLS command.
392506f25ae9SGregory Neil ShapiroconfTO_CONTROL		Timeout.control
392606f25ae9SGregory Neil Shapiro					[2m] The timeout for a complete
392706f25ae9SGregory Neil Shapiro					control socket transaction to complete.
3928c2aa98e2SPeter WemmconfTO_QUEUERETURN	Timeout.queuereturn
3929c2aa98e2SPeter Wemm					[5d] The timeout before a message is
3930c2aa98e2SPeter Wemm					returned as undeliverable.
3931c2aa98e2SPeter WemmconfTO_QUEUERETURN_NORMAL
3932c2aa98e2SPeter Wemm			Timeout.queuereturn.normal
3933c2aa98e2SPeter Wemm					[undefined] As above, for normal
3934c2aa98e2SPeter Wemm					priority messages.
3935c2aa98e2SPeter WemmconfTO_QUEUERETURN_URGENT
3936c2aa98e2SPeter Wemm			Timeout.queuereturn.urgent
3937c2aa98e2SPeter Wemm					[undefined] As above, for urgent
3938c2aa98e2SPeter Wemm					priority messages.
3939c2aa98e2SPeter WemmconfTO_QUEUERETURN_NONURGENT
3940c2aa98e2SPeter Wemm			Timeout.queuereturn.non-urgent
3941c2aa98e2SPeter Wemm					[undefined] As above, for non-urgent
3942c2aa98e2SPeter Wemm					(low) priority messages.
3943e92d3f3fSGregory Neil ShapiroconfTO_QUEUERETURN_DSN
3944e92d3f3fSGregory Neil Shapiro			Timeout.queuereturn.dsn
3945e92d3f3fSGregory Neil Shapiro					[undefined] As above, for delivery
3946e92d3f3fSGregory Neil Shapiro					status notification messages.
3947c2aa98e2SPeter WemmconfTO_QUEUEWARN	Timeout.queuewarn
3948c2aa98e2SPeter Wemm					[4h] The timeout before a warning
3949c2aa98e2SPeter Wemm					message is sent to the sender telling
395006f25ae9SGregory Neil Shapiro					them that the message has been
395106f25ae9SGregory Neil Shapiro					deferred.
3952c2aa98e2SPeter WemmconfTO_QUEUEWARN_NORMAL	Timeout.queuewarn.normal
3953c2aa98e2SPeter Wemm					[undefined] As above, for normal
3954c2aa98e2SPeter Wemm					priority messages.
3955c2aa98e2SPeter WemmconfTO_QUEUEWARN_URGENT	Timeout.queuewarn.urgent
3956c2aa98e2SPeter Wemm					[undefined] As above, for urgent
3957c2aa98e2SPeter Wemm					priority messages.
3958c2aa98e2SPeter WemmconfTO_QUEUEWARN_NONURGENT
3959c2aa98e2SPeter Wemm			Timeout.queuewarn.non-urgent
3960c2aa98e2SPeter Wemm					[undefined] As above, for non-urgent
3961c2aa98e2SPeter Wemm					(low) priority messages.
3962e92d3f3fSGregory Neil ShapiroconfTO_QUEUEWARN_DSN
3963e92d3f3fSGregory Neil Shapiro			Timeout.queuewarn.dsn
3964e92d3f3fSGregory Neil Shapiro					[undefined] As above, for delivery
3965e92d3f3fSGregory Neil Shapiro					status notification messages.
3966c2aa98e2SPeter WemmconfTO_HOSTSTATUS	Timeout.hoststatus
3967c2aa98e2SPeter Wemm					[30m] How long information about host
3968c2aa98e2SPeter Wemm					statuses will be maintained before it
3969c2aa98e2SPeter Wemm					is considered stale and the host should
3970c2aa98e2SPeter Wemm					be retried.  This applies both within
3971c2aa98e2SPeter Wemm					a single queue run and to persistent
3972c2aa98e2SPeter Wemm					information (see below).
397306f25ae9SGregory Neil ShapiroconfTO_RESOLVER_RETRANS	Timeout.resolver.retrans
397406f25ae9SGregory Neil Shapiro					[varies] Sets the resolver's
397594c01205SGregory Neil Shapiro					retransmission time interval (in
397606f25ae9SGregory Neil Shapiro					seconds).  Sets both
397706f25ae9SGregory Neil Shapiro					Timeout.resolver.retrans.first and
397806f25ae9SGregory Neil Shapiro					Timeout.resolver.retrans.normal.
397906f25ae9SGregory Neil ShapiroconfTO_RESOLVER_RETRANS_FIRST  Timeout.resolver.retrans.first
398006f25ae9SGregory Neil Shapiro					[varies] Sets the resolver's
398194c01205SGregory Neil Shapiro					retransmission time interval (in
398206f25ae9SGregory Neil Shapiro					seconds) for the first attempt to
398306f25ae9SGregory Neil Shapiro					deliver a message.
398406f25ae9SGregory Neil ShapiroconfTO_RESOLVER_RETRANS_NORMAL  Timeout.resolver.retrans.normal
398506f25ae9SGregory Neil Shapiro					[varies] Sets the resolver's
398694c01205SGregory Neil Shapiro					retransmission time interval (in
398706f25ae9SGregory Neil Shapiro					seconds) for all resolver lookups
398806f25ae9SGregory Neil Shapiro					except the first delivery attempt.
398906f25ae9SGregory Neil ShapiroconfTO_RESOLVER_RETRY	Timeout.resolver.retry
399006f25ae9SGregory Neil Shapiro					[varies] Sets the number of times
399106f25ae9SGregory Neil Shapiro					to retransmit a resolver query.
399206f25ae9SGregory Neil Shapiro					Sets both
399306f25ae9SGregory Neil Shapiro					Timeout.resolver.retry.first and
399406f25ae9SGregory Neil Shapiro					Timeout.resolver.retry.normal.
399506f25ae9SGregory Neil ShapiroconfTO_RESOLVER_RETRY_FIRST  Timeout.resolver.retry.first
399606f25ae9SGregory Neil Shapiro					[varies] Sets the number of times
399706f25ae9SGregory Neil Shapiro					to retransmit a resolver query for
399806f25ae9SGregory Neil Shapiro					the first attempt to deliver a
399906f25ae9SGregory Neil Shapiro					message.
400006f25ae9SGregory Neil ShapiroconfTO_RESOLVER_RETRY_NORMAL  Timeout.resolver.retry.normal
400106f25ae9SGregory Neil Shapiro					[varies] Sets the number of times
400206f25ae9SGregory Neil Shapiro					to retransmit a resolver query for
400306f25ae9SGregory Neil Shapiro					all resolver lookups except the
400406f25ae9SGregory Neil Shapiro					first delivery attempt.
4005c2aa98e2SPeter WemmconfTIME_ZONE		TimeZoneSpec	[USE_SYSTEM] Time zone info -- can be
4006c2aa98e2SPeter Wemm					USE_SYSTEM to use the system's idea,
4007c2aa98e2SPeter Wemm					USE_TZ to use the user's TZ envariable,
4008c2aa98e2SPeter Wemm					or something else to force that value.
4009c2aa98e2SPeter WemmconfDEF_USER_ID		DefaultUser	[1:1] Default user id.
4010c2aa98e2SPeter WemmconfUSERDB_SPEC		UserDatabaseSpec
401106f25ae9SGregory Neil Shapiro					[undefined] User database
401206f25ae9SGregory Neil Shapiro					specification.
4013c2aa98e2SPeter WemmconfFALLBACK_MX		FallbackMXhost	[undefined] Fallback MX host.
4014e92d3f3fSGregory Neil ShapiroconfFALLBACK_SMARTHOST	FallbackSmartHost
4015e92d3f3fSGregory Neil Shapiro					[undefined] Fallback smart host.
4016*5b0945b5SGregory Neil ShapiroconfTLS_FALLBACK_TO_CLEAR	TLSFallbacktoClear
4017*5b0945b5SGregory Neil Shapiro					[undefined] If set, immediately try
4018*5b0945b5SGregory Neil Shapiro					a connection again without STARTTLS
4019*5b0945b5SGregory Neil Shapiro					after a TLS handshake failure.
402006f25ae9SGregory Neil ShapiroconfTRY_NULL_MX_LIST	TryNullMXList	[False] If this host is the best MX
402106f25ae9SGregory Neil Shapiro					for a host and other arrangements
402206f25ae9SGregory Neil Shapiro					haven't been made, try connecting
402306f25ae9SGregory Neil Shapiro					to the host directly; normally this
402406f25ae9SGregory Neil Shapiro					would be a config error.
402506f25ae9SGregory Neil ShapiroconfQUEUE_LA		QueueLA		[varies] Load average at which
402606f25ae9SGregory Neil Shapiro					queue-only function kicks in.
402706f25ae9SGregory Neil Shapiro					Default values is (8 * numproc)
402806f25ae9SGregory Neil Shapiro					where numproc is the number of
402906f25ae9SGregory Neil Shapiro					processors online (if that can be
403006f25ae9SGregory Neil Shapiro					determined).
403106f25ae9SGregory Neil ShapiroconfREFUSE_LA		RefuseLA	[varies] Load average at which
403206f25ae9SGregory Neil Shapiro					incoming SMTP connections are
403306f25ae9SGregory Neil Shapiro					refused.  Default values is (12 *
403406f25ae9SGregory Neil Shapiro					numproc) where numproc is the
403506f25ae9SGregory Neil Shapiro					number of processors online (if
403606f25ae9SGregory Neil Shapiro					that can be determined).
4037e92d3f3fSGregory Neil ShapiroconfREJECT_LOG_INTERVAL	RejectLogInterval	[3h] Log interval when
4038e92d3f3fSGregory Neil Shapiro					refusing connections for this long.
403940266059SGregory Neil ShapiroconfDELAY_LA		DelayLA		[0] Load average at which sendmail
404040266059SGregory Neil Shapiro					will sleep for one second on most
404140266059SGregory Neil Shapiro					SMTP commands and before accepting
404240266059SGregory Neil Shapiro					connections.  0 means no limit.
404306f25ae9SGregory Neil ShapiroconfMAX_ALIAS_RECURSION	MaxAliasRecursion
404406f25ae9SGregory Neil Shapiro					[10] Maximum depth of alias recursion.
4045c2aa98e2SPeter WemmconfMAX_DAEMON_CHILDREN	MaxDaemonChildren
4046c2aa98e2SPeter Wemm					[undefined] The maximum number of
4047c2aa98e2SPeter Wemm					children the daemon will permit.  After
4048c2aa98e2SPeter Wemm					this number, connections will be
4049c2aa98e2SPeter Wemm					rejected.  If not set or <= 0, there is
4050c2aa98e2SPeter Wemm					no limit.
405106f25ae9SGregory Neil ShapiroconfMAX_HEADERS_LENGTH	MaxHeadersLength
4052193538b7SGregory Neil Shapiro					[32768] Maximum length of the sum
405306f25ae9SGregory Neil Shapiro					of all headers.
405406f25ae9SGregory Neil ShapiroconfMAX_MIME_HEADER_LENGTH  MaxMimeHeaderLength
405506f25ae9SGregory Neil Shapiro					[undefined] Maximum length of
405606f25ae9SGregory Neil Shapiro					certain MIME header field values.
4057c2aa98e2SPeter WemmconfCONNECTION_RATE_THROTTLE ConnectionRateThrottle
4058c2aa98e2SPeter Wemm					[undefined] The maximum number of
405940266059SGregory Neil Shapiro					connections permitted per second per
406040266059SGregory Neil Shapiro					daemon.  After this many connections
406140266059SGregory Neil Shapiro					are accepted, further connections
406240266059SGregory Neil Shapiro					will be delayed.  If not set or <= 0,
406340266059SGregory Neil Shapiro					there is no limit.
4064e92d3f3fSGregory Neil ShapiroconfCONNECTION_RATE_WINDOW_SIZE ConnectionRateWindowSize
4065e92d3f3fSGregory Neil Shapiro					[60s] Define the length of the
4066e92d3f3fSGregory Neil Shapiro					interval for which the number of
4067e92d3f3fSGregory Neil Shapiro					incoming connections is maintained.
4068c2aa98e2SPeter WemmconfWORK_RECIPIENT_FACTOR
4069c2aa98e2SPeter Wemm			RecipientFactor	[30000] Cost of each recipient.
407006f25ae9SGregory Neil ShapiroconfSEPARATE_PROC	ForkEachJob	[False] Run all deliveries in a
407106f25ae9SGregory Neil Shapiro					separate process.
4072c2aa98e2SPeter WemmconfWORK_CLASS_FACTOR	ClassFactor	[1800] Priority multiplier for class.
4073c2aa98e2SPeter WemmconfWORK_TIME_FACTOR	RetryFactor	[90000] Cost of each delivery attempt.
4074c2aa98e2SPeter WemmconfQUEUE_SORT_ORDER	QueueSortOrder	[Priority] Queue sort algorithm:
407540266059SGregory Neil Shapiro					Priority, Host, Filename, Random,
407640266059SGregory Neil Shapiro					Modification, or Time.
4077da7d7b9cSGregory Neil ShapiroconfMAX_QUEUE_AGE	MaxQueueAge	[undefined] If set to a value greater
4078da7d7b9cSGregory Neil Shapiro					than zero, entries in the queue
4079da7d7b9cSGregory Neil Shapiro					will be retried during a queue run
4080da7d7b9cSGregory Neil Shapiro					only if the individual retry time
4081da7d7b9cSGregory Neil Shapiro					has been reached which is doubled
4082da7d7b9cSGregory Neil Shapiro					for each attempt.  The maximum retry
4083da7d7b9cSGregory Neil Shapiro					time is limited by the specified value.
4084c2aa98e2SPeter WemmconfMIN_QUEUE_AGE	MinQueueAge	[0] The minimum amount of time a job
4085c2aa98e2SPeter Wemm					must sit in the queue between queue
4086c2aa98e2SPeter Wemm					runs.  This allows you to set the
4087c2aa98e2SPeter Wemm					queue run interval low for better
4088c2aa98e2SPeter Wemm					responsiveness without trying all
4089c2aa98e2SPeter Wemm					jobs in each run.
4090c2aa98e2SPeter WemmconfDEF_CHAR_SET	DefaultCharSet	[unknown-8bit] When converting
4091c2aa98e2SPeter Wemm					unlabeled 8 bit input to MIME, the
4092c2aa98e2SPeter Wemm					character set to use by default.
4093c2aa98e2SPeter WemmconfSERVICE_SWITCH_FILE	ServiceSwitchFile
409406f25ae9SGregory Neil Shapiro					[/etc/mail/service.switch] The file
409506f25ae9SGregory Neil Shapiro					to use for the service switch on
409606f25ae9SGregory Neil Shapiro					systems that do not have a
409706f25ae9SGregory Neil Shapiro					system-defined switch.
4098c2aa98e2SPeter WemmconfHOSTS_FILE		HostsFile	[/etc/hosts] The file to use when doing
4099c2aa98e2SPeter Wemm					"file" type access of hosts names.
4100c2aa98e2SPeter WemmconfDIAL_DELAY		DialDelay	[0s] If a connection fails, wait this
4101c2aa98e2SPeter Wemm					long and try again.  Zero means "don't
4102c2aa98e2SPeter Wemm					retry".  This is to allow "dial on
4103c2aa98e2SPeter Wemm					demand" connections to have enough time
4104c2aa98e2SPeter Wemm					to complete a connection.
4105c2aa98e2SPeter WemmconfNO_RCPT_ACTION	NoRecipientAction
4106c2aa98e2SPeter Wemm					[none] What to do if there are no legal
4107c2aa98e2SPeter Wemm					recipient fields (To:, Cc: or Bcc:)
4108c2aa98e2SPeter Wemm					in the message.  Legal values can
4109c2aa98e2SPeter Wemm					be "none" to just leave the
4110c2aa98e2SPeter Wemm					nonconforming message as is, "add-to"
4111c2aa98e2SPeter Wemm					to add a To: header with all the
4112c2aa98e2SPeter Wemm					known recipients (which may expose
4113c2aa98e2SPeter Wemm					blind recipients), "add-apparently-to"
4114c2aa98e2SPeter Wemm					to do the same but use Apparently-To:
411540266059SGregory Neil Shapiro					instead of To: (strongly discouraged
411640266059SGregory Neil Shapiro					in accordance with IETF standards),
411740266059SGregory Neil Shapiro					"add-bcc" to add an empty Bcc:
411840266059SGregory Neil Shapiro					header, or "add-to-undisclosed" to
411940266059SGregory Neil Shapiro					add the header
4120c2aa98e2SPeter Wemm					``To: undisclosed-recipients:;''.
4121c2aa98e2SPeter WemmconfSAFE_FILE_ENV	SafeFileEnvironment
4122c2aa98e2SPeter Wemm					[undefined] If set, sendmail will do a
4123c2aa98e2SPeter Wemm					chroot() into this directory before
4124c2aa98e2SPeter Wemm					writing files.
4125c2aa98e2SPeter WemmconfCOLON_OK_IN_ADDR	ColonOkInAddr	[True unless Configuration Level > 6]
4126c2aa98e2SPeter Wemm					If set, colons are treated as a regular
4127c2aa98e2SPeter Wemm					character in addresses.  If not set,
4128c2aa98e2SPeter Wemm					they are treated as the introducer to
4129c2aa98e2SPeter Wemm					the RFC 822 "group" syntax.  Colons are
4130c2aa98e2SPeter Wemm					handled properly in route-addrs.  This
4131c2aa98e2SPeter Wemm					option defaults on for V5 and lower
4132c2aa98e2SPeter Wemm					configuration files.
4133c2aa98e2SPeter WemmconfMAX_QUEUE_RUN_SIZE	MaxQueueRunSize	[0] If set, limit the maximum size of
4134c2aa98e2SPeter Wemm					any given queue run to this number of
4135c2aa98e2SPeter Wemm					entries.  Essentially, this will stop
413606f25ae9SGregory Neil Shapiro					reading each queue directory after this
4137c2aa98e2SPeter Wemm					number of entries are reached; it does
4138c2aa98e2SPeter Wemm					_not_ pick the highest priority jobs,
4139c2aa98e2SPeter Wemm					so this should be as large as your
4140c2aa98e2SPeter Wemm					system can tolerate.  If not set, there
4141c2aa98e2SPeter Wemm					is no limit.
414240266059SGregory Neil ShapiroconfMAX_QUEUE_CHILDREN	MaxQueueChildren
414340266059SGregory Neil Shapiro					[undefined] Limits the maximum number
414440266059SGregory Neil Shapiro					of concurrent queue runners active.
414540266059SGregory Neil Shapiro					This is to keep system resources used
414640266059SGregory Neil Shapiro					within a reasonable limit.  Relates to
4147e92d3f3fSGregory Neil Shapiro					Queue Groups and ForkEachJob.
414840266059SGregory Neil ShapiroconfMAX_RUNNERS_PER_QUEUE	MaxRunnersPerQueue
414940266059SGregory Neil Shapiro					[1] Only active when MaxQueueChildren
415040266059SGregory Neil Shapiro					defined.  Controls the maximum number
415140266059SGregory Neil Shapiro					of queue runners (aka queue children)
415240266059SGregory Neil Shapiro					active at the same time in a work
415340266059SGregory Neil Shapiro					group.  See also MaxQueueChildren.
4154c2aa98e2SPeter WemmconfDONT_EXPAND_CNAMES	DontExpandCnames
4155c2aa98e2SPeter Wemm					[False] If set, $[ ... $] lookups that
4156c2aa98e2SPeter Wemm					do DNS based lookups do not expand
4157c2aa98e2SPeter Wemm					CNAME records.  This currently violates
4158c2aa98e2SPeter Wemm					the published standards, but the IETF
4159c2aa98e2SPeter Wemm					seems to be moving toward legalizing
4160c2aa98e2SPeter Wemm					this.  For example, if "FTP.Foo.ORG"
4161c2aa98e2SPeter Wemm					is a CNAME for "Cruft.Foo.ORG", then
4162c2aa98e2SPeter Wemm					with this option set a lookup of
4163c2aa98e2SPeter Wemm					"FTP" will return "FTP.Foo.ORG"; if
4164c2aa98e2SPeter Wemm					clear it returns "Cruft.FOO.ORG".  N.B.
4165c2aa98e2SPeter Wemm					you may not see any effect until your
4166c2aa98e2SPeter Wemm					downstream neighbors stop doing CNAME
4167c2aa98e2SPeter Wemm					lookups as well.
4168c2aa98e2SPeter WemmconfFROM_LINE		UnixFromLine	[From $g $d] The From_ line used
4169c2aa98e2SPeter Wemm					when sending to files or programs.
4170c2aa98e2SPeter WemmconfSINGLE_LINE_FROM_HEADER  SingleLineFromHeader
4171c2aa98e2SPeter Wemm					[False] From: lines that have
4172c2aa98e2SPeter Wemm					embedded newlines are unwrapped
4173c2aa98e2SPeter Wemm					onto one line.
4174c2aa98e2SPeter WemmconfALLOW_BOGUS_HELO	AllowBogusHELO	[False] Allow HELO SMTP command that
4175c2aa98e2SPeter Wemm					does not include a host name.
4176c2aa98e2SPeter WemmconfMUST_QUOTE_CHARS	MustQuoteChars	[.'] Characters to be quoted in a full
4177c2aa98e2SPeter Wemm					name phrase (@,;:\()[] are automatic).
4178c2aa98e2SPeter WemmconfOPERATORS		OperatorChars	[.:%@!^/[]+] Address operator
4179c2aa98e2SPeter Wemm					characters.
4180c2aa98e2SPeter WemmconfSMTP_LOGIN_MSG	SmtpGreetingMessage
4181c2aa98e2SPeter Wemm					[$j Sendmail $v/$Z; $b]
4182c2aa98e2SPeter Wemm					The initial (spontaneous) SMTP
4183c2aa98e2SPeter Wemm					greeting message.  The word "ESMTP"
4184c2aa98e2SPeter Wemm					will be inserted between the first and
4185c2aa98e2SPeter Wemm					second words to convince other
4186c2aa98e2SPeter Wemm					sendmails to try to speak ESMTP.
4187c2aa98e2SPeter WemmconfDONT_INIT_GROUPS	DontInitGroups	[False] If set, the initgroups(3)
4188c2aa98e2SPeter Wemm					routine will never be invoked.  You
4189c2aa98e2SPeter Wemm					might want to do this if you are
4190c2aa98e2SPeter Wemm					running NIS and you have a large group
4191c2aa98e2SPeter Wemm					map, since this call does a sequential
4192c2aa98e2SPeter Wemm					scan of the map; in a large site this
4193c2aa98e2SPeter Wemm					can cause your ypserv to run
4194c2aa98e2SPeter Wemm					essentially full time.  If you set
4195c2aa98e2SPeter Wemm					this, agents run on behalf of users
4196c2aa98e2SPeter Wemm					will only have their primary
4197c2aa98e2SPeter Wemm					(/etc/passwd) group permissions.
4198c2aa98e2SPeter WemmconfUNSAFE_GROUP_WRITES	UnsafeGroupWrites
41994e4196cbSGregory Neil Shapiro					[True] If set, group-writable
4200c2aa98e2SPeter Wemm					:include: and .forward files are
4201c2aa98e2SPeter Wemm					considered "unsafe", that is, programs
4202c2aa98e2SPeter Wemm					and files cannot be directly referenced
4203c2aa98e2SPeter Wemm					from such files.  World-writable files
4204c2aa98e2SPeter Wemm					are always considered unsafe.
42054e4196cbSGregory Neil Shapiro					Notice: this option is deprecated and
42064e4196cbSGregory Neil Shapiro					will be removed in future versions;
42074e4196cbSGregory Neil Shapiro					Set GroupWritableForwardFileSafe
42084e4196cbSGregory Neil Shapiro					and GroupWritableIncludeFileSafe in
42094e4196cbSGregory Neil Shapiro					DontBlameSendmail if required.
421006f25ae9SGregory Neil ShapiroconfCONNECT_ONLY_TO	ConnectOnlyTo	[undefined] override connection
421106f25ae9SGregory Neil Shapiro					address (for testing).
421206f25ae9SGregory Neil ShapiroconfCONTROL_SOCKET_NAME	ControlSocketName
421306f25ae9SGregory Neil Shapiro					[undefined] Control socket for daemon
421406f25ae9SGregory Neil Shapiro					management.
4215c2aa98e2SPeter WemmconfDOUBLE_BOUNCE_ADDRESS  DoubleBounceAddress
4216c2aa98e2SPeter Wemm					[postmaster] If an error occurs when
4217c2aa98e2SPeter Wemm					sending an error message, send that
4218c2aa98e2SPeter Wemm					"double bounce" error message to this
421940266059SGregory Neil Shapiro					address.  If it expands to an empty
422040266059SGregory Neil Shapiro					string, double bounces are dropped.
4221d0cef73dSGregory Neil ShapiroconfSOFT_BOUNCE		SoftBounce	[False] If set, issue temporary errors
4222d0cef73dSGregory Neil Shapiro					(4xy) instead of permanent errors
4223d0cef73dSGregory Neil Shapiro					(5xy).  This can be useful during
4224d0cef73dSGregory Neil Shapiro					testing of a new configuration to
4225d0cef73dSGregory Neil Shapiro					avoid erroneous bouncing of mails.
422606f25ae9SGregory Neil ShapiroconfDEAD_LETTER_DROP	DeadLetterDrop	[undefined] Filename to save bounce
422706f25ae9SGregory Neil Shapiro					messages which could not be returned
422806f25ae9SGregory Neil Shapiro					to the user or sent to postmaster.
422906f25ae9SGregory Neil Shapiro					If not set, the queue file will
423006f25ae9SGregory Neil Shapiro					be renamed.
423106f25ae9SGregory Neil ShapiroconfRRT_IMPLIES_DSN	RrtImpliesDsn	[False] Return-Receipt-To: header
423206f25ae9SGregory Neil Shapiro					implies DSN request.
4233c2aa98e2SPeter WemmconfRUN_AS_USER		RunAsUser	[undefined] If set, become this user
4234c2aa98e2SPeter Wemm					when reading and delivering mail.
4235c2aa98e2SPeter Wemm					Causes all file reads (e.g., .forward
4236c2aa98e2SPeter Wemm					and :include: files) to be done as
4237c2aa98e2SPeter Wemm					this user.  Also, all programs will
4238c2aa98e2SPeter Wemm					be run as this user, and all output
4239c2aa98e2SPeter Wemm					files will be written as this user.
4240c2aa98e2SPeter WemmconfMAX_RCPTS_PER_MESSAGE  MaxRecipientsPerMessage
4241c2aa98e2SPeter Wemm					[infinite] If set, allow no more than
4242c2aa98e2SPeter Wemm					the specified number of recipients in
4243c2aa98e2SPeter Wemm					an SMTP envelope.  Further recipients
4244c2aa98e2SPeter Wemm					receive a 452 error code (i.e., they
4245c2aa98e2SPeter Wemm					are deferred for the next delivery
4246c2aa98e2SPeter Wemm					attempt).
4247323f6dcbSGregory Neil ShapiroconfBAD_RCPT_THROTTLE	BadRcptThrottle	[infinite] If set and the specified
4248323f6dcbSGregory Neil Shapiro					number of recipients in a single SMTP
4249323f6dcbSGregory Neil Shapiro					transaction have been rejected, sleep
4250323f6dcbSGregory Neil Shapiro					for one second after each subsequent
4251323f6dcbSGregory Neil Shapiro					RCPT command in that transaction.
4252c2aa98e2SPeter WemmconfDONT_PROBE_INTERFACES  DontProbeInterfaces
4253c2aa98e2SPeter Wemm					[False] If set, sendmail will _not_
4254c2aa98e2SPeter Wemm					insert the names and addresses of any
425506f25ae9SGregory Neil Shapiro					local interfaces into class {w}
4256c2aa98e2SPeter Wemm					(list of known "equivalent" addresses).
4257c2aa98e2SPeter Wemm					If you set this, you must also include
4258c2aa98e2SPeter Wemm					some support for these addresses (e.g.,
4259c2aa98e2SPeter Wemm					in a mailertable entry) -- otherwise,
4260c2aa98e2SPeter Wemm					mail to addresses in this list will
4261c2aa98e2SPeter Wemm					bounce with a configuration error.
426240266059SGregory Neil Shapiro					If set to "loopback" (without
426340266059SGregory Neil Shapiro					quotes), sendmail will skip
426440266059SGregory Neil Shapiro					loopback interfaces (e.g., "lo0").
426506f25ae9SGregory Neil ShapiroconfPID_FILE		PidFile		[system dependent] Location of pid
426606f25ae9SGregory Neil Shapiro					file.
426706f25ae9SGregory Neil ShapiroconfPROCESS_TITLE_PREFIX  ProcessTitlePrefix
426806f25ae9SGregory Neil Shapiro					[undefined] Prefix string for the
426906f25ae9SGregory Neil Shapiro					process title shown on 'ps' listings.
4270c2aa98e2SPeter WemmconfDONT_BLAME_SENDMAIL	DontBlameSendmail
4271c2aa98e2SPeter Wemm					[safe] Override sendmail's file
4272c2aa98e2SPeter Wemm					safety checks.  This will definitely
4273c2aa98e2SPeter Wemm					compromise system security and should
4274c2aa98e2SPeter Wemm					not be used unless absolutely
4275c2aa98e2SPeter Wemm					necessary.
4276c2aa98e2SPeter WemmconfREJECT_MSG		-		[550 Access denied] The message
4277c2aa98e2SPeter Wemm					given if the access database contains
4278c2aa98e2SPeter Wemm					REJECT in the value portion.
427940266059SGregory Neil ShapiroconfRELAY_MSG		-		[550 Relaying denied] The message
428040266059SGregory Neil Shapiro					given if an unauthorized relaying
428140266059SGregory Neil Shapiro					attempt is rejected.
428206f25ae9SGregory Neil ShapiroconfDF_BUFFER_SIZE	DataFileBufferSize
428306f25ae9SGregory Neil Shapiro					[4096] The maximum size of a
428406f25ae9SGregory Neil Shapiro					memory-buffered data (df) file
428506f25ae9SGregory Neil Shapiro					before a disk-based file is used.
428606f25ae9SGregory Neil ShapiroconfXF_BUFFER_SIZE	XScriptFileBufferSize
428706f25ae9SGregory Neil Shapiro					[4096] The maximum size of a
428806f25ae9SGregory Neil Shapiro					memory-buffered transcript (xf)
428906f25ae9SGregory Neil Shapiro					file before a disk-based file is
429006f25ae9SGregory Neil Shapiro					used.
429106f25ae9SGregory Neil ShapiroconfAUTH_MECHANISMS	AuthMechanisms	[GSSAPI KERBEROS_V4 DIGEST-MD5
429206f25ae9SGregory Neil Shapiro					CRAM-MD5] List of authentication
429306f25ae9SGregory Neil Shapiro					mechanisms for AUTH (separated by
429406f25ae9SGregory Neil Shapiro					spaces).  The advertised list of
429506f25ae9SGregory Neil Shapiro					authentication mechanisms will be the
429606f25ae9SGregory Neil Shapiro					intersection of this list and the list
429706f25ae9SGregory Neil Shapiro					of available mechanisms as determined
4298e92d3f3fSGregory Neil Shapiro					by the Cyrus SASL library.
4299e92d3f3fSGregory Neil ShapiroconfAUTH_REALM		AuthRealm	[undefined] The authentication realm
4300e92d3f3fSGregory Neil Shapiro					that is passed to the Cyrus SASL
4301e92d3f3fSGregory Neil Shapiro					library.  If no realm is specified,
4302da7d7b9cSGregory Neil Shapiro					$j is used.  See KNOWNBUGS.
4303602a2b1bSGregory Neil ShapiroconfDEF_AUTH_INFO	DefaultAuthInfo	[undefined] Name of file that contains
430406f25ae9SGregory Neil Shapiro					authentication information for
430540266059SGregory Neil Shapiro					outgoing connections.  This file must
430640266059SGregory Neil Shapiro					contain the user id, the authorization
430740266059SGregory Neil Shapiro					id, the password (plain text), the
430840266059SGregory Neil Shapiro					realm to use, and the list of
430940266059SGregory Neil Shapiro					mechanisms to try, each on a separate
431040266059SGregory Neil Shapiro					line and must be readable by root (or
431140266059SGregory Neil Shapiro					the trusted user) only.  If no realm
431240266059SGregory Neil Shapiro					is specified, $j is used.  If no
431340266059SGregory Neil Shapiro					mechanisms are given in the file,
431440266059SGregory Neil Shapiro					AuthMechanisms is used.  Notice: this
431540266059SGregory Neil Shapiro					option is deprecated and will be
431640266059SGregory Neil Shapiro					removed in future versions; it doesn't
431740266059SGregory Neil Shapiro					work for the MSP since it can't read
431840266059SGregory Neil Shapiro					the file.  Use the authinfo ruleset
431940266059SGregory Neil Shapiro					instead.  See also the section SMTP
432040266059SGregory Neil Shapiro					AUTHENTICATION.
432140266059SGregory Neil ShapiroconfAUTH_OPTIONS	AuthOptions	[undefined] If this option is 'A'
432206f25ae9SGregory Neil Shapiro					then the AUTH= parameter for the
432306f25ae9SGregory Neil Shapiro					MAIL FROM command is only issued
432406f25ae9SGregory Neil Shapiro					when authentication succeeded.
432513d88268SGregory Neil Shapiro					See doc/op/op.me for more options
432613d88268SGregory Neil Shapiro					and details.
432740266059SGregory Neil ShapiroconfAUTH_MAX_BITS	AuthMaxBits	[INT_MAX] Limit the maximum encryption
432840266059SGregory Neil Shapiro					strength for the security layer in
432940266059SGregory Neil Shapiro					SMTP AUTH (SASL).  Default is
433040266059SGregory Neil Shapiro					essentially unlimited.
433140266059SGregory Neil ShapiroconfTLS_SRV_OPTIONS	TLSSrvOptions	If this option is 'V' no client
433240266059SGregory Neil Shapiro					verification is performed, i.e.,
433340266059SGregory Neil Shapiro					the server doesn't ask for a
433440266059SGregory Neil Shapiro					certificate.
4335da7d7b9cSGregory Neil ShapiroconfSERVER_SSL_OPTIONS	ServerSSLOptions	[undefined] SSL related
4336da7d7b9cSGregory Neil Shapiro					options for server side.  See
4337da7d7b9cSGregory Neil Shapiro					SSL_CTX_set_options(3) for a list.
4338da7d7b9cSGregory Neil ShapiroconfCLIENT_SSL_OPTIONS	ClientSSLOptions	[undefined] SSL related
4339da7d7b9cSGregory Neil Shapiro					options for client side. See
4340da7d7b9cSGregory Neil Shapiro					SSL_CTX_set_options(3) for a list.
4341da7d7b9cSGregory Neil ShapiroconfCIPHER_LIST		CipherList	[undefined] Cipher list for TLS.
4342da7d7b9cSGregory Neil Shapiro					See ciphers(1) for possible values.
434306f25ae9SGregory Neil ShapiroconfLDAP_DEFAULT_SPEC	LDAPDefaultSpec	[undefined] Default map
434406f25ae9SGregory Neil Shapiro					specification for LDAP maps.  The
434506f25ae9SGregory Neil Shapiro					value should only contain LDAP
434606f25ae9SGregory Neil Shapiro					specific settings such as "-h host
434706f25ae9SGregory Neil Shapiro					-p port -d bindDN", etc.  The
434806f25ae9SGregory Neil Shapiro					settings will be used for all LDAP
434906f25ae9SGregory Neil Shapiro					maps unless they are specified in
435006f25ae9SGregory Neil Shapiro					the individual map specification
435106f25ae9SGregory Neil Shapiro					('K' command).
4352da7d7b9cSGregory Neil ShapiroconfCACERT_PATH		CACertPath	[undefined] Path to directory with
4353da7d7b9cSGregory Neil Shapiro					certificates of CAs which must contain
4354da7d7b9cSGregory Neil Shapiro					their hashes as filenames or links.
4355da7d7b9cSGregory Neil ShapiroconfCACERT		CACertFile	[undefined] File containing at least
4356da7d7b9cSGregory Neil Shapiro					one CA certificate.
435706f25ae9SGregory Neil ShapiroconfSERVER_CERT		ServerCertFile	[undefined] File containing the
435806f25ae9SGregory Neil Shapiro					cert of the server, i.e., this cert
435906f25ae9SGregory Neil Shapiro					is used when sendmail acts as
436006f25ae9SGregory Neil Shapiro					server.
436106f25ae9SGregory Neil ShapiroconfSERVER_KEY		ServerKeyFile	[undefined] File containing the
436206f25ae9SGregory Neil Shapiro					private key belonging to the server
436306f25ae9SGregory Neil Shapiro					cert.
436406f25ae9SGregory Neil ShapiroconfCLIENT_CERT		ClientCertFile	[undefined] File containing the
436506f25ae9SGregory Neil Shapiro					cert of the client, i.e., this cert
436606f25ae9SGregory Neil Shapiro					is used when sendmail acts as
436706f25ae9SGregory Neil Shapiro					client.
436806f25ae9SGregory Neil ShapiroconfCLIENT_KEY		ClientKeyFile	[undefined] File containing the
436906f25ae9SGregory Neil Shapiro					private key belonging to the client
437006f25ae9SGregory Neil Shapiro					cert.
4371e92d3f3fSGregory Neil ShapiroconfCRL			CRLFile		[undefined] File containing certificate
4372e92d3f3fSGregory Neil Shapiro					revocation status, useful for X.509v3
4373*5b0945b5SGregory Neil Shapiro					authentication.
4374*5b0945b5SGregory Neil ShapiroconfCRL_PATH		CRLPath		[undefined] Directory containing
4375*5b0945b5SGregory Neil Shapiro					hashes pointing to certificate
4376*5b0945b5SGregory Neil Shapiro					revocation status files.
437706f25ae9SGregory Neil ShapiroconfDH_PARAMETERS	DHParameters	[undefined] File containing the
437806f25ae9SGregory Neil Shapiro					DH parameters.
4379*5b0945b5SGregory Neil ShapiroconfDANE		DANE		[false] Enable DANE support.
438006f25ae9SGregory Neil ShapiroconfRAND_FILE		RandFile	[undefined] File containing random
438142e5d165SGregory Neil Shapiro					data (use prefix file:) or the
438242e5d165SGregory Neil Shapiro					name of the UNIX socket if EGD is
438342e5d165SGregory Neil Shapiro					used (use prefix egd:).  STARTTLS
438442e5d165SGregory Neil Shapiro					requires this option if the compile
438542e5d165SGregory Neil Shapiro					flag HASURANDOM is not set (see
438606f25ae9SGregory Neil Shapiro					sendmail/README).
4387da7d7b9cSGregory Neil ShapiroconfCERT_FINGERPRINT_ALGORITHM	CertFingerprintAlgorithm
4388da7d7b9cSGregory Neil Shapiro					[undefined] The fingerprint algorithm
4389da7d7b9cSGregory Neil Shapiro					(digest) to use for the presented
4390da7d7b9cSGregory Neil Shapiro					cert.
4391*5b0945b5SGregory Neil ShapiroconfSSL_ENGINE		SSLEngine	[undefined] Name of SSLEngine.
4392*5b0945b5SGregory Neil ShapiroconfSSL_ENGINE_PATH	SSLEnginePath	[undefined] Path to dynamic library
4393*5b0945b5SGregory Neil Shapiro					for SSLEngine.
439440266059SGregory Neil ShapiroconfNICE_QUEUE_RUN	NiceQueueRun	[undefined]  If set, the priority of
439540266059SGregory Neil Shapiro					queue runners is set the given value
439640266059SGregory Neil Shapiro					(nice(3)).
439740266059SGregory Neil ShapiroconfDIRECT_SUBMISSION_MODIFIERS	DirectSubmissionModifiers
439840266059SGregory Neil Shapiro					[undefined] Defines {daemon_flags}
439940266059SGregory Neil Shapiro					for direct submissions.
44004e4196cbSGregory Neil ShapiroconfUSE_MSP		UseMSP		[undefined] Use as mail submission
440140266059SGregory Neil Shapiro					program, see sendmail/SECURITY.
440240266059SGregory Neil ShapiroconfDELIVER_BY_MIN	DeliverByMin	[0] Minimum time for Deliver By
440340266059SGregory Neil Shapiro					SMTP Service Extension (RFC 2852).
4404e92d3f3fSGregory Neil ShapiroconfREQUIRES_DIR_FSYNC	RequiresDirfsync	[true] RequiresDirfsync can
4405e92d3f3fSGregory Neil Shapiro					be used to turn off the compile time
4406e92d3f3fSGregory Neil Shapiro					flag REQUIRES_DIR_FSYNC at runtime.
4407e92d3f3fSGregory Neil Shapiro					See sendmail/README for details.
440840266059SGregory Neil ShapiroconfSHARED_MEMORY_KEY	SharedMemoryKey [0] Key for shared memory.
4409d0cef73dSGregory Neil ShapiroconfSHARED_MEMORY_KEY_FILE
4410d0cef73dSGregory Neil Shapiro			SharedMemoryKeyFile
4411d0cef73dSGregory Neil Shapiro					[undefined] File where the
4412d0cef73dSGregory Neil Shapiro					automatically selected key for
4413d0cef73dSGregory Neil Shapiro					shared memory is stored.
441440266059SGregory Neil ShapiroconfFAST_SPLIT		FastSplit	[1] If set to a value greater than
441540266059SGregory Neil Shapiro					zero, the initial MX lookups on
441640266059SGregory Neil Shapiro					addresses is suppressed when they
441740266059SGregory Neil Shapiro					are sorted which may result in
441840266059SGregory Neil Shapiro					faster envelope splitting.  If the
441940266059SGregory Neil Shapiro					mail is submitted directly from the
442040266059SGregory Neil Shapiro					command line, then the value also
442140266059SGregory Neil Shapiro					limits the number of processes to
442240266059SGregory Neil Shapiro					deliver the envelopes.
442340266059SGregory Neil ShapiroconfMAILBOX_DATABASE	MailboxDatabase	[pw] Type of lookup to find
442440266059SGregory Neil Shapiro					information about local mailboxes.
442540266059SGregory Neil ShapiroconfDEQUOTE_OPTS	-		[empty] Additional options for the
442640266059SGregory Neil Shapiro					dequote map.
4427d0cef73dSGregory Neil ShapiroconfMAX_NOOP_COMMANDS	MaxNOOPCommands	[20] Maximum number of "useless"
4428d0cef73dSGregory Neil Shapiro					commands before the SMTP server
4429d0cef73dSGregory Neil Shapiro					will slow down responding.
4430d0cef73dSGregory Neil ShapiroconfHELO_NAME		HeloName	If defined, use as name for EHLO/HELO
4431d0cef73dSGregory Neil Shapiro					command (instead of $j).
443240266059SGregory Neil ShapiroconfINPUT_MAIL_FILTERS	InputMailFilters
443340266059SGregory Neil Shapiro					A comma separated list of filters
443440266059SGregory Neil Shapiro					which determines which filters and
443540266059SGregory Neil Shapiro					the invocation sequence are
443640266059SGregory Neil Shapiro					contacted for incoming SMTP
443740266059SGregory Neil Shapiro					messages.  If none are set, no
443840266059SGregory Neil Shapiro					filters will be contacted.
443940266059SGregory Neil ShapiroconfMILTER_LOG_LEVEL	Milter.LogLevel	[9] Log level for input mail filter
444040266059SGregory Neil Shapiro					actions, defaults to LogLevel.
444140266059SGregory Neil ShapiroconfMILTER_MACROS_CONNECT	Milter.macros.connect
444213bd1963SGregory Neil Shapiro					[j, _, {daemon_name}, {if_name},
444313bd1963SGregory Neil Shapiro					{if_addr}] Macros to transmit to
444413bd1963SGregory Neil Shapiro					milters when a session connection
444513bd1963SGregory Neil Shapiro					starts.
444640266059SGregory Neil ShapiroconfMILTER_MACROS_HELO	Milter.macros.helo
444713bd1963SGregory Neil Shapiro					[{tls_version}, {cipher},
444813bd1963SGregory Neil Shapiro					{cipher_bits}, {cert_subject},
444913bd1963SGregory Neil Shapiro					{cert_issuer}] Macros to transmit to
445013bd1963SGregory Neil Shapiro					milters after HELO/EHLO command.
445140266059SGregory Neil ShapiroconfMILTER_MACROS_ENVFROM	Milter.macros.envfrom
445213bd1963SGregory Neil Shapiro					[i, {auth_type}, {auth_authen},
445313bd1963SGregory Neil Shapiro					{auth_ssf}, {auth_author},
445413bd1963SGregory Neil Shapiro					{mail_mailer}, {mail_host},
445513bd1963SGregory Neil Shapiro					{mail_addr}] Macros to transmit to
445613bd1963SGregory Neil Shapiro					milters after MAIL FROM command.
445740266059SGregory Neil ShapiroconfMILTER_MACROS_ENVRCPT	Milter.macros.envrcpt
445813bd1963SGregory Neil Shapiro					[{rcpt_mailer}, {rcpt_host},
445913bd1963SGregory Neil Shapiro					{rcpt_addr}] Macros to transmit to
446013bd1963SGregory Neil Shapiro					milters after RCPT TO command.
4461e92d3f3fSGregory Neil ShapiroconfMILTER_MACROS_EOM		Milter.macros.eom
4462e92d3f3fSGregory Neil Shapiro					[{msg_id}] Macros to transmit to
4463d0cef73dSGregory Neil Shapiro					milters after the terminating
4464d0cef73dSGregory Neil Shapiro					DATA '.' is received.
4465d0cef73dSGregory Neil ShapiroconfMILTER_MACROS_EOH		Milter.macros.eoh
4466d0cef73dSGregory Neil Shapiro					Macros to transmit to milters
4467d0cef73dSGregory Neil Shapiro					after the end of headers.
4468d0cef73dSGregory Neil ShapiroconfMILTER_MACROS_DATA		Milter.macros.data
4469d0cef73dSGregory Neil Shapiro					Macros to transmit to milters
4470d0cef73dSGregory Neil Shapiro					after DATA command is received.
447140266059SGregory Neil Shapiro
4472c2aa98e2SPeter Wemm
4473c2aa98e2SPeter WemmSee also the description of OSTYPE for some parameters that can be
4474c2aa98e2SPeter Wemmtweaked (generally pathnames to mailers).
4475c2aa98e2SPeter Wemm
447640266059SGregory Neil ShapiroClientPortOptions and DaemonPortOptions are special cases since multiple
447740266059SGregory Neil Shapiroclients/daemons can be defined.  This can be done via
447806f25ae9SGregory Neil Shapiro
447940266059SGregory Neil Shapiro	CLIENT_OPTIONS(`field1=value1,field2=value2,...')
448006f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`field1=value1,field2=value2,...')
448106f25ae9SGregory Neil Shapiro
448240266059SGregory Neil ShapiroNote that multiple CLIENT_OPTIONS() commands (and therefore multiple
448340266059SGregory Neil ShapiroClientPortOptions settings) are allowed in order to give settings for each
448440266059SGregory Neil Shapiroprotocol family (e.g., one for Family=inet and one for Family=inet6).  A
448540266059SGregory Neil Shapirorestriction placed on one family only affects outgoing connections on that
448640266059SGregory Neil Shapiroparticular family.
448740266059SGregory Neil Shapiro
448806f25ae9SGregory Neil ShapiroIf DAEMON_OPTIONS is not used, then the default is
448906f25ae9SGregory Neil Shapiro
449006f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Port=smtp, Name=MTA')
449106f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Port=587, Name=MSA, M=E')
449206f25ae9SGregory Neil Shapiro
449306f25ae9SGregory Neil ShapiroIf you use one DAEMON_OPTIONS macro, it will alter the parameters
449406f25ae9SGregory Neil Shapiroof the first of these.  The second will still be defaulted; it
449506f25ae9SGregory Neil Shapirorepresents a "Message Submission Agent" (MSA) as defined by RFC
449606f25ae9SGregory Neil Shapiro2476 (see below).  To turn off the default definition for the MSA,
449706f25ae9SGregory Neil Shapirouse FEATURE(`no_default_msa') (see also FEATURES).  If you use
449806f25ae9SGregory Neil Shapiroadditional DAEMON_OPTIONS macros, they will add additional daemons.
449906f25ae9SGregory Neil Shapiro
450006f25ae9SGregory Neil ShapiroExample 1:  To change the port for the SMTP listener, while
450106f25ae9SGregory Neil Shapirostill using the MSA default, use
450206f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Port=925, Name=MTA')
450306f25ae9SGregory Neil Shapiro
450406f25ae9SGregory Neil ShapiroExample 2:  To change the port for the MSA daemon, while still
450506f25ae9SGregory Neil Shapirousing the default SMTP port, use
450606f25ae9SGregory Neil Shapiro	FEATURE(`no_default_msa')
450706f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Name=MTA')
450806f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Port=987, Name=MSA, M=E')
450906f25ae9SGregory Neil Shapiro
451006f25ae9SGregory Neil ShapiroNote that if the first of those DAEMON_OPTIONS lines were omitted, then
451106f25ae9SGregory Neil Shapirothere would be no listener on the standard SMTP port.
451206f25ae9SGregory Neil Shapiro
451306f25ae9SGregory Neil ShapiroExample 3: To listen on both IPv4 and IPv6 interfaces, use
451406f25ae9SGregory Neil Shapiro
451506f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Name=MTA-v4, Family=inet')
451606f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Name=MTA-v6, Family=inet6')
451706f25ae9SGregory Neil Shapiro
451806f25ae9SGregory Neil ShapiroA "Message Submission Agent" still uses all of the same rulesets for
451906f25ae9SGregory Neil Shapiroprocessing the message (and therefore still allows message rejection via
452006f25ae9SGregory Neil Shapirothe check_* rulesets).  In accordance with the RFC, the MSA will ensure
452113bd1963SGregory Neil Shapirothat all domains in envelope addresses are fully qualified if the message
452213bd1963SGregory Neil Shapirois relayed to another MTA.  It will also enforce the normal address syntax
452313bd1963SGregory Neil Shapirorules and log error messages.  Additionally, by using the M=a modifier you
452413bd1963SGregory Neil Shapirocan require authentication before messages are accepted by the MSA.
452513bd1963SGregory Neil ShapiroNotice: Do NOT use the 'a' modifier on a public accessible MTA!  Finally,
452613bd1963SGregory Neil Shapirothe M=E modifier shown above disables ETRN as required by RFC 2476.
452706f25ae9SGregory Neil Shapiro
452840266059SGregory Neil ShapiroMail filters can be defined using the INPUT_MAIL_FILTER() and MAIL_FILTER()
452940266059SGregory Neil Shapirocommands:
4530c2aa98e2SPeter Wemm
453140266059SGregory Neil Shapiro	INPUT_MAIL_FILTER(`sample', `S=local:/var/run/f1.sock')
453240266059SGregory Neil Shapiro	MAIL_FILTER(`myfilter', `S=inet:3333@localhost')
453340266059SGregory Neil Shapiro
453440266059SGregory Neil ShapiroThe INPUT_MAIL_FILTER() command causes the filter(s) to be called in the
453540266059SGregory Neil Shapirosame order they were specified by also setting confINPUT_MAIL_FILTERS.  A
453640266059SGregory Neil Shapirofilter can be defined without adding it to the input filter list by using
453740266059SGregory Neil ShapiroMAIL_FILTER() instead of INPUT_MAIL_FILTER() in your .mc file.
453840266059SGregory Neil ShapiroAlternatively, you can reset the list of filters and their order by setting
453940266059SGregory Neil ShapiroconfINPUT_MAIL_FILTERS option after all INPUT_MAIL_FILTER() commands in
454040266059SGregory Neil Shapiroyour .mc file.
454140266059SGregory Neil Shapiro
454240266059SGregory Neil Shapiro
454340266059SGregory Neil Shapiro+----------------------------+
454440266059SGregory Neil Shapiro| MESSAGE SUBMISSION PROGRAM |
454540266059SGregory Neil Shapiro+----------------------------+
454640266059SGregory Neil Shapiro
454740266059SGregory Neil ShapiroThe purpose of the message submission program (MSP) is explained
454840266059SGregory Neil Shapiroin sendmail/SECURITY.  This section contains a list of caveats and
454940266059SGregory Neil Shapiroa few hints how for those who want to tweak the default configuration
455040266059SGregory Neil Shapirofor it (which is installed as submit.cf).
455140266059SGregory Neil Shapiro
455240266059SGregory Neil ShapiroNotice: do not add options/features to submit.mc unless you are
455340266059SGregory Neil Shapiroabsolutely sure you need them.  Options you may want to change
455440266059SGregory Neil Shapiroinclude:
455540266059SGregory Neil Shapiro
4556605302a5SGregory Neil Shapiro- confTRUSTED_USERS, FEATURE(`use_ct_file'), and confCT_FILE for
455794c01205SGregory Neil Shapiro  avoiding X-Authentication warnings.
4558605302a5SGregory Neil Shapiro- confTIME_ZONE to change it from the default `USE_TZ'.
455940266059SGregory Neil Shapiro- confDELIVERY_MODE is set to interactive in msp.m4 instead
456040266059SGregory Neil Shapiro  of the default background mode.
456194c01205SGregory Neil Shapiro- FEATURE(stickyhost) and LOCAL_RELAY to send unqualified addresses
456294c01205SGregory Neil Shapiro  to the LOCAL_RELAY instead of the default relay.
456394c01205SGregory Neil Shapiro- confRAND_FILE if you use STARTTLS and sendmail is not compiled with
456494c01205SGregory Neil Shapiro  the flag HASURANDOM.
456594c01205SGregory Neil Shapiro
456694c01205SGregory Neil ShapiroThe MSP performs hostname canonicalization by default.  As also
456794c01205SGregory Neil Shapiroexplained in sendmail/SECURITY, mail may end up for various DNS
456894c01205SGregory Neil Shapirorelated reasons in the MSP queue. This problem can be minimized by
456994c01205SGregory Neil Shapirousing
457094c01205SGregory Neil Shapiro
457194c01205SGregory Neil Shapiro	FEATURE(`nocanonify', `canonify_hosts')
457294c01205SGregory Neil Shapiro	define(`confDIRECT_SUBMISSION_MODIFIERS', `C')
457394c01205SGregory Neil Shapiro
457494c01205SGregory Neil ShapiroSee the discussion about nocanonify for possible side effects.
457540266059SGregory Neil Shapiro
457640266059SGregory Neil ShapiroSome things are not intended to work with the MSP.  These include
457740266059SGregory Neil Shapirofeatures that influence the delivery process (e.g., mailertable,
457840266059SGregory Neil Shapiroaliases), or those that are only important for a SMTP server (e.g.,
457940266059SGregory Neil Shapirovirtusertable, DaemonPortOptions, multiple queues).  Moreover,
458040266059SGregory Neil Shapirorelaxing certain restrictions (RestrictQueueRun, permissions on
458140266059SGregory Neil Shapiroqueue directory) or adding features (e.g., enabling prog/file mailer)
458240266059SGregory Neil Shapirocan cause security problems.
458340266059SGregory Neil Shapiro
458440266059SGregory Neil ShapiroOther things don't work well with the MSP and require tweaking or
458540266059SGregory Neil Shapiroworkarounds.  For example, to allow for client authentication it
458640266059SGregory Neil Shapirois not just sufficient to provide a client certificate and the
458740266059SGregory Neil Shapirocorresponding key, but it is also necessary to make the key group
458840266059SGregory Neil Shapiro(smmsp) readable and tell sendmail not to complain about that, i.e.,
458940266059SGregory Neil Shapiro
459040266059SGregory Neil Shapiro	define(`confDONT_BLAME_SENDMAIL', `GroupReadableKeyFile')
459140266059SGregory Neil Shapiro
459240266059SGregory Neil ShapiroIf the MSP should actually use AUTH then the necessary data
459340266059SGregory Neil Shapiroshould be placed in a map as explained in SMTP AUTHENTICATION:
459440266059SGregory Neil Shapiro
459540266059SGregory Neil ShapiroFEATURE(`authinfo', `DATABASE_MAP_TYPE /etc/mail/msp-authinfo')
459640266059SGregory Neil Shapiro
459740266059SGregory Neil Shapiro/etc/mail/msp-authinfo should contain an entry like:
459840266059SGregory Neil Shapiro
459940266059SGregory Neil Shapiro	AuthInfo:127.0.0.1	"U:smmsp" "P:secret" "M:DIGEST-MD5"
460040266059SGregory Neil Shapiro
460140266059SGregory Neil ShapiroThe file and the map created by makemap should be owned by smmsp,
460240266059SGregory Neil Shapiroits group should be smmsp, and it should have mode 640.  The database
460340266059SGregory Neil Shapiroused by the MTA for AUTH must have a corresponding entry.
460440266059SGregory Neil ShapiroAdditionally the MTA must trust this authentication data so the AUTH=
460540266059SGregory Neil Shapiropart will be relayed on to the next hop.  This can be achieved by
460640266059SGregory Neil Shapiroadding the following to your sendmail.mc file:
460740266059SGregory Neil Shapiro
460840266059SGregory Neil Shapiro	LOCAL_RULESETS
460940266059SGregory Neil Shapiro	SLocal_trust_auth
461040266059SGregory Neil Shapiro	R$*	$: $&{auth_authen}
461140266059SGregory Neil Shapiro	Rsmmsp	$# OK
461240266059SGregory Neil Shapiro
4613e92d3f3fSGregory Neil ShapiroNote: the authentication data can leak to local users who invoke
4614e92d3f3fSGregory Neil Shapirothe MSP with debug options or even with -v.  For that reason either
4615e92d3f3fSGregory Neil Shapiroan authentication mechanism that does not show the password in the
4616e92d3f3fSGregory Neil ShapiroAUTH dialogue (e.g., DIGEST-MD5) or a different authentication
4617e92d3f3fSGregory Neil Shapiromethod like STARTTLS should be used.
4618e92d3f3fSGregory Neil Shapiro
461940266059SGregory Neil Shapirofeature/msp.m4 defines almost all settings for the MSP.  Most of
462040266059SGregory Neil Shapirothose should not be changed at all.  Some of the features and options
462140266059SGregory Neil Shapirocan be overridden if really necessary.  It is a bit tricky to do
462240266059SGregory Neil Shapirothis, because it depends on the actual way the option is defined
462340266059SGregory Neil Shapiroin feature/msp.m4.  If it is directly defined (i.e., define()) then
462440266059SGregory Neil Shapirothe modified value must be defined after
462540266059SGregory Neil Shapiro
462640266059SGregory Neil Shapiro	FEATURE(`msp')
462740266059SGregory Neil Shapiro
462840266059SGregory Neil ShapiroIf it is conditionally defined (i.e., ifdef()) then the desired
462940266059SGregory Neil Shapirovalue must be defined before the FEATURE line in the .mc file.
463040266059SGregory Neil ShapiroTo see how the options are defined read feature/msp.m4.
463140266059SGregory Neil Shapiro
463240266059SGregory Neil Shapiro
463340266059SGregory Neil Shapiro+--------------------------+
463440266059SGregory Neil Shapiro| FORMAT OF FILES AND MAPS |
463540266059SGregory Neil Shapiro+--------------------------+
463640266059SGregory Neil Shapiro
463740266059SGregory Neil ShapiroFiles that define classes, i.e., F{classname}, consist of lines
463840266059SGregory Neil Shapiroeach of which contains a single element of the class.  For example,
463940266059SGregory Neil Shapiro/etc/mail/local-host-names may have the following content:
464040266059SGregory Neil Shapiro
464140266059SGregory Neil Shapiromy.domain
464240266059SGregory Neil Shapiroanother.domain
464340266059SGregory Neil Shapiro
464440266059SGregory Neil ShapiroMaps must be created using makemap(8) , e.g.,
464540266059SGregory Neil Shapiro
464640266059SGregory Neil Shapiro	makemap hash MAP < MAP
464740266059SGregory Neil Shapiro
464840266059SGregory Neil ShapiroIn general, a text file from which a map is created contains lines
464940266059SGregory Neil Shapiroof the form
465040266059SGregory Neil Shapiro
465140266059SGregory Neil Shapirokey	value
465240266059SGregory Neil Shapiro
465340266059SGregory Neil Shapirowhere 'key' and 'value' are also called LHS and RHS, respectively.
465440266059SGregory Neil ShapiroBy default, the delimiter between LHS and RHS is a non-empty sequence
465540266059SGregory Neil Shapiroof white space characters.
465640266059SGregory Neil Shapiro
465740266059SGregory Neil Shapiro
465840266059SGregory Neil Shapiro+------------------+
465940266059SGregory Neil Shapiro| DIRECTORY LAYOUT |
466040266059SGregory Neil Shapiro+------------------+
4661c2aa98e2SPeter Wemm
4662c2aa98e2SPeter WemmWithin this directory are several subdirectories, to wit:
4663c2aa98e2SPeter Wemm
4664c2aa98e2SPeter Wemmm4		General support routines.  These are typically
4665c2aa98e2SPeter Wemm		very important and should not be changed without
4666c2aa98e2SPeter Wemm		very careful consideration.
4667c2aa98e2SPeter Wemm
4668c2aa98e2SPeter Wemmcf		The configuration files themselves.  They have
4669c2aa98e2SPeter Wemm		".mc" suffixes, and must be run through m4 to
4670c2aa98e2SPeter Wemm		become complete.  The resulting output should
4671c2aa98e2SPeter Wemm		have a ".cf" suffix.
4672c2aa98e2SPeter Wemm
4673c2aa98e2SPeter Wemmostype		Definitions describing a particular operating
4674c2aa98e2SPeter Wemm		system type.  These should always be referenced
4675c2aa98e2SPeter Wemm		using the OSTYPE macro in the .mc file.  Examples
4676c2aa98e2SPeter Wemm		include "bsd4.3", "bsd4.4", "sunos3.5", and
4677c2aa98e2SPeter Wemm		"sunos4.1".
4678c2aa98e2SPeter Wemm
4679c2aa98e2SPeter Wemmdomain		Definitions describing a particular domain, referenced
4680c2aa98e2SPeter Wemm		using the DOMAIN macro in the .mc file.  These are
4681c2aa98e2SPeter Wemm		site dependent; for example, "CS.Berkeley.EDU.m4"
4682c2aa98e2SPeter Wemm		describes hosts in the CS.Berkeley.EDU subdomain.
4683c2aa98e2SPeter Wemm
4684c2aa98e2SPeter Wemmmailer		Descriptions of mailers.  These are referenced using
4685c2aa98e2SPeter Wemm		the MAILER macro in the .mc file.
4686c2aa98e2SPeter Wemm
4687c2aa98e2SPeter Wemmsh		Shell files used when building the .cf file from the
4688c2aa98e2SPeter Wemm		.mc file in the cf subdirectory.
4689c2aa98e2SPeter Wemm
4690c2aa98e2SPeter Wemmfeature		These hold special orthogonal features that you might
4691c2aa98e2SPeter Wemm		want to include.  They should be referenced using
4692c2aa98e2SPeter Wemm		the FEATURE macro.
4693c2aa98e2SPeter Wemm
4694c2aa98e2SPeter Wemmhack		Local hacks.  These can be referenced using the HACK
4695c2aa98e2SPeter Wemm		macro.  They shouldn't be of more than voyeuristic
4696c2aa98e2SPeter Wemm		interest outside the .Berkeley.EDU domain, but who knows?
4697c2aa98e2SPeter Wemm
4698c2aa98e2SPeter Wemmsiteconfig	Site configuration -- e.g., tables of locally connected
4699c2aa98e2SPeter Wemm		UUCP sites.
4700c2aa98e2SPeter Wemm
4701c2aa98e2SPeter Wemm
4702c2aa98e2SPeter Wemm+------------------------+
4703c2aa98e2SPeter Wemm| ADMINISTRATIVE DETAILS |
4704c2aa98e2SPeter Wemm+------------------------+
4705c2aa98e2SPeter Wemm
4706c2aa98e2SPeter WemmThe following sections detail usage of certain internal parts of the
4707c2aa98e2SPeter Wemmsendmail.cf file.  Read them carefully if you are trying to modify
4708c2aa98e2SPeter Wemmthe current model.  If you find the above descriptions adequate, these
4709c2aa98e2SPeter Wemmshould be {boring, confusing, tedious, ridiculous} (pick one or more).
4710c2aa98e2SPeter Wemm
4711c2aa98e2SPeter WemmRULESETS (* means built in to sendmail)
4712c2aa98e2SPeter Wemm
4713c2aa98e2SPeter Wemm   0 *	Parsing
4714c2aa98e2SPeter Wemm   1 *	Sender rewriting
4715c2aa98e2SPeter Wemm   2 *	Recipient rewriting
4716c2aa98e2SPeter Wemm   3 *	Canonicalization
4717c2aa98e2SPeter Wemm   4 *	Post cleanup
4718c2aa98e2SPeter Wemm   5 *	Local address rewrite (after aliasing)
4719c2aa98e2SPeter Wemm  1x	mailer rules (sender qualification)
4720c2aa98e2SPeter Wemm  2x	mailer rules (recipient qualification)
4721c2aa98e2SPeter Wemm  3x	mailer rules (sender header qualification)
4722c2aa98e2SPeter Wemm  4x	mailer rules (recipient header qualification)
4723c2aa98e2SPeter Wemm  5x	mailer subroutines (general)
4724c2aa98e2SPeter Wemm  6x	mailer subroutines (general)
4725c2aa98e2SPeter Wemm  7x	mailer subroutines (general)
4726c2aa98e2SPeter Wemm  8x	reserved
4727c2aa98e2SPeter Wemm  90	Mailertable host stripping
4728c2aa98e2SPeter Wemm  96	Bottom half of Ruleset 3 (ruleset 6 in old sendmail)
4729c2aa98e2SPeter Wemm  97	Hook for recursive ruleset 0 call (ruleset 7 in old sendmail)
4730c2aa98e2SPeter Wemm  98	Local part of ruleset 0 (ruleset 8 in old sendmail)
4731c2aa98e2SPeter Wemm
4732c2aa98e2SPeter Wemm
4733c2aa98e2SPeter WemmMAILERS
4734c2aa98e2SPeter Wemm
4735c2aa98e2SPeter Wemm   0	local, prog	local and program mailers
4736c2aa98e2SPeter Wemm   1	[e]smtp, relay	SMTP channel
4737c2aa98e2SPeter Wemm   2	uucp-*		UNIX-to-UNIX Copy Program
4738c2aa98e2SPeter Wemm   3	netnews		Network News delivery
4739c2aa98e2SPeter Wemm   4	fax		Sam Leffler's HylaFAX software
4740c2aa98e2SPeter Wemm   5	mail11		DECnet mailer
4741c2aa98e2SPeter Wemm
4742c2aa98e2SPeter Wemm
4743c2aa98e2SPeter WemmMACROS
4744c2aa98e2SPeter Wemm
4745c2aa98e2SPeter Wemm   A
4746c2aa98e2SPeter Wemm   B	Bitnet Relay
4747c2aa98e2SPeter Wemm   C	DECnet Relay
4748c2aa98e2SPeter Wemm   D	The local domain -- usually not needed
4749c2aa98e2SPeter Wemm   E	reserved for X.400 Relay
4750c2aa98e2SPeter Wemm   F	FAX Relay
4751c2aa98e2SPeter Wemm   G
4752c2aa98e2SPeter Wemm   H	mail Hub (for mail clusters)
4753c2aa98e2SPeter Wemm   I
4754c2aa98e2SPeter Wemm   J
4755c2aa98e2SPeter Wemm   K
4756c2aa98e2SPeter Wemm   L	Luser Relay
475706f25ae9SGregory Neil Shapiro   M	Masquerade (who you claim to be)
4758c2aa98e2SPeter Wemm   N
4759c2aa98e2SPeter Wemm   O
4760c2aa98e2SPeter Wemm   P
4761c2aa98e2SPeter Wemm   Q
4762c2aa98e2SPeter Wemm   R	Relay (for unqualified names)
4763c2aa98e2SPeter Wemm   S	Smart Host
4764c2aa98e2SPeter Wemm   T
476506f25ae9SGregory Neil Shapiro   U	my UUCP name (if you have a UUCP connection)
476606f25ae9SGregory Neil Shapiro   V	UUCP Relay (class {V} hosts)
476706f25ae9SGregory Neil Shapiro   W	UUCP Relay (class {W} hosts)
476806f25ae9SGregory Neil Shapiro   X	UUCP Relay (class {X} hosts)
4769c2aa98e2SPeter Wemm   Y	UUCP Relay (all other hosts)
4770c2aa98e2SPeter Wemm   Z	Version number
4771c2aa98e2SPeter Wemm
4772c2aa98e2SPeter Wemm
4773c2aa98e2SPeter WemmCLASSES
4774c2aa98e2SPeter Wemm
4775c2aa98e2SPeter Wemm   A
4776c2aa98e2SPeter Wemm   B	domains that are candidates for bestmx lookup
4777c2aa98e2SPeter Wemm   C
4778c2aa98e2SPeter Wemm   D
4779c2aa98e2SPeter Wemm   E	addresses that should not seem to come from $M
478006f25ae9SGregory Neil Shapiro   F	hosts this system forward for
4781c2aa98e2SPeter Wemm   G	domains that should be looked up in genericstable
4782c2aa98e2SPeter Wemm   H
4783c2aa98e2SPeter Wemm   I
4784c2aa98e2SPeter Wemm   J
4785c2aa98e2SPeter Wemm   K
4786c2aa98e2SPeter Wemm   L	addresses that should not be forwarded to $R
4787c2aa98e2SPeter Wemm   M	domains that should be mapped to $M
478806f25ae9SGregory Neil Shapiro   N	host/domains that should not be mapped to $M
4789c2aa98e2SPeter Wemm   O	operators that indicate network operations (cannot be in local names)
4790c2aa98e2SPeter Wemm   P	top level pseudo-domains: BITNET, DECNET, FAX, UUCP, etc.
4791c2aa98e2SPeter Wemm   Q
479206f25ae9SGregory Neil Shapiro   R	domains this system is willing to relay (pass anti-spam filters)
4793c2aa98e2SPeter Wemm   S
4794c2aa98e2SPeter Wemm   T
4795c2aa98e2SPeter Wemm   U	locally connected UUCP hosts
4796c2aa98e2SPeter Wemm   V	UUCP hosts connected to relay $V
4797c2aa98e2SPeter Wemm   W	UUCP hosts connected to relay $W
4798c2aa98e2SPeter Wemm   X	UUCP hosts connected to relay $X
4799c2aa98e2SPeter Wemm   Y	locally connected smart UUCP hosts
4800c2aa98e2SPeter Wemm   Z	locally connected domain-ized UUCP hosts
4801c2aa98e2SPeter Wemm   .	the class containing only a dot
4802c2aa98e2SPeter Wemm   [	the class containing only a left bracket
4803c2aa98e2SPeter Wemm
4804c2aa98e2SPeter Wemm
4805c2aa98e2SPeter WemmM4 DIVERSIONS
4806c2aa98e2SPeter Wemm
4807c2aa98e2SPeter Wemm   1	Local host detection and resolution
4808c2aa98e2SPeter Wemm   2	Local Ruleset 3 additions
4809c2aa98e2SPeter Wemm   3	Local Ruleset 0 additions
4810c2aa98e2SPeter Wemm   4	UUCP Ruleset 0 additions
4811c2aa98e2SPeter Wemm   5	locally interpreted names (overrides $R)
4812c2aa98e2SPeter Wemm   6	local configuration (at top of file)
4813c2aa98e2SPeter Wemm   7	mailer definitions
4814*5b0945b5SGregory Neil Shapiro   8	DNS based blocklists
4815c2aa98e2SPeter Wemm   9	special local rulesets (1 and 2)
481606f25ae9SGregory Neil Shapiro
4817