xref: /freebsd/contrib/sendmail/cf/README (revision 605302a5c9939b7eeda0a31f38901d9a8348e8cb)
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
3140266059SGregory Neil ShapiroSTARTTLS
3240266059SGregory Neil ShapiroSMTP AUTHENTICATION
3340266059SGregory Neil ShapiroADDING NEW MAILERS OR RULESETS
3440266059SGregory Neil ShapiroADDING NEW MAIL FILTERS
3540266059SGregory Neil ShapiroQUEUE GROUP DEFINITIONS
3640266059SGregory Neil ShapiroNON-SMTP BASED CONFIGURATIONS
3740266059SGregory Neil ShapiroWHO AM I?
3840266059SGregory Neil ShapiroACCEPTING MAIL FOR MULTIPLE NAMES
3940266059SGregory Neil ShapiroUSING MAILERTABLES
4040266059SGregory Neil ShapiroUSING USERDB TO MAP FULL NAMES
4140266059SGregory Neil ShapiroMISCELLANEOUS SPECIAL FEATURES
4240266059SGregory Neil ShapiroSECURITY NOTES
4340266059SGregory Neil ShapiroTWEAKING CONFIGURATION OPTIONS
4440266059SGregory Neil ShapiroMESSAGE SUBMISSION PROGRAM
4540266059SGregory Neil ShapiroFORMAT OF FILES AND MAPS
4640266059SGregory Neil ShapiroDIRECTORY LAYOUT
4740266059SGregory Neil ShapiroADMINISTRATIVE DETAILS
48c2aa98e2SPeter Wemm
49c2aa98e2SPeter Wemm
50c2aa98e2SPeter Wemm+--------------------------+
51c2aa98e2SPeter Wemm| INTRODUCTION AND EXAMPLE |
52c2aa98e2SPeter Wemm+--------------------------+
53c2aa98e2SPeter Wemm
54c2aa98e2SPeter WemmConfiguration files are contained in the subdirectory "cf", with a
55c2aa98e2SPeter Wemmsuffix ".mc".  They must be run through "m4" to produce a ".cf" file.
56c2aa98e2SPeter WemmYou must pre-load "cf.m4":
57c2aa98e2SPeter Wemm
58c2aa98e2SPeter Wemm	m4 ${CFDIR}/m4/cf.m4 config.mc > config.cf
59c2aa98e2SPeter Wemm
6006f25ae9SGregory Neil ShapiroAlternatively, you can simply:
6106f25ae9SGregory Neil Shapiro
6206f25ae9SGregory Neil Shapiro	cd ${CFDIR}/cf
6306f25ae9SGregory Neil Shapiro	./Build config.cf
6406f25ae9SGregory Neil Shapiro
65c2aa98e2SPeter Wemmwhere ${CFDIR} is the root of the cf directory and config.mc is the
66c2aa98e2SPeter Wemmname of your configuration file.  If you are running a version of M4
67c2aa98e2SPeter Wemmthat understands the __file__ builtin (versions of GNU m4 >= 0.75 do
68c2aa98e2SPeter Wemmthis, but the versions distributed with 4.4BSD and derivatives do not)
69c2aa98e2SPeter Wemmor the -I flag (ditto), then ${CFDIR} can be in an arbitrary directory.
70c2aa98e2SPeter WemmFor "traditional" versions, ${CFDIR} ***MUST*** be "..", or you MUST
71c2aa98e2SPeter Wemmuse -D_CF_DIR_=/path/to/cf/dir/ -- note the trailing slash!  For example:
72c2aa98e2SPeter Wemm
73c2aa98e2SPeter Wemm	m4 -D_CF_DIR_=${CFDIR}/ ${CFDIR}/m4/cf.m4 config.mc > config.cf
74c2aa98e2SPeter Wemm
75c2aa98e2SPeter WemmLet's examine a typical .mc file:
76c2aa98e2SPeter Wemm
77c2aa98e2SPeter Wemm	divert(-1)
78c2aa98e2SPeter Wemm	#
7940266059SGregory Neil Shapiro	# Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers.
8006f25ae9SGregory Neil Shapiro	#	All rights reserved.
81c2aa98e2SPeter Wemm	# Copyright (c) 1983 Eric P. Allman.  All rights reserved.
82c2aa98e2SPeter Wemm	# Copyright (c) 1988, 1993
83c2aa98e2SPeter Wemm	#	The Regents of the University of California.  All rights reserved.
84c2aa98e2SPeter Wemm	#
85c2aa98e2SPeter Wemm	# By using this file, you agree to the terms and conditions set
86c2aa98e2SPeter Wemm	# forth in the LICENSE file which can be found at the top level of
87c2aa98e2SPeter Wemm	# the sendmail distribution.
88c2aa98e2SPeter Wemm	#
89c2aa98e2SPeter Wemm
90c2aa98e2SPeter Wemm	#
91c2aa98e2SPeter Wemm	#  This is a Berkeley-specific configuration file for HP-UX 9.x.
92c2aa98e2SPeter Wemm	#  It applies only to the Computer Science Division at Berkeley,
93c2aa98e2SPeter Wemm	#  and should not be used elsewhere.   It is provided on the sendmail
94c2aa98e2SPeter Wemm	#  distribution as a sample only.  To create your own configuration
95c2aa98e2SPeter Wemm	#  file, create an appropriate domain file in ../domain, change the
96c2aa98e2SPeter Wemm	#  `DOMAIN' macro below to reference that file, and copy the result
97c2aa98e2SPeter Wemm	#  to a name of your own choosing.
98c2aa98e2SPeter Wemm	#
99c2aa98e2SPeter Wemm	divert(0)
100c2aa98e2SPeter Wemm
101c2aa98e2SPeter WemmThe divert(-1) will delete the crud in the resulting output file.
102c2aa98e2SPeter WemmThe copyright notice can be replaced by whatever your lawyers require;
10306f25ae9SGregory Neil Shapiroour lawyers require the one that is included in these files.  A copyleft
104c2aa98e2SPeter Wemmis a copyright by another name.  The divert(0) restores regular output.
105c2aa98e2SPeter Wemm
106c2aa98e2SPeter Wemm	VERSIONID(`<SCCS or RCS version id>')
107c2aa98e2SPeter Wemm
108c2aa98e2SPeter WemmVERSIONID is a macro that stuffs the version information into the
10906f25ae9SGregory Neil Shapiroresulting file.  You could use SCCS, RCS, CVS, something else, or
110c2aa98e2SPeter Wemmomit it completely.  This is not the same as the version id included
111c2aa98e2SPeter Wemmin SMTP greeting messages -- this is defined in m4/version.m4.
112c2aa98e2SPeter Wemm
11306f25ae9SGregory Neil Shapiro	OSTYPE(`hpux9')dnl
114c2aa98e2SPeter Wemm
115c2aa98e2SPeter WemmYou must specify an OSTYPE to properly configure things such as the
116c2aa98e2SPeter Wemmpathname of the help and status files, the flags needed for the local
117c2aa98e2SPeter Wemmmailer, and other important things.  If you omit it, you will get an
118c2aa98e2SPeter Wemmerror when you try to build the configuration.  Look at the ostype
119c2aa98e2SPeter Wemmdirectory for the list of known operating system types.
120c2aa98e2SPeter Wemm
12106f25ae9SGregory Neil Shapiro	DOMAIN(`CS.Berkeley.EDU')dnl
122c2aa98e2SPeter Wemm
123c2aa98e2SPeter WemmThis example is specific to the Computer Science Division at Berkeley.
12406f25ae9SGregory Neil ShapiroYou can use "DOMAIN(`generic')" to get a sufficiently bland definition
125c2aa98e2SPeter Wemmthat may well work for you, or you can create a customized domain
126c2aa98e2SPeter Wemmdefinition appropriate for your environment.
127c2aa98e2SPeter Wemm
12806f25ae9SGregory Neil Shapiro	MAILER(`local')
12906f25ae9SGregory Neil Shapiro	MAILER(`smtp')
130c2aa98e2SPeter Wemm
13140266059SGregory Neil ShapiroThese describe the mailers used at the default CS site.  The local
13240266059SGregory Neil Shapiromailer is always included automatically.  Beware: MAILER declarations
13340266059SGregory Neil Shapiroshould always be at the end of the configuration file.  The general
13440266059SGregory Neil Shapirorules are that the order should be:
135c2aa98e2SPeter Wemm
136c2aa98e2SPeter Wemm	VERSIONID
137c2aa98e2SPeter Wemm	OSTYPE
138c2aa98e2SPeter Wemm	DOMAIN
139c2aa98e2SPeter Wemm	FEATURE
140c2aa98e2SPeter Wemm	local macro definitions
141c2aa98e2SPeter Wemm	MAILER
14240266059SGregory Neil Shapiro	LOCAL_CONFIG
14306f25ae9SGregory Neil Shapiro	LOCAL_RULE_*
14406f25ae9SGregory Neil Shapiro	LOCAL_RULESETS
14506f25ae9SGregory Neil Shapiro
14606f25ae9SGregory Neil ShapiroThere are a few exceptions to this rule.  Local macro definitions which
14706f25ae9SGregory Neil Shapiroinfluence a FEATURE() should be done before that feature.  For example,
14806f25ae9SGregory Neil Shapiroa define(`PROCMAIL_MAILER_PATH', ...) should be done before
14906f25ae9SGregory Neil ShapiroFEATURE(`local_procmail').
150c2aa98e2SPeter Wemm
15140266059SGregory Neil Shapiro*******************************************************************
15240266059SGregory Neil Shapiro***  BE SURE YOU CUSTOMIZE THESE FILES!  They have some		***
15340266059SGregory Neil Shapiro***  Berkeley-specific assumptions built in, such as the name	***
15440266059SGregory Neil Shapiro***  of their UUCP-relay.  You'll want to create your own	***
15540266059SGregory Neil Shapiro***  domain description, and use that in place of		***
15640266059SGregory Neil Shapiro***  domain/Berkeley.EDU.m4.					***
15740266059SGregory Neil Shapiro*******************************************************************
15840266059SGregory Neil Shapiro
159c2aa98e2SPeter Wemm
160c2aa98e2SPeter Wemm+----------------------------+
161c2aa98e2SPeter Wemm| A BRIEF INTRODUCTION TO M4 |
162c2aa98e2SPeter Wemm+----------------------------+
163c2aa98e2SPeter Wemm
164c2aa98e2SPeter WemmSendmail uses the M4 macro processor to ``compile'' the configuration
165c2aa98e2SPeter Wemmfiles.  The most important thing to know is that M4 is stream-based,
166c2aa98e2SPeter Wemmthat is, it doesn't understand about lines.  For this reason, in some
167c2aa98e2SPeter Wemmplaces you may see the word ``dnl'', which stands for ``delete
168c2aa98e2SPeter Wemmthrough newline''; essentially, it deletes all characters starting
169c2aa98e2SPeter Wemmat the ``dnl'' up to and including the next newline character.  In
170c2aa98e2SPeter Wemmmost cases sendmail uses this only to avoid lots of unnecessary
171c2aa98e2SPeter Wemmblank lines in the output.
172c2aa98e2SPeter Wemm
173c2aa98e2SPeter WemmOther important directives are define(A, B) which defines the macro
174c2aa98e2SPeter Wemm``A'' to have value ``B''.  Macros are expanded as they are read, so
175c2aa98e2SPeter Wemmone normally quotes both values to prevent expansion.  For example,
176c2aa98e2SPeter Wemm
177c2aa98e2SPeter Wemm	define(`SMART_HOST', `smart.foo.com')
178c2aa98e2SPeter Wemm
179c2aa98e2SPeter WemmOne word of warning:  M4 macros are expanded even in lines that appear
180c2aa98e2SPeter Wemmto be comments.  For example, if you have
181c2aa98e2SPeter Wemm
18206f25ae9SGregory Neil Shapiro	# See FEATURE(`foo') above
183c2aa98e2SPeter Wemm
18406f25ae9SGregory Neil Shapiroit will not do what you expect, because the FEATURE(`foo') will be
185c2aa98e2SPeter Wemmexpanded.  This also applies to
186c2aa98e2SPeter Wemm
187c2aa98e2SPeter Wemm	# And then define the $X macro to be the return address
188c2aa98e2SPeter Wemm
189c2aa98e2SPeter Wemmbecause ``define'' is an M4 keyword.  If you want to use them, surround
190c2aa98e2SPeter Wemmthem with directed quotes, `like this'.
191c2aa98e2SPeter Wemm
19240266059SGregory Neil Shapiro
19340266059SGregory Neil ShapiroNotice:
19440266059SGregory Neil Shapiro-------
19540266059SGregory Neil Shapiro
19640266059SGregory Neil ShapiroThis package requires a post-V7 version of m4; if you are running the
19740266059SGregory Neil Shapiro4.2bsd, SysV.2, or 7th Edition version.  SunOS's /usr/5bin/m4 or
19840266059SGregory Neil ShapiroBSD-Net/2's m4 both work.  GNU m4 version 1.1 or later also works.
19940266059SGregory Neil ShapiroUnfortunately, the M4 on BSDI 1.0 doesn't work -- you'll have to use a
20040266059SGregory Neil ShapiroNet/2 or GNU version.  GNU m4 is available from
20140266059SGregory Neil Shapiroftp://ftp.gnu.org/pub/gnu/m4/m4-1.4.tar.gz (check for the latest version).
20240266059SGregory Neil ShapiroEXCEPTIONS: DEC's m4 on Digital UNIX 4.x is broken (3.x is fine).  Use GNU
20340266059SGregory Neil Shapirom4 on this platform.
20440266059SGregory Neil Shapiro
20540266059SGregory Neil Shapiro
206c2aa98e2SPeter Wemm+----------------+
207c2aa98e2SPeter Wemm| FILE LOCATIONS |
208c2aa98e2SPeter Wemm+----------------+
209c2aa98e2SPeter Wemm
210c2aa98e2SPeter Wemmsendmail 8.9 has introduced a new configuration directory for sendmail
211c2aa98e2SPeter Wemmrelated files, /etc/mail.  The new files available for sendmail 8.9 --
21206f25ae9SGregory Neil Shapirothe class {R} /etc/mail/relay-domains and the access database
21306f25ae9SGregory Neil Shapiro/etc/mail/access -- take advantage of this new directory.  Beginning with
21406f25ae9SGregory Neil Shapiro8.10, all files will use this directory by default (some options may be
21506f25ae9SGregory Neil Shapiroset by OSTYPE() files).  This new directory should help to restore
21606f25ae9SGregory Neil Shapirouniformity to sendmail's file locations.
21706f25ae9SGregory Neil Shapiro
21806f25ae9SGregory Neil ShapiroBelow is a table of some of the common changes:
21906f25ae9SGregory Neil Shapiro
22006f25ae9SGregory Neil ShapiroOld filename			New filename
22106f25ae9SGregory Neil Shapiro------------			------------
22206f25ae9SGregory Neil Shapiro/etc/bitdomain			/etc/mail/bitdomain
22306f25ae9SGregory Neil Shapiro/etc/domaintable		/etc/mail/domaintable
22406f25ae9SGregory Neil Shapiro/etc/genericstable		/etc/mail/genericstable
22506f25ae9SGregory Neil Shapiro/etc/uudomain			/etc/mail/uudomain
22606f25ae9SGregory Neil Shapiro/etc/virtusertable		/etc/mail/virtusertable
22706f25ae9SGregory Neil Shapiro/etc/userdb			/etc/mail/userdb
22806f25ae9SGregory Neil Shapiro
22906f25ae9SGregory Neil Shapiro/etc/aliases			/etc/mail/aliases
23006f25ae9SGregory Neil Shapiro/etc/sendmail/aliases		/etc/mail/aliases
23106f25ae9SGregory Neil Shapiro/etc/ucbmail/aliases		/etc/mail/aliases
23206f25ae9SGregory Neil Shapiro/usr/adm/sendmail/aliases	/etc/mail/aliases
23306f25ae9SGregory Neil Shapiro/usr/lib/aliases		/etc/mail/aliases
23406f25ae9SGregory Neil Shapiro/usr/lib/mail/aliases		/etc/mail/aliases
23506f25ae9SGregory Neil Shapiro/usr/ucblib/aliases		/etc/mail/aliases
23606f25ae9SGregory Neil Shapiro
23706f25ae9SGregory Neil Shapiro/etc/sendmail.cw		/etc/mail/local-host-names
23806f25ae9SGregory Neil Shapiro/etc/mail/sendmail.cw		/etc/mail/local-host-names
23906f25ae9SGregory Neil Shapiro/etc/sendmail/sendmail.cw	/etc/mail/local-host-names
24006f25ae9SGregory Neil Shapiro
24106f25ae9SGregory Neil Shapiro/etc/sendmail.ct		/etc/mail/trusted-users
24206f25ae9SGregory Neil Shapiro
24306f25ae9SGregory Neil Shapiro/etc/sendmail.oE		/etc/mail/error-header
24406f25ae9SGregory Neil Shapiro
24506f25ae9SGregory Neil Shapiro/etc/sendmail.hf		/etc/mail/helpfile
24606f25ae9SGregory Neil Shapiro/etc/mail/sendmail.hf		/etc/mail/helpfile
24706f25ae9SGregory Neil Shapiro/usr/ucblib/sendmail.hf		/etc/mail/helpfile
24806f25ae9SGregory Neil Shapiro/etc/ucbmail/sendmail.hf	/etc/mail/helpfile
24906f25ae9SGregory Neil Shapiro/usr/lib/sendmail.hf		/etc/mail/helpfile
25006f25ae9SGregory Neil Shapiro/usr/share/lib/sendmail.hf	/etc/mail/helpfile
25106f25ae9SGregory Neil Shapiro/usr/share/misc/sendmail.hf	/etc/mail/helpfile
25206f25ae9SGregory Neil Shapiro/share/misc/sendmail.hf		/etc/mail/helpfile
25306f25ae9SGregory Neil Shapiro
25406f25ae9SGregory Neil Shapiro/etc/service.switch		/etc/mail/service.switch
25506f25ae9SGregory Neil Shapiro
25606f25ae9SGregory Neil Shapiro/etc/sendmail.st		/etc/mail/statistics
25706f25ae9SGregory Neil Shapiro/etc/mail/sendmail.st		/etc/mail/statistics
25806f25ae9SGregory Neil Shapiro/etc/mailer/sendmail.st		/etc/mail/statistics
25906f25ae9SGregory Neil Shapiro/etc/sendmail/sendmail.st	/etc/mail/statistics
26006f25ae9SGregory Neil Shapiro/usr/lib/sendmail.st		/etc/mail/statistics
26106f25ae9SGregory Neil Shapiro/usr/ucblib/sendmail.st		/etc/mail/statistics
26206f25ae9SGregory Neil Shapiro
26306f25ae9SGregory Neil ShapiroNote that all of these paths actually use a new m4 macro MAIL_SETTINGS_DIR
26406f25ae9SGregory Neil Shapiroto create the pathnames.  The default value of this variable is
26506f25ae9SGregory Neil Shapiro`/etc/mail/'.  If you set this macro to a different value, you MUST include
26606f25ae9SGregory Neil Shapiroa trailing slash.
267c2aa98e2SPeter Wemm
26813058a91SGregory Neil ShapiroNotice: all filenames used in a .mc (or .cf) file should be absolute
26913058a91SGregory Neil Shapiro(starting at the root, i.e., with '/').  Relative filenames most
27013058a91SGregory Neil Shapirolikely cause surprises during operations (unless otherwise noted).
27113058a91SGregory Neil Shapiro
27213058a91SGregory Neil Shapiro
273c2aa98e2SPeter Wemm+--------+
274c2aa98e2SPeter Wemm| OSTYPE |
275c2aa98e2SPeter Wemm+--------+
276c2aa98e2SPeter Wemm
277c2aa98e2SPeter WemmYou MUST define an operating system environment, or the configuration
278c2aa98e2SPeter Wemmfile build will puke.  There are several environments available; look
279c2aa98e2SPeter Wemmat the "ostype" directory for the current list.  This macro changes
280c2aa98e2SPeter Wemmthings like the location of the alias file and queue directory.  Some
281c2aa98e2SPeter Wemmof these files are identical to one another.
282c2aa98e2SPeter Wemm
283c2aa98e2SPeter WemmIt is IMPERATIVE that the OSTYPE occur before any MAILER definitions.
284c2aa98e2SPeter WemmIn general, the OSTYPE macro should go immediately after any version
285c2aa98e2SPeter Wemminformation, and MAILER definitions should always go last.
286c2aa98e2SPeter Wemm
287c2aa98e2SPeter WemmOperating system definitions are usually easy to write.  They may define
288c2aa98e2SPeter Wemmthe following variables (everything defaults, so an ostype file may be
289c2aa98e2SPeter Wemmempty).  Unfortunately, the list of configuration-supported systems is
290c2aa98e2SPeter Wemmnot as broad as the list of source-supported systems, since many of
291c2aa98e2SPeter Wemmthe source contributors do not include corresponding ostype files.
292c2aa98e2SPeter Wemm
29306f25ae9SGregory Neil ShapiroALIAS_FILE		[/etc/mail/aliases] The location of the text version
294c2aa98e2SPeter Wemm			of the alias file(s).  It can be a comma-separated
295c2aa98e2SPeter Wemm			list of names (but be sure you quote values with
296c2aa98e2SPeter Wemm			commas in them -- for example, use
297c2aa98e2SPeter Wemm				define(`ALIAS_FILE', `a,b')
298c2aa98e2SPeter Wemm			to get "a" and "b" both listed as alias files;
299c2aa98e2SPeter Wemm			otherwise the define() primitive only sees "a").
30006f25ae9SGregory Neil ShapiroHELP_FILE		[/etc/mail/helpfile] The name of the file
301c2aa98e2SPeter Wemm			containing information printed in response to
302c2aa98e2SPeter Wemm			the SMTP HELP command.
303c2aa98e2SPeter WemmQUEUE_DIR		[/var/spool/mqueue] The directory containing
30406f25ae9SGregory Neil Shapiro			queue files.  To use multiple queues, supply
30506f25ae9SGregory Neil Shapiro			a value ending with an asterisk.  For
306602a2b1bSGregory Neil Shapiro			example, /var/spool/mqueue/qd* will use all of the
30706f25ae9SGregory Neil Shapiro			directories or symbolic links to directories
308602a2b1bSGregory Neil Shapiro			beginning with 'qd' in /var/spool/mqueue as queue
30906f25ae9SGregory Neil Shapiro			directories.  The names 'qf', 'df', and 'xf' are
310602a2b1bSGregory Neil Shapiro			reserved as specific subdirectories for the
311602a2b1bSGregory Neil Shapiro			corresponding queue file types as explained in
31240266059SGregory Neil Shapiro			doc/op/op.me.  See also QUEUE GROUP DEFINITIONS.
31340266059SGregory Neil ShapiroMSP_QUEUE_DIR		[/var/spool/clientmqueue] The directory containing
31440266059SGregory Neil Shapiro			queue files for the MSP (Mail Submission Program,
31540266059SGregory Neil Shapiro			see sendmail/SECURITY).
31606f25ae9SGregory Neil ShapiroSTATUS_FILE		[/etc/mail/statistics] The file containing status
317c2aa98e2SPeter Wemm			information.
318c2aa98e2SPeter WemmLOCAL_MAILER_PATH	[/bin/mail] The program used to deliver local mail.
31906f25ae9SGregory Neil ShapiroLOCAL_MAILER_FLAGS	[Prmn9] The flags used by the local mailer.  The
32006f25ae9SGregory Neil Shapiro			flags lsDFMAw5:/|@q are always included.
321c2aa98e2SPeter WemmLOCAL_MAILER_ARGS	[mail -d $u] The arguments passed to deliver local
322c2aa98e2SPeter Wemm			mail.
323c2aa98e2SPeter WemmLOCAL_MAILER_MAX	[undefined] If defined, the maximum size of local
324c2aa98e2SPeter Wemm			mail that you are willing to accept.
32506f25ae9SGregory Neil ShapiroLOCAL_MAILER_MAXMSGS	[undefined] If defined, the maximum number of
32606f25ae9SGregory Neil Shapiro			messages to deliver in a single connection.  Only
32706f25ae9SGregory Neil Shapiro			useful for LMTP local mailers.
328c2aa98e2SPeter WemmLOCAL_MAILER_CHARSET	[undefined] If defined, messages containing 8-bit data
329c2aa98e2SPeter Wemm			that ARRIVE from an address that resolves to the
330c2aa98e2SPeter Wemm			local mailer and which are converted to MIME will be
331c2aa98e2SPeter Wemm			labeled with this character set.
33206f25ae9SGregory Neil ShapiroLOCAL_MAILER_EOL	[undefined] If defined, the string to use as the
33306f25ae9SGregory Neil Shapiro			end of line for the local mailer.
33406f25ae9SGregory Neil ShapiroLOCAL_MAILER_DSN_DIAGNOSTIC_CODE
33506f25ae9SGregory Neil Shapiro			[X-Unix] The DSN Diagnostic-Code value for the
33606f25ae9SGregory Neil Shapiro			local mailer.  This should be changed with care.
337c2aa98e2SPeter WemmLOCAL_SHELL_PATH	[/bin/sh] The shell used to deliver piped email.
338c2aa98e2SPeter WemmLOCAL_SHELL_FLAGS	[eu9] The flags used by the shell mailer.  The
339c2aa98e2SPeter Wemm			flags lsDFM are always included.
340c2aa98e2SPeter WemmLOCAL_SHELL_ARGS	[sh -c $u] The arguments passed to deliver "prog"
341c2aa98e2SPeter Wemm			mail.
342c2aa98e2SPeter WemmLOCAL_SHELL_DIR		[$z:/] The directory search path in which the
343c2aa98e2SPeter Wemm			shell should run.
34440266059SGregory Neil ShapiroLOCAL_MAILER_QGRP	[undefined] The queue group for the local mailer.
345c2aa98e2SPeter WemmUSENET_MAILER_PATH	[/usr/lib/news/inews] The name of the program
346c2aa98e2SPeter Wemm			used to submit news.
34706f25ae9SGregory Neil ShapiroUSENET_MAILER_FLAGS	[rsDFMmn] The mailer flags for the usenet mailer.
348c2aa98e2SPeter WemmUSENET_MAILER_ARGS	[-m -h -n] The command line arguments for the
34940266059SGregory Neil Shapiro			usenet mailer.  NOTE: Some versions of inews
35040266059SGregory Neil Shapiro			(such as those shipped with newer versions of INN)
35140266059SGregory Neil Shapiro			use different flags.  Double check the defaults
35240266059SGregory Neil Shapiro			against the inews man page.
353c2aa98e2SPeter WemmUSENET_MAILER_MAX	[100000] The maximum size of messages that will
354c2aa98e2SPeter Wemm			be accepted by the usenet mailer.
35540266059SGregory Neil ShapiroUSENET_MAILER_QGRP	[undefined] The queue group for the usenet mailer.
356c2aa98e2SPeter WemmSMTP_MAILER_FLAGS	[undefined] Flags added to SMTP mailer.  Default
35706f25ae9SGregory Neil Shapiro			flags are `mDFMuX' for all SMTP-based mailers; the
35806f25ae9SGregory Neil Shapiro			"esmtp" mailer adds `a'; "smtp8" adds `8'; and
35906f25ae9SGregory Neil Shapiro			"dsmtp" adds `%'.
36006f25ae9SGregory Neil ShapiroRELAY_MAILER_FLAGS	[undefined] Flags added to the relay mailer.  Default
36106f25ae9SGregory Neil Shapiro			flags are `mDFMuX' for all SMTP-based mailers; the
36206f25ae9SGregory Neil Shapiro			relay mailer adds `a8'.  If this is not defined,
36306f25ae9SGregory Neil Shapiro			then SMTP_MAILER_FLAGS is used.
364c2aa98e2SPeter WemmSMTP_MAILER_MAX		[undefined] The maximum size of messages that will
36506f25ae9SGregory Neil Shapiro			be transported using the smtp, smtp8, esmtp, or dsmtp
366c2aa98e2SPeter Wemm			mailers.
36706f25ae9SGregory Neil ShapiroSMTP_MAILER_MAXMSGS	[undefined] If defined, the maximum number of
36806f25ae9SGregory Neil Shapiro			messages to deliver in a single connection for the
36906f25ae9SGregory Neil Shapiro			smtp, smtp8, esmtp, or dsmtp mailers.
370605302a5SGregory Neil ShapiroSMTP_MAILER_MAXRCPTS	[undefined] If defined, the maximum number of
371605302a5SGregory Neil Shapiro			recipients to deliver in a single connection for the
372605302a5SGregory Neil Shapiro			smtp, smtp8, esmtp, or dsmtp mailers.
37342e5d165SGregory Neil ShapiroSMTP_MAILER_ARGS	[TCP $h] The arguments passed to the smtp mailer.
374c2aa98e2SPeter Wemm			About the only reason you would want to change this
375c2aa98e2SPeter Wemm			would be to change the default port.
37642e5d165SGregory Neil ShapiroESMTP_MAILER_ARGS	[TCP $h] The arguments passed to the esmtp mailer.
37742e5d165SGregory Neil ShapiroSMTP8_MAILER_ARGS	[TCP $h] The arguments passed to the smtp8 mailer.
37842e5d165SGregory Neil ShapiroDSMTP_MAILER_ARGS	[TCP $h] The arguments passed to the dsmtp mailer.
37942e5d165SGregory Neil ShapiroRELAY_MAILER_ARGS	[TCP $h] The arguments passed to the relay mailer.
38040266059SGregory Neil ShapiroSMTP_MAILER_QGRP	[undefined] The queue group for the smtp mailer.
38140266059SGregory Neil ShapiroESMTP_MAILER_QGRP	[undefined] The queue group for the esmtp mailer.
38240266059SGregory Neil ShapiroSMTP8_MAILER_QGRP	[undefined] The queue group for the smtp8 mailer.
38340266059SGregory Neil ShapiroDSMTP_MAILER_QGRP	[undefined] The queue group for the dsmtp mailer.
38440266059SGregory Neil ShapiroRELAY_MAILER_QGRP	[undefined] The queue group for the relay mailer.
38506f25ae9SGregory Neil ShapiroRELAY_MAILER_MAXMSGS	[undefined] If defined, the maximum number of
38606f25ae9SGregory Neil Shapiro			messages to deliver in a single connection for the
38706f25ae9SGregory Neil Shapiro			relay mailer.
388c2aa98e2SPeter WemmSMTP_MAILER_CHARSET	[undefined] If defined, messages containing 8-bit data
389c2aa98e2SPeter Wemm			that ARRIVE from an address that resolves to one of
390c2aa98e2SPeter Wemm			the SMTP mailers and which are converted to MIME will
391c2aa98e2SPeter Wemm			be labeled with this character set.
392c2aa98e2SPeter WemmUUCP_MAILER_PATH	[/usr/bin/uux] The program used to send UUCP mail.
393c2aa98e2SPeter WemmUUCP_MAILER_FLAGS	[undefined] Flags added to UUCP mailer.  Default
394c2aa98e2SPeter Wemm			flags are `DFMhuU' (and `m' for uucp-new mailer,
395c2aa98e2SPeter Wemm			minus `U' for uucp-dom mailer).
396c2aa98e2SPeter WemmUUCP_MAILER_ARGS	[uux - -r -z -a$g -gC $h!rmail ($u)] The arguments
397c2aa98e2SPeter Wemm			passed to the UUCP mailer.
398c2aa98e2SPeter WemmUUCP_MAILER_MAX		[100000] The maximum size message accepted for
399c2aa98e2SPeter Wemm			transmission by the UUCP mailers.
400c2aa98e2SPeter WemmUUCP_MAILER_CHARSET	[undefined] If defined, messages containing 8-bit data
401c2aa98e2SPeter Wemm			that ARRIVE from an address that resolves to one of
402c2aa98e2SPeter Wemm			the UUCP mailers and which are converted to MIME will
403c2aa98e2SPeter Wemm			be labeled with this character set.
40440266059SGregory Neil ShapiroUUCP_MAILER_QGRP	[undefined] The queue group for the UUCP mailers.
405c2aa98e2SPeter WemmFAX_MAILER_PATH		[/usr/local/lib/fax/mailfax] The program used to
406c2aa98e2SPeter Wemm			submit FAX messages.
407c2aa98e2SPeter WemmFAX_MAILER_ARGS		[mailfax $u $h $f] The arguments passed to the FAX
408c2aa98e2SPeter Wemm			mailer.
409c2aa98e2SPeter WemmFAX_MAILER_MAX		[100000] The maximum size message accepted for
410c2aa98e2SPeter Wemm			transmission by FAX.
411c2aa98e2SPeter WemmPOP_MAILER_PATH		[/usr/lib/mh/spop] The pathname of the POP mailer.
41206f25ae9SGregory Neil ShapiroPOP_MAILER_FLAGS	[Penu] Flags added to POP mailer.  Flags lsDFMq
413c2aa98e2SPeter Wemm			are always added.
414c2aa98e2SPeter WemmPOP_MAILER_ARGS		[pop $u] The arguments passed to the POP mailer.
41540266059SGregory Neil ShapiroPOP_MAILER_QGRP		[undefined] The queue group for the pop mailer.
416c2aa98e2SPeter WemmPROCMAIL_MAILER_PATH	[/usr/local/bin/procmail] The path to the procmail
4172e43090eSPeter Wemm			program.  This is also used by
4182e43090eSPeter Wemm			FEATURE(`local_procmail').
419c2aa98e2SPeter WemmPROCMAIL_MAILER_FLAGS	[SPhnu9] Flags added to Procmail mailer.  Flags
42006f25ae9SGregory Neil Shapiro			DFM are always set.  This is NOT used by
4212e43090eSPeter Wemm			FEATURE(`local_procmail'); tweak LOCAL_MAILER_FLAGS
422c2aa98e2SPeter Wemm			instead.
423c2aa98e2SPeter WemmPROCMAIL_MAILER_ARGS	[procmail -Y -m $h $f $u] The arguments passed to
424c2aa98e2SPeter Wemm			the Procmail mailer.  This is NOT used by
4252e43090eSPeter Wemm			FEATURE(`local_procmail'); tweak LOCAL_MAILER_ARGS
426c2aa98e2SPeter Wemm			instead.
427c2aa98e2SPeter WemmPROCMAIL_MAILER_MAX	[undefined] If set, the maximum size message that
428c2aa98e2SPeter Wemm			will be accepted by the procmail mailer.
42940266059SGregory Neil ShapiroPROCMAIL_MAILER_QGRP	[undefined] The queue group for the procmail mailer.
430c2aa98e2SPeter WemmMAIL11_MAILER_PATH	[/usr/etc/mail11] The path to the mail11 mailer.
431c2aa98e2SPeter WemmMAIL11_MAILER_FLAGS	[nsFx] Flags for the mail11 mailer.
432c2aa98e2SPeter WemmMAIL11_MAILER_ARGS	[mail11 $g $x $h $u] Arguments passed to the mail11
433c2aa98e2SPeter Wemm			mailer.
43440266059SGregory Neil ShapiroMAIL11_MAILER_QGRP	[undefined] The queue group for the mail11 mailer.
435c2aa98e2SPeter WemmPH_MAILER_PATH		[/usr/local/etc/phquery] The path to the phquery
436c2aa98e2SPeter Wemm			program.
43706f25ae9SGregory Neil ShapiroPH_MAILER_FLAGS		[ehmu] Flags for the phquery mailer.  Flags nrDFM
43806f25ae9SGregory Neil Shapiro			are always set.
439c2aa98e2SPeter WemmPH_MAILER_ARGS		[phquery -- $u] -- arguments to the phquery mailer.
44040266059SGregory Neil ShapiroPH_MAILER_QGRP		[undefined] The queue group for the ph mailer.
44106f25ae9SGregory Neil ShapiroCYRUS_MAILER_FLAGS	[Ah5@/:|] The flags used by the cyrus mailer.  The
442c2aa98e2SPeter Wemm			flags lsDFMnPq are always included.
443c2aa98e2SPeter WemmCYRUS_MAILER_PATH	[/usr/cyrus/bin/deliver] The program used to deliver
444c2aa98e2SPeter Wemm			cyrus mail.
445c2aa98e2SPeter WemmCYRUS_MAILER_ARGS	[deliver -e -m $h -- $u] The arguments passed
446c2aa98e2SPeter Wemm			to deliver cyrus mail.
447c2aa98e2SPeter WemmCYRUS_MAILER_MAX	[undefined] If set, the maximum size message that
448c2aa98e2SPeter Wemm			will be accepted by the cyrus mailer.
449c2aa98e2SPeter WemmCYRUS_MAILER_USER	[cyrus:mail] The user and group to become when
450c2aa98e2SPeter Wemm			running the cyrus mailer.
45140266059SGregory Neil ShapiroCYRUS_MAILER_QGRP	[undefined] The queue group for the cyrus mailer.
45206f25ae9SGregory Neil ShapiroCYRUS_BB_MAILER_FLAGS	[u] The flags used by the cyrusbb mailer.
45306f25ae9SGregory Neil Shapiro			The flags lsDFMnP are always included.
454c2aa98e2SPeter WemmCYRUS_BB_MAILER_ARGS	[deliver -e -m $u] The arguments passed
455c2aa98e2SPeter Wemm			to deliver cyrusbb mail.
456c2aa98e2SPeter WemmconfEBINDIR		[/usr/libexec] The directory for executables.
4572e43090eSPeter Wemm			Currently used for FEATURE(`local_lmtp') and
4582e43090eSPeter Wemm			FEATURE(`smrsh').
45906f25ae9SGregory Neil ShapiroQPAGE_MAILER_FLAGS	[mDFMs] The flags used by the qpage mailer.
46006f25ae9SGregory Neil ShapiroQPAGE_MAILER_PATH	[/usr/local/bin/qpage] The program used to deliver
46106f25ae9SGregory Neil Shapiro			qpage mail.
46206f25ae9SGregory Neil ShapiroQPAGE_MAILER_ARGS	[qpage -l0 -m -P$u] The arguments passed
46306f25ae9SGregory Neil Shapiro			to deliver qpage mail.
46406f25ae9SGregory Neil ShapiroQPAGE_MAILER_MAX	[4096] If set, the maximum size message that
46506f25ae9SGregory Neil Shapiro			will be accepted by the qpage mailer.
46640266059SGregory Neil ShapiroQPAGE_MAILER_QGRP	[undefined] The queue group for the qpage mailer.
46740266059SGregory Neil ShapiroLOCAL_PROG_QGRP		[undefined] The queue group for the prog mailer.
468c2aa98e2SPeter Wemm
46906f25ae9SGregory Neil ShapiroNote: to tweak Name_MAILER_FLAGS use the macro MODIFY_MAILER_FLAGS:
47006f25ae9SGregory Neil ShapiroMODIFY_MAILER_FLAGS(`Name', `change') where Name is the first part of
47106f25ae9SGregory Neil Shapirothe macro Name_MAILER_FLAGS and change can be: flags that should
47206f25ae9SGregory Neil Shapirobe used directly (thus overriding the default value), or if it
47306f25ae9SGregory Neil Shapirostarts with `+' (`-') then those flags are added to (removed from)
47406f25ae9SGregory Neil Shapirothe default value.  Example:
47506f25ae9SGregory Neil Shapiro
47606f25ae9SGregory Neil Shapiro	MODIFY_MAILER_FLAGS(`LOCAL', `+e')
47706f25ae9SGregory Neil Shapiro
47840266059SGregory Neil Shapirowill add the flag `e' to LOCAL_MAILER_FLAGS.  Notice: there are
47940266059SGregory Neil Shapiroseveral smtp mailers all of which are manipulated individually.
48040266059SGregory Neil ShapiroSee the section MAILERS for the available mailer names.
48106f25ae9SGregory Neil ShapiroWARNING: The FEATUREs local_lmtp and local_procmail set LOCAL_MAILER_FLAGS
48206f25ae9SGregory Neil Shapirounconditionally, i.e., without respecting any definitions in an
48306f25ae9SGregory Neil ShapiroOSTYPE setting.
484c2aa98e2SPeter Wemm
485c2aa98e2SPeter Wemm
486c2aa98e2SPeter Wemm+---------+
487c2aa98e2SPeter Wemm| DOMAINS |
488c2aa98e2SPeter Wemm+---------+
489c2aa98e2SPeter Wemm
490c2aa98e2SPeter WemmYou will probably want to collect domain-dependent defines into one
49106f25ae9SGregory Neil Shapirofile, referenced by the DOMAIN macro.  For example, the Berkeley
492c2aa98e2SPeter Wemmdomain file includes definitions for several internal distinguished
493c2aa98e2SPeter Wemmhosts:
494c2aa98e2SPeter Wemm
495c2aa98e2SPeter WemmUUCP_RELAY	The host that will accept UUCP-addressed email.
496c2aa98e2SPeter Wemm		If not defined, all UUCP sites must be directly
497c2aa98e2SPeter Wemm		connected.
498c2aa98e2SPeter WemmBITNET_RELAY	The host that will accept BITNET-addressed email.
499c2aa98e2SPeter Wemm		If not defined, the .BITNET pseudo-domain won't work.
500c2aa98e2SPeter WemmDECNET_RELAY	The host that will accept DECNET-addressed email.
501c2aa98e2SPeter Wemm		If not defined, the .DECNET pseudo-domain and addresses
502c2aa98e2SPeter Wemm		of the form node::user will not work.
503c2aa98e2SPeter WemmFAX_RELAY	The host that will accept mail to the .FAX pseudo-domain.
504c2aa98e2SPeter Wemm		The "fax" mailer overrides this value.
505193538b7SGregory Neil ShapiroLOCAL_RELAY	The site that will handle unqualified names -- that
506193538b7SGregory Neil Shapiro		is, names without an @domain extension.
507193538b7SGregory Neil Shapiro		Normally MAIL_HUB is preferred for this function.
508193538b7SGregory Neil Shapiro		LOCAL_RELAY is mostly useful in conjunction with
50940266059SGregory Neil Shapiro		FEATURE(`stickyhost') -- see the discussion of
510193538b7SGregory Neil Shapiro		stickyhost below.  If not set, they are assumed to
511193538b7SGregory Neil Shapiro		belong on this machine.  This allows you to have a
512193538b7SGregory Neil Shapiro		central site to store a company- or department-wide
513193538b7SGregory Neil Shapiro		alias database.  This only works at small sites,
514193538b7SGregory Neil Shapiro		and only with some user agents.
515c2aa98e2SPeter WemmLUSER_RELAY	The site that will handle lusers -- that is, apparently
51606f25ae9SGregory Neil Shapiro		local names that aren't local accounts or aliases.  To
51706f25ae9SGregory Neil Shapiro		specify a local user instead of a site, set this to
51806f25ae9SGregory Neil Shapiro		``local:username''.
519c2aa98e2SPeter Wemm
520c2aa98e2SPeter WemmAny of these can be either ``mailer:hostname'' (in which case the
521c2aa98e2SPeter Wemmmailer is the internal mailer name, such as ``uucp-new'' and the hostname
522c2aa98e2SPeter Wemmis the name of the host as appropriate for that mailer) or just a
523c2aa98e2SPeter Wemm``hostname'', in which case a default mailer type (usually ``relay'',
524c2aa98e2SPeter Wemma variant on SMTP) is used.  WARNING: if you have a wildcard MX
525c2aa98e2SPeter Wemmrecord matching your domain, you probably want to define these to
526c2aa98e2SPeter Wemmhave a trailing dot so that you won't get the mail diverted back
527c2aa98e2SPeter Wemmto yourself.
528c2aa98e2SPeter Wemm
529c2aa98e2SPeter WemmThe domain file can also be used to define a domain name, if needed
530c2aa98e2SPeter Wemm(using "DD<domain>") and set certain site-wide features.  If all hosts
531c2aa98e2SPeter Wemmat your site masquerade behind one email name, you could also use
532c2aa98e2SPeter WemmMASQUERADE_AS here.
533c2aa98e2SPeter Wemm
534c2aa98e2SPeter WemmYou do not have to define a domain -- in particular, if you are a
535c2aa98e2SPeter Wemmsingle machine sitting off somewhere, it is probably more work than
536c2aa98e2SPeter Wemmit's worth.  This is just a mechanism for combining "domain dependent
537c2aa98e2SPeter Wemmknowledge" into one place.
538c2aa98e2SPeter Wemm
53940266059SGregory Neil Shapiro
540c2aa98e2SPeter Wemm+---------+
541c2aa98e2SPeter Wemm| MAILERS |
542c2aa98e2SPeter Wemm+---------+
543c2aa98e2SPeter Wemm
544c2aa98e2SPeter WemmThere are fewer mailers supported in this version than the previous
545c2aa98e2SPeter Wemmversion, owing mostly to a simpler world.  As a general rule, put the
54640266059SGregory Neil ShapiroMAILER definitions last in your .mc file.
547c2aa98e2SPeter Wemm
548c2aa98e2SPeter Wemmlocal		The local and prog mailers.  You will almost always
549c2aa98e2SPeter Wemm		need these; the only exception is if you relay ALL
550c2aa98e2SPeter Wemm		your mail to another site.  This mailer is included
551c2aa98e2SPeter Wemm		automatically.
552c2aa98e2SPeter Wemm
553c2aa98e2SPeter Wemmsmtp		The Simple Mail Transport Protocol mailer.  This does
554c2aa98e2SPeter Wemm		not hide hosts behind a gateway or another other
555c2aa98e2SPeter Wemm		such hack; it assumes a world where everyone is
556c2aa98e2SPeter Wemm		running the name server.  This file actually defines
55706f25ae9SGregory Neil Shapiro		five mailers: "smtp" for regular (old-style) SMTP to
558c2aa98e2SPeter Wemm		other servers, "esmtp" for extended SMTP to other
559c2aa98e2SPeter Wemm		servers, "smtp8" to do SMTP to other servers without
560c2aa98e2SPeter Wemm		converting 8-bit data to MIME (essentially, this is
561c2aa98e2SPeter Wemm		your statement that you know the other end is 8-bit
56206f25ae9SGregory Neil Shapiro		clean even if it doesn't say so), "dsmtp" to do on
56306f25ae9SGregory Neil Shapiro		demand delivery, and "relay" for transmission to the
56406f25ae9SGregory Neil Shapiro		RELAY_HOST, LUSER_RELAY, or MAIL_HUB.
565c2aa98e2SPeter Wemm
56642e5d165SGregory Neil Shapirouucp		The UNIX-to-UNIX Copy Program mailer.  Actually, this
567c2aa98e2SPeter Wemm		defines two mailers, "uucp-old" (a.k.a. "uucp") and
568c2aa98e2SPeter Wemm		"uucp-new" (a.k.a. "suucp").  The latter is for when you
569c2aa98e2SPeter Wemm		know that the UUCP mailer at the other end can handle
570c2aa98e2SPeter Wemm		multiple recipients in one transfer.  If the smtp mailer
57140266059SGregory Neil Shapiro		is included in your configuration, two other mailers
57240266059SGregory Neil Shapiro		("uucp-dom" and "uucp-uudom") are also defined [warning: you
57340266059SGregory Neil Shapiro		MUST specify MAILER(`smtp') before MAILER(`uucp')].  When you
574c2aa98e2SPeter Wemm		include the uucp mailer, sendmail looks for all names in
57506f25ae9SGregory Neil Shapiro		class {U} and sends them to the uucp-old mailer; all
57606f25ae9SGregory Neil Shapiro		names in class {Y} are sent to uucp-new; and all
57706f25ae9SGregory Neil Shapiro		names in class {Z} are sent to uucp-uudom.  Note that
578c2aa98e2SPeter Wemm		this is a function of what version of rmail runs on
579c2aa98e2SPeter Wemm		the receiving end, and hence may be out of your control.
580c2aa98e2SPeter Wemm		See the section below describing UUCP mailers in more
581c2aa98e2SPeter Wemm		detail.
582c2aa98e2SPeter Wemm
583c2aa98e2SPeter Wemmusenet		Usenet (network news) delivery.  If this is specified,
584c2aa98e2SPeter Wemm		an extra rule is added to ruleset 0 that forwards all
585c2aa98e2SPeter Wemm		local email for users named ``group.usenet'' to the
586c2aa98e2SPeter Wemm		``inews'' program.  Note that this works for all groups,
587c2aa98e2SPeter Wemm		and may be considered a security problem.
588c2aa98e2SPeter Wemm
589c2aa98e2SPeter Wemmfax		Facsimile transmission.  This is experimental and based
590c2aa98e2SPeter Wemm		on Sam Leffler's HylaFAX software.  For more information,
591193538b7SGregory Neil Shapiro		see http://www.hylafax.org/.
592c2aa98e2SPeter Wemm
593c2aa98e2SPeter Wemmpop		Post Office Protocol.
594c2aa98e2SPeter Wemm
595c2aa98e2SPeter Wemmprocmail	An interface to procmail (does not come with sendmail).
596c2aa98e2SPeter Wemm		This is designed to be used in mailertables.  For example,
597c2aa98e2SPeter Wemm		a common question is "how do I forward all mail for a given
598c2aa98e2SPeter Wemm		domain to a single person?".  If you have this mailer
599c2aa98e2SPeter Wemm		defined, you could set up a mailertable reading:
600c2aa98e2SPeter Wemm
601c2aa98e2SPeter Wemm			host.com	procmail:/etc/procmailrcs/host.com
602c2aa98e2SPeter Wemm
603c2aa98e2SPeter Wemm		with the file /etc/procmailrcs/host.com reading:
604c2aa98e2SPeter Wemm
605c2aa98e2SPeter Wemm			:0	# forward mail for host.com
606c2aa98e2SPeter Wemm			! -oi -f $1 person@other.host
607c2aa98e2SPeter Wemm
608c2aa98e2SPeter Wemm		This would arrange for (anything)@host.com to be sent
609c2aa98e2SPeter Wemm		to person@other.host.  Within the procmail script, $1 is
610c2aa98e2SPeter Wemm		the name of the sender and $2 is the name of the recipient.
6112e43090eSPeter Wemm		If you use this with FEATURE(`local_procmail'), the FEATURE
612c2aa98e2SPeter Wemm		should be listed first.
613c2aa98e2SPeter Wemm
61440266059SGregory Neil Shapiro		Of course there are other ways to solve this particular
61540266059SGregory Neil Shapiro		problem, e.g., a catch-all entry in a virtusertable.
61640266059SGregory Neil Shapiro
617c2aa98e2SPeter Wemmmail11		The DECnet mail11 mailer, useful only if you have the mail11
618c2aa98e2SPeter Wemm		program from gatekeeper.dec.com:/pub/DEC/gwtools (and
619c2aa98e2SPeter Wemm		DECnet, of course).  This is for Phase IV DECnet support;
620c2aa98e2SPeter Wemm		if you have Phase V at your site you may have additional
621c2aa98e2SPeter Wemm		problems.
622c2aa98e2SPeter Wemm
623c2aa98e2SPeter Wemmphquery		The phquery program.  This is somewhat counterintuitively
624c2aa98e2SPeter Wemm		referenced as the "ph" mailer internally.  It can be used
625c2aa98e2SPeter Wemm		to do CCSO name server lookups.  The phquery program, which
626c2aa98e2SPeter Wemm		this mailer uses, is distributed with the ph client.
627c2aa98e2SPeter Wemm
628c2aa98e2SPeter Wemmcyrus		The cyrus and cyrusbb mailers.  The cyrus mailer delivers to
629c2aa98e2SPeter Wemm		a local cyrus user.  this mailer can make use of the
63040266059SGregory Neil Shapiro		"user+detail@local.host" syntax (see
63140266059SGregory Neil Shapiro		FEATURE(`preserve_local_plus_detail')); it will deliver the
63240266059SGregory Neil Shapiro		mail to the user's "detail" mailbox if the mailbox's ACL
63340266059SGregory Neil Shapiro		permits.  The cyrusbb mailer delivers to a system-wide
63440266059SGregory Neil Shapiro		cyrus mailbox if the mailbox's ACL permits.  The cyrus
63540266059SGregory Neil Shapiro		mailer must be defined after the local mailer.
636c2aa98e2SPeter Wemm
63706f25ae9SGregory Neil Shapiroqpage		A mailer for QuickPage, a pager interface.  See
63806f25ae9SGregory Neil Shapiro		http://www.qpage.org/ for further information.
639c2aa98e2SPeter Wemm
640c2aa98e2SPeter WemmThe local mailer accepts addresses of the form "user+detail", where
641c2aa98e2SPeter Wemmthe "+detail" is not used for mailbox matching but is available
6422e43090eSPeter Wemmto certain local mail programs (in particular, see
6432e43090eSPeter WemmFEATURE(`local_procmail')).  For example, "eric", "eric+sendmail", and
6442e43090eSPeter Wemm"eric+sww" all indicate the same user, but additional arguments <null>,
6452e43090eSPeter Wemm"sendmail", and "sww" may be provided for use in sorting mail.
646c2aa98e2SPeter Wemm
647c2aa98e2SPeter Wemm
648c2aa98e2SPeter Wemm+----------+
649c2aa98e2SPeter Wemm| FEATURES |
650c2aa98e2SPeter Wemm+----------+
651c2aa98e2SPeter Wemm
652c2aa98e2SPeter WemmSpecial features can be requested using the "FEATURE" macro.  For
653c2aa98e2SPeter Wemmexample, the .mc line:
654c2aa98e2SPeter Wemm
6552e43090eSPeter Wemm	FEATURE(`use_cw_file')
656c2aa98e2SPeter Wemm
65706f25ae9SGregory Neil Shapirotells sendmail that you want to have it read an /etc/mail/local-host-names
65840266059SGregory Neil Shapirofile to get values for class {w}.  A FEATURE may contain up to 9
65906f25ae9SGregory Neil Shapirooptional parameters -- for example:
660c2aa98e2SPeter Wemm
6612e43090eSPeter Wemm	FEATURE(`mailertable', `dbm /usr/lib/mailertable')
662c2aa98e2SPeter Wemm
663c2aa98e2SPeter WemmThe default database map type for the table features can be set with
664c2aa98e2SPeter Wemm
665c2aa98e2SPeter Wemm	define(`DATABASE_MAP_TYPE', `dbm')
666c2aa98e2SPeter Wemm
667c2aa98e2SPeter Wemmwhich would set it to use ndbm databases.  The default is the Berkeley DB
668c2aa98e2SPeter Wemmhash database format.  Note that you must still declare a database map type
669c2aa98e2SPeter Wemmif you specify an argument to a FEATURE.  DATABASE_MAP_TYPE is only used
67006f25ae9SGregory Neil Shapiroif no argument is given for the FEATURE.  It must be specified before any
67106f25ae9SGregory Neil Shapirofeature that uses a map.
672c2aa98e2SPeter Wemm
67340266059SGregory Neil ShapiroAlso, features which can take a map definition as an argument can also take
67440266059SGregory Neil Shapirothe special keyword `LDAP'.  If that keyword is used, the map will use the
67540266059SGregory Neil ShapiroLDAP definition described in the ``USING LDAP FOR ALIASES, MAPS, AND
67640266059SGregory Neil ShapiroCLASSES'' section below.
67740266059SGregory Neil Shapiro
678c2aa98e2SPeter WemmAvailable features are:
679c2aa98e2SPeter Wemm
68006f25ae9SGregory Neil Shapirouse_cw_file	Read the file /etc/mail/local-host-names file to get
68106f25ae9SGregory Neil Shapiro		alternate names for this host.  This might be used if you
68206f25ae9SGregory Neil Shapiro		were on a host that MXed for a dynamic set of other hosts.
68306f25ae9SGregory Neil Shapiro		If the set is static, just including the line "Cw<name1>
68406f25ae9SGregory Neil Shapiro		<name2> ..." (where the names are fully qualified domain
68506f25ae9SGregory Neil Shapiro		names) is probably superior.  The actual filename can be
68606f25ae9SGregory Neil Shapiro		overridden by redefining confCW_FILE.
687c2aa98e2SPeter Wemm
68806f25ae9SGregory Neil Shapirouse_ct_file	Read the file /etc/mail/trusted-users file to get the
68906f25ae9SGregory Neil Shapiro		names of users that will be ``trusted'', that is, able to
69006f25ae9SGregory Neil Shapiro		set their envelope from address using -f without generating
69106f25ae9SGregory Neil Shapiro		a warning message.  The actual filename can be overridden
69206f25ae9SGregory Neil Shapiro		by redefining confCT_FILE.
693c2aa98e2SPeter Wemm
694c2aa98e2SPeter Wemmredirect	Reject all mail addressed to "address.REDIRECT" with
69506f25ae9SGregory Neil Shapiro		a ``551 User has moved; please try <address>'' message.
696c2aa98e2SPeter Wemm		If this is set, you can alias people who have left
697c2aa98e2SPeter Wemm		to their new address with ".REDIRECT" appended.
698c2aa98e2SPeter Wemm
69906f25ae9SGregory Neil Shapironouucp		Don't route UUCP addresses.  This feature takes one
70006f25ae9SGregory Neil Shapiro		parameter:
70106f25ae9SGregory Neil Shapiro		`reject': reject addresses which have "!" in the local
70206f25ae9SGregory Neil Shapiro			part unless it originates from a system
70306f25ae9SGregory Neil Shapiro			that is allowed to relay.
70406f25ae9SGregory Neil Shapiro		`nospecial': don't do anything special with "!".
70540266059SGregory Neil Shapiro		Warnings: 1. See the notice in the anti-spam section.
70606f25ae9SGregory Neil Shapiro		2. don't remove "!" from OperatorChars if `reject' is
70706f25ae9SGregory Neil Shapiro		given as parameter.
708c2aa98e2SPeter Wemm
70906f25ae9SGregory Neil Shapironocanonify	Don't pass addresses to $[ ... $] for canonification
710193538b7SGregory Neil Shapiro		by default, i.e., host/domain names are considered canonical,
711193538b7SGregory Neil Shapiro		except for unqualified names, which must not be used in this
712193538b7SGregory Neil Shapiro		mode (violation of the standard).  It can be changed by
713193538b7SGregory Neil Shapiro		setting the DaemonPortOptions modifiers (M=).  That is,
71406f25ae9SGregory Neil Shapiro		FEATURE(`nocanonify') will be overridden by setting the
71506f25ae9SGregory Neil Shapiro		'c' flag.  Conversely, if FEATURE(`nocanonify') is not used,
71606f25ae9SGregory Neil Shapiro		it can be emulated by setting the 'C' flag
71706f25ae9SGregory Neil Shapiro		(DaemonPortOptions=Modifiers=C).  This would generally only
71806f25ae9SGregory Neil Shapiro		be used by sites that only act as mail gateways or which have
71906f25ae9SGregory Neil Shapiro		user agents that do full canonification themselves.  You may
72006f25ae9SGregory Neil Shapiro		also want to use
72106f25ae9SGregory Neil Shapiro		"define(`confBIND_OPTS', `-DNSRCH -DEFNAMES')" to turn off
72206f25ae9SGregory Neil Shapiro		the usual resolver options that do a similar thing.
72306f25ae9SGregory Neil Shapiro
72406f25ae9SGregory Neil Shapiro		An exception list for FEATURE(`nocanonify') can be
72506f25ae9SGregory Neil Shapiro		specified with CANONIFY_DOMAIN or CANONIFY_DOMAIN_FILE,
72606f25ae9SGregory Neil Shapiro		i.e., a list of domains which are nevertheless passed to
72706f25ae9SGregory Neil Shapiro		$[ ... $] for canonification.  This is useful to turn on
72806f25ae9SGregory Neil Shapiro		canonification for local domains, e.g., use
72906f25ae9SGregory Neil Shapiro		CANONIFY_DOMAIN(`my.domain my') to canonify addresses
73006f25ae9SGregory Neil Shapiro		which end in "my.domain" or "my".
73106f25ae9SGregory Neil Shapiro		Another way to require canonification in the local
73206f25ae9SGregory Neil Shapiro		domain is CANONIFY_DOMAIN(`$=m').
73306f25ae9SGregory Neil Shapiro
73406f25ae9SGregory Neil Shapiro		A trailing dot is added to addresses with more than
73506f25ae9SGregory Neil Shapiro		one component in it such that other features which
73606f25ae9SGregory Neil Shapiro		expect a trailing dot (e.g., virtusertable) will
73706f25ae9SGregory Neil Shapiro		still work.
73806f25ae9SGregory Neil Shapiro
73906f25ae9SGregory Neil Shapiro		If `canonify_hosts' is specified as parameter, i.e.,
74006f25ae9SGregory Neil Shapiro		FEATURE(`nocanonify', `canonify_hosts'), then
74106f25ae9SGregory Neil Shapiro		addresses which have only a hostname, e.g.,
74206f25ae9SGregory Neil Shapiro		<user@host>, will be canonified (and hopefully fully
74306f25ae9SGregory Neil Shapiro		qualified), too.
744c2aa98e2SPeter Wemm
745193538b7SGregory Neil Shapirostickyhost	This feature is sometimes used with LOCAL_RELAY,
746193538b7SGregory Neil Shapiro		although it can be used for a different effect with
747193538b7SGregory Neil Shapiro		MAIL_HUB.
748193538b7SGregory Neil Shapiro
749602a2b1bSGregory Neil Shapiro		When used without MAIL_HUB, email sent to
750193538b7SGregory Neil Shapiro		"user@local.host" are marked as "sticky" -- that
751193538b7SGregory Neil Shapiro		is, the local addresses aren't matched against UDB,
752193538b7SGregory Neil Shapiro		don't go through ruleset 5, and are not forwarded to
753193538b7SGregory Neil Shapiro		the LOCAL_RELAY (if defined).
754193538b7SGregory Neil Shapiro
755193538b7SGregory Neil Shapiro		With MAIL_HUB, mail addressed to "user@local.host"
756193538b7SGregory Neil Shapiro		is forwarded to the mail hub, with the envelope
757193538b7SGregory Neil Shapiro		address still remaining "user@local.host".
758193538b7SGregory Neil Shapiro		Without stickyhost, the envelope would be changed
759193538b7SGregory Neil Shapiro		to "user@mail_hub", in order to protect against
760193538b7SGregory Neil Shapiro		mailing loops.
761c2aa98e2SPeter Wemm
762c2aa98e2SPeter Wemmmailertable	Include a "mailer table" which can be used to override
76306f25ae9SGregory Neil Shapiro		routing for particular domains (which are not in class {w},
76406f25ae9SGregory Neil Shapiro		i.e.  local host names).  The argument of the FEATURE may be
76506f25ae9SGregory Neil Shapiro		the key definition.  If none is specified, the definition
76606f25ae9SGregory Neil Shapiro		used is:
7672e43090eSPeter Wemm
76806f25ae9SGregory Neil Shapiro			hash /etc/mail/mailertable
7692e43090eSPeter Wemm
770c2aa98e2SPeter Wemm		Keys in this database are fully qualified domain names
771c2aa98e2SPeter Wemm		or partial domains preceded by a dot -- for example,
77206f25ae9SGregory Neil Shapiro		"vangogh.CS.Berkeley.EDU" or ".CS.Berkeley.EDU".  As a
77306f25ae9SGregory Neil Shapiro		special case of the latter, "." matches any domain not
77406f25ae9SGregory Neil Shapiro		covered by other keys.  Values must be of the form:
775c2aa98e2SPeter Wemm			mailer:domain
776c2aa98e2SPeter Wemm		where "mailer" is the internal mailer name, and "domain"
777c2aa98e2SPeter Wemm		is where to send the message.  These maps are not
778c2aa98e2SPeter Wemm		reflected into the message header.  As a special case,
779c2aa98e2SPeter Wemm		the forms:
780c2aa98e2SPeter Wemm			local:user
781c2aa98e2SPeter Wemm		will forward to the indicated user using the local mailer,
782c2aa98e2SPeter Wemm			local:
783c2aa98e2SPeter Wemm		will forward to the original user in the e-mail address
784c2aa98e2SPeter Wemm		using the local mailer, and
785c2aa98e2SPeter Wemm			error:code message
78606f25ae9SGregory Neil Shapiro			error:D.S.N:code message
78706f25ae9SGregory Neil Shapiro		will give an error message with the indicated SMTP reply
78806f25ae9SGregory Neil Shapiro		code and message, where D.S.N is an RFC 1893 compliant
78906f25ae9SGregory Neil Shapiro		error code.
790c2aa98e2SPeter Wemm
791c2aa98e2SPeter Wemmdomaintable	Include a "domain table" which can be used to provide
792c2aa98e2SPeter Wemm		domain name mapping.  Use of this should really be
793c2aa98e2SPeter Wemm		limited to your own domains.  It may be useful if you
794c2aa98e2SPeter Wemm		change names (e.g., your company changes names from
795c2aa98e2SPeter Wemm		oldname.com to newname.com).  The argument of the
796c2aa98e2SPeter Wemm		FEATURE may be the key definition.  If none is specified,
797c2aa98e2SPeter Wemm		the definition used is:
7982e43090eSPeter Wemm
79906f25ae9SGregory Neil Shapiro			hash /etc/mail/domaintable
8002e43090eSPeter Wemm
801c2aa98e2SPeter Wemm		The key in this table is the domain name; the value is
802c2aa98e2SPeter Wemm		the new (fully qualified) domain.  Anything in the
803c2aa98e2SPeter Wemm		domaintable is reflected into headers; that is, this
804c2aa98e2SPeter Wemm		is done in ruleset 3.
805c2aa98e2SPeter Wemm
806c2aa98e2SPeter Wemmbitdomain	Look up bitnet hosts in a table to try to turn them into
807c2aa98e2SPeter Wemm		internet addresses.  The table can be built using the
808c2aa98e2SPeter Wemm		bitdomain program contributed by John Gardiner Myers.
809c2aa98e2SPeter Wemm		The argument of the FEATURE may be the key definition; if
810c2aa98e2SPeter Wemm		none is specified, the definition used is:
8112e43090eSPeter Wemm
81206f25ae9SGregory Neil Shapiro			hash /etc/mail/bitdomain
8132e43090eSPeter Wemm
814c2aa98e2SPeter Wemm		Keys are the bitnet hostname; values are the corresponding
815c2aa98e2SPeter Wemm		internet hostname.
816c2aa98e2SPeter Wemm
817c2aa98e2SPeter Wemmuucpdomain	Similar feature for UUCP hosts.  The default map definition
818c2aa98e2SPeter Wemm		is:
8192e43090eSPeter Wemm
82006f25ae9SGregory Neil Shapiro			hash /etc/mail/uudomain
8212e43090eSPeter Wemm
822c2aa98e2SPeter Wemm		At the moment there is no automagic tool to build this
823c2aa98e2SPeter Wemm		database.
824c2aa98e2SPeter Wemm
825c2aa98e2SPeter Wemmalways_add_domain
826c2aa98e2SPeter Wemm		Include the local host domain even on locally delivered
827c2aa98e2SPeter Wemm		mail.  Normally it is not added on unqualified names.
828c2aa98e2SPeter Wemm		However, if you use a shared message store but do not use
829c2aa98e2SPeter Wemm		the same user name space everywhere, you may need the host
83040266059SGregory Neil Shapiro		name on local names.  An optional argument specifies
83140266059SGregory Neil Shapiro		another domain to be added than the local.
832c2aa98e2SPeter Wemm
833c2aa98e2SPeter Wemmallmasquerade	If masquerading is enabled (using MASQUERADE_AS), this
834c2aa98e2SPeter Wemm		feature will cause recipient addresses to also masquerade
835c2aa98e2SPeter Wemm		as being from the masquerade host.  Normally they get
836c2aa98e2SPeter Wemm		the local hostname.  Although this may be right for
837c2aa98e2SPeter Wemm		ordinary users, it can break local aliases.  For example,
838c2aa98e2SPeter Wemm		if you send to "localalias", the originating sendmail will
839c2aa98e2SPeter Wemm		find that alias and send to all members, but send the
840c2aa98e2SPeter Wemm		message with "To: localalias@masqueradehost".  Since that
841c2aa98e2SPeter Wemm		alias likely does not exist, replies will fail.  Use this
842c2aa98e2SPeter Wemm		feature ONLY if you can guarantee that the ENTIRE
843c2aa98e2SPeter Wemm		namespace on your masquerade host supersets all the
844c2aa98e2SPeter Wemm		local entries.
845c2aa98e2SPeter Wemm
846c2aa98e2SPeter Wemmlimited_masquerade
84706f25ae9SGregory Neil Shapiro		Normally, any hosts listed in class {w} are masqueraded.  If
84806f25ae9SGregory Neil Shapiro		this feature is given, only the hosts listed in class {M} (see
84906f25ae9SGregory Neil Shapiro		below:  MASQUERADE_DOMAIN) are masqueraded.  This is useful
85006f25ae9SGregory Neil Shapiro		if you have several domains with disjoint namespaces hosted
85106f25ae9SGregory Neil Shapiro		on the same machine.
852c2aa98e2SPeter Wemm
853c2aa98e2SPeter Wemmmasquerade_entire_domain
854c2aa98e2SPeter Wemm		If masquerading is enabled (using MASQUERADE_AS) and
855c2aa98e2SPeter Wemm		MASQUERADE_DOMAIN (see below) is set, this feature will
856c2aa98e2SPeter Wemm		cause addresses to be rewritten such that the masquerading
857c2aa98e2SPeter Wemm		domains are actually entire domains to be hidden.  All
858c2aa98e2SPeter Wemm		hosts within the masquerading domains will be rewritten
859c2aa98e2SPeter Wemm		to the masquerade name (used in MASQUERADE_AS).  For example,
860c2aa98e2SPeter Wemm		if you have:
861c2aa98e2SPeter Wemm
86206f25ae9SGregory Neil Shapiro			MASQUERADE_AS(`masq.com')
86306f25ae9SGregory Neil Shapiro			MASQUERADE_DOMAIN(`foo.org')
86406f25ae9SGregory Neil Shapiro			MASQUERADE_DOMAIN(`bar.com')
865c2aa98e2SPeter Wemm
866c2aa98e2SPeter Wemm		then *foo.org and *bar.com are converted to masq.com.  Without
867c2aa98e2SPeter Wemm		this feature, only foo.org and bar.com are masqueraded.
868c2aa98e2SPeter Wemm
869c2aa98e2SPeter Wemm		    NOTE: only domains within your jurisdiction and
870c2aa98e2SPeter Wemm		    current hierarchy should be masqueraded using this.
871c2aa98e2SPeter Wemm
87240266059SGregory Neil Shapirolocal_no_masquerade
87340266059SGregory Neil Shapiro		This feature prevents the local mailer from masquerading even
87440266059SGregory Neil Shapiro		if MASQUERADE_AS is used.  MASQUERADE_AS will only have effect
87540266059SGregory Neil Shapiro		on addresses of mail going outside the local domain.
87640266059SGregory Neil Shapiro
87706f25ae9SGregory Neil Shapirogenericstable	This feature will cause unqualified addresses (i.e., without
87806f25ae9SGregory Neil Shapiro		a domain) and addresses with a domain listed in class {G}
87906f25ae9SGregory Neil Shapiro		to be looked up in a map and turned into another ("generic")
88006f25ae9SGregory Neil Shapiro		form, which can change both the domain name and the user name.
88140266059SGregory Neil Shapiro		Notice: if you use an MSP (as it is default starting with
88240266059SGregory Neil Shapiro		8.12), the MTA will only receive qualified addresses from the
88340266059SGregory Neil Shapiro		MSP (as required by the RFCs).  Hence you need to add your
88440266059SGregory Neil Shapiro		domain to class {G}.  This feature is similar to the userdb
88540266059SGregory Neil Shapiro		functionality.  The same types of addresses as for
88640266059SGregory Neil Shapiro		masquerading are looked up, i.e., only header sender
88740266059SGregory Neil Shapiro		addresses unless the allmasquerade and/or masquerade_envelope
88840266059SGregory Neil Shapiro		features are given.  Qualified addresses must have the domain
88940266059SGregory Neil Shapiro		part in class {G}; entries can be added to this class by the
89040266059SGregory Neil Shapiro		macros GENERICS_DOMAIN or GENERICS_DOMAIN_FILE (analogously
89140266059SGregory Neil Shapiro		to MASQUERADE_DOMAIN and MASQUERADE_DOMAIN_FILE, see below).
892c2aa98e2SPeter Wemm
8932e43090eSPeter Wemm		The argument of FEATURE(`genericstable') may be the map
894c2aa98e2SPeter Wemm		definition; the default map definition is:
895c2aa98e2SPeter Wemm
89606f25ae9SGregory Neil Shapiro			hash /etc/mail/genericstable
897c2aa98e2SPeter Wemm
89806f25ae9SGregory Neil Shapiro		The key for this table is either the full address, the domain
89906f25ae9SGregory Neil Shapiro		(with a leading @; the localpart is passed as first argument)
90006f25ae9SGregory Neil Shapiro		or the unqualified username (tried in the order mentioned);
90106f25ae9SGregory Neil Shapiro		the value is the new user address.  If the new user address
90206f25ae9SGregory Neil Shapiro		does not include a domain, it will be qualified in the standard
90306f25ae9SGregory Neil Shapiro		manner, i.e., using $j or the masquerade name.  Note that the
904c2aa98e2SPeter Wemm		address being looked up must be fully qualified.  For local
9052e43090eSPeter Wemm		mail, it is necessary to use FEATURE(`always_add_domain')
9062e43090eSPeter Wemm		for the addresses to be qualified.
90706f25ae9SGregory Neil Shapiro		The "+detail" of an address is passed as %1, so entries like
90806f25ae9SGregory Neil Shapiro
90906f25ae9SGregory Neil Shapiro			old+*@foo.org	new+%1@example.com
91006f25ae9SGregory Neil Shapiro			gen+*@foo.org	%1@example.com
91106f25ae9SGregory Neil Shapiro
91206f25ae9SGregory Neil Shapiro		and other forms are possible.
91306f25ae9SGregory Neil Shapiro
91406f25ae9SGregory Neil Shapirogenerics_entire_domain
91506f25ae9SGregory Neil Shapiro		If the genericstable is enabled and GENERICS_DOMAIN or
91606f25ae9SGregory Neil Shapiro		GENERICS_DOMAIN_FILE is used, this feature will cause
91706f25ae9SGregory Neil Shapiro		addresses to be searched in the map if their domain
91806f25ae9SGregory Neil Shapiro		parts are subdomains of elements in class {G}.
919c2aa98e2SPeter Wemm
920c2aa98e2SPeter Wemmvirtusertable	A domain-specific form of aliasing, allowing multiple
921c2aa98e2SPeter Wemm		virtual domains to be hosted on one machine.  For example,
922c2aa98e2SPeter Wemm		if the virtuser table contained:
923c2aa98e2SPeter Wemm
924c2aa98e2SPeter Wemm			info@foo.com	foo-info
925c2aa98e2SPeter Wemm			info@bar.com	bar-info
92640266059SGregory Neil Shapiro			joe@bar.com	error:nouser 550 No such user here
92740266059SGregory Neil Shapiro			jax@bar.com	error:5.7.0:550 Address invalid
92806f25ae9SGregory Neil Shapiro			@baz.org	jane@example.net
929c2aa98e2SPeter Wemm
930c2aa98e2SPeter Wemm		then mail addressed to info@foo.com will be sent to the
931c2aa98e2SPeter Wemm		address foo-info, mail addressed to info@bar.com will be
93206f25ae9SGregory Neil Shapiro		delivered to bar-info, and mail addressed to anyone at baz.org
93306f25ae9SGregory Neil Shapiro		will be sent to jane@example.net, mail to joe@bar.com will
93406f25ae9SGregory Neil Shapiro		be rejected with the specified error message, and mail to
93506f25ae9SGregory Neil Shapiro		jax@bar.com will also have a RFC 1893 compliant error code
93640266059SGregory Neil Shapiro		5.7.0.
937c2aa98e2SPeter Wemm
93806f25ae9SGregory Neil Shapiro		The username from the original address is passed
93906f25ae9SGregory Neil Shapiro		as %1 allowing:
940c2aa98e2SPeter Wemm
94106f25ae9SGregory Neil Shapiro			@foo.org	%1@example.com
94206f25ae9SGregory Neil Shapiro
94306f25ae9SGregory Neil Shapiro		meaning someone@foo.org will be sent to someone@example.com.
94406f25ae9SGregory Neil Shapiro		Additionally, if the local part consists of "user+detail"
94540266059SGregory Neil Shapiro		then "detail" is passed as %2 and "+detail" is passed as %3
94640266059SGregory Neil Shapiro		when a match against user+* is attempted, so entries like
94706f25ae9SGregory Neil Shapiro
94806f25ae9SGregory Neil Shapiro			old+*@foo.org	new+%2@example.com
94906f25ae9SGregory Neil Shapiro			gen+*@foo.org	%2@example.com
95040266059SGregory Neil Shapiro			+*@foo.org	%1%3@example.com
95140266059SGregory Neil Shapiro			X++@foo.org	Z%3@example.com
95240266059SGregory Neil Shapiro			@bar.org	%1%3
95306f25ae9SGregory Neil Shapiro
95406f25ae9SGregory Neil Shapiro		and other forms are possible.  Note: to preserve "+detail"
95540266059SGregory Neil Shapiro		for a default case (@domain) %1%3 must be used as RHS.
95640266059SGregory Neil Shapiro		There are two wildcards after "+": "+" matches only a non-empty
95740266059SGregory Neil Shapiro		detail, "*" matches also empty details, e.g., user+@foo.org
95840266059SGregory Neil Shapiro		matches +*@foo.org but not ++@foo.org.  This can be used
95940266059SGregory Neil Shapiro		to ensure that the parameters %2 and %3 are not empty.
960c2aa98e2SPeter Wemm
961c2aa98e2SPeter Wemm		All the host names on the left hand side (foo.com, bar.com,
96240266059SGregory Neil Shapiro		and baz.org) must be in class {w} or class {VirtHost}.  The
96306f25ae9SGregory Neil Shapiro		latter can be defined by the macros VIRTUSER_DOMAIN or
96406f25ae9SGregory Neil Shapiro		VIRTUSER_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
96506f25ae9SGregory Neil Shapiro		MASQUERADE_DOMAIN_FILE, see below).  If VIRTUSER_DOMAIN or
96606f25ae9SGregory Neil Shapiro		VIRTUSER_DOMAIN_FILE is used, then the entries of class
96706f25ae9SGregory Neil Shapiro		{VirtHost} are added to class {R}, i.e., relaying is allowed
96806f25ae9SGregory Neil Shapiro		to (and from) those domains.  The default map definition is:
969c2aa98e2SPeter Wemm
97006f25ae9SGregory Neil Shapiro			hash /etc/mail/virtusertable
971c2aa98e2SPeter Wemm
972c2aa98e2SPeter Wemm		A new definition can be specified as the second argument of
973c2aa98e2SPeter Wemm		the FEATURE macro, such as
974c2aa98e2SPeter Wemm
97506f25ae9SGregory Neil Shapiro			FEATURE(`virtusertable', `dbm /etc/mail/virtusers')
976c2aa98e2SPeter Wemm
97706f25ae9SGregory Neil Shapirovirtuser_entire_domain
97806f25ae9SGregory Neil Shapiro		If the virtusertable is enabled and VIRTUSER_DOMAIN or
97906f25ae9SGregory Neil Shapiro		VIRTUSER_DOMAIN_FILE is used, this feature will cause
98006f25ae9SGregory Neil Shapiro		addresses to be searched in the map if their domain
98106f25ae9SGregory Neil Shapiro		parts are subdomains of elements in class {VirtHost}.
98206f25ae9SGregory Neil Shapiro
98306f25ae9SGregory Neil Shapiroldap_routing	Implement LDAP-based e-mail recipient routing according to
98406f25ae9SGregory Neil Shapiro		the Internet Draft draft-lachman-laser-ldap-mail-routing-01.
98506f25ae9SGregory Neil Shapiro		This provides a method to re-route addresses with a
98606f25ae9SGregory Neil Shapiro		domain portion in class {LDAPRoute} to either a
98706f25ae9SGregory Neil Shapiro		different mail host or a different address.  Hosts can
98806f25ae9SGregory Neil Shapiro		be added to this class using LDAPROUTE_DOMAIN and
98906f25ae9SGregory Neil Shapiro		LDAPROUTE_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
99006f25ae9SGregory Neil Shapiro		MASQUERADE_DOMAIN_FILE, see below).
99106f25ae9SGregory Neil Shapiro
99206f25ae9SGregory Neil Shapiro		See the LDAP ROUTING section below for more information.
99306f25ae9SGregory Neil Shapiro
99406f25ae9SGregory Neil Shapironodns		If you aren't running DNS at your site (for example,
99506f25ae9SGregory Neil Shapiro		you are UUCP-only connected).  It's hard to consider
996c2aa98e2SPeter Wemm		this a "feature", but hey, it had to go somewhere.
997c2aa98e2SPeter Wemm		Actually, as of 8.7 this is a no-op -- remove "dns" from
998c2aa98e2SPeter Wemm		the hosts service switch entry instead.
999c2aa98e2SPeter Wemm
100006f25ae9SGregory Neil Shapironullclient	This is a special case -- it creates a configuration file
100106f25ae9SGregory Neil Shapiro		containing nothing but support for forwarding all mail to a
100206f25ae9SGregory Neil Shapiro		central hub via a local SMTP-based network.  The argument
100306f25ae9SGregory Neil Shapiro		is the name of that hub.
1004c2aa98e2SPeter Wemm
1005c2aa98e2SPeter Wemm		The only other feature that should be used in conjunction
100606f25ae9SGregory Neil Shapiro		with this one is FEATURE(`nocanonify').  No mailers
1007c2aa98e2SPeter Wemm		should be defined.  No aliasing or forwarding is done.
1008c2aa98e2SPeter Wemm
1009c2aa98e2SPeter Wemmlocal_lmtp	Use an LMTP capable local mailer.  The argument to this
1010c2aa98e2SPeter Wemm		feature is the pathname of an LMTP capable mailer.  By
1011c2aa98e2SPeter Wemm		default, mail.local is used.  This is expected to be the
1012c2aa98e2SPeter Wemm		mail.local which came with the 8.9 distribution which is
1013c2aa98e2SPeter Wemm		LMTP capable.  The path to mail.local is set by the
1014c2aa98e2SPeter Wemm		confEBINDIR m4 variable -- making the default
1015c2aa98e2SPeter Wemm		LOCAL_MAILER_PATH /usr/libexec/mail.local.
101606f25ae9SGregory Neil Shapiro		WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally,
101706f25ae9SGregory Neil Shapiro		i.e., without respecting any definitions in an OSTYPE setting.
1018c2aa98e2SPeter Wemm
101906f25ae9SGregory Neil Shapirolocal_procmail	Use procmail or another delivery agent as the local mailer.
102006f25ae9SGregory Neil Shapiro		The argument to this feature is the pathname of the
102106f25ae9SGregory Neil Shapiro		delivery agent, which defaults to PROCMAIL_MAILER_PATH.
102206f25ae9SGregory Neil Shapiro		Note that this does NOT use PROCMAIL_MAILER_FLAGS or
102306f25ae9SGregory Neil Shapiro		PROCMAIL_MAILER_ARGS for the local mailer; tweak
102406f25ae9SGregory Neil Shapiro		LOCAL_MAILER_FLAGS and LOCAL_MAILER_ARGS instead, or
102506f25ae9SGregory Neil Shapiro		specify the appropriate parameters.  When procmail is used,
102606f25ae9SGregory Neil Shapiro		the local mailer can make use of the
102706f25ae9SGregory Neil Shapiro		"user+indicator@local.host" syntax; normally the +indicator
102806f25ae9SGregory Neil Shapiro		is just tossed, but by default it is passed as the -a
102906f25ae9SGregory Neil Shapiro		argument to procmail.
103006f25ae9SGregory Neil Shapiro
103106f25ae9SGregory Neil Shapiro		This feature can take up to three arguments:
103206f25ae9SGregory Neil Shapiro
103306f25ae9SGregory Neil Shapiro		1. Path to the mailer program
103406f25ae9SGregory Neil Shapiro		   [default: /usr/local/bin/procmail]
103506f25ae9SGregory Neil Shapiro		2. Argument vector including name of the program
103606f25ae9SGregory Neil Shapiro		   [default: procmail -Y -a $h -d $u]
103706f25ae9SGregory Neil Shapiro		3. Flags for the mailer [default: SPfhn9]
103806f25ae9SGregory Neil Shapiro
103906f25ae9SGregory Neil Shapiro		Empty arguments cause the defaults to be taken.
104006f25ae9SGregory Neil Shapiro
104106f25ae9SGregory Neil Shapiro		For example, this allows it to use the maildrop
104206f25ae9SGregory Neil Shapiro		(http://www.flounder.net/~mrsam/maildrop/) mailer instead
104306f25ae9SGregory Neil Shapiro		by specifying:
104406f25ae9SGregory Neil Shapiro
104506f25ae9SGregory Neil Shapiro		FEATURE(`local_procmail', `/usr/local/bin/maildrop',
104606f25ae9SGregory Neil Shapiro		 `maildrop -d $u')
104706f25ae9SGregory Neil Shapiro
104806f25ae9SGregory Neil Shapiro		or scanmails using:
104906f25ae9SGregory Neil Shapiro
105006f25ae9SGregory Neil Shapiro		FEATURE(`local_procmail', `/usr/local/bin/scanmails')
105106f25ae9SGregory Neil Shapiro
105206f25ae9SGregory Neil Shapiro		WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally,
105306f25ae9SGregory Neil Shapiro		i.e.,  without respecting any definitions in an OSTYPE setting.
1054c2aa98e2SPeter Wemm
1055c2aa98e2SPeter Wemmbestmx_is_local	Accept mail as though locally addressed for any host that
1056c2aa98e2SPeter Wemm		lists us as the best possible MX record.  This generates
1057c2aa98e2SPeter Wemm		additional DNS traffic, but should be OK for low to
1058c2aa98e2SPeter Wemm		medium traffic hosts.  The argument may be a set of
1059c2aa98e2SPeter Wemm		domains, which will limit the feature to only apply to
1060c2aa98e2SPeter Wemm		these domains -- this will reduce unnecessary DNS
1061c2aa98e2SPeter Wemm		traffic.  THIS FEATURE IS FUNDAMENTALLY INCOMPATIBLE WITH
1062c2aa98e2SPeter Wemm		WILDCARD MX RECORDS!!!  If you have a wildcard MX record
1063c2aa98e2SPeter Wemm		that matches your domain, you cannot use this feature.
1064c2aa98e2SPeter Wemm
1065c2aa98e2SPeter Wemmsmrsh		Use the SendMail Restricted SHell (smrsh) provided
1066c2aa98e2SPeter Wemm		with the distribution instead of /bin/sh for mailing
1067c2aa98e2SPeter Wemm		to programs.  This improves the ability of the local
1068c2aa98e2SPeter Wemm		system administrator to control what gets run via
1069c2aa98e2SPeter Wemm		e-mail.  If an argument is provided it is used as the
1070c2aa98e2SPeter Wemm		pathname to smrsh; otherwise, the path defined by
1071c2aa98e2SPeter Wemm		confEBINDIR is used for the smrsh binary -- by default,
1072c2aa98e2SPeter Wemm		/usr/libexec/smrsh is assumed.
1073c2aa98e2SPeter Wemm
1074c2aa98e2SPeter Wemmpromiscuous_relay
1075c2aa98e2SPeter Wemm		By default, the sendmail configuration files do not permit
1076c2aa98e2SPeter Wemm		mail relaying (that is, accepting mail from outside your
107706f25ae9SGregory Neil Shapiro		local host (class {w}) and sending it to another host than
107806f25ae9SGregory Neil Shapiro		your local host).  This option sets your site to allow
107906f25ae9SGregory Neil Shapiro		mail relaying from any site to any site.  In almost all
108006f25ae9SGregory Neil Shapiro		cases, it is better to control relaying more carefully
108106f25ae9SGregory Neil Shapiro		with the access map, class {R}, or authentication.  Domains
108206f25ae9SGregory Neil Shapiro		can be added to class {R} by the macros RELAY_DOMAIN or
108306f25ae9SGregory Neil Shapiro		RELAY_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
108406f25ae9SGregory Neil Shapiro		MASQUERADE_DOMAIN_FILE, see below).
1085c2aa98e2SPeter Wemm
1086c2aa98e2SPeter Wemmrelay_entire_domain
1087c2aa98e2SPeter Wemm		By default, only hosts listed as RELAY in the access db
1088c2aa98e2SPeter Wemm		will be allowed to relay.  This option also allows any
108906f25ae9SGregory Neil Shapiro		host in your domain as defined by class {m}.
1090605302a5SGregory Neil Shapiro		Notice: make sure that your domain is not just a top level
1091605302a5SGregory Neil Shapiro		domain, e.g., com.  This can happen if you give your
1092605302a5SGregory Neil Shapiro		host a name like example.com instead of host.example.com.
1093c2aa98e2SPeter Wemm
1094c2aa98e2SPeter Wemmrelay_hosts_only
1095c2aa98e2SPeter Wemm		By default, names that are listed as RELAY in the access
109606f25ae9SGregory Neil Shapiro		db and class {R} are domain names, not host names.
1097c2aa98e2SPeter Wemm		For example, if you specify ``foo.com'', then mail to or
1098c2aa98e2SPeter Wemm		from foo.com, abc.foo.com, or a.very.deep.domain.foo.com
1099c2aa98e2SPeter Wemm		will all be accepted for relaying.  This feature changes
1100c2aa98e2SPeter Wemm		the behaviour to lookup individual host names only.
1101c2aa98e2SPeter Wemm
1102c2aa98e2SPeter Wemmrelay_based_on_MX
1103c2aa98e2SPeter Wemm		Turns on the ability to allow relaying based on the MX
1104065a643dSPeter Wemm		records of the host portion of an incoming recipient; that
1105065a643dSPeter Wemm		is, if an MX record for host foo.com points to your site,
1106065a643dSPeter Wemm		you will accept and relay mail addressed to foo.com.  See
1107c2aa98e2SPeter Wemm		description below for more information before using this
1108065a643dSPeter Wemm		feature.  Also, see the KNOWNBUGS entry regarding bestmx
1109065a643dSPeter Wemm		map lookups.
1110065a643dSPeter Wemm
11112e43090eSPeter Wemm		FEATURE(`relay_based_on_MX') does not necessarily allow
1112065a643dSPeter Wemm		routing of these messages which you expect to be allowed,
1113065a643dSPeter Wemm		if route address syntax (or %-hack syntax) is used.  If
1114065a643dSPeter Wemm		this is a problem, add entries to the access-table or use
11152e43090eSPeter Wemm		FEATURE(`loose_relay_check').
1116c2aa98e2SPeter Wemm
111706f25ae9SGregory Neil Shapirorelay_mail_from
111806f25ae9SGregory Neil Shapiro		Allows relaying if the mail sender is listed as RELAY in
111906f25ae9SGregory Neil Shapiro		the access map.  If an optional argument `domain' is given,
112040266059SGregory Neil Shapiro		relaying can be allowed just based on the domain portion
112140266059SGregory Neil Shapiro		of the sender address.  This feature should only be used if
112240266059SGregory Neil Shapiro		absolutely necessary as the sender address can be easily
112340266059SGregory Neil Shapiro		forged.  Use of this feature requires the "From:" tag be
112440266059SGregory Neil Shapiro		prepended to the key in the access map; see the discussion
112540266059SGregory Neil Shapiro		of tags and FEATURE(`relay_mail_from') in the section on
112640266059SGregory Neil Shapiro		anti-spam configuration control.
112706f25ae9SGregory Neil Shapiro
1128c2aa98e2SPeter Wemmrelay_local_from
1129c2aa98e2SPeter Wemm		Allows relaying if the domain portion of the mail sender
1130c2aa98e2SPeter Wemm		is a local host.  This should only be used if absolutely
1131065a643dSPeter Wemm		necessary as it opens a window for spammers.  Specifically,
1132065a643dSPeter Wemm		they can send mail to your mail server that claims to be
1133065a643dSPeter Wemm		from your domain (either directly or via a routed address),
1134065a643dSPeter Wemm		and you will go ahead and relay it out to arbitrary hosts
1135065a643dSPeter Wemm		on the Internet.
1136c2aa98e2SPeter Wemm
1137c2aa98e2SPeter Wemmaccept_unqualified_senders
1138c2aa98e2SPeter Wemm		Normally, MAIL FROM: commands in the SMTP session will be
1139c2aa98e2SPeter Wemm		refused if the connection is a network connection and the
1140c2aa98e2SPeter Wemm		sender address does not include a domain name.  If your
114106f25ae9SGregory Neil Shapiro		setup sends local mail unqualified (i.e., MAIL FROM: <joe>),
1142c2aa98e2SPeter Wemm		you will need to use this feature to accept unqualified
114306f25ae9SGregory Neil Shapiro		sender addresses.  Setting the DaemonPortOptions modifier
114406f25ae9SGregory Neil Shapiro		'u' overrides the default behavior, i.e., unqualified
114506f25ae9SGregory Neil Shapiro		addresses are accepted even without this FEATURE.
114606f25ae9SGregory Neil Shapiro		If this FEATURE is not used, the DaemonPortOptions modifier
114706f25ae9SGregory Neil Shapiro		'f' can be used to enforce fully qualified addresses.
1148c2aa98e2SPeter Wemm
1149c2aa98e2SPeter Wemmaccept_unresolvable_domains
1150c2aa98e2SPeter Wemm		Normally, MAIL FROM: commands in the SMTP session will be
115106f25ae9SGregory Neil Shapiro		refused if the host part of the argument to MAIL FROM:
115206f25ae9SGregory Neil Shapiro		cannot be located in the host name service (e.g., an A or
115306f25ae9SGregory Neil Shapiro		MX record in DNS).  If you are inside a firewall that has
115406f25ae9SGregory Neil Shapiro		only a limited view of the Internet host name space, this
115506f25ae9SGregory Neil Shapiro		could cause problems.  In this case you probably want to
115606f25ae9SGregory Neil Shapiro		use this feature to accept all domains on input, even if
115706f25ae9SGregory Neil Shapiro		they are unresolvable.
1158c2aa98e2SPeter Wemm
1159c2aa98e2SPeter Wemmaccess_db	Turns on the access database feature.  The access db gives
1160c2aa98e2SPeter Wemm		you the ability to allow or refuse to accept mail from
116140266059SGregory Neil Shapiro		specified domains for administrative reasons.  Moreover,
116240266059SGregory Neil Shapiro		it can control the behavior of sendmail in various situations.
116340266059SGregory Neil Shapiro		By default, the access database specification is:
11642e43090eSPeter Wemm
116540266059SGregory Neil Shapiro			hash -T<TMPF> /etc/mail/access
11662e43090eSPeter Wemm
116740266059SGregory Neil Shapiro		See the anti-spam configuration control section for further
116840266059SGregory Neil Shapiro		important information about this feature.  Notice:
116940266059SGregory Neil Shapiro		"-T<TMPF>" is meant literal, do not replace it by anything.
1170c2aa98e2SPeter Wemm
1171c2aa98e2SPeter Wemmblacklist_recipients
1172c2aa98e2SPeter Wemm		Turns on the ability to block incoming mail for certain
1173c2aa98e2SPeter Wemm		recipient usernames, hostnames, or addresses.  For
1174c2aa98e2SPeter Wemm		example, you can block incoming mail to user nobody,
1175c2aa98e2SPeter Wemm		host foo.mydomain.com, or guest@bar.mydomain.com.
1176c2aa98e2SPeter Wemm		These specifications are put in the access db as
117706f25ae9SGregory Neil Shapiro		described in the anti-spam configuration control section
117806f25ae9SGregory Neil Shapiro		later in this document.
1179c2aa98e2SPeter Wemm
1180193538b7SGregory Neil Shapirodelay_checks	The rulesets check_mail and check_relay will not be called
1181193538b7SGregory Neil Shapiro		when a client connects or issues a MAIL command, respectively.
1182193538b7SGregory Neil Shapiro		Instead, those rulesets will be called by the check_rcpt
1183193538b7SGregory Neil Shapiro		ruleset; they will be skipped under certain circumstances.
118440266059SGregory Neil Shapiro		See "Delay all checks" in the anti-spam configuration control
118540266059SGregory Neil Shapiro		section.  Note: this feature is incompatible to the versions
118640266059SGregory Neil Shapiro		in 8.10 and 8.11.
1187c2aa98e2SPeter Wemm
118806f25ae9SGregory Neil Shapirodnsbl		Turns on rejection of hosts found in an DNS based rejection
118906f25ae9SGregory Neil Shapiro		list.  If an argument is provided it is used as the domain
119006f25ae9SGregory Neil Shapiro		in which blocked hosts are listed; otherwise it defaults to
1191193538b7SGregory Neil Shapiro		blackholes.mail-abuse.org.  An explanation for an DNS based
119240266059SGregory Neil Shapiro		rejection list can be found at http://mail-abuse.org/rbl/.
119340266059SGregory Neil Shapiro		A second argument can be used to change the default error
119440266059SGregory Neil Shapiro		message.  Without that second argument, the error message
119540266059SGregory Neil Shapiro		will be
119640266059SGregory Neil Shapiro			Mail from IP-ADDRESS refused by blackhole site SERVER
119740266059SGregory Neil Shapiro		where IP-ADDRESS and SERVER are replaced by the appropriate
119840266059SGregory Neil Shapiro		information.  By default, temporary lookup failures are
119940266059SGregory Neil Shapiro		ignored.  This behavior can be changed by specifying a
120040266059SGregory Neil Shapiro		third argument, which must be either `t' or a full error
120140266059SGregory Neil Shapiro		message.  See the anti-spam configuration control section for
120240266059SGregory Neil Shapiro		an example.  The dnsbl feature can be included several times
120340266059SGregory Neil Shapiro		to query different DNS based rejection lists.  See also
120440266059SGregory Neil Shapiro		enhdnsbl for an enhanced version.
120506f25ae9SGregory Neil Shapiro
120613058a91SGregory Neil Shapiro		NOTE: The default DNS blacklist, blackholes.mail-abuse.org,
120713058a91SGregory Neil Shapiro		is a service offered by the Mail Abuse Prevention System
120813058a91SGregory Neil Shapiro		(MAPS).  As of July 31, 2001, MAPS is a subscription
120913058a91SGregory Neil Shapiro		service, so using that network address won't work if you
121013058a91SGregory Neil Shapiro		haven't subscribed.  Contact MAPS to subscribe
121113058a91SGregory Neil Shapiro		(http://mail-abuse.org/).
121213058a91SGregory Neil Shapiro
121340266059SGregory Neil Shapiroenhdnsbl	Enhanced version of dnsbl (see above).  Further arguments
121440266059SGregory Neil Shapiro		(up to 5) can be used to specify specific return values
121540266059SGregory Neil Shapiro		from lookups.  Temporary lookup failures are ignored unless
121640266059SGregory Neil Shapiro		a third argument is given, which must be either `t' or a full
121740266059SGregory Neil Shapiro		error message.  By default, any successful lookup will
121840266059SGregory Neil Shapiro		generate an error.  Otherwise the result of the lookup is
121940266059SGregory Neil Shapiro		compared with the supplied argument(s), and only if a match
122040266059SGregory Neil Shapiro		occurs an error is generated.  For example,
122140266059SGregory Neil Shapiro
122240266059SGregory Neil Shapiro		FEATURE(`enhdnsbl', `dnsbl.example.com', `', `t', `127.0.0.2.')
122340266059SGregory Neil Shapiro
122440266059SGregory Neil Shapiro		will reject the e-mail if the lookup returns the value
122540266059SGregory Neil Shapiro		``127.0.0.2.'', or generate a 451 response if the lookup
122640266059SGregory Neil Shapiro		temporarily failed.  The arguments can contain metasymbols
122740266059SGregory Neil Shapiro		as they are allowed in the LHS of rules.  As the example
122840266059SGregory Neil Shapiro		shows, the default values are also used if an empty argument,
122940266059SGregory Neil Shapiro		i.e., `', is specified.  This feature requires that sendmail
123040266059SGregory Neil Shapiro		has been compiled with the flag DNSMAP (see sendmail/README).
123140266059SGregory Neil Shapiro
123240266059SGregory Neil Shapirolookupdotdomain	Look up also .domain in the access map.  This allows to
123340266059SGregory Neil Shapiro		match only subdomains.  It does not work well with
123440266059SGregory Neil Shapiro		FEATURE(`relay_hosts_only'), because most lookups for
123540266059SGregory Neil Shapiro		subdomains are suppressed by the latter feature.
123640266059SGregory Neil Shapiro
1237c2aa98e2SPeter Wemmloose_relay_check
123806f25ae9SGregory Neil Shapiro		Normally, if % addressing is used for a recipient, e.g.
123906f25ae9SGregory Neil Shapiro		user%site@othersite, and othersite is in class {R}, the
1240c2aa98e2SPeter Wemm		check_rcpt ruleset will strip @othersite and recheck
1241c2aa98e2SPeter Wemm		user@site for relaying.  This feature changes that
1242c2aa98e2SPeter Wemm		behavior.  It should not be needed for most installations.
1243c2aa98e2SPeter Wemm
124440266059SGregory Neil Shapiroauthinfo	Provide a separate map for client side authentication
124540266059SGregory Neil Shapiro		information.  See SMTP AUTHENTICATION for details.
124640266059SGregory Neil Shapiro		By default, the authinfo database specification is:
124740266059SGregory Neil Shapiro
124840266059SGregory Neil Shapiro			hash /etc/mail/authinfo
124940266059SGregory Neil Shapiro
125040266059SGregory Neil Shapiropreserve_luser_host
125140266059SGregory Neil Shapiro		Preserve the name of the recipient host if LUSER_RELAY is
125240266059SGregory Neil Shapiro		used.  Without this option, the domain part of the
125340266059SGregory Neil Shapiro		recipient address will be replaced by the host specified as
125440266059SGregory Neil Shapiro		LUSER_RELAY.  This feature only works if the hostname is
125540266059SGregory Neil Shapiro		passed to the mailer (see mailer triple in op.me).  Note
125640266059SGregory Neil Shapiro		that in the default configuration the local mailer does not
125740266059SGregory Neil Shapiro		receive the hostname, i.e., the mailer triple has an empty
125840266059SGregory Neil Shapiro		hostname.
125940266059SGregory Neil Shapiro
126040266059SGregory Neil Shapiropreserve_local_plus_detail
126140266059SGregory Neil Shapiro		Preserve the +detail portion of the address when passing
126240266059SGregory Neil Shapiro		address to local delivery agent.  Disables alias and
126340266059SGregory Neil Shapiro		.forward +detail stripping (e.g., given user+detail, only
126440266059SGregory Neil Shapiro		that address will be looked up in the alias file; user+* and
126540266059SGregory Neil Shapiro		user will not be looked up).  Only use if the local
126640266059SGregory Neil Shapiro		delivery agent in use supports +detail addressing.
126740266059SGregory Neil Shapiro
126840266059SGregory Neil Shapirocompat_check	Enable ruleset check_compat to look up pairs of addresses
126940266059SGregory Neil Shapiro		with the Compat: tag --	Compat:sender<@>recipient -- in the
127040266059SGregory Neil Shapiro		access map.  Valid values for the RHS include
127140266059SGregory Neil Shapiro			DISCARD	silently discard recipient
127240266059SGregory Neil Shapiro			TEMP:	return a temporary error
127340266059SGregory Neil Shapiro			ERROR:	return a permanent error
127440266059SGregory Neil Shapiro		In the last two cases, a 4xy/5xy SMTP reply code should
127540266059SGregory Neil Shapiro		follow the colon.
127640266059SGregory Neil Shapiro
127706f25ae9SGregory Neil Shapirono_default_msa	Don't generate the default MSA daemon, i.e.,
127806f25ae9SGregory Neil Shapiro		DAEMON_OPTIONS(`Port=587,Name=MSA,M=E')
127906f25ae9SGregory Neil Shapiro		To define a MSA daemon with other parameters, use this
128006f25ae9SGregory Neil Shapiro		FEATURE and introduce new settings via DAEMON_OPTIONS().
1281c2aa98e2SPeter Wemm
128240266059SGregory Neil Shapiromsp		Defines config file for Message Submission Program.
1283605302a5SGregory Neil Shapiro		See sendmail/SECURITY for details and cf/cf/submit.mc how
1284605302a5SGregory Neil Shapiro		to use it.  An optional argument can be used to override
1285605302a5SGregory Neil Shapiro		the default of `[localhost]' to use as host to send all
1286605302a5SGregory Neil Shapiro		e-mails to.  Note that MX records will be used if the
1287605302a5SGregory Neil Shapiro		specified hostname is not in square brackets (e.g.,
1288605302a5SGregory Neil Shapiro		[hostname]).  If `MSA' is specified as second argument then
1289605302a5SGregory Neil Shapiro		port 587 is used to contact the server.  Example:
129040266059SGregory Neil Shapiro
129140266059SGregory Neil Shapiro			FEATURE(`msp', `', `MSA')
129240266059SGregory Neil Shapiro
129340266059SGregory Neil Shapiro		Some more hints about possible changes can be found below
129440266059SGregory Neil Shapiro		in the section MESSAGE SUBMISSION PROGRAM.
129540266059SGregory Neil Shapiro
129640266059SGregory Neil Shapiroqueuegroup	A simple example how to select a queue group based
129740266059SGregory Neil Shapiro		on the full e-mail address or the domain of the
129840266059SGregory Neil Shapiro		recipient.  Selection is done via entries in the
129940266059SGregory Neil Shapiro		access map using the tag QGRP:, for example:
130040266059SGregory Neil Shapiro
130140266059SGregory Neil Shapiro			QGRP:example.com	main
130240266059SGregory Neil Shapiro			QGRP:friend@some.org	others
130340266059SGregory Neil Shapiro			QGRP:my.domain		local
130440266059SGregory Neil Shapiro
130540266059SGregory Neil Shapiro		where "main", "others", and "local" are names of
130640266059SGregory Neil Shapiro		queue groups.  If an argument is specified, it is used
130740266059SGregory Neil Shapiro		as default queue group.
130840266059SGregory Neil Shapiro
1309605302a5SGregory Neil Shapiro		Note: please read the warning in doc/op/op.me about
1310605302a5SGregory Neil Shapiro		queue groups and possible queue manipulations.
1311605302a5SGregory Neil Shapiro
1312c2aa98e2SPeter Wemm+-------+
1313c2aa98e2SPeter Wemm| HACKS |
1314c2aa98e2SPeter Wemm+-------+
1315c2aa98e2SPeter Wemm
1316c2aa98e2SPeter WemmSome things just can't be called features.  To make this clear,
1317c2aa98e2SPeter Wemmthey go in the hack subdirectory and are referenced using the HACK
1318c2aa98e2SPeter Wemmmacro.  These will tend to be site-dependent.  The release
1319c2aa98e2SPeter Wemmincludes the Berkeley-dependent "cssubdomain" hack (that makes
1320c2aa98e2SPeter Wemmsendmail accept local names in either Berkeley.EDU or CS.Berkeley.EDU;
132106f25ae9SGregory Neil Shapirothis is intended as a short-term aid while moving hosts into
1322c2aa98e2SPeter Wemmsubdomains.
1323c2aa98e2SPeter Wemm
1324c2aa98e2SPeter Wemm
1325c2aa98e2SPeter Wemm+--------------------+
1326c2aa98e2SPeter Wemm| SITE CONFIGURATION |
1327c2aa98e2SPeter Wemm+--------------------+
1328c2aa98e2SPeter Wemm
1329c2aa98e2SPeter Wemm    *****************************************************
1330c2aa98e2SPeter Wemm    * This section is really obsolete, and is preserved	*
1331c2aa98e2SPeter Wemm    * only for back compatibility.  You should plan on	*
1332c2aa98e2SPeter Wemm    * using mailertables for new installations.  In	*
1333c2aa98e2SPeter Wemm    * particular, it doesn't work for the newer forms	*
1334c2aa98e2SPeter Wemm    * of UUCP mailers, such as uucp-uudom.		*
1335c2aa98e2SPeter Wemm    *****************************************************
1336c2aa98e2SPeter Wemm
1337c2aa98e2SPeter WemmComplex sites will need more local configuration information, such as
1338c2aa98e2SPeter Wemmlists of UUCP hosts they speak with directly.  This can get a bit more
1339c2aa98e2SPeter Wemmtricky.  For an example of a "complex" site, see cf/ucbvax.mc.
1340c2aa98e2SPeter Wemm
1341c2aa98e2SPeter WemmThe SITECONFIG macro allows you to indirectly reference site-dependent
1342c2aa98e2SPeter Wemmconfiguration information stored in the siteconfig subdirectory.  For
1343c2aa98e2SPeter Wemmexample, the line
1344c2aa98e2SPeter Wemm
134506f25ae9SGregory Neil Shapiro	SITECONFIG(`uucp.ucbvax', `ucbvax', `U')
1346c2aa98e2SPeter Wemm
1347c2aa98e2SPeter Wemmreads the file uucp.ucbvax for local connection information.  The
1348c2aa98e2SPeter Wemmsecond parameter is the local name (in this case just "ucbvax" since
1349c2aa98e2SPeter Wemmit is locally connected, and hence a UUCP hostname).  The third
1350c2aa98e2SPeter Wemmparameter is the name of both a macro to store the local name (in
135106f25ae9SGregory Neil Shapirothis case, {U}) and the name of the class (e.g., {U}) in which to store
1352c2aa98e2SPeter Wemmthe host information read from the file.  Another SITECONFIG line reads
1353c2aa98e2SPeter Wemm
135406f25ae9SGregory Neil Shapiro	SITECONFIG(`uucp.ucbarpa', `ucbarpa.Berkeley.EDU', `W')
1355c2aa98e2SPeter Wemm
1356c2aa98e2SPeter WemmThis says that the file uucp.ucbarpa contains the list of UUCP sites
135706f25ae9SGregory Neil Shapiroconnected to ucbarpa.Berkeley.EDU.  Class {W} will be used to
1358c2aa98e2SPeter Wemmstore this list, and $W is defined to be ucbarpa.Berkeley.EDU, that
1359c2aa98e2SPeter Wemmis, the name of the relay to which the hosts listed in uucp.ucbarpa
136006f25ae9SGregory Neil Shapiroare connected.  [The machine ucbarpa is gone now, but this
136106f25ae9SGregory Neil Shapiroout-of-date configuration file has been left around to demonstrate
136206f25ae9SGregory Neil Shapirohow you might do this.]
1363c2aa98e2SPeter Wemm
1364c2aa98e2SPeter WemmNote that the case of SITECONFIG with a third parameter of ``U'' is
1365c2aa98e2SPeter Wemmspecial; the second parameter is assumed to be the UUCP name of the
1366c2aa98e2SPeter Wemmlocal site, rather than the name of a remote site, and the UUCP name
136706f25ae9SGregory Neil Shapirois entered into class {w} (the list of local hostnames) as $U.UUCP.
1368c2aa98e2SPeter Wemm
1369c2aa98e2SPeter WemmThe siteconfig file (e.g., siteconfig/uucp.ucbvax.m4) contains nothing
1370c2aa98e2SPeter Wemmmore than a sequence of SITE macros describing connectivity.  For
1371c2aa98e2SPeter Wemmexample:
1372c2aa98e2SPeter Wemm
137306f25ae9SGregory Neil Shapiro	SITE(`cnmat')
137406f25ae9SGregory Neil Shapiro	SITE(`sgi olympus')
1375c2aa98e2SPeter Wemm
1376c2aa98e2SPeter WemmThe second example demonstrates that you can use two names on the
1377c2aa98e2SPeter Wemmsame line; these are usually aliases for the same host (or are at
1378c2aa98e2SPeter Wemmleast in the same company).
1379c2aa98e2SPeter Wemm
1380c2aa98e2SPeter Wemm
1381c2aa98e2SPeter Wemm+--------------------+
1382c2aa98e2SPeter Wemm| USING UUCP MAILERS |
1383c2aa98e2SPeter Wemm+--------------------+
1384c2aa98e2SPeter Wemm
1385c2aa98e2SPeter WemmIt's hard to get UUCP mailers right because of the extremely ad hoc
1386c2aa98e2SPeter Wemmnature of UUCP addressing.  These config files are really designed
1387c2aa98e2SPeter Wemmfor domain-based addressing, even for UUCP sites.
1388c2aa98e2SPeter Wemm
1389c2aa98e2SPeter WemmThere are four UUCP mailers available.  The choice of which one to
1390c2aa98e2SPeter Wemmuse is partly a matter of local preferences and what is running at
1391c2aa98e2SPeter Wemmthe other end of your UUCP connection.  Unlike good protocols that
1392c2aa98e2SPeter Wemmdefine what will go over the wire, UUCP uses the policy that you
1393c2aa98e2SPeter Wemmshould do what is right for the other end; if they change, you have
1394c2aa98e2SPeter Wemmto change.  This makes it hard to do the right thing, and discourages
1395c2aa98e2SPeter Wemmpeople from updating their software.  In general, if you can avoid
1396c2aa98e2SPeter WemmUUCP, please do.
1397c2aa98e2SPeter Wemm
1398c2aa98e2SPeter WemmThe major choice is whether to go for a domainized scheme or a
1399c2aa98e2SPeter Wemmnon-domainized scheme.  This depends entirely on what the other
1400c2aa98e2SPeter Wemmend will recognize.  If at all possible, you should encourage the
1401c2aa98e2SPeter Wemmother end to go to a domain-based system -- non-domainized addresses
1402c2aa98e2SPeter Wemmdon't work entirely properly.
1403c2aa98e2SPeter Wemm
1404c2aa98e2SPeter WemmThe four mailers are:
1405c2aa98e2SPeter Wemm
1406c2aa98e2SPeter Wemm    uucp-old (obsolete name: "uucp")
1407c2aa98e2SPeter Wemm	This is the oldest, the worst (but the closest to UUCP) way of
1408c2aa98e2SPeter Wemm	sending messages accros UUCP connections.  It does bangify
1409c2aa98e2SPeter Wemm	everything and prepends $U (your UUCP name) to the sender's
1410c2aa98e2SPeter Wemm	address (which can already be a bang path itself).  It can
1411c2aa98e2SPeter Wemm	only send to one address at a time, so it spends a lot of
1412c2aa98e2SPeter Wemm	time copying duplicates of messages.  Avoid this if at all
1413c2aa98e2SPeter Wemm	possible.
1414c2aa98e2SPeter Wemm
1415c2aa98e2SPeter Wemm    uucp-new (obsolete name: "suucp")
1416c2aa98e2SPeter Wemm	The same as above, except that it assumes that in one rmail
1417c2aa98e2SPeter Wemm	command you can specify several recipients.  It still has a
1418c2aa98e2SPeter Wemm	lot of other problems.
1419c2aa98e2SPeter Wemm
1420c2aa98e2SPeter Wemm    uucp-dom
1421c2aa98e2SPeter Wemm	This UUCP mailer keeps everything as domain addresses.
1422c2aa98e2SPeter Wemm	Basically, it uses the SMTP mailer rewriting rules.  This mailer
142340266059SGregory Neil Shapiro	is only included if MAILER(`smtp') is specified before
142440266059SGregory Neil Shapiro	MAILER(`uucp').
1425c2aa98e2SPeter Wemm
1426c2aa98e2SPeter Wemm	Unfortunately, a lot of UUCP mailer transport agents require
1427c2aa98e2SPeter Wemm	bangified addresses in the envelope, although you can use
1428c2aa98e2SPeter Wemm	domain-based addresses in the message header.  (The envelope
1429c2aa98e2SPeter Wemm	shows up as the From_ line on UNIX mail.)  So....
1430c2aa98e2SPeter Wemm
1431c2aa98e2SPeter Wemm    uucp-uudom
1432c2aa98e2SPeter Wemm	This is a cross between uucp-new (for the envelope addresses)
1433c2aa98e2SPeter Wemm	and uucp-dom (for the header addresses).  It bangifies the
1434c2aa98e2SPeter Wemm	envelope sender (From_ line in messages) without adding the
1435c2aa98e2SPeter Wemm	local hostname, unless there is no host name on the address
1436c2aa98e2SPeter Wemm	at all (e.g., "wolf") or the host component is a UUCP host name
1437c2aa98e2SPeter Wemm	instead of a domain name ("somehost!wolf" instead of
143806f25ae9SGregory Neil Shapiro	"some.dom.ain!wolf").  This is also included only if MAILER(`smtp')
143940266059SGregory Neil Shapiro	is also specified earlier.
1440c2aa98e2SPeter Wemm
1441c2aa98e2SPeter WemmExamples:
1442c2aa98e2SPeter Wemm
144306f25ae9SGregory Neil ShapiroOn host grasp.insa-lyon.fr (UUCP host name "grasp"), the following
144406f25ae9SGregory Neil Shapirosummarizes the sender rewriting for various mailers.
1445c2aa98e2SPeter Wemm
1446c2aa98e2SPeter WemmMailer		sender		rewriting in the envelope
1447c2aa98e2SPeter Wemm------		------		-------------------------
1448c2aa98e2SPeter Wemmuucp-{old,new}	wolf		grasp!wolf
1449c2aa98e2SPeter Wemmuucp-dom	wolf		wolf@grasp.insa-lyon.fr
1450c2aa98e2SPeter Wemmuucp-uudom	wolf		grasp.insa-lyon.fr!wolf
1451c2aa98e2SPeter Wemm
1452c2aa98e2SPeter Wemmuucp-{old,new}	wolf@fr.net	grasp!fr.net!wolf
1453c2aa98e2SPeter Wemmuucp-dom	wolf@fr.net	wolf@fr.net
1454c2aa98e2SPeter Wemmuucp-uudom	wolf@fr.net	fr.net!wolf
1455c2aa98e2SPeter Wemm
1456c2aa98e2SPeter Wemmuucp-{old,new}	somehost!wolf	grasp!somehost!wolf
1457c2aa98e2SPeter Wemmuucp-dom	somehost!wolf	somehost!wolf@grasp.insa-lyon.fr
1458c2aa98e2SPeter Wemmuucp-uudom	somehost!wolf	grasp.insa-lyon.fr!somehost!wolf
1459c2aa98e2SPeter Wemm
1460c2aa98e2SPeter WemmIf you are using one of the domainized UUCP mailers, you really want
1461c2aa98e2SPeter Wemmto convert all UUCP addresses to domain format -- otherwise, it will
1462c2aa98e2SPeter Wemmdo it for you (and probably not the way you expected).  For example,
1463c2aa98e2SPeter Wemmif you have the address foo!bar!baz (and you are not sending to foo),
1464c2aa98e2SPeter Wemmthe heuristics will add the @uucp.relay.name or @local.host.name to
1465c2aa98e2SPeter Wemmthis address.  However, if you map foo to foo.host.name first, it
1466c2aa98e2SPeter Wemmwill not add the local hostname.  You can do this using the uucpdomain
1467c2aa98e2SPeter Wemmfeature.
1468c2aa98e2SPeter Wemm
1469c2aa98e2SPeter Wemm
1470c2aa98e2SPeter Wemm+-------------------+
1471c2aa98e2SPeter Wemm| TWEAKING RULESETS |
1472c2aa98e2SPeter Wemm+-------------------+
1473c2aa98e2SPeter Wemm
1474c2aa98e2SPeter WemmFor more complex configurations, you can define special rules.
1475c2aa98e2SPeter WemmThe macro LOCAL_RULE_3 introduces rules that are used in canonicalizing
1476c2aa98e2SPeter Wemmthe names.  Any modifications made here are reflected in the header.
1477c2aa98e2SPeter Wemm
1478c2aa98e2SPeter WemmA common use is to convert old UUCP addresses to SMTP addresses using
1479c2aa98e2SPeter Wemmthe UUCPSMTP macro.  For example:
1480c2aa98e2SPeter Wemm
1481c2aa98e2SPeter Wemm	LOCAL_RULE_3
148206f25ae9SGregory Neil Shapiro	UUCPSMTP(`decvax',	`decvax.dec.com')
148306f25ae9SGregory Neil Shapiro	UUCPSMTP(`research',	`research.att.com')
1484c2aa98e2SPeter Wemm
1485c2aa98e2SPeter Wemmwill cause addresses of the form "decvax!user" and "research!user"
1486c2aa98e2SPeter Wemmto be converted to "user@decvax.dec.com" and "user@research.att.com"
1487c2aa98e2SPeter Wemmrespectively.
1488c2aa98e2SPeter Wemm
1489c2aa98e2SPeter WemmThis could also be used to look up hosts in a database map:
1490c2aa98e2SPeter Wemm
1491c2aa98e2SPeter Wemm	LOCAL_RULE_3
1492c2aa98e2SPeter Wemm	R$* < @ $+ > $*		$: $1 < @ $(hostmap $2 $) > $3
1493c2aa98e2SPeter Wemm
1494c2aa98e2SPeter WemmThis map would be defined in the LOCAL_CONFIG portion, as shown below.
1495c2aa98e2SPeter Wemm
1496c2aa98e2SPeter WemmSimilarly, LOCAL_RULE_0 can be used to introduce new parsing rules.
1497c2aa98e2SPeter WemmFor example, new rules are needed to parse hostnames that you accept
1498c2aa98e2SPeter Wemmvia MX records.  For example, you might have:
1499c2aa98e2SPeter Wemm
1500c2aa98e2SPeter Wemm	LOCAL_RULE_0
1501c2aa98e2SPeter Wemm	R$+ <@ host.dom.ain.>	$#uucp $@ cnmat $: $1 < @ host.dom.ain.>
1502c2aa98e2SPeter Wemm
1503c2aa98e2SPeter WemmYou would use this if you had installed an MX record for cnmat.Berkeley.EDU
1504c2aa98e2SPeter Wemmpointing at this host; this rule catches the message and forwards it on
1505c2aa98e2SPeter Wemmusing UUCP.
1506c2aa98e2SPeter Wemm
1507c2aa98e2SPeter WemmYou can also tweak rulesets 1 and 2 using LOCAL_RULE_1 and LOCAL_RULE_2.
1508c2aa98e2SPeter WemmThese rulesets are normally empty.
1509c2aa98e2SPeter Wemm
1510c2aa98e2SPeter WemmA similar macro is LOCAL_CONFIG.  This introduces lines added after the
151106f25ae9SGregory Neil Shapiroboilerplate option setting but before rulesets.  Do not declare rulesets in
151206f25ae9SGregory Neil Shapirothe LOCAL_CONFIG section.  It can be used to declare local database maps or
151306f25ae9SGregory Neil Shapirowhatever.  For example:
1514c2aa98e2SPeter Wemm
1515c2aa98e2SPeter Wemm	LOCAL_CONFIG
151606f25ae9SGregory Neil Shapiro	Khostmap hash /etc/mail/hostmap
1517c2aa98e2SPeter Wemm	Kyplocal nis -m hosts.byname
1518c2aa98e2SPeter Wemm
1519c2aa98e2SPeter Wemm
1520c2aa98e2SPeter Wemm+---------------------------+
1521c2aa98e2SPeter Wemm| MASQUERADING AND RELAYING |
1522c2aa98e2SPeter Wemm+---------------------------+
1523c2aa98e2SPeter Wemm
1524c2aa98e2SPeter WemmYou can have your host masquerade as another using
1525c2aa98e2SPeter Wemm
152606f25ae9SGregory Neil Shapiro	MASQUERADE_AS(`host.domain')
1527c2aa98e2SPeter Wemm
1528c2aa98e2SPeter WemmThis causes mail being sent to be labeled as coming from the
1529c2aa98e2SPeter Wemmindicated host.domain, rather than $j.  One normally masquerades as
153006f25ae9SGregory Neil Shapiroone of one's own subdomains (for example, it's unlikely that
153106f25ae9SGregory Neil ShapiroBerkeley would choose to masquerade as an MIT site).  This
153206f25ae9SGregory Neil Shapirobehaviour is modified by a plethora of FEATUREs; in particular, see
153306f25ae9SGregory Neil Shapiromasquerade_envelope, allmasquerade, limited_masquerade, and
153406f25ae9SGregory Neil Shapiromasquerade_entire_domain.
1535c2aa98e2SPeter Wemm
1536c2aa98e2SPeter WemmThe masquerade name is not normally canonified, so it is important
1537c2aa98e2SPeter Wemmthat it be your One True Name, that is, fully qualified and not a
1538c2aa98e2SPeter WemmCNAME.  However, if you use a CNAME, the receiving side may canonify
1539c2aa98e2SPeter Wemmit for you, so don't think you can cheat CNAME mapping this way.
1540c2aa98e2SPeter Wemm
1541c2aa98e2SPeter WemmNormally the only addresses that are masqueraded are those that come
154206f25ae9SGregory Neil Shapirofrom this host (that is, are either unqualified or in class {w}, the list
154306f25ae9SGregory Neil Shapiroof local domain names).  You can augment this list, which is realized
154406f25ae9SGregory Neil Shapiroby class {M} using
1545c2aa98e2SPeter Wemm
154606f25ae9SGregory Neil Shapiro	MASQUERADE_DOMAIN(`otherhost.domain')
1547c2aa98e2SPeter Wemm
1548c2aa98e2SPeter WemmThe effect of this is that although mail to user@otherhost.domain
1549c2aa98e2SPeter Wemmwill not be delivered locally, any mail including any user@otherhost.domain
1550c2aa98e2SPeter Wemmwill, when relayed, be rewritten to have the MASQUERADE_AS address.
1551c2aa98e2SPeter WemmThis can be a space-separated list of names.
1552c2aa98e2SPeter Wemm
1553c2aa98e2SPeter WemmIf these names are in a file, you can use
1554c2aa98e2SPeter Wemm
155506f25ae9SGregory Neil Shapiro	MASQUERADE_DOMAIN_FILE(`filename')
1556c2aa98e2SPeter Wemm
155706f25ae9SGregory Neil Shapiroto read the list of names from the indicated file (i.e., to add
155806f25ae9SGregory Neil Shapiroelements to class {M}).
155906f25ae9SGregory Neil Shapiro
156006f25ae9SGregory Neil ShapiroTo exempt hosts or subdomains from being masqueraded, you can use
156106f25ae9SGregory Neil Shapiro
156206f25ae9SGregory Neil Shapiro	MASQUERADE_EXCEPTION(`host.domain')
156306f25ae9SGregory Neil Shapiro
156406f25ae9SGregory Neil ShapiroThis can come handy if you want to masquerade a whole domain
156540266059SGregory Neil Shapiroexcept for one (or a few) host(s).  If these names are in a file,
156640266059SGregory Neil Shapiroyou can use
156740266059SGregory Neil Shapiro
156840266059SGregory Neil Shapiro	MASQUERADE_EXCEPTION_FILE(`filename')
1569c2aa98e2SPeter Wemm
1570c2aa98e2SPeter WemmNormally only header addresses are masqueraded.  If you want to
1571c2aa98e2SPeter Wemmmasquerade the envelope as well, use
1572c2aa98e2SPeter Wemm
15732e43090eSPeter Wemm	FEATURE(`masquerade_envelope')
1574c2aa98e2SPeter Wemm
1575c2aa98e2SPeter WemmThere are always users that need to be "exposed" -- that is, their
1576c2aa98e2SPeter Wemminternal site name should be displayed instead of the masquerade name.
157706f25ae9SGregory Neil ShapiroRoot is an example (which has been "exposed" by default prior to 8.10).
157806f25ae9SGregory Neil ShapiroYou can add users to this list using
1579c2aa98e2SPeter Wemm
158006f25ae9SGregory Neil Shapiro	EXPOSED_USER(`usernames')
1581c2aa98e2SPeter Wemm
158240266059SGregory Neil ShapiroThis adds users to class {E}; you could also use
1583c2aa98e2SPeter Wemm
158440266059SGregory Neil Shapiro	EXPOSED_USER_FILE(`filename')
1585c2aa98e2SPeter Wemm
1586c2aa98e2SPeter WemmYou can also arrange to relay all unqualified names (that is, names
1587c2aa98e2SPeter Wemmwithout @host) to a relay host.  For example, if you have a central
1588c2aa98e2SPeter Wemmemail server, you might relay to that host so that users don't have
1589c2aa98e2SPeter Wemmto have .forward files or aliases.  You can do this using
1590c2aa98e2SPeter Wemm
15912e43090eSPeter Wemm	define(`LOCAL_RELAY', `mailer:hostname')
1592c2aa98e2SPeter Wemm
1593c2aa98e2SPeter WemmThe ``mailer:'' can be omitted, in which case the mailer defaults to
1594c2aa98e2SPeter Wemm"relay".  There are some user names that you don't want relayed, perhaps
1595c2aa98e2SPeter Wemmbecause of local aliases.  A common example is root, which may be
1596c2aa98e2SPeter Wemmlocally aliased.  You can add entries to this list using
1597c2aa98e2SPeter Wemm
159806f25ae9SGregory Neil Shapiro	LOCAL_USER(`usernames')
1599c2aa98e2SPeter Wemm
160040266059SGregory Neil ShapiroThis adds users to class {L}; you could also use
1601c2aa98e2SPeter Wemm
160240266059SGregory Neil Shapiro	LOCAL_USER_FILE(`filename')
1603c2aa98e2SPeter Wemm
1604c2aa98e2SPeter WemmIf you want all incoming mail sent to a centralized hub, as for a
1605c2aa98e2SPeter Wemmshared /var/spool/mail scheme, use
1606c2aa98e2SPeter Wemm
16072e43090eSPeter Wemm	define(`MAIL_HUB', `mailer:hostname')
1608c2aa98e2SPeter Wemm
1609c2aa98e2SPeter WemmAgain, ``mailer:'' defaults to "relay".  If you define both LOCAL_RELAY
16102e43090eSPeter Wemmand MAIL_HUB _AND_ you have FEATURE(`stickyhost'), unqualified names will
1611c2aa98e2SPeter Wemmbe sent to the LOCAL_RELAY and other local names will be sent to MAIL_HUB.
161206f25ae9SGregory Neil ShapiroNote: there is a (long standing) bug which keeps this combination from
161306f25ae9SGregory Neil Shapiroworking for addresses of the form user+detail.
161406f25ae9SGregory Neil ShapiroNames in class {L} will be delivered locally, so you MUST have aliases or
1615c2aa98e2SPeter Wemm.forward files for them.
1616c2aa98e2SPeter Wemm
1617c2aa98e2SPeter WemmFor example, if you are on machine mastodon.CS.Berkeley.EDU and you have
16182e43090eSPeter WemmFEATURE(`stickyhost'), the following combinations of settings will have the
1619c2aa98e2SPeter Wemmindicated effects:
1620c2aa98e2SPeter Wemm
1621c2aa98e2SPeter Wemmemail sent to....	eric			  eric@mastodon.CS.Berkeley.EDU
1622c2aa98e2SPeter Wemm
1623c2aa98e2SPeter WemmLOCAL_RELAY set to	mail.CS.Berkeley.EDU	  (delivered locally)
1624c2aa98e2SPeter Wemmmail.CS.Berkeley.EDU	  (no local aliasing)	    (aliasing done)
1625c2aa98e2SPeter Wemm
1626c2aa98e2SPeter WemmMAIL_HUB set to		mammoth.CS.Berkeley.EDU	  mammoth.CS.Berkeley.EDU
1627c2aa98e2SPeter Wemmmammoth.CS.Berkeley.EDU	  (aliasing done)	    (aliasing done)
1628c2aa98e2SPeter Wemm
1629c2aa98e2SPeter WemmBoth LOCAL_RELAY and	mail.CS.Berkeley.EDU	  mammoth.CS.Berkeley.EDU
1630c2aa98e2SPeter WemmMAIL_HUB set as above	  (no local aliasing)	    (aliasing done)
1631c2aa98e2SPeter Wemm
16322e43090eSPeter WemmIf you do not have FEATURE(`stickyhost') set, then LOCAL_RELAY and
1633c2aa98e2SPeter WemmMAIL_HUB act identically, with MAIL_HUB taking precedence.
1634c2aa98e2SPeter Wemm
1635c2aa98e2SPeter WemmIf you want all outgoing mail to go to a central relay site, define
1636c2aa98e2SPeter WemmSMART_HOST as well.  Briefly:
1637c2aa98e2SPeter Wemm
1638c2aa98e2SPeter Wemm	LOCAL_RELAY applies to unqualified names (e.g., "eric").
1639c2aa98e2SPeter Wemm	MAIL_HUB applies to names qualified with the name of the
1640c2aa98e2SPeter Wemm		local host (e.g., "eric@mastodon.CS.Berkeley.EDU").
164106f25ae9SGregory Neil Shapiro	SMART_HOST applies to names qualified with other hosts or
164206f25ae9SGregory Neil Shapiro		bracketed addresses (e.g., "eric@mastodon.CS.Berkeley.EDU"
164306f25ae9SGregory Neil Shapiro		or "eric@[127.0.0.1]").
1644c2aa98e2SPeter Wemm
1645c2aa98e2SPeter WemmHowever, beware that other relays (e.g., UUCP_RELAY, BITNET_RELAY,
1646c2aa98e2SPeter WemmDECNET_RELAY, and FAX_RELAY) take precedence over SMART_HOST, so if you
1647c2aa98e2SPeter Wemmreally want absolutely everything to go to a single central site you will
1648c2aa98e2SPeter Wemmneed to unset all the other relays -- or better yet, find or build a
1649c2aa98e2SPeter Wemmminimal config file that does this.
1650c2aa98e2SPeter Wemm
1651c2aa98e2SPeter WemmFor duplicate suppression to work properly, the host name is best
1652c2aa98e2SPeter Wemmspecified with a terminal dot:
1653c2aa98e2SPeter Wemm
1654c2aa98e2SPeter Wemm	define(`MAIL_HUB', `host.domain.')
1655c2aa98e2SPeter Wemm	      note the trailing dot ---^
1656c2aa98e2SPeter Wemm
1657c2aa98e2SPeter Wemm
165840266059SGregory Neil Shapiro+-------------------------------------------+
165940266059SGregory Neil Shapiro| USING LDAP FOR ALIASES, MAPS, AND CLASSES |
166040266059SGregory Neil Shapiro+-------------------------------------------+
166140266059SGregory Neil Shapiro
166240266059SGregory Neil ShapiroLDAP can be used for aliases, maps, and classes by either specifying your
166340266059SGregory Neil Shapiroown LDAP map specification or using the built-in default LDAP map
166440266059SGregory Neil Shapirospecification.  The built-in default specifications all provide lookups
166540266059SGregory Neil Shapirowhich match against either the machine's fully qualified hostname (${j}) or
166640266059SGregory Neil Shapiroa "cluster".  The cluster allows you to share LDAP entries among a large
166740266059SGregory Neil Shapironumber of machines without having to enter each of the machine names into
166840266059SGregory Neil Shapiroeach LDAP entry.  To set the LDAP cluster name to use for a particular
166940266059SGregory Neil Shapiromachine or set of machines, set the confLDAP_CLUSTER m4 variable to a
167040266059SGregory Neil Shapirounique name.  For example:
167140266059SGregory Neil Shapiro
167240266059SGregory Neil Shapiro	define(`confLDAP_CLUSTER', `Servers')
167340266059SGregory Neil Shapiro
167440266059SGregory Neil ShapiroHere, the word `Servers' will be the cluster name.  As an example, assume
167540266059SGregory Neil Shapirothat smtp.sendmail.org, etrn.sendmail.org, and mx.sendmail.org all belong
167640266059SGregory Neil Shapiroto the Servers cluster.
167740266059SGregory Neil Shapiro
167840266059SGregory Neil ShapiroSome of the LDAP LDIF examples below show use of the Servers cluster.
167940266059SGregory Neil ShapiroEvery entry must have either a sendmailMTAHost or sendmailMTACluster
168040266059SGregory Neil Shapiroattribute or it will be ignored.  Be careful as mixing clusters and
168140266059SGregory Neil Shapiroindividual host records can have surprising results (see the CAUTION
168240266059SGregory Neil Shapirosections below).
168340266059SGregory Neil Shapiro
168440266059SGregory Neil ShapiroSee the file cf/sendmail.schema for the actual LDAP schemas.  Note that
168540266059SGregory Neil Shapirothis schema (and therefore the lookups and examples below) is experimental
168640266059SGregory Neil Shapiroat this point as it has had little public review.  Therefore, it may change
168740266059SGregory Neil Shapiroin future versions.  Feedback via sendmail@sendmail.org is encouraged.
168840266059SGregory Neil Shapiro
168940266059SGregory Neil Shapiro-------
169040266059SGregory Neil ShapiroAliases
169140266059SGregory Neil Shapiro-------
169240266059SGregory Neil Shapiro
169340266059SGregory Neil ShapiroThe ALIAS_FILE (O AliasFile) option can be set to use LDAP for alias
169440266059SGregory Neil Shapirolookups.  To use the default schema, simply use:
169540266059SGregory Neil Shapiro
169640266059SGregory Neil Shapiro	define(`ALIAS_FILE', `ldap:')
169740266059SGregory Neil Shapiro
169840266059SGregory Neil ShapiroBy doing so, you will use the default schema which expands to a map
169940266059SGregory Neil Shapirodeclared as follows:
170040266059SGregory Neil Shapiro
170140266059SGregory Neil Shapiro	ldap -k (&(objectClass=sendmailMTAAliasObject)
170240266059SGregory Neil Shapiro		  (sendmailMTAAliasGrouping=aliases)
170340266059SGregory Neil Shapiro		  (|(sendmailMTACluster=${sendmailMTACluster})
170440266059SGregory Neil Shapiro		    (sendmailMTAHost=$j))
170540266059SGregory Neil Shapiro		  (sendmailMTAKey=%0))
170640266059SGregory Neil Shapiro	     -v sendmailMTAAliasValue
170740266059SGregory Neil Shapiro
170840266059SGregory Neil ShapiroNOTE: The macros shown above ${sendmailMTACluster} and $j are not actually
170940266059SGregory Neil Shapiroused when the binary expands the `ldap:' token as the AliasFile option is
171040266059SGregory Neil Shapironot actually macro-expanded when read from the sendmail.cf file.
171140266059SGregory Neil Shapiro
171240266059SGregory Neil ShapiroExample LDAP LDIF entries might be:
171340266059SGregory Neil Shapiro
171440266059SGregory Neil Shapiro	dn: sendmailMTAKey=sendmail-list, dc=sendmail, dc=org
171540266059SGregory Neil Shapiro	objectClass: sendmailMTA
171640266059SGregory Neil Shapiro	objectClass: sendmailMTAAlias
171740266059SGregory Neil Shapiro	objectClass: sendmailMTAAliasObject
171840266059SGregory Neil Shapiro	sendmailMTAAliasGrouping: aliases
171940266059SGregory Neil Shapiro	sendmailMTAHost: etrn.sendmail.org
172040266059SGregory Neil Shapiro	sendmailMTAKey: sendmail-list
172140266059SGregory Neil Shapiro	sendmailMTAAliasValue: ca@example.org
172240266059SGregory Neil Shapiro	sendmailMTAAliasValue: eric
172340266059SGregory Neil Shapiro	sendmailMTAAliasValue: gshapiro@example.com
172440266059SGregory Neil Shapiro
172540266059SGregory Neil Shapiro	dn: sendmailMTAKey=owner-sendmail-list, dc=sendmail, dc=org
172640266059SGregory Neil Shapiro	objectClass: sendmailMTA
172740266059SGregory Neil Shapiro	objectClass: sendmailMTAAlias
172840266059SGregory Neil Shapiro	objectClass: sendmailMTAAliasObject
172940266059SGregory Neil Shapiro	sendmailMTAAliasGrouping: aliases
173040266059SGregory Neil Shapiro	sendmailMTAHost: etrn.sendmail.org
173140266059SGregory Neil Shapiro	sendmailMTAKey: owner-sendmail-list
173240266059SGregory Neil Shapiro	sendmailMTAAliasValue: eric
173340266059SGregory Neil Shapiro
173440266059SGregory Neil Shapiro	dn: sendmailMTAKey=postmaster, dc=sendmail, dc=org
173540266059SGregory Neil Shapiro	objectClass: sendmailMTA
173640266059SGregory Neil Shapiro	objectClass: sendmailMTAAlias
173740266059SGregory Neil Shapiro	objectClass: sendmailMTAAliasObject
173840266059SGregory Neil Shapiro	sendmailMTAAliasGrouping: aliases
173940266059SGregory Neil Shapiro	sendmailMTACluster: Servers
174040266059SGregory Neil Shapiro	sendmailMTAKey: postmaster
174140266059SGregory Neil Shapiro	sendmailMTAAliasValue: eric
174240266059SGregory Neil Shapiro
174340266059SGregory Neil ShapiroHere, the aliases sendmail-list and owner-sendmail-list will be available
174440266059SGregory Neil Shapiroonly on etrn.sendmail.org but the postmaster alias will be available on
174540266059SGregory Neil Shapiroevery machine in the Servers cluster (including etrn.sendmail.org).
174640266059SGregory Neil Shapiro
174740266059SGregory Neil ShapiroCAUTION: aliases are additive so that entries like these:
174840266059SGregory Neil Shapiro
174940266059SGregory Neil Shapiro	dn: sendmailMTAKey=bob, dc=sendmail, dc=org
175040266059SGregory Neil Shapiro	objectClass: sendmailMTA
175140266059SGregory Neil Shapiro	objectClass: sendmailMTAAlias
175240266059SGregory Neil Shapiro	objectClass: sendmailMTAAliasObject
175340266059SGregory Neil Shapiro	sendmailMTAAliasGrouping: aliases
175440266059SGregory Neil Shapiro	sendmailMTACluster: Servers
175540266059SGregory Neil Shapiro	sendmailMTAKey: bob
175640266059SGregory Neil Shapiro	sendmailMTAAliasValue: eric
175740266059SGregory Neil Shapiro
1758605302a5SGregory Neil Shapiro	dn: sendmailMTAKey=bobetrn, dc=sendmail, dc=org
175940266059SGregory Neil Shapiro	objectClass: sendmailMTA
176040266059SGregory Neil Shapiro	objectClass: sendmailMTAAlias
176140266059SGregory Neil Shapiro	objectClass: sendmailMTAAliasObject
176240266059SGregory Neil Shapiro	sendmailMTAAliasGrouping: aliases
176340266059SGregory Neil Shapiro	sendmailMTAHost: etrn.sendmail.org
176440266059SGregory Neil Shapiro	sendmailMTAKey: bob
176540266059SGregory Neil Shapiro	sendmailMTAAliasValue: gshapiro
176640266059SGregory Neil Shapiro
176740266059SGregory Neil Shapirowould mean that on all of the hosts in the cluster, mail to bob would go to
176840266059SGregory Neil Shapiroeric EXCEPT on etrn.sendmail.org in which case it would go to BOTH eric and
176940266059SGregory Neil Shapirogshapiro.
177040266059SGregory Neil Shapiro
177140266059SGregory Neil ShapiroIf you prefer not to use the default LDAP schema for your aliases, you can
177240266059SGregory Neil Shapirospecify the map parameters when setting ALIAS_FILE.  For example:
177340266059SGregory Neil Shapiro
177440266059SGregory Neil Shapiro	define(`ALIAS_FILE', `ldap:-k (&(objectClass=mailGroup)(mail=%0)) -v mgrpRFC822MailMember')
177540266059SGregory Neil Shapiro
177640266059SGregory Neil Shapiro----
177740266059SGregory Neil ShapiroMaps
177840266059SGregory Neil Shapiro----
177940266059SGregory Neil Shapiro
178040266059SGregory Neil ShapiroFEATURE()'s which take an optional map definition argument (e.g., access,
178140266059SGregory Neil Shapiromailertable, virtusertable, etc.) can instead take the special keyword
178240266059SGregory Neil Shapiro`LDAP', e.g.:
178340266059SGregory Neil Shapiro
178440266059SGregory Neil Shapiro	FEATURE(`access_db', `LDAP')
178540266059SGregory Neil Shapiro	FEATURE(`virtusertable', `LDAP')
178640266059SGregory Neil Shapiro
178740266059SGregory Neil ShapiroWhen this keyword is given, that map will use LDAP lookups consisting of
178840266059SGregory Neil Shapirothe objectClass sendmailMTAClassObject, the attribute sendmailMTAMapName
178940266059SGregory Neil Shapirowith the map name, a search attribute of sendmailMTAKey, and the value
179040266059SGregory Neil Shapiroattribute sendmailMTAMapValue.
179140266059SGregory Neil Shapiro
179240266059SGregory Neil ShapiroThe values for sendmailMTAMapName are:
179340266059SGregory Neil Shapiro
179440266059SGregory Neil Shapiro	FEATURE()		sendmailMTAMapName
179540266059SGregory Neil Shapiro	---------		------------------
179640266059SGregory Neil Shapiro	access_db		access
179740266059SGregory Neil Shapiro	authinfo		authinfo
179840266059SGregory Neil Shapiro	bitdomain		bitdomain
179940266059SGregory Neil Shapiro	domaintable		domain
180040266059SGregory Neil Shapiro	genericstable		generics
180140266059SGregory Neil Shapiro	mailertable		mailer
180240266059SGregory Neil Shapiro	uucpdomain		uucpdomain
180340266059SGregory Neil Shapiro	virtusertable		virtuser
180440266059SGregory Neil Shapiro
180540266059SGregory Neil ShapiroFor example, FEATURE(`mailertable', `LDAP') would use the map definition:
180640266059SGregory Neil Shapiro
180740266059SGregory Neil Shapiro	Kmailertable ldap -k (&(objectClass=sendmailMTAMapObject)
180840266059SGregory Neil Shapiro			       (sendmailMTAMapName=mailer)
180940266059SGregory Neil Shapiro			       (|(sendmailMTACluster=${sendmailMTACluster})
181040266059SGregory Neil Shapiro				 (sendmailMTAHost=$j))
181140266059SGregory Neil Shapiro			       (sendmailMTAKey=%0))
181240266059SGregory Neil Shapiro			  -1 -v sendmailMTAMapValue
181340266059SGregory Neil Shapiro
181440266059SGregory Neil ShapiroAn example LDAP LDIF entry using this map might be:
181540266059SGregory Neil Shapiro
181640266059SGregory Neil Shapiro	dn: sendmailMTAMapName=mailer, dc=sendmail, dc=org
181740266059SGregory Neil Shapiro	objectClass: sendmailMTA
181840266059SGregory Neil Shapiro	objectClass: sendmailMTAMap
181940266059SGregory Neil Shapiro	sendmailMTACluster: Servers
182040266059SGregory Neil Shapiro	sendmailMTAMapName: mailer
182140266059SGregory Neil Shapiro
182240266059SGregory Neil Shapiro	dn: sendmailMTAKey=example.com, sendmailMTAMapName=mailer, dc=sendmail, dc=org
182340266059SGregory Neil Shapiro	objectClass: sendmailMTA
182440266059SGregory Neil Shapiro	objectClass: sendmailMTAMap
182540266059SGregory Neil Shapiro	objectClass: sendmailMTAMapObject
182640266059SGregory Neil Shapiro	sendmailMTAMapName: mailer
182740266059SGregory Neil Shapiro	sendmailMTACluster: Servers
182840266059SGregory Neil Shapiro	sendmailMTAKey: example.com
182940266059SGregory Neil Shapiro	sendmailMTAMapValue: relay:[smtp.example.com]
183040266059SGregory Neil Shapiro
183140266059SGregory Neil ShapiroCAUTION: If your LDAP database contains the record above and *ALSO* a host
183240266059SGregory Neil Shapirospecific record such as:
183340266059SGregory Neil Shapiro
183440266059SGregory Neil Shapiro	dn: sendmailMTAKey=example.com@etrn, sendmailMTAMapName=mailer, dc=sendmail, dc=org
183540266059SGregory Neil Shapiro	objectClass: sendmailMTA
183640266059SGregory Neil Shapiro	objectClass: sendmailMTAMap
183740266059SGregory Neil Shapiro	objectClass: sendmailMTAMapObject
183840266059SGregory Neil Shapiro	sendmailMTAMapName: mailer
183940266059SGregory Neil Shapiro	sendmailMTAHost: etrn.sendmail.org
184040266059SGregory Neil Shapiro	sendmailMTAKey: example.com
184140266059SGregory Neil Shapiro	sendmailMTAMapValue: relay:[mx.example.com]
184240266059SGregory Neil Shapiro
184340266059SGregory Neil Shapirothen these entries will give unexpected results.  When the lookup is done
184440266059SGregory Neil Shapiroon etrn.sendmail.org, the effect is that there is *NO* match at all as maps
184540266059SGregory Neil Shapirorequire a single match.  Since the host etrn.sendmail.org is also in the
184640266059SGregory Neil ShapiroServers cluster, LDAP would return two answers for the example.com map key
184740266059SGregory Neil Shapiroin which case sendmail would treat this as no match at all.
184840266059SGregory Neil Shapiro
184940266059SGregory Neil ShapiroIf you prefer not to use the default LDAP schema for your maps, you can
185040266059SGregory Neil Shapirospecify the map parameters when using the FEATURE().  For example:
185140266059SGregory Neil Shapiro
185240266059SGregory Neil Shapiro	FEATURE(`access_db', `ldap:-1 -k (&(objectClass=mapDatabase)(key=%0)) -v value')
185340266059SGregory Neil Shapiro
185440266059SGregory Neil Shapiro-------
185540266059SGregory Neil ShapiroClasses
185640266059SGregory Neil Shapiro-------
185740266059SGregory Neil Shapiro
185840266059SGregory Neil ShapiroNormally, classes can be filled via files or programs.  As of 8.12, they
185940266059SGregory Neil Shapirocan also be filled via map lookups using a new syntax:
186040266059SGregory Neil Shapiro
186140266059SGregory Neil Shapiro	F{ClassName}mapkey@mapclass:mapspec
186240266059SGregory Neil Shapiro
186340266059SGregory Neil Shapiromapkey is optional and if not provided the map key will be empty.  This can
186440266059SGregory Neil Shapirobe used with LDAP to read classes from LDAP.  Note that the lookup is only
186540266059SGregory Neil Shapirodone when sendmail is initially started.  Use the special value `@LDAP' to
186640266059SGregory Neil Shapirouse the default LDAP schema.  For example:
186740266059SGregory Neil Shapiro
186840266059SGregory Neil Shapiro	RELAY_DOMAIN_FILE(`@LDAP')
186940266059SGregory Neil Shapiro
187040266059SGregory Neil Shapirowould put all of the attribute sendmailMTAClassValue values of LDAP records
187140266059SGregory Neil Shapirowith objectClass sendmailMTAClass and an attribute sendmailMTAClassName of
187240266059SGregory Neil Shapiro'R' into class $={R}.  In other words, it is equivalent to the LDAP map
187340266059SGregory Neil Shapirospecification:
187440266059SGregory Neil Shapiro
187540266059SGregory Neil Shapiro	F{R}@ldap:-k (&(objectClass=sendmailMTAClass)
187640266059SGregory Neil Shapiro		       (sendmailMTAClassName=R)
187740266059SGregory Neil Shapiro		       (|(sendmailMTACluster=${sendmailMTACluster})
187840266059SGregory Neil Shapiro			 (sendmailMTAHost=$j)))
187940266059SGregory Neil Shapiro		  -v sendmailMTAClassValue
188040266059SGregory Neil Shapiro
188140266059SGregory Neil ShapiroNOTE: The macros shown above ${sendmailMTACluster} and $j are not actually
188240266059SGregory Neil Shapiroused when the binary expands the `@LDAP' token as class declarations are
188340266059SGregory Neil Shapironot actually macro-expanded when read from the sendmail.cf file.
188440266059SGregory Neil Shapiro
188540266059SGregory Neil ShapiroThis can be used with class related commands such as RELAY_DOMAIN_FILE(),
188640266059SGregory Neil ShapiroMASQUERADE_DOMAIN_FILE(), etc:
188740266059SGregory Neil Shapiro
188840266059SGregory Neil Shapiro	Command				sendmailMTAClassName
188940266059SGregory Neil Shapiro	-------				--------------------
189040266059SGregory Neil Shapiro	CANONIFY_DOMAIN_FILE()		Canonify
189140266059SGregory Neil Shapiro	EXPOSED_USER_FILE()		E
189240266059SGregory Neil Shapiro	GENERICS_DOMAIN_FILE()		G
189340266059SGregory Neil Shapiro	LDAPROUTE_DOMAIN_FILE()		LDAPRoute
189440266059SGregory Neil Shapiro	LDAPROUTE_EQUIVALENT_FILE()	LDAPRouteEquiv
189540266059SGregory Neil Shapiro	LOCAL_USER_FILE()		L
189640266059SGregory Neil Shapiro	MASQUERADE_DOMAIN_FILE()	M
189740266059SGregory Neil Shapiro	MASQUERADE_EXCEPTION_FILE()	N
189840266059SGregory Neil Shapiro	RELAY_DOMAIN_FILE()		R
189940266059SGregory Neil Shapiro	VIRTUSER_DOMAIN_FILE()		VirtHost
190040266059SGregory Neil Shapiro
190140266059SGregory Neil ShapiroYou can also add your own as any 'F'ile class of the form:
190240266059SGregory Neil Shapiro
190340266059SGregory Neil Shapiro	F{ClassName}@LDAP
190440266059SGregory Neil Shapiro	  ^^^^^^^^^
190540266059SGregory Neil Shapirowill use "ClassName" for the sendmailMTAClassName.
190640266059SGregory Neil Shapiro
190740266059SGregory Neil ShapiroAn example LDAP LDIF entry would look like:
190840266059SGregory Neil Shapiro
190940266059SGregory Neil Shapiro	dn: sendmailMTAClassName=R, dc=sendmail, dc=org
191040266059SGregory Neil Shapiro	objectClass: sendmailMTA
191140266059SGregory Neil Shapiro	objectClass: sendmailMTAClass
191240266059SGregory Neil Shapiro	sendmailMTACluster: Servers
191340266059SGregory Neil Shapiro	sendmailMTAClassName: R
191440266059SGregory Neil Shapiro	sendmailMTAClassValue: sendmail.org
191540266059SGregory Neil Shapiro	sendmailMTAClassValue: example.com
191640266059SGregory Neil Shapiro	sendmailMTAClassValue: 10.56.23
191740266059SGregory Neil Shapiro
191840266059SGregory Neil ShapiroCAUTION: If your LDAP database contains the record above and *ALSO* a host
191940266059SGregory Neil Shapirospecific record such as:
192040266059SGregory Neil Shapiro
192140266059SGregory Neil Shapiro	dn: sendmailMTAClassName=R@etrn.sendmail.org, dc=sendmail, dc=org
192240266059SGregory Neil Shapiro	objectClass: sendmailMTA
192340266059SGregory Neil Shapiro	objectClass: sendmailMTAClass
192440266059SGregory Neil Shapiro	sendmailMTAHost: etrn.sendmail.org
192540266059SGregory Neil Shapiro	sendmailMTAClassName: R
192640266059SGregory Neil Shapiro	sendmailMTAClassValue: example.com
192740266059SGregory Neil Shapiro
192840266059SGregory Neil Shapirothe result will be similar to the aliases caution above.  When the lookup
192940266059SGregory Neil Shapirois done on etrn.sendmail.org, $={R} would contain all of the entries (from
193040266059SGregory Neil Shapiroboth the cluster match and the host match).  In other words, the effective
193140266059SGregory Neil Shapirois additive.
193240266059SGregory Neil Shapiro
193340266059SGregory Neil ShapiroIf you prefer not to use the default LDAP schema for your classes, you can
193440266059SGregory Neil Shapirospecify the map parameters when using the class command.  For example:
193540266059SGregory Neil Shapiro
193640266059SGregory Neil Shapiro	VIRTUSER_DOMAIN_FILE(`@ldap:-k (&(objectClass=virtHosts)(host=*)) -v host')
193740266059SGregory Neil Shapiro
193840266059SGregory Neil ShapiroRemember, macros can not be used in a class declaration as the binary does
193940266059SGregory Neil Shapironot expand them.
194040266059SGregory Neil Shapiro
194140266059SGregory Neil Shapiro
194206f25ae9SGregory Neil Shapiro+--------------+
194306f25ae9SGregory Neil Shapiro| LDAP ROUTING |
194406f25ae9SGregory Neil Shapiro+--------------+
194506f25ae9SGregory Neil Shapiro
194606f25ae9SGregory Neil ShapiroFEATURE(`ldap_routing') can be used to implement the IETF Internet Draft
194706f25ae9SGregory Neil ShapiroLDAP Schema for Intranet Mail Routing
194806f25ae9SGregory Neil Shapiro(draft-lachman-laser-ldap-mail-routing-01).  This feature enables
194906f25ae9SGregory Neil ShapiroLDAP-based rerouting of a particular address to either a different host
195006f25ae9SGregory Neil Shapiroor a different address.  The LDAP lookup is first attempted on the full
195106f25ae9SGregory Neil Shapiroaddress (e.g., user@example.com) and then on the domain portion
195206f25ae9SGregory Neil Shapiro(e.g., @example.com).  Be sure to setup your domain for LDAP routing using
195306f25ae9SGregory Neil ShapiroLDAPROUTE_DOMAIN(), e.g.:
195406f25ae9SGregory Neil Shapiro
195506f25ae9SGregory Neil Shapiro	LDAPROUTE_DOMAIN(`example.com')
195606f25ae9SGregory Neil Shapiro
195740266059SGregory Neil ShapiroAdditionally, you can specify equivalent domains for LDAP routing using
195840266059SGregory Neil ShapiroLDAPROUTE_EQUIVALENT() and LDAPROUTE_EQUIVALENT_FILE().  'Equivalent'
195940266059SGregory Neil Shapirohostnames are mapped to $M (the masqueraded hostname for the server) before
196040266059SGregory Neil Shapirothe LDAP query.  For example, if the mail is addressed to
196140266059SGregory Neil Shapirouser@host1.example.com, normally the LDAP lookup would only be done for
196240266059SGregory Neil Shapiro'user@host1.example.com' and '@host1.example.com'.   However, if
196340266059SGregory Neil ShapiroLDAPROUTE_EQUIVALENT(`host1.example.com') is used, the lookups would also be
196440266059SGregory Neil Shapirodone on 'user@example.com' and '@example.com' after attempting the
196540266059SGregory Neil Shapirohost1.example.com lookups.
196640266059SGregory Neil Shapiro
196706f25ae9SGregory Neil ShapiroBy default, the feature will use the schemas as specified in the draft
196806f25ae9SGregory Neil Shapiroand will not reject addresses not found by the LDAP lookup.  However,
196906f25ae9SGregory Neil Shapirothis behavior can be changed by giving additional arguments to the FEATURE()
197006f25ae9SGregory Neil Shapirocommand:
197106f25ae9SGregory Neil Shapiro
197240266059SGregory Neil Shapiro FEATURE(`ldap_routing', <mailHost>, <mailRoutingAddress>, <bounce>, <detail>)
197306f25ae9SGregory Neil Shapiro
197406f25ae9SGregory Neil Shapirowhere <mailHost> is a map definition describing how to lookup an alternative
197506f25ae9SGregory Neil Shapiromail host for a particular address; <mailRoutingAddress> is a map definition
197640266059SGregory Neil Shapirodescribing how to lookup an alternative address for a particular address;
197706f25ae9SGregory Neil Shapirothe <bounce> argument, if present and not the word "passthru", dictates
197806f25ae9SGregory Neil Shapirothat mail should be bounced if neither a mailHost nor mailRoutingAddress
197940266059SGregory Neil Shapirois found; and <detail> indicates what actions to take if the address
198040266059SGregory Neil Shapirocontains +detail information -- `strip' tries the lookup with the +detail
198140266059SGregory Neil Shapiroand if no matches are found, strips the +detail and tries the lookup again;
198240266059SGregory Neil Shapiro`preserve', does the same as `strip' but if a mailRoutingAddress match is
198340266059SGregory Neil Shapirofound, the +detail information is copied to the new address.
198406f25ae9SGregory Neil Shapiro
198506f25ae9SGregory Neil ShapiroThe default <mailHost> map definition is:
198606f25ae9SGregory Neil Shapiro
1987605302a5SGregory Neil Shapiro	ldap -1 -T<TMPF> -v mailHost -k (&(objectClass=inetLocalMailRecipient)
198806f25ae9SGregory Neil Shapiro				 (mailLocalAddress=%0))
198906f25ae9SGregory Neil Shapiro
199006f25ae9SGregory Neil ShapiroThe default <mailRoutingAddress> map definition is:
199106f25ae9SGregory Neil Shapiro
1992605302a5SGregory Neil Shapiro	ldap -1 -T<TMPF> -v mailRoutingAddress
1993605302a5SGregory Neil Shapiro			 -k (&(objectClass=inetLocalMailRecipient)
199406f25ae9SGregory Neil Shapiro			      (mailLocalAddress=%0))
199506f25ae9SGregory Neil Shapiro
199606f25ae9SGregory Neil ShapiroNote that neither includes the LDAP server hostname (-h server) or base DN
199706f25ae9SGregory Neil Shapiro(-b o=org,c=COUNTRY), both necessary for LDAP queries.  It is presumed that
199806f25ae9SGregory Neil Shapiroyour .mc file contains a setting for the confLDAP_DEFAULT_SPEC option with
199906f25ae9SGregory Neil Shapirothese settings.  If this is not the case, the map definitions should be
2000605302a5SGregory Neil Shapirochanged as described above.  The "-T<TMPF>" is required in any user
2001605302a5SGregory Neil Shapirospecified map definition to catch temporary errors.
200206f25ae9SGregory Neil Shapiro
200306f25ae9SGregory Neil ShapiroThe following possibilities exist as a result of an LDAP lookup on an
200406f25ae9SGregory Neil Shapiroaddress:
200506f25ae9SGregory Neil Shapiro
200606f25ae9SGregory Neil Shapiro	mailHost is	mailRoutingAddress is	Results in
200706f25ae9SGregory Neil Shapiro	-----------	---------------------	----------
200806f25ae9SGregory Neil Shapiro	set to a	set			mail delivered to
200906f25ae9SGregory Neil Shapiro	"local" host				mailRoutingAddress
201006f25ae9SGregory Neil Shapiro
201106f25ae9SGregory Neil Shapiro	set to a	not set			delivered to
201206f25ae9SGregory Neil Shapiro	"local" host				original address
201306f25ae9SGregory Neil Shapiro
201406f25ae9SGregory Neil Shapiro	set to a	set			mailRoutingAddress
201506f25ae9SGregory Neil Shapiro	remote host				relayed to mailHost
201606f25ae9SGregory Neil Shapiro
201706f25ae9SGregory Neil Shapiro	set to a	not set			original address
201806f25ae9SGregory Neil Shapiro	remote host				relayed to mailHost
201906f25ae9SGregory Neil Shapiro
202006f25ae9SGregory Neil Shapiro	not set		set			mail delivered to
202106f25ae9SGregory Neil Shapiro						mailRoutingAddress
202206f25ae9SGregory Neil Shapiro
202306f25ae9SGregory Neil Shapiro	not set		not set			delivered to
202406f25ae9SGregory Neil Shapiro						original address *OR*
202506f25ae9SGregory Neil Shapiro						bounced as unknown user
202606f25ae9SGregory Neil Shapiro
202740266059SGregory Neil ShapiroThe term "local" host above means the host specified is in class {w}.  If
202840266059SGregory Neil Shapirothe result would mean sending the mail to a different host, that host is
202940266059SGregory Neil Shapirolooked up in the mailertable before delivery.
203040266059SGregory Neil Shapiro
203106f25ae9SGregory Neil ShapiroNote that the last case depends on whether the third argument is given
203206f25ae9SGregory Neil Shapiroto the FEATURE() command.  The default is to deliver the message to the
203306f25ae9SGregory Neil Shapirooriginal address.
203406f25ae9SGregory Neil Shapiro
203506f25ae9SGregory Neil ShapiroThe LDAP entries should be set up with an objectClass of
203606f25ae9SGregory Neil ShapiroinetLocalMailRecipient and the address be listed in a mailLocalAddress
203706f25ae9SGregory Neil Shapiroattribute.  If present, there must be only one mailHost attribute and it
203806f25ae9SGregory Neil Shapiromust contain a fully qualified host name as its value.  Similarly, if
203906f25ae9SGregory Neil Shapiropresent, there must be only one mailRoutingAddress attribute and it must
204040266059SGregory Neil Shapirocontain an RFC 822 compliant address.  Some example LDAP records (in LDIF
204106f25ae9SGregory Neil Shapiroformat):
204206f25ae9SGregory Neil Shapiro
204306f25ae9SGregory Neil Shapiro	dn: uid=tom, o=example.com, c=US
204406f25ae9SGregory Neil Shapiro	objectClass: inetLocalMailRecipient
204506f25ae9SGregory Neil Shapiro	mailLocalAddress: tom@example.com
204606f25ae9SGregory Neil Shapiro	mailRoutingAddress: thomas@mailhost.example.com
204706f25ae9SGregory Neil Shapiro
204806f25ae9SGregory Neil ShapiroThis would deliver mail for tom@example.com to thomas@mailhost.example.com.
204906f25ae9SGregory Neil Shapiro
205006f25ae9SGregory Neil Shapiro	dn: uid=dick, o=example.com, c=US
205106f25ae9SGregory Neil Shapiro	objectClass: inetLocalMailRecipient
205206f25ae9SGregory Neil Shapiro	mailLocalAddress: dick@example.com
205306f25ae9SGregory Neil Shapiro	mailHost: eng.example.com
205406f25ae9SGregory Neil Shapiro
205506f25ae9SGregory Neil ShapiroThis would relay mail for dick@example.com to the same address but redirect
205640266059SGregory Neil Shapirothe mail to MX records listed for the host eng.example.com (unless the
205740266059SGregory Neil Shapiromailertable overrides).
205806f25ae9SGregory Neil Shapiro
205906f25ae9SGregory Neil Shapiro	dn: uid=harry, o=example.com, c=US
206006f25ae9SGregory Neil Shapiro	objectClass: inetLocalMailRecipient
206106f25ae9SGregory Neil Shapiro	mailLocalAddress: harry@example.com
206206f25ae9SGregory Neil Shapiro	mailHost: mktmail.example.com
206306f25ae9SGregory Neil Shapiro	mailRoutingAddress: harry@mkt.example.com
206406f25ae9SGregory Neil Shapiro
206506f25ae9SGregory Neil ShapiroThis would relay mail for harry@example.com to the MX records listed for
206606f25ae9SGregory Neil Shapirothe host mktmail.example.com using the new address harry@mkt.example.com
206706f25ae9SGregory Neil Shapirowhen talking to that host.
206806f25ae9SGregory Neil Shapiro
206906f25ae9SGregory Neil Shapiro	dn: uid=virtual.example.com, o=example.com, c=US
207006f25ae9SGregory Neil Shapiro	objectClass: inetLocalMailRecipient
207106f25ae9SGregory Neil Shapiro	mailLocalAddress: @virtual.example.com
207206f25ae9SGregory Neil Shapiro	mailHost: server.example.com
207306f25ae9SGregory Neil Shapiro	mailRoutingAddress: virtual@example.com
207406f25ae9SGregory Neil Shapiro
207506f25ae9SGregory Neil ShapiroThis would send all mail destined for any username @virtual.example.com to
207606f25ae9SGregory Neil Shapirothe machine server.example.com's MX servers and deliver to the address
207706f25ae9SGregory Neil Shapirovirtual@example.com on that relay machine.
207806f25ae9SGregory Neil Shapiro
207906f25ae9SGregory Neil Shapiro
2080c2aa98e2SPeter Wemm+---------------------------------+
2081c2aa98e2SPeter Wemm| ANTI-SPAM CONFIGURATION CONTROL |
2082c2aa98e2SPeter Wemm+---------------------------------+
2083c2aa98e2SPeter Wemm
2084c2aa98e2SPeter WemmThe primary anti-spam features available in sendmail are:
2085c2aa98e2SPeter Wemm
2086c2aa98e2SPeter Wemm* Relaying is denied by default.
2087c2aa98e2SPeter Wemm* Better checking on sender information.
2088c2aa98e2SPeter Wemm* Access database.
2089c2aa98e2SPeter Wemm* Header checks.
2090c2aa98e2SPeter Wemm
209106f25ae9SGregory Neil ShapiroRelaying (transmission of messages from a site outside your host (class
209206f25ae9SGregory Neil Shapiro{w}) to another site except yours) is denied by default.  Note that this
209306f25ae9SGregory Neil Shapirochanged in sendmail 8.9; previous versions allowed relaying by default.
209406f25ae9SGregory Neil ShapiroIf you really want to revert to the old behaviour, you will need to use
209506f25ae9SGregory Neil ShapiroFEATURE(`promiscuous_relay').  You can allow certain domains to relay
209606f25ae9SGregory Neil Shapirothrough your server by adding their domain name or IP address to class
209706f25ae9SGregory Neil Shapiro{R} using RELAY_DOMAIN() and RELAY_DOMAIN_FILE() or via the access database
209840266059SGregory Neil Shapiro(described below).  Note that IPv6 addresses must be prefaced with "IPv6:".
209940266059SGregory Neil ShapiroThe file consists (like any other file based class) of entries listed on
210040266059SGregory Neil Shapiroseparate lines, e.g.,
210106f25ae9SGregory Neil Shapiro
210206f25ae9SGregory Neil Shapiro	sendmail.org
210306f25ae9SGregory Neil Shapiro	128.32
210440266059SGregory Neil Shapiro	IPv6:2002:c0a8:02c7
210540266059SGregory Neil Shapiro	IPv6:2002:c0a8:51d2::23f4
210606f25ae9SGregory Neil Shapiro	host.mydomain.com
210740266059SGregory Neil Shapiro	[UNIX:localhost]
210840266059SGregory Neil Shapiro
210940266059SGregory Neil ShapiroNotice: the last entry allows relaying for connections via a UNIX
211040266059SGregory Neil Shapirosocket to the MTA/MSP.  This might be necessary if your configuration
211140266059SGregory Neil Shapirodoesn't allow relaying by other means in that case, e.g., by having
211240266059SGregory Neil Shapirolocalhost.$m in class {R} (make sure $m is not just a top level
211340266059SGregory Neil Shapirodomain).
2114c2aa98e2SPeter Wemm
2115c2aa98e2SPeter WemmIf you use
2116c2aa98e2SPeter Wemm
21172e43090eSPeter Wemm	FEATURE(`relay_entire_domain')
2118c2aa98e2SPeter Wemm
211906f25ae9SGregory Neil Shapirothen any host in any of your local domains (that is, class {m})
2120065a643dSPeter Wemmwill be relayed (that is, you will accept mail either to or from any
2121065a643dSPeter Wemmhost in your domain).
2122c2aa98e2SPeter Wemm
2123c2aa98e2SPeter WemmYou can also allow relaying based on the MX records of the host
2124c2aa98e2SPeter Wemmportion of an incoming recipient address by using
2125c2aa98e2SPeter Wemm
21262e43090eSPeter Wemm	FEATURE(`relay_based_on_MX')
2127c2aa98e2SPeter Wemm
2128c2aa98e2SPeter WemmFor example, if your server receives a recipient of user@domain.com
2129c2aa98e2SPeter Wemmand domain.com lists your server in its MX records, the mail will be
213040266059SGregory Neil Shapiroaccepted for relay to domain.com.  This feature may cause problems
213140266059SGregory Neil Shapiroif MX lookups for the recipient domain are slow or time out.  In that
213240266059SGregory Neil Shapirocase, mail will be temporarily rejected.  It is usually better to
213340266059SGregory Neil Shapiromaintain a list of hosts/domains for which the server acts as relay.
213440266059SGregory Neil ShapiroNote also that this feature will stop spammers from using your host
213540266059SGregory Neil Shapiroto relay spam but it will not stop outsiders from using your server
213640266059SGregory Neil Shapiroas a relay for their site (that is, they set up an MX record pointing
213740266059SGregory Neil Shapiroto your mail server, and you will relay mail addressed to them
213840266059SGregory Neil Shapirowithout any prior arrangement).  Along the same lines,
2139c2aa98e2SPeter Wemm
21402e43090eSPeter Wemm	FEATURE(`relay_local_from')
2141c2aa98e2SPeter Wemm
2142c2aa98e2SPeter Wemmwill allow relaying if the sender specifies a return path (i.e.
214340266059SGregory Neil ShapiroMAIL FROM: <user@domain>) domain which is a local domain.  This is a
2144c2aa98e2SPeter Wemmdangerous feature as it will allow spammers to spam using your mail
2145c2aa98e2SPeter Wemmserver by simply specifying a return address of user@your.domain.com.
2146c2aa98e2SPeter WemmIt should not be used unless absolutely necessary.
214706f25ae9SGregory Neil ShapiroA slightly better solution is
214806f25ae9SGregory Neil Shapiro
214906f25ae9SGregory Neil Shapiro	FEATURE(`relay_mail_from')
215006f25ae9SGregory Neil Shapiro
215106f25ae9SGregory Neil Shapirowhich allows relaying if the mail sender is listed as RELAY in the
215206f25ae9SGregory Neil Shapiroaccess map.  If an optional argument `domain' is given, the domain
215306f25ae9SGregory Neil Shapiroportion of the mail sender is also checked to allowing relaying.
215406f25ae9SGregory Neil ShapiroThis option only works together with the tag From: for the LHS of
215540266059SGregory Neil Shapirothe access map entries (see below: Finer control...).  This feature
215640266059SGregory Neil Shapiroallows spammers to abuse your mail server by specifying a return
215740266059SGregory Neil Shapiroaddress that you enabled in your access file.  This may be harder
215840266059SGregory Neil Shapiroto figure out for spammers, but it should not be used unless
215940266059SGregory Neil Shapironecessary.  Instead use SMTP AUTH or STARTTLS to allow relaying
216040266059SGregory Neil Shapirofor roaming users.
216106f25ae9SGregory Neil Shapiro
2162c2aa98e2SPeter Wemm
216340266059SGregory Neil ShapiroIf source routing is used in the recipient address (e.g.,
2164c2aa98e2SPeter WemmRCPT TO: <user%site.com@othersite.com>), sendmail will check
2165c2aa98e2SPeter Wemmuser@site.com for relaying if othersite.com is an allowed relay host
216606f25ae9SGregory Neil Shapiroin either class {R}, class {m} if FEATURE(`relay_entire_domain') is used,
21672e43090eSPeter Wemmor the access database if FEATURE(`access_db') is used.  To prevent
2168c2aa98e2SPeter Wemmthe address from being stripped down, use:
2169c2aa98e2SPeter Wemm
21702e43090eSPeter Wemm	FEATURE(`loose_relay_check')
2171c2aa98e2SPeter Wemm
2172c2aa98e2SPeter WemmIf you think you need to use this feature, you probably do not.  This
2173c2aa98e2SPeter Wemmshould only be used for sites which have no control over the addresses
2174c2aa98e2SPeter Wemmthat they provide a gateway for.  Use this FEATURE with caution as it
2175c2aa98e2SPeter Wemmcan allow spammers to relay through your server if not setup properly.
2176c2aa98e2SPeter Wemm
217706f25ae9SGregory Neil ShapiroNOTICE: It is possible to relay mail through a system which the anti-relay
217806f25ae9SGregory Neil Shapirorules do not prevent: the case of a system that does use FEATURE(`nouucp',
217906f25ae9SGregory Neil Shapiro`nospecial') (system A) and relays local messages to a mail hub (e.g., via
218006f25ae9SGregory Neil ShapiroLOCAL_RELAY or LUSER_RELAY) (system B).  If system B doesn't use
218106f25ae9SGregory Neil ShapiroFEATURE(`nouucp') at all, addresses of the form
218206f25ae9SGregory Neil Shapiro<example.net!user@local.host> would be relayed to <user@example.net>.
218306f25ae9SGregory Neil ShapiroSystem A doesn't recognize `!' as an address separator and therefore
218406f25ae9SGregory Neil Shapiroforwards it to the mail hub which in turns relays it because it came from
218506f25ae9SGregory Neil Shapiroa trusted local host.  So if a mailserver allows UUCP (bang-format)
218606f25ae9SGregory Neil Shapiroaddresses, all systems from which it allows relaying should do the same
218706f25ae9SGregory Neil Shapiroor reject those addresses.
218806f25ae9SGregory Neil Shapiro
2189c2aa98e2SPeter WemmAs of 8.9, sendmail will refuse mail if the MAIL FROM: parameter has
2190c2aa98e2SPeter Wemman unresolvable domain (i.e., one that DNS, your local name service,
219140266059SGregory Neil Shapiroor special case rules in ruleset 3 cannot locate).  This also applies
219240266059SGregory Neil Shapiroto addresses that use domain literals, e.g., <user@[1.2.3.4]>, if the
219340266059SGregory Neil ShapiroIP address can't be mapped to a host name.  If you want to continue
219440266059SGregory Neil Shapiroto accept such domains, e.g., because you are inside a firewall that
219540266059SGregory Neil Shapirohas only a limited view of the Internet host name space (note that you
219640266059SGregory Neil Shapirowill not be able to return mail to them unless you have some "smart
219740266059SGregory Neil Shapirohost" forwarder), use
2198c2aa98e2SPeter Wemm
21992e43090eSPeter Wemm	FEATURE(`accept_unresolvable_domains')
2200c2aa98e2SPeter Wemm
220140266059SGregory Neil ShapiroAlternatively, you can allow specific addresses by adding them to
220240266059SGregory Neil Shapirothe access map, e.g.,
220340266059SGregory Neil Shapiro
220440266059SGregory Neil Shapiro	From:unresolvable.domain	OK
220540266059SGregory Neil Shapiro	From:[1.2.3.4]			OK
220640266059SGregory Neil Shapiro	From:[1.2.4]			OK
220740266059SGregory Neil Shapiro
220840266059SGregory Neil ShapiroNotice: domains which are temporarily unresolvable are (temporarily)
220940266059SGregory Neil Shapirorejected with a 451 reply code.  If those domains should be accepted
221040266059SGregory Neil Shapiro(which is discouraged) then you can use
221140266059SGregory Neil Shapiro
221240266059SGregory Neil Shapiro	LOCAL_CONFIG
221340266059SGregory Neil Shapiro	C{ResOk}TEMP
221440266059SGregory Neil Shapiro
2215c2aa98e2SPeter Wemmsendmail will also refuse mail if the MAIL FROM: parameter is not
2216c2aa98e2SPeter Wemmfully qualified (i.e., contains a domain as well as a user).  If you
2217c2aa98e2SPeter Wemmwant to continue to accept such senders, use
2218c2aa98e2SPeter Wemm
22192e43090eSPeter Wemm	FEATURE(`accept_unqualified_senders')
2220c2aa98e2SPeter Wemm
222106f25ae9SGregory Neil ShapiroSetting the DaemonPortOptions modifier 'u' overrides the default behavior,
222206f25ae9SGregory Neil Shapiroi.e., unqualified addresses are accepted even without this FEATURE.  If
222306f25ae9SGregory Neil Shapirothis FEATURE is not used, the DaemonPortOptions modifier 'f' can be used
222440266059SGregory Neil Shapiroto enforce fully qualified domain names.
222506f25ae9SGregory Neil Shapiro
2226c2aa98e2SPeter WemmAn ``access'' database can be created to accept or reject mail from
2227c2aa98e2SPeter Wemmselected domains.  For example, you may choose to reject all mail
2228c2aa98e2SPeter Wemmoriginating from known spammers.  To enable such a database, use
2229c2aa98e2SPeter Wemm
22302e43090eSPeter Wemm	FEATURE(`access_db')
2231c2aa98e2SPeter Wemm
223240266059SGregory Neil ShapiroNotice: the access database is applied to the envelope addresses
223340266059SGregory Neil Shapiroand the connection information, not to the header.
223440266059SGregory Neil Shapiro
223540266059SGregory Neil ShapiroThe FEATURE macro can accept as second parameter the key file
2236c2aa98e2SPeter Wemmdefinition for the database; for example
2237c2aa98e2SPeter Wemm
223840266059SGregory Neil Shapiro	FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access_map')
223940266059SGregory Neil Shapiro
224040266059SGregory Neil ShapiroNotice: If a second argument is specified it must contain the option
224140266059SGregory Neil Shapiro`-T<TMPF>' as shown above.  The optional third and fourth parameters
224240266059SGregory Neil Shapiromay be `skip' or `lookupdotdomain'.  The former enables SKIP as
224340266059SGregory Neil Shapirovalue part (see below), the latter is another way to enable the
224440266059SGregory Neil Shapirofeature of the same name (see above).
2245c2aa98e2SPeter Wemm
2246065a643dSPeter WemmRemember, since /etc/mail/access is a database, after creating the text
2247065a643dSPeter Wemmfile as described below, you must use makemap to create the database
2248065a643dSPeter Wemmmap.  For example:
2249065a643dSPeter Wemm
2250065a643dSPeter Wemm	makemap hash /etc/mail/access < /etc/mail/access
2251065a643dSPeter Wemm
2252c2aa98e2SPeter WemmThe table itself uses e-mail addresses, domain names, and network
225340266059SGregory Neil Shapironumbers as keys.  Note that IPv6 addresses must be prefaced with "IPv6:".
225440266059SGregory Neil ShapiroFor example,
2255c2aa98e2SPeter Wemm
2256c2aa98e2SPeter Wemm	spammer@aol.com			REJECT
2257c2aa98e2SPeter Wemm	cyberspammer.com		REJECT
2258605302a5SGregory Neil Shapiro	TLD				REJECT
2259065a643dSPeter Wemm	192.168.212			REJECT
226040266059SGregory Neil Shapiro	IPv6:2002:c0a8:02c7		RELAY
226140266059SGregory Neil Shapiro	IPv6:2002:c0a8:51d2::23f4	REJECT
2262c2aa98e2SPeter Wemm
2263c2aa98e2SPeter Wemmwould refuse mail from spammer@aol.com, any user from cyberspammer.com
2264605302a5SGregory Neil Shapiro(or any host within the cyberspammer.com domain), any host in the entire
2265605302a5SGregory Neil Shapirotop level domain TLD, 192.168.212.* network, and the IPv6 address
2266605302a5SGregory Neil Shapiro2002:c0a8:51d2::23f4.  It would allow relay for the IPv6 network
2267605302a5SGregory Neil Shapiro2002:c0a8:02c7::/48.
2268c2aa98e2SPeter Wemm
2269c2aa98e2SPeter WemmThe value part of the map can contain:
2270c2aa98e2SPeter Wemm
227140266059SGregory Neil Shapiro	OK		Accept mail even if other rules in the running
227240266059SGregory Neil Shapiro			ruleset would reject it, for example, if the domain
227340266059SGregory Neil Shapiro			name is unresolvable.  "Accept" does not mean
227440266059SGregory Neil Shapiro			"relay", but at most acceptance for local
227540266059SGregory Neil Shapiro			recipients.  That is, OK allows less than RELAY.
2276065a643dSPeter Wemm	RELAY		Accept mail addressed to the indicated domain or
2277065a643dSPeter Wemm			received from the indicated domain for relaying
2278065a643dSPeter Wemm			through your SMTP server.  RELAY also serves as
2279065a643dSPeter Wemm			an implicit OK for the other checks.
2280065a643dSPeter Wemm	REJECT		Reject the sender or recipient with a general
2281c2aa98e2SPeter Wemm			purpose message.
2282065a643dSPeter Wemm	DISCARD		Discard the message completely using the
2283193538b7SGregory Neil Shapiro			$#discard mailer.  If it is used in check_compat,
2284193538b7SGregory Neil Shapiro			it affects only the designated recipient, not
2285193538b7SGregory Neil Shapiro			the whole message as it does in all other cases.
2286193538b7SGregory Neil Shapiro			This should only be used if really necessary.
228740266059SGregory Neil Shapiro	SKIP		This can only be used for host/domain names
228840266059SGregory Neil Shapiro			and IP addresses/nets.  It will abort the current
228940266059SGregory Neil Shapiro			search for this entry without accepting or rejecting
229040266059SGregory Neil Shapiro			it but causing the default action.
229142e5d165SGregory Neil Shapiro	### any text	where ### is an RFC 821 compliant error code and
229242e5d165SGregory Neil Shapiro			"any text" is a message to return for the command.
229342e5d165SGregory Neil Shapiro			The string should be quoted to avoid surprises,
229442e5d165SGregory Neil Shapiro			e.g., sendmail may remove spaces otherwise.
229540266059SGregory Neil Shapiro			This type is deprecated, use one the two
229640266059SGregory Neil Shapiro			ERROR:  entries below instead.
229706f25ae9SGregory Neil Shapiro	ERROR:### any text
229806f25ae9SGregory Neil Shapiro			as above, but useful to mark error messages as such.
229906f25ae9SGregory Neil Shapiro	ERROR:D.S.N:### any text
230006f25ae9SGregory Neil Shapiro			where D.S.N is an RFC 1893 compliant error code
230106f25ae9SGregory Neil Shapiro			and the rest as above.
2302c2aa98e2SPeter Wemm
2303c2aa98e2SPeter WemmFor example:
2304c2aa98e2SPeter Wemm
230540266059SGregory Neil Shapiro	cyberspammer.com	ERROR:550 "We don't accept mail from spammers"
2306c2aa98e2SPeter Wemm	okay.cyberspammer.com	OK
230706f25ae9SGregory Neil Shapiro	sendmail.org		RELAY
2308c2aa98e2SPeter Wemm	128.32			RELAY
230940266059SGregory Neil Shapiro	IPv6:1:2:3:4:5:6:7	RELAY
231006f25ae9SGregory Neil Shapiro	[127.0.0.3]		OK
231140266059SGregory Neil Shapiro	[IPv6:1:2:3:4:5:6:7:8]	OK
2312c2aa98e2SPeter Wemm
231306f25ae9SGregory Neil Shapirowould accept mail from okay.cyberspammer.com, but would reject mail from
231406f25ae9SGregory Neil Shapiroall other hosts at cyberspammer.com with the indicated message.  It would
231506f25ae9SGregory Neil Shapiroallow relaying mail from and to any hosts in the sendmail.org domain, and
231606f25ae9SGregory Neil Shapiroallow relaying from the 128.32.*.* network and the IPv6 1:2:3:4:5:6:7:*
231706f25ae9SGregory Neil Shapironetwork.  The latter two entries are for checks against ${client_name} if
231806f25ae9SGregory Neil Shapirothe IP address doesn't resolve to a hostname (or is considered as "may be
231940266059SGregory Neil Shapiroforged").  That is, using square brackets means these are host names,
232040266059SGregory Neil Shapironot network numbers.
232106f25ae9SGregory Neil Shapiro
232206f25ae9SGregory Neil ShapiroWarning: if you change the RFC 821 compliant error code from the default
232306f25ae9SGregory Neil Shapirovalue of 550, then you should probably also change the RFC 1893 compliant
232406f25ae9SGregory Neil Shapiroerror code to match it.  For example, if you use
232506f25ae9SGregory Neil Shapiro
232640266059SGregory Neil Shapiro	user@example.com	ERROR:450 mailbox full
232706f25ae9SGregory Neil Shapiro
232840266059SGregory Neil Shapirothe error returned would be "450 5.0.0 mailbox full" which is wrong.
232940266059SGregory Neil ShapiroUse "ERROR:4.2.2:450 mailbox full" instead.
233006f25ae9SGregory Neil Shapiro
233106f25ae9SGregory Neil ShapiroNote, UUCP users may need to add hostname.UUCP to the access database
233240266059SGregory Neil Shapiroor class {R}.
233340266059SGregory Neil Shapiro
233440266059SGregory Neil ShapiroIf you also use:
2335c2aa98e2SPeter Wemm
23362e43090eSPeter Wemm	FEATURE(`relay_hosts_only')
2337c2aa98e2SPeter Wemm
2338c2aa98e2SPeter Wemmthen the above example will allow relaying for sendmail.org, but not
2339c2aa98e2SPeter Wemmhosts within the sendmail.org domain.  Note that this will also require
234006f25ae9SGregory Neil Shapirohosts listed in class {R} to be fully qualified host names.
2341c2aa98e2SPeter Wemm
2342c2aa98e2SPeter WemmYou can also use the access database to block sender addresses based on
2343c2aa98e2SPeter Wemmthe username portion of the address.  For example:
2344c2aa98e2SPeter Wemm
234542e5d165SGregory Neil Shapiro	FREE.STEALTH.MAILER@	ERROR:550 Spam not accepted
2346c2aa98e2SPeter Wemm
2347c2aa98e2SPeter WemmNote that you must include the @ after the username to signify that
2348c2aa98e2SPeter Wemmthis database entry is for checking only the username portion of the
2349c2aa98e2SPeter Wemmsender address.
2350c2aa98e2SPeter Wemm
2351c2aa98e2SPeter WemmIf you use:
2352c2aa98e2SPeter Wemm
23532e43090eSPeter Wemm	FEATURE(`blacklist_recipients')
2354c2aa98e2SPeter Wemm
2355c2aa98e2SPeter Wemmthen you can add entries to the map for local users, hosts in your
2356c2aa98e2SPeter Wemmdomains, or addresses in your domain which should not receive mail:
2357c2aa98e2SPeter Wemm
235842e5d165SGregory Neil Shapiro	badlocaluser@		ERROR:550 Mailbox disabled for this username
235942e5d165SGregory Neil Shapiro	host.mydomain.com	ERROR:550 That host does not accept mail
236042e5d165SGregory Neil Shapiro	user@otherhost.mydomain.com	ERROR:550 Mailbox disabled for this recipient
2361c2aa98e2SPeter Wemm
2362c2aa98e2SPeter WemmThis would prevent a recipient of badlocaluser@mydomain.com, any
2363c2aa98e2SPeter Wemmuser at host.mydomain.com, and the single address
236406f25ae9SGregory Neil Shapirouser@otherhost.mydomain.com from receiving mail.  Please note: a
236506f25ae9SGregory Neil Shapirolocal username must be now tagged with an @ (this is consistent
236606f25ae9SGregory Neil Shapirowith the check of the sender address, and hence it is possible to
236706f25ae9SGregory Neil Shapirodistinguish between hostnames and usernames).  Enabling this feature
236806f25ae9SGregory Neil Shapirowill keep you from sending mails to all addresses that have an
236906f25ae9SGregory Neil Shapiroerror message or REJECT as value part in the access map.  Taking
237006f25ae9SGregory Neil Shapirothe example from above:
2371065a643dSPeter Wemm
2372065a643dSPeter Wemm	spammer@aol.com		REJECT
2373065a643dSPeter Wemm	cyberspammer.com	REJECT
2374065a643dSPeter Wemm
2375065a643dSPeter WemmMail can't be sent to spammer@aol.com or anyone at cyberspammer.com.
2376c2aa98e2SPeter Wemm
237740266059SGregory Neil ShapiroThere are several DNS based blacklists, the first of which was
237840266059SGregory Neil Shapirothe RBL (``Realtime Blackhole List'') run by the MAPS project,
237940266059SGregory Neil Shapirosee http://mail-abuse.org/.  These are databases of spammers
238040266059SGregory Neil Shapiromaintained in DNS.  To use such a database, specify
2381c2aa98e2SPeter Wemm
238206f25ae9SGregory Neil Shapiro	FEATURE(`dnsbl')
2383c2aa98e2SPeter Wemm
238440266059SGregory Neil ShapiroThis will cause sendmail to reject mail from any site in the original
238513058a91SGregory Neil ShapiroRealtime Blackhole List database.  This default DNS blacklist,
238613058a91SGregory Neil Shapiroblackholes.mail-abuse.org, is a service offered by the Mail Abuse
238713058a91SGregory Neil ShapiroPrevention System (MAPS).  As of July 31, 2001, MAPS is a subscription
238813058a91SGregory Neil Shapiroservice, so using that network address won't work if you haven't
238913058a91SGregory Neil Shapirosubscribed.  Contact MAPS to subscribe (http://mail-abuse.org/).
239013058a91SGregory Neil Shapiro
239113058a91SGregory Neil ShapiroYou can specify an alternative RBL server to check by specifying an
239213058a91SGregory Neil Shapiroargument to the FEATURE.  The default error message is
239313058a91SGregory Neil Shapiro
239440266059SGregory Neil Shapiro	Mail from IP-ADDRESS refused by blackhole site SERVER
2395193538b7SGregory Neil Shapiro
239640266059SGregory Neil Shapirowhere IP-ADDRESS and SERVER are replaced by the appropriate
239740266059SGregory Neil Shapiroinformation.  A second argument can be used to specify a different
239840266059SGregory Neil Shapirotext.  By default, temporary lookup failures are ignored and hence
239940266059SGregory Neil Shapirocause the connection not to be rejected by the DNS based rejection
240040266059SGregory Neil Shapirolist.  This behavior can be changed by specifying a third argument,
240140266059SGregory Neil Shapirowhich must be either `t' or a full error message.  For example:
2402193538b7SGregory Neil Shapiro
240340266059SGregory Neil Shapiro	FEATURE(`dnsbl', `dnsbl.example.com', `',
240440266059SGregory Neil Shapiro	`"451 Temporary lookup failure for " $&{client_addr} " in dnsbl.example.com"')
240540266059SGregory Neil Shapiro
240640266059SGregory Neil ShapiroIf `t' is used, the error message is:
240740266059SGregory Neil Shapiro
240840266059SGregory Neil Shapiro	451 Temporary lookup failure of IP-ADDRESS at SERVER
240940266059SGregory Neil Shapiro
241040266059SGregory Neil Shapirowhere IP-ADDRESS and SERVER are replaced by the appropriate
241140266059SGregory Neil Shapiroinformation.
241240266059SGregory Neil Shapiro
241340266059SGregory Neil ShapiroThis FEATURE can be included several times to query different
241440266059SGregory Neil ShapiroDNS based rejection lists, e.g., the dial-up user list (see
241540266059SGregory Neil Shapirohttp://mail-abuse.org/dul/).
241640266059SGregory Neil Shapiro
241740266059SGregory Neil ShapiroNotice: to avoid checking your own local domains against those
241840266059SGregory Neil Shapiroblacklists, use the access_db feature and add:
241940266059SGregory Neil Shapiro
242040266059SGregory Neil Shapiro	Connect:10.1		OK
242140266059SGregory Neil Shapiro	Connect:127.0.0.1	RELAY
242240266059SGregory Neil Shapiro
242340266059SGregory Neil Shapiroto the access map, where 10.1 is your local network.  You may
242440266059SGregory Neil Shapirowant to use "RELAY" instead of "OK" to allow also relaying
242540266059SGregory Neil Shapiroinstead of just disabling the DNS lookups in the backlists.
242640266059SGregory Neil Shapiro
2427c2aa98e2SPeter Wemm
2428c2aa98e2SPeter WemmThe features described above make use of the check_relay, check_mail,
2429c2aa98e2SPeter Wemmand check_rcpt rulesets.  If you wish to include your own checks,
2430c2aa98e2SPeter Wemmyou can put your checks in the rulesets Local_check_relay,
2431c2aa98e2SPeter WemmLocal_check_mail, and Local_check_rcpt.  For example if you wanted to
2432c2aa98e2SPeter Wemmblock senders with all numeric usernames (i.e. 2312343@bigisp.com),
243340266059SGregory Neil Shapiroyou would use Local_check_mail and the regex map:
2434c2aa98e2SPeter Wemm
2435c2aa98e2SPeter Wemm	LOCAL_CONFIG
2436c2aa98e2SPeter Wemm	Kallnumbers regex -a@MATCH ^[0-9]+$
2437c2aa98e2SPeter Wemm
2438c2aa98e2SPeter Wemm	LOCAL_RULESETS
2439c2aa98e2SPeter Wemm	SLocal_check_mail
2440c2aa98e2SPeter Wemm	# check address against various regex checks
2441c2aa98e2SPeter Wemm	R$*				$: $>Parse0 $>3 $1
2442c2aa98e2SPeter Wemm	R$+ < @ bigisp.com. > $*	$: $(allnumbers $1 $)
2443c2aa98e2SPeter Wemm	R@MATCH				$#error $: 553 Header Error
2444c2aa98e2SPeter Wemm
2445c2aa98e2SPeter WemmThese rules are called with the original arguments of the corresponding
2446c2aa98e2SPeter Wemmcheck_* ruleset.  If the local ruleset returns $#OK, no further checking
2447c2aa98e2SPeter Wemmis done by the features described above and the mail is accepted.  If the
2448c2aa98e2SPeter Wemmlocal ruleset resolves to a mailer (such as $#error or $#discard), the
2449c2aa98e2SPeter Wemmappropriate action is taken.  Otherwise, the results of the local
2450c2aa98e2SPeter Wemmrewriting are ignored.
2451c2aa98e2SPeter Wemm
245206f25ae9SGregory Neil ShapiroFiner control by using tags for the LHS of the access map
245340266059SGregory Neil Shapiro---------------------------------------------------------
245406f25ae9SGregory Neil Shapiro
245506f25ae9SGregory Neil ShapiroRead this section only if the options listed so far are not sufficient
245606f25ae9SGregory Neil Shapirofor your purposes.  There is now the option to tag entries in the
245706f25ae9SGregory Neil Shapiroaccess map according to their type.  Three tags are available:
245806f25ae9SGregory Neil Shapiro
245906f25ae9SGregory Neil Shapiro	Connect:	connection information (${client_addr}, ${client_name})
2460602a2b1bSGregory Neil Shapiro	From:		envelope sender
2461602a2b1bSGregory Neil Shapiro	To:		envelope recipient
246206f25ae9SGregory Neil Shapiro
246306f25ae9SGregory Neil ShapiroIf the required item is looked up in a map, it will be tried first
246406f25ae9SGregory Neil Shapirowith the corresponding tag in front, then (as fallback to enable
246540266059SGregory Neil Shapirobackward compatibility) without any tag, unless the specific feature
246640266059SGregory Neil Shapirorequires a tag.  For example,
246706f25ae9SGregory Neil Shapiro
246806f25ae9SGregory Neil Shapiro	From:spammer@some.dom	REJECT
246906f25ae9SGregory Neil Shapiro	To:friend.domain	RELAY
247006f25ae9SGregory Neil Shapiro	Connect:friend.domain	OK
247106f25ae9SGregory Neil Shapiro	Connect:from.domain	RELAY
247206f25ae9SGregory Neil Shapiro	From:good@another.dom	OK
247306f25ae9SGregory Neil Shapiro	From:another.dom	REJECT
247406f25ae9SGregory Neil Shapiro
247506f25ae9SGregory Neil ShapiroThis would deny mails from spammer@some.dom but you could still
247606f25ae9SGregory Neil Shapirosend mail to that address even if FEATURE(`blacklist_recipients')
247706f25ae9SGregory Neil Shapirois enabled.  Your system will allow relaying to friend.domain, but
247806f25ae9SGregory Neil Shapironot from it (unless enabled by other means).  Connections from that
247906f25ae9SGregory Neil Shapirodomain will be allowed even if it ends up in one of the DNS based
248006f25ae9SGregory Neil Shapirorejection lists.  Relaying is enabled from from.domain but not to
248106f25ae9SGregory Neil Shapiroit (since relaying is based on the connection information for
248206f25ae9SGregory Neil Shapirooutgoing relaying, the tag Connect: must be used; for incoming
248306f25ae9SGregory Neil Shapirorelaying, which is based on the recipient address, To: must be
248406f25ae9SGregory Neil Shapiroused).  The last two entries allow mails from good@another.dom but
248506f25ae9SGregory Neil Shapiroreject mail from all other addresses with another.dom as domain
248606f25ae9SGregory Neil Shapiropart.
248706f25ae9SGregory Neil Shapiro
248806f25ae9SGregory Neil ShapiroDelay all checks
248940266059SGregory Neil Shapiro----------------
249006f25ae9SGregory Neil Shapiro
249106f25ae9SGregory Neil ShapiroBy using FEATURE(`delay_checks') the rulesets check_mail and check_relay
249206f25ae9SGregory Neil Shapirowill not be called when a client connects or issues a MAIL command,
249306f25ae9SGregory Neil Shapirorespectively.  Instead, those rulesets will be called by the check_rcpt
249406f25ae9SGregory Neil Shapiroruleset; they will be skipped if a sender has been authenticated using
249506f25ae9SGregory Neil Shapiroa "trusted" mechanism, i.e., one that is defined via TRUST_AUTH_MECH().
249606f25ae9SGregory Neil ShapiroIf check_mail returns an error then the RCPT TO command will be rejected
249706f25ae9SGregory Neil Shapirowith that error.  If it returns some other result starting with $# then
249806f25ae9SGregory Neil Shapirocheck_relay will be skipped.  If the sender address (or a part of it) is
249906f25ae9SGregory Neil Shapirolisted in the access map and it has a RHS of OK or RELAY, then check_relay
250006f25ae9SGregory Neil Shapirowill be skipped.  This has an interesting side effect: if your domain is
250106f25ae9SGregory Neil Shapiromy.domain and you have
250206f25ae9SGregory Neil Shapiro
250306f25ae9SGregory Neil Shapiro	my.domain	RELAY
250406f25ae9SGregory Neil Shapiro
250506f25ae9SGregory Neil Shapiroin the access map, then all e-mail with a sender address of
250606f25ae9SGregory Neil Shapiro<user@my.domain> gets through, even if check_relay would reject it
250706f25ae9SGregory Neil Shapiro(e.g., based on the hostname or IP address).  This allows spammers
250806f25ae9SGregory Neil Shapiroto get around DNS based blacklist by faking the sender address.  To
250906f25ae9SGregory Neil Shapiroavoid this problem you have to use tagged entries:
251006f25ae9SGregory Neil Shapiro
251106f25ae9SGregory Neil Shapiro	To:my.domain		RELAY
251206f25ae9SGregory Neil Shapiro	Connect:my.domain	RELAY
251306f25ae9SGregory Neil Shapiro
251406f25ae9SGregory Neil Shapiroif you need those entries at all (class {R} may take care of them).
251506f25ae9SGregory Neil Shapiro
251606f25ae9SGregory Neil ShapiroFEATURE(`delay_checks') can take an optional argument:
251706f25ae9SGregory Neil Shapiro
251806f25ae9SGregory Neil Shapiro	FEATURE(`delay_checks', `friend')
251906f25ae9SGregory Neil Shapiro		 enables spamfriend test
252006f25ae9SGregory Neil Shapiro	FEATURE(`delay_checks', `hater')
252106f25ae9SGregory Neil Shapiro		 enables spamhater test
252206f25ae9SGregory Neil Shapiro
2523605302a5SGregory Neil ShapiroIf such an argument is given, the recipient will be looked up in the
2524605302a5SGregory Neil Shapiroaccess map (using the tag Spam:).  If the argument is `friend', then
2525605302a5SGregory Neil Shapirothe default behavior is to apply the other rulesets and make a SPAM
2526605302a5SGregory Neil Shapirofriend the exception.  The rulesets check_mail and check_relay will be
2527605302a5SGregory Neil Shapiroskipped only if the recipient address is found and has RHS FRIEND.  If
2528605302a5SGregory Neil Shapirothe argument is `hater', then the default behavior is to skip the rulesets
2529605302a5SGregory Neil Shapirocheck_mail and check_relay and make a SPAM hater the exception.  The
2530605302a5SGregory Neil Shapiroother two rulesets will be applied only if the recipient address is
2531605302a5SGregory Neil Shapirofound and has RHS HATER.
253206f25ae9SGregory Neil Shapiro
253306f25ae9SGregory Neil ShapiroThis allows for simple exceptions from the tests, e.g., by activating
253440266059SGregory Neil Shapirothe friend option and having
253506f25ae9SGregory Neil Shapiro
253640266059SGregory Neil Shapiro	Spam:abuse@	FRIEND
253706f25ae9SGregory Neil Shapiro
253806f25ae9SGregory Neil Shapiroin the access map, mail to abuse@localdomain will get through.  It is
253906f25ae9SGregory Neil Shapiroalso possible to specify a full address or an address with +detail:
254006f25ae9SGregory Neil Shapiro
254140266059SGregory Neil Shapiro	Spam:abuse@my.domain	FRIEND
254240266059SGregory Neil Shapiro	Spam:me+abuse@		FRIEND
254340266059SGregory Neil Shapiro	Spam:spam.domain	FRIEND
254406f25ae9SGregory Neil Shapiro
254540266059SGregory Neil ShapiroNote: The required tag has been changed in 8.12 from To: to Spam:.
254640266059SGregory Neil ShapiroThis change is incompatible to previous versions.  However, you can
254740266059SGregory Neil Shapiro(for now) simply add the new entries to the access map, the old
254840266059SGregory Neil Shapiroones will be ignored.  As soon as you removed the old entries from
254940266059SGregory Neil Shapirothe access map, specify a third parameter (`n') to this feature and
255040266059SGregory Neil Shapirothe backward compatibility rules will not be in the generated .cf
255140266059SGregory Neil Shapirofile.
255206f25ae9SGregory Neil Shapiro
255306f25ae9SGregory Neil ShapiroHeader Checks
255440266059SGregory Neil Shapiro-------------
2555c2aa98e2SPeter Wemm
2556c2aa98e2SPeter WemmYou can also reject mail on the basis of the contents of headers.
2557c2aa98e2SPeter WemmThis is done by adding a ruleset call to the 'H' header definition command
2558c2aa98e2SPeter Wemmin sendmail.cf.  For example, this can be used to check the validity of
2559c2aa98e2SPeter Wemma Message-ID: header:
2560c2aa98e2SPeter Wemm
2561c2aa98e2SPeter Wemm	LOCAL_RULESETS
2562c2aa98e2SPeter Wemm	HMessage-Id: $>CheckMessageId
2563c2aa98e2SPeter Wemm
2564c2aa98e2SPeter Wemm	SCheckMessageId
2565c2aa98e2SPeter Wemm	R< $+ @ $+ >		$@ OK
2566c2aa98e2SPeter Wemm	R$*			$#error $: 553 Header Error
2567c2aa98e2SPeter Wemm
256806f25ae9SGregory Neil ShapiroThe alternative format:
2569065a643dSPeter Wemm
257006f25ae9SGregory Neil Shapiro	HSubject: $>+CheckSubject
2571065a643dSPeter Wemm
257206f25ae9SGregory Neil Shapirothat is, $>+ instead of $>, gives the full Subject: header including
257306f25ae9SGregory Neil Shapirocomments to the ruleset (comments in parentheses () are stripped
257406f25ae9SGregory Neil Shapiroby default).
25752e43090eSPeter Wemm
257606f25ae9SGregory Neil ShapiroA default ruleset for headers which don't have a specific ruleset
257706f25ae9SGregory Neil Shapirodefined for them can be given by:
2578065a643dSPeter Wemm
257906f25ae9SGregory Neil Shapiro	H*: $>CheckHdr
258006f25ae9SGregory Neil Shapiro
258140266059SGregory Neil ShapiroNotice:
258240266059SGregory Neil Shapiro1. All rules act on tokens as explained in doc/op/op.{me,ps,txt}.
2583602a2b1bSGregory Neil ShapiroThat may cause problems with simple header checks due to the
2584602a2b1bSGregory Neil Shapirotokenization.  It might be simpler to use a regex map and apply it
2585602a2b1bSGregory Neil Shapiroto $&{currHeader}.
258640266059SGregory Neil Shapiro2. There are no default rulesets coming with this distribution of
258740266059SGregory Neil Shapirosendmail.  You can either write your own or you can search the
258840266059SGregory Neil ShapiroWWW for examples, e.g.,  http://www.digitalanswers.org/check_local/
2589602a2b1bSGregory Neil Shapiro
259006f25ae9SGregory Neil ShapiroAfter all of the headers are read, the check_eoh ruleset will be called for
259106f25ae9SGregory Neil Shapiroany final header-related checks.  The ruleset is called with the number of
259206f25ae9SGregory Neil Shapiroheaders and the size of all of the headers in bytes separated by $|.  One
259306f25ae9SGregory Neil Shapiroexample usage is to reject messages which do not have a Message-Id:
259406f25ae9SGregory Neil Shapiroheader.  However, the Message-Id: header is *NOT* a required header and is
259506f25ae9SGregory Neil Shapironot a guaranteed spam indicator.  This ruleset is an example and should
259606f25ae9SGregory Neil Shapiroprobably not be used in production.
259706f25ae9SGregory Neil Shapiro
259806f25ae9SGregory Neil Shapiro	LOCAL_CONFIG
259906f25ae9SGregory Neil Shapiro	Kstorage macro
260006f25ae9SGregory Neil Shapiro
260106f25ae9SGregory Neil Shapiro	LOCAL_RULESETS
260206f25ae9SGregory Neil Shapiro	HMessage-Id: $>CheckMessageId
260306f25ae9SGregory Neil Shapiro
260406f25ae9SGregory Neil Shapiro	SCheckMessageId
260506f25ae9SGregory Neil Shapiro	# Record the presence of the header
260606f25ae9SGregory Neil Shapiro	R$*			$: $(storage {MessageIdCheck} $@ OK $) $1
260706f25ae9SGregory Neil Shapiro	R< $+ @ $+ >		$@ OK
260806f25ae9SGregory Neil Shapiro	R$*			$#error $: 553 Header Error
260906f25ae9SGregory Neil Shapiro
261006f25ae9SGregory Neil Shapiro	Scheck_eoh
261106f25ae9SGregory Neil Shapiro	# Check the macro
261206f25ae9SGregory Neil Shapiro	R$*			$: < $&{MessageIdCheck} >
261306f25ae9SGregory Neil Shapiro	# Clear the macro for the next message
261406f25ae9SGregory Neil Shapiro	R$*			$: $(storage {MessageIdCheck} $) $1
261506f25ae9SGregory Neil Shapiro	# Has a Message-Id: header
261606f25ae9SGregory Neil Shapiro	R< $+ >			$@ OK
261706f25ae9SGregory Neil Shapiro	# Allow missing Message-Id: from local mail
261806f25ae9SGregory Neil Shapiro	R$*			$: < $&{client_name} >
261906f25ae9SGregory Neil Shapiro	R< >			$@ OK
262006f25ae9SGregory Neil Shapiro	R< $=w >		$@ OK
262106f25ae9SGregory Neil Shapiro	# Otherwise, reject the mail
262206f25ae9SGregory Neil Shapiro	R$*			$#error $: 553 Header Error
262306f25ae9SGregory Neil Shapiro
262442e5d165SGregory Neil Shapiro+----------+
262506f25ae9SGregory Neil Shapiro| STARTTLS |
262642e5d165SGregory Neil Shapiro+----------+
262706f25ae9SGregory Neil Shapiro
262806f25ae9SGregory Neil ShapiroIn this text, cert will be used as an abreviation for X.509 certificate,
262940266059SGregory Neil ShapiroDN (CN) is the distinguished (common) name of a cert, and CA is a
263040266059SGregory Neil Shapirocertification authority, which signs (issues) certs.
263106f25ae9SGregory Neil Shapiro
263213058a91SGregory Neil ShapiroFor STARTTLS to be offered by sendmail you need to set at least
263313058a91SGregory Neil Shapirothis variables (the file names and paths are just examples):
263413058a91SGregory Neil Shapiro
263513058a91SGregory Neil Shapiro	define(`confCACERT_PATH', `/etc/mail/certs/')
263613058a91SGregory Neil Shapiro	define(`confCACERT', `/etc/mail/certs/CA.cert.pem')
263713058a91SGregory Neil Shapiro	define(`confSERVER_CERT', `/etc/mail/certs/my.cert.pem')
263813058a91SGregory Neil Shapiro	define(`confSERVER_KEY', `/etc/mail/certs/my.key.pem')
263913058a91SGregory Neil Shapiro
264013058a91SGregory Neil ShapiroOn systems which do not have the compile flag HASURANDOM set (see
264113058a91SGregory Neil Shapirosendmail/README) you also must set confRAND_FILE.
264213058a91SGregory Neil Shapiro
264340266059SGregory Neil ShapiroSee doc/op/op.{me,ps,txt} for more information about these options,
264440266059SGregory Neil Shapiroespecially the sections ``Certificates for STARTTLS'' and ``PRNG for
264513058a91SGregory Neil ShapiroSTARTTLS''.
264613058a91SGregory Neil Shapiro
264706f25ae9SGregory Neil ShapiroMacros related to STARTTLS are:
264806f25ae9SGregory Neil Shapiro
264906f25ae9SGregory Neil Shapiro${cert_issuer} holds the DN of the CA (the cert issuer).
265006f25ae9SGregory Neil Shapiro${cert_subject} holds the DN of the cert (called the cert subject).
265140266059SGregory Neil Shapiro${cn_issuer} holds the CN of the CA (the cert issuer).
265240266059SGregory Neil Shapiro${cn_subject} holds the CN of the cert (called the cert subject).
265306f25ae9SGregory Neil Shapiro${tls_version} the TLS/SSL version used for the connection, e.g., TLSv1,
265440266059SGregory Neil Shapiro	TLSv1/SSLv3, SSLv3, SSLv2.
265506f25ae9SGregory Neil Shapiro${cipher} the cipher used for the connection, e.g., EDH-DSS-DES-CBC3-SHA,
265606f25ae9SGregory Neil Shapiro	EDH-RSA-DES-CBC-SHA, DES-CBC-MD5, DES-CBC3-SHA.
265706f25ae9SGregory Neil Shapiro${cipher_bits} the keylength (in bits) of the symmetric encryption algorithm
265806f25ae9SGregory Neil Shapiro	used for the connection.
265940266059SGregory Neil Shapiro${verify} holds the result of the verification of the presented cert.
266040266059SGregory Neil Shapiro	Possible values are:
266106f25ae9SGregory Neil Shapiro	OK	 verification succeeded.
266206f25ae9SGregory Neil Shapiro	NO	 no cert presented.
266340266059SGregory Neil Shapiro	NOT	 no cert requested.
266440266059SGregory Neil Shapiro	FAIL	 cert presented but could not be verified,
266540266059SGregory Neil Shapiro		 e.g., the cert of the signing CA is missing.
266606f25ae9SGregory Neil Shapiro	NONE	 STARTTLS has not been performed.
266706f25ae9SGregory Neil Shapiro	TEMP	 temporary error occurred.
266840266059SGregory Neil Shapiro	PROTOCOL protocol error occurred (SMTP level).
266906f25ae9SGregory Neil Shapiro	SOFTWARE STARTTLS handshake failed.
267006f25ae9SGregory Neil Shapiro${server_name} the name of the server of the current outgoing SMTP
267106f25ae9SGregory Neil Shapiro	connection.
267206f25ae9SGregory Neil Shapiro${server_addr} the address of the server of the current outgoing SMTP
267306f25ae9SGregory Neil Shapiro	connection.
267406f25ae9SGregory Neil Shapiro
267506f25ae9SGregory Neil ShapiroRelaying
267640266059SGregory Neil Shapiro--------
267706f25ae9SGregory Neil Shapiro
267806f25ae9SGregory Neil ShapiroSMTP STARTTLS can allow relaying for senders who have successfully
267906f25ae9SGregory Neil Shapiroauthenticated themselves.  This is done in the ruleset RelayAuth.  If the
268006f25ae9SGregory Neil Shapiroverification of the cert failed (${verify} != OK), relaying is subject to
268106f25ae9SGregory Neil Shapirothe usual rules.  Otherwise the DN of the issuer is looked up in the access
268206f25ae9SGregory Neil Shapiromap using the tag CERTISSUER.  If the resulting value is RELAY, relaying is
268306f25ae9SGregory Neil Shapiroallowed.  If it is SUBJECT, the DN of the cert subject is looked up next in
268440266059SGregory Neil Shapirothe access map using the tag CERTSUBJECT.  If the value is RELAY, relaying
268506f25ae9SGregory Neil Shapirois allowed.
268606f25ae9SGregory Neil Shapiro
268706f25ae9SGregory Neil ShapiroTo make things a bit more flexible (or complicated), the values for
268806f25ae9SGregory Neil Shapiro${cert_issuer} and ${cert_subject} can be optionally modified by regular
268906f25ae9SGregory Neil Shapiroexpressions defined in the m4 variables _CERT_REGEX_ISSUER_ and
269006f25ae9SGregory Neil Shapiro_CERT_REGEX_SUBJECT_, respectively.  To avoid problems with those macros in
269106f25ae9SGregory Neil Shapirorulesets and map lookups, they are modified as follows: each non-printable
269206f25ae9SGregory Neil Shapirocharacter and the characters '<', '>', '(', ')', '"', '+' are replaced by
269306f25ae9SGregory Neil Shapirotheir HEX value with a leading '+'.  For example:
269406f25ae9SGregory Neil Shapiro
269506f25ae9SGregory Neil Shapiro/C=US/ST=California/O=endmail.org/OU=private/CN=Darth Mail (Cert)/Email=
269606f25ae9SGregory Neil Shapirodarth+cert@endmail.org
269706f25ae9SGregory Neil Shapiro
269806f25ae9SGregory Neil Shapirois encoded as:
269906f25ae9SGregory Neil Shapiro
270006f25ae9SGregory Neil Shapiro/C=US/ST=California/O=endmail.org/OU=private/CN=
270106f25ae9SGregory Neil ShapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org
270206f25ae9SGregory Neil Shapiro
270306f25ae9SGregory Neil Shapiro(line breaks have been inserted for readability).
270406f25ae9SGregory Neil Shapiro
270540266059SGregory Neil ShapiroExamples:
270640266059SGregory Neil Shapiro
270740266059SGregory Neil ShapiroTo allow relaying for everyone who can present a cert signed by
270840266059SGregory Neil Shapiro
270940266059SGregory Neil Shapiro/C=US/ST=California/O=endmail.org/OU=private/CN=
271040266059SGregory Neil ShapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org
271140266059SGregory Neil Shapiro
271240266059SGregory Neil Shapirosimply use:
271340266059SGregory Neil Shapiro
271440266059SGregory Neil ShapiroCERTIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN=
271540266059SGregory Neil ShapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org	RELAY
271640266059SGregory Neil Shapiro
271740266059SGregory Neil ShapiroTo allow relaying only for a subset of machines that have a cert signed by
271840266059SGregory Neil Shapiro
271940266059SGregory Neil Shapiro/C=US/ST=California/O=endmail.org/OU=private/CN=
272040266059SGregory Neil ShapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org
272140266059SGregory Neil Shapiro
272240266059SGregory Neil Shapirouse:
272340266059SGregory Neil Shapiro
272440266059SGregory Neil ShapiroCERTIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN=
272540266059SGregory Neil ShapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org	SUBJECT
272640266059SGregory Neil ShapiroCERTSubject:/C=US/ST=California/O=endmail.org/OU=private/CN=
272740266059SGregory Neil ShapiroDeathStar/Email=deathstar@endmail.org		RELAY
272840266059SGregory Neil Shapiro
272940266059SGregory Neil ShapiroNote: line breaks have been inserted after "CN=" for readability,
273040266059SGregory Neil Shapiroeach tagged entry must be one (long) line in the access map.
273140266059SGregory Neil Shapiro
273240266059SGregory Neil ShapiroOf course it is also possible to write a simple ruleset that allows
273306f25ae9SGregory Neil Shapirorelaying for everyone who can present a cert that can be verified, e.g.,
273406f25ae9SGregory Neil Shapiro
273506f25ae9SGregory Neil ShapiroLOCAL_RULESETS
273606f25ae9SGregory Neil ShapiroSLocal_check_rcpt
273706f25ae9SGregory Neil ShapiroR$*	$: $&{verify}
273806f25ae9SGregory Neil ShapiroROK	$# OK
273906f25ae9SGregory Neil Shapiro
274006f25ae9SGregory Neil ShapiroAllowing Connections
274140266059SGregory Neil Shapiro--------------------
274206f25ae9SGregory Neil Shapiro
274340266059SGregory Neil ShapiroThe rulesets tls_server, tls_client, and tls_rcpt are used to decide whether
274440266059SGregory Neil Shapiroan SMTP connection is accepted (or should continue).
274506f25ae9SGregory Neil Shapiro
274606f25ae9SGregory Neil Shapirotls_server is called when sendmail acts as client after a STARTTLS command
274706f25ae9SGregory Neil Shapiro(should) have been issued.  The parameter is the value of ${verify}.
274806f25ae9SGregory Neil Shapiro
274906f25ae9SGregory Neil Shapirotls_client is called when sendmail acts as server, after a STARTTLS command
275006f25ae9SGregory Neil Shapirohas been issued, and from check_mail.  The parameter is the value of
275106f25ae9SGregory Neil Shapiro${verify} and STARTTLS or MAIL, respectively.
275206f25ae9SGregory Neil Shapiro
275306f25ae9SGregory Neil ShapiroBoth rulesets behave the same.  If no access map is in use, the connection
275406f25ae9SGregory Neil Shapirowill be accepted unless ${verify} is SOFTWARE, in which case the connection
275540266059SGregory Neil Shapirois always aborted.  For tls_server/tls_client, ${client_name}/${server_name}
275640266059SGregory Neil Shapirois looked up in the access map using the tag TLS_Srv/TLS_Clt, which is done
275706f25ae9SGregory Neil Shapirowith the ruleset LookUpDomain.  If no entry is found, ${client_addr}
275806f25ae9SGregory Neil Shapiro(${server_addr}) is looked up in the access map (same tag, ruleset
275906f25ae9SGregory Neil ShapiroLookUpAddr).  If this doesn't result in an entry either, just the tag is
276040266059SGregory Neil Shapirolooked up in the access map (included the trailing colon).  Notice:
276140266059SGregory Neil Shapirorequiring that e-mail is sent to a server only encrypted, e.g., via
276240266059SGregory Neil Shapiro
276340266059SGregory Neil ShapiroTLS_Srv:secure.domain	ENCR:112
276440266059SGregory Neil Shapiro
276540266059SGregory Neil Shapirodoesn't necessarily mean that e-mail sent to that domain is encrypted.
276640266059SGregory Neil ShapiroIf the domain has multiple MX servers, e.g.,
276740266059SGregory Neil Shapiro
276840266059SGregory Neil Shapirosecure.domain.	IN MX 10	mail.secure.domain.
276940266059SGregory Neil Shapirosecure.domain.	IN MX 50	mail.other.domain.
277040266059SGregory Neil Shapiro
277140266059SGregory Neil Shapirothen mail to user@secure.domain may go unencrypted to mail.other.domain.
277240266059SGregory Neil Shapirotls_rcpt can be used to address this problem.
277340266059SGregory Neil Shapiro
277440266059SGregory Neil Shapirotls_rcpt is called before a RCPT TO: command is sent.  The parameter is the
277540266059SGregory Neil Shapirocurrent recipient.  This ruleset is only defined if FEATURE(`access_db')
277640266059SGregory Neil Shapirois selected.  A recipient address user@domain is looked up in the access
277740266059SGregory Neil Shapiromap in four formats: TLS_Rcpt:user@domain, TLS_Rcpt:user@, TLS_Rcpt:domain,
277840266059SGregory Neil Shapiroand TLS_Rcpt:; the first match is taken.
277940266059SGregory Neil Shapiro
278040266059SGregory Neil ShapiroThe result of the lookups is then used to call the ruleset TLS_connection,
278140266059SGregory Neil Shapirowhich checks the requirement specified by the RHS in the access map against
278240266059SGregory Neil Shapirothe actual parameters of the current TLS connection, esp. ${verify} and
278306f25ae9SGregory Neil Shapiro${cipher_bits}.  Legal RHSs in the access map are:
278406f25ae9SGregory Neil Shapiro
278506f25ae9SGregory Neil ShapiroVERIFY		verification must have succeeded
278606f25ae9SGregory Neil ShapiroVERIFY:bits	verification must have succeeded and ${cipher_bits} must
278706f25ae9SGregory Neil Shapiro		be greater than or equal bits.
278806f25ae9SGregory Neil ShapiroENCR:bits	${cipher_bits} must be greater than or equal bits.
278906f25ae9SGregory Neil Shapiro
279006f25ae9SGregory Neil ShapiroThe RHS can optionally be prefixed by TEMP+ or PERM+ to select a temporary
279106f25ae9SGregory Neil Shapiroor permanent error.  The default is a temporary error code (403 4.7.0)
279206f25ae9SGregory Neil Shapirounless the macro TLS_PERM_ERR is set during generation of the .cf file.
279306f25ae9SGregory Neil Shapiro
279406f25ae9SGregory Neil ShapiroIf a certain level of encryption is required, then it might also be
279506f25ae9SGregory Neil Shapiropossible that this level is provided by the security layer from a SASL
279606f25ae9SGregory Neil Shapiroalgorithm, e.g., DIGEST-MD5.
279706f25ae9SGregory Neil Shapiro
279840266059SGregory Neil ShapiroFurthermore, there can be a list of extensions added.  Such a list
279940266059SGregory Neil Shapirostarts with '+' and the items are separated by '++'.  Allowed
280040266059SGregory Neil Shapiroextensions are:
280140266059SGregory Neil Shapiro
280240266059SGregory Neil ShapiroCN:name		name must match ${cn_subject}
280340266059SGregory Neil ShapiroCN		${server_name} must match ${cn_subject}
280440266059SGregory Neil ShapiroCS:name		name must match ${cert_subject}
280540266059SGregory Neil ShapiroCI:name		name must match ${cert_issuer}
280640266059SGregory Neil Shapiro
2807c86d5965SGregory Neil ShapiroExample: e-mail sent to secure.example.com should only use an encrypted
280840266059SGregory Neil Shapiroconnection.  E-mail received from hosts within the laptop.example.com domain
280940266059SGregory Neil Shapiroshould only be accepted if they have been authenticated.  The host which
281040266059SGregory Neil Shapiroreceives e-mail for darth@endmail.org must present a cert that uses the
281140266059SGregory Neil ShapiroCN smtp.endmail.org.
281240266059SGregory Neil Shapiro
281306f25ae9SGregory Neil ShapiroTLS_Srv:secure.example.com      ENCR:112
281406f25ae9SGregory Neil ShapiroTLS_Clt:laptop.example.com      PERM+VERIFY:112
281540266059SGregory Neil ShapiroTLS_Rcpt:darth@endmail.org	ENCR:112+CN:smtp.endmail.org
281606f25ae9SGregory Neil Shapiro
2817602a2b1bSGregory Neil Shapiro
281840266059SGregory Neil ShapiroDisabling STARTTLS And Setting SMTP Server Features
281940266059SGregory Neil Shapiro---------------------------------------------------
2820602a2b1bSGregory Neil Shapiro
282140266059SGregory Neil ShapiroBy default STARTTLS is used whenever possible.  However, there are
282240266059SGregory Neil Shapirosome broken MTAs that don't properly implement STARTTLS.  To be able
282340266059SGregory Neil Shapiroto send to (or receive from) those MTAs, the ruleset try_tls
282440266059SGregory Neil Shapiro(srv_features) can be used that work together with the access map.
282540266059SGregory Neil ShapiroEntries for the access map must be tagged with Try_TLS (Srv_Features)
282640266059SGregory Neil Shapiroand refer to the hostname or IP address of the connecting system.
282740266059SGregory Neil ShapiroA default case can be specified by using just the tag.  For example,
282840266059SGregory Neil Shapirothe following entries in the access map:
2829602a2b1bSGregory Neil Shapiro
283040266059SGregory Neil Shapiro	Try_TLS:broken.server	NO
283140266059SGregory Neil Shapiro	Srv_Features:my.domain	v
283240266059SGregory Neil Shapiro	Srv_Features:		V
2833602a2b1bSGregory Neil Shapiro
283440266059SGregory Neil Shapirowill turn off STARTTLS when sending to broken.server (or any host
283540266059SGregory Neil Shapiroin that domain), and request a client certificate during the TLS
283640266059SGregory Neil Shapirohandshake only for hosts in my.domain.  The valid entries on the RHS
283740266059SGregory Neil Shapirofor Srv_Features are listed in the Sendmail Installation and
283840266059SGregory Neil ShapiroOperations Guide.
2839602a2b1bSGregory Neil Shapiro
2840602a2b1bSGregory Neil Shapiro
284106f25ae9SGregory Neil ShapiroReceived: Header
284240266059SGregory Neil Shapiro----------------
284306f25ae9SGregory Neil Shapiro
284406f25ae9SGregory Neil ShapiroThe Received: header reveals whether STARTTLS has been used.  It contains an
284506f25ae9SGregory Neil Shapiroextra line:
284606f25ae9SGregory Neil Shapiro
284740266059SGregory Neil Shapiro(version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify})
284840266059SGregory Neil Shapiro
284906f25ae9SGregory Neil Shapiro
285042e5d165SGregory Neil Shapiro+---------------------+
285106f25ae9SGregory Neil Shapiro| SMTP AUTHENTICATION |
285242e5d165SGregory Neil Shapiro+---------------------+
285306f25ae9SGregory Neil Shapiro
285406f25ae9SGregory Neil ShapiroThe macros ${auth_authen}, ${auth_author}, and ${auth_type} can be
285506f25ae9SGregory Neil Shapiroused in anti-relay rulesets to allow relaying for those users that
285606f25ae9SGregory Neil Shapiroauthenticated themselves.  A very simple example is:
285706f25ae9SGregory Neil Shapiro
285806f25ae9SGregory Neil ShapiroSLocal_check_rcpt
285906f25ae9SGregory Neil ShapiroR$*		$: $&{auth_type}
286006f25ae9SGregory Neil ShapiroR$+		$# OK
286106f25ae9SGregory Neil Shapiro
286206f25ae9SGregory Neil Shapirowhich checks whether a user has successfully authenticated using
286306f25ae9SGregory Neil Shapiroany available mechanism.  Depending on the setup of the CYRUS SASL
286406f25ae9SGregory Neil Shapirolibrary, more sophisticated rulesets might be required, e.g.,
286506f25ae9SGregory Neil Shapiro
286606f25ae9SGregory Neil ShapiroSLocal_check_rcpt
286706f25ae9SGregory Neil ShapiroR$*		$: $&{auth_type} $| $&{auth_authen}
286806f25ae9SGregory Neil ShapiroRDIGEST-MD5 $| $+@$=w	$# OK
286906f25ae9SGregory Neil Shapiro
287006f25ae9SGregory Neil Shapiroto allow relaying for users that authenticated using DIGEST-MD5
287106f25ae9SGregory Neil Shapiroand have an identity in the local domains.
287206f25ae9SGregory Neil Shapiro
287340266059SGregory Neil ShapiroThe ruleset trust_auth is used to determine whether a given AUTH=
287406f25ae9SGregory Neil Shapiroparameter (that is passed to this ruleset) should be trusted.  This
287506f25ae9SGregory Neil Shapiroruleset may make use of the other ${auth_*} macros.  Only if the
287606f25ae9SGregory Neil Shapiroruleset resolves to the error mailer, the AUTH= parameter is not
287706f25ae9SGregory Neil Shapirotrusted.  A user supplied ruleset Local_trust_auth can be written
287806f25ae9SGregory Neil Shapiroto modify the default behavior, which only trust the AUTH=
287906f25ae9SGregory Neil Shapiroparameter if it is identical to the authenticated user.
288006f25ae9SGregory Neil Shapiro
288106f25ae9SGregory Neil ShapiroPer default, relaying is allowed for any user who authenticated
288206f25ae9SGregory Neil Shapirovia a "trusted" mechanism, i.e., one that is defined via
288306f25ae9SGregory Neil ShapiroTRUST_AUTH_MECH(`list of mechanisms')
2884193538b7SGregory Neil ShapiroFor example:
2885193538b7SGregory Neil ShapiroTRUST_AUTH_MECH(`KERBEROS_V4 DIGEST-MD5')
288606f25ae9SGregory Neil Shapiro
288706f25ae9SGregory Neil ShapiroIf the selected mechanism provides a security layer the number of
288806f25ae9SGregory Neil Shapirobits used for the key of the symmetric cipher is stored in the
288906f25ae9SGregory Neil Shapiromacro ${auth_ssf}.
2890c2aa98e2SPeter Wemm
289140266059SGregory Neil ShapiroIf sendmail acts as client, it needs some information how to
289240266059SGregory Neil Shapiroauthenticate against another MTA.  This information can be provided
289340266059SGregory Neil Shapiroby the ruleset authinfo or by the option DefaultAuthInfo.  The
289440266059SGregory Neil Shapiroauthinfo ruleset looks up {server_name} using the tag AuthInfo: in
289540266059SGregory Neil Shapirothe access map.  If no entry is found, {server_addr} is looked up
289640266059SGregory Neil Shapiroin the same way and finally just the tag AuthInfo: to provide
289740266059SGregory Neil Shapirodefault values.
289840266059SGregory Neil Shapiro
289940266059SGregory Neil ShapiroNotice: the default configuration file causes the option DefaultAuthInfo
290040266059SGregory Neil Shapiroto fail since the ruleset authinfo is in the .cf file. If you really
290140266059SGregory Neil Shapirowant to use DefaultAuthInfo (it is deprecated) then you have to
290240266059SGregory Neil Shapiroremove the ruleset.
290340266059SGregory Neil Shapiro
290440266059SGregory Neil ShapiroThe RHS for an AuthInfo: entry in the access map should consists of a
290540266059SGregory Neil Shapirolist of tokens, each of which has the form: "TDstring" (including
290640266059SGregory Neil Shapirothe quotes).  T is a tag which describes the item, D is a delimiter,
290740266059SGregory Neil Shapiroeither ':' for simple text or '=' for a base64 encoded string.
290840266059SGregory Neil ShapiroValid values for the tag are:
290940266059SGregory Neil Shapiro
291040266059SGregory Neil Shapiro	U	user (authorization) id
291140266059SGregory Neil Shapiro	I	authentication id
291240266059SGregory Neil Shapiro	P	password
291340266059SGregory Neil Shapiro	R	realm
291440266059SGregory Neil Shapiro	M	list of mechanisms delimited by spaces
291540266059SGregory Neil Shapiro
291640266059SGregory Neil ShapiroExample entries are:
291740266059SGregory Neil Shapiro
291840266059SGregory Neil ShapiroAuthInfo:other.dom "U:user" "I:user" "P:secret" "R:other.dom" "M:DIGEST-MD5"
291940266059SGregory Neil ShapiroAuthInfo:more.dom "U:user" "P=c2VjcmV0"
292040266059SGregory Neil Shapiro
292140266059SGregory Neil ShapiroUser or authentication id must exist as well as the password.  All
292240266059SGregory Neil Shapiroother entries have default values.  If one of user or authentication
292340266059SGregory Neil Shapiroid is missing, the existing value is used for the missing item.
292440266059SGregory Neil ShapiroIf "R:" is not specified, realm defaults to $j.  The list of mechanisms
292540266059SGregory Neil Shapirodefaults to those specified by AuthMechanisms.
292640266059SGregory Neil Shapiro
292740266059SGregory Neil ShapiroSince this map contains sensitive information, either the access
292840266059SGregory Neil Shapiromap must be unreadable by everyone but root (or the trusted user)
292940266059SGregory Neil Shapiroor FEATURE(`authinfo') must be used which provides a separate map.
293040266059SGregory Neil ShapiroNotice: It is not checked whether the map is actually
293140266059SGregory Neil Shapirogroup/world-unreadable, this is left to the user.
293240266059SGregory Neil Shapiro
2933c2aa98e2SPeter Wemm+--------------------------------+
2934c2aa98e2SPeter Wemm| ADDING NEW MAILERS OR RULESETS |
2935c2aa98e2SPeter Wemm+--------------------------------+
2936c2aa98e2SPeter Wemm
2937c2aa98e2SPeter WemmSometimes you may need to add entirely new mailers or rulesets.  They
2938c2aa98e2SPeter Wemmshould be introduced with the constructs MAILER_DEFINITIONS and
2939c2aa98e2SPeter WemmLOCAL_RULESETS respectively.  For example:
2940c2aa98e2SPeter Wemm
2941c2aa98e2SPeter Wemm	MAILER_DEFINITIONS
2942c2aa98e2SPeter Wemm	Mmymailer, ...
2943c2aa98e2SPeter Wemm	...
2944c2aa98e2SPeter Wemm
2945c2aa98e2SPeter Wemm	LOCAL_RULESETS
2946c2aa98e2SPeter Wemm	Smyruleset
2947c2aa98e2SPeter Wemm	...
2948c2aa98e2SPeter Wemm
294940266059SGregory Neil ShapiroLocal additions for the rulesets srv_features, try_tls, tls_rcpt,
295040266059SGregory Neil Shapirotls_client, and tls_server can be made using LOCAL_SRV_FEATURES,
295140266059SGregory Neil ShapiroLOCAL_TRY_TLS, LOCAL_TLS_RCPT, LOCAL_TLS_CLIENT, and LOCAL_TLS_SERVER,
295240266059SGregory Neil Shapirorespectively.  For example, to add a local ruleset that decides
295340266059SGregory Neil Shapirowhether to try STARTTLS in a sendmail client, use:
2954c2aa98e2SPeter Wemm
295540266059SGregory Neil Shapiro	LOCAL_TRY_TLS
295640266059SGregory Neil Shapiro	R...
295740266059SGregory Neil Shapiro
295840266059SGregory Neil ShapiroNote: you don't need to add a name for the ruleset, it is implicitly
295940266059SGregory Neil Shapirodefined by using the appropriate macro.
296040266059SGregory Neil Shapiro
296140266059SGregory Neil Shapiro
2962193538b7SGregory Neil Shapiro+-------------------------+
2963193538b7SGregory Neil Shapiro| ADDING NEW MAIL FILTERS |
2964193538b7SGregory Neil Shapiro+-------------------------+
296506f25ae9SGregory Neil Shapiro
296606f25ae9SGregory Neil ShapiroSendmail supports mail filters to filter incoming SMTP messages according
296706f25ae9SGregory Neil Shapiroto the "Sendmail Mail Filter API" documentation.  These filters can be
296806f25ae9SGregory Neil Shapiroconfigured in your mc file using the two commands:
296906f25ae9SGregory Neil Shapiro
297006f25ae9SGregory Neil Shapiro	MAIL_FILTER(`name', `equates')
297106f25ae9SGregory Neil Shapiro	INPUT_MAIL_FILTER(`name', `equates')
297206f25ae9SGregory Neil Shapiro
297306f25ae9SGregory Neil ShapiroThe first command, MAIL_FILTER(), simply defines a filter with the given
297406f25ae9SGregory Neil Shapironame and equates.  For example:
297506f25ae9SGregory Neil Shapiro
297606f25ae9SGregory Neil Shapiro	MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
297706f25ae9SGregory Neil Shapiro
297806f25ae9SGregory Neil ShapiroThis creates the equivalent sendmail.cf entry:
297906f25ae9SGregory Neil Shapiro
298006f25ae9SGregory Neil Shapiro	Xarchive, S=local:/var/run/archivesock, F=R
298106f25ae9SGregory Neil Shapiro
298206f25ae9SGregory Neil ShapiroThe INPUT_MAIL_FILTER() command performs the same actions as MAIL_FILTER
298306f25ae9SGregory Neil Shapirobut also populates the m4 variable `confINPUT_MAIL_FILTERS' with the name
298406f25ae9SGregory Neil Shapiroof the filter such that the filter will actually be called by sendmail.
298506f25ae9SGregory Neil Shapiro
298606f25ae9SGregory Neil ShapiroFor example, the two commands:
298706f25ae9SGregory Neil Shapiro
298806f25ae9SGregory Neil Shapiro	INPUT_MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
298906f25ae9SGregory Neil Shapiro	INPUT_MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T')
299006f25ae9SGregory Neil Shapiro
299106f25ae9SGregory Neil Shapiroare equivalent to the three commands:
299206f25ae9SGregory Neil Shapiro
299306f25ae9SGregory Neil Shapiro	MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
299406f25ae9SGregory Neil Shapiro	MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T')
299506f25ae9SGregory Neil Shapiro	define(`confINPUT_MAIL_FILTERS', `archive, spamcheck')
299606f25ae9SGregory Neil Shapiro
299706f25ae9SGregory Neil ShapiroIn general, INPUT_MAIL_FILTER() should be used unless you need to define
299806f25ae9SGregory Neil Shapiromore filters than you want to use for `confINPUT_MAIL_FILTERS'.
299906f25ae9SGregory Neil Shapiro
300006f25ae9SGregory Neil ShapiroNote that setting `confINPUT_MAIL_FILTERS' after any INPUT_MAIL_FILTER()
300106f25ae9SGregory Neil Shapirocommands will clear the list created by the prior INPUT_MAIL_FILTER()
300206f25ae9SGregory Neil Shapirocommands.
300306f25ae9SGregory Neil Shapiro
300406f25ae9SGregory Neil Shapiro
300540266059SGregory Neil Shapiro+-------------------------+
300640266059SGregory Neil Shapiro| QUEUE GROUP DEFINITIONS |
300740266059SGregory Neil Shapiro+-------------------------+
300840266059SGregory Neil Shapiro
300940266059SGregory Neil ShapiroIn addition to the queue directory (which is the default queue group
301040266059SGregory Neil Shapirocalled "mqueue"), sendmail can deal with multiple queue groups, which
301140266059SGregory Neil Shapiroare collections of queue directories with the same behaviour.  Queue
301240266059SGregory Neil Shapirogroups can be defined using the command:
301340266059SGregory Neil Shapiro
301440266059SGregory Neil Shapiro	QUEUE_GROUP(`name', `equates')
301540266059SGregory Neil Shapiro
301640266059SGregory Neil ShapiroFor details about queue groups, please see doc/op/op.{me,ps,txt}.
301740266059SGregory Neil Shapiro
3018c2aa98e2SPeter Wemm+-------------------------------+
3019c2aa98e2SPeter Wemm| NON-SMTP BASED CONFIGURATIONS |
3020c2aa98e2SPeter Wemm+-------------------------------+
3021c2aa98e2SPeter Wemm
302206f25ae9SGregory Neil ShapiroThese configuration files are designed primarily for use by
302306f25ae9SGregory Neil ShapiroSMTP-based sites.  They may not be well tuned for UUCP-only or
3024c2aa98e2SPeter WemmUUCP-primarily nodes (the latter is defined as a small local net
302506f25ae9SGregory Neil Shapiroconnected to the rest of the world via UUCP).  However, there is
302606f25ae9SGregory Neil Shapiroone hook to handle some special cases.
3027c2aa98e2SPeter Wemm
3028c2aa98e2SPeter WemmYou can define a ``smart host'' that understands a richer address syntax
3029c2aa98e2SPeter Wemmusing:
3030c2aa98e2SPeter Wemm
30312e43090eSPeter Wemm	define(`SMART_HOST', `mailer:hostname')
3032c2aa98e2SPeter Wemm
3033c2aa98e2SPeter WemmIn this case, the ``mailer:'' defaults to "relay".  Any messages that
3034c2aa98e2SPeter Wemmcan't be handled using the usual UUCP rules are passed to this host.
3035c2aa98e2SPeter Wemm
3036c2aa98e2SPeter WemmIf you are on a local SMTP-based net that connects to the outside
3037c2aa98e2SPeter Wemmworld via UUCP, you can use LOCAL_NET_CONFIG to add appropriate rules.
3038c2aa98e2SPeter WemmFor example:
3039c2aa98e2SPeter Wemm
304006f25ae9SGregory Neil Shapiro	define(`SMART_HOST', `uucp-new:uunet')
3041c2aa98e2SPeter Wemm	LOCAL_NET_CONFIG
3042c2aa98e2SPeter Wemm	R$* < @ $* .$m. > $*	$#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3
3043c2aa98e2SPeter Wemm
3044605302a5SGregory Neil ShapiroThis will cause all names that end in your domain name ($m) to be sent
3045605302a5SGregory Neil Shapirovia SMTP; anything else will be sent via uucp-new (smart UUCP) to uunet.
30462e43090eSPeter WemmIf you have FEATURE(`nocanonify'), you may need to omit the dots after
3047c2aa98e2SPeter Wemmthe $m.  If you are running a local DNS inside your domain which is
3048c2aa98e2SPeter Wemmnot otherwise connected to the outside world, you probably want to
3049c2aa98e2SPeter Wemmuse:
3050c2aa98e2SPeter Wemm
30512e43090eSPeter Wemm	define(`SMART_HOST', `smtp:fire.wall.com')
3052c2aa98e2SPeter Wemm	LOCAL_NET_CONFIG
3053c2aa98e2SPeter Wemm	R$* < @ $* . > $*	$#smtp $@ $2. $: $1 < @ $2. > $3
3054c2aa98e2SPeter Wemm
3055c2aa98e2SPeter WemmThat is, send directly only to things you found in your DNS lookup;
3056c2aa98e2SPeter Wemmanything else goes through SMART_HOST.
3057c2aa98e2SPeter Wemm
3058c2aa98e2SPeter WemmYou may need to turn off the anti-spam rules in order to accept
30592e43090eSPeter WemmUUCP mail with FEATURE(`promiscuous_relay') and
30602e43090eSPeter WemmFEATURE(`accept_unresolvable_domains').
3061c2aa98e2SPeter Wemm
3062c2aa98e2SPeter Wemm
3063c2aa98e2SPeter Wemm+-----------+
3064c2aa98e2SPeter Wemm| WHO AM I? |
3065c2aa98e2SPeter Wemm+-----------+
3066c2aa98e2SPeter Wemm
3067c2aa98e2SPeter WemmNormally, the $j macro is automatically defined to be your fully
3068c2aa98e2SPeter Wemmqualified domain name (FQDN).  Sendmail does this by getting your
3069c2aa98e2SPeter Wemmhost name using gethostname and then calling gethostbyname on the
3070c2aa98e2SPeter Wemmresult.  For example, in some environments gethostname returns
3071c2aa98e2SPeter Wemmonly the root of the host name (such as "foo"); gethostbyname is
3072c2aa98e2SPeter Wemmsupposed to return the FQDN ("foo.bar.com").  In some (fairly rare)
3073c2aa98e2SPeter Wemmcases, gethostbyname may fail to return the FQDN.  In this case
3074c2aa98e2SPeter Wemmyou MUST define confDOMAIN_NAME to be your fully qualified domain
3075c2aa98e2SPeter Wemmname.  This is usually done using:
3076c2aa98e2SPeter Wemm
3077c2aa98e2SPeter Wemm	Dmbar.com
3078c2aa98e2SPeter Wemm	define(`confDOMAIN_NAME', `$w.$m')dnl
3079c2aa98e2SPeter Wemm
3080c2aa98e2SPeter Wemm
308106f25ae9SGregory Neil Shapiro+-----------------------------------+
308206f25ae9SGregory Neil Shapiro| ACCEPTING MAIL FOR MULTIPLE NAMES |
308306f25ae9SGregory Neil Shapiro+-----------------------------------+
308406f25ae9SGregory Neil Shapiro
308506f25ae9SGregory Neil ShapiroIf your host is known by several different names, you need to augment
308606f25ae9SGregory Neil Shapiroclass {w}.  This is a list of names by which your host is known, and
308706f25ae9SGregory Neil Shapiroanything sent to an address using a host name in this list will be
308806f25ae9SGregory Neil Shapirotreated as local mail.  You can do this in two ways:  either create the
308906f25ae9SGregory Neil Shapirofile /etc/mail/local-host-names containing a list of your aliases (one per
309006f25ae9SGregory Neil Shapiroline), and use ``FEATURE(`use_cw_file')'' in the .mc file, or add
309106f25ae9SGregory Neil Shapiro``LOCAL_DOMAIN(`alias.host.name')''.  Be sure you use the fully-qualified
309206f25ae9SGregory Neil Shapironame of the host, rather than a short name.
309306f25ae9SGregory Neil Shapiro
309406f25ae9SGregory Neil ShapiroIf you want to have different address in different domains, take
309506f25ae9SGregory Neil Shapiroa look at the virtusertable feature, which is also explained at
309606f25ae9SGregory Neil Shapirohttp://www.sendmail.org/virtual-hosting.html
309706f25ae9SGregory Neil Shapiro
309806f25ae9SGregory Neil Shapiro
3099c2aa98e2SPeter Wemm+--------------------+
3100c2aa98e2SPeter Wemm| USING MAILERTABLES |
3101c2aa98e2SPeter Wemm+--------------------+
3102c2aa98e2SPeter Wemm
31032e43090eSPeter WemmTo use FEATURE(`mailertable'), you will have to create an external
3104c2aa98e2SPeter Wemmdatabase containing the routing information for various domains.
3105c2aa98e2SPeter WemmFor example, a mailertable file in text format might be:
3106c2aa98e2SPeter Wemm
3107c2aa98e2SPeter Wemm	.my.domain		xnet:%1.my.domain
310806f25ae9SGregory Neil Shapiro	uuhost1.my.domain	uucp-new:uuhost1
3109c2aa98e2SPeter Wemm	.bitnet			smtp:relay.bit.net
3110c2aa98e2SPeter Wemm
311106f25ae9SGregory Neil ShapiroThis should normally be stored in /etc/mail/mailertable.  The actual
3112c2aa98e2SPeter Wemmdatabase version of the mailertable is built using:
3113c2aa98e2SPeter Wemm
311406f25ae9SGregory Neil Shapiro	makemap hash /etc/mail/mailertable < /etc/mail/mailertable
3115c2aa98e2SPeter Wemm
3116c2aa98e2SPeter WemmThe semantics are simple.  Any LHS entry that does not begin with
3117c2aa98e2SPeter Wemma dot matches the full host name indicated.  LHS entries beginning
311842e5d165SGregory Neil Shapirowith a dot match anything ending with that domain name (including
311942e5d165SGregory Neil Shapirothe leading dot) -- that is, they can be thought of as having a
312042e5d165SGregory Neil Shapiroleading ".+" regular expression pattern for a non-empty sequence of
312142e5d165SGregory Neil Shapirocharacters.  Matching is done in order of most-to-least qualified
312242e5d165SGregory Neil Shapiro-- for example, even though ".my.domain" is listed first in the
312342e5d165SGregory Neil Shapiroabove example, an entry of "uuhost1.my.domain" will match the second
312442e5d165SGregory Neil Shapiroentry since it is more explicit.  Note: e-mail to "user@my.domain"
312542e5d165SGregory Neil Shapirodoes not match any entry in the above table.  You need to have
312642e5d165SGregory Neil Shapirosomething like:
312706f25ae9SGregory Neil Shapiro
312806f25ae9SGregory Neil Shapiro	my.domain		esmtp:host.my.domain
3129c2aa98e2SPeter Wemm
3130c2aa98e2SPeter WemmThe RHS should always be a "mailer:host" pair.  The mailer is the
313140266059SGregory Neil Shapiroconfiguration name of a mailer (that is, an M line in the
3132c2aa98e2SPeter Wemmsendmail.cf file).  The "host" will be the hostname passed to
3133c2aa98e2SPeter Wemmthat mailer.  In domain-based matches (that is, those with leading
3134c2aa98e2SPeter Wemmdots) the "%1" may be used to interpolate the wildcarded part of
3135c2aa98e2SPeter Wemmthe host name.  For example, the first line above sends everything
3136c2aa98e2SPeter Wemmaddressed to "anything.my.domain" to that same host name, but using
3137c2aa98e2SPeter Wemmthe (presumably experimental) xnet mailer.
3138c2aa98e2SPeter Wemm
3139c2aa98e2SPeter WemmIn some cases you may want to temporarily turn off MX records,
3140c2aa98e2SPeter Wemmparticularly on gateways.  For example, you may want to MX
3141c2aa98e2SPeter Wemmeverything in a domain to one machine that then forwards it
3142c2aa98e2SPeter Wemmdirectly.  To do this, you might use the DNS configuration:
3143c2aa98e2SPeter Wemm
3144c2aa98e2SPeter Wemm	*.domain.	IN	MX	0	relay.machine
3145c2aa98e2SPeter Wemm
3146c2aa98e2SPeter Wemmand on relay.machine use the mailertable:
3147c2aa98e2SPeter Wemm
3148c2aa98e2SPeter Wemm	.domain		smtp:[gateway.domain]
3149c2aa98e2SPeter Wemm
3150c2aa98e2SPeter WemmThe [square brackets] turn off MX records for this host only.
3151c2aa98e2SPeter WemmIf you didn't do this, the mailertable would use the MX record
3152c2aa98e2SPeter Wemmagain, which would give you an MX loop.
3153c2aa98e2SPeter Wemm
3154c2aa98e2SPeter Wemm
3155c2aa98e2SPeter Wemm+--------------------------------+
3156c2aa98e2SPeter Wemm| USING USERDB TO MAP FULL NAMES |
3157c2aa98e2SPeter Wemm+--------------------------------+
3158c2aa98e2SPeter Wemm
3159c2aa98e2SPeter WemmThe user database was not originally intended for mapping full names
3160c2aa98e2SPeter Wemmto login names (e.g., Eric.Allman => eric), but some people are using
316106f25ae9SGregory Neil Shapiroit that way.  (it is recommended that you set up aliases for this
3162c2aa98e2SPeter Wemmpurpose instead -- since you can specify multiple alias files, this
3163c2aa98e2SPeter Wemmis fairly easy.)  The intent was to locate the default maildrop at
3164c2aa98e2SPeter Wemma site, but allow you to override this by sending to a specific host.
3165c2aa98e2SPeter Wemm
3166c2aa98e2SPeter WemmIf you decide to set up the user database in this fashion, it is
31672e43090eSPeter Wemmimperative that you not use FEATURE(`stickyhost') -- otherwise,
3168c2aa98e2SPeter Wemme-mail sent to Full.Name@local.host.name will be rejected.
3169c2aa98e2SPeter Wemm
3170c2aa98e2SPeter WemmTo build the internal form of the user database, use:
3171c2aa98e2SPeter Wemm
317206f25ae9SGregory Neil Shapiro	makemap btree /etc/mail/userdb < /etc/mail/userdb.txt
3173c2aa98e2SPeter Wemm
317406f25ae9SGregory Neil ShapiroAs a general rule, it is an extremely bad idea to using full names
317506f25ae9SGregory Neil Shapiroas e-mail addresses, since they are not in any sense unique.  For
317642e5d165SGregory Neil Shapiroexample, the UNIX software-development community has at least two
317706f25ae9SGregory Neil Shapirowell-known Peter Deutsches, and at one time Bell Labs had two
317806f25ae9SGregory Neil ShapiroStephen R. Bournes with offices along the same hallway.  Which one
317906f25ae9SGregory Neil Shapirowill be forced to suffer the indignity of being Stephen_R_Bourne_2?
318006f25ae9SGregory Neil ShapiroThe less famous of the two, or the one that was hired later?
3181c2aa98e2SPeter Wemm
3182c2aa98e2SPeter WemmFinger should handle full names (and be fuzzy).  Mail should use
318306f25ae9SGregory Neil Shapirohandles, and not be fuzzy.
3184c2aa98e2SPeter Wemm
3185c2aa98e2SPeter Wemm
3186c2aa98e2SPeter Wemm+--------------------------------+
3187c2aa98e2SPeter Wemm| MISCELLANEOUS SPECIAL FEATURES |
3188c2aa98e2SPeter Wemm+--------------------------------+
3189c2aa98e2SPeter Wemm
3190c2aa98e2SPeter WemmPlussed users
3191c2aa98e2SPeter Wemm	Sometimes it is convenient to merge configuration on a
3192c2aa98e2SPeter Wemm	centralized mail machine, for example, to forward all
3193c2aa98e2SPeter Wemm	root mail to a mail server.  In this case it might be
3194c2aa98e2SPeter Wemm	useful to be able to treat the root addresses as a class
3195c2aa98e2SPeter Wemm	of addresses with subtle differences.  You can do this
3196c2aa98e2SPeter Wemm	using plussed users.  For example, a client might include
3197c2aa98e2SPeter Wemm	the alias:
3198c2aa98e2SPeter Wemm
3199c2aa98e2SPeter Wemm		root:  root+client1@server
3200c2aa98e2SPeter Wemm
3201c2aa98e2SPeter Wemm	On the server, this will match an alias for "root+client1".
3202c2aa98e2SPeter Wemm	If that is not found, the alias "root+*" will be tried,
3203c2aa98e2SPeter Wemm	then "root".
3204c2aa98e2SPeter Wemm
3205c2aa98e2SPeter Wemm
3206c2aa98e2SPeter Wemm+----------------+
3207c2aa98e2SPeter Wemm| SECURITY NOTES |
3208c2aa98e2SPeter Wemm+----------------+
3209c2aa98e2SPeter Wemm
3210c2aa98e2SPeter WemmA lot of sendmail security comes down to you.  Sendmail 8 is much
3211c2aa98e2SPeter Wemmmore careful about checking for security problems than previous
3212c2aa98e2SPeter Wemmversions, but there are some things that you still need to watch
3213c2aa98e2SPeter Wemmfor.  In particular:
3214c2aa98e2SPeter Wemm
3215c2aa98e2SPeter Wemm* Make sure the aliases file isn't writable except by trusted
3216c2aa98e2SPeter Wemm  system personnel.  This includes both the text and database
3217c2aa98e2SPeter Wemm  version.
3218c2aa98e2SPeter Wemm
3219c2aa98e2SPeter Wemm* Make sure that other files that sendmail reads, such as the
3220c2aa98e2SPeter Wemm  mailertable, are only writable by trusted system personnel.
3221c2aa98e2SPeter Wemm
3222c2aa98e2SPeter Wemm* The queue directory should not be world writable PARTICULARLY
3223c2aa98e2SPeter Wemm  if your system allows "file giveaways" (that is, if a non-root
3224c2aa98e2SPeter Wemm  user can chown any file they own to any other user).
3225c2aa98e2SPeter Wemm
3226c2aa98e2SPeter Wemm* If your system allows file giveaways, DO NOT create a publically
3227c2aa98e2SPeter Wemm  writable directory for forward files.  This will allow anyone
3228c2aa98e2SPeter Wemm  to steal anyone else's e-mail.  Instead, create a script that
3229c2aa98e2SPeter Wemm  copies the .forward file from users' home directories once a
3230c2aa98e2SPeter Wemm  night (if you want the non-NFS-mounted forward directory).
3231c2aa98e2SPeter Wemm
3232c2aa98e2SPeter Wemm* If your system allows file giveaways, you'll find that
3233c2aa98e2SPeter Wemm  sendmail is much less trusting of :include: files -- in
3234c2aa98e2SPeter Wemm  particular, you'll have to have /SENDMAIL/ANY/SHELL/ in
3235c2aa98e2SPeter Wemm  /etc/shells before they will be trusted (that is, before
3236c2aa98e2SPeter Wemm  files and programs listed in them will be honored).
3237c2aa98e2SPeter Wemm
3238c2aa98e2SPeter WemmIn general, file giveaways are a mistake -- if you can turn them
323906f25ae9SGregory Neil Shapirooff, do so.
3240c2aa98e2SPeter Wemm
3241c2aa98e2SPeter Wemm
3242c2aa98e2SPeter Wemm+--------------------------------+
3243c2aa98e2SPeter Wemm| TWEAKING CONFIGURATION OPTIONS |
3244c2aa98e2SPeter Wemm+--------------------------------+
3245c2aa98e2SPeter Wemm
3246c2aa98e2SPeter WemmThere are a large number of configuration options that don't normally
3247c2aa98e2SPeter Wemmneed to be changed.  However, if you feel you need to tweak them, you
3248c2aa98e2SPeter Wemmcan define the following M4 variables.  This list is shown in four
3249c2aa98e2SPeter Wemmcolumns:  the name you define, the default value for that definition,
3250c2aa98e2SPeter Wemmthe option or macro that is affected (either Ox for an option or Dx
3251c2aa98e2SPeter Wemmfor a macro), and a brief description.  Greater detail of the semantics
3252c2aa98e2SPeter Wemmcan be found in the Installation and Operations Guide.
3253c2aa98e2SPeter Wemm
3254c2aa98e2SPeter WemmSome options are likely to be deprecated in future versions -- that is,
3255c2aa98e2SPeter Wemmthe option is only included to provide back-compatibility.  These are
3256c2aa98e2SPeter Wemmmarked with "*".
3257c2aa98e2SPeter Wemm
3258c2aa98e2SPeter WemmRemember that these options are M4 variables, and hence may need to
3259c2aa98e2SPeter Wemmbe quoted.  In particular, arguments with commas will usually have to
3260c2aa98e2SPeter Wemmbe ``double quoted, like this phrase'' to avoid having the comma
3261c2aa98e2SPeter Wemmconfuse things.  This is common for alias file definitions and for
3262c2aa98e2SPeter Wemmthe read timeout.
3263c2aa98e2SPeter Wemm
3264c2aa98e2SPeter WemmM4 Variable Name	Configuration	Description & [Default]
3265c2aa98e2SPeter Wemm================	=============	=======================
3266c2aa98e2SPeter WemmconfMAILER_NAME		$n macro	[MAILER-DAEMON] The sender name used
3267c2aa98e2SPeter Wemm					for internally generated outgoing
3268c2aa98e2SPeter Wemm					messages.
3269c2aa98e2SPeter WemmconfDOMAIN_NAME		$j macro	If defined, sets $j.  This should
3270c2aa98e2SPeter Wemm					only be done if your system cannot
3271c2aa98e2SPeter Wemm					determine your local domain name,
3272c2aa98e2SPeter Wemm					and then it should be set to
3273c2aa98e2SPeter Wemm					$w.Foo.COM, where Foo.COM is your
3274c2aa98e2SPeter Wemm					domain name.
3275c2aa98e2SPeter WemmconfCF_VERSION		$Z macro	If defined, this is appended to the
3276c2aa98e2SPeter Wemm					configuration version name.
327740266059SGregory Neil ShapiroconfLDAP_CLUSTER	${sendmailMTACluster} macro
327840266059SGregory Neil Shapiro					If defined, this is the LDAP
327940266059SGregory Neil Shapiro					cluster to use for LDAP searches
328040266059SGregory Neil Shapiro					as described above in ``USING LDAP
328140266059SGregory Neil Shapiro					FOR ALIASES, MAPS, AND CLASSES''.
3282c2aa98e2SPeter WemmconfFROM_HEADER		From:		[$?x$x <$g>$|$g$.] The format of an
3283c2aa98e2SPeter Wemm					internally generated From: address.
3284c2aa98e2SPeter WemmconfRECEIVED_HEADER	Received:
3285c2aa98e2SPeter Wemm		[$?sfrom $s $.$?_($?s$|from $.$_)
328606f25ae9SGregory Neil Shapiro			$.$?{auth_type}(authenticated)
3287c2aa98e2SPeter Wemm			$.by $j ($v/$Z)$?r with $r$. id $i$?u
3288c2aa98e2SPeter Wemm			for $u; $|;
3289c2aa98e2SPeter Wemm			$.$b]
3290c2aa98e2SPeter Wemm					The format of the Received: header
3291c2aa98e2SPeter Wemm					in messages passed through this host.
3292c2aa98e2SPeter Wemm					It is unwise to try to change this.
329306f25ae9SGregory Neil ShapiroconfCW_FILE		Fw class	[/etc/mail/local-host-names] Name
329406f25ae9SGregory Neil Shapiro					of file used to get the local
329506f25ae9SGregory Neil Shapiro					additions to class {w} (local host
329606f25ae9SGregory Neil Shapiro					names).
329706f25ae9SGregory Neil ShapiroconfCT_FILE		Ft class	[/etc/mail/trusted-users] Name of
329806f25ae9SGregory Neil Shapiro					file used to get the local additions
329906f25ae9SGregory Neil Shapiro					to class {t} (trusted users).
3300c2aa98e2SPeter WemmconfCR_FILE		FR class	[/etc/mail/relay-domains] Name of
3301c2aa98e2SPeter Wemm					file used to get the local additions
330206f25ae9SGregory Neil Shapiro					to class {R} (hosts allowed to relay).
3303c2aa98e2SPeter WemmconfTRUSTED_USERS	Ct class	[no default] Names of users to add to
3304c2aa98e2SPeter Wemm					the list of trusted users.  This list
3305c2aa98e2SPeter Wemm					always includes root, uucp, and daemon.
33062e43090eSPeter Wemm					See also FEATURE(`use_ct_file').
330706f25ae9SGregory Neil ShapiroconfTRUSTED_USER	TrustedUser	[no default] Trusted user for file
330806f25ae9SGregory Neil Shapiro					ownership and starting the daemon.
330906f25ae9SGregory Neil Shapiro					Not to be confused with
331006f25ae9SGregory Neil Shapiro					confTRUSTED_USERS (see above).
3311c2aa98e2SPeter WemmconfSMTP_MAILER		-		[esmtp] The mailer name used when
3312c2aa98e2SPeter Wemm					SMTP connectivity is required.
331306f25ae9SGregory Neil Shapiro					One of "smtp", "smtp8",
331406f25ae9SGregory Neil Shapiro					"esmtp", or "dsmtp".
3315c2aa98e2SPeter WemmconfUUCP_MAILER		-		[uucp-old] The mailer to be used by
3316c2aa98e2SPeter Wemm					default for bang-format recipient
3317c2aa98e2SPeter Wemm					addresses.  See also discussion of
331806f25ae9SGregory Neil Shapiro					class {U}, class {Y}, and class {Z}
331906f25ae9SGregory Neil Shapiro					in the MAILER(`uucp') section.
3320c2aa98e2SPeter WemmconfLOCAL_MAILER	-		[local] The mailer name used when
3321c2aa98e2SPeter Wemm					local connectivity is required.
3322c2aa98e2SPeter Wemm					Almost always "local".
3323c2aa98e2SPeter WemmconfRELAY_MAILER	-		[relay] The default mailer name used
3324c2aa98e2SPeter Wemm					for relaying any mail (e.g., to a
3325c2aa98e2SPeter Wemm					BITNET_RELAY, a SMART_HOST, or
3326c2aa98e2SPeter Wemm					whatever).  This can reasonably be
3327c2aa98e2SPeter Wemm					"uucp-new" if you are on a
3328c2aa98e2SPeter Wemm					UUCP-connected site.
3329c2aa98e2SPeter WemmconfSEVEN_BIT_INPUT	SevenBitInput	[False] Force input to seven bits?
3330c2aa98e2SPeter WemmconfEIGHT_BIT_HANDLING	EightBitMode	[pass8] 8-bit data handling
3331c2aa98e2SPeter WemmconfALIAS_WAIT		AliasWait	[10m] Time to wait for alias file
3332c2aa98e2SPeter Wemm					rebuild until you get bored and
3333c2aa98e2SPeter Wemm					decide that the apparently pending
3334c2aa98e2SPeter Wemm					rebuild failed.
3335c2aa98e2SPeter WemmconfMIN_FREE_BLOCKS	MinFreeBlocks	[100] Minimum number of free blocks on
3336c2aa98e2SPeter Wemm					queue filesystem to accept SMTP mail.
3337c2aa98e2SPeter Wemm					(Prior to 8.7 this was minfree/maxsize,
3338c2aa98e2SPeter Wemm					where minfree was the number of free
3339c2aa98e2SPeter Wemm					blocks and maxsize was the maximum
3340c2aa98e2SPeter Wemm					message size.  Use confMAX_MESSAGE_SIZE
3341c2aa98e2SPeter Wemm					for the second value now.)
3342c2aa98e2SPeter WemmconfMAX_MESSAGE_SIZE	MaxMessageSize	[infinite] The maximum size of messages
3343c2aa98e2SPeter Wemm					that will be accepted (in bytes).
3344c2aa98e2SPeter WemmconfBLANK_SUB		BlankSub	[.] Blank (space) substitution
3345c2aa98e2SPeter Wemm					character.
3346c2aa98e2SPeter WemmconfCON_EXPENSIVE	HoldExpensive	[False] Avoid connecting immediately
334706f25ae9SGregory Neil Shapiro					to mailers marked expensive.
3348c2aa98e2SPeter WemmconfCHECKPOINT_INTERVAL	CheckpointInterval
3349c2aa98e2SPeter Wemm					[10] Checkpoint queue files every N
3350c2aa98e2SPeter Wemm					recipients.
3351c2aa98e2SPeter WemmconfDELIVERY_MODE	DeliveryMode	[background] Default delivery mode.
3352c2aa98e2SPeter WemmconfERROR_MODE		ErrorMode	[print] Error message mode.
3353c2aa98e2SPeter WemmconfERROR_MESSAGE	ErrorHeader	[undefined] Error message header/file.
3354065a643dSPeter WemmconfSAVE_FROM_LINES	SaveFromLine	Save extra leading From_ lines.
3355c2aa98e2SPeter WemmconfTEMP_FILE_MODE	TempFileMode	[0600] Temporary file mode.
3356c2aa98e2SPeter WemmconfMATCH_GECOS		MatchGECOS	[False] Match GECOS field.
3357c2aa98e2SPeter WemmconfMAX_HOP		MaxHopCount	[25] Maximum hop count.
335806f25ae9SGregory Neil ShapiroconfIGNORE_DOTS*	IgnoreDots	[False; always False in -bs or -bd
335906f25ae9SGregory Neil Shapiro					mode] Ignore dot as terminator for
336006f25ae9SGregory Neil Shapiro					incoming messages?
3361c2aa98e2SPeter WemmconfBIND_OPTS		ResolverOptions	[undefined] Default options for DNS
3362c2aa98e2SPeter Wemm					resolver.
3363c2aa98e2SPeter WemmconfMIME_FORMAT_ERRORS*	SendMimeErrors	[True] Send error messages as MIME-
3364c2aa98e2SPeter Wemm					encapsulated messages per RFC 1344.
3365c2aa98e2SPeter WemmconfFORWARD_PATH	ForwardPath	[$z/.forward.$w:$z/.forward]
3366c2aa98e2SPeter Wemm					The colon-separated list of places to
3367c2aa98e2SPeter Wemm					search for .forward files.  N.B.: see
3368c2aa98e2SPeter Wemm					the Security Notes section.
3369c2aa98e2SPeter WemmconfMCI_CACHE_SIZE	ConnectionCacheSize
3370c2aa98e2SPeter Wemm					[2] Size of open connection cache.
3371c2aa98e2SPeter WemmconfMCI_CACHE_TIMEOUT	ConnectionCacheTimeout
3372c2aa98e2SPeter Wemm					[5m] Open connection cache timeout.
3373c2aa98e2SPeter WemmconfHOST_STATUS_DIRECTORY HostStatusDirectory
3374c2aa98e2SPeter Wemm					[undefined] If set, host status is kept
3375c2aa98e2SPeter Wemm					on disk between sendmail runs in the
3376c2aa98e2SPeter Wemm					named directory tree.  This need not be
3377c2aa98e2SPeter Wemm					a full pathname, in which case it is
3378c2aa98e2SPeter Wemm					interpreted relative to the queue
3379c2aa98e2SPeter Wemm					directory.
3380c2aa98e2SPeter WemmconfSINGLE_THREAD_DELIVERY  SingleThreadDelivery
3381c2aa98e2SPeter Wemm					[False] If this option and the
3382c2aa98e2SPeter Wemm					HostStatusDirectory option are both
3383c2aa98e2SPeter Wemm					set, single thread deliveries to other
3384c2aa98e2SPeter Wemm					hosts.  That is, don't allow any two
3385c2aa98e2SPeter Wemm					sendmails on this host to connect
3386c2aa98e2SPeter Wemm					simultaneously to any other single
3387c2aa98e2SPeter Wemm					host.  This can slow down delivery in
3388c2aa98e2SPeter Wemm					some cases, in particular since a
3389c2aa98e2SPeter Wemm					cached but otherwise idle connection
3390c2aa98e2SPeter Wemm					to a host will prevent other sendmails
3391c2aa98e2SPeter Wemm					from connecting to the other host.
339206f25ae9SGregory Neil ShapiroconfUSE_ERRORS_TO*	UseErrorsTo	[False] Use the Errors-To: header to
3393c2aa98e2SPeter Wemm					deliver error messages.  This should
3394c2aa98e2SPeter Wemm					not be necessary because of general
3395c2aa98e2SPeter Wemm					acceptance of the envelope/header
3396c2aa98e2SPeter Wemm					distinction.
3397c2aa98e2SPeter WemmconfLOG_LEVEL		LogLevel	[9] Log level.
339806f25ae9SGregory Neil ShapiroconfME_TOO		MeToo		[True] Include sender in group
339906f25ae9SGregory Neil Shapiro					expansions.  This option is
340006f25ae9SGregory Neil Shapiro					deprecated and will be removed from
340106f25ae9SGregory Neil Shapiro					a future version.
3402c2aa98e2SPeter WemmconfCHECK_ALIASES	CheckAliases	[False] Check RHS of aliases when
3403c2aa98e2SPeter Wemm					running newaliases.  Since this does
3404c2aa98e2SPeter Wemm					DNS lookups on every address, it can
3405c2aa98e2SPeter Wemm					slow down the alias rebuild process
3406c2aa98e2SPeter Wemm					considerably on large alias files.
3407c2aa98e2SPeter WemmconfOLD_STYLE_HEADERS*	OldStyleHeaders	[True] Assume that headers without
3408c2aa98e2SPeter Wemm					special chars are old style.
3409c2aa98e2SPeter WemmconfPRIVACY_FLAGS	PrivacyOptions	[authwarnings] Privacy flags.
3410c2aa98e2SPeter WemmconfCOPY_ERRORS_TO	PostmasterCopy	[undefined] Address for additional
3411c2aa98e2SPeter Wemm					copies of all error messages.
3412c2aa98e2SPeter WemmconfQUEUE_FACTOR	QueueFactor	[600000] Slope of queue-only function.
341340266059SGregory Neil ShapiroconfQUEUE_FILE_MODE	QueueFileMode	[undefined] Default permissions for
341440266059SGregory Neil Shapiro					queue files (octal).  If not set,
341540266059SGregory Neil Shapiro					sendmail uses 0600 unless its real
341640266059SGregory Neil Shapiro					and effective uid are different in
341740266059SGregory Neil Shapiro					which case it uses 0644.
3418c2aa98e2SPeter WemmconfDONT_PRUNE_ROUTES	DontPruneRoutes	[False] Don't prune down route-addr
3419c2aa98e2SPeter Wemm					syntax addresses to the minimum
3420c2aa98e2SPeter Wemm					possible.
3421c2aa98e2SPeter WemmconfSAFE_QUEUE*		SuperSafe	[True] Commit all messages to disk
3422c2aa98e2SPeter Wemm					before forking.
3423c2aa98e2SPeter WemmconfTO_INITIAL		Timeout.initial	[5m] The timeout waiting for a response
3424c2aa98e2SPeter Wemm					on the initial connect.
3425c2aa98e2SPeter WemmconfTO_CONNECT		Timeout.connect	[0] The timeout waiting for an initial
3426c2aa98e2SPeter Wemm					connect() to complete.  This can only
3427c2aa98e2SPeter Wemm					shorten connection timeouts; the kernel
3428c2aa98e2SPeter Wemm					silently enforces an absolute maximum
3429c2aa98e2SPeter Wemm					(which varies depending on the system).
3430c2aa98e2SPeter WemmconfTO_ICONNECT		Timeout.iconnect
3431c2aa98e2SPeter Wemm					[undefined] Like Timeout.connect, but
3432c2aa98e2SPeter Wemm					applies only to the very first attempt
3433c2aa98e2SPeter Wemm					to connect to a host in a message.
3434c2aa98e2SPeter Wemm					This allows a single very fast pass
3435c2aa98e2SPeter Wemm					followed by more careful delivery
3436c2aa98e2SPeter Wemm					attempts in the future.
343740266059SGregory Neil ShapiroconfTO_ACONNECT		Timeout.aconnect
343840266059SGregory Neil Shapiro					[0] The overall timeout waiting for
343940266059SGregory Neil Shapiro					all connection for a single delivery
344040266059SGregory Neil Shapiro					attempt to succeed.  If 0, no overall
344140266059SGregory Neil Shapiro					limit is applied.
3442c2aa98e2SPeter WemmconfTO_HELO		Timeout.helo	[5m] The timeout waiting for a response
3443c2aa98e2SPeter Wemm					to a HELO or EHLO command.
3444c2aa98e2SPeter WemmconfTO_MAIL		Timeout.mail	[10m] The timeout waiting for a
3445c2aa98e2SPeter Wemm					response to the MAIL command.
3446c2aa98e2SPeter WemmconfTO_RCPT		Timeout.rcpt	[1h] The timeout waiting for a response
3447c2aa98e2SPeter Wemm					to the RCPT command.
3448c2aa98e2SPeter WemmconfTO_DATAINIT		Timeout.datainit
3449c2aa98e2SPeter Wemm					[5m] The timeout waiting for a 354
3450c2aa98e2SPeter Wemm					response from the DATA command.
3451c2aa98e2SPeter WemmconfTO_DATABLOCK	Timeout.datablock
3452c2aa98e2SPeter Wemm					[1h] The timeout waiting for a block
3453c2aa98e2SPeter Wemm					during DATA phase.
3454c2aa98e2SPeter WemmconfTO_DATAFINAL	Timeout.datafinal
3455c2aa98e2SPeter Wemm					[1h] The timeout waiting for a response
3456c2aa98e2SPeter Wemm					to the final "." that terminates a
3457c2aa98e2SPeter Wemm					message.
3458c2aa98e2SPeter WemmconfTO_RSET		Timeout.rset	[5m] The timeout waiting for a response
3459c2aa98e2SPeter Wemm					to the RSET command.
3460c2aa98e2SPeter WemmconfTO_QUIT		Timeout.quit	[2m] The timeout waiting for a response
3461c2aa98e2SPeter Wemm					to the QUIT command.
3462c2aa98e2SPeter WemmconfTO_MISC		Timeout.misc	[2m] The timeout waiting for a response
3463c2aa98e2SPeter Wemm					to other SMTP commands.
346406f25ae9SGregory Neil ShapiroconfTO_COMMAND		Timeout.command	[1h] In server SMTP, the timeout
346506f25ae9SGregory Neil Shapiro					waiting	for a command to be issued.
346606f25ae9SGregory Neil ShapiroconfTO_IDENT		Timeout.ident	[5s] The timeout waiting for a
346706f25ae9SGregory Neil Shapiro					response to an IDENT query.
3468c2aa98e2SPeter WemmconfTO_FILEOPEN		Timeout.fileopen
3469c2aa98e2SPeter Wemm					[60s] The timeout waiting for a file
3470c2aa98e2SPeter Wemm					(e.g., :include: file) to be opened.
347140266059SGregory Neil ShapiroconfTO_LHLO		Timeout.lhlo	[2m] The timeout waiting for a response
347240266059SGregory Neil Shapiro					to an LMTP LHLO command.
347340266059SGregory Neil ShapiroconfTO_AUTH		Timeout.auth	[10m] The timeout waiting for a
347440266059SGregory Neil Shapiro					response in an AUTH dialogue.
347540266059SGregory Neil ShapiroconfTO_STARTTLS		Timeout.starttls
347640266059SGregory Neil Shapiro					[1h] The timeout waiting for a
347740266059SGregory Neil Shapiro					response to an SMTP STARTTLS command.
347806f25ae9SGregory Neil ShapiroconfTO_CONTROL		Timeout.control
347906f25ae9SGregory Neil Shapiro					[2m] The timeout for a complete
348006f25ae9SGregory Neil Shapiro					control socket transaction to complete.
3481c2aa98e2SPeter WemmconfTO_QUEUERETURN	Timeout.queuereturn
3482c2aa98e2SPeter Wemm					[5d] The timeout before a message is
3483c2aa98e2SPeter Wemm					returned as undeliverable.
3484c2aa98e2SPeter WemmconfTO_QUEUERETURN_NORMAL
3485c2aa98e2SPeter Wemm			Timeout.queuereturn.normal
3486c2aa98e2SPeter Wemm					[undefined] As above, for normal
3487c2aa98e2SPeter Wemm					priority messages.
3488c2aa98e2SPeter WemmconfTO_QUEUERETURN_URGENT
3489c2aa98e2SPeter Wemm			Timeout.queuereturn.urgent
3490c2aa98e2SPeter Wemm					[undefined] As above, for urgent
3491c2aa98e2SPeter Wemm					priority messages.
3492c2aa98e2SPeter WemmconfTO_QUEUERETURN_NONURGENT
3493c2aa98e2SPeter Wemm			Timeout.queuereturn.non-urgent
3494c2aa98e2SPeter Wemm					[undefined] As above, for non-urgent
3495c2aa98e2SPeter Wemm					(low) priority messages.
3496c2aa98e2SPeter WemmconfTO_QUEUEWARN	Timeout.queuewarn
3497c2aa98e2SPeter Wemm					[4h] The timeout before a warning
3498c2aa98e2SPeter Wemm					message is sent to the sender telling
349906f25ae9SGregory Neil Shapiro					them that the message has been
350006f25ae9SGregory Neil Shapiro					deferred.
3501c2aa98e2SPeter WemmconfTO_QUEUEWARN_NORMAL	Timeout.queuewarn.normal
3502c2aa98e2SPeter Wemm					[undefined] As above, for normal
3503c2aa98e2SPeter Wemm					priority messages.
3504c2aa98e2SPeter WemmconfTO_QUEUEWARN_URGENT	Timeout.queuewarn.urgent
3505c2aa98e2SPeter Wemm					[undefined] As above, for urgent
3506c2aa98e2SPeter Wemm					priority messages.
3507c2aa98e2SPeter WemmconfTO_QUEUEWARN_NONURGENT
3508c2aa98e2SPeter Wemm			Timeout.queuewarn.non-urgent
3509c2aa98e2SPeter Wemm					[undefined] As above, for non-urgent
3510c2aa98e2SPeter Wemm					(low) priority messages.
3511c2aa98e2SPeter WemmconfTO_HOSTSTATUS	Timeout.hoststatus
3512c2aa98e2SPeter Wemm					[30m] How long information about host
3513c2aa98e2SPeter Wemm					statuses will be maintained before it
3514c2aa98e2SPeter Wemm					is considered stale and the host should
3515c2aa98e2SPeter Wemm					be retried.  This applies both within
3516c2aa98e2SPeter Wemm					a single queue run and to persistent
3517c2aa98e2SPeter Wemm					information (see below).
351806f25ae9SGregory Neil ShapiroconfTO_RESOLVER_RETRANS	Timeout.resolver.retrans
351906f25ae9SGregory Neil Shapiro					[varies] Sets the resolver's
352006f25ae9SGregory Neil Shapiro					retransmition time interval (in
352106f25ae9SGregory Neil Shapiro					seconds).  Sets both
352206f25ae9SGregory Neil Shapiro					Timeout.resolver.retrans.first and
352306f25ae9SGregory Neil Shapiro					Timeout.resolver.retrans.normal.
352406f25ae9SGregory Neil ShapiroconfTO_RESOLVER_RETRANS_FIRST  Timeout.resolver.retrans.first
352506f25ae9SGregory Neil Shapiro					[varies] Sets the resolver's
352606f25ae9SGregory Neil Shapiro					retransmition time interval (in
352706f25ae9SGregory Neil Shapiro					seconds) for the first attempt to
352806f25ae9SGregory Neil Shapiro					deliver a message.
352906f25ae9SGregory Neil ShapiroconfTO_RESOLVER_RETRANS_NORMAL  Timeout.resolver.retrans.normal
353006f25ae9SGregory Neil Shapiro					[varies] Sets the resolver's
353106f25ae9SGregory Neil Shapiro					retransmition time interval (in
353206f25ae9SGregory Neil Shapiro					seconds) for all resolver lookups
353306f25ae9SGregory Neil Shapiro					except the first delivery attempt.
353406f25ae9SGregory Neil ShapiroconfTO_RESOLVER_RETRY	Timeout.resolver.retry
353506f25ae9SGregory Neil Shapiro					[varies] Sets the number of times
353606f25ae9SGregory Neil Shapiro					to retransmit a resolver query.
353706f25ae9SGregory Neil Shapiro					Sets both
353806f25ae9SGregory Neil Shapiro					Timeout.resolver.retry.first and
353906f25ae9SGregory Neil Shapiro					Timeout.resolver.retry.normal.
354006f25ae9SGregory Neil ShapiroconfTO_RESOLVER_RETRY_FIRST  Timeout.resolver.retry.first
354106f25ae9SGregory Neil Shapiro					[varies] Sets the number of times
354206f25ae9SGregory Neil Shapiro					to retransmit a resolver query for
354306f25ae9SGregory Neil Shapiro					the first attempt to deliver a
354406f25ae9SGregory Neil Shapiro					message.
354506f25ae9SGregory Neil ShapiroconfTO_RESOLVER_RETRY_NORMAL  Timeout.resolver.retry.normal
354606f25ae9SGregory Neil Shapiro					[varies] Sets the number of times
354706f25ae9SGregory Neil Shapiro					to retransmit a resolver query for
354806f25ae9SGregory Neil Shapiro					all resolver lookups except the
354906f25ae9SGregory Neil Shapiro					first delivery attempt.
3550c2aa98e2SPeter WemmconfTIME_ZONE		TimeZoneSpec	[USE_SYSTEM] Time zone info -- can be
3551c2aa98e2SPeter Wemm					USE_SYSTEM to use the system's idea,
3552c2aa98e2SPeter Wemm					USE_TZ to use the user's TZ envariable,
3553c2aa98e2SPeter Wemm					or something else to force that value.
3554c2aa98e2SPeter WemmconfDEF_USER_ID		DefaultUser	[1:1] Default user id.
3555c2aa98e2SPeter WemmconfUSERDB_SPEC		UserDatabaseSpec
355606f25ae9SGregory Neil Shapiro					[undefined] User database
355706f25ae9SGregory Neil Shapiro					specification.
3558c2aa98e2SPeter WemmconfFALLBACK_MX		FallbackMXhost	[undefined] Fallback MX host.
355906f25ae9SGregory Neil ShapiroconfTRY_NULL_MX_LIST	TryNullMXList	[False] If this host is the best MX
356006f25ae9SGregory Neil Shapiro					for a host and other arrangements
356106f25ae9SGregory Neil Shapiro					haven't been made, try connecting
356206f25ae9SGregory Neil Shapiro					to the host directly; normally this
356306f25ae9SGregory Neil Shapiro					would be a config error.
356406f25ae9SGregory Neil ShapiroconfQUEUE_LA		QueueLA		[varies] Load average at which
356506f25ae9SGregory Neil Shapiro					queue-only function kicks in.
356606f25ae9SGregory Neil Shapiro					Default values is (8 * numproc)
356706f25ae9SGregory Neil Shapiro					where numproc is the number of
356806f25ae9SGregory Neil Shapiro					processors online (if that can be
356906f25ae9SGregory Neil Shapiro					determined).
357006f25ae9SGregory Neil ShapiroconfREFUSE_LA		RefuseLA	[varies] Load average at which
357106f25ae9SGregory Neil Shapiro					incoming SMTP connections are
357206f25ae9SGregory Neil Shapiro					refused.  Default values is (12 *
357306f25ae9SGregory Neil Shapiro					numproc) where numproc is the
357406f25ae9SGregory Neil Shapiro					number of processors online (if
357506f25ae9SGregory Neil Shapiro					that can be determined).
357640266059SGregory Neil ShapiroconfDELAY_LA		DelayLA		[0] Load average at which sendmail
357740266059SGregory Neil Shapiro					will sleep for one second on most
357840266059SGregory Neil Shapiro					SMTP commands and before accepting
357940266059SGregory Neil Shapiro					connections.  0 means no limit.
358006f25ae9SGregory Neil ShapiroconfMAX_ALIAS_RECURSION	MaxAliasRecursion
358106f25ae9SGregory Neil Shapiro					[10] Maximum depth of alias recursion.
3582c2aa98e2SPeter WemmconfMAX_DAEMON_CHILDREN	MaxDaemonChildren
3583c2aa98e2SPeter Wemm					[undefined] The maximum number of
3584c2aa98e2SPeter Wemm					children the daemon will permit.  After
3585c2aa98e2SPeter Wemm					this number, connections will be
3586c2aa98e2SPeter Wemm					rejected.  If not set or <= 0, there is
3587c2aa98e2SPeter Wemm					no limit.
358806f25ae9SGregory Neil ShapiroconfMAX_HEADERS_LENGTH	MaxHeadersLength
3589193538b7SGregory Neil Shapiro					[32768] Maximum length of the sum
359006f25ae9SGregory Neil Shapiro					of all headers.
359106f25ae9SGregory Neil ShapiroconfMAX_MIME_HEADER_LENGTH  MaxMimeHeaderLength
359206f25ae9SGregory Neil Shapiro					[undefined] Maximum length of
359306f25ae9SGregory Neil Shapiro					certain MIME header field values.
3594c2aa98e2SPeter WemmconfCONNECTION_RATE_THROTTLE ConnectionRateThrottle
3595c2aa98e2SPeter Wemm					[undefined] The maximum number of
359640266059SGregory Neil Shapiro					connections permitted per second per
359740266059SGregory Neil Shapiro					daemon.  After this many connections
359840266059SGregory Neil Shapiro					are accepted, further connections
359940266059SGregory Neil Shapiro					will be delayed.  If not set or <= 0,
360040266059SGregory Neil Shapiro					there is no limit.
3601c2aa98e2SPeter WemmconfWORK_RECIPIENT_FACTOR
3602c2aa98e2SPeter Wemm			RecipientFactor	[30000] Cost of each recipient.
360306f25ae9SGregory Neil ShapiroconfSEPARATE_PROC	ForkEachJob	[False] Run all deliveries in a
360406f25ae9SGregory Neil Shapiro					separate process.
3605c2aa98e2SPeter WemmconfWORK_CLASS_FACTOR	ClassFactor	[1800] Priority multiplier for class.
3606c2aa98e2SPeter WemmconfWORK_TIME_FACTOR	RetryFactor	[90000] Cost of each delivery attempt.
3607c2aa98e2SPeter WemmconfQUEUE_SORT_ORDER	QueueSortOrder	[Priority] Queue sort algorithm:
360840266059SGregory Neil Shapiro					Priority, Host, Filename, Random,
360940266059SGregory Neil Shapiro					Modification, or Time.
3610c2aa98e2SPeter WemmconfMIN_QUEUE_AGE	MinQueueAge	[0] The minimum amount of time a job
3611c2aa98e2SPeter Wemm					must sit in the queue between queue
3612c2aa98e2SPeter Wemm					runs.  This allows you to set the
3613c2aa98e2SPeter Wemm					queue run interval low for better
3614c2aa98e2SPeter Wemm					responsiveness without trying all
3615c2aa98e2SPeter Wemm					jobs in each run.
3616c2aa98e2SPeter WemmconfDEF_CHAR_SET	DefaultCharSet	[unknown-8bit] When converting
3617c2aa98e2SPeter Wemm					unlabeled 8 bit input to MIME, the
3618c2aa98e2SPeter Wemm					character set to use by default.
3619c2aa98e2SPeter WemmconfSERVICE_SWITCH_FILE	ServiceSwitchFile
362006f25ae9SGregory Neil Shapiro					[/etc/mail/service.switch] The file
362106f25ae9SGregory Neil Shapiro					to use for the service switch on
362206f25ae9SGregory Neil Shapiro					systems that do not have a
362306f25ae9SGregory Neil Shapiro					system-defined switch.
3624c2aa98e2SPeter WemmconfHOSTS_FILE		HostsFile	[/etc/hosts] The file to use when doing
3625c2aa98e2SPeter Wemm					"file" type access of hosts names.
3626c2aa98e2SPeter WemmconfDIAL_DELAY		DialDelay	[0s] If a connection fails, wait this
3627c2aa98e2SPeter Wemm					long and try again.  Zero means "don't
3628c2aa98e2SPeter Wemm					retry".  This is to allow "dial on
3629c2aa98e2SPeter Wemm					demand" connections to have enough time
3630c2aa98e2SPeter Wemm					to complete a connection.
3631c2aa98e2SPeter WemmconfNO_RCPT_ACTION	NoRecipientAction
3632c2aa98e2SPeter Wemm					[none] What to do if there are no legal
3633c2aa98e2SPeter Wemm					recipient fields (To:, Cc: or Bcc:)
3634c2aa98e2SPeter Wemm					in the message.  Legal values can
3635c2aa98e2SPeter Wemm					be "none" to just leave the
3636c2aa98e2SPeter Wemm					nonconforming message as is, "add-to"
3637c2aa98e2SPeter Wemm					to add a To: header with all the
3638c2aa98e2SPeter Wemm					known recipients (which may expose
3639c2aa98e2SPeter Wemm					blind recipients), "add-apparently-to"
3640c2aa98e2SPeter Wemm					to do the same but use Apparently-To:
364140266059SGregory Neil Shapiro					instead of To: (strongly discouraged
364240266059SGregory Neil Shapiro					in accordance with IETF standards),
364340266059SGregory Neil Shapiro					"add-bcc" to add an empty Bcc:
364440266059SGregory Neil Shapiro					header, or "add-to-undisclosed" to
364540266059SGregory Neil Shapiro					add the header
3646c2aa98e2SPeter Wemm					``To: undisclosed-recipients:;''.
3647c2aa98e2SPeter WemmconfSAFE_FILE_ENV	SafeFileEnvironment
3648c2aa98e2SPeter Wemm					[undefined] If set, sendmail will do a
3649c2aa98e2SPeter Wemm					chroot() into this directory before
3650c2aa98e2SPeter Wemm					writing files.
3651c2aa98e2SPeter WemmconfCOLON_OK_IN_ADDR	ColonOkInAddr	[True unless Configuration Level > 6]
3652c2aa98e2SPeter Wemm					If set, colons are treated as a regular
3653c2aa98e2SPeter Wemm					character in addresses.  If not set,
3654c2aa98e2SPeter Wemm					they are treated as the introducer to
3655c2aa98e2SPeter Wemm					the RFC 822 "group" syntax.  Colons are
3656c2aa98e2SPeter Wemm					handled properly in route-addrs.  This
3657c2aa98e2SPeter Wemm					option defaults on for V5 and lower
3658c2aa98e2SPeter Wemm					configuration files.
3659c2aa98e2SPeter WemmconfMAX_QUEUE_RUN_SIZE	MaxQueueRunSize	[0] If set, limit the maximum size of
3660c2aa98e2SPeter Wemm					any given queue run to this number of
3661c2aa98e2SPeter Wemm					entries.  Essentially, this will stop
366206f25ae9SGregory Neil Shapiro					reading each queue directory after this
3663c2aa98e2SPeter Wemm					number of entries are reached; it does
3664c2aa98e2SPeter Wemm					_not_ pick the highest priority jobs,
3665c2aa98e2SPeter Wemm					so this should be as large as your
3666c2aa98e2SPeter Wemm					system can tolerate.  If not set, there
3667c2aa98e2SPeter Wemm					is no limit.
366840266059SGregory Neil ShapiroconfMAX_QUEUE_CHILDREN	MaxQueueChildren
366940266059SGregory Neil Shapiro					[undefined] Limits the maximum number
367040266059SGregory Neil Shapiro					of concurrent queue runners active.
367140266059SGregory Neil Shapiro					This is to keep system resources used
367240266059SGregory Neil Shapiro					within a reasonable limit.  Relates to
367340266059SGregory Neil Shapiro					Queue Groups and ForkAllJobs.
367440266059SGregory Neil ShapiroconfMAX_RUNNERS_PER_QUEUE	MaxRunnersPerQueue
367540266059SGregory Neil Shapiro					[1] Only active when MaxQueueChildren
367640266059SGregory Neil Shapiro					defined.  Controls the maximum number
367740266059SGregory Neil Shapiro					of queue runners (aka queue children)
367840266059SGregory Neil Shapiro					active at the same time in a work
367940266059SGregory Neil Shapiro					group.  See also MaxQueueChildren.
3680c2aa98e2SPeter WemmconfDONT_EXPAND_CNAMES	DontExpandCnames
3681c2aa98e2SPeter Wemm					[False] If set, $[ ... $] lookups that
3682c2aa98e2SPeter Wemm					do DNS based lookups do not expand
3683c2aa98e2SPeter Wemm					CNAME records.  This currently violates
3684c2aa98e2SPeter Wemm					the published standards, but the IETF
3685c2aa98e2SPeter Wemm					seems to be moving toward legalizing
3686c2aa98e2SPeter Wemm					this.  For example, if "FTP.Foo.ORG"
3687c2aa98e2SPeter Wemm					is a CNAME for "Cruft.Foo.ORG", then
3688c2aa98e2SPeter Wemm					with this option set a lookup of
3689c2aa98e2SPeter Wemm					"FTP" will return "FTP.Foo.ORG"; if
3690c2aa98e2SPeter Wemm					clear it returns "Cruft.FOO.ORG".  N.B.
3691c2aa98e2SPeter Wemm					you may not see any effect until your
3692c2aa98e2SPeter Wemm					downstream neighbors stop doing CNAME
3693c2aa98e2SPeter Wemm					lookups as well.
3694c2aa98e2SPeter WemmconfFROM_LINE		UnixFromLine	[From $g $d] The From_ line used
3695c2aa98e2SPeter Wemm					when sending to files or programs.
3696c2aa98e2SPeter WemmconfSINGLE_LINE_FROM_HEADER  SingleLineFromHeader
3697c2aa98e2SPeter Wemm					[False] From: lines that have
3698c2aa98e2SPeter Wemm					embedded newlines are unwrapped
3699c2aa98e2SPeter Wemm					onto one line.
3700c2aa98e2SPeter WemmconfALLOW_BOGUS_HELO	AllowBogusHELO	[False] Allow HELO SMTP command that
3701c2aa98e2SPeter Wemm					does not include a host name.
3702c2aa98e2SPeter WemmconfMUST_QUOTE_CHARS	MustQuoteChars	[.'] Characters to be quoted in a full
3703c2aa98e2SPeter Wemm					name phrase (@,;:\()[] are automatic).
3704c2aa98e2SPeter WemmconfOPERATORS		OperatorChars	[.:%@!^/[]+] Address operator
3705c2aa98e2SPeter Wemm					characters.
3706c2aa98e2SPeter WemmconfSMTP_LOGIN_MSG	SmtpGreetingMessage
3707c2aa98e2SPeter Wemm					[$j Sendmail $v/$Z; $b]
3708c2aa98e2SPeter Wemm					The initial (spontaneous) SMTP
3709c2aa98e2SPeter Wemm					greeting message.  The word "ESMTP"
3710c2aa98e2SPeter Wemm					will be inserted between the first and
3711c2aa98e2SPeter Wemm					second words to convince other
3712c2aa98e2SPeter Wemm					sendmails to try to speak ESMTP.
3713c2aa98e2SPeter WemmconfDONT_INIT_GROUPS	DontInitGroups	[False] If set, the initgroups(3)
3714c2aa98e2SPeter Wemm					routine will never be invoked.  You
3715c2aa98e2SPeter Wemm					might want to do this if you are
3716c2aa98e2SPeter Wemm					running NIS and you have a large group
3717c2aa98e2SPeter Wemm					map, since this call does a sequential
3718c2aa98e2SPeter Wemm					scan of the map; in a large site this
3719c2aa98e2SPeter Wemm					can cause your ypserv to run
3720c2aa98e2SPeter Wemm					essentially full time.  If you set
3721c2aa98e2SPeter Wemm					this, agents run on behalf of users
3722c2aa98e2SPeter Wemm					will only have their primary
3723c2aa98e2SPeter Wemm					(/etc/passwd) group permissions.
3724c2aa98e2SPeter WemmconfUNSAFE_GROUP_WRITES	UnsafeGroupWrites
3725c2aa98e2SPeter Wemm					[False] If set, group-writable
3726c2aa98e2SPeter Wemm					:include: and .forward files are
3727c2aa98e2SPeter Wemm					considered "unsafe", that is, programs
3728c2aa98e2SPeter Wemm					and files cannot be directly referenced
3729c2aa98e2SPeter Wemm					from such files.  World-writable files
3730c2aa98e2SPeter Wemm					are always considered unsafe.
373106f25ae9SGregory Neil ShapiroconfCONNECT_ONLY_TO	ConnectOnlyTo	[undefined] override connection
373206f25ae9SGregory Neil Shapiro					address (for testing).
373306f25ae9SGregory Neil ShapiroconfCONTROL_SOCKET_NAME	ControlSocketName
373406f25ae9SGregory Neil Shapiro					[undefined] Control socket for daemon
373506f25ae9SGregory Neil Shapiro					management.
3736c2aa98e2SPeter WemmconfDOUBLE_BOUNCE_ADDRESS  DoubleBounceAddress
3737c2aa98e2SPeter Wemm					[postmaster] If an error occurs when
3738c2aa98e2SPeter Wemm					sending an error message, send that
3739c2aa98e2SPeter Wemm					"double bounce" error message to this
374040266059SGregory Neil Shapiro					address.  If it expands to an empty
374140266059SGregory Neil Shapiro					string, double bounces are dropped.
374206f25ae9SGregory Neil ShapiroconfDEAD_LETTER_DROP	DeadLetterDrop	[undefined] Filename to save bounce
374306f25ae9SGregory Neil Shapiro					messages which could not be returned
374406f25ae9SGregory Neil Shapiro					to the user or sent to postmaster.
374506f25ae9SGregory Neil Shapiro					If not set, the queue file will
374606f25ae9SGregory Neil Shapiro					be renamed.
374706f25ae9SGregory Neil ShapiroconfRRT_IMPLIES_DSN	RrtImpliesDsn	[False] Return-Receipt-To: header
374806f25ae9SGregory Neil Shapiro					implies DSN request.
3749c2aa98e2SPeter WemmconfRUN_AS_USER		RunAsUser	[undefined] If set, become this user
3750c2aa98e2SPeter Wemm					when reading and delivering mail.
3751c2aa98e2SPeter Wemm					Causes all file reads (e.g., .forward
3752c2aa98e2SPeter Wemm					and :include: files) to be done as
3753c2aa98e2SPeter Wemm					this user.  Also, all programs will
3754c2aa98e2SPeter Wemm					be run as this user, and all output
3755c2aa98e2SPeter Wemm					files will be written as this user.
3756c2aa98e2SPeter Wemm					Intended for use only on firewalls
3757c2aa98e2SPeter Wemm					where users do not have accounts.
3758c2aa98e2SPeter WemmconfMAX_RCPTS_PER_MESSAGE  MaxRecipientsPerMessage
3759c2aa98e2SPeter Wemm					[infinite] If set, allow no more than
3760c2aa98e2SPeter Wemm					the specified number of recipients in
3761c2aa98e2SPeter Wemm					an SMTP envelope.  Further recipients
3762c2aa98e2SPeter Wemm					receive a 452 error code (i.e., they
3763c2aa98e2SPeter Wemm					are deferred for the next delivery
3764c2aa98e2SPeter Wemm					attempt).
376540266059SGregory Neil ShapiroconfBAD_RCPT_THROTTLE	BadRcptThrottle	[infinite] If set and more than the
376640266059SGregory Neil Shapiro					specified number of recipients in an
376740266059SGregory Neil Shapiro					envelope are rejected, sleep for one
376840266059SGregory Neil Shapiro					second after each rejected RCPT
376940266059SGregory Neil Shapiro					command.
3770c2aa98e2SPeter WemmconfDONT_PROBE_INTERFACES  DontProbeInterfaces
3771c2aa98e2SPeter Wemm					[False] If set, sendmail will _not_
3772c2aa98e2SPeter Wemm					insert the names and addresses of any
377306f25ae9SGregory Neil Shapiro					local interfaces into class {w}
3774c2aa98e2SPeter Wemm					(list of known "equivalent" addresses).
3775c2aa98e2SPeter Wemm					If you set this, you must also include
3776c2aa98e2SPeter Wemm					some support for these addresses (e.g.,
3777c2aa98e2SPeter Wemm					in a mailertable entry) -- otherwise,
3778c2aa98e2SPeter Wemm					mail to addresses in this list will
3779c2aa98e2SPeter Wemm					bounce with a configuration error.
378040266059SGregory Neil Shapiro					If set to "loopback" (without
378140266059SGregory Neil Shapiro					quotes), sendmail will skip
378240266059SGregory Neil Shapiro					loopback interfaces (e.g., "lo0").
378306f25ae9SGregory Neil ShapiroconfPID_FILE		PidFile		[system dependent] Location of pid
378406f25ae9SGregory Neil Shapiro					file.
378506f25ae9SGregory Neil ShapiroconfPROCESS_TITLE_PREFIX  ProcessTitlePrefix
378606f25ae9SGregory Neil Shapiro					[undefined] Prefix string for the
378706f25ae9SGregory Neil Shapiro					process title shown on 'ps' listings.
3788c2aa98e2SPeter WemmconfDONT_BLAME_SENDMAIL	DontBlameSendmail
3789c2aa98e2SPeter Wemm					[safe] Override sendmail's file
3790c2aa98e2SPeter Wemm					safety checks.  This will definitely
3791c2aa98e2SPeter Wemm					compromise system security and should
3792c2aa98e2SPeter Wemm					not be used unless absolutely
3793c2aa98e2SPeter Wemm					necessary.
3794c2aa98e2SPeter WemmconfREJECT_MSG		-		[550 Access denied] The message
3795c2aa98e2SPeter Wemm					given if the access database contains
3796c2aa98e2SPeter Wemm					REJECT in the value portion.
379740266059SGregory Neil ShapiroconfRELAY_MSG		-		[550 Relaying denied] The message
379840266059SGregory Neil Shapiro					given if an unauthorized relaying
379940266059SGregory Neil Shapiro					attempt is rejected.
380006f25ae9SGregory Neil ShapiroconfDF_BUFFER_SIZE	DataFileBufferSize
380106f25ae9SGregory Neil Shapiro					[4096] The maximum size of a
380206f25ae9SGregory Neil Shapiro					memory-buffered data (df) file
380306f25ae9SGregory Neil Shapiro					before a disk-based file is used.
380406f25ae9SGregory Neil ShapiroconfXF_BUFFER_SIZE	XScriptFileBufferSize
380506f25ae9SGregory Neil Shapiro					[4096] The maximum size of a
380606f25ae9SGregory Neil Shapiro					memory-buffered transcript (xf)
380706f25ae9SGregory Neil Shapiro					file before a disk-based file is
380806f25ae9SGregory Neil Shapiro					used.
380906f25ae9SGregory Neil ShapiroconfAUTH_MECHANISMS	AuthMechanisms	[GSSAPI KERBEROS_V4 DIGEST-MD5
381006f25ae9SGregory Neil Shapiro					CRAM-MD5] List of authentication
381106f25ae9SGregory Neil Shapiro					mechanisms for AUTH (separated by
381206f25ae9SGregory Neil Shapiro					spaces).  The advertised list of
381306f25ae9SGregory Neil Shapiro					authentication mechanisms will be the
381406f25ae9SGregory Neil Shapiro					intersection of this list and the list
381506f25ae9SGregory Neil Shapiro					of available mechanisms as determined
381606f25ae9SGregory Neil Shapiro					by the CYRUS SASL library.
3817602a2b1bSGregory Neil ShapiroconfDEF_AUTH_INFO	DefaultAuthInfo	[undefined] Name of file that contains
381806f25ae9SGregory Neil Shapiro					authentication information for
381940266059SGregory Neil Shapiro					outgoing connections.  This file must
382040266059SGregory Neil Shapiro					contain the user id, the authorization
382140266059SGregory Neil Shapiro					id, the password (plain text), the
382240266059SGregory Neil Shapiro					realm to use, and the list of
382340266059SGregory Neil Shapiro					mechanisms to try, each on a separate
382440266059SGregory Neil Shapiro					line and must be readable by root (or
382540266059SGregory Neil Shapiro					the trusted user) only.  If no realm
382640266059SGregory Neil Shapiro					is specified, $j is used.  If no
382740266059SGregory Neil Shapiro					mechanisms are given in the file,
382840266059SGregory Neil Shapiro					AuthMechanisms is used.  Notice: this
382940266059SGregory Neil Shapiro					option is deprecated and will be
383040266059SGregory Neil Shapiro					removed in future versions; it doesn't
383140266059SGregory Neil Shapiro					work for the MSP since it can't read
383240266059SGregory Neil Shapiro					the file.  Use the authinfo ruleset
383340266059SGregory Neil Shapiro					instead.  See also the section SMTP
383440266059SGregory Neil Shapiro					AUTHENTICATION.
383540266059SGregory Neil ShapiroconfAUTH_OPTIONS	AuthOptions	[undefined] If this option is 'A'
383606f25ae9SGregory Neil Shapiro					then the AUTH= parameter for the
383706f25ae9SGregory Neil Shapiro					MAIL FROM command is only issued
383806f25ae9SGregory Neil Shapiro					when authentication succeeded.
383940266059SGregory Neil Shapiro					Other values (which should be listed
384040266059SGregory Neil Shapiro					one after the other without any
384140266059SGregory Neil Shapiro					intervening characters except for
384240266059SGregory Neil Shapiro					space or comma) are a, c, d, f, p,
384340266059SGregory Neil Shapiro					and y.  See doc/op/op.me for
384440266059SGregory Neil Shapiro					details.
384540266059SGregory Neil ShapiroconfAUTH_MAX_BITS	AuthMaxBits	[INT_MAX] Limit the maximum encryption
384640266059SGregory Neil Shapiro					strength for the security layer in
384740266059SGregory Neil Shapiro					SMTP AUTH (SASL).  Default is
384840266059SGregory Neil Shapiro					essentially unlimited.
384940266059SGregory Neil ShapiroconfTLS_SRV_OPTIONS	TLSSrvOptions	If this option is 'V' no client
385040266059SGregory Neil Shapiro					verification is performed, i.e.,
385140266059SGregory Neil Shapiro					the server doesn't ask for a
385240266059SGregory Neil Shapiro					certificate.
385306f25ae9SGregory Neil ShapiroconfLDAP_DEFAULT_SPEC	LDAPDefaultSpec	[undefined] Default map
385406f25ae9SGregory Neil Shapiro					specification for LDAP maps.  The
385506f25ae9SGregory Neil Shapiro					value should only contain LDAP
385606f25ae9SGregory Neil Shapiro					specific settings such as "-h host
385706f25ae9SGregory Neil Shapiro					-p port -d bindDN", etc.  The
385806f25ae9SGregory Neil Shapiro					settings will be used for all LDAP
385906f25ae9SGregory Neil Shapiro					maps unless they are specified in
386006f25ae9SGregory Neil Shapiro					the individual map specification
386106f25ae9SGregory Neil Shapiro					('K' command).
386206f25ae9SGregory Neil ShapiroconfCACERT_PATH		CACERTPath	[undefined] Path to directory
386306f25ae9SGregory Neil Shapiro					with certs of CAs.
386406f25ae9SGregory Neil ShapiroconfCACERT		CACERTFile	[undefined] File containing one CA
386506f25ae9SGregory Neil Shapiro					cert.
386606f25ae9SGregory Neil ShapiroconfSERVER_CERT		ServerCertFile	[undefined] File containing the
386706f25ae9SGregory Neil Shapiro					cert of the server, i.e., this cert
386806f25ae9SGregory Neil Shapiro					is used when sendmail acts as
386906f25ae9SGregory Neil Shapiro					server.
387006f25ae9SGregory Neil ShapiroconfSERVER_KEY		ServerKeyFile	[undefined] File containing the
387106f25ae9SGregory Neil Shapiro					private key belonging to the server
387206f25ae9SGregory Neil Shapiro					cert.
387306f25ae9SGregory Neil ShapiroconfCLIENT_CERT		ClientCertFile	[undefined] File containing the
387406f25ae9SGregory Neil Shapiro					cert of the client, i.e., this cert
387506f25ae9SGregory Neil Shapiro					is used when sendmail acts as
387606f25ae9SGregory Neil Shapiro					client.
387706f25ae9SGregory Neil ShapiroconfCLIENT_KEY		ClientKeyFile	[undefined] File containing the
387806f25ae9SGregory Neil Shapiro					private key belonging to the client
387906f25ae9SGregory Neil Shapiro					cert.
388006f25ae9SGregory Neil ShapiroconfDH_PARAMETERS	DHParameters	[undefined] File containing the
388106f25ae9SGregory Neil Shapiro					DH parameters.
388206f25ae9SGregory Neil ShapiroconfRAND_FILE		RandFile	[undefined] File containing random
388342e5d165SGregory Neil Shapiro					data (use prefix file:) or the
388442e5d165SGregory Neil Shapiro					name of the UNIX socket if EGD is
388542e5d165SGregory Neil Shapiro					used (use prefix egd:).  STARTTLS
388642e5d165SGregory Neil Shapiro					requires this option if the compile
388742e5d165SGregory Neil Shapiro					flag HASURANDOM is not set (see
388806f25ae9SGregory Neil Shapiro					sendmail/README).
388940266059SGregory Neil ShapiroconfNICE_QUEUE_RUN	NiceQueueRun	[undefined]  If set, the priority of
389040266059SGregory Neil Shapiro					queue runners is set the given value
389140266059SGregory Neil Shapiro					(nice(3)).
389240266059SGregory Neil ShapiroconfDIRECT_SUBMISSION_MODIFIERS	DirectSubmissionModifiers
389340266059SGregory Neil Shapiro					[undefined] Defines {daemon_flags}
389440266059SGregory Neil Shapiro					for direct submissions.
389540266059SGregory Neil ShapiroconfUSE_MSP		UseMSP		[false] Use as mail submission
389640266059SGregory Neil Shapiro					program, see sendmail/SECURITY.
389740266059SGregory Neil ShapiroconfDELIVER_BY_MIN	DeliverByMin	[0] Minimum time for Deliver By
389840266059SGregory Neil Shapiro					SMTP Service Extension (RFC 2852).
389940266059SGregory Neil ShapiroconfSHARED_MEMORY_KEY	SharedMemoryKey [0] Key for shared memory.
390040266059SGregory Neil ShapiroconfFAST_SPLIT		FastSplit	[1] If set to a value greater than
390140266059SGregory Neil Shapiro					zero, the initial MX lookups on
390240266059SGregory Neil Shapiro					addresses is suppressed when they
390340266059SGregory Neil Shapiro					are sorted which may result in
390440266059SGregory Neil Shapiro					faster envelope splitting.  If the
390540266059SGregory Neil Shapiro					mail is submitted directly from the
390640266059SGregory Neil Shapiro					command line, then the value also
390740266059SGregory Neil Shapiro					limits the number of processes to
390840266059SGregory Neil Shapiro					deliver the envelopes.
390940266059SGregory Neil ShapiroconfMAILBOX_DATABASE	MailboxDatabase	[pw] Type of lookup to find
391040266059SGregory Neil Shapiro					information about local mailboxes.
391140266059SGregory Neil ShapiroconfDEQUOTE_OPTS	-		[empty] Additional options for the
391240266059SGregory Neil Shapiro					dequote map.
391340266059SGregory Neil ShapiroconfINPUT_MAIL_FILTERS	InputMailFilters
391440266059SGregory Neil Shapiro					A comma separated list of filters
391540266059SGregory Neil Shapiro					which determines which filters and
391640266059SGregory Neil Shapiro					the invocation sequence are
391740266059SGregory Neil Shapiro					contacted for incoming SMTP
391840266059SGregory Neil Shapiro					messages.  If none are set, no
391940266059SGregory Neil Shapiro					filters will be contacted.
392040266059SGregory Neil ShapiroconfMILTER_LOG_LEVEL	Milter.LogLevel	[9] Log level for input mail filter
392140266059SGregory Neil Shapiro					actions, defaults to LogLevel.
392240266059SGregory Neil ShapiroconfMILTER_MACROS_CONNECT	Milter.macros.connect
392340266059SGregory Neil Shapiro					[empty]	Macros to transmit to milters
392440266059SGregory Neil Shapiro					when a session connection starts.
392540266059SGregory Neil ShapiroconfMILTER_MACROS_HELO	Milter.macros.helo
392640266059SGregory Neil Shapiro					[empty]	Macros to transmit to milters
392740266059SGregory Neil Shapiro					after HELO command.
392840266059SGregory Neil ShapiroconfMILTER_MACROS_ENVFROM	Milter.macros.envfrom
392940266059SGregory Neil Shapiro					[empty]	Macros to transmit to milters
393040266059SGregory Neil Shapiro					after MAIL FROM command.
393140266059SGregory Neil ShapiroconfMILTER_MACROS_ENVRCPT	Milter.macros.envrcpt
393240266059SGregory Neil Shapiro					[empty]	Macros to transmit to milters
393340266059SGregory Neil Shapiro					after RCPT TO command.
393440266059SGregory Neil Shapiro
3935c2aa98e2SPeter Wemm
3936c2aa98e2SPeter WemmSee also the description of OSTYPE for some parameters that can be
3937c2aa98e2SPeter Wemmtweaked (generally pathnames to mailers).
3938c2aa98e2SPeter Wemm
393940266059SGregory Neil ShapiroClientPortOptions and DaemonPortOptions are special cases since multiple
394040266059SGregory Neil Shapiroclients/daemons can be defined.  This can be done via
394106f25ae9SGregory Neil Shapiro
394240266059SGregory Neil Shapiro	CLIENT_OPTIONS(`field1=value1,field2=value2,...')
394306f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`field1=value1,field2=value2,...')
394406f25ae9SGregory Neil Shapiro
394540266059SGregory Neil ShapiroNote that multiple CLIENT_OPTIONS() commands (and therefore multiple
394640266059SGregory Neil ShapiroClientPortOptions settings) are allowed in order to give settings for each
394740266059SGregory Neil Shapiroprotocol family (e.g., one for Family=inet and one for Family=inet6).  A
394840266059SGregory Neil Shapirorestriction placed on one family only affects outgoing connections on that
394940266059SGregory Neil Shapiroparticular family.
395040266059SGregory Neil Shapiro
395106f25ae9SGregory Neil ShapiroIf DAEMON_OPTIONS is not used, then the default is
395206f25ae9SGregory Neil Shapiro
395306f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Port=smtp, Name=MTA')
395406f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Port=587, Name=MSA, M=E')
395506f25ae9SGregory Neil Shapiro
395606f25ae9SGregory Neil ShapiroIf you use one DAEMON_OPTIONS macro, it will alter the parameters
395706f25ae9SGregory Neil Shapiroof the first of these.  The second will still be defaulted; it
395806f25ae9SGregory Neil Shapirorepresents a "Message Submission Agent" (MSA) as defined by RFC
395906f25ae9SGregory Neil Shapiro2476 (see below).  To turn off the default definition for the MSA,
396006f25ae9SGregory Neil Shapirouse FEATURE(`no_default_msa') (see also FEATURES).  If you use
396106f25ae9SGregory Neil Shapiroadditional DAEMON_OPTIONS macros, they will add additional daemons.
396206f25ae9SGregory Neil Shapiro
396306f25ae9SGregory Neil ShapiroExample 1:  To change the port for the SMTP listener, while
396406f25ae9SGregory Neil Shapirostill using the MSA default, use
396506f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Port=925, Name=MTA')
396606f25ae9SGregory Neil Shapiro
396706f25ae9SGregory Neil ShapiroExample 2:  To change the port for the MSA daemon, while still
396806f25ae9SGregory Neil Shapirousing the default SMTP port, use
396906f25ae9SGregory Neil Shapiro	FEATURE(`no_default_msa')
397006f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Name=MTA')
397106f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Port=987, Name=MSA, M=E')
397206f25ae9SGregory Neil Shapiro
397306f25ae9SGregory Neil ShapiroNote that if the first of those DAEMON_OPTIONS lines were omitted, then
397406f25ae9SGregory Neil Shapirothere would be no listener on the standard SMTP port.
397506f25ae9SGregory Neil Shapiro
397606f25ae9SGregory Neil ShapiroExample 3: To listen on both IPv4 and IPv6 interfaces, use
397706f25ae9SGregory Neil Shapiro
397806f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Name=MTA-v4, Family=inet')
397906f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Name=MTA-v6, Family=inet6')
398006f25ae9SGregory Neil Shapiro
398106f25ae9SGregory Neil ShapiroA "Message Submission Agent" still uses all of the same rulesets for
398206f25ae9SGregory Neil Shapiroprocessing the message (and therefore still allows message rejection via
398306f25ae9SGregory Neil Shapirothe check_* rulesets).  In accordance with the RFC, the MSA will ensure
398406f25ae9SGregory Neil Shapirothat all domains in the envelope are fully qualified if the message is
398506f25ae9SGregory Neil Shapirorelayed to another MTA.  It will also enforce the normal address syntax
398606f25ae9SGregory Neil Shapirorules and log error messages.  Additionally, by using the M=a modifier
398706f25ae9SGregory Neil Shapiroyou can require authentication before messages are accepted by the MSA.
39888774250cSGregory Neil ShapiroNotice: Do NOT use the 'a' modifier on a public accessible MTA!
398906f25ae9SGregory Neil ShapiroFinally, the M=E modifier shown above disables ETRN as required by RFC
399006f25ae9SGregory Neil Shapiro2476.
399106f25ae9SGregory Neil Shapiro
399240266059SGregory Neil ShapiroMail filters can be defined using the INPUT_MAIL_FILTER() and MAIL_FILTER()
399340266059SGregory Neil Shapirocommands:
3994c2aa98e2SPeter Wemm
399540266059SGregory Neil Shapiro	INPUT_MAIL_FILTER(`sample', `S=local:/var/run/f1.sock')
399640266059SGregory Neil Shapiro	MAIL_FILTER(`myfilter', `S=inet:3333@localhost')
399740266059SGregory Neil Shapiro
399840266059SGregory Neil ShapiroThe INPUT_MAIL_FILTER() command causes the filter(s) to be called in the
399940266059SGregory Neil Shapirosame order they were specified by also setting confINPUT_MAIL_FILTERS.  A
400040266059SGregory Neil Shapirofilter can be defined without adding it to the input filter list by using
400140266059SGregory Neil ShapiroMAIL_FILTER() instead of INPUT_MAIL_FILTER() in your .mc file.
400240266059SGregory Neil ShapiroAlternatively, you can reset the list of filters and their order by setting
400340266059SGregory Neil ShapiroconfINPUT_MAIL_FILTERS option after all INPUT_MAIL_FILTER() commands in
400440266059SGregory Neil Shapiroyour .mc file.
400540266059SGregory Neil Shapiro
400640266059SGregory Neil Shapiro
400740266059SGregory Neil Shapiro+----------------------------+
400840266059SGregory Neil Shapiro| MESSAGE SUBMISSION PROGRAM |
400940266059SGregory Neil Shapiro+----------------------------+
401040266059SGregory Neil Shapiro
401140266059SGregory Neil ShapiroThe purpose of the message submission program (MSP) is explained
401240266059SGregory Neil Shapiroin sendmail/SECURITY.  This section contains a list of caveats and
401340266059SGregory Neil Shapiroa few hints how for those who want to tweak the default configuration
401440266059SGregory Neil Shapirofor it (which is installed as submit.cf).
401540266059SGregory Neil Shapiro
401640266059SGregory Neil ShapiroNotice: do not add options/features to submit.mc unless you are
401740266059SGregory Neil Shapiroabsolutely sure you need them.  Options you may want to change
401840266059SGregory Neil Shapiroinclude:
401940266059SGregory Neil Shapiro
4020605302a5SGregory Neil Shapiro- confTRUSTED_USERS, FEATURE(`use_ct_file'), and confCT_FILE for
4021605302a5SGregory Neil Shapiro  avoiding X-Authorization warnings.
4022605302a5SGregory Neil Shapiro- confTIME_ZONE to change it from the default `USE_TZ'.
402340266059SGregory Neil Shapiro- confDELIVERY_MODE is set to interactive in msp.m4 instead
402440266059SGregory Neil Shapiro  of the default background mode.
402540266059SGregory Neil Shapiro
402640266059SGregory Neil ShapiroSome things are not intended to work with the MSP.  These include
402740266059SGregory Neil Shapirofeatures that influence the delivery process (e.g., mailertable,
402840266059SGregory Neil Shapiroaliases), or those that are only important for a SMTP server (e.g.,
402940266059SGregory Neil Shapirovirtusertable, DaemonPortOptions, multiple queues).  Moreover,
403040266059SGregory Neil Shapirorelaxing certain restrictions (RestrictQueueRun, permissions on
403140266059SGregory Neil Shapiroqueue directory) or adding features (e.g., enabling prog/file mailer)
403240266059SGregory Neil Shapirocan cause security problems.
403340266059SGregory Neil Shapiro
403440266059SGregory Neil ShapiroOther things don't work well with the MSP and require tweaking or
403540266059SGregory Neil Shapiroworkarounds.  For example, to allow for client authentication it
403640266059SGregory Neil Shapirois not just sufficient to provide a client certificate and the
403740266059SGregory Neil Shapirocorresponding key, but it is also necessary to make the key group
403840266059SGregory Neil Shapiro(smmsp) readable and tell sendmail not to complain about that, i.e.,
403940266059SGregory Neil Shapiro
404040266059SGregory Neil Shapiro	define(`confDONT_BLAME_SENDMAIL', `GroupReadableKeyFile')
404140266059SGregory Neil Shapiro
404240266059SGregory Neil ShapiroIf the MSP should actually use AUTH then the necessary data
404340266059SGregory Neil Shapiroshould be placed in a map as explained in SMTP AUTHENTICATION:
404440266059SGregory Neil Shapiro
404540266059SGregory Neil ShapiroFEATURE(`authinfo', `DATABASE_MAP_TYPE /etc/mail/msp-authinfo')
404640266059SGregory Neil Shapiro
404740266059SGregory Neil Shapiro/etc/mail/msp-authinfo should contain an entry like:
404840266059SGregory Neil Shapiro
404940266059SGregory Neil Shapiro	AuthInfo:127.0.0.1	"U:smmsp" "P:secret" "M:DIGEST-MD5"
405040266059SGregory Neil Shapiro
405140266059SGregory Neil ShapiroThe file and the map created by makemap should be owned by smmsp,
405240266059SGregory Neil Shapiroits group should be smmsp, and it should have mode 640.  The database
405340266059SGregory Neil Shapiroused by the MTA for AUTH must have a corresponding entry.
405440266059SGregory Neil ShapiroAdditionally the MTA must trust this authentication data so the AUTH=
405540266059SGregory Neil Shapiropart will be relayed on to the next hop.  This can be achieved by
405640266059SGregory Neil Shapiroadding the following to your sendmail.mc file:
405740266059SGregory Neil Shapiro
405840266059SGregory Neil Shapiro	LOCAL_RULESETS
405940266059SGregory Neil Shapiro	SLocal_trust_auth
406040266059SGregory Neil Shapiro	R$*	$: $&{auth_authen}
406140266059SGregory Neil Shapiro	Rsmmsp	$# OK
406240266059SGregory Neil Shapiro
406340266059SGregory Neil Shapirofeature/msp.m4 defines almost all settings for the MSP.  Most of
406440266059SGregory Neil Shapirothose should not be changed at all.  Some of the features and options
406540266059SGregory Neil Shapirocan be overridden if really necessary.  It is a bit tricky to do
406640266059SGregory Neil Shapirothis, because it depends on the actual way the option is defined
406740266059SGregory Neil Shapiroin feature/msp.m4.  If it is directly defined (i.e., define()) then
406840266059SGregory Neil Shapirothe modified value must be defined after
406940266059SGregory Neil Shapiro
407040266059SGregory Neil Shapiro	FEATURE(`msp')
407140266059SGregory Neil Shapiro
407240266059SGregory Neil ShapiroIf it is conditionally defined (i.e., ifdef()) then the desired
407340266059SGregory Neil Shapirovalue must be defined before the FEATURE line in the .mc file.
407440266059SGregory Neil ShapiroTo see how the options are defined read feature/msp.m4.
407540266059SGregory Neil Shapiro
407640266059SGregory Neil Shapiro
407740266059SGregory Neil Shapiro+--------------------------+
407840266059SGregory Neil Shapiro| FORMAT OF FILES AND MAPS |
407940266059SGregory Neil Shapiro+--------------------------+
408040266059SGregory Neil Shapiro
408140266059SGregory Neil ShapiroFiles that define classes, i.e., F{classname}, consist of lines
408240266059SGregory Neil Shapiroeach of which contains a single element of the class.  For example,
408340266059SGregory Neil Shapiro/etc/mail/local-host-names may have the following content:
408440266059SGregory Neil Shapiro
408540266059SGregory Neil Shapiromy.domain
408640266059SGregory Neil Shapiroanother.domain
408740266059SGregory Neil Shapiro
408840266059SGregory Neil ShapiroMaps must be created using makemap(8) , e.g.,
408940266059SGregory Neil Shapiro
409040266059SGregory Neil Shapiro	makemap hash MAP < MAP
409140266059SGregory Neil Shapiro
409240266059SGregory Neil ShapiroIn general, a text file from which a map is created contains lines
409340266059SGregory Neil Shapiroof the form
409440266059SGregory Neil Shapiro
409540266059SGregory Neil Shapirokey	value
409640266059SGregory Neil Shapiro
409740266059SGregory Neil Shapirowhere 'key' and 'value' are also called LHS and RHS, respectively.
409840266059SGregory Neil ShapiroBy default, the delimiter between LHS and RHS is a non-empty sequence
409940266059SGregory Neil Shapiroof white space characters.
410040266059SGregory Neil Shapiro
410140266059SGregory Neil Shapiro
410240266059SGregory Neil Shapiro+------------------+
410340266059SGregory Neil Shapiro| DIRECTORY LAYOUT |
410440266059SGregory Neil Shapiro+------------------+
4105c2aa98e2SPeter Wemm
4106c2aa98e2SPeter WemmWithin this directory are several subdirectories, to wit:
4107c2aa98e2SPeter Wemm
4108c2aa98e2SPeter Wemmm4		General support routines.  These are typically
4109c2aa98e2SPeter Wemm		very important and should not be changed without
4110c2aa98e2SPeter Wemm		very careful consideration.
4111c2aa98e2SPeter Wemm
4112c2aa98e2SPeter Wemmcf		The configuration files themselves.  They have
4113c2aa98e2SPeter Wemm		".mc" suffixes, and must be run through m4 to
4114c2aa98e2SPeter Wemm		become complete.  The resulting output should
4115c2aa98e2SPeter Wemm		have a ".cf" suffix.
4116c2aa98e2SPeter Wemm
4117c2aa98e2SPeter Wemmostype		Definitions describing a particular operating
4118c2aa98e2SPeter Wemm		system type.  These should always be referenced
4119c2aa98e2SPeter Wemm		using the OSTYPE macro in the .mc file.  Examples
4120c2aa98e2SPeter Wemm		include "bsd4.3", "bsd4.4", "sunos3.5", and
4121c2aa98e2SPeter Wemm		"sunos4.1".
4122c2aa98e2SPeter Wemm
4123c2aa98e2SPeter Wemmdomain		Definitions describing a particular domain, referenced
4124c2aa98e2SPeter Wemm		using the DOMAIN macro in the .mc file.  These are
4125c2aa98e2SPeter Wemm		site dependent; for example, "CS.Berkeley.EDU.m4"
4126c2aa98e2SPeter Wemm		describes hosts in the CS.Berkeley.EDU subdomain.
4127c2aa98e2SPeter Wemm
4128c2aa98e2SPeter Wemmmailer		Descriptions of mailers.  These are referenced using
4129c2aa98e2SPeter Wemm		the MAILER macro in the .mc file.
4130c2aa98e2SPeter Wemm
4131c2aa98e2SPeter Wemmsh		Shell files used when building the .cf file from the
4132c2aa98e2SPeter Wemm		.mc file in the cf subdirectory.
4133c2aa98e2SPeter Wemm
4134c2aa98e2SPeter Wemmfeature		These hold special orthogonal features that you might
4135c2aa98e2SPeter Wemm		want to include.  They should be referenced using
4136c2aa98e2SPeter Wemm		the FEATURE macro.
4137c2aa98e2SPeter Wemm
4138c2aa98e2SPeter Wemmhack		Local hacks.  These can be referenced using the HACK
4139c2aa98e2SPeter Wemm		macro.  They shouldn't be of more than voyeuristic
4140c2aa98e2SPeter Wemm		interest outside the .Berkeley.EDU domain, but who knows?
4141c2aa98e2SPeter Wemm
4142c2aa98e2SPeter Wemmsiteconfig	Site configuration -- e.g., tables of locally connected
4143c2aa98e2SPeter Wemm		UUCP sites.
4144c2aa98e2SPeter Wemm
4145c2aa98e2SPeter Wemm
4146c2aa98e2SPeter Wemm+------------------------+
4147c2aa98e2SPeter Wemm| ADMINISTRATIVE DETAILS |
4148c2aa98e2SPeter Wemm+------------------------+
4149c2aa98e2SPeter Wemm
4150c2aa98e2SPeter WemmThe following sections detail usage of certain internal parts of the
4151c2aa98e2SPeter Wemmsendmail.cf file.  Read them carefully if you are trying to modify
4152c2aa98e2SPeter Wemmthe current model.  If you find the above descriptions adequate, these
4153c2aa98e2SPeter Wemmshould be {boring, confusing, tedious, ridiculous} (pick one or more).
4154c2aa98e2SPeter Wemm
4155c2aa98e2SPeter WemmRULESETS (* means built in to sendmail)
4156c2aa98e2SPeter Wemm
4157c2aa98e2SPeter Wemm   0 *	Parsing
4158c2aa98e2SPeter Wemm   1 *	Sender rewriting
4159c2aa98e2SPeter Wemm   2 *	Recipient rewriting
4160c2aa98e2SPeter Wemm   3 *	Canonicalization
4161c2aa98e2SPeter Wemm   4 *	Post cleanup
4162c2aa98e2SPeter Wemm   5 *	Local address rewrite (after aliasing)
4163c2aa98e2SPeter Wemm  1x	mailer rules (sender qualification)
4164c2aa98e2SPeter Wemm  2x	mailer rules (recipient qualification)
4165c2aa98e2SPeter Wemm  3x	mailer rules (sender header qualification)
4166c2aa98e2SPeter Wemm  4x	mailer rules (recipient header qualification)
4167c2aa98e2SPeter Wemm  5x	mailer subroutines (general)
4168c2aa98e2SPeter Wemm  6x	mailer subroutines (general)
4169c2aa98e2SPeter Wemm  7x	mailer subroutines (general)
4170c2aa98e2SPeter Wemm  8x	reserved
4171c2aa98e2SPeter Wemm  90	Mailertable host stripping
4172c2aa98e2SPeter Wemm  96	Bottom half of Ruleset 3 (ruleset 6 in old sendmail)
4173c2aa98e2SPeter Wemm  97	Hook for recursive ruleset 0 call (ruleset 7 in old sendmail)
4174c2aa98e2SPeter Wemm  98	Local part of ruleset 0 (ruleset 8 in old sendmail)
4175c2aa98e2SPeter Wemm
4176c2aa98e2SPeter Wemm
4177c2aa98e2SPeter WemmMAILERS
4178c2aa98e2SPeter Wemm
4179c2aa98e2SPeter Wemm   0	local, prog	local and program mailers
4180c2aa98e2SPeter Wemm   1	[e]smtp, relay	SMTP channel
4181c2aa98e2SPeter Wemm   2	uucp-*		UNIX-to-UNIX Copy Program
4182c2aa98e2SPeter Wemm   3	netnews		Network News delivery
4183c2aa98e2SPeter Wemm   4	fax		Sam Leffler's HylaFAX software
4184c2aa98e2SPeter Wemm   5	mail11		DECnet mailer
4185c2aa98e2SPeter Wemm
4186c2aa98e2SPeter Wemm
4187c2aa98e2SPeter WemmMACROS
4188c2aa98e2SPeter Wemm
4189c2aa98e2SPeter Wemm   A
4190c2aa98e2SPeter Wemm   B	Bitnet Relay
4191c2aa98e2SPeter Wemm   C	DECnet Relay
4192c2aa98e2SPeter Wemm   D	The local domain -- usually not needed
4193c2aa98e2SPeter Wemm   E	reserved for X.400 Relay
4194c2aa98e2SPeter Wemm   F	FAX Relay
4195c2aa98e2SPeter Wemm   G
4196c2aa98e2SPeter Wemm   H	mail Hub (for mail clusters)
4197c2aa98e2SPeter Wemm   I
4198c2aa98e2SPeter Wemm   J
4199c2aa98e2SPeter Wemm   K
4200c2aa98e2SPeter Wemm   L	Luser Relay
420106f25ae9SGregory Neil Shapiro   M	Masquerade (who you claim to be)
4202c2aa98e2SPeter Wemm   N
4203c2aa98e2SPeter Wemm   O
4204c2aa98e2SPeter Wemm   P
4205c2aa98e2SPeter Wemm   Q
4206c2aa98e2SPeter Wemm   R	Relay (for unqualified names)
4207c2aa98e2SPeter Wemm   S	Smart Host
4208c2aa98e2SPeter Wemm   T
420906f25ae9SGregory Neil Shapiro   U	my UUCP name (if you have a UUCP connection)
421006f25ae9SGregory Neil Shapiro   V	UUCP Relay (class {V} hosts)
421106f25ae9SGregory Neil Shapiro   W	UUCP Relay (class {W} hosts)
421206f25ae9SGregory Neil Shapiro   X	UUCP Relay (class {X} hosts)
4213c2aa98e2SPeter Wemm   Y	UUCP Relay (all other hosts)
4214c2aa98e2SPeter Wemm   Z	Version number
4215c2aa98e2SPeter Wemm
4216c2aa98e2SPeter Wemm
4217c2aa98e2SPeter WemmCLASSES
4218c2aa98e2SPeter Wemm
4219c2aa98e2SPeter Wemm   A
4220c2aa98e2SPeter Wemm   B	domains that are candidates for bestmx lookup
4221c2aa98e2SPeter Wemm   C
4222c2aa98e2SPeter Wemm   D
4223c2aa98e2SPeter Wemm   E	addresses that should not seem to come from $M
422406f25ae9SGregory Neil Shapiro   F	hosts this system forward for
4225c2aa98e2SPeter Wemm   G	domains that should be looked up in genericstable
4226c2aa98e2SPeter Wemm   H
4227c2aa98e2SPeter Wemm   I
4228c2aa98e2SPeter Wemm   J
4229c2aa98e2SPeter Wemm   K
4230c2aa98e2SPeter Wemm   L	addresses that should not be forwarded to $R
4231c2aa98e2SPeter Wemm   M	domains that should be mapped to $M
423206f25ae9SGregory Neil Shapiro   N	host/domains that should not be mapped to $M
4233c2aa98e2SPeter Wemm   O	operators that indicate network operations (cannot be in local names)
4234c2aa98e2SPeter Wemm   P	top level pseudo-domains: BITNET, DECNET, FAX, UUCP, etc.
4235c2aa98e2SPeter Wemm   Q
423606f25ae9SGregory Neil Shapiro   R	domains this system is willing to relay (pass anti-spam filters)
4237c2aa98e2SPeter Wemm   S
4238c2aa98e2SPeter Wemm   T
4239c2aa98e2SPeter Wemm   U	locally connected UUCP hosts
4240c2aa98e2SPeter Wemm   V	UUCP hosts connected to relay $V
4241c2aa98e2SPeter Wemm   W	UUCP hosts connected to relay $W
4242c2aa98e2SPeter Wemm   X	UUCP hosts connected to relay $X
4243c2aa98e2SPeter Wemm   Y	locally connected smart UUCP hosts
4244c2aa98e2SPeter Wemm   Z	locally connected domain-ized UUCP hosts
4245c2aa98e2SPeter Wemm   .	the class containing only a dot
4246c2aa98e2SPeter Wemm   [	the class containing only a left bracket
4247c2aa98e2SPeter Wemm
4248c2aa98e2SPeter Wemm
4249c2aa98e2SPeter WemmM4 DIVERSIONS
4250c2aa98e2SPeter Wemm
4251c2aa98e2SPeter Wemm   1	Local host detection and resolution
4252c2aa98e2SPeter Wemm   2	Local Ruleset 3 additions
4253c2aa98e2SPeter Wemm   3	Local Ruleset 0 additions
4254c2aa98e2SPeter Wemm   4	UUCP Ruleset 0 additions
4255c2aa98e2SPeter Wemm   5	locally interpreted names (overrides $R)
4256c2aa98e2SPeter Wemm   6	local configuration (at top of file)
4257c2aa98e2SPeter Wemm   7	mailer definitions
425806f25ae9SGregory Neil Shapiro   8	DNS based blacklists
4259c2aa98e2SPeter Wemm   9	special local rulesets (1 and 2)
426006f25ae9SGregory Neil Shapiro
4261605302a5SGregory Neil Shapiro$Revision: 8.612 $, Last updated $Date: 2002/04/03 17:12:52 $
4262