xref: /freebsd/contrib/sendmail/cf/README (revision 193538b7dabbb9c165660ca97d2704eea0642fa1)
1c2aa98e2SPeter Wemm
206f25ae9SGregory Neil Shapiro		SENDMAIL CONFIGURATION FILES
3c2aa98e2SPeter Wemm
406f25ae9SGregory Neil ShapiroThis document describes the sendmail configuration files.  This package
506f25ae9SGregory Neil Shapirorequires a post-V7 version of m4; if you are running the 4.2bsd, SysV.2, or
606f25ae9SGregory Neil Shapiro7th Edition version.  SunOS's /usr/5bin/m4 or BSD-Net/2's m4 both work.
706f25ae9SGregory Neil ShapiroGNU m4 version 1.1 or later also works.  Unfortunately, the M4 on BSDI 1.0
8c2aa98e2SPeter Wemmdoesn't work -- you'll have to use a Net/2 or GNU version.  GNU m4 is
942e5d165SGregory Neil Shapiroavailable from ftp://ftp.gnu.org/pub/gnu/m4/m4-1.4.tar.gz (check for the
10193538b7SGregory Neil Shapirolatest version).  EXCEPTIONS: DEC's m4 on Digital UNIX 4.x is broken (3.x
1106f25ae9SGregory Neil Shapirois fine).  Use GNU m4 on this platform.
12c2aa98e2SPeter Wemm
1306f25ae9SGregory Neil ShapiroTo get started, you may want to look at tcpproto.mc (for TCP-only sites),
1406f25ae9SGregory Neil Shapirouucpproto.mc (for UUCP-only sites), and clientproto.mc (for clusters of
1506f25ae9SGregory Neil Shapiroclients using a single mail host).  Others are versions previously used at
1606f25ae9SGregory Neil ShapiroBerkeley.  For example, ucbvax has gone away, but ucbvax.mc demonstrates
1706f25ae9SGregory Neil Shapirosome interesting techniques.
18c2aa98e2SPeter Wemm
19c2aa98e2SPeter Wemm*******************************************************************
20c2aa98e2SPeter Wemm***  BE SURE YOU CUSTOMIZE THESE FILES!  They have some		***
21c2aa98e2SPeter Wemm***  Berkeley-specific assumptions built in, such as the name	***
2206f25ae9SGregory Neil Shapiro***  of their UUCP-relay.  You'll want to create your own	***
2306f25ae9SGregory Neil Shapiro***  domain description, and use that in place of		***
24c2aa98e2SPeter Wemm***  domain/Berkeley.EDU.m4.					***
25c2aa98e2SPeter Wemm*******************************************************************
26c2aa98e2SPeter Wemm
27c2aa98e2SPeter Wemm
28c2aa98e2SPeter Wemm+--------------------------+
29c2aa98e2SPeter Wemm| INTRODUCTION AND EXAMPLE |
30c2aa98e2SPeter Wemm+--------------------------+
31c2aa98e2SPeter Wemm
32c2aa98e2SPeter WemmConfiguration files are contained in the subdirectory "cf", with a
33c2aa98e2SPeter Wemmsuffix ".mc".  They must be run through "m4" to produce a ".cf" file.
34c2aa98e2SPeter WemmYou must pre-load "cf.m4":
35c2aa98e2SPeter Wemm
36c2aa98e2SPeter Wemm	m4 ${CFDIR}/m4/cf.m4 config.mc > config.cf
37c2aa98e2SPeter Wemm
3806f25ae9SGregory Neil ShapiroAlternatively, you can simply:
3906f25ae9SGregory Neil Shapiro
4006f25ae9SGregory Neil Shapiro	cd ${CFDIR}/cf
4106f25ae9SGregory Neil Shapiro	./Build config.cf
4206f25ae9SGregory Neil Shapiro
43c2aa98e2SPeter Wemmwhere ${CFDIR} is the root of the cf directory and config.mc is the
44c2aa98e2SPeter Wemmname of your configuration file.  If you are running a version of M4
45c2aa98e2SPeter Wemmthat understands the __file__ builtin (versions of GNU m4 >= 0.75 do
46c2aa98e2SPeter Wemmthis, but the versions distributed with 4.4BSD and derivatives do not)
47c2aa98e2SPeter Wemmor the -I flag (ditto), then ${CFDIR} can be in an arbitrary directory.
48c2aa98e2SPeter WemmFor "traditional" versions, ${CFDIR} ***MUST*** be "..", or you MUST
49c2aa98e2SPeter Wemmuse -D_CF_DIR_=/path/to/cf/dir/ -- note the trailing slash!  For example:
50c2aa98e2SPeter Wemm
51c2aa98e2SPeter Wemm	m4 -D_CF_DIR_=${CFDIR}/ ${CFDIR}/m4/cf.m4 config.mc > config.cf
52c2aa98e2SPeter Wemm
53c2aa98e2SPeter WemmLet's examine a typical .mc file:
54c2aa98e2SPeter Wemm
55c2aa98e2SPeter Wemm	divert(-1)
56c2aa98e2SPeter Wemm	#
5706f25ae9SGregory Neil Shapiro	# Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
5806f25ae9SGregory Neil Shapiro	#	All rights reserved.
59c2aa98e2SPeter Wemm	# Copyright (c) 1983 Eric P. Allman.  All rights reserved.
60c2aa98e2SPeter Wemm	# Copyright (c) 1988, 1993
61c2aa98e2SPeter Wemm	#	The Regents of the University of California.  All rights reserved.
62c2aa98e2SPeter Wemm	#
63c2aa98e2SPeter Wemm	# By using this file, you agree to the terms and conditions set
64c2aa98e2SPeter Wemm	# forth in the LICENSE file which can be found at the top level of
65c2aa98e2SPeter Wemm	# the sendmail distribution.
66c2aa98e2SPeter Wemm	#
67c2aa98e2SPeter Wemm
68c2aa98e2SPeter Wemm	#
69c2aa98e2SPeter Wemm	#  This is a Berkeley-specific configuration file for HP-UX 9.x.
70c2aa98e2SPeter Wemm	#  It applies only to the Computer Science Division at Berkeley,
71c2aa98e2SPeter Wemm	#  and should not be used elsewhere.   It is provided on the sendmail
72c2aa98e2SPeter Wemm	#  distribution as a sample only.  To create your own configuration
73c2aa98e2SPeter Wemm	#  file, create an appropriate domain file in ../domain, change the
74c2aa98e2SPeter Wemm	#  `DOMAIN' macro below to reference that file, and copy the result
75c2aa98e2SPeter Wemm	#  to a name of your own choosing.
76c2aa98e2SPeter Wemm	#
77c2aa98e2SPeter Wemm	divert(0)
78c2aa98e2SPeter Wemm
79c2aa98e2SPeter WemmThe divert(-1) will delete the crud in the resulting output file.
80c2aa98e2SPeter WemmThe copyright notice can be replaced by whatever your lawyers require;
8106f25ae9SGregory Neil Shapiroour lawyers require the one that is included in these files.  A copyleft
82c2aa98e2SPeter Wemmis a copyright by another name.  The divert(0) restores regular output.
83c2aa98e2SPeter Wemm
84c2aa98e2SPeter Wemm	VERSIONID(`<SCCS or RCS version id>')
85c2aa98e2SPeter Wemm
86c2aa98e2SPeter WemmVERSIONID is a macro that stuffs the version information into the
8706f25ae9SGregory Neil Shapiroresulting file.  You could use SCCS, RCS, CVS, something else, or
88c2aa98e2SPeter Wemmomit it completely.  This is not the same as the version id included
89c2aa98e2SPeter Wemmin SMTP greeting messages -- this is defined in m4/version.m4.
90c2aa98e2SPeter Wemm
9106f25ae9SGregory Neil Shapiro	OSTYPE(`hpux9')dnl
92c2aa98e2SPeter Wemm
93c2aa98e2SPeter WemmYou must specify an OSTYPE to properly configure things such as the
94c2aa98e2SPeter Wemmpathname of the help and status files, the flags needed for the local
95c2aa98e2SPeter Wemmmailer, and other important things.  If you omit it, you will get an
96c2aa98e2SPeter Wemmerror when you try to build the configuration.  Look at the ostype
97c2aa98e2SPeter Wemmdirectory for the list of known operating system types.
98c2aa98e2SPeter Wemm
9906f25ae9SGregory Neil Shapiro	DOMAIN(`CS.Berkeley.EDU')dnl
100c2aa98e2SPeter Wemm
101c2aa98e2SPeter WemmThis example is specific to the Computer Science Division at Berkeley.
10206f25ae9SGregory Neil ShapiroYou can use "DOMAIN(`generic')" to get a sufficiently bland definition
103c2aa98e2SPeter Wemmthat may well work for you, or you can create a customized domain
104c2aa98e2SPeter Wemmdefinition appropriate for your environment.
105c2aa98e2SPeter Wemm
10606f25ae9SGregory Neil Shapiro	MAILER(`local')
10706f25ae9SGregory Neil Shapiro	MAILER(`smtp')
108c2aa98e2SPeter Wemm
10906f25ae9SGregory Neil ShapiroThese describe the mailers used at the default CS site.  The
110c2aa98e2SPeter Wemmlocal mailer is always included automatically.  Beware: MAILER
111c2aa98e2SPeter Wemmdeclarations should always be at the end of the configuration file,
11206f25ae9SGregory Neil Shapiroand MAILER(`smtp') should always precede MAILER(`procmail'), and
11306f25ae9SGregory Neil ShapiroMAILER(`uucp').  The general rules are that the order should be:
114c2aa98e2SPeter Wemm
115c2aa98e2SPeter Wemm	VERSIONID
116c2aa98e2SPeter Wemm	OSTYPE
117c2aa98e2SPeter Wemm	DOMAIN
118c2aa98e2SPeter Wemm	FEATURE
119c2aa98e2SPeter Wemm	local macro definitions
120c2aa98e2SPeter Wemm	MAILER
12106f25ae9SGregory Neil Shapiro	LOCAL_RULE_*
12206f25ae9SGregory Neil Shapiro	LOCAL_RULESETS
12306f25ae9SGregory Neil Shapiro
12406f25ae9SGregory Neil ShapiroThere are a few exceptions to this rule.  Local macro definitions which
12506f25ae9SGregory Neil Shapiroinfluence a FEATURE() should be done before that feature.  For example,
12606f25ae9SGregory Neil Shapiroa define(`PROCMAIL_MAILER_PATH', ...) should be done before
12706f25ae9SGregory Neil ShapiroFEATURE(`local_procmail').
128c2aa98e2SPeter Wemm
129c2aa98e2SPeter Wemm
130c2aa98e2SPeter Wemm+----------------------------+
131c2aa98e2SPeter Wemm| A BRIEF INTRODUCTION TO M4 |
132c2aa98e2SPeter Wemm+----------------------------+
133c2aa98e2SPeter Wemm
134c2aa98e2SPeter WemmSendmail uses the M4 macro processor to ``compile'' the configuration
135c2aa98e2SPeter Wemmfiles.  The most important thing to know is that M4 is stream-based,
136c2aa98e2SPeter Wemmthat is, it doesn't understand about lines.  For this reason, in some
137c2aa98e2SPeter Wemmplaces you may see the word ``dnl'', which stands for ``delete
138c2aa98e2SPeter Wemmthrough newline''; essentially, it deletes all characters starting
139c2aa98e2SPeter Wemmat the ``dnl'' up to and including the next newline character.  In
140c2aa98e2SPeter Wemmmost cases sendmail uses this only to avoid lots of unnecessary
141c2aa98e2SPeter Wemmblank lines in the output.
142c2aa98e2SPeter Wemm
143c2aa98e2SPeter WemmOther important directives are define(A, B) which defines the macro
144c2aa98e2SPeter Wemm``A'' to have value ``B''.  Macros are expanded as they are read, so
145c2aa98e2SPeter Wemmone normally quotes both values to prevent expansion.  For example,
146c2aa98e2SPeter Wemm
147c2aa98e2SPeter Wemm	define(`SMART_HOST', `smart.foo.com')
148c2aa98e2SPeter Wemm
149c2aa98e2SPeter WemmOne word of warning:  M4 macros are expanded even in lines that appear
150c2aa98e2SPeter Wemmto be comments.  For example, if you have
151c2aa98e2SPeter Wemm
15206f25ae9SGregory Neil Shapiro	# See FEATURE(`foo') above
153c2aa98e2SPeter Wemm
15406f25ae9SGregory Neil Shapiroit will not do what you expect, because the FEATURE(`foo') will be
155c2aa98e2SPeter Wemmexpanded.  This also applies to
156c2aa98e2SPeter Wemm
157c2aa98e2SPeter Wemm	# And then define the $X macro to be the return address
158c2aa98e2SPeter Wemm
159c2aa98e2SPeter Wemmbecause ``define'' is an M4 keyword.  If you want to use them, surround
160c2aa98e2SPeter Wemmthem with directed quotes, `like this'.
161c2aa98e2SPeter Wemm
162c2aa98e2SPeter Wemm+----------------+
163c2aa98e2SPeter Wemm| FILE LOCATIONS |
164c2aa98e2SPeter Wemm+----------------+
165c2aa98e2SPeter Wemm
166c2aa98e2SPeter Wemmsendmail 8.9 has introduced a new configuration directory for sendmail
167c2aa98e2SPeter Wemmrelated files, /etc/mail.  The new files available for sendmail 8.9 --
16806f25ae9SGregory Neil Shapirothe class {R} /etc/mail/relay-domains and the access database
16906f25ae9SGregory Neil Shapiro/etc/mail/access -- take advantage of this new directory.  Beginning with
17006f25ae9SGregory Neil Shapiro8.10, all files will use this directory by default (some options may be
17106f25ae9SGregory Neil Shapiroset by OSTYPE() files).  This new directory should help to restore
17206f25ae9SGregory Neil Shapirouniformity to sendmail's file locations.
17306f25ae9SGregory Neil Shapiro
17406f25ae9SGregory Neil ShapiroBelow is a table of some of the common changes:
17506f25ae9SGregory Neil Shapiro
17606f25ae9SGregory Neil ShapiroOld filename			New filename
17706f25ae9SGregory Neil Shapiro------------			------------
17806f25ae9SGregory Neil Shapiro/etc/bitdomain			/etc/mail/bitdomain
17906f25ae9SGregory Neil Shapiro/etc/domaintable		/etc/mail/domaintable
18006f25ae9SGregory Neil Shapiro/etc/genericstable		/etc/mail/genericstable
18106f25ae9SGregory Neil Shapiro/etc/uudomain			/etc/mail/uudomain
18206f25ae9SGregory Neil Shapiro/etc/virtusertable		/etc/mail/virtusertable
18306f25ae9SGregory Neil Shapiro/etc/userdb			/etc/mail/userdb
18406f25ae9SGregory Neil Shapiro
18506f25ae9SGregory Neil Shapiro/etc/aliases			/etc/mail/aliases
18606f25ae9SGregory Neil Shapiro/etc/sendmail/aliases		/etc/mail/aliases
18706f25ae9SGregory Neil Shapiro/etc/ucbmail/aliases		/etc/mail/aliases
18806f25ae9SGregory Neil Shapiro/usr/adm/sendmail/aliases	/etc/mail/aliases
18906f25ae9SGregory Neil Shapiro/usr/lib/aliases		/etc/mail/aliases
19006f25ae9SGregory Neil Shapiro/usr/lib/mail/aliases		/etc/mail/aliases
19106f25ae9SGregory Neil Shapiro/usr/ucblib/aliases		/etc/mail/aliases
19206f25ae9SGregory Neil Shapiro
19306f25ae9SGregory Neil Shapiro/etc/sendmail.cw		/etc/mail/local-host-names
19406f25ae9SGregory Neil Shapiro/etc/mail/sendmail.cw		/etc/mail/local-host-names
19506f25ae9SGregory Neil Shapiro/etc/sendmail/sendmail.cw	/etc/mail/local-host-names
19606f25ae9SGregory Neil Shapiro
19706f25ae9SGregory Neil Shapiro/etc/sendmail.ct		/etc/mail/trusted-users
19806f25ae9SGregory Neil Shapiro
19906f25ae9SGregory Neil Shapiro/etc/sendmail.oE		/etc/mail/error-header
20006f25ae9SGregory Neil Shapiro
20106f25ae9SGregory Neil Shapiro/etc/sendmail.hf		/etc/mail/helpfile
20206f25ae9SGregory Neil Shapiro/etc/mail/sendmail.hf		/etc/mail/helpfile
20306f25ae9SGregory Neil Shapiro/usr/ucblib/sendmail.hf		/etc/mail/helpfile
20406f25ae9SGregory Neil Shapiro/etc/ucbmail/sendmail.hf	/etc/mail/helpfile
20506f25ae9SGregory Neil Shapiro/usr/lib/sendmail.hf		/etc/mail/helpfile
20606f25ae9SGregory Neil Shapiro/usr/share/lib/sendmail.hf	/etc/mail/helpfile
20706f25ae9SGregory Neil Shapiro/usr/share/misc/sendmail.hf	/etc/mail/helpfile
20806f25ae9SGregory Neil Shapiro/share/misc/sendmail.hf		/etc/mail/helpfile
20906f25ae9SGregory Neil Shapiro
21006f25ae9SGregory Neil Shapiro/etc/service.switch		/etc/mail/service.switch
21106f25ae9SGregory Neil Shapiro
21206f25ae9SGregory Neil Shapiro/etc/sendmail.st		/etc/mail/statistics
21306f25ae9SGregory Neil Shapiro/etc/mail/sendmail.st		/etc/mail/statistics
21406f25ae9SGregory Neil Shapiro/etc/mailer/sendmail.st		/etc/mail/statistics
21506f25ae9SGregory Neil Shapiro/etc/sendmail/sendmail.st	/etc/mail/statistics
21606f25ae9SGregory Neil Shapiro/usr/lib/sendmail.st		/etc/mail/statistics
21706f25ae9SGregory Neil Shapiro/usr/ucblib/sendmail.st		/etc/mail/statistics
21806f25ae9SGregory Neil Shapiro
21906f25ae9SGregory Neil ShapiroNote that all of these paths actually use a new m4 macro MAIL_SETTINGS_DIR
22006f25ae9SGregory Neil Shapiroto create the pathnames.  The default value of this variable is
22106f25ae9SGregory Neil Shapiro`/etc/mail/'.  If you set this macro to a different value, you MUST include
22206f25ae9SGregory Neil Shapiroa trailing slash.
223c2aa98e2SPeter Wemm
224c2aa98e2SPeter Wemm+--------+
225c2aa98e2SPeter Wemm| OSTYPE |
226c2aa98e2SPeter Wemm+--------+
227c2aa98e2SPeter Wemm
228c2aa98e2SPeter WemmYou MUST define an operating system environment, or the configuration
229c2aa98e2SPeter Wemmfile build will puke.  There are several environments available; look
230c2aa98e2SPeter Wemmat the "ostype" directory for the current list.  This macro changes
231c2aa98e2SPeter Wemmthings like the location of the alias file and queue directory.  Some
232c2aa98e2SPeter Wemmof these files are identical to one another.
233c2aa98e2SPeter Wemm
234c2aa98e2SPeter WemmIt is IMPERATIVE that the OSTYPE occur before any MAILER definitions.
235c2aa98e2SPeter WemmIn general, the OSTYPE macro should go immediately after any version
236c2aa98e2SPeter Wemminformation, and MAILER definitions should always go last.
237c2aa98e2SPeter Wemm
238c2aa98e2SPeter WemmOperating system definitions are usually easy to write.  They may define
239c2aa98e2SPeter Wemmthe following variables (everything defaults, so an ostype file may be
240c2aa98e2SPeter Wemmempty).  Unfortunately, the list of configuration-supported systems is
241c2aa98e2SPeter Wemmnot as broad as the list of source-supported systems, since many of
242c2aa98e2SPeter Wemmthe source contributors do not include corresponding ostype files.
243c2aa98e2SPeter Wemm
24406f25ae9SGregory Neil ShapiroALIAS_FILE		[/etc/mail/aliases] The location of the text version
245c2aa98e2SPeter Wemm			of the alias file(s).  It can be a comma-separated
246c2aa98e2SPeter Wemm			list of names (but be sure you quote values with
247c2aa98e2SPeter Wemm			commas in them -- for example, use
248c2aa98e2SPeter Wemm				define(`ALIAS_FILE', `a,b')
249c2aa98e2SPeter Wemm			to get "a" and "b" both listed as alias files;
250c2aa98e2SPeter Wemm			otherwise the define() primitive only sees "a").
25106f25ae9SGregory Neil ShapiroHELP_FILE		[/etc/mail/helpfile] The name of the file
252c2aa98e2SPeter Wemm			containing information printed in response to
253c2aa98e2SPeter Wemm			the SMTP HELP command.
254c2aa98e2SPeter WemmQUEUE_DIR		[/var/spool/mqueue] The directory containing
25506f25ae9SGregory Neil Shapiro			queue files.  To use multiple queues, supply
25606f25ae9SGregory Neil Shapiro			a value ending with an asterisk.  For
25706f25ae9SGregory Neil Shapiro			example, /var/spool/mqueue/q* will use all of the
25806f25ae9SGregory Neil Shapiro			directories or symbolic links to directories
25906f25ae9SGregory Neil Shapiro			beginning with 'q' in /var/spool/mqueue as queue
26006f25ae9SGregory Neil Shapiro			directories.  The names 'qf', 'df', and 'xf' are
26106f25ae9SGregory Neil Shapiro			used as specific subdirectories for the corresponding
26206f25ae9SGregory Neil Shapiro			queue file types.
26306f25ae9SGregory Neil ShapiroSTATUS_FILE		[/etc/mail/statistics] The file containing status
264c2aa98e2SPeter Wemm			information.
265c2aa98e2SPeter WemmLOCAL_MAILER_PATH	[/bin/mail] The program used to deliver local mail.
26606f25ae9SGregory Neil ShapiroLOCAL_MAILER_FLAGS	[Prmn9] The flags used by the local mailer.  The
26706f25ae9SGregory Neil Shapiro			flags lsDFMAw5:/|@q are always included.
268c2aa98e2SPeter WemmLOCAL_MAILER_ARGS	[mail -d $u] The arguments passed to deliver local
269c2aa98e2SPeter Wemm			mail.
270c2aa98e2SPeter WemmLOCAL_MAILER_MAX	[undefined] If defined, the maximum size of local
271c2aa98e2SPeter Wemm			mail that you are willing to accept.
27206f25ae9SGregory Neil ShapiroLOCAL_MAILER_MAXMSGS	[undefined] If defined, the maximum number of
27306f25ae9SGregory Neil Shapiro			messages to deliver in a single connection.  Only
27406f25ae9SGregory Neil Shapiro			useful for LMTP local mailers.
275c2aa98e2SPeter WemmLOCAL_MAILER_CHARSET	[undefined] If defined, messages containing 8-bit data
276c2aa98e2SPeter Wemm			that ARRIVE from an address that resolves to the
277c2aa98e2SPeter Wemm			local mailer and which are converted to MIME will be
278c2aa98e2SPeter Wemm			labeled with this character set.
27906f25ae9SGregory Neil ShapiroLOCAL_MAILER_EOL	[undefined] If defined, the string to use as the
28006f25ae9SGregory Neil Shapiro			end of line for the local mailer.
28106f25ae9SGregory Neil ShapiroLOCAL_MAILER_DSN_DIAGNOSTIC_CODE
28206f25ae9SGregory Neil Shapiro			[X-Unix] The DSN Diagnostic-Code value for the
28306f25ae9SGregory Neil Shapiro			local mailer.  This should be changed with care.
284c2aa98e2SPeter WemmLOCAL_SHELL_PATH	[/bin/sh] The shell used to deliver piped email.
285c2aa98e2SPeter WemmLOCAL_SHELL_FLAGS	[eu9] The flags used by the shell mailer.  The
286c2aa98e2SPeter Wemm			flags lsDFM are always included.
287c2aa98e2SPeter WemmLOCAL_SHELL_ARGS	[sh -c $u] The arguments passed to deliver "prog"
288c2aa98e2SPeter Wemm			mail.
289c2aa98e2SPeter WemmLOCAL_SHELL_DIR		[$z:/] The directory search path in which the
290c2aa98e2SPeter Wemm			shell should run.
291c2aa98e2SPeter WemmUSENET_MAILER_PATH	[/usr/lib/news/inews] The name of the program
292c2aa98e2SPeter Wemm			used to submit news.
29306f25ae9SGregory Neil ShapiroUSENET_MAILER_FLAGS	[rsDFMmn] The mailer flags for the usenet mailer.
294c2aa98e2SPeter WemmUSENET_MAILER_ARGS	[-m -h -n] The command line arguments for the
295c2aa98e2SPeter Wemm			usenet mailer.
296c2aa98e2SPeter WemmUSENET_MAILER_MAX	[100000] The maximum size of messages that will
297c2aa98e2SPeter Wemm			be accepted by the usenet mailer.
298c2aa98e2SPeter WemmSMTP_MAILER_FLAGS	[undefined] Flags added to SMTP mailer.  Default
29906f25ae9SGregory Neil Shapiro			flags are `mDFMuX' for all SMTP-based mailers; the
30006f25ae9SGregory Neil Shapiro			"esmtp" mailer adds `a'; "smtp8" adds `8'; and
30106f25ae9SGregory Neil Shapiro			"dsmtp" adds `%'.
30206f25ae9SGregory Neil ShapiroRELAY_MAILER_FLAGS	[undefined] Flags added to the relay mailer.  Default
30306f25ae9SGregory Neil Shapiro			flags are `mDFMuX' for all SMTP-based mailers; the
30406f25ae9SGregory Neil Shapiro			relay mailer adds `a8'.  If this is not defined,
30506f25ae9SGregory Neil Shapiro			then SMTP_MAILER_FLAGS is used.
306c2aa98e2SPeter WemmSMTP_MAILER_MAX		[undefined] The maximum size of messages that will
30706f25ae9SGregory Neil Shapiro			be transported using the smtp, smtp8, esmtp, or dsmtp
308c2aa98e2SPeter Wemm			mailers.
30906f25ae9SGregory Neil ShapiroSMTP_MAILER_MAXMSGS	[undefined] If defined, the maximum number of
31006f25ae9SGregory Neil Shapiro			messages to deliver in a single connection for the
31106f25ae9SGregory Neil Shapiro			smtp, smtp8, esmtp, or dsmtp mailers.
31242e5d165SGregory Neil ShapiroSMTP_MAILER_ARGS	[TCP $h] The arguments passed to the smtp mailer.
313c2aa98e2SPeter Wemm			About the only reason you would want to change this
314c2aa98e2SPeter Wemm			would be to change the default port.
31542e5d165SGregory Neil ShapiroESMTP_MAILER_ARGS	[TCP $h] The arguments passed to the esmtp mailer.
31642e5d165SGregory Neil ShapiroSMTP8_MAILER_ARGS	[TCP $h] The arguments passed to the smtp8 mailer.
31742e5d165SGregory Neil ShapiroDSMTP_MAILER_ARGS	[TCP $h] The arguments passed to the dsmtp mailer.
31842e5d165SGregory Neil ShapiroRELAY_MAILER_ARGS	[TCP $h] The arguments passed to the relay mailer.
31906f25ae9SGregory Neil ShapiroRELAY_MAILER_MAXMSGS	[undefined] If defined, the maximum number of
32006f25ae9SGregory Neil Shapiro			messages to deliver in a single connection for the
32106f25ae9SGregory Neil Shapiro			relay mailer.
322c2aa98e2SPeter WemmSMTP_MAILER_CHARSET	[undefined] If defined, messages containing 8-bit data
323c2aa98e2SPeter Wemm			that ARRIVE from an address that resolves to one of
324c2aa98e2SPeter Wemm			the SMTP mailers and which are converted to MIME will
325c2aa98e2SPeter Wemm			be labeled with this character set.
326c2aa98e2SPeter WemmUUCP_MAILER_PATH	[/usr/bin/uux] The program used to send UUCP mail.
327c2aa98e2SPeter WemmUUCP_MAILER_FLAGS	[undefined] Flags added to UUCP mailer.  Default
328c2aa98e2SPeter Wemm			flags are `DFMhuU' (and `m' for uucp-new mailer,
329c2aa98e2SPeter Wemm			minus `U' for uucp-dom mailer).
330c2aa98e2SPeter WemmUUCP_MAILER_ARGS	[uux - -r -z -a$g -gC $h!rmail ($u)] The arguments
331c2aa98e2SPeter Wemm			passed to the UUCP mailer.
332c2aa98e2SPeter WemmUUCP_MAILER_MAX		[100000] The maximum size message accepted for
333c2aa98e2SPeter Wemm			transmission by the UUCP mailers.
334c2aa98e2SPeter WemmUUCP_MAILER_CHARSET	[undefined] If defined, messages containing 8-bit data
335c2aa98e2SPeter Wemm			that ARRIVE from an address that resolves to one of
336c2aa98e2SPeter Wemm			the UUCP mailers and which are converted to MIME will
337c2aa98e2SPeter Wemm			be labeled with this character set.
338c2aa98e2SPeter WemmFAX_MAILER_PATH		[/usr/local/lib/fax/mailfax] The program used to
339c2aa98e2SPeter Wemm			submit FAX messages.
340c2aa98e2SPeter WemmFAX_MAILER_ARGS		[mailfax $u $h $f] The arguments passed to the FAX
341c2aa98e2SPeter Wemm			mailer.
342c2aa98e2SPeter WemmFAX_MAILER_MAX		[100000] The maximum size message accepted for
343c2aa98e2SPeter Wemm			transmission by FAX.
344c2aa98e2SPeter WemmPOP_MAILER_PATH		[/usr/lib/mh/spop] The pathname of the POP mailer.
34506f25ae9SGregory Neil ShapiroPOP_MAILER_FLAGS	[Penu] Flags added to POP mailer.  Flags lsDFMq
346c2aa98e2SPeter Wemm			are always added.
347c2aa98e2SPeter WemmPOP_MAILER_ARGS		[pop $u] The arguments passed to the POP mailer.
348c2aa98e2SPeter WemmPROCMAIL_MAILER_PATH	[/usr/local/bin/procmail] The path to the procmail
3492e43090eSPeter Wemm			program.  This is also used by
3502e43090eSPeter Wemm			FEATURE(`local_procmail').
351c2aa98e2SPeter WemmPROCMAIL_MAILER_FLAGS	[SPhnu9] Flags added to Procmail mailer.  Flags
35206f25ae9SGregory Neil Shapiro			DFM are always set.  This is NOT used by
3532e43090eSPeter Wemm			FEATURE(`local_procmail'); tweak LOCAL_MAILER_FLAGS
354c2aa98e2SPeter Wemm			instead.
355c2aa98e2SPeter WemmPROCMAIL_MAILER_ARGS	[procmail -Y -m $h $f $u] The arguments passed to
356c2aa98e2SPeter Wemm			the Procmail mailer.  This is NOT used by
3572e43090eSPeter Wemm			FEATURE(`local_procmail'); tweak LOCAL_MAILER_ARGS
358c2aa98e2SPeter Wemm			instead.
359c2aa98e2SPeter WemmPROCMAIL_MAILER_MAX	[undefined] If set, the maximum size message that
360c2aa98e2SPeter Wemm			will be accepted by the procmail mailer.
361c2aa98e2SPeter WemmMAIL11_MAILER_PATH	[/usr/etc/mail11] The path to the mail11 mailer.
362c2aa98e2SPeter WemmMAIL11_MAILER_FLAGS	[nsFx] Flags for the mail11 mailer.
363c2aa98e2SPeter WemmMAIL11_MAILER_ARGS	[mail11 $g $x $h $u] Arguments passed to the mail11
364c2aa98e2SPeter Wemm			mailer.
365c2aa98e2SPeter WemmPH_MAILER_PATH		[/usr/local/etc/phquery] The path to the phquery
366c2aa98e2SPeter Wemm			program.
36706f25ae9SGregory Neil ShapiroPH_MAILER_FLAGS		[ehmu] Flags for the phquery mailer.  Flags nrDFM
36806f25ae9SGregory Neil Shapiro			are always set.
369c2aa98e2SPeter WemmPH_MAILER_ARGS		[phquery -- $u] -- arguments to the phquery mailer.
37006f25ae9SGregory Neil ShapiroCYRUS_MAILER_FLAGS	[Ah5@/:|] The flags used by the cyrus mailer.  The
371c2aa98e2SPeter Wemm			flags lsDFMnPq are always included.
372c2aa98e2SPeter WemmCYRUS_MAILER_PATH	[/usr/cyrus/bin/deliver] The program used to deliver
373c2aa98e2SPeter Wemm			cyrus mail.
374c2aa98e2SPeter WemmCYRUS_MAILER_ARGS	[deliver -e -m $h -- $u] The arguments passed
375c2aa98e2SPeter Wemm			to deliver cyrus mail.
376c2aa98e2SPeter WemmCYRUS_MAILER_MAX	[undefined] If set, the maximum size message that
377c2aa98e2SPeter Wemm			will be accepted by the cyrus mailer.
378c2aa98e2SPeter WemmCYRUS_MAILER_USER	[cyrus:mail] The user and group to become when
379c2aa98e2SPeter Wemm			running the cyrus mailer.
38006f25ae9SGregory Neil ShapiroCYRUS_BB_MAILER_FLAGS	[u] The flags used by the cyrusbb mailer.
38106f25ae9SGregory Neil Shapiro			The flags lsDFMnP are always included.
382c2aa98e2SPeter WemmCYRUS_BB_MAILER_ARGS	[deliver -e -m $u] The arguments passed
383c2aa98e2SPeter Wemm			to deliver cyrusbb mail.
384c2aa98e2SPeter WemmconfEBINDIR		[/usr/libexec] The directory for executables.
3852e43090eSPeter Wemm			Currently used for FEATURE(`local_lmtp') and
3862e43090eSPeter Wemm			FEATURE(`smrsh').
38706f25ae9SGregory Neil ShapiroQPAGE_MAILER_FLAGS	[mDFMs] The flags used by the qpage mailer.
38806f25ae9SGregory Neil ShapiroQPAGE_MAILER_PATH	[/usr/local/bin/qpage] The program used to deliver
38906f25ae9SGregory Neil Shapiro			qpage mail.
39006f25ae9SGregory Neil ShapiroQPAGE_MAILER_ARGS	[qpage -l0 -m -P$u] The arguments passed
39106f25ae9SGregory Neil Shapiro			to deliver qpage mail.
39206f25ae9SGregory Neil ShapiroQPAGE_MAILER_MAX	[4096] If set, the maximum size message that
39306f25ae9SGregory Neil Shapiro			will be accepted by the qpage mailer.
394c2aa98e2SPeter Wemm
39506f25ae9SGregory Neil ShapiroNote: to tweak Name_MAILER_FLAGS use the macro MODIFY_MAILER_FLAGS:
39606f25ae9SGregory Neil ShapiroMODIFY_MAILER_FLAGS(`Name', `change') where Name is the first part of
39706f25ae9SGregory Neil Shapirothe macro Name_MAILER_FLAGS and change can be: flags that should
39806f25ae9SGregory Neil Shapirobe used directly (thus overriding the default value), or if it
39906f25ae9SGregory Neil Shapirostarts with `+' (`-') then those flags are added to (removed from)
40006f25ae9SGregory Neil Shapirothe default value.  Example:
40106f25ae9SGregory Neil Shapiro
40206f25ae9SGregory Neil Shapiro	MODIFY_MAILER_FLAGS(`LOCAL', `+e')
40306f25ae9SGregory Neil Shapiro
40406f25ae9SGregory Neil Shapirowill add the flag `e' to LOCAL_MAILER_FLAGS.
40506f25ae9SGregory Neil ShapiroWARNING: The FEATUREs local_lmtp and local_procmail set LOCAL_MAILER_FLAGS
40606f25ae9SGregory Neil Shapirounconditionally, i.e., without respecting any definitions in an
40706f25ae9SGregory Neil ShapiroOSTYPE setting.
408c2aa98e2SPeter Wemm
409c2aa98e2SPeter Wemm
410c2aa98e2SPeter Wemm+---------+
411c2aa98e2SPeter Wemm| DOMAINS |
412c2aa98e2SPeter Wemm+---------+
413c2aa98e2SPeter Wemm
414c2aa98e2SPeter WemmYou will probably want to collect domain-dependent defines into one
41506f25ae9SGregory Neil Shapirofile, referenced by the DOMAIN macro.  For example, the Berkeley
416c2aa98e2SPeter Wemmdomain file includes definitions for several internal distinguished
417c2aa98e2SPeter Wemmhosts:
418c2aa98e2SPeter Wemm
419c2aa98e2SPeter WemmUUCP_RELAY	The host that will accept UUCP-addressed email.
420c2aa98e2SPeter Wemm		If not defined, all UUCP sites must be directly
421c2aa98e2SPeter Wemm		connected.
422c2aa98e2SPeter WemmBITNET_RELAY	The host that will accept BITNET-addressed email.
423c2aa98e2SPeter Wemm		If not defined, the .BITNET pseudo-domain won't work.
424c2aa98e2SPeter WemmDECNET_RELAY	The host that will accept DECNET-addressed email.
425c2aa98e2SPeter Wemm		If not defined, the .DECNET pseudo-domain and addresses
426c2aa98e2SPeter Wemm		of the form node::user will not work.
427c2aa98e2SPeter WemmFAX_RELAY	The host that will accept mail to the .FAX pseudo-domain.
428c2aa98e2SPeter Wemm		The "fax" mailer overrides this value.
429193538b7SGregory Neil ShapiroLOCAL_RELAY	The site that will handle unqualified names -- that
430193538b7SGregory Neil Shapiro		is, names with out an @domain extension.
431193538b7SGregory Neil Shapiro		Normally MAIL_HUB is preferred for this function.
432193538b7SGregory Neil Shapiro		LOCAL_RELAY is mostly useful in conjunction with
433193538b7SGregory Neil Shapiro		FEATURE(stickyhost) -- see the discussion of
434193538b7SGregory Neil Shapiro		stickyhost below.  If not set, they are assumed to
435193538b7SGregory Neil Shapiro		belong on this machine.  This allows you to have a
436193538b7SGregory Neil Shapiro		central site to store a company- or department-wide
437193538b7SGregory Neil Shapiro		alias database.  This only works at small sites,
438193538b7SGregory Neil Shapiro		and only with some user agents.
439c2aa98e2SPeter WemmLUSER_RELAY	The site that will handle lusers -- that is, apparently
44006f25ae9SGregory Neil Shapiro		local names that aren't local accounts or aliases.  To
44106f25ae9SGregory Neil Shapiro		specify a local user instead of a site, set this to
44206f25ae9SGregory Neil Shapiro		``local:username''.
443c2aa98e2SPeter Wemm
444c2aa98e2SPeter WemmAny of these can be either ``mailer:hostname'' (in which case the
445c2aa98e2SPeter Wemmmailer is the internal mailer name, such as ``uucp-new'' and the hostname
446c2aa98e2SPeter Wemmis the name of the host as appropriate for that mailer) or just a
447c2aa98e2SPeter Wemm``hostname'', in which case a default mailer type (usually ``relay'',
448c2aa98e2SPeter Wemma variant on SMTP) is used.  WARNING: if you have a wildcard MX
449c2aa98e2SPeter Wemmrecord matching your domain, you probably want to define these to
450c2aa98e2SPeter Wemmhave a trailing dot so that you won't get the mail diverted back
451c2aa98e2SPeter Wemmto yourself.
452c2aa98e2SPeter Wemm
453c2aa98e2SPeter WemmThe domain file can also be used to define a domain name, if needed
454c2aa98e2SPeter Wemm(using "DD<domain>") and set certain site-wide features.  If all hosts
455c2aa98e2SPeter Wemmat your site masquerade behind one email name, you could also use
456c2aa98e2SPeter WemmMASQUERADE_AS here.
457c2aa98e2SPeter Wemm
458c2aa98e2SPeter WemmYou do not have to define a domain -- in particular, if you are a
459c2aa98e2SPeter Wemmsingle machine sitting off somewhere, it is probably more work than
460c2aa98e2SPeter Wemmit's worth.  This is just a mechanism for combining "domain dependent
461c2aa98e2SPeter Wemmknowledge" into one place.
462c2aa98e2SPeter Wemm
463c2aa98e2SPeter Wemm+---------+
464c2aa98e2SPeter Wemm| MAILERS |
465c2aa98e2SPeter Wemm+---------+
466c2aa98e2SPeter Wemm
467c2aa98e2SPeter WemmThere are fewer mailers supported in this version than the previous
468c2aa98e2SPeter Wemmversion, owing mostly to a simpler world.  As a general rule, put the
46906f25ae9SGregory Neil ShapiroMAILER definitions last in your .mc file, and always put MAILER(`smtp')
47006f25ae9SGregory Neil Shapirobefore MAILER(`uucp') and MAILER(`procmail') -- several features and
47106f25ae9SGregory Neil Shapirodefinitions will modify the definition of mailers, and the smtp mailer
47206f25ae9SGregory Neil Shapiromodifies the UUCP mailer.  Moreover, MAILER(`cyrus'), MAILER(`pop'),
47306f25ae9SGregory Neil ShapiroMAILER(`phquery'), and MAILER(`usenet') must be defined after
47406f25ae9SGregory Neil ShapiroMAILER(`local').
475c2aa98e2SPeter Wemm
476c2aa98e2SPeter Wemmlocal		The local and prog mailers.  You will almost always
477c2aa98e2SPeter Wemm		need these; the only exception is if you relay ALL
478c2aa98e2SPeter Wemm		your mail to another site.  This mailer is included
479c2aa98e2SPeter Wemm		automatically.
480c2aa98e2SPeter Wemm
481c2aa98e2SPeter Wemmsmtp		The Simple Mail Transport Protocol mailer.  This does
482c2aa98e2SPeter Wemm		not hide hosts behind a gateway or another other
483c2aa98e2SPeter Wemm		such hack; it assumes a world where everyone is
484c2aa98e2SPeter Wemm		running the name server.  This file actually defines
48506f25ae9SGregory Neil Shapiro		five mailers: "smtp" for regular (old-style) SMTP to
486c2aa98e2SPeter Wemm		other servers, "esmtp" for extended SMTP to other
487c2aa98e2SPeter Wemm		servers, "smtp8" to do SMTP to other servers without
488c2aa98e2SPeter Wemm		converting 8-bit data to MIME (essentially, this is
489c2aa98e2SPeter Wemm		your statement that you know the other end is 8-bit
49006f25ae9SGregory Neil Shapiro		clean even if it doesn't say so), "dsmtp" to do on
49106f25ae9SGregory Neil Shapiro		demand delivery, and "relay" for transmission to the
49206f25ae9SGregory Neil Shapiro		RELAY_HOST, LUSER_RELAY, or MAIL_HUB.
493c2aa98e2SPeter Wemm
49442e5d165SGregory Neil Shapirouucp		The UNIX-to-UNIX Copy Program mailer.  Actually, this
495c2aa98e2SPeter Wemm		defines two mailers, "uucp-old" (a.k.a. "uucp") and
496c2aa98e2SPeter Wemm		"uucp-new" (a.k.a. "suucp").  The latter is for when you
497c2aa98e2SPeter Wemm		know that the UUCP mailer at the other end can handle
498c2aa98e2SPeter Wemm		multiple recipients in one transfer.  If the smtp mailer
499c2aa98e2SPeter Wemm		is also included in your configuration, two other mailers
500c2aa98e2SPeter Wemm		("uucp-dom" and "uucp-uudom") are also defined [warning:
501c2aa98e2SPeter Wemm		you MUST specify MAILER(smtp) before MAILER(uucp)].  When you
502c2aa98e2SPeter Wemm		include the uucp mailer, sendmail looks for all names in
50306f25ae9SGregory Neil Shapiro		class {U} and sends them to the uucp-old mailer; all
50406f25ae9SGregory Neil Shapiro		names in class {Y} are sent to uucp-new; and all
50506f25ae9SGregory Neil Shapiro		names in class {Z} are sent to uucp-uudom.  Note that
506c2aa98e2SPeter Wemm		this is a function of what version of rmail runs on
507c2aa98e2SPeter Wemm		the receiving end, and hence may be out of your control.
508c2aa98e2SPeter Wemm		See the section below describing UUCP mailers in more
509c2aa98e2SPeter Wemm		detail.
510c2aa98e2SPeter Wemm
511c2aa98e2SPeter Wemmusenet		Usenet (network news) delivery.  If this is specified,
512c2aa98e2SPeter Wemm		an extra rule is added to ruleset 0 that forwards all
513c2aa98e2SPeter Wemm		local email for users named ``group.usenet'' to the
514c2aa98e2SPeter Wemm		``inews'' program.  Note that this works for all groups,
515c2aa98e2SPeter Wemm		and may be considered a security problem.
516c2aa98e2SPeter Wemm
517c2aa98e2SPeter Wemmfax		Facsimile transmission.  This is experimental and based
518c2aa98e2SPeter Wemm		on Sam Leffler's HylaFAX software.  For more information,
519193538b7SGregory Neil Shapiro		see http://www.hylafax.org/.
520c2aa98e2SPeter Wemm
521c2aa98e2SPeter Wemmpop		Post Office Protocol.
522c2aa98e2SPeter Wemm
523c2aa98e2SPeter Wemmprocmail	An interface to procmail (does not come with sendmail).
524c2aa98e2SPeter Wemm		This is designed to be used in mailertables.  For example,
525c2aa98e2SPeter Wemm		a common question is "how do I forward all mail for a given
526c2aa98e2SPeter Wemm		domain to a single person?".  If you have this mailer
527c2aa98e2SPeter Wemm		defined, you could set up a mailertable reading:
528c2aa98e2SPeter Wemm
529c2aa98e2SPeter Wemm			host.com	procmail:/etc/procmailrcs/host.com
530c2aa98e2SPeter Wemm
531c2aa98e2SPeter Wemm		with the file /etc/procmailrcs/host.com reading:
532c2aa98e2SPeter Wemm
533c2aa98e2SPeter Wemm			:0	# forward mail for host.com
534c2aa98e2SPeter Wemm			! -oi -f $1 person@other.host
535c2aa98e2SPeter Wemm
536c2aa98e2SPeter Wemm		This would arrange for (anything)@host.com to be sent
537c2aa98e2SPeter Wemm		to person@other.host.  Within the procmail script, $1 is
538c2aa98e2SPeter Wemm		the name of the sender and $2 is the name of the recipient.
5392e43090eSPeter Wemm		If you use this with FEATURE(`local_procmail'), the FEATURE
540c2aa98e2SPeter Wemm		should be listed first.
541c2aa98e2SPeter Wemm
542c2aa98e2SPeter Wemmmail11		The DECnet mail11 mailer, useful only if you have the mail11
543c2aa98e2SPeter Wemm		program from gatekeeper.dec.com:/pub/DEC/gwtools (and
544c2aa98e2SPeter Wemm		DECnet, of course).  This is for Phase IV DECnet support;
545c2aa98e2SPeter Wemm		if you have Phase V at your site you may have additional
546c2aa98e2SPeter Wemm		problems.
547c2aa98e2SPeter Wemm
548c2aa98e2SPeter Wemmphquery		The phquery program.  This is somewhat counterintuitively
549c2aa98e2SPeter Wemm		referenced as the "ph" mailer internally.  It can be used
550c2aa98e2SPeter Wemm		to do CCSO name server lookups.  The phquery program, which
551c2aa98e2SPeter Wemm		this mailer uses, is distributed with the ph client.
552c2aa98e2SPeter Wemm
553c2aa98e2SPeter Wemmcyrus		The cyrus and cyrusbb mailers.  The cyrus mailer delivers to
554c2aa98e2SPeter Wemm		a local cyrus user.  this mailer can make use of the
555c2aa98e2SPeter Wemm		"user+detail@local.host" syntax; it will deliver the mail to
556c2aa98e2SPeter Wemm		the user's "detail" mailbox if the mailbox's ACL permits.
557c2aa98e2SPeter Wemm		The cyrusbb mailer delivers to a system-wide cyrus mailbox
55806f25ae9SGregory Neil Shapiro		if the mailbox's ACL permits.  The cyrus mailer must be
55906f25ae9SGregory Neil Shapiro		defined after the local mailer.
560c2aa98e2SPeter Wemm
56106f25ae9SGregory Neil Shapiroqpage		A mailer for QuickPage, a pager interface.  See
56206f25ae9SGregory Neil Shapiro		http://www.qpage.org/ for further information.
563c2aa98e2SPeter Wemm
564c2aa98e2SPeter WemmThe local mailer accepts addresses of the form "user+detail", where
565c2aa98e2SPeter Wemmthe "+detail" is not used for mailbox matching but is available
5662e43090eSPeter Wemmto certain local mail programs (in particular, see
5672e43090eSPeter WemmFEATURE(`local_procmail')).  For example, "eric", "eric+sendmail", and
5682e43090eSPeter Wemm"eric+sww" all indicate the same user, but additional arguments <null>,
5692e43090eSPeter Wemm"sendmail", and "sww" may be provided for use in sorting mail.
570c2aa98e2SPeter Wemm
571c2aa98e2SPeter Wemm
572c2aa98e2SPeter Wemm+----------+
573c2aa98e2SPeter Wemm| FEATURES |
574c2aa98e2SPeter Wemm+----------+
575c2aa98e2SPeter Wemm
576c2aa98e2SPeter WemmSpecial features can be requested using the "FEATURE" macro.  For
577c2aa98e2SPeter Wemmexample, the .mc line:
578c2aa98e2SPeter Wemm
5792e43090eSPeter Wemm	FEATURE(`use_cw_file')
580c2aa98e2SPeter Wemm
58106f25ae9SGregory Neil Shapirotells sendmail that you want to have it read an /etc/mail/local-host-names
58206f25ae9SGregory Neil Shapirofile to get values for class {w}.  The FEATURE may contain up to 9
58306f25ae9SGregory Neil Shapirooptional parameters -- for example:
584c2aa98e2SPeter Wemm
5852e43090eSPeter Wemm	FEATURE(`mailertable', `dbm /usr/lib/mailertable')
586c2aa98e2SPeter Wemm
587c2aa98e2SPeter WemmThe default database map type for the table features can be set with
588c2aa98e2SPeter Wemm
589c2aa98e2SPeter Wemm	define(`DATABASE_MAP_TYPE', `dbm')
590c2aa98e2SPeter Wemm
591c2aa98e2SPeter Wemmwhich would set it to use ndbm databases.  The default is the Berkeley DB
592c2aa98e2SPeter Wemmhash database format.  Note that you must still declare a database map type
593c2aa98e2SPeter Wemmif you specify an argument to a FEATURE.  DATABASE_MAP_TYPE is only used
59406f25ae9SGregory Neil Shapiroif no argument is given for the FEATURE.  It must be specified before any
59506f25ae9SGregory Neil Shapirofeature that uses a map.
596c2aa98e2SPeter Wemm
597c2aa98e2SPeter WemmAvailable features are:
598c2aa98e2SPeter Wemm
59906f25ae9SGregory Neil Shapirouse_cw_file	Read the file /etc/mail/local-host-names file to get
60006f25ae9SGregory Neil Shapiro		alternate names for this host.  This might be used if you
60106f25ae9SGregory Neil Shapiro		were on a host that MXed for a dynamic set of other hosts.
60206f25ae9SGregory Neil Shapiro		If the set is static, just including the line "Cw<name1>
60306f25ae9SGregory Neil Shapiro		<name2> ..." (where the names are fully qualified domain
60406f25ae9SGregory Neil Shapiro		names) is probably superior.  The actual filename can be
60506f25ae9SGregory Neil Shapiro		overridden by redefining confCW_FILE.
606c2aa98e2SPeter Wemm
60706f25ae9SGregory Neil Shapirouse_ct_file	Read the file /etc/mail/trusted-users file to get the
60806f25ae9SGregory Neil Shapiro		names of users that will be ``trusted'', that is, able to
60906f25ae9SGregory Neil Shapiro		set their envelope from address using -f without generating
61006f25ae9SGregory Neil Shapiro		a warning message.  The actual filename can be overridden
61106f25ae9SGregory Neil Shapiro		by redefining confCT_FILE.
612c2aa98e2SPeter Wemm
613c2aa98e2SPeter Wemmredirect	Reject all mail addressed to "address.REDIRECT" with
61406f25ae9SGregory Neil Shapiro		a ``551 User has moved; please try <address>'' message.
615c2aa98e2SPeter Wemm		If this is set, you can alias people who have left
616c2aa98e2SPeter Wemm		to their new address with ".REDIRECT" appended.
617c2aa98e2SPeter Wemm
61806f25ae9SGregory Neil Shapironouucp		Don't route UUCP addresses.  This feature takes one
61906f25ae9SGregory Neil Shapiro		parameter:
62006f25ae9SGregory Neil Shapiro		`reject': reject addresses which have "!" in the local
62106f25ae9SGregory Neil Shapiro			part unless it originates from a system
62206f25ae9SGregory Neil Shapiro			that is allowed to relay.
62306f25ae9SGregory Neil Shapiro		`nospecial': don't do anything special with "!".
62406f25ae9SGregory Neil Shapiro		Warnings: 1. See the NOTICE in the ANTI-SPAM section.
62506f25ae9SGregory Neil Shapiro		2. don't remove "!" from OperatorChars if `reject' is
62606f25ae9SGregory Neil Shapiro		given as parameter.
627c2aa98e2SPeter Wemm
62806f25ae9SGregory Neil Shapironocanonify	Don't pass addresses to $[ ... $] for canonification
629193538b7SGregory Neil Shapiro		by default, i.e., host/domain names are considered canonical,
630193538b7SGregory Neil Shapiro		except for unqualified names, which must not be used in this
631193538b7SGregory Neil Shapiro		mode (violation of the standard).  It can be changed by
632193538b7SGregory Neil Shapiro		setting the DaemonPortOptions modifiers (M=).  That is,
63306f25ae9SGregory Neil Shapiro		FEATURE(`nocanonify') will be overridden by setting the
63406f25ae9SGregory Neil Shapiro		'c' flag.  Conversely, if FEATURE(`nocanonify') is not used,
63506f25ae9SGregory Neil Shapiro		it can be emulated by setting the 'C' flag
63606f25ae9SGregory Neil Shapiro		(DaemonPortOptions=Modifiers=C).  This would generally only
63706f25ae9SGregory Neil Shapiro		be used by sites that only act as mail gateways or which have
63806f25ae9SGregory Neil Shapiro		user agents that do full canonification themselves.  You may
63906f25ae9SGregory Neil Shapiro		also want to use
64006f25ae9SGregory Neil Shapiro		"define(`confBIND_OPTS', `-DNSRCH -DEFNAMES')" to turn off
64106f25ae9SGregory Neil Shapiro		the usual resolver options that do a similar thing.
64206f25ae9SGregory Neil Shapiro
64306f25ae9SGregory Neil Shapiro		An exception list for FEATURE(`nocanonify') can be
64406f25ae9SGregory Neil Shapiro		specified with CANONIFY_DOMAIN or CANONIFY_DOMAIN_FILE,
64506f25ae9SGregory Neil Shapiro		i.e., a list of domains which are nevertheless passed to
64606f25ae9SGregory Neil Shapiro		$[ ... $] for canonification.  This is useful to turn on
64706f25ae9SGregory Neil Shapiro		canonification for local domains, e.g., use
64806f25ae9SGregory Neil Shapiro		CANONIFY_DOMAIN(`my.domain my') to canonify addresses
64906f25ae9SGregory Neil Shapiro		which end in "my.domain" or "my".
65006f25ae9SGregory Neil Shapiro		Another way to require canonification in the local
65106f25ae9SGregory Neil Shapiro		domain is CANONIFY_DOMAIN(`$=m').
65206f25ae9SGregory Neil Shapiro
65306f25ae9SGregory Neil Shapiro		A trailing dot is added to addresses with more than
65406f25ae9SGregory Neil Shapiro		one component in it such that other features which
65506f25ae9SGregory Neil Shapiro		expect a trailing dot (e.g., virtusertable) will
65606f25ae9SGregory Neil Shapiro		still work.
65706f25ae9SGregory Neil Shapiro
65806f25ae9SGregory Neil Shapiro		If `canonify_hosts' is specified as parameter, i.e.,
65906f25ae9SGregory Neil Shapiro		FEATURE(`nocanonify', `canonify_hosts'), then
66006f25ae9SGregory Neil Shapiro		addresses which have only a hostname, e.g.,
66106f25ae9SGregory Neil Shapiro		<user@host>, will be canonified (and hopefully fully
66206f25ae9SGregory Neil Shapiro		qualified), too.
663c2aa98e2SPeter Wemm
664193538b7SGregory Neil Shapirostickyhost	This feature is sometimes used with LOCAL_RELAY,
665193538b7SGregory Neil Shapiro		although it can be used for a different effect with
666193538b7SGregory Neil Shapiro		MAIL_HUB.
667193538b7SGregory Neil Shapiro
668193538b7SGregory Neil Shapiro		When used with without MAIL_HUB, email sent to
669193538b7SGregory Neil Shapiro		"user@local.host" are marked as "sticky" -- that
670193538b7SGregory Neil Shapiro		is, the local addresses aren't matched against UDB,
671193538b7SGregory Neil Shapiro		don't go through ruleset 5, and are not forwarded to
672193538b7SGregory Neil Shapiro		the LOCAL_RELAY (if defined).
673193538b7SGregory Neil Shapiro
674193538b7SGregory Neil Shapiro		With MAIL_HUB, mail addressed to "user@local.host"
675193538b7SGregory Neil Shapiro		is forwarded to the mail hub, with the envelope
676193538b7SGregory Neil Shapiro		address still remaining "user@local.host".
677193538b7SGregory Neil Shapiro		Without stickyhost, the envelope would be changed
678193538b7SGregory Neil Shapiro		to "user@mail_hub", in order to protect against
679193538b7SGregory Neil Shapiro		mailing loops.
680c2aa98e2SPeter Wemm
681c2aa98e2SPeter Wemmmailertable	Include a "mailer table" which can be used to override
68206f25ae9SGregory Neil Shapiro		routing for particular domains (which are not in class {w},
68306f25ae9SGregory Neil Shapiro		i.e.  local host names).  The argument of the FEATURE may be
68406f25ae9SGregory Neil Shapiro		the key definition.  If none is specified, the definition
68506f25ae9SGregory Neil Shapiro		used is:
6862e43090eSPeter Wemm
68706f25ae9SGregory Neil Shapiro			hash /etc/mail/mailertable
6882e43090eSPeter Wemm
689c2aa98e2SPeter Wemm		Keys in this database are fully qualified domain names
690c2aa98e2SPeter Wemm		or partial domains preceded by a dot -- for example,
69106f25ae9SGregory Neil Shapiro		"vangogh.CS.Berkeley.EDU" or ".CS.Berkeley.EDU".  As a
69206f25ae9SGregory Neil Shapiro		special case of the latter, "." matches any domain not
69306f25ae9SGregory Neil Shapiro		covered by other keys.  Values must be of the form:
694c2aa98e2SPeter Wemm			mailer:domain
695c2aa98e2SPeter Wemm		where "mailer" is the internal mailer name, and "domain"
696c2aa98e2SPeter Wemm		is where to send the message.  These maps are not
697c2aa98e2SPeter Wemm		reflected into the message header.  As a special case,
698c2aa98e2SPeter Wemm		the forms:
699c2aa98e2SPeter Wemm			local:user
700c2aa98e2SPeter Wemm		will forward to the indicated user using the local mailer,
701c2aa98e2SPeter Wemm			local:
702c2aa98e2SPeter Wemm		will forward to the original user in the e-mail address
703c2aa98e2SPeter Wemm		using the local mailer, and
704c2aa98e2SPeter Wemm			error:code message
70506f25ae9SGregory Neil Shapiro			error:D.S.N:code message
70606f25ae9SGregory Neil Shapiro		will give an error message with the indicated SMTP reply
70706f25ae9SGregory Neil Shapiro		code and message, where D.S.N is an RFC 1893 compliant
70806f25ae9SGregory Neil Shapiro		error code.
709c2aa98e2SPeter Wemm
710c2aa98e2SPeter Wemmdomaintable	Include a "domain table" which can be used to provide
711c2aa98e2SPeter Wemm		domain name mapping.  Use of this should really be
712c2aa98e2SPeter Wemm		limited to your own domains.  It may be useful if you
713c2aa98e2SPeter Wemm		change names (e.g., your company changes names from
714c2aa98e2SPeter Wemm		oldname.com to newname.com).  The argument of the
715c2aa98e2SPeter Wemm		FEATURE may be the key definition.  If none is specified,
716c2aa98e2SPeter Wemm		the definition used is:
7172e43090eSPeter Wemm
71806f25ae9SGregory Neil Shapiro			hash /etc/mail/domaintable
7192e43090eSPeter Wemm
720c2aa98e2SPeter Wemm		The key in this table is the domain name; the value is
721c2aa98e2SPeter Wemm		the new (fully qualified) domain.  Anything in the
722c2aa98e2SPeter Wemm		domaintable is reflected into headers; that is, this
723c2aa98e2SPeter Wemm		is done in ruleset 3.
724c2aa98e2SPeter Wemm
725c2aa98e2SPeter Wemmbitdomain	Look up bitnet hosts in a table to try to turn them into
726c2aa98e2SPeter Wemm		internet addresses.  The table can be built using the
727c2aa98e2SPeter Wemm		bitdomain program contributed by John Gardiner Myers.
728c2aa98e2SPeter Wemm		The argument of the FEATURE may be the key definition; if
729c2aa98e2SPeter Wemm		none is specified, the definition used is:
7302e43090eSPeter Wemm
73106f25ae9SGregory Neil Shapiro			hash /etc/mail/bitdomain
7322e43090eSPeter Wemm
733c2aa98e2SPeter Wemm		Keys are the bitnet hostname; values are the corresponding
734c2aa98e2SPeter Wemm		internet hostname.
735c2aa98e2SPeter Wemm
736c2aa98e2SPeter Wemmuucpdomain	Similar feature for UUCP hosts.  The default map definition
737c2aa98e2SPeter Wemm		is:
7382e43090eSPeter Wemm
73906f25ae9SGregory Neil Shapiro			hash /etc/mail/uudomain
7402e43090eSPeter Wemm
741c2aa98e2SPeter Wemm		At the moment there is no automagic tool to build this
742c2aa98e2SPeter Wemm		database.
743c2aa98e2SPeter Wemm
744c2aa98e2SPeter Wemmalways_add_domain
745c2aa98e2SPeter Wemm		Include the local host domain even on locally delivered
746c2aa98e2SPeter Wemm		mail.  Normally it is not added on unqualified names.
747c2aa98e2SPeter Wemm		However, if you use a shared message store but do not use
748c2aa98e2SPeter Wemm		the same user name space everywhere, you may need the host
749c2aa98e2SPeter Wemm		name on local names.
750c2aa98e2SPeter Wemm
751c2aa98e2SPeter Wemmallmasquerade	If masquerading is enabled (using MASQUERADE_AS), this
752c2aa98e2SPeter Wemm		feature will cause recipient addresses to also masquerade
753c2aa98e2SPeter Wemm		as being from the masquerade host.  Normally they get
754c2aa98e2SPeter Wemm		the local hostname.  Although this may be right for
755c2aa98e2SPeter Wemm		ordinary users, it can break local aliases.  For example,
756c2aa98e2SPeter Wemm		if you send to "localalias", the originating sendmail will
757c2aa98e2SPeter Wemm		find that alias and send to all members, but send the
758c2aa98e2SPeter Wemm		message with "To: localalias@masqueradehost".  Since that
759c2aa98e2SPeter Wemm		alias likely does not exist, replies will fail.  Use this
760c2aa98e2SPeter Wemm		feature ONLY if you can guarantee that the ENTIRE
761c2aa98e2SPeter Wemm		namespace on your masquerade host supersets all the
762c2aa98e2SPeter Wemm		local entries.
763c2aa98e2SPeter Wemm
764c2aa98e2SPeter Wemmlimited_masquerade
76506f25ae9SGregory Neil Shapiro		Normally, any hosts listed in class {w} are masqueraded.  If
76606f25ae9SGregory Neil Shapiro		this feature is given, only the hosts listed in class {M} (see
76706f25ae9SGregory Neil Shapiro		below:  MASQUERADE_DOMAIN) are masqueraded.  This is useful
76806f25ae9SGregory Neil Shapiro		if you have several domains with disjoint namespaces hosted
76906f25ae9SGregory Neil Shapiro		on the same machine.
770c2aa98e2SPeter Wemm
771c2aa98e2SPeter Wemmmasquerade_entire_domain
772c2aa98e2SPeter Wemm		If masquerading is enabled (using MASQUERADE_AS) and
773c2aa98e2SPeter Wemm		MASQUERADE_DOMAIN (see below) is set, this feature will
774c2aa98e2SPeter Wemm		cause addresses to be rewritten such that the masquerading
775c2aa98e2SPeter Wemm		domains are actually entire domains to be hidden.  All
776c2aa98e2SPeter Wemm		hosts within the masquerading domains will be rewritten
777c2aa98e2SPeter Wemm		to the masquerade name (used in MASQUERADE_AS).  For example,
778c2aa98e2SPeter Wemm		if you have:
779c2aa98e2SPeter Wemm
78006f25ae9SGregory Neil Shapiro			MASQUERADE_AS(`masq.com')
78106f25ae9SGregory Neil Shapiro			MASQUERADE_DOMAIN(`foo.org')
78206f25ae9SGregory Neil Shapiro			MASQUERADE_DOMAIN(`bar.com')
783c2aa98e2SPeter Wemm
784c2aa98e2SPeter Wemm		then *foo.org and *bar.com are converted to masq.com.  Without
785c2aa98e2SPeter Wemm		this feature, only foo.org and bar.com are masqueraded.
786c2aa98e2SPeter Wemm
787c2aa98e2SPeter Wemm		    NOTE: only domains within your jurisdiction and
788c2aa98e2SPeter Wemm		    current hierarchy should be masqueraded using this.
789c2aa98e2SPeter Wemm
79006f25ae9SGregory Neil Shapirogenericstable	This feature will cause unqualified addresses (i.e., without
79106f25ae9SGregory Neil Shapiro		a domain) and addresses with a domain listed in class {G}
79206f25ae9SGregory Neil Shapiro		to be looked up in a map and turned into another ("generic")
79306f25ae9SGregory Neil Shapiro		form, which can change both the domain name and the user name.
79406f25ae9SGregory Neil Shapiro		This is similar to the userdb functionality.  The same types of
79506f25ae9SGregory Neil Shapiro		addresses as for masquerading are looked up, i.e., only header
796c2aa98e2SPeter Wemm		sender addresses unless the allmasquerade and/or
797c2aa98e2SPeter Wemm		masquerade_envelope features are given.  Qualified addresses
79806f25ae9SGregory Neil Shapiro		must have the domain part in class {G}; entries can
79906f25ae9SGregory Neil Shapiro		be added to this class by the macros GENERICS_DOMAIN or
80006f25ae9SGregory Neil Shapiro		GENERICS_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
80106f25ae9SGregory Neil Shapiro		MASQUERADE_DOMAIN_FILE, see below).
802c2aa98e2SPeter Wemm
8032e43090eSPeter Wemm		The argument of FEATURE(`genericstable') may be the map
804c2aa98e2SPeter Wemm		definition; the default map definition is:
805c2aa98e2SPeter Wemm
80606f25ae9SGregory Neil Shapiro			hash /etc/mail/genericstable
807c2aa98e2SPeter Wemm
80806f25ae9SGregory Neil Shapiro		The key for this table is either the full address, the domain
80906f25ae9SGregory Neil Shapiro		(with a leading @; the localpart is passed as first argument)
81006f25ae9SGregory Neil Shapiro		or the unqualified username (tried in the order mentioned);
81106f25ae9SGregory Neil Shapiro		the value is the new user address.  If the new user address
81206f25ae9SGregory Neil Shapiro		does not include a domain, it will be qualified in the standard
81306f25ae9SGregory Neil Shapiro		manner, i.e., using $j or the masquerade name.  Note that the
814c2aa98e2SPeter Wemm		address being looked up must be fully qualified.  For local
8152e43090eSPeter Wemm		mail, it is necessary to use FEATURE(`always_add_domain')
8162e43090eSPeter Wemm		for the addresses to be qualified.
81706f25ae9SGregory Neil Shapiro		The "+detail" of an address is passed as %1, so entries like
81806f25ae9SGregory Neil Shapiro
81906f25ae9SGregory Neil Shapiro			old+*@foo.org	new+%1@example.com
82006f25ae9SGregory Neil Shapiro			gen+*@foo.org	%1@example.com
82106f25ae9SGregory Neil Shapiro
82206f25ae9SGregory Neil Shapiro		and other forms are possible.
82306f25ae9SGregory Neil Shapiro
82406f25ae9SGregory Neil Shapirogenerics_entire_domain
82506f25ae9SGregory Neil Shapiro		If the genericstable is enabled and GENERICS_DOMAIN or
82606f25ae9SGregory Neil Shapiro		GENERICS_DOMAIN_FILE is used, this feature will cause
82706f25ae9SGregory Neil Shapiro		addresses to be searched in the map if their domain
82806f25ae9SGregory Neil Shapiro		parts are subdomains of elements in class {G}.
829c2aa98e2SPeter Wemm
830c2aa98e2SPeter Wemmvirtusertable	A domain-specific form of aliasing, allowing multiple
831c2aa98e2SPeter Wemm		virtual domains to be hosted on one machine.  For example,
832c2aa98e2SPeter Wemm		if the virtuser table contained:
833c2aa98e2SPeter Wemm
834c2aa98e2SPeter Wemm			info@foo.com	foo-info
835c2aa98e2SPeter Wemm			info@bar.com	bar-info
83606f25ae9SGregory Neil Shapiro			joe@bar.com	error:nouser No such user here
83706f25ae9SGregory Neil Shapiro			jax@bar.com	error:D.S.N:unavailable Address invalid
83806f25ae9SGregory Neil Shapiro			@baz.org	jane@example.net
839c2aa98e2SPeter Wemm
840c2aa98e2SPeter Wemm		then mail addressed to info@foo.com will be sent to the
841c2aa98e2SPeter Wemm		address foo-info, mail addressed to info@bar.com will be
84206f25ae9SGregory Neil Shapiro		delivered to bar-info, and mail addressed to anyone at baz.org
84306f25ae9SGregory Neil Shapiro		will be sent to jane@example.net, mail to joe@bar.com will
84406f25ae9SGregory Neil Shapiro		be rejected with the specified error message, and mail to
84506f25ae9SGregory Neil Shapiro		jax@bar.com will also have a RFC 1893 compliant error code
84606f25ae9SGregory Neil Shapiro		D.S.N.
847c2aa98e2SPeter Wemm
84806f25ae9SGregory Neil Shapiro		The username from the original address is passed
84906f25ae9SGregory Neil Shapiro		as %1 allowing:
850c2aa98e2SPeter Wemm
85106f25ae9SGregory Neil Shapiro			@foo.org	%1@example.com
85206f25ae9SGregory Neil Shapiro
85306f25ae9SGregory Neil Shapiro		meaning someone@foo.org will be sent to someone@example.com.
85406f25ae9SGregory Neil Shapiro		Additionally, if the local part consists of "user+detail"
85506f25ae9SGregory Neil Shapiro		then "detail" is passed as %2 when a match against user+*
85606f25ae9SGregory Neil Shapiro		is attempted, so entries like
85706f25ae9SGregory Neil Shapiro
85806f25ae9SGregory Neil Shapiro			old+*@foo.org	new+%2@example.com
85906f25ae9SGregory Neil Shapiro			gen+*@foo.org	%2@example.com
86006f25ae9SGregory Neil Shapiro			+*@foo.org	%1+%2@example.com
86106f25ae9SGregory Neil Shapiro
86206f25ae9SGregory Neil Shapiro		and other forms are possible.  Note: to preserve "+detail"
86306f25ae9SGregory Neil Shapiro		for a default case (@domain) +*@domain must be used as
86406f25ae9SGregory Neil Shapiro		exemplified above.
865c2aa98e2SPeter Wemm
866c2aa98e2SPeter Wemm		All the host names on the left hand side (foo.com, bar.com,
86706f25ae9SGregory Neil Shapiro		and baz.org) must be in class {w} or class {VirtHost}, the
86806f25ae9SGregory Neil Shapiro		latter can be defined by the macros VIRTUSER_DOMAIN or
86906f25ae9SGregory Neil Shapiro		VIRTUSER_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
87006f25ae9SGregory Neil Shapiro		MASQUERADE_DOMAIN_FILE, see below).  If VIRTUSER_DOMAIN or
87106f25ae9SGregory Neil Shapiro		VIRTUSER_DOMAIN_FILE is used, then the entries of class
87206f25ae9SGregory Neil Shapiro		{VirtHost} are added to class {R}, i.e., relaying is allowed
87306f25ae9SGregory Neil Shapiro		to (and from) those domains.  The default map definition is:
874c2aa98e2SPeter Wemm
87506f25ae9SGregory Neil Shapiro			hash /etc/mail/virtusertable
876c2aa98e2SPeter Wemm
877c2aa98e2SPeter Wemm		A new definition can be specified as the second argument of
878c2aa98e2SPeter Wemm		the FEATURE macro, such as
879c2aa98e2SPeter Wemm
88006f25ae9SGregory Neil Shapiro			FEATURE(`virtusertable', `dbm /etc/mail/virtusers')
881c2aa98e2SPeter Wemm
88206f25ae9SGregory Neil Shapirovirtuser_entire_domain
88306f25ae9SGregory Neil Shapiro		If the virtusertable is enabled and VIRTUSER_DOMAIN or
88406f25ae9SGregory Neil Shapiro		VIRTUSER_DOMAIN_FILE is used, this feature will cause
88506f25ae9SGregory Neil Shapiro		addresses to be searched in the map if their domain
88606f25ae9SGregory Neil Shapiro		parts are subdomains of elements in class {VirtHost}.
88706f25ae9SGregory Neil Shapiro
88806f25ae9SGregory Neil Shapiroldap_routing	Implement LDAP-based e-mail recipient routing according to
88906f25ae9SGregory Neil Shapiro		the Internet Draft draft-lachman-laser-ldap-mail-routing-01.
89006f25ae9SGregory Neil Shapiro		This provides a method to re-route addresses with a
89106f25ae9SGregory Neil Shapiro		domain portion in class {LDAPRoute} to either a
89206f25ae9SGregory Neil Shapiro		different mail host or a different address.  Hosts can
89306f25ae9SGregory Neil Shapiro		be added to this class using LDAPROUTE_DOMAIN and
89406f25ae9SGregory Neil Shapiro		LDAPROUTE_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
89506f25ae9SGregory Neil Shapiro		MASQUERADE_DOMAIN_FILE, see below).
89606f25ae9SGregory Neil Shapiro
89706f25ae9SGregory Neil Shapiro		See the LDAP ROUTING section below for more information.
89806f25ae9SGregory Neil Shapiro
89906f25ae9SGregory Neil Shapironodns		If you aren't running DNS at your site (for example,
90006f25ae9SGregory Neil Shapiro		you are UUCP-only connected).  It's hard to consider
901c2aa98e2SPeter Wemm		this a "feature", but hey, it had to go somewhere.
902c2aa98e2SPeter Wemm		Actually, as of 8.7 this is a no-op -- remove "dns" from
903c2aa98e2SPeter Wemm		the hosts service switch entry instead.
904c2aa98e2SPeter Wemm
90506f25ae9SGregory Neil Shapironullclient	This is a special case -- it creates a configuration file
90606f25ae9SGregory Neil Shapiro		containing nothing but support for forwarding all mail to a
90706f25ae9SGregory Neil Shapiro		central hub via a local SMTP-based network.  The argument
90806f25ae9SGregory Neil Shapiro		is the name of that hub.
909c2aa98e2SPeter Wemm
910c2aa98e2SPeter Wemm		The only other feature that should be used in conjunction
91106f25ae9SGregory Neil Shapiro		with this one is FEATURE(`nocanonify').  No mailers
912c2aa98e2SPeter Wemm		should be defined.  No aliasing or forwarding is done.
913c2aa98e2SPeter Wemm
914c2aa98e2SPeter Wemmlocal_lmtp	Use an LMTP capable local mailer.  The argument to this
915c2aa98e2SPeter Wemm		feature is the pathname of an LMTP capable mailer.  By
916c2aa98e2SPeter Wemm		default, mail.local is used.  This is expected to be the
917c2aa98e2SPeter Wemm		mail.local which came with the 8.9 distribution which is
918c2aa98e2SPeter Wemm		LMTP capable.  The path to mail.local is set by the
919c2aa98e2SPeter Wemm		confEBINDIR m4 variable -- making the default
920c2aa98e2SPeter Wemm		LOCAL_MAILER_PATH /usr/libexec/mail.local.
92106f25ae9SGregory Neil Shapiro		WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally,
92206f25ae9SGregory Neil Shapiro		i.e., without respecting any definitions in an OSTYPE setting.
923c2aa98e2SPeter Wemm
92406f25ae9SGregory Neil Shapirolocal_procmail	Use procmail or another delivery agent as the local mailer.
92506f25ae9SGregory Neil Shapiro		The argument to this feature is the pathname of the
92606f25ae9SGregory Neil Shapiro		delivery agent, which defaults to PROCMAIL_MAILER_PATH.
92706f25ae9SGregory Neil Shapiro		Note that this does NOT use PROCMAIL_MAILER_FLAGS or
92806f25ae9SGregory Neil Shapiro		PROCMAIL_MAILER_ARGS for the local mailer; tweak
92906f25ae9SGregory Neil Shapiro		LOCAL_MAILER_FLAGS and LOCAL_MAILER_ARGS instead, or
93006f25ae9SGregory Neil Shapiro		specify the appropriate parameters.  When procmail is used,
93106f25ae9SGregory Neil Shapiro		the local mailer can make use of the
93206f25ae9SGregory Neil Shapiro		"user+indicator@local.host" syntax; normally the +indicator
93306f25ae9SGregory Neil Shapiro		is just tossed, but by default it is passed as the -a
93406f25ae9SGregory Neil Shapiro		argument to procmail.
93506f25ae9SGregory Neil Shapiro
93606f25ae9SGregory Neil Shapiro		This feature can take up to three arguments:
93706f25ae9SGregory Neil Shapiro
93806f25ae9SGregory Neil Shapiro		1. Path to the mailer program
93906f25ae9SGregory Neil Shapiro		   [default: /usr/local/bin/procmail]
94006f25ae9SGregory Neil Shapiro		2. Argument vector including name of the program
94106f25ae9SGregory Neil Shapiro		   [default: procmail -Y -a $h -d $u]
94206f25ae9SGregory Neil Shapiro		3. Flags for the mailer [default: SPfhn9]
94306f25ae9SGregory Neil Shapiro
94406f25ae9SGregory Neil Shapiro		Empty arguments cause the defaults to be taken.
94506f25ae9SGregory Neil Shapiro
94606f25ae9SGregory Neil Shapiro		For example, this allows it to use the maildrop
94706f25ae9SGregory Neil Shapiro		(http://www.flounder.net/~mrsam/maildrop/) mailer instead
94806f25ae9SGregory Neil Shapiro		by specifying:
94906f25ae9SGregory Neil Shapiro
95006f25ae9SGregory Neil Shapiro		FEATURE(`local_procmail', `/usr/local/bin/maildrop',
95106f25ae9SGregory Neil Shapiro		 `maildrop -d $u')
95206f25ae9SGregory Neil Shapiro
95306f25ae9SGregory Neil Shapiro		or scanmails using:
95406f25ae9SGregory Neil Shapiro
95506f25ae9SGregory Neil Shapiro		FEATURE(`local_procmail', `/usr/local/bin/scanmails')
95606f25ae9SGregory Neil Shapiro
95706f25ae9SGregory Neil Shapiro		WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally,
95806f25ae9SGregory Neil Shapiro		i.e.,  without respecting any definitions in an OSTYPE setting.
959c2aa98e2SPeter Wemm
960c2aa98e2SPeter Wemmbestmx_is_local	Accept mail as though locally addressed for any host that
961c2aa98e2SPeter Wemm		lists us as the best possible MX record.  This generates
962c2aa98e2SPeter Wemm		additional DNS traffic, but should be OK for low to
963c2aa98e2SPeter Wemm		medium traffic hosts.  The argument may be a set of
964c2aa98e2SPeter Wemm		domains, which will limit the feature to only apply to
965c2aa98e2SPeter Wemm		these domains -- this will reduce unnecessary DNS
966c2aa98e2SPeter Wemm		traffic.  THIS FEATURE IS FUNDAMENTALLY INCOMPATIBLE WITH
967c2aa98e2SPeter Wemm		WILDCARD MX RECORDS!!!  If you have a wildcard MX record
968c2aa98e2SPeter Wemm		that matches your domain, you cannot use this feature.
969c2aa98e2SPeter Wemm
970c2aa98e2SPeter Wemmsmrsh		Use the SendMail Restricted SHell (smrsh) provided
971c2aa98e2SPeter Wemm		with the distribution instead of /bin/sh for mailing
972c2aa98e2SPeter Wemm		to programs.  This improves the ability of the local
973c2aa98e2SPeter Wemm		system administrator to control what gets run via
974c2aa98e2SPeter Wemm		e-mail.  If an argument is provided it is used as the
975c2aa98e2SPeter Wemm		pathname to smrsh; otherwise, the path defined by
976c2aa98e2SPeter Wemm		confEBINDIR is used for the smrsh binary -- by default,
977c2aa98e2SPeter Wemm		/usr/libexec/smrsh is assumed.
978c2aa98e2SPeter Wemm
979c2aa98e2SPeter Wemmpromiscuous_relay
980c2aa98e2SPeter Wemm		By default, the sendmail configuration files do not permit
981c2aa98e2SPeter Wemm		mail relaying (that is, accepting mail from outside your
98206f25ae9SGregory Neil Shapiro		local host (class {w}) and sending it to another host than
98306f25ae9SGregory Neil Shapiro		your local host).  This option sets your site to allow
98406f25ae9SGregory Neil Shapiro		mail relaying from any site to any site.  In almost all
98506f25ae9SGregory Neil Shapiro		cases, it is better to control relaying more carefully
98606f25ae9SGregory Neil Shapiro		with the access map, class {R}, or authentication.  Domains
98706f25ae9SGregory Neil Shapiro		can be added to class {R} by the macros RELAY_DOMAIN or
98806f25ae9SGregory Neil Shapiro		RELAY_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
98906f25ae9SGregory Neil Shapiro		MASQUERADE_DOMAIN_FILE, see below).
990c2aa98e2SPeter Wemm
991c2aa98e2SPeter Wemmrelay_entire_domain
992c2aa98e2SPeter Wemm		By default, only hosts listed as RELAY in the access db
993c2aa98e2SPeter Wemm		will be allowed to relay.  This option also allows any
99406f25ae9SGregory Neil Shapiro		host in your domain as defined by class {m}.
995c2aa98e2SPeter Wemm
996c2aa98e2SPeter Wemmrelay_hosts_only
997c2aa98e2SPeter Wemm		By default, names that are listed as RELAY in the access
99806f25ae9SGregory Neil Shapiro		db and class {R} are domain names, not host names.
999c2aa98e2SPeter Wemm		For example, if you specify ``foo.com'', then mail to or
1000c2aa98e2SPeter Wemm		from foo.com, abc.foo.com, or a.very.deep.domain.foo.com
1001c2aa98e2SPeter Wemm		will all be accepted for relaying.  This feature changes
1002c2aa98e2SPeter Wemm		the behaviour to lookup individual host names only.
1003c2aa98e2SPeter Wemm
1004c2aa98e2SPeter Wemmrelay_based_on_MX
1005c2aa98e2SPeter Wemm		Turns on the ability to allow relaying based on the MX
1006065a643dSPeter Wemm		records of the host portion of an incoming recipient; that
1007065a643dSPeter Wemm		is, if an MX record for host foo.com points to your site,
1008065a643dSPeter Wemm		you will accept and relay mail addressed to foo.com.  See
1009c2aa98e2SPeter Wemm		description below for more information before using this
1010065a643dSPeter Wemm		feature.  Also, see the KNOWNBUGS entry regarding bestmx
1011065a643dSPeter Wemm		map lookups.
1012065a643dSPeter Wemm
10132e43090eSPeter Wemm		FEATURE(`relay_based_on_MX') does not necessarily allow
1014065a643dSPeter Wemm		routing of these messages which you expect to be allowed,
1015065a643dSPeter Wemm		if route address syntax (or %-hack syntax) is used.  If
1016065a643dSPeter Wemm		this is a problem, add entries to the access-table or use
10172e43090eSPeter Wemm		FEATURE(`loose_relay_check').
1018c2aa98e2SPeter Wemm
101906f25ae9SGregory Neil Shapirorelay_mail_from
102006f25ae9SGregory Neil Shapiro		Allows relaying if the mail sender is listed as RELAY in
102106f25ae9SGregory Neil Shapiro		the access map.  If an optional argument `domain' is given,
102206f25ae9SGregory Neil Shapiro		the domain portion of the mail sender is checked too.
102306f25ae9SGregory Neil Shapiro		This should only be used if absolutely necessary as the
102406f25ae9SGregory Neil Shapiro		sender address can be easily forged.  Use of this feature
102506f25ae9SGregory Neil Shapiro		requires the "From:" tag be prepended to the key in the
102606f25ae9SGregory Neil Shapiro		access map; see the discussion of tags and
102706f25ae9SGregory Neil Shapiro		FEATURE(`relay_mail_from') in the section on ANTI-SPAM
102806f25ae9SGregory Neil Shapiro		CONFIGURATION CONTROL.
102906f25ae9SGregory Neil Shapiro
1030c2aa98e2SPeter Wemmrelay_local_from
1031c2aa98e2SPeter Wemm		Allows relaying if the domain portion of the mail sender
1032c2aa98e2SPeter Wemm		is a local host.  This should only be used if absolutely
1033065a643dSPeter Wemm		necessary as it opens a window for spammers.  Specifically,
1034065a643dSPeter Wemm		they can send mail to your mail server that claims to be
1035065a643dSPeter Wemm		from your domain (either directly or via a routed address),
1036065a643dSPeter Wemm		and you will go ahead and relay it out to arbitrary hosts
1037065a643dSPeter Wemm		on the Internet.
1038c2aa98e2SPeter Wemm
1039c2aa98e2SPeter Wemmaccept_unqualified_senders
1040c2aa98e2SPeter Wemm		Normally, MAIL FROM: commands in the SMTP session will be
1041c2aa98e2SPeter Wemm		refused if the connection is a network connection and the
1042c2aa98e2SPeter Wemm		sender address does not include a domain name.  If your
104306f25ae9SGregory Neil Shapiro		setup sends local mail unqualified (i.e., MAIL FROM: <joe>),
1044c2aa98e2SPeter Wemm		you will need to use this feature to accept unqualified
104506f25ae9SGregory Neil Shapiro		sender addresses.  Setting the DaemonPortOptions modifier
104606f25ae9SGregory Neil Shapiro		'u' overrides the default behavior, i.e., unqualified
104706f25ae9SGregory Neil Shapiro		addresses are accepted even without this FEATURE.
104806f25ae9SGregory Neil Shapiro		If this FEATURE is not used, the DaemonPortOptions modifier
104906f25ae9SGregory Neil Shapiro		'f' can be used to enforce fully qualified addresses.
1050c2aa98e2SPeter Wemm
1051c2aa98e2SPeter Wemmaccept_unresolvable_domains
1052c2aa98e2SPeter Wemm		Normally, MAIL FROM: commands in the SMTP session will be
105306f25ae9SGregory Neil Shapiro		refused if the host part of the argument to MAIL FROM:
105406f25ae9SGregory Neil Shapiro		cannot be located in the host name service (e.g., an A or
105506f25ae9SGregory Neil Shapiro		MX record in DNS).  If you are inside a firewall that has
105606f25ae9SGregory Neil Shapiro		only a limited view of the Internet host name space, this
105706f25ae9SGregory Neil Shapiro		could cause problems.  In this case you probably want to
105806f25ae9SGregory Neil Shapiro		use this feature to accept all domains on input, even if
105906f25ae9SGregory Neil Shapiro		they are unresolvable.
1060c2aa98e2SPeter Wemm
1061c2aa98e2SPeter Wemmaccess_db	Turns on the access database feature.  The access db gives
1062c2aa98e2SPeter Wemm		you the ability to allow or refuse to accept mail from
1063c2aa98e2SPeter Wemm		specified domains for administrative reasons.  By default,
10642e43090eSPeter Wemm		the access database specification is:
10652e43090eSPeter Wemm
106606f25ae9SGregory Neil Shapiro			hash /etc/mail/access
10672e43090eSPeter Wemm
106806f25ae9SGregory Neil Shapiro		The format of the database is described in the anti-spam
106906f25ae9SGregory Neil Shapiro		configuration control section later in this document.
1070c2aa98e2SPeter Wemm
1071c2aa98e2SPeter Wemmblacklist_recipients
1072c2aa98e2SPeter Wemm		Turns on the ability to block incoming mail for certain
1073c2aa98e2SPeter Wemm		recipient usernames, hostnames, or addresses.  For
1074c2aa98e2SPeter Wemm		example, you can block incoming mail to user nobody,
1075c2aa98e2SPeter Wemm		host foo.mydomain.com, or guest@bar.mydomain.com.
1076c2aa98e2SPeter Wemm		These specifications are put in the access db as
107706f25ae9SGregory Neil Shapiro		described in the anti-spam configuration control section
107806f25ae9SGregory Neil Shapiro		later in this document.
1079c2aa98e2SPeter Wemm
1080193538b7SGregory Neil Shapirodelay_checks	The rulesets check_mail and check_relay will not be called
1081193538b7SGregory Neil Shapiro		when a client connects or issues a MAIL command, respectively.
1082193538b7SGregory Neil Shapiro		Instead, those rulesets will be called by the check_rcpt
1083193538b7SGregory Neil Shapiro		ruleset; they will be skipped under certain circumstances.
1084193538b7SGregory Neil Shapiro		See "Delay all checks" in "ANTI-SPAM CONFIGURATION CONTROL".
1085193538b7SGregory Neil Shapiro
108606f25ae9SGregory Neil Shapirorbl		This feature is deprecated! Please use dnsbl instead.
108706f25ae9SGregory Neil Shapiro		Turns on rejection of hosts found in the Realtime Blackhole
108806f25ae9SGregory Neil Shapiro		List.  If an argument is provided it is used as the domain
108906f25ae9SGregory Neil Shapiro		in which blocked hosts are listed; otherwise, the main
109006f25ae9SGregory Neil Shapiro		RBL domain rbl.maps.vix.com is used.  For details, see
1091c2aa98e2SPeter Wemm		http://maps.vix.com/rbl/.
1092c2aa98e2SPeter Wemm
109306f25ae9SGregory Neil Shapirodnsbl		Turns on rejection of hosts found in an DNS based rejection
109406f25ae9SGregory Neil Shapiro		list.  If an argument is provided it is used as the domain
109506f25ae9SGregory Neil Shapiro		in which blocked hosts are listed; otherwise it defaults to
1096193538b7SGregory Neil Shapiro		blackholes.mail-abuse.org.  An explanation for an DNS based
1097193538b7SGregory Neil Shapiro		rejection list can be found http://mail-abuse.org/rbl/.  A
1098193538b7SGregory Neil Shapiro		second argument can be used to change the default error
1099193538b7SGregory Neil Shapiro		message of Mail from $&{client_addr} refused by blackhole site
1100193538b7SGregory Neil Shapiro		SERVER where SERVER is replaced by the first argument.  This
1101193538b7SGregory Neil Shapiro		feature can be included several times to query different DNS
1102193538b7SGregory Neil Shapiro		based rejection lists.
110306f25ae9SGregory Neil Shapiro
1104c2aa98e2SPeter Wemmloose_relay_check
110506f25ae9SGregory Neil Shapiro		Normally, if % addressing is used for a recipient, e.g.
110606f25ae9SGregory Neil Shapiro		user%site@othersite, and othersite is in class {R}, the
1107c2aa98e2SPeter Wemm		check_rcpt ruleset will strip @othersite and recheck
1108c2aa98e2SPeter Wemm		user@site for relaying.  This feature changes that
1109c2aa98e2SPeter Wemm		behavior.  It should not be needed for most installations.
1110c2aa98e2SPeter Wemm
111106f25ae9SGregory Neil Shapirono_default_msa	Don't generate the default MSA daemon, i.e.,
111206f25ae9SGregory Neil Shapiro		DAEMON_OPTIONS(`Port=587,Name=MSA,M=E')
111306f25ae9SGregory Neil Shapiro		To define a MSA daemon with other parameters, use this
111406f25ae9SGregory Neil Shapiro		FEATURE and introduce new settings via DAEMON_OPTIONS().
1115c2aa98e2SPeter Wemm
1116c2aa98e2SPeter Wemm+-------+
1117c2aa98e2SPeter Wemm| HACKS |
1118c2aa98e2SPeter Wemm+-------+
1119c2aa98e2SPeter Wemm
1120c2aa98e2SPeter WemmSome things just can't be called features.  To make this clear,
1121c2aa98e2SPeter Wemmthey go in the hack subdirectory and are referenced using the HACK
1122c2aa98e2SPeter Wemmmacro.  These will tend to be site-dependent.  The release
1123c2aa98e2SPeter Wemmincludes the Berkeley-dependent "cssubdomain" hack (that makes
1124c2aa98e2SPeter Wemmsendmail accept local names in either Berkeley.EDU or CS.Berkeley.EDU;
112506f25ae9SGregory Neil Shapirothis is intended as a short-term aid while moving hosts into
1126c2aa98e2SPeter Wemmsubdomains.
1127c2aa98e2SPeter Wemm
1128c2aa98e2SPeter Wemm
1129c2aa98e2SPeter Wemm+--------------------+
1130c2aa98e2SPeter Wemm| SITE CONFIGURATION |
1131c2aa98e2SPeter Wemm+--------------------+
1132c2aa98e2SPeter Wemm
1133c2aa98e2SPeter Wemm    *****************************************************
1134c2aa98e2SPeter Wemm    * This section is really obsolete, and is preserved	*
1135c2aa98e2SPeter Wemm    * only for back compatibility.  You should plan on	*
1136c2aa98e2SPeter Wemm    * using mailertables for new installations.	  In	*
1137c2aa98e2SPeter Wemm    * particular, it doesn't work for the newer forms	*
1138c2aa98e2SPeter Wemm    * of UUCP mailers, such as uucp-uudom.		*
1139c2aa98e2SPeter Wemm    *****************************************************
1140c2aa98e2SPeter Wemm
1141c2aa98e2SPeter WemmComplex sites will need more local configuration information, such as
1142c2aa98e2SPeter Wemmlists of UUCP hosts they speak with directly.  This can get a bit more
1143c2aa98e2SPeter Wemmtricky.  For an example of a "complex" site, see cf/ucbvax.mc.
1144c2aa98e2SPeter Wemm
1145c2aa98e2SPeter WemmThe SITECONFIG macro allows you to indirectly reference site-dependent
1146c2aa98e2SPeter Wemmconfiguration information stored in the siteconfig subdirectory.  For
1147c2aa98e2SPeter Wemmexample, the line
1148c2aa98e2SPeter Wemm
114906f25ae9SGregory Neil Shapiro	SITECONFIG(`uucp.ucbvax', `ucbvax', `U')
1150c2aa98e2SPeter Wemm
1151c2aa98e2SPeter Wemmreads the file uucp.ucbvax for local connection information.  The
1152c2aa98e2SPeter Wemmsecond parameter is the local name (in this case just "ucbvax" since
1153c2aa98e2SPeter Wemmit is locally connected, and hence a UUCP hostname).  The third
1154c2aa98e2SPeter Wemmparameter is the name of both a macro to store the local name (in
115506f25ae9SGregory Neil Shapirothis case, {U}) and the name of the class (e.g., {U}) in which to store
1156c2aa98e2SPeter Wemmthe host information read from the file.  Another SITECONFIG line reads
1157c2aa98e2SPeter Wemm
115806f25ae9SGregory Neil Shapiro	SITECONFIG(`uucp.ucbarpa', `ucbarpa.Berkeley.EDU', `W')
1159c2aa98e2SPeter Wemm
1160c2aa98e2SPeter WemmThis says that the file uucp.ucbarpa contains the list of UUCP sites
116106f25ae9SGregory Neil Shapiroconnected to ucbarpa.Berkeley.EDU.  Class {W} will be used to
1162c2aa98e2SPeter Wemmstore this list, and $W is defined to be ucbarpa.Berkeley.EDU, that
1163c2aa98e2SPeter Wemmis, the name of the relay to which the hosts listed in uucp.ucbarpa
116406f25ae9SGregory Neil Shapiroare connected.  [The machine ucbarpa is gone now, but this
116506f25ae9SGregory Neil Shapiroout-of-date configuration file has been left around to demonstrate
116606f25ae9SGregory Neil Shapirohow you might do this.]
1167c2aa98e2SPeter Wemm
1168c2aa98e2SPeter WemmNote that the case of SITECONFIG with a third parameter of ``U'' is
1169c2aa98e2SPeter Wemmspecial; the second parameter is assumed to be the UUCP name of the
1170c2aa98e2SPeter Wemmlocal site, rather than the name of a remote site, and the UUCP name
117106f25ae9SGregory Neil Shapirois entered into class {w} (the list of local hostnames) as $U.UUCP.
1172c2aa98e2SPeter Wemm
1173c2aa98e2SPeter WemmThe siteconfig file (e.g., siteconfig/uucp.ucbvax.m4) contains nothing
1174c2aa98e2SPeter Wemmmore than a sequence of SITE macros describing connectivity.  For
1175c2aa98e2SPeter Wemmexample:
1176c2aa98e2SPeter Wemm
117706f25ae9SGregory Neil Shapiro	SITE(`cnmat')
117806f25ae9SGregory Neil Shapiro	SITE(`sgi olympus')
1179c2aa98e2SPeter Wemm
1180c2aa98e2SPeter WemmThe second example demonstrates that you can use two names on the
1181c2aa98e2SPeter Wemmsame line; these are usually aliases for the same host (or are at
1182c2aa98e2SPeter Wemmleast in the same company).
1183c2aa98e2SPeter Wemm
1184c2aa98e2SPeter Wemm
1185c2aa98e2SPeter Wemm+--------------------+
1186c2aa98e2SPeter Wemm| USING UUCP MAILERS |
1187c2aa98e2SPeter Wemm+--------------------+
1188c2aa98e2SPeter Wemm
1189c2aa98e2SPeter WemmIt's hard to get UUCP mailers right because of the extremely ad hoc
1190c2aa98e2SPeter Wemmnature of UUCP addressing.  These config files are really designed
1191c2aa98e2SPeter Wemmfor domain-based addressing, even for UUCP sites.
1192c2aa98e2SPeter Wemm
1193c2aa98e2SPeter WemmThere are four UUCP mailers available.  The choice of which one to
1194c2aa98e2SPeter Wemmuse is partly a matter of local preferences and what is running at
1195c2aa98e2SPeter Wemmthe other end of your UUCP connection.  Unlike good protocols that
1196c2aa98e2SPeter Wemmdefine what will go over the wire, UUCP uses the policy that you
1197c2aa98e2SPeter Wemmshould do what is right for the other end; if they change, you have
1198c2aa98e2SPeter Wemmto change.  This makes it hard to do the right thing, and discourages
1199c2aa98e2SPeter Wemmpeople from updating their software.  In general, if you can avoid
1200c2aa98e2SPeter WemmUUCP, please do.
1201c2aa98e2SPeter Wemm
1202c2aa98e2SPeter WemmThe major choice is whether to go for a domainized scheme or a
1203c2aa98e2SPeter Wemmnon-domainized scheme.  This depends entirely on what the other
1204c2aa98e2SPeter Wemmend will recognize.  If at all possible, you should encourage the
1205c2aa98e2SPeter Wemmother end to go to a domain-based system -- non-domainized addresses
1206c2aa98e2SPeter Wemmdon't work entirely properly.
1207c2aa98e2SPeter Wemm
1208c2aa98e2SPeter WemmThe four mailers are:
1209c2aa98e2SPeter Wemm
1210c2aa98e2SPeter Wemm    uucp-old (obsolete name: "uucp")
1211c2aa98e2SPeter Wemm	This is the oldest, the worst (but the closest to UUCP) way of
1212c2aa98e2SPeter Wemm	sending messages accros UUCP connections.  It does bangify
1213c2aa98e2SPeter Wemm	everything and prepends $U (your UUCP name) to the sender's
1214c2aa98e2SPeter Wemm	address (which can already be a bang path itself).  It can
1215c2aa98e2SPeter Wemm	only send to one address at a time, so it spends a lot of
1216c2aa98e2SPeter Wemm	time copying duplicates of messages.  Avoid this if at all
1217c2aa98e2SPeter Wemm	possible.
1218c2aa98e2SPeter Wemm
1219c2aa98e2SPeter Wemm    uucp-new (obsolete name: "suucp")
1220c2aa98e2SPeter Wemm	The same as above, except that it assumes that in one rmail
1221c2aa98e2SPeter Wemm	command you can specify several recipients.  It still has a
1222c2aa98e2SPeter Wemm	lot of other problems.
1223c2aa98e2SPeter Wemm
1224c2aa98e2SPeter Wemm    uucp-dom
1225c2aa98e2SPeter Wemm	This UUCP mailer keeps everything as domain addresses.
1226c2aa98e2SPeter Wemm	Basically, it uses the SMTP mailer rewriting rules.  This mailer
122706f25ae9SGregory Neil Shapiro	is only included if MAILER(`smtp') is also specified.
1228c2aa98e2SPeter Wemm
1229c2aa98e2SPeter Wemm	Unfortunately, a lot of UUCP mailer transport agents require
1230c2aa98e2SPeter Wemm	bangified addresses in the envelope, although you can use
1231c2aa98e2SPeter Wemm	domain-based addresses in the message header.  (The envelope
1232c2aa98e2SPeter Wemm	shows up as the From_ line on UNIX mail.)  So....
1233c2aa98e2SPeter Wemm
1234c2aa98e2SPeter Wemm    uucp-uudom
1235c2aa98e2SPeter Wemm	This is a cross between uucp-new (for the envelope addresses)
1236c2aa98e2SPeter Wemm	and uucp-dom (for the header addresses).  It bangifies the
1237c2aa98e2SPeter Wemm	envelope sender (From_ line in messages) without adding the
1238c2aa98e2SPeter Wemm	local hostname, unless there is no host name on the address
1239c2aa98e2SPeter Wemm	at all (e.g., "wolf") or the host component is a UUCP host name
1240c2aa98e2SPeter Wemm	instead of a domain name ("somehost!wolf" instead of
124106f25ae9SGregory Neil Shapiro	"some.dom.ain!wolf").  This is also included only if MAILER(`smtp')
1242c2aa98e2SPeter Wemm	is also specified.
1243c2aa98e2SPeter Wemm
1244c2aa98e2SPeter WemmExamples:
1245c2aa98e2SPeter Wemm
124606f25ae9SGregory Neil ShapiroOn host grasp.insa-lyon.fr (UUCP host name "grasp"), the following
124706f25ae9SGregory Neil Shapirosummarizes the sender rewriting for various mailers.
1248c2aa98e2SPeter Wemm
1249c2aa98e2SPeter WemmMailer		sender		rewriting in the envelope
1250c2aa98e2SPeter Wemm------		------		-------------------------
1251c2aa98e2SPeter Wemmuucp-{old,new}	wolf		grasp!wolf
1252c2aa98e2SPeter Wemmuucp-dom	wolf		wolf@grasp.insa-lyon.fr
1253c2aa98e2SPeter Wemmuucp-uudom	wolf		grasp.insa-lyon.fr!wolf
1254c2aa98e2SPeter Wemm
1255c2aa98e2SPeter Wemmuucp-{old,new}	wolf@fr.net	grasp!fr.net!wolf
1256c2aa98e2SPeter Wemmuucp-dom	wolf@fr.net	wolf@fr.net
1257c2aa98e2SPeter Wemmuucp-uudom	wolf@fr.net	fr.net!wolf
1258c2aa98e2SPeter Wemm
1259c2aa98e2SPeter Wemmuucp-{old,new}	somehost!wolf	grasp!somehost!wolf
1260c2aa98e2SPeter Wemmuucp-dom	somehost!wolf	somehost!wolf@grasp.insa-lyon.fr
1261c2aa98e2SPeter Wemmuucp-uudom	somehost!wolf	grasp.insa-lyon.fr!somehost!wolf
1262c2aa98e2SPeter Wemm
1263c2aa98e2SPeter WemmIf you are using one of the domainized UUCP mailers, you really want
1264c2aa98e2SPeter Wemmto convert all UUCP addresses to domain format -- otherwise, it will
1265c2aa98e2SPeter Wemmdo it for you (and probably not the way you expected).  For example,
1266c2aa98e2SPeter Wemmif you have the address foo!bar!baz (and you are not sending to foo),
1267c2aa98e2SPeter Wemmthe heuristics will add the @uucp.relay.name or @local.host.name to
1268c2aa98e2SPeter Wemmthis address.  However, if you map foo to foo.host.name first, it
1269c2aa98e2SPeter Wemmwill not add the local hostname.  You can do this using the uucpdomain
1270c2aa98e2SPeter Wemmfeature.
1271c2aa98e2SPeter Wemm
1272c2aa98e2SPeter Wemm
1273c2aa98e2SPeter Wemm+-------------------+
1274c2aa98e2SPeter Wemm| TWEAKING RULESETS |
1275c2aa98e2SPeter Wemm+-------------------+
1276c2aa98e2SPeter Wemm
1277c2aa98e2SPeter WemmFor more complex configurations, you can define special rules.
1278c2aa98e2SPeter WemmThe macro LOCAL_RULE_3 introduces rules that are used in canonicalizing
1279c2aa98e2SPeter Wemmthe names.  Any modifications made here are reflected in the header.
1280c2aa98e2SPeter Wemm
1281c2aa98e2SPeter WemmA common use is to convert old UUCP addresses to SMTP addresses using
1282c2aa98e2SPeter Wemmthe UUCPSMTP macro.  For example:
1283c2aa98e2SPeter Wemm
1284c2aa98e2SPeter Wemm	LOCAL_RULE_3
128506f25ae9SGregory Neil Shapiro	UUCPSMTP(`decvax',	`decvax.dec.com')
128606f25ae9SGregory Neil Shapiro	UUCPSMTP(`research',	`research.att.com')
1287c2aa98e2SPeter Wemm
1288c2aa98e2SPeter Wemmwill cause addresses of the form "decvax!user" and "research!user"
1289c2aa98e2SPeter Wemmto be converted to "user@decvax.dec.com" and "user@research.att.com"
1290c2aa98e2SPeter Wemmrespectively.
1291c2aa98e2SPeter Wemm
1292c2aa98e2SPeter WemmThis could also be used to look up hosts in a database map:
1293c2aa98e2SPeter Wemm
1294c2aa98e2SPeter Wemm	LOCAL_RULE_3
1295c2aa98e2SPeter Wemm	R$* < @ $+ > $*		$: $1 < @ $(hostmap $2 $) > $3
1296c2aa98e2SPeter Wemm
1297c2aa98e2SPeter WemmThis map would be defined in the LOCAL_CONFIG portion, as shown below.
1298c2aa98e2SPeter Wemm
1299c2aa98e2SPeter WemmSimilarly, LOCAL_RULE_0 can be used to introduce new parsing rules.
1300c2aa98e2SPeter WemmFor example, new rules are needed to parse hostnames that you accept
1301c2aa98e2SPeter Wemmvia MX records.  For example, you might have:
1302c2aa98e2SPeter Wemm
1303c2aa98e2SPeter Wemm	LOCAL_RULE_0
1304c2aa98e2SPeter Wemm	R$+ <@ host.dom.ain.>	$#uucp $@ cnmat $: $1 < @ host.dom.ain.>
1305c2aa98e2SPeter Wemm
1306c2aa98e2SPeter WemmYou would use this if you had installed an MX record for cnmat.Berkeley.EDU
1307c2aa98e2SPeter Wemmpointing at this host; this rule catches the message and forwards it on
1308c2aa98e2SPeter Wemmusing UUCP.
1309c2aa98e2SPeter Wemm
1310c2aa98e2SPeter WemmYou can also tweak rulesets 1 and 2 using LOCAL_RULE_1 and LOCAL_RULE_2.
1311c2aa98e2SPeter WemmThese rulesets are normally empty.
1312c2aa98e2SPeter Wemm
1313c2aa98e2SPeter WemmA similar macro is LOCAL_CONFIG.  This introduces lines added after the
131406f25ae9SGregory Neil Shapiroboilerplate option setting but before rulesets.  Do not declare rulesets in
131506f25ae9SGregory Neil Shapirothe LOCAL_CONFIG section.  It can be used to declare local database maps or
131606f25ae9SGregory Neil Shapirowhatever.  For example:
1317c2aa98e2SPeter Wemm
1318c2aa98e2SPeter Wemm	LOCAL_CONFIG
131906f25ae9SGregory Neil Shapiro	Khostmap hash /etc/mail/hostmap
1320c2aa98e2SPeter Wemm	Kyplocal nis -m hosts.byname
1321c2aa98e2SPeter Wemm
1322c2aa98e2SPeter Wemm
1323c2aa98e2SPeter Wemm+---------------------------+
1324c2aa98e2SPeter Wemm| MASQUERADING AND RELAYING |
1325c2aa98e2SPeter Wemm+---------------------------+
1326c2aa98e2SPeter Wemm
1327c2aa98e2SPeter WemmYou can have your host masquerade as another using
1328c2aa98e2SPeter Wemm
132906f25ae9SGregory Neil Shapiro	MASQUERADE_AS(`host.domain')
1330c2aa98e2SPeter Wemm
1331c2aa98e2SPeter WemmThis causes mail being sent to be labeled as coming from the
1332c2aa98e2SPeter Wemmindicated host.domain, rather than $j.  One normally masquerades as
133306f25ae9SGregory Neil Shapiroone of one's own subdomains (for example, it's unlikely that
133406f25ae9SGregory Neil ShapiroBerkeley would choose to masquerade as an MIT site).  This
133506f25ae9SGregory Neil Shapirobehaviour is modified by a plethora of FEATUREs; in particular, see
133606f25ae9SGregory Neil Shapiromasquerade_envelope, allmasquerade, limited_masquerade, and
133706f25ae9SGregory Neil Shapiromasquerade_entire_domain.
1338c2aa98e2SPeter Wemm
1339c2aa98e2SPeter WemmThe masquerade name is not normally canonified, so it is important
1340c2aa98e2SPeter Wemmthat it be your One True Name, that is, fully qualified and not a
1341c2aa98e2SPeter WemmCNAME.  However, if you use a CNAME, the receiving side may canonify
1342c2aa98e2SPeter Wemmit for you, so don't think you can cheat CNAME mapping this way.
1343c2aa98e2SPeter Wemm
1344c2aa98e2SPeter WemmNormally the only addresses that are masqueraded are those that come
134506f25ae9SGregory Neil Shapirofrom this host (that is, are either unqualified or in class {w}, the list
134606f25ae9SGregory Neil Shapiroof local domain names).  You can augment this list, which is realized
134706f25ae9SGregory Neil Shapiroby class {M} using
1348c2aa98e2SPeter Wemm
134906f25ae9SGregory Neil Shapiro	MASQUERADE_DOMAIN(`otherhost.domain')
1350c2aa98e2SPeter Wemm
1351c2aa98e2SPeter WemmThe effect of this is that although mail to user@otherhost.domain
1352c2aa98e2SPeter Wemmwill not be delivered locally, any mail including any user@otherhost.domain
1353c2aa98e2SPeter Wemmwill, when relayed, be rewritten to have the MASQUERADE_AS address.
1354c2aa98e2SPeter WemmThis can be a space-separated list of names.
1355c2aa98e2SPeter Wemm
1356c2aa98e2SPeter WemmIf these names are in a file, you can use
1357c2aa98e2SPeter Wemm
135806f25ae9SGregory Neil Shapiro	MASQUERADE_DOMAIN_FILE(`filename')
1359c2aa98e2SPeter Wemm
136006f25ae9SGregory Neil Shapiroto read the list of names from the indicated file (i.e., to add
136106f25ae9SGregory Neil Shapiroelements to class {M}).
136206f25ae9SGregory Neil Shapiro
136306f25ae9SGregory Neil ShapiroTo exempt hosts or subdomains from being masqueraded, you can use
136406f25ae9SGregory Neil Shapiro
136506f25ae9SGregory Neil Shapiro	MASQUERADE_EXCEPTION(`host.domain')
136606f25ae9SGregory Neil Shapiro
136706f25ae9SGregory Neil ShapiroThis can come handy if you want to masquerade a whole domain
136806f25ae9SGregory Neil Shapiroexcept for one (or a few) host(s).
1369c2aa98e2SPeter Wemm
1370c2aa98e2SPeter WemmNormally only header addresses are masqueraded.  If you want to
1371c2aa98e2SPeter Wemmmasquerade the envelope as well, use
1372c2aa98e2SPeter Wemm
13732e43090eSPeter Wemm	FEATURE(`masquerade_envelope')
1374c2aa98e2SPeter Wemm
1375c2aa98e2SPeter WemmThere are always users that need to be "exposed" -- that is, their
1376c2aa98e2SPeter Wemminternal site name should be displayed instead of the masquerade name.
137706f25ae9SGregory Neil ShapiroRoot is an example (which has been "exposed" by default prior to 8.10).
137806f25ae9SGregory Neil ShapiroYou can add users to this list using
1379c2aa98e2SPeter Wemm
138006f25ae9SGregory Neil Shapiro	EXPOSED_USER(`usernames')
1381c2aa98e2SPeter Wemm
138206f25ae9SGregory Neil ShapiroThis adds users to class {E}; you could also use something like
1383c2aa98e2SPeter Wemm
138406f25ae9SGregory Neil Shapiro	FE/etc/mail/exposed-users
1385c2aa98e2SPeter Wemm
1386c2aa98e2SPeter WemmYou can also arrange to relay all unqualified names (that is, names
1387c2aa98e2SPeter Wemmwithout @host) to a relay host.  For example, if you have a central
1388c2aa98e2SPeter Wemmemail server, you might relay to that host so that users don't have
1389c2aa98e2SPeter Wemmto have .forward files or aliases.  You can do this using
1390c2aa98e2SPeter Wemm
13912e43090eSPeter Wemm	define(`LOCAL_RELAY', `mailer:hostname')
1392c2aa98e2SPeter Wemm
1393c2aa98e2SPeter WemmThe ``mailer:'' can be omitted, in which case the mailer defaults to
1394c2aa98e2SPeter Wemm"relay".  There are some user names that you don't want relayed, perhaps
1395c2aa98e2SPeter Wemmbecause of local aliases.  A common example is root, which may be
1396c2aa98e2SPeter Wemmlocally aliased.  You can add entries to this list using
1397c2aa98e2SPeter Wemm
139806f25ae9SGregory Neil Shapiro	LOCAL_USER(`usernames')
1399c2aa98e2SPeter Wemm
140006f25ae9SGregory Neil ShapiroThis adds users to class {L}; you could also use something like
1401c2aa98e2SPeter Wemm
140206f25ae9SGregory Neil Shapiro	FL/etc/mail/local-users
1403c2aa98e2SPeter Wemm
1404c2aa98e2SPeter WemmIf you want all incoming mail sent to a centralized hub, as for a
1405c2aa98e2SPeter Wemmshared /var/spool/mail scheme, use
1406c2aa98e2SPeter Wemm
14072e43090eSPeter Wemm	define(`MAIL_HUB', `mailer:hostname')
1408c2aa98e2SPeter Wemm
1409c2aa98e2SPeter WemmAgain, ``mailer:'' defaults to "relay".  If you define both LOCAL_RELAY
14102e43090eSPeter Wemmand MAIL_HUB _AND_ you have FEATURE(`stickyhost'), unqualified names will
1411c2aa98e2SPeter Wemmbe sent to the LOCAL_RELAY and other local names will be sent to MAIL_HUB.
141206f25ae9SGregory Neil ShapiroNote: there is a (long standing) bug which keeps this combination from
141306f25ae9SGregory Neil Shapiroworking for addresses of the form user+detail.
141406f25ae9SGregory Neil ShapiroNames in class {L} will be delivered locally, so you MUST have aliases or
1415c2aa98e2SPeter Wemm.forward files for them.
1416c2aa98e2SPeter Wemm
1417c2aa98e2SPeter WemmFor example, if you are on machine mastodon.CS.Berkeley.EDU and you have
14182e43090eSPeter WemmFEATURE(`stickyhost'), the following combinations of settings will have the
1419c2aa98e2SPeter Wemmindicated effects:
1420c2aa98e2SPeter Wemm
1421c2aa98e2SPeter Wemmemail sent to....	eric			  eric@mastodon.CS.Berkeley.EDU
1422c2aa98e2SPeter Wemm
1423c2aa98e2SPeter WemmLOCAL_RELAY set to	mail.CS.Berkeley.EDU	  (delivered locally)
1424c2aa98e2SPeter Wemmmail.CS.Berkeley.EDU	  (no local aliasing)	    (aliasing done)
1425c2aa98e2SPeter Wemm
1426c2aa98e2SPeter WemmMAIL_HUB set to		mammoth.CS.Berkeley.EDU	  mammoth.CS.Berkeley.EDU
1427c2aa98e2SPeter Wemmmammoth.CS.Berkeley.EDU	  (aliasing done)	    (aliasing done)
1428c2aa98e2SPeter Wemm
1429c2aa98e2SPeter WemmBoth LOCAL_RELAY and	mail.CS.Berkeley.EDU	  mammoth.CS.Berkeley.EDU
1430c2aa98e2SPeter WemmMAIL_HUB set as above	  (no local aliasing)	    (aliasing done)
1431c2aa98e2SPeter Wemm
14322e43090eSPeter WemmIf you do not have FEATURE(`stickyhost') set, then LOCAL_RELAY and
1433c2aa98e2SPeter WemmMAIL_HUB act identically, with MAIL_HUB taking precedence.
1434c2aa98e2SPeter Wemm
1435c2aa98e2SPeter WemmIf you want all outgoing mail to go to a central relay site, define
1436c2aa98e2SPeter WemmSMART_HOST as well.  Briefly:
1437c2aa98e2SPeter Wemm
1438c2aa98e2SPeter Wemm	LOCAL_RELAY applies to unqualified names (e.g., "eric").
1439c2aa98e2SPeter Wemm	MAIL_HUB applies to names qualified with the name of the
1440c2aa98e2SPeter Wemm		local host (e.g., "eric@mastodon.CS.Berkeley.EDU").
144106f25ae9SGregory Neil Shapiro	SMART_HOST applies to names qualified with other hosts or
144206f25ae9SGregory Neil Shapiro		bracketed addresses (e.g., "eric@mastodon.CS.Berkeley.EDU"
144306f25ae9SGregory Neil Shapiro		or "eric@[127.0.0.1]").
1444c2aa98e2SPeter Wemm
1445c2aa98e2SPeter WemmHowever, beware that other relays (e.g., UUCP_RELAY, BITNET_RELAY,
1446c2aa98e2SPeter WemmDECNET_RELAY, and FAX_RELAY) take precedence over SMART_HOST, so if you
1447c2aa98e2SPeter Wemmreally want absolutely everything to go to a single central site you will
1448c2aa98e2SPeter Wemmneed to unset all the other relays -- or better yet, find or build a
1449c2aa98e2SPeter Wemmminimal config file that does this.
1450c2aa98e2SPeter Wemm
1451c2aa98e2SPeter WemmFor duplicate suppression to work properly, the host name is best
1452c2aa98e2SPeter Wemmspecified with a terminal dot:
1453c2aa98e2SPeter Wemm
1454c2aa98e2SPeter Wemm	define(`MAIL_HUB', `host.domain.')
1455c2aa98e2SPeter Wemm	      note the trailing dot ---^
1456c2aa98e2SPeter Wemm
1457c2aa98e2SPeter Wemm
145806f25ae9SGregory Neil Shapiro+--------------+
145906f25ae9SGregory Neil Shapiro| LDAP ROUTING |
146006f25ae9SGregory Neil Shapiro+--------------+
146106f25ae9SGregory Neil Shapiro
146206f25ae9SGregory Neil ShapiroFEATURE(`ldap_routing') can be used to implement the IETF Internet Draft
146306f25ae9SGregory Neil ShapiroLDAP Schema for Intranet Mail Routing
146406f25ae9SGregory Neil Shapiro(draft-lachman-laser-ldap-mail-routing-01).  This feature enables
146506f25ae9SGregory Neil ShapiroLDAP-based rerouting of a particular address to either a different host
146606f25ae9SGregory Neil Shapiroor a different address.  The LDAP lookup is first attempted on the full
146706f25ae9SGregory Neil Shapiroaddress (e.g., user@example.com) and then on the domain portion
146806f25ae9SGregory Neil Shapiro(e.g., @example.com).  Be sure to setup your domain for LDAP routing using
146906f25ae9SGregory Neil ShapiroLDAPROUTE_DOMAIN(), e.g.:
147006f25ae9SGregory Neil Shapiro
147106f25ae9SGregory Neil Shapiro	LDAPROUTE_DOMAIN(`example.com')
147206f25ae9SGregory Neil Shapiro
147306f25ae9SGregory Neil ShapiroBy default, the feature will use the schemas as specified in the draft
147406f25ae9SGregory Neil Shapiroand will not reject addresses not found by the LDAP lookup.  However,
147506f25ae9SGregory Neil Shapirothis behavior can be changed by giving additional arguments to the FEATURE()
147606f25ae9SGregory Neil Shapirocommand:
147706f25ae9SGregory Neil Shapiro
147806f25ae9SGregory Neil Shapiro	FEATURE(`ldap_routing', <mailHost>, <mailRoutingAddress>, <bounce>)
147906f25ae9SGregory Neil Shapiro
148006f25ae9SGregory Neil Shapirowhere <mailHost> is a map definition describing how to lookup an alternative
148106f25ae9SGregory Neil Shapiromail host for a particular address; <mailRoutingAddress> is a map definition
148206f25ae9SGregory Neil Shapirodescribing how to lookup an alternative address for a particular address; and
148306f25ae9SGregory Neil Shapirothe <bounce> argument, if present and not the word "passthru", dictates
148406f25ae9SGregory Neil Shapirothat mail should be bounced if neither a mailHost nor mailRoutingAddress
148506f25ae9SGregory Neil Shapirois found.
148606f25ae9SGregory Neil Shapiro
148706f25ae9SGregory Neil ShapiroThe default <mailHost> map definition is:
148806f25ae9SGregory Neil Shapiro
148906f25ae9SGregory Neil Shapiro	ldap -1 -v mailHost -k (&(objectClass=inetLocalMailRecipient)
149006f25ae9SGregory Neil Shapiro				 (mailLocalAddress=%0))
149106f25ae9SGregory Neil Shapiro
149206f25ae9SGregory Neil ShapiroThe default <mailRoutingAddress> map definition is:
149306f25ae9SGregory Neil Shapiro
149406f25ae9SGregory Neil Shapiro	ldap -1 -v mailRoutingAddress -k (&(objectClass=inetLocalMailRecipient)
149506f25ae9SGregory Neil Shapiro					   (mailLocalAddress=%0))
149606f25ae9SGregory Neil Shapiro
149706f25ae9SGregory Neil ShapiroNote that neither includes the LDAP server hostname (-h server) or base DN
149806f25ae9SGregory Neil Shapiro(-b o=org,c=COUNTRY), both necessary for LDAP queries.  It is presumed that
149906f25ae9SGregory Neil Shapiroyour .mc file contains a setting for the confLDAP_DEFAULT_SPEC option with
150006f25ae9SGregory Neil Shapirothese settings.  If this is not the case, the map definitions should be
150106f25ae9SGregory Neil Shapirochanged as described above.
150206f25ae9SGregory Neil Shapiro
150306f25ae9SGregory Neil ShapiroThe following possibilities exist as a result of an LDAP lookup on an
150406f25ae9SGregory Neil Shapiroaddress:
150506f25ae9SGregory Neil Shapiro
150606f25ae9SGregory Neil Shapiro	mailHost is	mailRoutingAddress is	Results in
150706f25ae9SGregory Neil Shapiro	-----------	---------------------	----------
150806f25ae9SGregory Neil Shapiro	set to a	set			mail delivered to
150906f25ae9SGregory Neil Shapiro	"local" host				mailRoutingAddress
151006f25ae9SGregory Neil Shapiro
151106f25ae9SGregory Neil Shapiro	set to a	not set			delivered to
151206f25ae9SGregory Neil Shapiro	"local" host				original address
151306f25ae9SGregory Neil Shapiro
151406f25ae9SGregory Neil Shapiro	set to a	set			mailRoutingAddress
151506f25ae9SGregory Neil Shapiro	remote host				relayed to mailHost
151606f25ae9SGregory Neil Shapiro
151706f25ae9SGregory Neil Shapiro	set to a	not set			original address
151806f25ae9SGregory Neil Shapiro	remote host				relayed to mailHost
151906f25ae9SGregory Neil Shapiro
152006f25ae9SGregory Neil Shapiro	not set		set			mail delivered to
152106f25ae9SGregory Neil Shapiro						mailRoutingAddress
152206f25ae9SGregory Neil Shapiro
152306f25ae9SGregory Neil Shapiro	not set		not set			delivered to
152406f25ae9SGregory Neil Shapiro						original address *OR*
152506f25ae9SGregory Neil Shapiro						bounced as unknown user
152606f25ae9SGregory Neil Shapiro
152706f25ae9SGregory Neil ShapiroThe term "local" host above means the host specified is in class {w}.
152806f25ae9SGregory Neil ShapiroNote that the last case depends on whether the third argument is given
152906f25ae9SGregory Neil Shapiroto the FEATURE() command.  The default is to deliver the message to the
153006f25ae9SGregory Neil Shapirooriginal address.
153106f25ae9SGregory Neil Shapiro
153206f25ae9SGregory Neil ShapiroThe LDAP entries should be set up with an objectClass of
153306f25ae9SGregory Neil ShapiroinetLocalMailRecipient and the address be listed in a mailLocalAddress
153406f25ae9SGregory Neil Shapiroattribute.  If present, there must be only one mailHost attribute and it
153506f25ae9SGregory Neil Shapiromust contain a fully qualified host name as its value.  Similarly, if
153606f25ae9SGregory Neil Shapiropresent, there must be only one mailRoutingAddress attribute and it must
153706f25ae9SGregory Neil Shapirocontain an RFC 822 compliant address.  Some example LDAP records (in ldif
153806f25ae9SGregory Neil Shapiroformat):
153906f25ae9SGregory Neil Shapiro
154006f25ae9SGregory Neil Shapiro	dn: uid=tom, o=example.com, c=US
154106f25ae9SGregory Neil Shapiro	objectClass: inetLocalMailRecipient
154206f25ae9SGregory Neil Shapiro	mailLocalAddress: tom@example.com
154306f25ae9SGregory Neil Shapiro	mailRoutingAddress: thomas@mailhost.example.com
154406f25ae9SGregory Neil Shapiro
154506f25ae9SGregory Neil ShapiroThis would deliver mail for tom@example.com to thomas@mailhost.example.com.
154606f25ae9SGregory Neil Shapiro
154706f25ae9SGregory Neil Shapiro	dn: uid=dick, o=example.com, c=US
154806f25ae9SGregory Neil Shapiro	objectClass: inetLocalMailRecipient
154906f25ae9SGregory Neil Shapiro	mailLocalAddress: dick@example.com
155006f25ae9SGregory Neil Shapiro	mailHost: eng.example.com
155106f25ae9SGregory Neil Shapiro
155206f25ae9SGregory Neil ShapiroThis would relay mail for dick@example.com to the same address but redirect
155306f25ae9SGregory Neil Shapirothe mail to MX records listed for the host eng.example.com.
155406f25ae9SGregory Neil Shapiro
155506f25ae9SGregory Neil Shapiro	dn: uid=harry, o=example.com, c=US
155606f25ae9SGregory Neil Shapiro	objectClass: inetLocalMailRecipient
155706f25ae9SGregory Neil Shapiro	mailLocalAddress: harry@example.com
155806f25ae9SGregory Neil Shapiro	mailHost: mktmail.example.com
155906f25ae9SGregory Neil Shapiro	mailRoutingAddress: harry@mkt.example.com
156006f25ae9SGregory Neil Shapiro
156106f25ae9SGregory Neil ShapiroThis would relay mail for harry@example.com to the MX records listed for
156206f25ae9SGregory Neil Shapirothe host mktmail.example.com using the new address harry@mkt.example.com
156306f25ae9SGregory Neil Shapirowhen talking to that host.
156406f25ae9SGregory Neil Shapiro
156506f25ae9SGregory Neil Shapiro	dn: uid=virtual.example.com, o=example.com, c=US
156606f25ae9SGregory Neil Shapiro	objectClass: inetLocalMailRecipient
156706f25ae9SGregory Neil Shapiro	mailLocalAddress: @virtual.example.com
156806f25ae9SGregory Neil Shapiro	mailHost: server.example.com
156906f25ae9SGregory Neil Shapiro	mailRoutingAddress: virtual@example.com
157006f25ae9SGregory Neil Shapiro
157106f25ae9SGregory Neil ShapiroThis would send all mail destined for any username @virtual.example.com to
157206f25ae9SGregory Neil Shapirothe machine server.example.com's MX servers and deliver to the address
157306f25ae9SGregory Neil Shapirovirtual@example.com on that relay machine.
157406f25ae9SGregory Neil Shapiro
157506f25ae9SGregory Neil Shapiro
1576c2aa98e2SPeter Wemm+---------------------------------+
1577c2aa98e2SPeter Wemm| ANTI-SPAM CONFIGURATION CONTROL |
1578c2aa98e2SPeter Wemm+---------------------------------+
1579c2aa98e2SPeter Wemm
1580c2aa98e2SPeter WemmThe primary anti-spam features available in sendmail are:
1581c2aa98e2SPeter Wemm
1582c2aa98e2SPeter Wemm* Relaying is denied by default.
1583c2aa98e2SPeter Wemm* Better checking on sender information.
1584c2aa98e2SPeter Wemm* Access database.
1585c2aa98e2SPeter Wemm* Header checks.
1586c2aa98e2SPeter Wemm
158706f25ae9SGregory Neil ShapiroRelaying (transmission of messages from a site outside your host (class
158806f25ae9SGregory Neil Shapiro{w}) to another site except yours) is denied by default.  Note that this
158906f25ae9SGregory Neil Shapirochanged in sendmail 8.9; previous versions allowed relaying by default.
159006f25ae9SGregory Neil ShapiroIf you really want to revert to the old behaviour, you will need to use
159106f25ae9SGregory Neil ShapiroFEATURE(`promiscuous_relay').  You can allow certain domains to relay
159206f25ae9SGregory Neil Shapirothrough your server by adding their domain name or IP address to class
159306f25ae9SGregory Neil Shapiro{R} using RELAY_DOMAIN() and RELAY_DOMAIN_FILE() or via the access database
159406f25ae9SGregory Neil Shapiro(described below).  The file consists (like any other file based class)
159506f25ae9SGregory Neil Shapiroof entries listed on separate lines, e.g.,
159606f25ae9SGregory Neil Shapiro
159706f25ae9SGregory Neil Shapiro	sendmail.org
159806f25ae9SGregory Neil Shapiro	128.32
159906f25ae9SGregory Neil Shapiro	1:2:3:4:5:6:7
160006f25ae9SGregory Neil Shapiro	host.mydomain.com
1601c2aa98e2SPeter Wemm
1602c2aa98e2SPeter WemmIf you use
1603c2aa98e2SPeter Wemm
16042e43090eSPeter Wemm	FEATURE(`relay_entire_domain')
1605c2aa98e2SPeter Wemm
160606f25ae9SGregory Neil Shapirothen any host in any of your local domains (that is, class {m})
1607065a643dSPeter Wemmwill be relayed (that is, you will accept mail either to or from any
1608065a643dSPeter Wemmhost in your domain).
1609c2aa98e2SPeter Wemm
1610c2aa98e2SPeter WemmYou can also allow relaying based on the MX records of the host
1611c2aa98e2SPeter Wemmportion of an incoming recipient address by using
1612c2aa98e2SPeter Wemm
16132e43090eSPeter Wemm	FEATURE(`relay_based_on_MX')
1614c2aa98e2SPeter Wemm
1615c2aa98e2SPeter WemmFor example, if your server receives a recipient of user@domain.com
1616c2aa98e2SPeter Wemmand domain.com lists your server in its MX records, the mail will be
1617065a643dSPeter Wemmaccepted for relay to domain.com.  Note that this will stop spammers
1618065a643dSPeter Wemmfrom using your host to relay spam but it will not stop outsiders from
1619065a643dSPeter Wemmusing your server as a relay for their site (that is, they set up an
1620065a643dSPeter WemmMX record pointing to your mail server, and you will relay mail addressed
1621065a643dSPeter Wemmto them without any prior arrangement).  Along the same lines,
1622c2aa98e2SPeter Wemm
16232e43090eSPeter Wemm	FEATURE(`relay_local_from')
1624c2aa98e2SPeter Wemm
1625c2aa98e2SPeter Wemmwill allow relaying if the sender specifies a return path (i.e.
1626c2aa98e2SPeter WemmMAIL FROM: <user@domain>) domain which is a local domain.  This a
1627c2aa98e2SPeter Wemmdangerous feature as it will allow spammers to spam using your mail
1628c2aa98e2SPeter Wemmserver by simply specifying a return address of user@your.domain.com.
1629c2aa98e2SPeter WemmIt should not be used unless absolutely necessary.
163006f25ae9SGregory Neil ShapiroA slightly better solution is
163106f25ae9SGregory Neil Shapiro
163206f25ae9SGregory Neil Shapiro	FEATURE(`relay_mail_from')
163306f25ae9SGregory Neil Shapiro
163406f25ae9SGregory Neil Shapirowhich allows relaying if the mail sender is listed as RELAY in the
163506f25ae9SGregory Neil Shapiroaccess map.  If an optional argument `domain' is given, the domain
163606f25ae9SGregory Neil Shapiroportion of the mail sender is also checked to allowing relaying.
163706f25ae9SGregory Neil ShapiroThis option only works together with the tag From: for the LHS of
163806f25ae9SGregory Neil Shapirothe access map entries (see below: Finer control...).
163906f25ae9SGregory Neil Shapiro
1640c2aa98e2SPeter Wemm
1641c2aa98e2SPeter WemmIf source routing is used in the recipient address (i.e.
1642c2aa98e2SPeter WemmRCPT TO: <user%site.com@othersite.com>), sendmail will check
1643c2aa98e2SPeter Wemmuser@site.com for relaying if othersite.com is an allowed relay host
164406f25ae9SGregory Neil Shapiroin either class {R}, class {m} if FEATURE(`relay_entire_domain') is used,
16452e43090eSPeter Wemmor the access database if FEATURE(`access_db') is used.  To prevent
1646c2aa98e2SPeter Wemmthe address from being stripped down, use:
1647c2aa98e2SPeter Wemm
16482e43090eSPeter Wemm	FEATURE(`loose_relay_check')
1649c2aa98e2SPeter Wemm
1650c2aa98e2SPeter WemmIf you think you need to use this feature, you probably do not.  This
1651c2aa98e2SPeter Wemmshould only be used for sites which have no control over the addresses
1652c2aa98e2SPeter Wemmthat they provide a gateway for.  Use this FEATURE with caution as it
1653c2aa98e2SPeter Wemmcan allow spammers to relay through your server if not setup properly.
1654c2aa98e2SPeter Wemm
165506f25ae9SGregory Neil ShapiroNOTICE: It is possible to relay mail through a system which the anti-relay
165606f25ae9SGregory Neil Shapirorules do not prevent: the case of a system that does use FEATURE(`nouucp',
165706f25ae9SGregory Neil Shapiro`nospecial') (system A) and relays local messages to a mail hub (e.g., via
165806f25ae9SGregory Neil ShapiroLOCAL_RELAY or LUSER_RELAY) (system B).  If system B doesn't use
165906f25ae9SGregory Neil ShapiroFEATURE(`nouucp') at all, addresses of the form
166006f25ae9SGregory Neil Shapiro<example.net!user@local.host> would be relayed to <user@example.net>.
166106f25ae9SGregory Neil ShapiroSystem A doesn't recognize `!' as an address separator and therefore
166206f25ae9SGregory Neil Shapiroforwards it to the mail hub which in turns relays it because it came from
166306f25ae9SGregory Neil Shapiroa trusted local host.  So if a mailserver allows UUCP (bang-format)
166406f25ae9SGregory Neil Shapiroaddresses, all systems from which it allows relaying should do the same
166506f25ae9SGregory Neil Shapiroor reject those addresses.
166606f25ae9SGregory Neil Shapiro
1667c2aa98e2SPeter WemmAs of 8.9, sendmail will refuse mail if the MAIL FROM: parameter has
1668c2aa98e2SPeter Wemman unresolvable domain (i.e., one that DNS, your local name service,
1669c2aa98e2SPeter Wemmor special case rules in ruleset 3 cannot locate).  If you want to
167006f25ae9SGregory Neil Shapirocontinue to accept such domains, e.g., because you are inside a
1671c2aa98e2SPeter Wemmfirewall that has only a limited view of the Internet host name space
1672c2aa98e2SPeter Wemm(note that you will not be able to return mail to them unless you have
1673c2aa98e2SPeter Wemmsome "smart host" forwarder), use
1674c2aa98e2SPeter Wemm
16752e43090eSPeter Wemm	FEATURE(`accept_unresolvable_domains')
1676c2aa98e2SPeter Wemm
1677c2aa98e2SPeter Wemmsendmail will also refuse mail if the MAIL FROM: parameter is not
1678c2aa98e2SPeter Wemmfully qualified (i.e., contains a domain as well as a user).  If you
1679c2aa98e2SPeter Wemmwant to continue to accept such senders, use
1680c2aa98e2SPeter Wemm
16812e43090eSPeter Wemm	FEATURE(`accept_unqualified_senders')
1682c2aa98e2SPeter Wemm
168306f25ae9SGregory Neil ShapiroSetting the DaemonPortOptions modifier 'u' overrides the default behavior,
168406f25ae9SGregory Neil Shapiroi.e., unqualified addresses are accepted even without this FEATURE.  If
168506f25ae9SGregory Neil Shapirothis FEATURE is not used, the DaemonPortOptions modifier 'f' can be used
168606f25ae9SGregory Neil Shapiroto enforce fully qualified addresses.
168706f25ae9SGregory Neil Shapiro
1688c2aa98e2SPeter WemmAn ``access'' database can be created to accept or reject mail from
1689c2aa98e2SPeter Wemmselected domains.  For example, you may choose to reject all mail
1690c2aa98e2SPeter Wemmoriginating from known spammers.  To enable such a database, use
1691c2aa98e2SPeter Wemm
16922e43090eSPeter Wemm	FEATURE(`access_db')
1693c2aa98e2SPeter Wemm
1694c2aa98e2SPeter WemmThe FEATURE macro can accept a second parameter giving the key file
1695c2aa98e2SPeter Wemmdefinition for the database; for example
1696c2aa98e2SPeter Wemm
169706f25ae9SGregory Neil Shapiro	FEATURE(`access_db', `hash /etc/mail/access')
1698c2aa98e2SPeter Wemm
1699065a643dSPeter WemmRemember, since /etc/mail/access is a database, after creating the text
1700065a643dSPeter Wemmfile as described below, you must use makemap to create the database
1701065a643dSPeter Wemmmap.  For example:
1702065a643dSPeter Wemm
1703065a643dSPeter Wemm	makemap hash /etc/mail/access < /etc/mail/access
1704065a643dSPeter Wemm
1705c2aa98e2SPeter WemmThe table itself uses e-mail addresses, domain names, and network
1706c2aa98e2SPeter Wemmnumbers as keys.  For example,
1707c2aa98e2SPeter Wemm
1708c2aa98e2SPeter Wemm	spammer@aol.com		REJECT
1709c2aa98e2SPeter Wemm	cyberspammer.com	REJECT
1710065a643dSPeter Wemm	192.168.212		REJECT
1711c2aa98e2SPeter Wemm
1712c2aa98e2SPeter Wemmwould refuse mail from spammer@aol.com, any user from cyberspammer.com
1713c2aa98e2SPeter Wemm(or any host within the cyberspammer.com domain), and any host on the
1714065a643dSPeter Wemm192.168.212.* network.
1715c2aa98e2SPeter Wemm
1716c2aa98e2SPeter WemmThe value part of the map can contain:
1717c2aa98e2SPeter Wemm
1718065a643dSPeter Wemm	OK		Accept mail even if other rules in the
1719065a643dSPeter Wemm			running ruleset would reject it, for example,
1720065a643dSPeter Wemm			if the domain name is unresolvable.
1721065a643dSPeter Wemm	RELAY		Accept mail addressed to the indicated domain or
1722065a643dSPeter Wemm			received from the indicated domain for relaying
1723065a643dSPeter Wemm			through your SMTP server.  RELAY also serves as
1724065a643dSPeter Wemm			an implicit OK for the other checks.
1725065a643dSPeter Wemm	REJECT		Reject the sender or recipient with a general
1726c2aa98e2SPeter Wemm			purpose message.
1727065a643dSPeter Wemm	DISCARD		Discard the message completely using the
1728193538b7SGregory Neil Shapiro			$#discard mailer.  If it is used in check_compat,
1729193538b7SGregory Neil Shapiro			it affects only the designated recipient, not
1730193538b7SGregory Neil Shapiro			the whole message as it does in all other cases.
1731193538b7SGregory Neil Shapiro			This should only be used if really necessary.
173242e5d165SGregory Neil Shapiro	### any text	where ### is an RFC 821 compliant error code and
173342e5d165SGregory Neil Shapiro			"any text" is a message to return for the command.
173442e5d165SGregory Neil Shapiro			The string should be quoted to avoid surprises,
173542e5d165SGregory Neil Shapiro			e.g., sendmail may remove spaces otherwise.
173606f25ae9SGregory Neil Shapiro	ERROR:### any text
173706f25ae9SGregory Neil Shapiro			as above, but useful to mark error messages as such.
173806f25ae9SGregory Neil Shapiro	ERROR:D.S.N:### any text
173906f25ae9SGregory Neil Shapiro			where D.S.N is an RFC 1893 compliant error code
174006f25ae9SGregory Neil Shapiro			and the rest as above.
1741c2aa98e2SPeter Wemm
1742c2aa98e2SPeter WemmFor example:
1743c2aa98e2SPeter Wemm
174442e5d165SGregory Neil Shapiro	cyberspammer.com	ERROR:"550 We don't accept mail from spammers"
1745c2aa98e2SPeter Wemm	okay.cyberspammer.com	OK
174606f25ae9SGregory Neil Shapiro	sendmail.org		RELAY
1747c2aa98e2SPeter Wemm	128.32			RELAY
174806f25ae9SGregory Neil Shapiro	1:2:3:4:5:6:7		RELAY
174906f25ae9SGregory Neil Shapiro	[127.0.0.3]		OK
175006f25ae9SGregory Neil Shapiro	[1:2:3:4:5:6:7:8]	OK
1751c2aa98e2SPeter Wemm
175206f25ae9SGregory Neil Shapirowould accept mail from okay.cyberspammer.com, but would reject mail from
175306f25ae9SGregory Neil Shapiroall other hosts at cyberspammer.com with the indicated message.  It would
175406f25ae9SGregory Neil Shapiroallow relaying mail from and to any hosts in the sendmail.org domain, and
175506f25ae9SGregory Neil Shapiroallow relaying from the 128.32.*.* network and the IPv6 1:2:3:4:5:6:7:*
175606f25ae9SGregory Neil Shapironetwork.  The latter two entries are for checks against ${client_name} if
175706f25ae9SGregory Neil Shapirothe IP address doesn't resolve to a hostname (or is considered as "may be
175806f25ae9SGregory Neil Shapiroforged").
175906f25ae9SGregory Neil Shapiro
176006f25ae9SGregory Neil ShapiroWarning: if you change the RFC 821 compliant error code from the default
176106f25ae9SGregory Neil Shapirovalue of 550, then you should probably also change the RFC 1893 compliant
176206f25ae9SGregory Neil Shapiroerror code to match it.  For example, if you use
176306f25ae9SGregory Neil Shapiro
176406f25ae9SGregory Neil Shapiro	user@example.com	450 mailbox full
176506f25ae9SGregory Neil Shapiro
176606f25ae9SGregory Neil Shapirothe error returned would be "450 4.0.0 mailbox full" which is wrong.
176706f25ae9SGregory Neil ShapiroUse "450 4.2.2 mailbox full" or "ERROR:4.2.2:450 mailbox full"
176806f25ae9SGregory Neil Shapiroinstead.
176906f25ae9SGregory Neil Shapiro
177006f25ae9SGregory Neil ShapiroNote, UUCP users may need to add hostname.UUCP to the access database
177106f25ae9SGregory Neil Shapiroor class {R}.  If you also use:
1772c2aa98e2SPeter Wemm
17732e43090eSPeter Wemm	FEATURE(`relay_hosts_only')
1774c2aa98e2SPeter Wemm
1775c2aa98e2SPeter Wemmthen the above example will allow relaying for sendmail.org, but not
1776c2aa98e2SPeter Wemmhosts within the sendmail.org domain.  Note that this will also require
177706f25ae9SGregory Neil Shapirohosts listed in class {R} to be fully qualified host names.
1778c2aa98e2SPeter Wemm
1779c2aa98e2SPeter WemmYou can also use the access database to block sender addresses based on
1780c2aa98e2SPeter Wemmthe username portion of the address.  For example:
1781c2aa98e2SPeter Wemm
178242e5d165SGregory Neil Shapiro	FREE.STEALTH.MAILER@	ERROR:550 Spam not accepted
1783c2aa98e2SPeter Wemm
1784c2aa98e2SPeter WemmNote that you must include the @ after the username to signify that
1785c2aa98e2SPeter Wemmthis database entry is for checking only the username portion of the
1786c2aa98e2SPeter Wemmsender address.
1787c2aa98e2SPeter Wemm
1788c2aa98e2SPeter WemmIf you use:
1789c2aa98e2SPeter Wemm
17902e43090eSPeter Wemm	FEATURE(`blacklist_recipients')
1791c2aa98e2SPeter Wemm
1792c2aa98e2SPeter Wemmthen you can add entries to the map for local users, hosts in your
1793c2aa98e2SPeter Wemmdomains, or addresses in your domain which should not receive mail:
1794c2aa98e2SPeter Wemm
179542e5d165SGregory Neil Shapiro	badlocaluser@		ERROR:550 Mailbox disabled for this username
179642e5d165SGregory Neil Shapiro	host.mydomain.com	ERROR:550 That host does not accept mail
179742e5d165SGregory Neil Shapiro	user@otherhost.mydomain.com	ERROR:550 Mailbox disabled for this recipient
1798c2aa98e2SPeter Wemm
1799c2aa98e2SPeter WemmThis would prevent a recipient of badlocaluser@mydomain.com, any
1800c2aa98e2SPeter Wemmuser at host.mydomain.com, and the single address
180106f25ae9SGregory Neil Shapirouser@otherhost.mydomain.com from receiving mail.  Please note: a
180206f25ae9SGregory Neil Shapirolocal username must be now tagged with an @ (this is consistent
180306f25ae9SGregory Neil Shapirowith the check of the sender address, and hence it is possible to
180406f25ae9SGregory Neil Shapirodistinguish between hostnames and usernames).  Enabling this feature
180506f25ae9SGregory Neil Shapirowill keep you from sending mails to all addresses that have an
180606f25ae9SGregory Neil Shapiroerror message or REJECT as value part in the access map.  Taking
180706f25ae9SGregory Neil Shapirothe example from above:
1808065a643dSPeter Wemm
1809065a643dSPeter Wemm	spammer@aol.com		REJECT
1810065a643dSPeter Wemm	cyberspammer.com	REJECT
1811065a643dSPeter Wemm
1812065a643dSPeter WemmMail can't be sent to spammer@aol.com or anyone at cyberspammer.com.
1813c2aa98e2SPeter Wemm
1814c2aa98e2SPeter WemmThere is also a ``Realtime Blackhole List'' run by the MAPS project
1815c2aa98e2SPeter Wemmat http://maps.vix.com/.  This is a database maintained in DNS of
1816c2aa98e2SPeter Wemmspammers.  To use this database, use
1817c2aa98e2SPeter Wemm
181806f25ae9SGregory Neil Shapiro	FEATURE(`dnsbl')
1819c2aa98e2SPeter Wemm
1820c2aa98e2SPeter WemmThis will cause sendmail to reject mail from any site in the
1821c2aa98e2SPeter WemmRealtime Blackhole List database.  You can specify an alternative
182206f25ae9SGregory Neil ShapiroRBL domain to check by specifying an argument to the FEATURE.
1823193538b7SGregory Neil ShapiroThe default error message is
1824193538b7SGregory Neil Shapiro
182506f25ae9SGregory Neil Shapiro	Mail from $&{client_addr} refused by blackhole site DOMAIN
1826193538b7SGregory Neil Shapiro
1827193538b7SGregory Neil Shapirowhere DOMAIN is the first argument of the feature.  A second argument
1828193538b7SGregory Neil Shapirocan be used to specify a different text.  This FEATURE can be
1829193538b7SGregory Neil Shapiroincluded several times to query different DNS based rejection lists,
1830193538b7SGregory Neil Shapiroe.g., the dial-up user list (see http://maps.vix.com/dul/).
1831c2aa98e2SPeter Wemm
1832c2aa98e2SPeter WemmThe features described above make use of the check_relay, check_mail,
1833c2aa98e2SPeter Wemmand check_rcpt rulesets.  If you wish to include your own checks,
1834c2aa98e2SPeter Wemmyou can put your checks in the rulesets Local_check_relay,
1835c2aa98e2SPeter WemmLocal_check_mail, and Local_check_rcpt.  For example if you wanted to
1836c2aa98e2SPeter Wemmblock senders with all numeric usernames (i.e. 2312343@bigisp.com),
1837c2aa98e2SPeter Wemmyou would use Local_check_mail and the new regex map:
1838c2aa98e2SPeter Wemm
1839c2aa98e2SPeter Wemm	LOCAL_CONFIG
1840c2aa98e2SPeter Wemm	Kallnumbers regex -a@MATCH ^[0-9]+$
1841c2aa98e2SPeter Wemm
1842c2aa98e2SPeter Wemm	LOCAL_RULESETS
1843c2aa98e2SPeter Wemm	SLocal_check_mail
1844c2aa98e2SPeter Wemm	# check address against various regex checks
1845c2aa98e2SPeter Wemm	R$*				$: $>Parse0 $>3 $1
1846c2aa98e2SPeter Wemm	R$+ < @ bigisp.com. > $*	$: $(allnumbers $1 $)
1847c2aa98e2SPeter Wemm	R@MATCH				$#error $: 553 Header Error
1848c2aa98e2SPeter Wemm
1849c2aa98e2SPeter WemmThese rules are called with the original arguments of the corresponding
1850c2aa98e2SPeter Wemmcheck_* ruleset.  If the local ruleset returns $#OK, no further checking
1851c2aa98e2SPeter Wemmis done by the features described above and the mail is accepted.  If the
1852c2aa98e2SPeter Wemmlocal ruleset resolves to a mailer (such as $#error or $#discard), the
1853c2aa98e2SPeter Wemmappropriate action is taken.  Otherwise, the results of the local
1854c2aa98e2SPeter Wemmrewriting are ignored.
1855c2aa98e2SPeter Wemm
185606f25ae9SGregory Neil ShapiroFiner control by using tags for the LHS of the access map
185706f25ae9SGregory Neil Shapiro
185806f25ae9SGregory Neil ShapiroRead this section only if the options listed so far are not sufficient
185906f25ae9SGregory Neil Shapirofor your purposes.  There is now the option to tag entries in the
186006f25ae9SGregory Neil Shapiroaccess map according to their type.  Three tags are available:
186106f25ae9SGregory Neil Shapiro
186206f25ae9SGregory Neil Shapiro	Connect:	connection information (${client_addr}, ${client_name})
186306f25ae9SGregory Neil Shapiro	From:		sender
186406f25ae9SGregory Neil Shapiro	To:		recipient
186506f25ae9SGregory Neil Shapiro
186606f25ae9SGregory Neil ShapiroIf the required item is looked up in a map, it will be tried first
186706f25ae9SGregory Neil Shapirowith the corresponding tag in front, then (as fallback to enable
186806f25ae9SGregory Neil Shapirobackward compatibility) without any tag.  For example,
186906f25ae9SGregory Neil Shapiro
187006f25ae9SGregory Neil Shapiro	From:spammer@some.dom	REJECT
187106f25ae9SGregory Neil Shapiro	To:friend.domain	RELAY
187206f25ae9SGregory Neil Shapiro	Connect:friend.domain	OK
187306f25ae9SGregory Neil Shapiro	Connect:from.domain	RELAY
187406f25ae9SGregory Neil Shapiro	From:good@another.dom	OK
187506f25ae9SGregory Neil Shapiro	From:another.dom	REJECT
187606f25ae9SGregory Neil Shapiro
187706f25ae9SGregory Neil ShapiroThis would deny mails from spammer@some.dom but you could still
187806f25ae9SGregory Neil Shapirosend mail to that address even if FEATURE(`blacklist_recipients')
187906f25ae9SGregory Neil Shapirois enabled.  Your system will allow relaying to friend.domain, but
188006f25ae9SGregory Neil Shapironot from it (unless enabled by other means).  Connections from that
188106f25ae9SGregory Neil Shapirodomain will be allowed even if it ends up in one of the DNS based
188206f25ae9SGregory Neil Shapirorejection lists.  Relaying is enabled from from.domain but not to
188306f25ae9SGregory Neil Shapiroit (since relaying is based on the connection information for
188406f25ae9SGregory Neil Shapirooutgoing relaying, the tag Connect: must be used; for incoming
188506f25ae9SGregory Neil Shapirorelaying, which is based on the recipient address, To: must be
188606f25ae9SGregory Neil Shapiroused).  The last two entries allow mails from good@another.dom but
188706f25ae9SGregory Neil Shapiroreject mail from all other addresses with another.dom as domain
188806f25ae9SGregory Neil Shapiropart.
188906f25ae9SGregory Neil Shapiro
189006f25ae9SGregory Neil ShapiroDelay all checks
189106f25ae9SGregory Neil Shapiro
189206f25ae9SGregory Neil ShapiroBy using FEATURE(`delay_checks') the rulesets check_mail and check_relay
189306f25ae9SGregory Neil Shapirowill not be called when a client connects or issues a MAIL command,
189406f25ae9SGregory Neil Shapirorespectively.  Instead, those rulesets will be called by the check_rcpt
189506f25ae9SGregory Neil Shapiroruleset; they will be skipped if a sender has been authenticated using
189606f25ae9SGregory Neil Shapiroa "trusted" mechanism, i.e., one that is defined via TRUST_AUTH_MECH().
189706f25ae9SGregory Neil ShapiroIf check_mail returns an error then the RCPT TO command will be rejected
189806f25ae9SGregory Neil Shapirowith that error.  If it returns some other result starting with $# then
189906f25ae9SGregory Neil Shapirocheck_relay will be skipped.  If the sender address (or a part of it) is
190006f25ae9SGregory Neil Shapirolisted in the access map and it has a RHS of OK or RELAY, then check_relay
190106f25ae9SGregory Neil Shapirowill be skipped.  This has an interesting side effect: if your domain is
190206f25ae9SGregory Neil Shapiromy.domain and you have
190306f25ae9SGregory Neil Shapiro
190406f25ae9SGregory Neil Shapiro	my.domain	RELAY
190506f25ae9SGregory Neil Shapiro
190606f25ae9SGregory Neil Shapiroin the access map, then all e-mail with a sender address of
190706f25ae9SGregory Neil Shapiro<user@my.domain> gets through, even if check_relay would reject it
190806f25ae9SGregory Neil Shapiro(e.g., based on the hostname or IP address).  This allows spammers
190906f25ae9SGregory Neil Shapiroto get around DNS based blacklist by faking the sender address.  To
191006f25ae9SGregory Neil Shapiroavoid this problem you have to use tagged entries:
191106f25ae9SGregory Neil Shapiro
191206f25ae9SGregory Neil Shapiro	To:my.domain		RELAY
191306f25ae9SGregory Neil Shapiro	Connect:my.domain	RELAY
191406f25ae9SGregory Neil Shapiro
191506f25ae9SGregory Neil Shapiroif you need those entries at all (class {R} may take care of them).
191606f25ae9SGregory Neil Shapiro
191706f25ae9SGregory Neil ShapiroFEATURE(`delay_checks') can take an optional argument:
191806f25ae9SGregory Neil Shapiro
191906f25ae9SGregory Neil Shapiro	FEATURE(`delay_checks', `friend')
192006f25ae9SGregory Neil Shapiro		 enables spamfriend test
192106f25ae9SGregory Neil Shapiro	FEATURE(`delay_checks', `hater')
192206f25ae9SGregory Neil Shapiro		 enables spamhater test
192306f25ae9SGregory Neil Shapiro
192406f25ae9SGregory Neil ShapiroIf such an argument is given, the recipient will be looked up in the access
192506f25ae9SGregory Neil Shapiromap (using the tag To:).  If the argument is `friend', then the other
192606f25ae9SGregory Neil Shapirorulesets will be skipped if the recipient address is found and has RHS
192706f25ae9SGregory Neil Shapirospamfriend.  If the argument is `hater', then the other rulesets will be
192806f25ae9SGregory Neil Shapiroapplied if the recipient address is found and has RHS spamhater.
192906f25ae9SGregory Neil Shapiro
193006f25ae9SGregory Neil ShapiroThis allows for simple exceptions from the tests, e.g., by activating
193106f25ae9SGregory Neil Shapirothe spamfriend option and having
193206f25ae9SGregory Neil Shapiro
193306f25ae9SGregory Neil Shapiro	To:abuse@	SPAMFRIEND
193406f25ae9SGregory Neil Shapiro
193506f25ae9SGregory Neil Shapiroin the access map, mail to abuse@localdomain will get through.  It is
193606f25ae9SGregory Neil Shapiroalso possible to specify a full address or an address with +detail:
193706f25ae9SGregory Neil Shapiro
193806f25ae9SGregory Neil Shapiro	To:abuse@abuse.my.domain	SPAMFRIEND
193906f25ae9SGregory Neil Shapiro	To:me+abuse@		SPAMFRIEND
194006f25ae9SGregory Neil Shapiro
194106f25ae9SGregory Neil Shapiro
194206f25ae9SGregory Neil ShapiroHeader Checks
1943c2aa98e2SPeter Wemm
1944c2aa98e2SPeter WemmYou can also reject mail on the basis of the contents of headers.
1945c2aa98e2SPeter WemmThis is done by adding a ruleset call to the 'H' header definition command
1946c2aa98e2SPeter Wemmin sendmail.cf.  For example, this can be used to check the validity of
1947c2aa98e2SPeter Wemma Message-ID: header:
1948c2aa98e2SPeter Wemm
1949c2aa98e2SPeter Wemm	LOCAL_RULESETS
1950c2aa98e2SPeter Wemm	HMessage-Id: $>CheckMessageId
1951c2aa98e2SPeter Wemm
1952c2aa98e2SPeter Wemm	SCheckMessageId
1953c2aa98e2SPeter Wemm	R< $+ @ $+ >		$@ OK
1954c2aa98e2SPeter Wemm	R$*			$#error $: 553 Header Error
1955c2aa98e2SPeter Wemm
195606f25ae9SGregory Neil ShapiroThe alternative format:
1957065a643dSPeter Wemm
195806f25ae9SGregory Neil Shapiro	HSubject: $>+CheckSubject
1959065a643dSPeter Wemm
196006f25ae9SGregory Neil Shapirothat is, $>+ instead of $>, gives the full Subject: header including
196106f25ae9SGregory Neil Shapirocomments to the ruleset (comments in parentheses () are stripped
196206f25ae9SGregory Neil Shapiroby default).
19632e43090eSPeter Wemm
196406f25ae9SGregory Neil ShapiroA default ruleset for headers which don't have a specific ruleset
196506f25ae9SGregory Neil Shapirodefined for them can be given by:
1966065a643dSPeter Wemm
196706f25ae9SGregory Neil Shapiro	H*: $>CheckHdr
196806f25ae9SGregory Neil Shapiro
196906f25ae9SGregory Neil ShapiroAfter all of the headers are read, the check_eoh ruleset will be called for
197006f25ae9SGregory Neil Shapiroany final header-related checks.  The ruleset is called with the number of
197106f25ae9SGregory Neil Shapiroheaders and the size of all of the headers in bytes separated by $|.  One
197206f25ae9SGregory Neil Shapiroexample usage is to reject messages which do not have a Message-Id:
197306f25ae9SGregory Neil Shapiroheader.  However, the Message-Id: header is *NOT* a required header and is
197406f25ae9SGregory Neil Shapironot a guaranteed spam indicator.  This ruleset is an example and should
197506f25ae9SGregory Neil Shapiroprobably not be used in production.
197606f25ae9SGregory Neil Shapiro
197706f25ae9SGregory Neil Shapiro	LOCAL_CONFIG
197806f25ae9SGregory Neil Shapiro	Kstorage macro
197906f25ae9SGregory Neil Shapiro
198006f25ae9SGregory Neil Shapiro	LOCAL_RULESETS
198106f25ae9SGregory Neil Shapiro	HMessage-Id: $>CheckMessageId
198206f25ae9SGregory Neil Shapiro
198306f25ae9SGregory Neil Shapiro	SCheckMessageId
198406f25ae9SGregory Neil Shapiro	# Record the presence of the header
198506f25ae9SGregory Neil Shapiro	R$*			$: $(storage {MessageIdCheck} $@ OK $) $1
198606f25ae9SGregory Neil Shapiro	R< $+ @ $+ >		$@ OK
198706f25ae9SGregory Neil Shapiro	R$*			$#error $: 553 Header Error
198806f25ae9SGregory Neil Shapiro
198906f25ae9SGregory Neil Shapiro	Scheck_eoh
199006f25ae9SGregory Neil Shapiro	# Check the macro
199106f25ae9SGregory Neil Shapiro	R$*			$: < $&{MessageIdCheck} >
199206f25ae9SGregory Neil Shapiro	# Clear the macro for the next message
199306f25ae9SGregory Neil Shapiro	R$*			$: $(storage {MessageIdCheck} $) $1
199406f25ae9SGregory Neil Shapiro	# Has a Message-Id: header
199506f25ae9SGregory Neil Shapiro	R< $+ >			$@ OK
199606f25ae9SGregory Neil Shapiro	# Allow missing Message-Id: from local mail
199706f25ae9SGregory Neil Shapiro	R$*			$: < $&{client_name} >
199806f25ae9SGregory Neil Shapiro	R< >			$@ OK
199906f25ae9SGregory Neil Shapiro	R< $=w >		$@ OK
200006f25ae9SGregory Neil Shapiro	# Otherwise, reject the mail
200106f25ae9SGregory Neil Shapiro	R$*			$#error $: 553 Header Error
200206f25ae9SGregory Neil Shapiro
200342e5d165SGregory Neil Shapiro+----------+
200406f25ae9SGregory Neil Shapiro| STARTTLS |
200542e5d165SGregory Neil Shapiro+----------+
200606f25ae9SGregory Neil Shapiro
200706f25ae9SGregory Neil ShapiroIn this text, cert will be used as an abreviation for X.509 certificate,
200806f25ae9SGregory Neil ShapiroDN is the distinguished name of a cert, and CA is a certification authority.
200906f25ae9SGregory Neil Shapiro
201006f25ae9SGregory Neil ShapiroMacros related to STARTTLS are:
201106f25ae9SGregory Neil Shapiro
201206f25ae9SGregory Neil Shapiro${cert_issuer} holds the DN of the CA (the cert issuer).
201306f25ae9SGregory Neil Shapiro${cert_subject} holds the DN of the cert (called the cert subject).
201406f25ae9SGregory Neil Shapiro${tls_version} the TLS/SSL version used for the connection, e.g., TLSv1,
201506f25ae9SGregory Neil Shapiro	SSLv3, SSLv2.
201606f25ae9SGregory Neil Shapiro${cipher} the cipher used for the connection, e.g., EDH-DSS-DES-CBC3-SHA,
201706f25ae9SGregory Neil Shapiro	EDH-RSA-DES-CBC-SHA, DES-CBC-MD5, DES-CBC3-SHA.
201806f25ae9SGregory Neil Shapiro${cipher_bits} the keylength (in bits) of the symmetric encryption algorithm
201906f25ae9SGregory Neil Shapiro	used for the connection.
202006f25ae9SGregory Neil Shapiro${verify} holds the result of the verification of the presented cert. Possible
202106f25ae9SGregory Neil Shapiro	values are:
202206f25ae9SGregory Neil Shapiro	OK	verification succeeded.
202306f25ae9SGregory Neil Shapiro	NO	no cert presented.
202406f25ae9SGregory Neil Shapiro	FAIL	cert presented but could not be verified, e.g., the signing
202506f25ae9SGregory Neil Shapiro		CA is missing.
202606f25ae9SGregory Neil Shapiro	NONE	STARTTLS has not been performed.
202706f25ae9SGregory Neil Shapiro	TEMP	temporary error occurred.
202806f25ae9SGregory Neil Shapiro	PROTOCOL some protocol error occurred.
202906f25ae9SGregory Neil Shapiro	SOFTWARE STARTTLS handshake failed.
203006f25ae9SGregory Neil Shapiro${server_name}	the name of the server of the current outgoing SMTP
203106f25ae9SGregory Neil Shapiro	connection.
203206f25ae9SGregory Neil Shapiro${server_addr}	the address of the server of the current outgoing SMTP
203306f25ae9SGregory Neil Shapiro	connection.
203406f25ae9SGregory Neil Shapiro
203506f25ae9SGregory Neil ShapiroRelaying
203606f25ae9SGregory Neil Shapiro
203706f25ae9SGregory Neil ShapiroSMTP STARTTLS can allow relaying for senders who have successfully
203806f25ae9SGregory Neil Shapiroauthenticated themselves. This is done in the ruleset RelayAuth. If the
203906f25ae9SGregory Neil Shapiroverification of the cert failed (${verify} != OK), relaying is subject to
204006f25ae9SGregory Neil Shapirothe usual rules. Otherwise the DN of the issuer is looked up in the access
204106f25ae9SGregory Neil Shapiromap using the tag CERTISSUER. If the resulting value is RELAY, relaying is
204206f25ae9SGregory Neil Shapiroallowed. If it is SUBJECT, the DN of the cert subject is looked up next in
204306f25ae9SGregory Neil Shapirothe access map. using the tag CERTSUBJECT. If the value is RELAY, relaying
204406f25ae9SGregory Neil Shapirois allowed.
204506f25ae9SGregory Neil Shapiro
204606f25ae9SGregory Neil ShapiroTo make things a bit more flexible (or complicated), the values for
204706f25ae9SGregory Neil Shapiro${cert_issuer} and ${cert_subject} can be optionally modified by regular
204806f25ae9SGregory Neil Shapiroexpressions defined in the m4 variables _CERT_REGEX_ISSUER_ and
204906f25ae9SGregory Neil Shapiro_CERT_REGEX_SUBJECT_, respectively. To avoid problems with those macros in
205006f25ae9SGregory Neil Shapirorulesets and map lookups, they are modified as follows: each non-printable
205106f25ae9SGregory Neil Shapirocharacter and the characters '<', '>', '(', ')', '"', '+' are replaced by
205206f25ae9SGregory Neil Shapirotheir HEX value with a leading '+'. For example:
205306f25ae9SGregory Neil Shapiro
205406f25ae9SGregory Neil Shapiro/C=US/ST=California/O=endmail.org/OU=private/CN=Darth Mail (Cert)/Email=
205506f25ae9SGregory Neil Shapirodarth+cert@endmail.org
205606f25ae9SGregory Neil Shapiro
205706f25ae9SGregory Neil Shapirois encoded as:
205806f25ae9SGregory Neil Shapiro
205906f25ae9SGregory Neil Shapiro/C=US/ST=California/O=endmail.org/OU=private/CN=
206006f25ae9SGregory Neil ShapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org
206106f25ae9SGregory Neil Shapiro
206206f25ae9SGregory Neil Shapiro(line breaks have been inserted for readability).
206306f25ae9SGregory Neil Shapiro
206406f25ae9SGregory Neil ShapiroOf course it is also possible to write a simple rulesets that allows
206506f25ae9SGregory Neil Shapirorelaying for everyone who can present a cert that can be verified, e.g.,
206606f25ae9SGregory Neil Shapiro
206706f25ae9SGregory Neil ShapiroLOCAL_RULESETS
206806f25ae9SGregory Neil ShapiroSLocal_check_rcpt
206906f25ae9SGregory Neil ShapiroR$*	$: $&{verify}
207006f25ae9SGregory Neil ShapiroROK	$# OK
207106f25ae9SGregory Neil Shapiro
207206f25ae9SGregory Neil ShapiroAllowing Connections
207306f25ae9SGregory Neil Shapiro
207406f25ae9SGregory Neil ShapiroThe rulesets tls_server and tls_client are used to decide whether an SMTP
207506f25ae9SGregory Neil Shapiroconnection is accepted (or should continue).
207606f25ae9SGregory Neil Shapiro
207706f25ae9SGregory Neil Shapirotls_server is called when sendmail acts as client after a STARTTLS command
207806f25ae9SGregory Neil Shapiro(should) have been issued. The parameter is the value of ${verify}.
207906f25ae9SGregory Neil Shapiro
208006f25ae9SGregory Neil Shapirotls_client is called when sendmail acts as server, after a STARTTLS command
208106f25ae9SGregory Neil Shapirohas been issued, and from check_mail. The parameter is the value of
208206f25ae9SGregory Neil Shapiro${verify} and STARTTLS or MAIL, respectively.
208306f25ae9SGregory Neil Shapiro
208406f25ae9SGregory Neil ShapiroBoth rulesets behave the same. If no access map is in use, the connection
208506f25ae9SGregory Neil Shapirowill be accepted unless ${verify} is SOFTWARE, in which case the connection
208606f25ae9SGregory Neil Shapirois always aborted.  Otherwise, ${client_name} (${server_name}) is looked
208706f25ae9SGregory Neil Shapiroup in the access map using the tag TLS_Srv (or TLS_Clt), which is done
208806f25ae9SGregory Neil Shapirowith the ruleset LookUpDomain. If no entry is found, ${client_addr}
208906f25ae9SGregory Neil Shapiro(${server_addr}) is looked up in the access map (same tag, ruleset
209006f25ae9SGregory Neil ShapiroLookUpAddr). If this doesn't result in an entry either, just the tag is
209106f25ae9SGregory Neil Shapirolooked up in the access map (included the trailing :).  The result of the
209206f25ae9SGregory Neil Shapirolookups is then used to call the ruleset tls_connection, which checks the
209306f25ae9SGregory Neil Shapirorequirement specified by the RHS in the access map against the actual
209406f25ae9SGregory Neil Shapiroparameters of the current TLS connection, esp. ${verify} and
209506f25ae9SGregory Neil Shapiro${cipher_bits}. Legal RHSs in the access map are:
209606f25ae9SGregory Neil Shapiro
209706f25ae9SGregory Neil ShapiroVERIFY		verification must have succeeded
209806f25ae9SGregory Neil ShapiroVERIFY:bits	verification must have succeeded and ${cipher_bits} must
209906f25ae9SGregory Neil Shapiro		be greater than or equal bits.
210006f25ae9SGregory Neil ShapiroENCR:bits	${cipher_bits} must be greater than or equal bits.
210106f25ae9SGregory Neil Shapiro
210206f25ae9SGregory Neil ShapiroThe RHS can optionally be prefixed by TEMP+ or PERM+ to select a temporary
210306f25ae9SGregory Neil Shapiroor permanent error. The default is a temporary error code (403 4.7.0)
210406f25ae9SGregory Neil Shapirounless the macro TLS_PERM_ERR is set during generation of the .cf file.
210506f25ae9SGregory Neil Shapiro
210606f25ae9SGregory Neil ShapiroIf a certain level of encryption is required, then it might also be
210706f25ae9SGregory Neil Shapiropossible that this level is provided by the security layer from a SASL
210806f25ae9SGregory Neil Shapiroalgorithm, e.g., DIGEST-MD5.
210906f25ae9SGregory Neil Shapiro
211006f25ae9SGregory Neil ShapiroExample: e-mail send to secure.example.com should only use an encrypted
211106f25ae9SGregory Neil Shapiroconnection. e-mail received from hosts within the laptop.example.com domain
211206f25ae9SGregory Neil Shapiroshould only be accepted if they have been authenticated.
211306f25ae9SGregory Neil ShapiroTLS_Srv:secure.example.com      ENCR:112
211406f25ae9SGregory Neil ShapiroTLS_Clt:laptop.example.com      PERM+VERIFY:112
211506f25ae9SGregory Neil Shapiro
211606f25ae9SGregory Neil ShapiroReceived: Header
211706f25ae9SGregory Neil Shapiro
211806f25ae9SGregory Neil ShapiroThe Received: header reveals whether STARTTLS has been used. It contains an
211906f25ae9SGregory Neil Shapiroextra line:
212006f25ae9SGregory Neil Shapiro
212106f25ae9SGregory Neil Shapiro(using ${tls_version} with cipher ${cipher} (${cipher_bits} bits) verified ${verify})
212206f25ae9SGregory Neil Shapiro
212342e5d165SGregory Neil Shapiro+---------------------+
212406f25ae9SGregory Neil Shapiro| SMTP AUTHENTICATION |
212542e5d165SGregory Neil Shapiro+---------------------+
212606f25ae9SGregory Neil Shapiro
212706f25ae9SGregory Neil ShapiroThe macros ${auth_authen}, ${auth_author}, and ${auth_type} can be
212806f25ae9SGregory Neil Shapiroused in anti-relay rulesets to allow relaying for those users that
212906f25ae9SGregory Neil Shapiroauthenticated themselves.  A very simple example is:
213006f25ae9SGregory Neil Shapiro
213106f25ae9SGregory Neil ShapiroSLocal_check_rcpt
213206f25ae9SGregory Neil ShapiroR$*		$: $&{auth_type}
213306f25ae9SGregory Neil ShapiroR$+		$# OK
213406f25ae9SGregory Neil Shapiro
213506f25ae9SGregory Neil Shapirowhich checks whether a user has successfully authenticated using
213606f25ae9SGregory Neil Shapiroany available mechanism.  Depending on the setup of the CYRUS SASL
213706f25ae9SGregory Neil Shapirolibrary, more sophisticated rulesets might be required, e.g.,
213806f25ae9SGregory Neil Shapiro
213906f25ae9SGregory Neil ShapiroSLocal_check_rcpt
214006f25ae9SGregory Neil ShapiroR$*		$: $&{auth_type} $| $&{auth_authen}
214106f25ae9SGregory Neil ShapiroRDIGEST-MD5 $| $+@$=w	$# OK
214206f25ae9SGregory Neil Shapiro
214306f25ae9SGregory Neil Shapiroto allow relaying for users that authenticated using DIGEST-MD5
214406f25ae9SGregory Neil Shapiroand have an identity in the local domains.
214506f25ae9SGregory Neil Shapiro
214606f25ae9SGregory Neil ShapiroThe ruleset Strust_auth is used to determine whether a given AUTH=
214706f25ae9SGregory Neil Shapiroparameter (that is passed to this ruleset) should be trusted.  This
214806f25ae9SGregory Neil Shapiroruleset may make use of the other ${auth_*} macros.  Only if the
214906f25ae9SGregory Neil Shapiroruleset resolves to the error mailer, the AUTH= parameter is not
215006f25ae9SGregory Neil Shapirotrusted.  A user supplied ruleset Local_trust_auth can be written
215106f25ae9SGregory Neil Shapiroto modify the default behavior, which only trust the AUTH=
215206f25ae9SGregory Neil Shapiroparameter if it is identical to the authenticated user.
215306f25ae9SGregory Neil Shapiro
215406f25ae9SGregory Neil ShapiroPer default, relaying is allowed for any user who authenticated
215506f25ae9SGregory Neil Shapirovia a "trusted" mechanism, i.e., one that is defined via
215606f25ae9SGregory Neil ShapiroTRUST_AUTH_MECH(`list of mechanisms')
2157193538b7SGregory Neil ShapiroFor example:
2158193538b7SGregory Neil ShapiroTRUST_AUTH_MECH(`KERBEROS_V4 DIGEST-MD5')
215906f25ae9SGregory Neil Shapiro
216006f25ae9SGregory Neil ShapiroIf the selected mechanism provides a security layer the number of
216106f25ae9SGregory Neil Shapirobits used for the key of the symmetric cipher is stored in the
216206f25ae9SGregory Neil Shapiromacro ${auth_ssf}.
2163c2aa98e2SPeter Wemm
2164c2aa98e2SPeter Wemm+--------------------------------+
2165c2aa98e2SPeter Wemm| ADDING NEW MAILERS OR RULESETS |
2166c2aa98e2SPeter Wemm+--------------------------------+
2167c2aa98e2SPeter Wemm
2168c2aa98e2SPeter WemmSometimes you may need to add entirely new mailers or rulesets.  They
2169c2aa98e2SPeter Wemmshould be introduced with the constructs MAILER_DEFINITIONS and
2170c2aa98e2SPeter WemmLOCAL_RULESETS respectively.  For example:
2171c2aa98e2SPeter Wemm
2172c2aa98e2SPeter Wemm	MAILER_DEFINITIONS
2173c2aa98e2SPeter Wemm	Mmymailer, ...
2174c2aa98e2SPeter Wemm	...
2175c2aa98e2SPeter Wemm
2176c2aa98e2SPeter Wemm	LOCAL_RULESETS
2177c2aa98e2SPeter Wemm	Smyruleset
2178c2aa98e2SPeter Wemm	...
2179c2aa98e2SPeter Wemm
2180c2aa98e2SPeter Wemm
218106f25ae9SGregory Neil Shapiro#if _FFR_MILTER
2182193538b7SGregory Neil Shapiro+-------------------------+
2183193538b7SGregory Neil Shapiro| ADDING NEW MAIL FILTERS |
2184193538b7SGregory Neil Shapiro+-------------------------+
218506f25ae9SGregory Neil Shapiro
218606f25ae9SGregory Neil ShapiroSendmail supports mail filters to filter incoming SMTP messages according
218706f25ae9SGregory Neil Shapiroto the "Sendmail Mail Filter API" documentation.  These filters can be
218806f25ae9SGregory Neil Shapiroconfigured in your mc file using the two commands:
218906f25ae9SGregory Neil Shapiro
219006f25ae9SGregory Neil Shapiro	MAIL_FILTER(`name', `equates')
219106f25ae9SGregory Neil Shapiro	INPUT_MAIL_FILTER(`name', `equates')
219206f25ae9SGregory Neil Shapiro
219306f25ae9SGregory Neil ShapiroThe first command, MAIL_FILTER(), simply defines a filter with the given
219406f25ae9SGregory Neil Shapironame and equates.  For example:
219506f25ae9SGregory Neil Shapiro
219606f25ae9SGregory Neil Shapiro	MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
219706f25ae9SGregory Neil Shapiro
219806f25ae9SGregory Neil ShapiroThis creates the equivalent sendmail.cf entry:
219906f25ae9SGregory Neil Shapiro
220006f25ae9SGregory Neil Shapiro	Xarchive, S=local:/var/run/archivesock, F=R
220106f25ae9SGregory Neil Shapiro
220206f25ae9SGregory Neil ShapiroThe INPUT_MAIL_FILTER() command performs the same actions as MAIL_FILTER
220306f25ae9SGregory Neil Shapirobut also populates the m4 variable `confINPUT_MAIL_FILTERS' with the name
220406f25ae9SGregory Neil Shapiroof the filter such that the filter will actually be called by sendmail.
220506f25ae9SGregory Neil Shapiro
220606f25ae9SGregory Neil ShapiroFor example, the two commands:
220706f25ae9SGregory Neil Shapiro
220806f25ae9SGregory Neil Shapiro	INPUT_MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
220906f25ae9SGregory Neil Shapiro	INPUT_MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T')
221006f25ae9SGregory Neil Shapiro
221106f25ae9SGregory Neil Shapiroare equivalent to the three commands:
221206f25ae9SGregory Neil Shapiro
221306f25ae9SGregory Neil Shapiro	MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
221406f25ae9SGregory Neil Shapiro	MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T')
221506f25ae9SGregory Neil Shapiro	define(`confINPUT_MAIL_FILTERS', `archive, spamcheck')
221606f25ae9SGregory Neil Shapiro
221706f25ae9SGregory Neil ShapiroIn general, INPUT_MAIL_FILTER() should be used unless you need to define
221806f25ae9SGregory Neil Shapiromore filters than you want to use for `confINPUT_MAIL_FILTERS'.
221906f25ae9SGregory Neil Shapiro
222006f25ae9SGregory Neil ShapiroNote that setting `confINPUT_MAIL_FILTERS' after any INPUT_MAIL_FILTER()
222106f25ae9SGregory Neil Shapirocommands will clear the list created by the prior INPUT_MAIL_FILTER()
222206f25ae9SGregory Neil Shapirocommands.
222306f25ae9SGregory Neil Shapiro#endif /* _FFR_MILTER */
222406f25ae9SGregory Neil Shapiro
222506f25ae9SGregory Neil Shapiro
2226c2aa98e2SPeter Wemm+-------------------------------+
2227c2aa98e2SPeter Wemm| NON-SMTP BASED CONFIGURATIONS |
2228c2aa98e2SPeter Wemm+-------------------------------+
2229c2aa98e2SPeter Wemm
223006f25ae9SGregory Neil ShapiroThese configuration files are designed primarily for use by
223106f25ae9SGregory Neil ShapiroSMTP-based sites.  They may not be well tuned for UUCP-only or
2232c2aa98e2SPeter WemmUUCP-primarily nodes (the latter is defined as a small local net
223306f25ae9SGregory Neil Shapiroconnected to the rest of the world via UUCP).  However, there is
223406f25ae9SGregory Neil Shapiroone hook to handle some special cases.
2235c2aa98e2SPeter Wemm
2236c2aa98e2SPeter WemmYou can define a ``smart host'' that understands a richer address syntax
2237c2aa98e2SPeter Wemmusing:
2238c2aa98e2SPeter Wemm
22392e43090eSPeter Wemm	define(`SMART_HOST', `mailer:hostname')
2240c2aa98e2SPeter Wemm
2241c2aa98e2SPeter WemmIn this case, the ``mailer:'' defaults to "relay".  Any messages that
2242c2aa98e2SPeter Wemmcan't be handled using the usual UUCP rules are passed to this host.
2243c2aa98e2SPeter Wemm
2244c2aa98e2SPeter WemmIf you are on a local SMTP-based net that connects to the outside
2245c2aa98e2SPeter Wemmworld via UUCP, you can use LOCAL_NET_CONFIG to add appropriate rules.
2246c2aa98e2SPeter WemmFor example:
2247c2aa98e2SPeter Wemm
224806f25ae9SGregory Neil Shapiro	define(`SMART_HOST', `uucp-new:uunet')
2249c2aa98e2SPeter Wemm	LOCAL_NET_CONFIG
2250c2aa98e2SPeter Wemm	R$* < @ $* .$m. > $*	$#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3
2251c2aa98e2SPeter Wemm
2252c2aa98e2SPeter WemmThis will cause all names that end in your domain name ($m) via
225306f25ae9SGregory Neil ShapiroSMTP; anything else will be sent via uucp-new (smart UUCP) to uunet.
22542e43090eSPeter WemmIf you have FEATURE(`nocanonify'), you may need to omit the dots after
2255c2aa98e2SPeter Wemmthe $m.  If you are running a local DNS inside your domain which is
2256c2aa98e2SPeter Wemmnot otherwise connected to the outside world, you probably want to
2257c2aa98e2SPeter Wemmuse:
2258c2aa98e2SPeter Wemm
22592e43090eSPeter Wemm	define(`SMART_HOST', `smtp:fire.wall.com')
2260c2aa98e2SPeter Wemm	LOCAL_NET_CONFIG
2261c2aa98e2SPeter Wemm	R$* < @ $* . > $*	$#smtp $@ $2. $: $1 < @ $2. > $3
2262c2aa98e2SPeter Wemm
2263c2aa98e2SPeter WemmThat is, send directly only to things you found in your DNS lookup;
2264c2aa98e2SPeter Wemmanything else goes through SMART_HOST.
2265c2aa98e2SPeter Wemm
2266c2aa98e2SPeter WemmYou may need to turn off the anti-spam rules in order to accept
22672e43090eSPeter WemmUUCP mail with FEATURE(`promiscuous_relay') and
22682e43090eSPeter WemmFEATURE(`accept_unresolvable_domains').
2269c2aa98e2SPeter Wemm
2270c2aa98e2SPeter Wemm
2271c2aa98e2SPeter Wemm+-----------+
2272c2aa98e2SPeter Wemm| WHO AM I? |
2273c2aa98e2SPeter Wemm+-----------+
2274c2aa98e2SPeter Wemm
2275c2aa98e2SPeter WemmNormally, the $j macro is automatically defined to be your fully
2276c2aa98e2SPeter Wemmqualified domain name (FQDN).  Sendmail does this by getting your
2277c2aa98e2SPeter Wemmhost name using gethostname and then calling gethostbyname on the
2278c2aa98e2SPeter Wemmresult.  For example, in some environments gethostname returns
2279c2aa98e2SPeter Wemmonly the root of the host name (such as "foo"); gethostbyname is
2280c2aa98e2SPeter Wemmsupposed to return the FQDN ("foo.bar.com").  In some (fairly rare)
2281c2aa98e2SPeter Wemmcases, gethostbyname may fail to return the FQDN.  In this case
2282c2aa98e2SPeter Wemmyou MUST define confDOMAIN_NAME to be your fully qualified domain
2283c2aa98e2SPeter Wemmname.  This is usually done using:
2284c2aa98e2SPeter Wemm
2285c2aa98e2SPeter Wemm	Dmbar.com
2286c2aa98e2SPeter Wemm	define(`confDOMAIN_NAME', `$w.$m')dnl
2287c2aa98e2SPeter Wemm
2288c2aa98e2SPeter Wemm
228906f25ae9SGregory Neil Shapiro+-----------------------------------+
229006f25ae9SGregory Neil Shapiro| ACCEPTING MAIL FOR MULTIPLE NAMES |
229106f25ae9SGregory Neil Shapiro+-----------------------------------+
229206f25ae9SGregory Neil Shapiro
229306f25ae9SGregory Neil ShapiroIf your host is known by several different names, you need to augment
229406f25ae9SGregory Neil Shapiroclass {w}.  This is a list of names by which your host is known, and
229506f25ae9SGregory Neil Shapiroanything sent to an address using a host name in this list will be
229606f25ae9SGregory Neil Shapirotreated as local mail.  You can do this in two ways:  either create the
229706f25ae9SGregory Neil Shapirofile /etc/mail/local-host-names containing a list of your aliases (one per
229806f25ae9SGregory Neil Shapiroline), and use ``FEATURE(`use_cw_file')'' in the .mc file, or add
229906f25ae9SGregory Neil Shapiro``LOCAL_DOMAIN(`alias.host.name')''.  Be sure you use the fully-qualified
230006f25ae9SGregory Neil Shapironame of the host, rather than a short name.
230106f25ae9SGregory Neil Shapiro
230206f25ae9SGregory Neil ShapiroIf you want to have different address in different domains, take
230306f25ae9SGregory Neil Shapiroa look at the virtusertable feature, which is also explained at
230406f25ae9SGregory Neil Shapirohttp://www.sendmail.org/virtual-hosting.html
230506f25ae9SGregory Neil Shapiro
230606f25ae9SGregory Neil Shapiro
2307c2aa98e2SPeter Wemm+--------------------+
2308c2aa98e2SPeter Wemm| USING MAILERTABLES |
2309c2aa98e2SPeter Wemm+--------------------+
2310c2aa98e2SPeter Wemm
23112e43090eSPeter WemmTo use FEATURE(`mailertable'), you will have to create an external
2312c2aa98e2SPeter Wemmdatabase containing the routing information for various domains.
2313c2aa98e2SPeter WemmFor example, a mailertable file in text format might be:
2314c2aa98e2SPeter Wemm
2315c2aa98e2SPeter Wemm	.my.domain		xnet:%1.my.domain
231606f25ae9SGregory Neil Shapiro	uuhost1.my.domain	uucp-new:uuhost1
2317c2aa98e2SPeter Wemm	.bitnet			smtp:relay.bit.net
2318c2aa98e2SPeter Wemm
231906f25ae9SGregory Neil ShapiroThis should normally be stored in /etc/mail/mailertable.  The actual
2320c2aa98e2SPeter Wemmdatabase version of the mailertable is built using:
2321c2aa98e2SPeter Wemm
232206f25ae9SGregory Neil Shapiro	makemap hash /etc/mail/mailertable < /etc/mail/mailertable
2323c2aa98e2SPeter Wemm
2324c2aa98e2SPeter WemmThe semantics are simple.  Any LHS entry that does not begin with
2325c2aa98e2SPeter Wemma dot matches the full host name indicated.  LHS entries beginning
232642e5d165SGregory Neil Shapirowith a dot match anything ending with that domain name (including
232742e5d165SGregory Neil Shapirothe leading dot) -- that is, they can be thought of as having a
232842e5d165SGregory Neil Shapiroleading ".+" regular expression pattern for a non-empty sequence of
232942e5d165SGregory Neil Shapirocharacters.  Matching is done in order of most-to-least qualified
233042e5d165SGregory Neil Shapiro-- for example, even though ".my.domain" is listed first in the
233142e5d165SGregory Neil Shapiroabove example, an entry of "uuhost1.my.domain" will match the second
233242e5d165SGregory Neil Shapiroentry since it is more explicit.  Note: e-mail to "user@my.domain"
233342e5d165SGregory Neil Shapirodoes not match any entry in the above table.  You need to have
233442e5d165SGregory Neil Shapirosomething like:
233506f25ae9SGregory Neil Shapiro
233606f25ae9SGregory Neil Shapiro	my.domain		esmtp:host.my.domain
2337c2aa98e2SPeter Wemm
2338c2aa98e2SPeter WemmThe RHS should always be a "mailer:host" pair.  The mailer is the
233906f25ae9SGregory Neil Shapiroconfiguration name of a mailer (that is, an {M} line in the
2340c2aa98e2SPeter Wemmsendmail.cf file).  The "host" will be the hostname passed to
2341c2aa98e2SPeter Wemmthat mailer.  In domain-based matches (that is, those with leading
2342c2aa98e2SPeter Wemmdots) the "%1" may be used to interpolate the wildcarded part of
2343c2aa98e2SPeter Wemmthe host name.  For example, the first line above sends everything
2344c2aa98e2SPeter Wemmaddressed to "anything.my.domain" to that same host name, but using
2345c2aa98e2SPeter Wemmthe (presumably experimental) xnet mailer.
2346c2aa98e2SPeter Wemm
2347c2aa98e2SPeter WemmIn some cases you may want to temporarily turn off MX records,
2348c2aa98e2SPeter Wemmparticularly on gateways.  For example, you may want to MX
2349c2aa98e2SPeter Wemmeverything in a domain to one machine that then forwards it
2350c2aa98e2SPeter Wemmdirectly.  To do this, you might use the DNS configuration:
2351c2aa98e2SPeter Wemm
2352c2aa98e2SPeter Wemm	*.domain.	IN	MX	0	relay.machine
2353c2aa98e2SPeter Wemm
2354c2aa98e2SPeter Wemmand on relay.machine use the mailertable:
2355c2aa98e2SPeter Wemm
2356c2aa98e2SPeter Wemm	.domain		smtp:[gateway.domain]
2357c2aa98e2SPeter Wemm
2358c2aa98e2SPeter WemmThe [square brackets] turn off MX records for this host only.
2359c2aa98e2SPeter WemmIf you didn't do this, the mailertable would use the MX record
2360c2aa98e2SPeter Wemmagain, which would give you an MX loop.
2361c2aa98e2SPeter Wemm
2362c2aa98e2SPeter Wemm
2363c2aa98e2SPeter Wemm+--------------------------------+
2364c2aa98e2SPeter Wemm| USING USERDB TO MAP FULL NAMES |
2365c2aa98e2SPeter Wemm+--------------------------------+
2366c2aa98e2SPeter Wemm
2367c2aa98e2SPeter WemmThe user database was not originally intended for mapping full names
2368c2aa98e2SPeter Wemmto login names (e.g., Eric.Allman => eric), but some people are using
236906f25ae9SGregory Neil Shapiroit that way.  (it is recommended that you set up aliases for this
2370c2aa98e2SPeter Wemmpurpose instead -- since you can specify multiple alias files, this
2371c2aa98e2SPeter Wemmis fairly easy.)  The intent was to locate the default maildrop at
2372c2aa98e2SPeter Wemma site, but allow you to override this by sending to a specific host.
2373c2aa98e2SPeter Wemm
2374c2aa98e2SPeter WemmIf you decide to set up the user database in this fashion, it is
23752e43090eSPeter Wemmimperative that you not use FEATURE(`stickyhost') -- otherwise,
2376c2aa98e2SPeter Wemme-mail sent to Full.Name@local.host.name will be rejected.
2377c2aa98e2SPeter Wemm
2378c2aa98e2SPeter WemmTo build the internal form of the user database, use:
2379c2aa98e2SPeter Wemm
238006f25ae9SGregory Neil Shapiro	makemap btree /etc/mail/userdb < /etc/mail/userdb.txt
2381c2aa98e2SPeter Wemm
238206f25ae9SGregory Neil ShapiroAs a general rule, it is an extremely bad idea to using full names
238306f25ae9SGregory Neil Shapiroas e-mail addresses, since they are not in any sense unique.  For
238442e5d165SGregory Neil Shapiroexample, the UNIX software-development community has at least two
238506f25ae9SGregory Neil Shapirowell-known Peter Deutsches, and at one time Bell Labs had two
238606f25ae9SGregory Neil ShapiroStephen R. Bournes with offices along the same hallway.  Which one
238706f25ae9SGregory Neil Shapirowill be forced to suffer the indignity of being Stephen_R_Bourne_2?
238806f25ae9SGregory Neil ShapiroThe less famous of the two, or the one that was hired later?
2389c2aa98e2SPeter Wemm
2390c2aa98e2SPeter WemmFinger should handle full names (and be fuzzy).  Mail should use
239106f25ae9SGregory Neil Shapirohandles, and not be fuzzy.
2392c2aa98e2SPeter Wemm
2393c2aa98e2SPeter Wemm
2394c2aa98e2SPeter Wemm+--------------------------------+
2395c2aa98e2SPeter Wemm| MISCELLANEOUS SPECIAL FEATURES |
2396c2aa98e2SPeter Wemm+--------------------------------+
2397c2aa98e2SPeter Wemm
2398c2aa98e2SPeter WemmPlussed users
2399c2aa98e2SPeter Wemm	Sometimes it is convenient to merge configuration on a
2400c2aa98e2SPeter Wemm	centralized mail machine, for example, to forward all
2401c2aa98e2SPeter Wemm	root mail to a mail server.  In this case it might be
2402c2aa98e2SPeter Wemm	useful to be able to treat the root addresses as a class
2403c2aa98e2SPeter Wemm	of addresses with subtle differences.  You can do this
2404c2aa98e2SPeter Wemm	using plussed users.  For example, a client might include
2405c2aa98e2SPeter Wemm	the alias:
2406c2aa98e2SPeter Wemm
2407c2aa98e2SPeter Wemm		root:  root+client1@server
2408c2aa98e2SPeter Wemm
2409c2aa98e2SPeter Wemm	On the server, this will match an alias for "root+client1".
2410c2aa98e2SPeter Wemm	If that is not found, the alias "root+*" will be tried,
2411c2aa98e2SPeter Wemm	then "root".
2412c2aa98e2SPeter Wemm
2413c2aa98e2SPeter Wemm
2414c2aa98e2SPeter Wemm+----------------+
2415c2aa98e2SPeter Wemm| SECURITY NOTES |
2416c2aa98e2SPeter Wemm+----------------+
2417c2aa98e2SPeter Wemm
2418c2aa98e2SPeter WemmA lot of sendmail security comes down to you.  Sendmail 8 is much
2419c2aa98e2SPeter Wemmmore careful about checking for security problems than previous
2420c2aa98e2SPeter Wemmversions, but there are some things that you still need to watch
2421c2aa98e2SPeter Wemmfor.  In particular:
2422c2aa98e2SPeter Wemm
2423c2aa98e2SPeter Wemm* Make sure the aliases file isn't writable except by trusted
2424c2aa98e2SPeter Wemm  system personnel.  This includes both the text and database
2425c2aa98e2SPeter Wemm  version.
2426c2aa98e2SPeter Wemm
2427c2aa98e2SPeter Wemm* Make sure that other files that sendmail reads, such as the
2428c2aa98e2SPeter Wemm  mailertable, are only writable by trusted system personnel.
2429c2aa98e2SPeter Wemm
2430c2aa98e2SPeter Wemm* The queue directory should not be world writable PARTICULARLY
2431c2aa98e2SPeter Wemm  if your system allows "file giveaways" (that is, if a non-root
2432c2aa98e2SPeter Wemm  user can chown any file they own to any other user).
2433c2aa98e2SPeter Wemm
2434c2aa98e2SPeter Wemm* If your system allows file giveaways, DO NOT create a publically
2435c2aa98e2SPeter Wemm  writable directory for forward files.  This will allow anyone
2436c2aa98e2SPeter Wemm  to steal anyone else's e-mail.  Instead, create a script that
2437c2aa98e2SPeter Wemm  copies the .forward file from users' home directories once a
2438c2aa98e2SPeter Wemm  night (if you want the non-NFS-mounted forward directory).
2439c2aa98e2SPeter Wemm
2440c2aa98e2SPeter Wemm* If your system allows file giveaways, you'll find that
2441c2aa98e2SPeter Wemm  sendmail is much less trusting of :include: files -- in
2442c2aa98e2SPeter Wemm  particular, you'll have to have /SENDMAIL/ANY/SHELL/ in
2443c2aa98e2SPeter Wemm  /etc/shells before they will be trusted (that is, before
2444c2aa98e2SPeter Wemm  files and programs listed in them will be honored).
2445c2aa98e2SPeter Wemm
2446c2aa98e2SPeter WemmIn general, file giveaways are a mistake -- if you can turn them
244706f25ae9SGregory Neil Shapirooff, do so.
2448c2aa98e2SPeter Wemm
2449c2aa98e2SPeter Wemm
2450c2aa98e2SPeter Wemm+--------------------------------+
2451c2aa98e2SPeter Wemm| TWEAKING CONFIGURATION OPTIONS |
2452c2aa98e2SPeter Wemm+--------------------------------+
2453c2aa98e2SPeter Wemm
2454c2aa98e2SPeter WemmThere are a large number of configuration options that don't normally
2455c2aa98e2SPeter Wemmneed to be changed.  However, if you feel you need to tweak them, you
2456c2aa98e2SPeter Wemmcan define the following M4 variables.  This list is shown in four
2457c2aa98e2SPeter Wemmcolumns:  the name you define, the default value for that definition,
2458c2aa98e2SPeter Wemmthe option or macro that is affected (either Ox for an option or Dx
2459c2aa98e2SPeter Wemmfor a macro), and a brief description.  Greater detail of the semantics
2460c2aa98e2SPeter Wemmcan be found in the Installation and Operations Guide.
2461c2aa98e2SPeter Wemm
2462c2aa98e2SPeter WemmSome options are likely to be deprecated in future versions -- that is,
2463c2aa98e2SPeter Wemmthe option is only included to provide back-compatibility.  These are
2464c2aa98e2SPeter Wemmmarked with "*".
2465c2aa98e2SPeter Wemm
2466c2aa98e2SPeter WemmRemember that these options are M4 variables, and hence may need to
2467c2aa98e2SPeter Wemmbe quoted.  In particular, arguments with commas will usually have to
2468c2aa98e2SPeter Wemmbe ``double quoted, like this phrase'' to avoid having the comma
2469c2aa98e2SPeter Wemmconfuse things.  This is common for alias file definitions and for
2470c2aa98e2SPeter Wemmthe read timeout.
2471c2aa98e2SPeter Wemm
2472c2aa98e2SPeter WemmM4 Variable Name	Configuration	Description & [Default]
2473c2aa98e2SPeter Wemm================	=============	=======================
2474c2aa98e2SPeter WemmconfMAILER_NAME		$n macro	[MAILER-DAEMON] The sender name used
2475c2aa98e2SPeter Wemm					for internally generated outgoing
2476c2aa98e2SPeter Wemm					messages.
2477c2aa98e2SPeter WemmconfDOMAIN_NAME		$j macro	If defined, sets $j.  This should
2478c2aa98e2SPeter Wemm					only be done if your system cannot
2479c2aa98e2SPeter Wemm					determine your local domain name,
2480c2aa98e2SPeter Wemm					and then it should be set to
2481c2aa98e2SPeter Wemm					$w.Foo.COM, where Foo.COM is your
2482c2aa98e2SPeter Wemm					domain name.
2483c2aa98e2SPeter WemmconfCF_VERSION		$Z macro	If defined, this is appended to the
2484c2aa98e2SPeter Wemm					configuration version name.
2485c2aa98e2SPeter WemmconfFROM_HEADER		From:		[$?x$x <$g>$|$g$.] The format of an
2486c2aa98e2SPeter Wemm					internally generated From: address.
2487c2aa98e2SPeter WemmconfRECEIVED_HEADER	Received:
2488c2aa98e2SPeter Wemm		[$?sfrom $s $.$?_($?s$|from $.$_)
248906f25ae9SGregory Neil Shapiro			$.$?{auth_type}(authenticated)
2490c2aa98e2SPeter Wemm			$.by $j ($v/$Z)$?r with $r$. id $i$?u
2491c2aa98e2SPeter Wemm			for $u; $|;
2492c2aa98e2SPeter Wemm			$.$b]
2493c2aa98e2SPeter Wemm					The format of the Received: header
2494c2aa98e2SPeter Wemm					in messages passed through this host.
2495c2aa98e2SPeter Wemm					It is unwise to try to change this.
249606f25ae9SGregory Neil ShapiroconfCW_FILE		Fw class	[/etc/mail/local-host-names] Name
249706f25ae9SGregory Neil Shapiro					of file used to get the local
249806f25ae9SGregory Neil Shapiro					additions to class {w} (local host
249906f25ae9SGregory Neil Shapiro					names).
250006f25ae9SGregory Neil ShapiroconfCT_FILE		Ft class	[/etc/mail/trusted-users] Name of
250106f25ae9SGregory Neil Shapiro					file used to get the local additions
250206f25ae9SGregory Neil Shapiro					to class {t} (trusted users).
2503c2aa98e2SPeter WemmconfCR_FILE		FR class	[/etc/mail/relay-domains] Name of
2504c2aa98e2SPeter Wemm					file used to get the local additions
250506f25ae9SGregory Neil Shapiro					to class {R} (hosts allowed to relay).
2506c2aa98e2SPeter WemmconfTRUSTED_USERS	Ct class	[no default] Names of users to add to
2507c2aa98e2SPeter Wemm					the list of trusted users.  This list
2508c2aa98e2SPeter Wemm					always includes root, uucp, and daemon.
25092e43090eSPeter Wemm					See also FEATURE(`use_ct_file').
251006f25ae9SGregory Neil ShapiroconfTRUSTED_USER	TrustedUser	[no default] Trusted user for file
251106f25ae9SGregory Neil Shapiro					ownership and starting the daemon.
251206f25ae9SGregory Neil Shapiro					Not to be confused with
251306f25ae9SGregory Neil Shapiro					confTRUSTED_USERS (see above).
2514c2aa98e2SPeter WemmconfSMTP_MAILER		-		[esmtp] The mailer name used when
2515c2aa98e2SPeter Wemm					SMTP connectivity is required.
251606f25ae9SGregory Neil Shapiro					One of "smtp", "smtp8",
251706f25ae9SGregory Neil Shapiro					"esmtp", or "dsmtp".
2518c2aa98e2SPeter WemmconfUUCP_MAILER		-		[uucp-old] The mailer to be used by
2519c2aa98e2SPeter Wemm					default for bang-format recipient
2520c2aa98e2SPeter Wemm					addresses.  See also discussion of
252106f25ae9SGregory Neil Shapiro					class {U}, class {Y}, and class {Z}
252206f25ae9SGregory Neil Shapiro					in the MAILER(`uucp') section.
2523c2aa98e2SPeter WemmconfLOCAL_MAILER	-		[local] The mailer name used when
2524c2aa98e2SPeter Wemm					local connectivity is required.
2525c2aa98e2SPeter Wemm					Almost always "local".
2526c2aa98e2SPeter WemmconfRELAY_MAILER	-		[relay] The default mailer name used
2527c2aa98e2SPeter Wemm					for relaying any mail (e.g., to a
2528c2aa98e2SPeter Wemm					BITNET_RELAY, a SMART_HOST, or
2529c2aa98e2SPeter Wemm					whatever).  This can reasonably be
2530c2aa98e2SPeter Wemm					"uucp-new" if you are on a
2531c2aa98e2SPeter Wemm					UUCP-connected site.
2532c2aa98e2SPeter WemmconfSEVEN_BIT_INPUT	SevenBitInput	[False] Force input to seven bits?
2533c2aa98e2SPeter WemmconfEIGHT_BIT_HANDLING	EightBitMode	[pass8] 8-bit data handling
2534c2aa98e2SPeter WemmconfALIAS_WAIT		AliasWait	[10m] Time to wait for alias file
2535c2aa98e2SPeter Wemm					rebuild until you get bored and
2536c2aa98e2SPeter Wemm					decide that the apparently pending
2537c2aa98e2SPeter Wemm					rebuild failed.
2538c2aa98e2SPeter WemmconfMIN_FREE_BLOCKS	MinFreeBlocks	[100] Minimum number of free blocks on
2539c2aa98e2SPeter Wemm					queue filesystem to accept SMTP mail.
2540c2aa98e2SPeter Wemm					(Prior to 8.7 this was minfree/maxsize,
2541c2aa98e2SPeter Wemm					where minfree was the number of free
2542c2aa98e2SPeter Wemm					blocks and maxsize was the maximum
2543c2aa98e2SPeter Wemm					message size.  Use confMAX_MESSAGE_SIZE
2544c2aa98e2SPeter Wemm					for the second value now.)
2545c2aa98e2SPeter WemmconfMAX_MESSAGE_SIZE	MaxMessageSize	[infinite] The maximum size of messages
2546c2aa98e2SPeter Wemm					that will be accepted (in bytes).
2547c2aa98e2SPeter WemmconfBLANK_SUB		BlankSub	[.] Blank (space) substitution
2548c2aa98e2SPeter Wemm					character.
2549c2aa98e2SPeter WemmconfCON_EXPENSIVE	HoldExpensive	[False] Avoid connecting immediately
255006f25ae9SGregory Neil Shapiro					to mailers marked expensive.
2551c2aa98e2SPeter WemmconfCHECKPOINT_INTERVAL	CheckpointInterval
2552c2aa98e2SPeter Wemm					[10] Checkpoint queue files every N
2553c2aa98e2SPeter Wemm					recipients.
2554c2aa98e2SPeter WemmconfDELIVERY_MODE	DeliveryMode	[background] Default delivery mode.
2555c2aa98e2SPeter WemmconfAUTO_REBUILD	AutoRebuildAliases
2556c2aa98e2SPeter Wemm					[False] Automatically rebuild alias
2557c2aa98e2SPeter Wemm					file if needed.
255806f25ae9SGregory Neil Shapiro					There is a potential for a denial
255906f25ae9SGregory Neil Shapiro					of service attack if this is set.
256006f25ae9SGregory Neil Shapiro					This option is deprecated and will
256106f25ae9SGregory Neil Shapiro					be removed from a future version.
2562c2aa98e2SPeter WemmconfERROR_MODE		ErrorMode	[print] Error message mode.
2563c2aa98e2SPeter WemmconfERROR_MESSAGE	ErrorHeader	[undefined] Error message header/file.
2564065a643dSPeter WemmconfSAVE_FROM_LINES	SaveFromLine	Save extra leading From_ lines.
2565c2aa98e2SPeter WemmconfTEMP_FILE_MODE	TempFileMode	[0600] Temporary file mode.
2566c2aa98e2SPeter WemmconfMATCH_GECOS		MatchGECOS	[False] Match GECOS field.
2567c2aa98e2SPeter WemmconfMAX_HOP		MaxHopCount	[25] Maximum hop count.
256806f25ae9SGregory Neil ShapiroconfIGNORE_DOTS*	IgnoreDots	[False; always False in -bs or -bd
256906f25ae9SGregory Neil Shapiro					mode] Ignore dot as terminator for
257006f25ae9SGregory Neil Shapiro					incoming messages?
2571c2aa98e2SPeter WemmconfBIND_OPTS		ResolverOptions	[undefined] Default options for DNS
2572c2aa98e2SPeter Wemm					resolver.
2573c2aa98e2SPeter WemmconfMIME_FORMAT_ERRORS*	SendMimeErrors	[True] Send error messages as MIME-
2574c2aa98e2SPeter Wemm					encapsulated messages per RFC 1344.
2575c2aa98e2SPeter WemmconfFORWARD_PATH	ForwardPath	[$z/.forward.$w:$z/.forward]
2576c2aa98e2SPeter Wemm					The colon-separated list of places to
2577c2aa98e2SPeter Wemm					search for .forward files.  N.B.: see
2578c2aa98e2SPeter Wemm					the Security Notes section.
2579c2aa98e2SPeter WemmconfMCI_CACHE_SIZE	ConnectionCacheSize
2580c2aa98e2SPeter Wemm					[2] Size of open connection cache.
2581c2aa98e2SPeter WemmconfMCI_CACHE_TIMEOUT	ConnectionCacheTimeout
2582c2aa98e2SPeter Wemm					[5m] Open connection cache timeout.
2583c2aa98e2SPeter WemmconfHOST_STATUS_DIRECTORY HostStatusDirectory
2584c2aa98e2SPeter Wemm					[undefined] If set, host status is kept
2585c2aa98e2SPeter Wemm					on disk between sendmail runs in the
2586c2aa98e2SPeter Wemm					named directory tree.  This need not be
2587c2aa98e2SPeter Wemm					a full pathname, in which case it is
2588c2aa98e2SPeter Wemm					interpreted relative to the queue
2589c2aa98e2SPeter Wemm					directory.
2590c2aa98e2SPeter WemmconfSINGLE_THREAD_DELIVERY  SingleThreadDelivery
2591c2aa98e2SPeter Wemm					[False] If this option and the
2592c2aa98e2SPeter Wemm					HostStatusDirectory option are both
2593c2aa98e2SPeter Wemm					set, single thread deliveries to other
2594c2aa98e2SPeter Wemm					hosts.  That is, don't allow any two
2595c2aa98e2SPeter Wemm					sendmails on this host to connect
2596c2aa98e2SPeter Wemm					simultaneously to any other single
2597c2aa98e2SPeter Wemm					host.  This can slow down delivery in
2598c2aa98e2SPeter Wemm					some cases, in particular since a
2599c2aa98e2SPeter Wemm					cached but otherwise idle connection
2600c2aa98e2SPeter Wemm					to a host will prevent other sendmails
2601c2aa98e2SPeter Wemm					from connecting to the other host.
260206f25ae9SGregory Neil ShapiroconfUSE_ERRORS_TO*	UseErrorsTo	[False] Use the Errors-To: header to
2603c2aa98e2SPeter Wemm					deliver error messages.  This should
2604c2aa98e2SPeter Wemm					not be necessary because of general
2605c2aa98e2SPeter Wemm					acceptance of the envelope/header
2606c2aa98e2SPeter Wemm					distinction.
2607c2aa98e2SPeter WemmconfLOG_LEVEL		LogLevel	[9] Log level.
260806f25ae9SGregory Neil ShapiroconfME_TOO		MeToo		[True] Include sender in group
260906f25ae9SGregory Neil Shapiro					expansions.  This option is
261006f25ae9SGregory Neil Shapiro					deprecated and will be removed from
261106f25ae9SGregory Neil Shapiro					a future version.
2612c2aa98e2SPeter WemmconfCHECK_ALIASES	CheckAliases	[False] Check RHS of aliases when
2613c2aa98e2SPeter Wemm					running newaliases.  Since this does
2614c2aa98e2SPeter Wemm					DNS lookups on every address, it can
2615c2aa98e2SPeter Wemm					slow down the alias rebuild process
2616c2aa98e2SPeter Wemm					considerably on large alias files.
2617c2aa98e2SPeter WemmconfOLD_STYLE_HEADERS*	OldStyleHeaders	[True] Assume that headers without
2618c2aa98e2SPeter Wemm					special chars are old style.
261906f25ae9SGregory Neil ShapiroconfCLIENT_OPTIONS	ClientPortOptions
262006f25ae9SGregory Neil Shapiro					[none] Options for outgoing SMTP client
262106f25ae9SGregory Neil Shapiro					connections.
2622c2aa98e2SPeter WemmconfPRIVACY_FLAGS	PrivacyOptions	[authwarnings] Privacy flags.
2623c2aa98e2SPeter WemmconfCOPY_ERRORS_TO	PostmasterCopy	[undefined] Address for additional
2624c2aa98e2SPeter Wemm					copies of all error messages.
2625c2aa98e2SPeter WemmconfQUEUE_FACTOR	QueueFactor	[600000] Slope of queue-only function.
2626c2aa98e2SPeter WemmconfDONT_PRUNE_ROUTES	DontPruneRoutes	[False] Don't prune down route-addr
2627c2aa98e2SPeter Wemm					syntax addresses to the minimum
2628c2aa98e2SPeter Wemm					possible.
2629c2aa98e2SPeter WemmconfSAFE_QUEUE*		SuperSafe	[True] Commit all messages to disk
2630c2aa98e2SPeter Wemm					before forking.
2631c2aa98e2SPeter WemmconfTO_INITIAL		Timeout.initial	[5m] The timeout waiting for a response
2632c2aa98e2SPeter Wemm					on the initial connect.
2633c2aa98e2SPeter WemmconfTO_CONNECT		Timeout.connect	[0] The timeout waiting for an initial
2634c2aa98e2SPeter Wemm					connect() to complete.  This can only
2635c2aa98e2SPeter Wemm					shorten connection timeouts; the kernel
2636c2aa98e2SPeter Wemm					silently enforces an absolute maximum
2637c2aa98e2SPeter Wemm					(which varies depending on the system).
2638c2aa98e2SPeter WemmconfTO_ICONNECT		Timeout.iconnect
2639c2aa98e2SPeter Wemm					[undefined] Like Timeout.connect, but
2640c2aa98e2SPeter Wemm					applies only to the very first attempt
2641c2aa98e2SPeter Wemm					to connect to a host in a message.
2642c2aa98e2SPeter Wemm					This allows a single very fast pass
2643c2aa98e2SPeter Wemm					followed by more careful delivery
2644c2aa98e2SPeter Wemm					attempts in the future.
2645c2aa98e2SPeter WemmconfTO_HELO		Timeout.helo	[5m] The timeout waiting for a response
2646c2aa98e2SPeter Wemm					to a HELO or EHLO command.
2647c2aa98e2SPeter WemmconfTO_MAIL		Timeout.mail	[10m] The timeout waiting for a
2648c2aa98e2SPeter Wemm					response to the MAIL command.
2649c2aa98e2SPeter WemmconfTO_RCPT		Timeout.rcpt	[1h] The timeout waiting for a response
2650c2aa98e2SPeter Wemm					to the RCPT command.
2651c2aa98e2SPeter WemmconfTO_DATAINIT		Timeout.datainit
2652c2aa98e2SPeter Wemm					[5m] The timeout waiting for a 354
2653c2aa98e2SPeter Wemm					response from the DATA command.
2654c2aa98e2SPeter WemmconfTO_DATABLOCK	Timeout.datablock
2655c2aa98e2SPeter Wemm					[1h] The timeout waiting for a block
2656c2aa98e2SPeter Wemm					during DATA phase.
2657c2aa98e2SPeter WemmconfTO_DATAFINAL	Timeout.datafinal
2658c2aa98e2SPeter Wemm					[1h] The timeout waiting for a response
2659c2aa98e2SPeter Wemm					to the final "." that terminates a
2660c2aa98e2SPeter Wemm					message.
2661c2aa98e2SPeter WemmconfTO_RSET		Timeout.rset	[5m] The timeout waiting for a response
2662c2aa98e2SPeter Wemm					to the RSET command.
2663c2aa98e2SPeter WemmconfTO_QUIT		Timeout.quit	[2m] The timeout waiting for a response
2664c2aa98e2SPeter Wemm					to the QUIT command.
2665c2aa98e2SPeter WemmconfTO_MISC		Timeout.misc	[2m] The timeout waiting for a response
2666c2aa98e2SPeter Wemm					to other SMTP commands.
266706f25ae9SGregory Neil ShapiroconfTO_COMMAND		Timeout.command	[1h] In server SMTP, the timeout
266806f25ae9SGregory Neil Shapiro					waiting	for a command to be issued.
266906f25ae9SGregory Neil ShapiroconfTO_IDENT		Timeout.ident	[5s] The timeout waiting for a
267006f25ae9SGregory Neil Shapiro					response to an IDENT query.
2671c2aa98e2SPeter WemmconfTO_FILEOPEN		Timeout.fileopen
2672c2aa98e2SPeter Wemm					[60s] The timeout waiting for a file
2673c2aa98e2SPeter Wemm					(e.g., :include: file) to be opened.
267406f25ae9SGregory Neil ShapiroconfTO_CONTROL		Timeout.control
267506f25ae9SGregory Neil Shapiro					[2m] The timeout for a complete
267606f25ae9SGregory Neil Shapiro					control socket transaction to complete.
2677c2aa98e2SPeter WemmconfTO_QUEUERETURN	Timeout.queuereturn
2678c2aa98e2SPeter Wemm					[5d] The timeout before a message is
2679c2aa98e2SPeter Wemm					returned as undeliverable.
2680c2aa98e2SPeter WemmconfTO_QUEUERETURN_NORMAL
2681c2aa98e2SPeter Wemm			Timeout.queuereturn.normal
2682c2aa98e2SPeter Wemm					[undefined] As above, for normal
2683c2aa98e2SPeter Wemm					priority messages.
2684c2aa98e2SPeter WemmconfTO_QUEUERETURN_URGENT
2685c2aa98e2SPeter Wemm			Timeout.queuereturn.urgent
2686c2aa98e2SPeter Wemm					[undefined] As above, for urgent
2687c2aa98e2SPeter Wemm					priority messages.
2688c2aa98e2SPeter WemmconfTO_QUEUERETURN_NONURGENT
2689c2aa98e2SPeter Wemm			Timeout.queuereturn.non-urgent
2690c2aa98e2SPeter Wemm					[undefined] As above, for non-urgent
2691c2aa98e2SPeter Wemm					(low) priority messages.
2692c2aa98e2SPeter WemmconfTO_QUEUEWARN	Timeout.queuewarn
2693c2aa98e2SPeter Wemm					[4h] The timeout before a warning
2694c2aa98e2SPeter Wemm					message is sent to the sender telling
269506f25ae9SGregory Neil Shapiro					them that the message has been
269606f25ae9SGregory Neil Shapiro					deferred.
2697c2aa98e2SPeter WemmconfTO_QUEUEWARN_NORMAL	Timeout.queuewarn.normal
2698c2aa98e2SPeter Wemm					[undefined] As above, for normal
2699c2aa98e2SPeter Wemm					priority messages.
2700c2aa98e2SPeter WemmconfTO_QUEUEWARN_URGENT	Timeout.queuewarn.urgent
2701c2aa98e2SPeter Wemm					[undefined] As above, for urgent
2702c2aa98e2SPeter Wemm					priority messages.
2703c2aa98e2SPeter WemmconfTO_QUEUEWARN_NONURGENT
2704c2aa98e2SPeter Wemm			Timeout.queuewarn.non-urgent
2705c2aa98e2SPeter Wemm					[undefined] As above, for non-urgent
2706c2aa98e2SPeter Wemm					(low) priority messages.
2707c2aa98e2SPeter WemmconfTO_HOSTSTATUS	Timeout.hoststatus
2708c2aa98e2SPeter Wemm					[30m] How long information about host
2709c2aa98e2SPeter Wemm					statuses will be maintained before it
2710c2aa98e2SPeter Wemm					is considered stale and the host should
2711c2aa98e2SPeter Wemm					be retried.  This applies both within
2712c2aa98e2SPeter Wemm					a single queue run and to persistent
2713c2aa98e2SPeter Wemm					information (see below).
271406f25ae9SGregory Neil ShapiroconfTO_RESOLVER_RETRANS	Timeout.resolver.retrans
271506f25ae9SGregory Neil Shapiro					[varies] Sets the resolver's
271606f25ae9SGregory Neil Shapiro					retransmition time interval (in
271706f25ae9SGregory Neil Shapiro					seconds).  Sets both
271806f25ae9SGregory Neil Shapiro					Timeout.resolver.retrans.first and
271906f25ae9SGregory Neil Shapiro					Timeout.resolver.retrans.normal.
272006f25ae9SGregory Neil ShapiroconfTO_RESOLVER_RETRANS_FIRST  Timeout.resolver.retrans.first
272106f25ae9SGregory Neil Shapiro					[varies] Sets the resolver's
272206f25ae9SGregory Neil Shapiro					retransmition time interval (in
272306f25ae9SGregory Neil Shapiro					seconds) for the first attempt to
272406f25ae9SGregory Neil Shapiro					deliver a message.
272506f25ae9SGregory Neil ShapiroconfTO_RESOLVER_RETRANS_NORMAL  Timeout.resolver.retrans.normal
272606f25ae9SGregory Neil Shapiro					[varies] Sets the resolver's
272706f25ae9SGregory Neil Shapiro					retransmition time interval (in
272806f25ae9SGregory Neil Shapiro					seconds) for all resolver lookups
272906f25ae9SGregory Neil Shapiro					except the first delivery attempt.
273006f25ae9SGregory Neil ShapiroconfTO_RESOLVER_RETRY	Timeout.resolver.retry
273106f25ae9SGregory Neil Shapiro					[varies] Sets the number of times
273206f25ae9SGregory Neil Shapiro					to retransmit a resolver query.
273306f25ae9SGregory Neil Shapiro					Sets both
273406f25ae9SGregory Neil Shapiro					Timeout.resolver.retry.first and
273506f25ae9SGregory Neil Shapiro					Timeout.resolver.retry.normal.
273606f25ae9SGregory Neil ShapiroconfTO_RESOLVER_RETRY_FIRST  Timeout.resolver.retry.first
273706f25ae9SGregory Neil Shapiro					[varies] Sets the number of times
273806f25ae9SGregory Neil Shapiro					to retransmit a resolver query for
273906f25ae9SGregory Neil Shapiro					the first attempt to deliver a
274006f25ae9SGregory Neil Shapiro					message.
274106f25ae9SGregory Neil ShapiroconfTO_RESOLVER_RETRY_NORMAL  Timeout.resolver.retry.normal
274206f25ae9SGregory Neil Shapiro					[varies] Sets the number of times
274306f25ae9SGregory Neil Shapiro					to retransmit a resolver query for
274406f25ae9SGregory Neil Shapiro					all resolver lookups except the
274506f25ae9SGregory Neil Shapiro					first delivery attempt.
2746c2aa98e2SPeter WemmconfTIME_ZONE		TimeZoneSpec	[USE_SYSTEM] Time zone info -- can be
2747c2aa98e2SPeter Wemm					USE_SYSTEM to use the system's idea,
2748c2aa98e2SPeter Wemm					USE_TZ to use the user's TZ envariable,
2749c2aa98e2SPeter Wemm					or something else to force that value.
2750c2aa98e2SPeter WemmconfDEF_USER_ID		DefaultUser	[1:1] Default user id.
2751c2aa98e2SPeter WemmconfUSERDB_SPEC		UserDatabaseSpec
275206f25ae9SGregory Neil Shapiro					[undefined] User database
275306f25ae9SGregory Neil Shapiro					specification.
2754c2aa98e2SPeter WemmconfFALLBACK_MX		FallbackMXhost	[undefined] Fallback MX host.
275506f25ae9SGregory Neil ShapiroconfTRY_NULL_MX_LIST	TryNullMXList	[False] If this host is the best MX
275606f25ae9SGregory Neil Shapiro					for a host and other arrangements
275706f25ae9SGregory Neil Shapiro					haven't been made, try connecting
275806f25ae9SGregory Neil Shapiro					to the host directly; normally this
275906f25ae9SGregory Neil Shapiro					would be a config error.
276006f25ae9SGregory Neil ShapiroconfQUEUE_LA		QueueLA		[varies] Load average at which
276106f25ae9SGregory Neil Shapiro					queue-only function kicks in.
276206f25ae9SGregory Neil Shapiro					Default values is (8 * numproc)
276306f25ae9SGregory Neil Shapiro					where numproc is the number of
276406f25ae9SGregory Neil Shapiro					processors online (if that can be
276506f25ae9SGregory Neil Shapiro					determined).
276606f25ae9SGregory Neil ShapiroconfREFUSE_LA		RefuseLA	[varies] Load average at which
276706f25ae9SGregory Neil Shapiro					incoming SMTP connections are
276806f25ae9SGregory Neil Shapiro					refused.  Default values is (12 *
276906f25ae9SGregory Neil Shapiro					numproc) where numproc is the
277006f25ae9SGregory Neil Shapiro					number of processors online (if
277106f25ae9SGregory Neil Shapiro					that can be determined).
277206f25ae9SGregory Neil ShapiroconfMAX_ALIAS_RECURSION	MaxAliasRecursion
277306f25ae9SGregory Neil Shapiro					[10] Maximum depth of alias recursion.
2774c2aa98e2SPeter WemmconfMAX_DAEMON_CHILDREN	MaxDaemonChildren
2775c2aa98e2SPeter Wemm					[undefined] The maximum number of
2776c2aa98e2SPeter Wemm					children the daemon will permit.  After
2777c2aa98e2SPeter Wemm					this number, connections will be
2778c2aa98e2SPeter Wemm					rejected.  If not set or <= 0, there is
2779c2aa98e2SPeter Wemm					no limit.
278006f25ae9SGregory Neil ShapiroconfMAX_HEADERS_LENGTH	MaxHeadersLength
2781193538b7SGregory Neil Shapiro					[32768] Maximum length of the sum
278206f25ae9SGregory Neil Shapiro					of all headers.
278306f25ae9SGregory Neil ShapiroconfMAX_MIME_HEADER_LENGTH  MaxMimeHeaderLength
278406f25ae9SGregory Neil Shapiro					[undefined] Maximum length of
278506f25ae9SGregory Neil Shapiro					certain MIME header field values.
2786c2aa98e2SPeter WemmconfCONNECTION_RATE_THROTTLE ConnectionRateThrottle
2787c2aa98e2SPeter Wemm					[undefined] The maximum number of
2788c2aa98e2SPeter Wemm					connections permitted per second.
2789c2aa98e2SPeter Wemm					After this many connections are
2790c2aa98e2SPeter Wemm					accepted, further connections will be
2791c2aa98e2SPeter Wemm					delayed.  If not set or <= 0, there is
2792c2aa98e2SPeter Wemm					no limit.
2793c2aa98e2SPeter WemmconfWORK_RECIPIENT_FACTOR
2794c2aa98e2SPeter Wemm			RecipientFactor	[30000] Cost of each recipient.
279506f25ae9SGregory Neil ShapiroconfSEPARATE_PROC	ForkEachJob	[False] Run all deliveries in a
279606f25ae9SGregory Neil Shapiro					separate process.
2797c2aa98e2SPeter WemmconfWORK_CLASS_FACTOR	ClassFactor	[1800] Priority multiplier for class.
2798c2aa98e2SPeter WemmconfWORK_TIME_FACTOR	RetryFactor	[90000] Cost of each delivery attempt.
2799c2aa98e2SPeter WemmconfQUEUE_SORT_ORDER	QueueSortOrder	[Priority] Queue sort algorithm:
280006f25ae9SGregory Neil Shapiro					Priority, Host, Filename, or Time.
2801c2aa98e2SPeter WemmconfMIN_QUEUE_AGE	MinQueueAge	[0] The minimum amount of time a job
2802c2aa98e2SPeter Wemm					must sit in the queue between queue
2803c2aa98e2SPeter Wemm					runs.  This allows you to set the
2804c2aa98e2SPeter Wemm					queue run interval low for better
2805c2aa98e2SPeter Wemm					responsiveness without trying all
2806c2aa98e2SPeter Wemm					jobs in each run.
2807c2aa98e2SPeter WemmconfDEF_CHAR_SET	DefaultCharSet	[unknown-8bit] When converting
2808c2aa98e2SPeter Wemm					unlabeled 8 bit input to MIME, the
2809c2aa98e2SPeter Wemm					character set to use by default.
2810c2aa98e2SPeter WemmconfSERVICE_SWITCH_FILE	ServiceSwitchFile
281106f25ae9SGregory Neil Shapiro					[/etc/mail/service.switch] The file
281206f25ae9SGregory Neil Shapiro					to use for the service switch on
281306f25ae9SGregory Neil Shapiro					systems that do not have a
281406f25ae9SGregory Neil Shapiro					system-defined switch.
2815c2aa98e2SPeter WemmconfHOSTS_FILE		HostsFile	[/etc/hosts] The file to use when doing
2816c2aa98e2SPeter Wemm					"file" type access of hosts names.
2817c2aa98e2SPeter WemmconfDIAL_DELAY		DialDelay	[0s] If a connection fails, wait this
2818c2aa98e2SPeter Wemm					long and try again.  Zero means "don't
2819c2aa98e2SPeter Wemm					retry".  This is to allow "dial on
2820c2aa98e2SPeter Wemm					demand" connections to have enough time
2821c2aa98e2SPeter Wemm					to complete a connection.
2822c2aa98e2SPeter WemmconfNO_RCPT_ACTION	NoRecipientAction
2823c2aa98e2SPeter Wemm					[none] What to do if there are no legal
2824c2aa98e2SPeter Wemm					recipient fields (To:, Cc: or Bcc:)
2825c2aa98e2SPeter Wemm					in the message.  Legal values can
2826c2aa98e2SPeter Wemm					be "none" to just leave the
2827c2aa98e2SPeter Wemm					nonconforming message as is, "add-to"
2828c2aa98e2SPeter Wemm					to add a To: header with all the
2829c2aa98e2SPeter Wemm					known recipients (which may expose
2830c2aa98e2SPeter Wemm					blind recipients), "add-apparently-to"
2831c2aa98e2SPeter Wemm					to do the same but use Apparently-To:
2832c2aa98e2SPeter Wemm					instead of To:, "add-bcc" to add an
2833c2aa98e2SPeter Wemm					empty Bcc: header, or
2834c2aa98e2SPeter Wemm					"add-to-undisclosed" to add the header
2835c2aa98e2SPeter Wemm					``To: undisclosed-recipients:;''.
2836c2aa98e2SPeter WemmconfSAFE_FILE_ENV	SafeFileEnvironment
2837c2aa98e2SPeter Wemm					[undefined] If set, sendmail will do a
2838c2aa98e2SPeter Wemm					chroot() into this directory before
2839c2aa98e2SPeter Wemm					writing files.
2840c2aa98e2SPeter WemmconfCOLON_OK_IN_ADDR	ColonOkInAddr	[True unless Configuration Level > 6]
2841c2aa98e2SPeter Wemm					If set, colons are treated as a regular
2842c2aa98e2SPeter Wemm					character in addresses.  If not set,
2843c2aa98e2SPeter Wemm					they are treated as the introducer to
2844c2aa98e2SPeter Wemm					the RFC 822 "group" syntax.  Colons are
2845c2aa98e2SPeter Wemm					handled properly in route-addrs.  This
2846c2aa98e2SPeter Wemm					option defaults on for V5 and lower
2847c2aa98e2SPeter Wemm					configuration files.
2848c2aa98e2SPeter WemmconfMAX_QUEUE_RUN_SIZE	MaxQueueRunSize	[0] If set, limit the maximum size of
2849c2aa98e2SPeter Wemm					any given queue run to this number of
2850c2aa98e2SPeter Wemm					entries.  Essentially, this will stop
285106f25ae9SGregory Neil Shapiro					reading each queue directory after this
2852c2aa98e2SPeter Wemm					number of entries are reached; it does
2853c2aa98e2SPeter Wemm					_not_ pick the highest priority jobs,
2854c2aa98e2SPeter Wemm					so this should be as large as your
2855c2aa98e2SPeter Wemm					system can tolerate.  If not set, there
2856c2aa98e2SPeter Wemm					is no limit.
2857c2aa98e2SPeter WemmconfDONT_EXPAND_CNAMES	DontExpandCnames
2858c2aa98e2SPeter Wemm					[False] If set, $[ ... $] lookups that
2859c2aa98e2SPeter Wemm					do DNS based lookups do not expand
2860c2aa98e2SPeter Wemm					CNAME records.  This currently violates
2861c2aa98e2SPeter Wemm					the published standards, but the IETF
2862c2aa98e2SPeter Wemm					seems to be moving toward legalizing
2863c2aa98e2SPeter Wemm					this.  For example, if "FTP.Foo.ORG"
2864c2aa98e2SPeter Wemm					is a CNAME for "Cruft.Foo.ORG", then
2865c2aa98e2SPeter Wemm					with this option set a lookup of
2866c2aa98e2SPeter Wemm					"FTP" will return "FTP.Foo.ORG"; if
2867c2aa98e2SPeter Wemm					clear it returns "Cruft.FOO.ORG".  N.B.
2868c2aa98e2SPeter Wemm					you may not see any effect until your
2869c2aa98e2SPeter Wemm					downstream neighbors stop doing CNAME
2870c2aa98e2SPeter Wemm					lookups as well.
2871c2aa98e2SPeter WemmconfFROM_LINE		UnixFromLine	[From $g $d] The From_ line used
2872c2aa98e2SPeter Wemm					when sending to files or programs.
2873c2aa98e2SPeter WemmconfSINGLE_LINE_FROM_HEADER  SingleLineFromHeader
2874c2aa98e2SPeter Wemm					[False] From: lines that have
2875c2aa98e2SPeter Wemm					embedded newlines are unwrapped
2876c2aa98e2SPeter Wemm					onto one line.
2877c2aa98e2SPeter WemmconfALLOW_BOGUS_HELO	AllowBogusHELO	[False] Allow HELO SMTP command that
2878c2aa98e2SPeter Wemm					does not include a host name.
2879c2aa98e2SPeter WemmconfMUST_QUOTE_CHARS	MustQuoteChars	[.'] Characters to be quoted in a full
2880c2aa98e2SPeter Wemm					name phrase (@,;:\()[] are automatic).
2881c2aa98e2SPeter WemmconfOPERATORS		OperatorChars	[.:%@!^/[]+] Address operator
2882c2aa98e2SPeter Wemm					characters.
2883c2aa98e2SPeter WemmconfSMTP_LOGIN_MSG	SmtpGreetingMessage
2884c2aa98e2SPeter Wemm					[$j Sendmail $v/$Z; $b]
2885c2aa98e2SPeter Wemm					The initial (spontaneous) SMTP
2886c2aa98e2SPeter Wemm					greeting message.  The word "ESMTP"
2887c2aa98e2SPeter Wemm					will be inserted between the first and
2888c2aa98e2SPeter Wemm					second words to convince other
2889c2aa98e2SPeter Wemm					sendmails to try to speak ESMTP.
2890c2aa98e2SPeter WemmconfDONT_INIT_GROUPS	DontInitGroups	[False] If set, the initgroups(3)
2891c2aa98e2SPeter Wemm					routine will never be invoked.  You
2892c2aa98e2SPeter Wemm					might want to do this if you are
2893c2aa98e2SPeter Wemm					running NIS and you have a large group
2894c2aa98e2SPeter Wemm					map, since this call does a sequential
2895c2aa98e2SPeter Wemm					scan of the map; in a large site this
2896c2aa98e2SPeter Wemm					can cause your ypserv to run
2897c2aa98e2SPeter Wemm					essentially full time.  If you set
2898c2aa98e2SPeter Wemm					this, agents run on behalf of users
2899c2aa98e2SPeter Wemm					will only have their primary
2900c2aa98e2SPeter Wemm					(/etc/passwd) group permissions.
2901c2aa98e2SPeter WemmconfUNSAFE_GROUP_WRITES	UnsafeGroupWrites
2902c2aa98e2SPeter Wemm					[False] If set, group-writable
2903c2aa98e2SPeter Wemm					:include: and .forward files are
2904c2aa98e2SPeter Wemm					considered "unsafe", that is, programs
2905c2aa98e2SPeter Wemm					and files cannot be directly referenced
2906c2aa98e2SPeter Wemm					from such files.  World-writable files
2907c2aa98e2SPeter Wemm					are always considered unsafe.
290806f25ae9SGregory Neil ShapiroconfCONNECT_ONLY_TO	ConnectOnlyTo	[undefined] override connection
290906f25ae9SGregory Neil Shapiro					address (for testing).
291006f25ae9SGregory Neil ShapiroconfCONTROL_SOCKET_NAME	ControlSocketName
291106f25ae9SGregory Neil Shapiro					[undefined] Control socket for daemon
291206f25ae9SGregory Neil Shapiro					management.
2913c2aa98e2SPeter WemmconfDOUBLE_BOUNCE_ADDRESS  DoubleBounceAddress
2914c2aa98e2SPeter Wemm					[postmaster] If an error occurs when
2915c2aa98e2SPeter Wemm					sending an error message, send that
2916c2aa98e2SPeter Wemm					"double bounce" error message to this
2917c2aa98e2SPeter Wemm					address.
291806f25ae9SGregory Neil ShapiroconfDEAD_LETTER_DROP	DeadLetterDrop	[undefined] Filename to save bounce
291906f25ae9SGregory Neil Shapiro					messages which could not be returned
292006f25ae9SGregory Neil Shapiro					to the user or sent to postmaster.
292106f25ae9SGregory Neil Shapiro					If not set, the queue file will
292206f25ae9SGregory Neil Shapiro					be renamed.
292306f25ae9SGregory Neil ShapiroconfRRT_IMPLIES_DSN	RrtImpliesDsn	[False] Return-Receipt-To: header
292406f25ae9SGregory Neil Shapiro					implies DSN request.
2925c2aa98e2SPeter WemmconfRUN_AS_USER		RunAsUser	[undefined] If set, become this user
2926c2aa98e2SPeter Wemm					when reading and delivering mail.
2927c2aa98e2SPeter Wemm					Causes all file reads (e.g., .forward
2928c2aa98e2SPeter Wemm					and :include: files) to be done as
2929c2aa98e2SPeter Wemm					this user.  Also, all programs will
2930c2aa98e2SPeter Wemm					be run as this user, and all output
2931c2aa98e2SPeter Wemm					files will be written as this user.
2932c2aa98e2SPeter Wemm					Intended for use only on firewalls
2933c2aa98e2SPeter Wemm					where users do not have accounts.
2934c2aa98e2SPeter WemmconfMAX_RCPTS_PER_MESSAGE  MaxRecipientsPerMessage
2935c2aa98e2SPeter Wemm					[infinite] If set, allow no more than
2936c2aa98e2SPeter Wemm					the specified number of recipients in
2937c2aa98e2SPeter Wemm					an SMTP envelope.  Further recipients
2938c2aa98e2SPeter Wemm					receive a 452 error code (i.e., they
2939c2aa98e2SPeter Wemm					are deferred for the next delivery
2940c2aa98e2SPeter Wemm					attempt).
2941c2aa98e2SPeter WemmconfDONT_PROBE_INTERFACES  DontProbeInterfaces
2942c2aa98e2SPeter Wemm					[False] If set, sendmail will _not_
2943c2aa98e2SPeter Wemm					insert the names and addresses of any
294406f25ae9SGregory Neil Shapiro					local interfaces into class {w}
2945c2aa98e2SPeter Wemm					(list of known "equivalent" addresses).
2946c2aa98e2SPeter Wemm					If you set this, you must also include
2947c2aa98e2SPeter Wemm					some support for these addresses (e.g.,
2948c2aa98e2SPeter Wemm					in a mailertable entry) -- otherwise,
2949c2aa98e2SPeter Wemm					mail to addresses in this list will
2950c2aa98e2SPeter Wemm					bounce with a configuration error.
295106f25ae9SGregory Neil ShapiroconfPID_FILE		PidFile		[system dependent] Location of pid
295206f25ae9SGregory Neil Shapiro					file.
295306f25ae9SGregory Neil ShapiroconfPROCESS_TITLE_PREFIX  ProcessTitlePrefix
295406f25ae9SGregory Neil Shapiro					[undefined] Prefix string for the
295506f25ae9SGregory Neil Shapiro					process title shown on 'ps' listings.
2956c2aa98e2SPeter WemmconfDONT_BLAME_SENDMAIL	DontBlameSendmail
2957c2aa98e2SPeter Wemm					[safe] Override sendmail's file
2958c2aa98e2SPeter Wemm					safety checks.  This will definitely
2959c2aa98e2SPeter Wemm					compromise system security and should
2960c2aa98e2SPeter Wemm					not be used unless absolutely
2961c2aa98e2SPeter Wemm					necessary.
2962c2aa98e2SPeter WemmconfREJECT_MSG		-		[550 Access denied] The message
2963c2aa98e2SPeter Wemm					given if the access database contains
2964c2aa98e2SPeter Wemm					REJECT in the value portion.
296506f25ae9SGregory Neil ShapiroconfDF_BUFFER_SIZE	DataFileBufferSize
296606f25ae9SGregory Neil Shapiro					[4096] The maximum size of a
296706f25ae9SGregory Neil Shapiro					memory-buffered data (df) file
296806f25ae9SGregory Neil Shapiro					before a disk-based file is used.
296906f25ae9SGregory Neil ShapiroconfXF_BUFFER_SIZE	XScriptFileBufferSize
297006f25ae9SGregory Neil Shapiro					[4096] The maximum size of a
297106f25ae9SGregory Neil Shapiro					memory-buffered transcript (xf)
297206f25ae9SGregory Neil Shapiro					file before a disk-based file is
297306f25ae9SGregory Neil Shapiro					used.
297406f25ae9SGregory Neil ShapiroconfAUTH_MECHANISMS	AuthMechanisms	[GSSAPI KERBEROS_V4 DIGEST-MD5
297506f25ae9SGregory Neil Shapiro					CRAM-MD5] List of authentication
297606f25ae9SGregory Neil Shapiro					mechanisms for AUTH (separated by
297706f25ae9SGregory Neil Shapiro					spaces).  The advertised list of
297806f25ae9SGregory Neil Shapiro					authentication mechanisms will be the
297906f25ae9SGregory Neil Shapiro					intersection of this list and the list
298006f25ae9SGregory Neil Shapiro					of available mechanisms as determined
298106f25ae9SGregory Neil Shapiro					by the CYRUS SASL library.
298206f25ae9SGregory Neil ShapiroconfDEF_AUTH_INFO	DefaultAuthInfo	[undefined] Filename that contains
298306f25ae9SGregory Neil Shapiro					authentication information for
298406f25ae9SGregory Neil Shapiro					outgoing connections.  This file
298506f25ae9SGregory Neil Shapiro					must contain the user id, the
298606f25ae9SGregory Neil Shapiro					authorization id, the password
298706f25ae9SGregory Neil Shapiro					(plain text), and the realm to use,
298806f25ae9SGregory Neil Shapiro					each on a separate line and must be
298906f25ae9SGregory Neil Shapiro					readable by root (or the trusted
299006f25ae9SGregory Neil Shapiro					user) only.  If no realm is
299106f25ae9SGregory Neil Shapiro					specified, $j is used.
299206f25ae9SGregory Neil Shapiro
299306f25ae9SGregory Neil Shapiro					NOTE: Currently, AuthMechanisms is
299406f25ae9SGregory Neil Shapiro					used to determine the list of
299506f25ae9SGregory Neil Shapiro					mechanisms to use on an outgoing
299606f25ae9SGregory Neil Shapiro					connection.  Sites which require a
299706f25ae9SGregory Neil Shapiro					different list of mechanisms for
299806f25ae9SGregory Neil Shapiro					incoming connections and outgoing
299906f25ae9SGregory Neil Shapiro					connections will have the ability
300006f25ae9SGregory Neil Shapiro					to do this in 8.11 by specifying a
300106f25ae9SGregory Neil Shapiro					list of mechanisms as the fifth
300206f25ae9SGregory Neil Shapiro					line of the DefaultAuthInfo file.
300306f25ae9SGregory Neil Shapiro					If no mechanisms are given in the
300406f25ae9SGregory Neil Shapiro					file, AuthMechanisms is used.  The
300506f25ae9SGregory Neil Shapiro					code for doing so is included as
300606f25ae9SGregory Neil Shapiro					in the sendmail source code but
300706f25ae9SGregory Neil Shapiro					disabled.  It can be enabled by
300806f25ae9SGregory Neil Shapiro					recompiling sendmail with:
300906f25ae9SGregory Neil Shapiro					-D_FFR_DEFAUTHINFO_MECHS
301006f25ae9SGregory Neil ShapiroconfAUTH_OPTIONS	AuthOptions	[undefined] If this options is 'A'
301106f25ae9SGregory Neil Shapiro					then the AUTH= parameter for the
301206f25ae9SGregory Neil Shapiro					MAIL FROM command is only issued
301306f25ae9SGregory Neil Shapiro					when authentication succeeded.
301406f25ae9SGregory Neil ShapiroconfLDAP_DEFAULT_SPEC	LDAPDefaultSpec	[undefined] Default map
301506f25ae9SGregory Neil Shapiro					specification for LDAP maps.  The
301606f25ae9SGregory Neil Shapiro					value should only contain LDAP
301706f25ae9SGregory Neil Shapiro					specific settings such as "-h host
301806f25ae9SGregory Neil Shapiro					-p port -d bindDN", etc.  The
301906f25ae9SGregory Neil Shapiro					settings will be used for all LDAP
302006f25ae9SGregory Neil Shapiro					maps unless they are specified in
302106f25ae9SGregory Neil Shapiro					the individual map specification
302206f25ae9SGregory Neil Shapiro					('K' command).
302306f25ae9SGregory Neil ShapiroconfCACERT_PATH		CACERTPath	[undefined] Path to directory
302406f25ae9SGregory Neil Shapiro					with certs of CAs.
302506f25ae9SGregory Neil ShapiroconfCACERT		CACERTFile	[undefined] File containing one CA
302606f25ae9SGregory Neil Shapiro					cert.
302706f25ae9SGregory Neil ShapiroconfSERVER_CERT		ServerCertFile	[undefined] File containing the
302806f25ae9SGregory Neil Shapiro					cert of the server, i.e., this cert
302906f25ae9SGregory Neil Shapiro					is used when sendmail acts as
303006f25ae9SGregory Neil Shapiro					server.
303106f25ae9SGregory Neil ShapiroconfSERVER_KEY		ServerKeyFile	[undefined] File containing the
303206f25ae9SGregory Neil Shapiro					private key belonging to the server
303306f25ae9SGregory Neil Shapiro					cert.
303406f25ae9SGregory Neil ShapiroconfCLIENT_CERT		ClientCertFile	[undefined] File containing the
303506f25ae9SGregory Neil Shapiro					cert of the client, i.e., this cert
303606f25ae9SGregory Neil Shapiro					is used when sendmail acts as
303706f25ae9SGregory Neil Shapiro					client.
303806f25ae9SGregory Neil ShapiroconfCLIENT_KEY		ClientKeyFile	[undefined] File containing the
303906f25ae9SGregory Neil Shapiro					private key belonging to the client
304006f25ae9SGregory Neil Shapiro					cert.
304106f25ae9SGregory Neil ShapiroconfDH_PARAMETERS	DHParameters	[undefined] File containing the
304206f25ae9SGregory Neil Shapiro					DH parameters.
304306f25ae9SGregory Neil ShapiroconfRAND_FILE		RandFile	[undefined] File containing random
304442e5d165SGregory Neil Shapiro					data (use prefix file:) or the
304542e5d165SGregory Neil Shapiro					name of the UNIX socket if EGD is
304642e5d165SGregory Neil Shapiro					used (use prefix egd:).  STARTTLS
304742e5d165SGregory Neil Shapiro					requires this option if the compile
304842e5d165SGregory Neil Shapiro					flag HASURANDOM is not set (see
304906f25ae9SGregory Neil Shapiro					sendmail/README).
3050c2aa98e2SPeter Wemm
3051c2aa98e2SPeter WemmSee also the description of OSTYPE for some parameters that can be
3052c2aa98e2SPeter Wemmtweaked (generally pathnames to mailers).
3053c2aa98e2SPeter Wemm
305406f25ae9SGregory Neil ShapiroDaemonPortOptions are a special case since multiple daemons can be
305506f25ae9SGregory Neil Shapirodefined.  This can be done via
305606f25ae9SGregory Neil Shapiro
305706f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`field1=value1,field2=value2,...')
305806f25ae9SGregory Neil Shapiro
305906f25ae9SGregory Neil ShapiroIf DAEMON_OPTIONS is not used, then the default is
306006f25ae9SGregory Neil Shapiro
306106f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Port=smtp, Name=MTA')
306206f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Port=587, Name=MSA, M=E')
306306f25ae9SGregory Neil Shapiro
306406f25ae9SGregory Neil ShapiroIf you use one DAEMON_OPTIONS macro, it will alter the parameters
306506f25ae9SGregory Neil Shapiroof the first of these.  The second will still be defaulted; it
306606f25ae9SGregory Neil Shapirorepresents a "Message Submission Agent" (MSA) as defined by RFC
306706f25ae9SGregory Neil Shapiro2476 (see below).  To turn off the default definition for the MSA,
306806f25ae9SGregory Neil Shapirouse FEATURE(`no_default_msa') (see also FEATURES).  If you use
306906f25ae9SGregory Neil Shapiroadditional DAEMON_OPTIONS macros, they will add additional daemons.
307006f25ae9SGregory Neil Shapiro
307106f25ae9SGregory Neil ShapiroExample 1:  To change the port for the SMTP listener, while
307206f25ae9SGregory Neil Shapirostill using the MSA default, use
307306f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Port=925, Name=MTA')
307406f25ae9SGregory Neil Shapiro
307506f25ae9SGregory Neil ShapiroExample 2:  To change the port for the MSA daemon, while still
307606f25ae9SGregory Neil Shapirousing the default SMTP port, use
307706f25ae9SGregory Neil Shapiro	FEATURE(`no_default_msa')
307806f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Name=MTA')
307906f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Port=987, Name=MSA, M=E')
308006f25ae9SGregory Neil Shapiro
308106f25ae9SGregory Neil ShapiroNote that if the first of those DAEMON_OPTIONS lines were omitted, then
308206f25ae9SGregory Neil Shapirothere would be no listener on the standard SMTP port.
308306f25ae9SGregory Neil Shapiro
308406f25ae9SGregory Neil ShapiroExample 3: To listen on both IPv4 and IPv6 interfaces, use
308506f25ae9SGregory Neil Shapiro
308606f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Name=MTA-v4, Family=inet')
308706f25ae9SGregory Neil Shapiro	DAEMON_OPTIONS(`Name=MTA-v6, Family=inet6')
308806f25ae9SGregory Neil Shapiro
308906f25ae9SGregory Neil ShapiroA "Message Submission Agent" still uses all of the same rulesets for
309006f25ae9SGregory Neil Shapiroprocessing the message (and therefore still allows message rejection via
309106f25ae9SGregory Neil Shapirothe check_* rulesets).  In accordance with the RFC, the MSA will ensure
309206f25ae9SGregory Neil Shapirothat all domains in the envelope are fully qualified if the message is
309306f25ae9SGregory Neil Shapirorelayed to another MTA.  It will also enforce the normal address syntax
309406f25ae9SGregory Neil Shapirorules and log error messages.  Additionally, by using the M=a modifier
309506f25ae9SGregory Neil Shapiroyou can require authentication before messages are accepted by the MSA.
309606f25ae9SGregory Neil ShapiroFinally, the M=E modifier shown above disables ETRN as required by RFC
309706f25ae9SGregory Neil Shapiro2476.
309806f25ae9SGregory Neil Shapiro
3099c2aa98e2SPeter Wemm
3100c2aa98e2SPeter Wemm+-----------+
3101c2aa98e2SPeter Wemm| HIERARCHY |
3102c2aa98e2SPeter Wemm+-----------+
3103c2aa98e2SPeter Wemm
3104c2aa98e2SPeter WemmWithin this directory are several subdirectories, to wit:
3105c2aa98e2SPeter Wemm
3106c2aa98e2SPeter Wemmm4		General support routines.  These are typically
3107c2aa98e2SPeter Wemm		very important and should not be changed without
3108c2aa98e2SPeter Wemm		very careful consideration.
3109c2aa98e2SPeter Wemm
3110c2aa98e2SPeter Wemmcf		The configuration files themselves.  They have
3111c2aa98e2SPeter Wemm		".mc" suffixes, and must be run through m4 to
3112c2aa98e2SPeter Wemm		become complete.  The resulting output should
3113c2aa98e2SPeter Wemm		have a ".cf" suffix.
3114c2aa98e2SPeter Wemm
3115c2aa98e2SPeter Wemmostype		Definitions describing a particular operating
3116c2aa98e2SPeter Wemm		system type.  These should always be referenced
3117c2aa98e2SPeter Wemm		using the OSTYPE macro in the .mc file.  Examples
3118c2aa98e2SPeter Wemm		include "bsd4.3", "bsd4.4", "sunos3.5", and
3119c2aa98e2SPeter Wemm		"sunos4.1".
3120c2aa98e2SPeter Wemm
3121c2aa98e2SPeter Wemmdomain		Definitions describing a particular domain, referenced
3122c2aa98e2SPeter Wemm		using the DOMAIN macro in the .mc file.  These are
3123c2aa98e2SPeter Wemm		site dependent; for example, "CS.Berkeley.EDU.m4"
3124c2aa98e2SPeter Wemm		describes hosts in the CS.Berkeley.EDU subdomain.
3125c2aa98e2SPeter Wemm
3126c2aa98e2SPeter Wemmmailer		Descriptions of mailers.  These are referenced using
3127c2aa98e2SPeter Wemm		the MAILER macro in the .mc file.
3128c2aa98e2SPeter Wemm
3129c2aa98e2SPeter Wemmsh		Shell files used when building the .cf file from the
3130c2aa98e2SPeter Wemm		.mc file in the cf subdirectory.
3131c2aa98e2SPeter Wemm
3132c2aa98e2SPeter Wemmfeature		These hold special orthogonal features that you might
3133c2aa98e2SPeter Wemm		want to include.  They should be referenced using
3134c2aa98e2SPeter Wemm		the FEATURE macro.
3135c2aa98e2SPeter Wemm
3136c2aa98e2SPeter Wemmhack		Local hacks.  These can be referenced using the HACK
3137c2aa98e2SPeter Wemm		macro.  They shouldn't be of more than voyeuristic
3138c2aa98e2SPeter Wemm		interest outside the .Berkeley.EDU domain, but who knows?
3139c2aa98e2SPeter Wemm
3140c2aa98e2SPeter Wemmsiteconfig	Site configuration -- e.g., tables of locally connected
3141c2aa98e2SPeter Wemm		UUCP sites.
3142c2aa98e2SPeter Wemm
3143c2aa98e2SPeter Wemm
3144c2aa98e2SPeter Wemm+------------------------+
3145c2aa98e2SPeter Wemm| ADMINISTRATIVE DETAILS |
3146c2aa98e2SPeter Wemm+------------------------+
3147c2aa98e2SPeter Wemm
3148c2aa98e2SPeter WemmThe following sections detail usage of certain internal parts of the
3149c2aa98e2SPeter Wemmsendmail.cf file.  Read them carefully if you are trying to modify
3150c2aa98e2SPeter Wemmthe current model.  If you find the above descriptions adequate, these
3151c2aa98e2SPeter Wemmshould be {boring, confusing, tedious, ridiculous} (pick one or more).
3152c2aa98e2SPeter Wemm
3153c2aa98e2SPeter WemmRULESETS (* means built in to sendmail)
3154c2aa98e2SPeter Wemm
3155c2aa98e2SPeter Wemm   0 *	Parsing
3156c2aa98e2SPeter Wemm   1 *	Sender rewriting
3157c2aa98e2SPeter Wemm   2 *	Recipient rewriting
3158c2aa98e2SPeter Wemm   3 *	Canonicalization
3159c2aa98e2SPeter Wemm   4 *	Post cleanup
3160c2aa98e2SPeter Wemm   5 *	Local address rewrite (after aliasing)
3161c2aa98e2SPeter Wemm  1x	mailer rules (sender qualification)
3162c2aa98e2SPeter Wemm  2x	mailer rules (recipient qualification)
3163c2aa98e2SPeter Wemm  3x	mailer rules (sender header qualification)
3164c2aa98e2SPeter Wemm  4x	mailer rules (recipient header qualification)
3165c2aa98e2SPeter Wemm  5x	mailer subroutines (general)
3166c2aa98e2SPeter Wemm  6x	mailer subroutines (general)
3167c2aa98e2SPeter Wemm  7x	mailer subroutines (general)
3168c2aa98e2SPeter Wemm  8x	reserved
3169c2aa98e2SPeter Wemm  90	Mailertable host stripping
3170c2aa98e2SPeter Wemm  96	Bottom half of Ruleset 3 (ruleset 6 in old sendmail)
3171c2aa98e2SPeter Wemm  97	Hook for recursive ruleset 0 call (ruleset 7 in old sendmail)
3172c2aa98e2SPeter Wemm  98	Local part of ruleset 0 (ruleset 8 in old sendmail)
3173c2aa98e2SPeter Wemm  99	Guaranteed null (for debugging)
3174c2aa98e2SPeter Wemm
3175c2aa98e2SPeter Wemm
3176c2aa98e2SPeter WemmMAILERS
3177c2aa98e2SPeter Wemm
3178c2aa98e2SPeter Wemm   0	local, prog	local and program mailers
3179c2aa98e2SPeter Wemm   1	[e]smtp, relay	SMTP channel
3180c2aa98e2SPeter Wemm   2	uucp-*		UNIX-to-UNIX Copy Program
3181c2aa98e2SPeter Wemm   3	netnews		Network News delivery
3182c2aa98e2SPeter Wemm   4	fax		Sam Leffler's HylaFAX software
3183c2aa98e2SPeter Wemm   5	mail11		DECnet mailer
3184c2aa98e2SPeter Wemm
3185c2aa98e2SPeter Wemm
3186c2aa98e2SPeter WemmMACROS
3187c2aa98e2SPeter Wemm
3188c2aa98e2SPeter Wemm   A
3189c2aa98e2SPeter Wemm   B	Bitnet Relay
3190c2aa98e2SPeter Wemm   C	DECnet Relay
3191c2aa98e2SPeter Wemm   D	The local domain -- usually not needed
3192c2aa98e2SPeter Wemm   E	reserved for X.400 Relay
3193c2aa98e2SPeter Wemm   F	FAX Relay
3194c2aa98e2SPeter Wemm   G
3195c2aa98e2SPeter Wemm   H	mail Hub (for mail clusters)
3196c2aa98e2SPeter Wemm   I
3197c2aa98e2SPeter Wemm   J
3198c2aa98e2SPeter Wemm   K
3199c2aa98e2SPeter Wemm   L	Luser Relay
320006f25ae9SGregory Neil Shapiro   M	Masquerade (who you claim to be)
3201c2aa98e2SPeter Wemm   N
3202c2aa98e2SPeter Wemm   O
3203c2aa98e2SPeter Wemm   P
3204c2aa98e2SPeter Wemm   Q
3205c2aa98e2SPeter Wemm   R	Relay (for unqualified names)
3206c2aa98e2SPeter Wemm   S	Smart Host
3207c2aa98e2SPeter Wemm   T
320806f25ae9SGregory Neil Shapiro   U	my UUCP name (if you have a UUCP connection)
320906f25ae9SGregory Neil Shapiro   V	UUCP Relay (class {V} hosts)
321006f25ae9SGregory Neil Shapiro   W	UUCP Relay (class {W} hosts)
321106f25ae9SGregory Neil Shapiro   X	UUCP Relay (class {X} hosts)
3212c2aa98e2SPeter Wemm   Y	UUCP Relay (all other hosts)
3213c2aa98e2SPeter Wemm   Z	Version number
3214c2aa98e2SPeter Wemm
3215c2aa98e2SPeter Wemm
3216c2aa98e2SPeter WemmCLASSES
3217c2aa98e2SPeter Wemm
3218c2aa98e2SPeter Wemm   A
3219c2aa98e2SPeter Wemm   B	domains that are candidates for bestmx lookup
3220c2aa98e2SPeter Wemm   C
3221c2aa98e2SPeter Wemm   D
3222c2aa98e2SPeter Wemm   E	addresses that should not seem to come from $M
322306f25ae9SGregory Neil Shapiro   F	hosts this system forward for
3224c2aa98e2SPeter Wemm   G	domains that should be looked up in genericstable
3225c2aa98e2SPeter Wemm   H
3226c2aa98e2SPeter Wemm   I
3227c2aa98e2SPeter Wemm   J
3228c2aa98e2SPeter Wemm   K
3229c2aa98e2SPeter Wemm   L	addresses that should not be forwarded to $R
3230c2aa98e2SPeter Wemm   M	domains that should be mapped to $M
323106f25ae9SGregory Neil Shapiro   N	host/domains that should not be mapped to $M
3232c2aa98e2SPeter Wemm   O	operators that indicate network operations (cannot be in local names)
3233c2aa98e2SPeter Wemm   P	top level pseudo-domains: BITNET, DECNET, FAX, UUCP, etc.
3234c2aa98e2SPeter Wemm   Q
323506f25ae9SGregory Neil Shapiro   R	domains this system is willing to relay (pass anti-spam filters)
3236c2aa98e2SPeter Wemm   S
3237c2aa98e2SPeter Wemm   T
3238c2aa98e2SPeter Wemm   U	locally connected UUCP hosts
3239c2aa98e2SPeter Wemm   V	UUCP hosts connected to relay $V
3240c2aa98e2SPeter Wemm   W	UUCP hosts connected to relay $W
3241c2aa98e2SPeter Wemm   X	UUCP hosts connected to relay $X
3242c2aa98e2SPeter Wemm   Y	locally connected smart UUCP hosts
3243c2aa98e2SPeter Wemm   Z	locally connected domain-ized UUCP hosts
3244c2aa98e2SPeter Wemm   .	the class containing only a dot
3245c2aa98e2SPeter Wemm   [	the class containing only a left bracket
3246c2aa98e2SPeter Wemm
3247c2aa98e2SPeter Wemm
3248c2aa98e2SPeter WemmM4 DIVERSIONS
3249c2aa98e2SPeter Wemm
3250c2aa98e2SPeter Wemm   1	Local host detection and resolution
3251c2aa98e2SPeter Wemm   2	Local Ruleset 3 additions
3252c2aa98e2SPeter Wemm   3	Local Ruleset 0 additions
3253c2aa98e2SPeter Wemm   4	UUCP Ruleset 0 additions
3254c2aa98e2SPeter Wemm   5	locally interpreted names (overrides $R)
3255c2aa98e2SPeter Wemm   6	local configuration (at top of file)
3256c2aa98e2SPeter Wemm   7	mailer definitions
325706f25ae9SGregory Neil Shapiro   8	DNS based blacklists
3258c2aa98e2SPeter Wemm   9	special local rulesets (1 and 2)
325906f25ae9SGregory Neil Shapiro
3260193538b7SGregory Neil Shapiro$Revision: 8.383.2.1.2.35 $, Last updated $Date: 2000/12/17 17:19:11 $
3261