README revision 64562
1
2		SENDMAIL CONFIGURATION FILES
3
4This document describes the sendmail configuration files.  This package
5requires a post-V7 version of m4; if you are running the 4.2bsd, SysV.2, or
67th Edition version.  SunOS's /usr/5bin/m4 or BSD-Net/2's m4 both work.
7GNU m4 version 1.1 or later also works.  Unfortunately, the M4 on BSDI 1.0
8doesn't work -- you'll have to use a Net/2 or GNU version.  GNU m4 is
9available from ftp://ftp.gnu.org/pub/gnu/m4-1.4.tar.gz (check for the
10latset version).  EXCEPTIONS: DEC's m4 on Digital UNIX 4.x is broken (3.x
11is fine).  Use GNU m4 on this platform.
12
13To get started, you may want to look at tcpproto.mc (for TCP-only sites),
14uucpproto.mc (for UUCP-only sites), and clientproto.mc (for clusters of
15clients using a single mail host).  Others are versions previously used at
16Berkeley.  For example, ucbvax has gone away, but ucbvax.mc demonstrates
17some interesting techniques.
18
19*******************************************************************
20***  BE SURE YOU CUSTOMIZE THESE FILES!  They have some		***
21***  Berkeley-specific assumptions built in, such as the name	***
22***  of their UUCP-relay.  You'll want to create your own	***
23***  domain description, and use that in place of		***
24***  domain/Berkeley.EDU.m4.					***
25*******************************************************************
26
27
28+--------------------------+
29| INTRODUCTION AND EXAMPLE |
30+--------------------------+
31
32Configuration files are contained in the subdirectory "cf", with a
33suffix ".mc".  They must be run through "m4" to produce a ".cf" file.
34You must pre-load "cf.m4":
35
36	m4 ${CFDIR}/m4/cf.m4 config.mc > config.cf
37
38Alternatively, you can simply:
39
40	cd ${CFDIR}/cf
41	./Build config.cf
42
43where ${CFDIR} is the root of the cf directory and config.mc is the
44name of your configuration file.  If you are running a version of M4
45that understands the __file__ builtin (versions of GNU m4 >= 0.75 do
46this, but the versions distributed with 4.4BSD and derivatives do not)
47or the -I flag (ditto), then ${CFDIR} can be in an arbitrary directory.
48For "traditional" versions, ${CFDIR} ***MUST*** be "..", or you MUST
49use -D_CF_DIR_=/path/to/cf/dir/ -- note the trailing slash!  For example:
50
51	m4 -D_CF_DIR_=${CFDIR}/ ${CFDIR}/m4/cf.m4 config.mc > config.cf
52
53Let's examine a typical .mc file:
54
55	divert(-1)
56	#
57	# Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
58	#	All rights reserved.
59	# Copyright (c) 1983 Eric P. Allman.  All rights reserved.
60	# Copyright (c) 1988, 1993
61	#	The Regents of the University of California.  All rights reserved.
62	#
63	# By using this file, you agree to the terms and conditions set
64	# forth in the LICENSE file which can be found at the top level of
65	# the sendmail distribution.
66	#
67
68	#
69	#  This is a Berkeley-specific configuration file for HP-UX 9.x.
70	#  It applies only to the Computer Science Division at Berkeley,
71	#  and should not be used elsewhere.   It is provided on the sendmail
72	#  distribution as a sample only.  To create your own configuration
73	#  file, create an appropriate domain file in ../domain, change the
74	#  `DOMAIN' macro below to reference that file, and copy the result
75	#  to a name of your own choosing.
76	#
77	divert(0)
78
79The divert(-1) will delete the crud in the resulting output file.
80The copyright notice can be replaced by whatever your lawyers require;
81our lawyers require the one that is included in these files.  A copyleft
82is a copyright by another name.  The divert(0) restores regular output.
83
84	VERSIONID(`<SCCS or RCS version id>')
85
86VERSIONID is a macro that stuffs the version information into the
87resulting file.  You could use SCCS, RCS, CVS, something else, or
88omit it completely.  This is not the same as the version id included
89in SMTP greeting messages -- this is defined in m4/version.m4.
90
91	OSTYPE(`hpux9')dnl
92
93You must specify an OSTYPE to properly configure things such as the
94pathname of the help and status files, the flags needed for the local
95mailer, and other important things.  If you omit it, you will get an
96error when you try to build the configuration.  Look at the ostype
97directory for the list of known operating system types.
98
99	DOMAIN(`CS.Berkeley.EDU')dnl
100
101This example is specific to the Computer Science Division at Berkeley.
102You can use "DOMAIN(`generic')" to get a sufficiently bland definition
103that may well work for you, or you can create a customized domain
104definition appropriate for your environment.
105
106	MAILER(`local')
107	MAILER(`smtp')
108
109These describe the mailers used at the default CS site.  The
110local mailer is always included automatically.  Beware: MAILER
111declarations should always be at the end of the configuration file,
112and MAILER(`smtp') should always precede MAILER(`procmail'), and
113MAILER(`uucp').  The general rules are that the order should be:
114
115	VERSIONID
116	OSTYPE
117	DOMAIN
118	FEATURE
119	local macro definitions
120	MAILER
121	LOCAL_RULE_*
122	LOCAL_RULESETS
123
124There are a few exceptions to this rule.  Local macro definitions which
125influence a FEATURE() should be done before that feature.  For example,
126a define(`PROCMAIL_MAILER_PATH', ...) should be done before
127FEATURE(`local_procmail').
128
129
130+----------------------------+
131| A BRIEF INTRODUCTION TO M4 |
132+----------------------------+
133
134Sendmail uses the M4 macro processor to ``compile'' the configuration
135files.  The most important thing to know is that M4 is stream-based,
136that is, it doesn't understand about lines.  For this reason, in some
137places you may see the word ``dnl'', which stands for ``delete
138through newline''; essentially, it deletes all characters starting
139at the ``dnl'' up to and including the next newline character.  In
140most cases sendmail uses this only to avoid lots of unnecessary
141blank lines in the output.
142
143Other important directives are define(A, B) which defines the macro
144``A'' to have value ``B''.  Macros are expanded as they are read, so
145one normally quotes both values to prevent expansion.  For example,
146
147	define(`SMART_HOST', `smart.foo.com')
148
149One word of warning:  M4 macros are expanded even in lines that appear
150to be comments.  For example, if you have
151
152	# See FEATURE(`foo') above
153
154it will not do what you expect, because the FEATURE(`foo') will be
155expanded.  This also applies to
156
157	# And then define the $X macro to be the return address
158
159because ``define'' is an M4 keyword.  If you want to use them, surround
160them with directed quotes, `like this'.
161
162+----------------+
163| FILE LOCATIONS |
164+----------------+
165
166sendmail 8.9 has introduced a new configuration directory for sendmail
167related files, /etc/mail.  The new files available for sendmail 8.9 --
168the class {R} /etc/mail/relay-domains and the access database
169/etc/mail/access -- take advantage of this new directory.  Beginning with
1708.10, all files will use this directory by default (some options may be
171set by OSTYPE() files).  This new directory should help to restore
172uniformity to sendmail's file locations.
173
174Below is a table of some of the common changes:
175
176Old filename			New filename
177------------			------------
178/etc/bitdomain			/etc/mail/bitdomain
179/etc/domaintable		/etc/mail/domaintable
180/etc/genericstable		/etc/mail/genericstable
181/etc/uudomain			/etc/mail/uudomain
182/etc/virtusertable		/etc/mail/virtusertable
183/etc/userdb			/etc/mail/userdb
184
185/etc/aliases			/etc/mail/aliases
186/etc/sendmail/aliases		/etc/mail/aliases
187/etc/ucbmail/aliases		/etc/mail/aliases
188/usr/adm/sendmail/aliases	/etc/mail/aliases
189/usr/lib/aliases		/etc/mail/aliases
190/usr/lib/mail/aliases		/etc/mail/aliases
191/usr/ucblib/aliases		/etc/mail/aliases
192
193/etc/sendmail.cw		/etc/mail/local-host-names
194/etc/mail/sendmail.cw		/etc/mail/local-host-names
195/etc/sendmail/sendmail.cw	/etc/mail/local-host-names
196
197/etc/sendmail.ct		/etc/mail/trusted-users
198
199/etc/sendmail.oE		/etc/mail/error-header
200
201/etc/sendmail.hf		/etc/mail/helpfile
202/etc/mail/sendmail.hf		/etc/mail/helpfile
203/usr/ucblib/sendmail.hf		/etc/mail/helpfile
204/etc/ucbmail/sendmail.hf	/etc/mail/helpfile
205/usr/lib/sendmail.hf		/etc/mail/helpfile
206/usr/share/lib/sendmail.hf	/etc/mail/helpfile
207/usr/share/misc/sendmail.hf	/etc/mail/helpfile
208/share/misc/sendmail.hf		/etc/mail/helpfile
209
210/etc/service.switch		/etc/mail/service.switch
211
212/etc/sendmail.st		/etc/mail/statistics
213/etc/mail/sendmail.st		/etc/mail/statistics
214/etc/mailer/sendmail.st		/etc/mail/statistics
215/etc/sendmail/sendmail.st	/etc/mail/statistics
216/usr/lib/sendmail.st		/etc/mail/statistics
217/usr/ucblib/sendmail.st		/etc/mail/statistics
218
219Note that all of these paths actually use a new m4 macro MAIL_SETTINGS_DIR
220to create the pathnames.  The default value of this variable is
221`/etc/mail/'.  If you set this macro to a different value, you MUST include
222a trailing slash.
223
224+--------+
225| OSTYPE |
226+--------+
227
228You MUST define an operating system environment, or the configuration
229file build will puke.  There are several environments available; look
230at the "ostype" directory for the current list.  This macro changes
231things like the location of the alias file and queue directory.  Some
232of these files are identical to one another.
233
234It is IMPERATIVE that the OSTYPE occur before any MAILER definitions.
235In general, the OSTYPE macro should go immediately after any version
236information, and MAILER definitions should always go last.
237
238Operating system definitions are usually easy to write.  They may define
239the following variables (everything defaults, so an ostype file may be
240empty).  Unfortunately, the list of configuration-supported systems is
241not as broad as the list of source-supported systems, since many of
242the source contributors do not include corresponding ostype files.
243
244ALIAS_FILE		[/etc/mail/aliases] The location of the text version
245			of the alias file(s).  It can be a comma-separated
246			list of names (but be sure you quote values with
247			commas in them -- for example, use
248				define(`ALIAS_FILE', `a,b')
249			to get "a" and "b" both listed as alias files;
250			otherwise the define() primitive only sees "a").
251HELP_FILE		[/etc/mail/helpfile] The name of the file
252			containing information printed in response to
253			the SMTP HELP command.
254QUEUE_DIR		[/var/spool/mqueue] The directory containing
255			queue files.  To use multiple queues, supply
256			a value ending with an asterisk.  For
257			example, /var/spool/mqueue/q* will use all of the
258			directories or symbolic links to directories
259			beginning with 'q' in /var/spool/mqueue as queue
260			directories.  The names 'qf', 'df', and 'xf' are
261			used as specific subdirectories for the corresponding
262			queue file types.
263STATUS_FILE		[/etc/mail/statistics] The file containing status
264			information.
265LOCAL_MAILER_PATH	[/bin/mail] The program used to deliver local mail.
266LOCAL_MAILER_FLAGS	[Prmn9] The flags used by the local mailer.  The
267			flags lsDFMAw5:/|@q are always included.
268LOCAL_MAILER_ARGS	[mail -d $u] The arguments passed to deliver local
269			mail.
270LOCAL_MAILER_MAX	[undefined] If defined, the maximum size of local
271			mail that you are willing to accept.
272LOCAL_MAILER_MAXMSGS	[undefined] If defined, the maximum number of
273			messages to deliver in a single connection.  Only
274			useful for LMTP local mailers.
275LOCAL_MAILER_CHARSET	[undefined] If defined, messages containing 8-bit data
276			that ARRIVE from an address that resolves to the
277			local mailer and which are converted to MIME will be
278			labeled with this character set.
279LOCAL_MAILER_EOL	[undefined] If defined, the string to use as the
280			end of line for the local mailer.
281LOCAL_MAILER_DSN_DIAGNOSTIC_CODE
282			[X-Unix] The DSN Diagnostic-Code value for the
283			local mailer.  This should be changed with care.
284LOCAL_SHELL_PATH	[/bin/sh] The shell used to deliver piped email.
285LOCAL_SHELL_FLAGS	[eu9] The flags used by the shell mailer.  The
286			flags lsDFM are always included.
287LOCAL_SHELL_ARGS	[sh -c $u] The arguments passed to deliver "prog"
288			mail.
289LOCAL_SHELL_DIR		[$z:/] The directory search path in which the
290			shell should run.
291USENET_MAILER_PATH	[/usr/lib/news/inews] The name of the program
292			used to submit news.
293USENET_MAILER_FLAGS	[rsDFMmn] The mailer flags for the usenet mailer.
294USENET_MAILER_ARGS	[-m -h -n] The command line arguments for the
295			usenet mailer.
296USENET_MAILER_MAX	[100000] The maximum size of messages that will
297			be accepted by the usenet mailer.
298SMTP_MAILER_FLAGS	[undefined] Flags added to SMTP mailer.  Default
299			flags are `mDFMuX' for all SMTP-based mailers; the
300			"esmtp" mailer adds `a'; "smtp8" adds `8'; and
301			"dsmtp" adds `%'.
302RELAY_MAILER_FLAGS	[undefined] Flags added to the relay mailer.  Default
303			flags are `mDFMuX' for all SMTP-based mailers; the
304			relay mailer adds `a8'.  If this is not defined,
305			then SMTP_MAILER_FLAGS is used.
306SMTP_MAILER_MAX		[undefined] The maximum size of messages that will
307			be transported using the smtp, smtp8, esmtp, or dsmtp
308			mailers.
309SMTP_MAILER_MAXMSGS	[undefined] If defined, the maximum number of
310			messages to deliver in a single connection for the
311			smtp, smtp8, esmtp, or dsmtp mailers.
312SMTP_MAILER_ARGS	[IPC $h] The arguments passed to the smtp mailer.
313			About the only reason you would want to change this
314			would be to change the default port.
315ESMTP_MAILER_ARGS	[IPC $h] The arguments passed to the esmtp mailer.
316SMTP8_MAILER_ARGS	[IPC $h] The arguments passed to the smtp8 mailer.
317DSMTP_MAILER_ARGS	[IPC $h] The arguments passed to the dsmtp mailer.
318RELAY_MAILER_ARGS	[IPC $h] The arguments passed to the relay mailer.
319RELAY_MAILER_MAXMSGS	[undefined] If defined, the maximum number of
320			messages to deliver in a single connection for the
321			relay mailer.
322SMTP_MAILER_CHARSET	[undefined] If defined, messages containing 8-bit data
323			that ARRIVE from an address that resolves to one of
324			the SMTP mailers and which are converted to MIME will
325			be labeled with this character set.
326UUCP_MAILER_PATH	[/usr/bin/uux] The program used to send UUCP mail.
327UUCP_MAILER_FLAGS	[undefined] Flags added to UUCP mailer.  Default
328			flags are `DFMhuU' (and `m' for uucp-new mailer,
329			minus `U' for uucp-dom mailer).
330UUCP_MAILER_ARGS	[uux - -r -z -a$g -gC $h!rmail ($u)] The arguments
331			passed to the UUCP mailer.
332UUCP_MAILER_MAX		[100000] The maximum size message accepted for
333			transmission by the UUCP mailers.
334UUCP_MAILER_CHARSET	[undefined] If defined, messages containing 8-bit data
335			that ARRIVE from an address that resolves to one of
336			the UUCP mailers and which are converted to MIME will
337			be labeled with this character set.
338FAX_MAILER_PATH		[/usr/local/lib/fax/mailfax] The program used to
339			submit FAX messages.
340FAX_MAILER_ARGS		[mailfax $u $h $f] The arguments passed to the FAX
341			mailer.
342FAX_MAILER_MAX		[100000] The maximum size message accepted for
343			transmission by FAX.
344POP_MAILER_PATH		[/usr/lib/mh/spop] The pathname of the POP mailer.
345POP_MAILER_FLAGS	[Penu] Flags added to POP mailer.  Flags lsDFMq
346			are always added.
347POP_MAILER_ARGS		[pop $u] The arguments passed to the POP mailer.
348PROCMAIL_MAILER_PATH	[/usr/local/bin/procmail] The path to the procmail
349			program.  This is also used by
350			FEATURE(`local_procmail').
351PROCMAIL_MAILER_FLAGS	[SPhnu9] Flags added to Procmail mailer.  Flags
352			DFM are always set.  This is NOT used by
353			FEATURE(`local_procmail'); tweak LOCAL_MAILER_FLAGS
354			instead.
355PROCMAIL_MAILER_ARGS	[procmail -Y -m $h $f $u] The arguments passed to
356			the Procmail mailer.  This is NOT used by
357			FEATURE(`local_procmail'); tweak LOCAL_MAILER_ARGS
358			instead.
359PROCMAIL_MAILER_MAX	[undefined] If set, the maximum size message that
360			will be accepted by the procmail mailer.
361MAIL11_MAILER_PATH	[/usr/etc/mail11] The path to the mail11 mailer.
362MAIL11_MAILER_FLAGS	[nsFx] Flags for the mail11 mailer.
363MAIL11_MAILER_ARGS	[mail11 $g $x $h $u] Arguments passed to the mail11
364			mailer.
365PH_MAILER_PATH		[/usr/local/etc/phquery] The path to the phquery
366			program.
367PH_MAILER_FLAGS		[ehmu] Flags for the phquery mailer.  Flags nrDFM
368			are always set.
369PH_MAILER_ARGS		[phquery -- $u] -- arguments to the phquery mailer.
370CYRUS_MAILER_FLAGS	[Ah5@/:|] The flags used by the cyrus mailer.  The
371			flags lsDFMnPq are always included.
372CYRUS_MAILER_PATH	[/usr/cyrus/bin/deliver] The program used to deliver
373			cyrus mail.
374CYRUS_MAILER_ARGS	[deliver -e -m $h -- $u] The arguments passed
375			to deliver cyrus mail.
376CYRUS_MAILER_MAX	[undefined] If set, the maximum size message that
377			will be accepted by the cyrus mailer.
378CYRUS_MAILER_USER	[cyrus:mail] The user and group to become when
379			running the cyrus mailer.
380CYRUS_BB_MAILER_FLAGS	[u] The flags used by the cyrusbb mailer.
381			The flags lsDFMnP are always included.
382CYRUS_BB_MAILER_ARGS	[deliver -e -m $u] The arguments passed
383			to deliver cyrusbb mail.
384confEBINDIR		[/usr/libexec] The directory for executables.
385			Currently used for FEATURE(`local_lmtp') and
386			FEATURE(`smrsh').
387QPAGE_MAILER_FLAGS	[mDFMs] The flags used by the qpage mailer.
388QPAGE_MAILER_PATH	[/usr/local/bin/qpage] The program used to deliver
389			qpage mail.
390QPAGE_MAILER_ARGS	[qpage -l0 -m -P$u] The arguments passed
391			to deliver qpage mail.
392QPAGE_MAILER_MAX	[4096] If set, the maximum size message that
393			will be accepted by the qpage mailer.
394
395Note: to tweak Name_MAILER_FLAGS use the macro MODIFY_MAILER_FLAGS:
396MODIFY_MAILER_FLAGS(`Name', `change') where Name is the first part of
397the macro Name_MAILER_FLAGS and change can be: flags that should
398be used directly (thus overriding the default value), or if it
399starts with `+' (`-') then those flags are added to (removed from)
400the default value.  Example:
401
402	MODIFY_MAILER_FLAGS(`LOCAL', `+e')
403
404will add the flag `e' to LOCAL_MAILER_FLAGS.
405WARNING: The FEATUREs local_lmtp and local_procmail set LOCAL_MAILER_FLAGS
406unconditionally, i.e., without respecting any definitions in an
407OSTYPE setting.
408
409
410+---------+
411| DOMAINS |
412+---------+
413
414You will probably want to collect domain-dependent defines into one
415file, referenced by the DOMAIN macro.  For example, the Berkeley
416domain file includes definitions for several internal distinguished
417hosts:
418
419UUCP_RELAY	The host that will accept UUCP-addressed email.
420		If not defined, all UUCP sites must be directly
421		connected.
422BITNET_RELAY	The host that will accept BITNET-addressed email.
423		If not defined, the .BITNET pseudo-domain won't work.
424DECNET_RELAY	The host that will accept DECNET-addressed email.
425		If not defined, the .DECNET pseudo-domain and addresses
426		of the form node::user will not work.
427FAX_RELAY	The host that will accept mail to the .FAX pseudo-domain.
428		The "fax" mailer overrides this value.
429LOCAL_RELAY	DEPRECATED.  The site that will handle unqualified
430		names -- that is, names with out an @domain extension.
431		If not set, they are assumed to belong on this machine.
432		This allows you to have a central site to store a
433		company- or department-wide alias database.  This
434		only works at small sites, and only with some user
435		agents.
436LUSER_RELAY	The site that will handle lusers -- that is, apparently
437		local names that aren't local accounts or aliases.  To
438		specify a local user instead of a site, set this to
439		``local:username''.
440
441Any of these can be either ``mailer:hostname'' (in which case the
442mailer is the internal mailer name, such as ``uucp-new'' and the hostname
443is the name of the host as appropriate for that mailer) or just a
444``hostname'', in which case a default mailer type (usually ``relay'',
445a variant on SMTP) is used.  WARNING: if you have a wildcard MX
446record matching your domain, you probably want to define these to
447have a trailing dot so that you won't get the mail diverted back
448to yourself.
449
450The domain file can also be used to define a domain name, if needed
451(using "DD<domain>") and set certain site-wide features.  If all hosts
452at your site masquerade behind one email name, you could also use
453MASQUERADE_AS here.
454
455You do not have to define a domain -- in particular, if you are a
456single machine sitting off somewhere, it is probably more work than
457it's worth.  This is just a mechanism for combining "domain dependent
458knowledge" into one place.
459
460+---------+
461| MAILERS |
462+---------+
463
464There are fewer mailers supported in this version than the previous
465version, owing mostly to a simpler world.  As a general rule, put the
466MAILER definitions last in your .mc file, and always put MAILER(`smtp')
467before MAILER(`uucp') and MAILER(`procmail') -- several features and
468definitions will modify the definition of mailers, and the smtp mailer
469modifies the UUCP mailer.  Moreover, MAILER(`cyrus'), MAILER(`pop'),
470MAILER(`phquery'), and MAILER(`usenet') must be defined after
471MAILER(`local').
472
473local		The local and prog mailers.  You will almost always
474		need these; the only exception is if you relay ALL
475		your mail to another site.  This mailer is included
476		automatically.
477
478smtp		The Simple Mail Transport Protocol mailer.  This does
479		not hide hosts behind a gateway or another other
480		such hack; it assumes a world where everyone is
481		running the name server.  This file actually defines
482		five mailers: "smtp" for regular (old-style) SMTP to
483		other servers, "esmtp" for extended SMTP to other
484		servers, "smtp8" to do SMTP to other servers without
485		converting 8-bit data to MIME (essentially, this is
486		your statement that you know the other end is 8-bit
487		clean even if it doesn't say so), "dsmtp" to do on
488		demand delivery, and "relay" for transmission to the
489		RELAY_HOST, LUSER_RELAY, or MAIL_HUB.
490
491uucp		The Unix-to-Unix Copy Program mailer.  Actually, this
492		defines two mailers, "uucp-old" (a.k.a. "uucp") and
493		"uucp-new" (a.k.a. "suucp").  The latter is for when you
494		know that the UUCP mailer at the other end can handle
495		multiple recipients in one transfer.  If the smtp mailer
496		is also included in your configuration, two other mailers
497		("uucp-dom" and "uucp-uudom") are also defined [warning:
498		you MUST specify MAILER(smtp) before MAILER(uucp)].  When you
499		include the uucp mailer, sendmail looks for all names in
500		class {U} and sends them to the uucp-old mailer; all
501		names in class {Y} are sent to uucp-new; and all
502		names in class {Z} are sent to uucp-uudom.  Note that
503		this is a function of what version of rmail runs on
504		the receiving end, and hence may be out of your control.
505		See the section below describing UUCP mailers in more
506		detail.
507
508usenet		Usenet (network news) delivery.  If this is specified,
509		an extra rule is added to ruleset 0 that forwards all
510		local email for users named ``group.usenet'' to the
511		``inews'' program.  Note that this works for all groups,
512		and may be considered a security problem.
513
514fax		Facsimile transmission.  This is experimental and based
515		on Sam Leffler's HylaFAX software.  For more information,
516		see http://www.vix.com/hylafax/.
517
518pop		Post Office Protocol.
519
520procmail	An interface to procmail (does not come with sendmail).
521		This is designed to be used in mailertables.  For example,
522		a common question is "how do I forward all mail for a given
523		domain to a single person?".  If you have this mailer
524		defined, you could set up a mailertable reading:
525
526			host.com	procmail:/etc/procmailrcs/host.com
527
528		with the file /etc/procmailrcs/host.com reading:
529
530			:0	# forward mail for host.com
531			! -oi -f $1 person@other.host
532
533		This would arrange for (anything)@host.com to be sent
534		to person@other.host.  Within the procmail script, $1 is
535		the name of the sender and $2 is the name of the recipient.
536		If you use this with FEATURE(`local_procmail'), the FEATURE
537		should be listed first.
538
539mail11		The DECnet mail11 mailer, useful only if you have the mail11
540		program from gatekeeper.dec.com:/pub/DEC/gwtools (and
541		DECnet, of course).  This is for Phase IV DECnet support;
542		if you have Phase V at your site you may have additional
543		problems.
544
545phquery		The phquery program.  This is somewhat counterintuitively
546		referenced as the "ph" mailer internally.  It can be used
547		to do CCSO name server lookups.  The phquery program, which
548		this mailer uses, is distributed with the ph client.
549
550cyrus		The cyrus and cyrusbb mailers.  The cyrus mailer delivers to
551		a local cyrus user.  this mailer can make use of the
552		"user+detail@local.host" syntax; it will deliver the mail to
553		the user's "detail" mailbox if the mailbox's ACL permits.
554		The cyrusbb mailer delivers to a system-wide cyrus mailbox
555		if the mailbox's ACL permits.  The cyrus mailer must be
556		defined after the local mailer.
557
558qpage		A mailer for QuickPage, a pager interface.  See
559		http://www.qpage.org/ for further information.
560
561The local mailer accepts addresses of the form "user+detail", where
562the "+detail" is not used for mailbox matching but is available
563to certain local mail programs (in particular, see
564FEATURE(`local_procmail')).  For example, "eric", "eric+sendmail", and
565"eric+sww" all indicate the same user, but additional arguments <null>,
566"sendmail", and "sww" may be provided for use in sorting mail.
567
568
569+----------+
570| FEATURES |
571+----------+
572
573Special features can be requested using the "FEATURE" macro.  For
574example, the .mc line:
575
576	FEATURE(`use_cw_file')
577
578tells sendmail that you want to have it read an /etc/mail/local-host-names
579file to get values for class {w}.  The FEATURE may contain up to 9
580optional parameters -- for example:
581
582	FEATURE(`mailertable', `dbm /usr/lib/mailertable')
583
584The default database map type for the table features can be set with
585
586	define(`DATABASE_MAP_TYPE', `dbm')
587
588which would set it to use ndbm databases.  The default is the Berkeley DB
589hash database format.  Note that you must still declare a database map type
590if you specify an argument to a FEATURE.  DATABASE_MAP_TYPE is only used
591if no argument is given for the FEATURE.  It must be specified before any
592feature that uses a map.
593
594Available features are:
595
596use_cw_file	Read the file /etc/mail/local-host-names file to get
597		alternate names for this host.  This might be used if you
598		were on a host that MXed for a dynamic set of other hosts.
599		If the set is static, just including the line "Cw<name1>
600		<name2> ..." (where the names are fully qualified domain
601		names) is probably superior.  The actual filename can be
602		overridden by redefining confCW_FILE.
603
604use_ct_file	Read the file /etc/mail/trusted-users file to get the
605		names of users that will be ``trusted'', that is, able to
606		set their envelope from address using -f without generating
607		a warning message.  The actual filename can be overridden
608		by redefining confCT_FILE.
609
610redirect	Reject all mail addressed to "address.REDIRECT" with
611		a ``551 User has moved; please try <address>'' message.
612		If this is set, you can alias people who have left
613		to their new address with ".REDIRECT" appended.
614
615nouucp		Don't route UUCP addresses.  This feature takes one
616		parameter:
617		`reject': reject addresses which have "!" in the local
618			part unless it originates from a system
619			that is allowed to relay.
620		`nospecial': don't do anything special with "!".
621		Warnings: 1. See the NOTICE in the ANTI-SPAM section.
622		2. don't remove "!" from OperatorChars if `reject' is
623		given as parameter.
624
625nocanonify	Don't pass addresses to $[ ... $] for canonification
626		by default.  It can be changed by setting the
627		DaemonPortOptions modifiers (M=).  That is,
628		FEATURE(`nocanonify') will be overridden by setting the
629		'c' flag.  Conversely, if FEATURE(`nocanonify') is not used,
630		it can be emulated by setting the 'C' flag
631		(DaemonPortOptions=Modifiers=C).  This would generally only
632		be used by sites that only act as mail gateways or which have
633		user agents that do full canonification themselves.  You may
634		also want to use
635		"define(`confBIND_OPTS', `-DNSRCH -DEFNAMES')" to turn off
636		the usual resolver options that do a similar thing.
637
638		An exception list for FEATURE(`nocanonify') can be
639		specified with CANONIFY_DOMAIN or CANONIFY_DOMAIN_FILE,
640		i.e., a list of domains which are nevertheless passed to
641		$[ ... $] for canonification.  This is useful to turn on
642		canonification for local domains, e.g., use
643		CANONIFY_DOMAIN(`my.domain my') to canonify addresses
644		which end in "my.domain" or "my".
645		Another way to require canonification in the local
646		domain is CANONIFY_DOMAIN(`$=m').
647
648		A trailing dot is added to addresses with more than
649		one component in it such that other features which
650		expect a trailing dot (e.g., virtusertable) will
651		still work.
652
653		If `canonify_hosts' is specified as parameter, i.e.,
654		FEATURE(`nocanonify', `canonify_hosts'), then
655		addresses which have only a hostname, e.g.,
656		<user@host>, will be canonified (and hopefully fully
657		qualified), too.
658
659stickyhost	If set, email sent to "user@local.host" are marked
660		as "sticky" -- that is, the local addresses aren't
661		matched against UDB and don't go through ruleset 5.
662		This is used if you want a set up where "user" is
663		not necessarily the same as "user@local.host", e.g.,
664		to make a distinct domain-wide namespace.  Prior to
665		8.7 this was the default, and notsticky was used to
666		turn this off.
667
668mailertable	Include a "mailer table" which can be used to override
669		routing for particular domains (which are not in class {w},
670		i.e.  local host names).  The argument of the FEATURE may be
671		the key definition.  If none is specified, the definition
672		used is:
673
674			hash /etc/mail/mailertable
675
676		Keys in this database are fully qualified domain names
677		or partial domains preceded by a dot -- for example,
678		"vangogh.CS.Berkeley.EDU" or ".CS.Berkeley.EDU".  As a
679		special case of the latter, "." matches any domain not
680		covered by other keys.  Values must be of the form:
681			mailer:domain
682		where "mailer" is the internal mailer name, and "domain"
683		is where to send the message.  These maps are not
684		reflected into the message header.  As a special case,
685		the forms:
686			local:user
687		will forward to the indicated user using the local mailer,
688			local:
689		will forward to the original user in the e-mail address
690		using the local mailer, and
691			error:code message
692			error:D.S.N:code message
693		will give an error message with the indicated SMTP reply
694		code and message, where D.S.N is an RFC 1893 compliant
695		error code.
696
697domaintable	Include a "domain table" which can be used to provide
698		domain name mapping.  Use of this should really be
699		limited to your own domains.  It may be useful if you
700		change names (e.g., your company changes names from
701		oldname.com to newname.com).  The argument of the
702		FEATURE may be the key definition.  If none is specified,
703		the definition used is:
704
705			hash /etc/mail/domaintable
706
707		The key in this table is the domain name; the value is
708		the new (fully qualified) domain.  Anything in the
709		domaintable is reflected into headers; that is, this
710		is done in ruleset 3.
711
712bitdomain	Look up bitnet hosts in a table to try to turn them into
713		internet addresses.  The table can be built using the
714		bitdomain program contributed by John Gardiner Myers.
715		The argument of the FEATURE may be the key definition; if
716		none is specified, the definition used is:
717
718			hash /etc/mail/bitdomain
719
720		Keys are the bitnet hostname; values are the corresponding
721		internet hostname.
722
723uucpdomain	Similar feature for UUCP hosts.  The default map definition
724		is:
725
726			hash /etc/mail/uudomain
727
728		At the moment there is no automagic tool to build this
729		database.
730
731always_add_domain
732		Include the local host domain even on locally delivered
733		mail.  Normally it is not added on unqualified names.
734		However, if you use a shared message store but do not use
735		the same user name space everywhere, you may need the host
736		name on local names.
737
738allmasquerade	If masquerading is enabled (using MASQUERADE_AS), this
739		feature will cause recipient addresses to also masquerade
740		as being from the masquerade host.  Normally they get
741		the local hostname.  Although this may be right for
742		ordinary users, it can break local aliases.  For example,
743		if you send to "localalias", the originating sendmail will
744		find that alias and send to all members, but send the
745		message with "To: localalias@masqueradehost".  Since that
746		alias likely does not exist, replies will fail.  Use this
747		feature ONLY if you can guarantee that the ENTIRE
748		namespace on your masquerade host supersets all the
749		local entries.
750
751limited_masquerade
752		Normally, any hosts listed in class {w} are masqueraded.  If
753		this feature is given, only the hosts listed in class {M} (see
754		below:  MASQUERADE_DOMAIN) are masqueraded.  This is useful
755		if you have several domains with disjoint namespaces hosted
756		on the same machine.
757
758masquerade_entire_domain
759		If masquerading is enabled (using MASQUERADE_AS) and
760		MASQUERADE_DOMAIN (see below) is set, this feature will
761		cause addresses to be rewritten such that the masquerading
762		domains are actually entire domains to be hidden.  All
763		hosts within the masquerading domains will be rewritten
764		to the masquerade name (used in MASQUERADE_AS).  For example,
765		if you have:
766
767			MASQUERADE_AS(`masq.com')
768			MASQUERADE_DOMAIN(`foo.org')
769			MASQUERADE_DOMAIN(`bar.com')
770
771		then *foo.org and *bar.com are converted to masq.com.  Without
772		this feature, only foo.org and bar.com are masqueraded.
773
774		    NOTE: only domains within your jurisdiction and
775		    current hierarchy should be masqueraded using this.
776
777genericstable	This feature will cause unqualified addresses (i.e., without
778		a domain) and addresses with a domain listed in class {G}
779		to be looked up in a map and turned into another ("generic")
780		form, which can change both the domain name and the user name.
781		This is similar to the userdb functionality.  The same types of
782		addresses as for masquerading are looked up, i.e., only header
783		sender addresses unless the allmasquerade and/or
784		masquerade_envelope features are given.  Qualified addresses
785		must have the domain part in class {G}; entries can
786		be added to this class by the macros GENERICS_DOMAIN or
787		GENERICS_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
788		MASQUERADE_DOMAIN_FILE, see below).
789
790		The argument of FEATURE(`genericstable') may be the map
791		definition; the default map definition is:
792
793			hash /etc/mail/genericstable
794
795		The key for this table is either the full address, the domain
796		(with a leading @; the localpart is passed as first argument)
797		or the unqualified username (tried in the order mentioned);
798		the value is the new user address.  If the new user address
799		does not include a domain, it will be qualified in the standard
800		manner, i.e., using $j or the masquerade name.  Note that the
801		address being looked up must be fully qualified.  For local
802		mail, it is necessary to use FEATURE(`always_add_domain')
803		for the addresses to be qualified.
804		The "+detail" of an address is passed as %1, so entries like
805
806			old+*@foo.org	new+%1@example.com
807			gen+*@foo.org	%1@example.com
808
809		and other forms are possible.
810
811generics_entire_domain
812		If the genericstable is enabled and GENERICS_DOMAIN or
813		GENERICS_DOMAIN_FILE is used, this feature will cause
814		addresses to be searched in the map if their domain
815		parts are subdomains of elements in class {G}.
816
817virtusertable	A domain-specific form of aliasing, allowing multiple
818		virtual domains to be hosted on one machine.  For example,
819		if the virtuser table contained:
820
821			info@foo.com	foo-info
822			info@bar.com	bar-info
823			joe@bar.com	error:nouser No such user here
824			jax@bar.com	error:D.S.N:unavailable Address invalid
825			@baz.org	jane@example.net
826
827		then mail addressed to info@foo.com will be sent to the
828		address foo-info, mail addressed to info@bar.com will be
829		delivered to bar-info, and mail addressed to anyone at baz.org
830		will be sent to jane@example.net, mail to joe@bar.com will
831		be rejected with the specified error message, and mail to
832		jax@bar.com will also have a RFC 1893 compliant error code
833		D.S.N.
834
835		The username from the original address is passed
836		as %1 allowing:
837
838			@foo.org	%1@example.com
839
840		meaning someone@foo.org will be sent to someone@example.com.
841		Additionally, if the local part consists of "user+detail"
842		then "detail" is passed as %2 when a match against user+*
843		is attempted, so entries like
844
845			old+*@foo.org	new+%2@example.com
846			gen+*@foo.org	%2@example.com
847			+*@foo.org	%1+%2@example.com
848
849		and other forms are possible.  Note: to preserve "+detail"
850		for a default case (@domain) +*@domain must be used as
851		exemplified above.
852
853		All the host names on the left hand side (foo.com, bar.com,
854		and baz.org) must be in class {w} or class {VirtHost}, the
855		latter can be defined by the macros VIRTUSER_DOMAIN or
856		VIRTUSER_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
857		MASQUERADE_DOMAIN_FILE, see below).  If VIRTUSER_DOMAIN or
858		VIRTUSER_DOMAIN_FILE is used, then the entries of class
859		{VirtHost} are added to class {R}, i.e., relaying is allowed
860		to (and from) those domains.  The default map definition is:
861
862			hash /etc/mail/virtusertable
863
864		A new definition can be specified as the second argument of
865		the FEATURE macro, such as
866
867			FEATURE(`virtusertable', `dbm /etc/mail/virtusers')
868
869virtuser_entire_domain
870		If the virtusertable is enabled and VIRTUSER_DOMAIN or
871		VIRTUSER_DOMAIN_FILE is used, this feature will cause
872		addresses to be searched in the map if their domain
873		parts are subdomains of elements in class {VirtHost}.
874
875ldap_routing	Implement LDAP-based e-mail recipient routing according to
876		the Internet Draft draft-lachman-laser-ldap-mail-routing-01.
877		This provides a method to re-route addresses with a
878		domain portion in class {LDAPRoute} to either a
879		different mail host or a different address.  Hosts can
880		be added to this class using LDAPROUTE_DOMAIN and
881		LDAPROUTE_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
882		MASQUERADE_DOMAIN_FILE, see below).
883
884		See the LDAP ROUTING section below for more information.
885
886nodns		If you aren't running DNS at your site (for example,
887		you are UUCP-only connected).  It's hard to consider
888		this a "feature", but hey, it had to go somewhere.
889		Actually, as of 8.7 this is a no-op -- remove "dns" from
890		the hosts service switch entry instead.
891
892nullclient	This is a special case -- it creates a configuration file
893		containing nothing but support for forwarding all mail to a
894		central hub via a local SMTP-based network.  The argument
895		is the name of that hub.
896
897		The only other feature that should be used in conjunction
898		with this one is FEATURE(`nocanonify').  No mailers
899		should be defined.  No aliasing or forwarding is done.
900
901local_lmtp	Use an LMTP capable local mailer.  The argument to this
902		feature is the pathname of an LMTP capable mailer.  By
903		default, mail.local is used.  This is expected to be the
904		mail.local which came with the 8.9 distribution which is
905		LMTP capable.  The path to mail.local is set by the
906		confEBINDIR m4 variable -- making the default
907		LOCAL_MAILER_PATH /usr/libexec/mail.local.
908		WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally,
909		i.e., without respecting any definitions in an OSTYPE setting.
910
911local_procmail	Use procmail or another delivery agent as the local mailer.
912		The argument to this feature is the pathname of the
913		delivery agent, which defaults to PROCMAIL_MAILER_PATH.
914		Note that this does NOT use PROCMAIL_MAILER_FLAGS or
915		PROCMAIL_MAILER_ARGS for the local mailer; tweak
916		LOCAL_MAILER_FLAGS and LOCAL_MAILER_ARGS instead, or
917		specify the appropriate parameters.  When procmail is used,
918		the local mailer can make use of the
919		"user+indicator@local.host" syntax; normally the +indicator
920		is just tossed, but by default it is passed as the -a
921		argument to procmail.
922
923		This feature can take up to three arguments:
924
925		1. Path to the mailer program
926		   [default: /usr/local/bin/procmail]
927		2. Argument vector including name of the program
928		   [default: procmail -Y -a $h -d $u]
929		3. Flags for the mailer [default: SPfhn9]
930
931		Empty arguments cause the defaults to be taken.
932
933		For example, this allows it to use the maildrop
934		(http://www.flounder.net/~mrsam/maildrop/) mailer instead
935		by specifying:
936
937		FEATURE(`local_procmail', `/usr/local/bin/maildrop',
938		 `maildrop -d $u')
939
940		or scanmails using:
941
942		FEATURE(`local_procmail', `/usr/local/bin/scanmails')
943
944		WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally,
945		i.e.,  without respecting any definitions in an OSTYPE setting.
946
947bestmx_is_local	Accept mail as though locally addressed for any host that
948		lists us as the best possible MX record.  This generates
949		additional DNS traffic, but should be OK for low to
950		medium traffic hosts.  The argument may be a set of
951		domains, which will limit the feature to only apply to
952		these domains -- this will reduce unnecessary DNS
953		traffic.  THIS FEATURE IS FUNDAMENTALLY INCOMPATIBLE WITH
954		WILDCARD MX RECORDS!!!  If you have a wildcard MX record
955		that matches your domain, you cannot use this feature.
956
957smrsh		Use the SendMail Restricted SHell (smrsh) provided
958		with the distribution instead of /bin/sh for mailing
959		to programs.  This improves the ability of the local
960		system administrator to control what gets run via
961		e-mail.  If an argument is provided it is used as the
962		pathname to smrsh; otherwise, the path defined by
963		confEBINDIR is used for the smrsh binary -- by default,
964		/usr/libexec/smrsh is assumed.
965
966promiscuous_relay
967		By default, the sendmail configuration files do not permit
968		mail relaying (that is, accepting mail from outside your
969		local host (class {w}) and sending it to another host than
970		your local host).  This option sets your site to allow
971		mail relaying from any site to any site.  In almost all
972		cases, it is better to control relaying more carefully
973		with the access map, class {R}, or authentication.  Domains
974		can be added to class {R} by the macros RELAY_DOMAIN or
975		RELAY_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
976		MASQUERADE_DOMAIN_FILE, see below).
977
978relay_entire_domain
979		By default, only hosts listed as RELAY in the access db
980		will be allowed to relay.  This option also allows any
981		host in your domain as defined by class {m}.
982
983relay_hosts_only
984		By default, names that are listed as RELAY in the access
985		db and class {R} are domain names, not host names.
986		For example, if you specify ``foo.com'', then mail to or
987		from foo.com, abc.foo.com, or a.very.deep.domain.foo.com
988		will all be accepted for relaying.  This feature changes
989		the behaviour to lookup individual host names only.
990
991relay_based_on_MX
992		Turns on the ability to allow relaying based on the MX
993		records of the host portion of an incoming recipient; that
994		is, if an MX record for host foo.com points to your site,
995		you will accept and relay mail addressed to foo.com.  See
996		description below for more information before using this
997		feature.  Also, see the KNOWNBUGS entry regarding bestmx
998		map lookups.
999
1000		FEATURE(`relay_based_on_MX') does not necessarily allow
1001		routing of these messages which you expect to be allowed,
1002		if route address syntax (or %-hack syntax) is used.  If
1003		this is a problem, add entries to the access-table or use
1004		FEATURE(`loose_relay_check').
1005
1006relay_mail_from
1007		Allows relaying if the mail sender is listed as RELAY in
1008		the access map.  If an optional argument `domain' is given,
1009		the domain portion of the mail sender is checked too.
1010		This should only be used if absolutely necessary as the
1011		sender address can be easily forged.  Use of this feature
1012		requires the "From:" tag be prepended to the key in the
1013		access map; see the discussion of tags and
1014		FEATURE(`relay_mail_from') in the section on ANTI-SPAM
1015		CONFIGURATION CONTROL.
1016
1017relay_local_from
1018		Allows relaying if the domain portion of the mail sender
1019		is a local host.  This should only be used if absolutely
1020		necessary as it opens a window for spammers.  Specifically,
1021		they can send mail to your mail server that claims to be
1022		from your domain (either directly or via a routed address),
1023		and you will go ahead and relay it out to arbitrary hosts
1024		on the Internet.
1025
1026accept_unqualified_senders
1027		Normally, MAIL FROM: commands in the SMTP session will be
1028		refused if the connection is a network connection and the
1029		sender address does not include a domain name.  If your
1030		setup sends local mail unqualified (i.e., MAIL FROM: <joe>),
1031		you will need to use this feature to accept unqualified
1032		sender addresses.  Setting the DaemonPortOptions modifier
1033		'u' overrides the default behavior, i.e., unqualified
1034		addresses are accepted even without this FEATURE.
1035		If this FEATURE is not used, the DaemonPortOptions modifier
1036		'f' can be used to enforce fully qualified addresses.
1037
1038accept_unresolvable_domains
1039		Normally, MAIL FROM: commands in the SMTP session will be
1040		refused if the host part of the argument to MAIL FROM:
1041		cannot be located in the host name service (e.g., an A or
1042		MX record in DNS).  If you are inside a firewall that has
1043		only a limited view of the Internet host name space, this
1044		could cause problems.  In this case you probably want to
1045		use this feature to accept all domains on input, even if
1046		they are unresolvable.
1047
1048access_db	Turns on the access database feature.  The access db gives
1049		you the ability to allow or refuse to accept mail from
1050		specified domains for administrative reasons.  By default,
1051		the access database specification is:
1052
1053			hash /etc/mail/access
1054
1055		The format of the database is described in the anti-spam
1056		configuration control section later in this document.
1057
1058blacklist_recipients
1059		Turns on the ability to block incoming mail for certain
1060		recipient usernames, hostnames, or addresses.  For
1061		example, you can block incoming mail to user nobody,
1062		host foo.mydomain.com, or guest@bar.mydomain.com.
1063		These specifications are put in the access db as
1064		described in the anti-spam configuration control section
1065		later in this document.
1066
1067rbl		This feature is deprecated! Please use dnsbl instead.
1068		Turns on rejection of hosts found in the Realtime Blackhole
1069		List.  If an argument is provided it is used as the domain
1070		in which blocked hosts are listed; otherwise, the main
1071		RBL domain rbl.maps.vix.com is used.  For details, see
1072		http://maps.vix.com/rbl/.
1073
1074dnsbl		Turns on rejection of hosts found in an DNS based rejection
1075		list.  If an argument is provided it is used as the domain
1076		in which blocked hosts are listed; otherwise it defaults to
1077		rbl.maps.vix.com.  An explanation for an DNS based rejection
1078		list can be found http://maps.vix.com/rbl/.  A second argument
1079		can be used to change the default error message of
1080		Mail from $&{client_addr} refused by blackhole site SERVER
1081		where SERVER is replaced by the first argument.  This feature
1082		can be included several times to query different DNS based
1083		rejection lists.
1084
1085loose_relay_check
1086		Normally, if % addressing is used for a recipient, e.g.
1087		user%site@othersite, and othersite is in class {R}, the
1088		check_rcpt ruleset will strip @othersite and recheck
1089		user@site for relaying.  This feature changes that
1090		behavior.  It should not be needed for most installations.
1091
1092no_default_msa	Don't generate the default MSA daemon, i.e.,
1093		DAEMON_OPTIONS(`Port=587,Name=MSA,M=E')
1094		To define a MSA daemon with other parameters, use this
1095		FEATURE and introduce new settings via DAEMON_OPTIONS().
1096
1097+-------+
1098| HACKS |
1099+-------+
1100
1101Some things just can't be called features.  To make this clear,
1102they go in the hack subdirectory and are referenced using the HACK
1103macro.  These will tend to be site-dependent.  The release
1104includes the Berkeley-dependent "cssubdomain" hack (that makes
1105sendmail accept local names in either Berkeley.EDU or CS.Berkeley.EDU;
1106this is intended as a short-term aid while moving hosts into
1107subdomains.
1108
1109
1110+--------------------+
1111| SITE CONFIGURATION |
1112+--------------------+
1113
1114    *****************************************************
1115    * This section is really obsolete, and is preserved	*
1116    * only for back compatibility.  You should plan on	*
1117    * using mailertables for new installations.	  In	*
1118    * particular, it doesn't work for the newer forms	*
1119    * of UUCP mailers, such as uucp-uudom.		*
1120    *****************************************************
1121
1122Complex sites will need more local configuration information, such as
1123lists of UUCP hosts they speak with directly.  This can get a bit more
1124tricky.  For an example of a "complex" site, see cf/ucbvax.mc.
1125
1126The SITECONFIG macro allows you to indirectly reference site-dependent
1127configuration information stored in the siteconfig subdirectory.  For
1128example, the line
1129
1130	SITECONFIG(`uucp.ucbvax', `ucbvax', `U')
1131
1132reads the file uucp.ucbvax for local connection information.  The
1133second parameter is the local name (in this case just "ucbvax" since
1134it is locally connected, and hence a UUCP hostname).  The third
1135parameter is the name of both a macro to store the local name (in
1136this case, {U}) and the name of the class (e.g., {U}) in which to store
1137the host information read from the file.  Another SITECONFIG line reads
1138
1139	SITECONFIG(`uucp.ucbarpa', `ucbarpa.Berkeley.EDU', `W')
1140
1141This says that the file uucp.ucbarpa contains the list of UUCP sites
1142connected to ucbarpa.Berkeley.EDU.  Class {W} will be used to
1143store this list, and $W is defined to be ucbarpa.Berkeley.EDU, that
1144is, the name of the relay to which the hosts listed in uucp.ucbarpa
1145are connected.  [The machine ucbarpa is gone now, but this
1146out-of-date configuration file has been left around to demonstrate
1147how you might do this.]
1148
1149Note that the case of SITECONFIG with a third parameter of ``U'' is
1150special; the second parameter is assumed to be the UUCP name of the
1151local site, rather than the name of a remote site, and the UUCP name
1152is entered into class {w} (the list of local hostnames) as $U.UUCP.
1153
1154The siteconfig file (e.g., siteconfig/uucp.ucbvax.m4) contains nothing
1155more than a sequence of SITE macros describing connectivity.  For
1156example:
1157
1158	SITE(`cnmat')
1159	SITE(`sgi olympus')
1160
1161The second example demonstrates that you can use two names on the
1162same line; these are usually aliases for the same host (or are at
1163least in the same company).
1164
1165
1166+--------------------+
1167| USING UUCP MAILERS |
1168+--------------------+
1169
1170It's hard to get UUCP mailers right because of the extremely ad hoc
1171nature of UUCP addressing.  These config files are really designed
1172for domain-based addressing, even for UUCP sites.
1173
1174There are four UUCP mailers available.  The choice of which one to
1175use is partly a matter of local preferences and what is running at
1176the other end of your UUCP connection.  Unlike good protocols that
1177define what will go over the wire, UUCP uses the policy that you
1178should do what is right for the other end; if they change, you have
1179to change.  This makes it hard to do the right thing, and discourages
1180people from updating their software.  In general, if you can avoid
1181UUCP, please do.
1182
1183The major choice is whether to go for a domainized scheme or a
1184non-domainized scheme.  This depends entirely on what the other
1185end will recognize.  If at all possible, you should encourage the
1186other end to go to a domain-based system -- non-domainized addresses
1187don't work entirely properly.
1188
1189The four mailers are:
1190
1191    uucp-old (obsolete name: "uucp")
1192	This is the oldest, the worst (but the closest to UUCP) way of
1193	sending messages accros UUCP connections.  It does bangify
1194	everything and prepends $U (your UUCP name) to the sender's
1195	address (which can already be a bang path itself).  It can
1196	only send to one address at a time, so it spends a lot of
1197	time copying duplicates of messages.  Avoid this if at all
1198	possible.
1199
1200    uucp-new (obsolete name: "suucp")
1201	The same as above, except that it assumes that in one rmail
1202	command you can specify several recipients.  It still has a
1203	lot of other problems.
1204
1205    uucp-dom
1206	This UUCP mailer keeps everything as domain addresses.
1207	Basically, it uses the SMTP mailer rewriting rules.  This mailer
1208	is only included if MAILER(`smtp') is also specified.
1209
1210	Unfortunately, a lot of UUCP mailer transport agents require
1211	bangified addresses in the envelope, although you can use
1212	domain-based addresses in the message header.  (The envelope
1213	shows up as the From_ line on UNIX mail.)  So....
1214
1215    uucp-uudom
1216	This is a cross between uucp-new (for the envelope addresses)
1217	and uucp-dom (for the header addresses).  It bangifies the
1218	envelope sender (From_ line in messages) without adding the
1219	local hostname, unless there is no host name on the address
1220	at all (e.g., "wolf") or the host component is a UUCP host name
1221	instead of a domain name ("somehost!wolf" instead of
1222	"some.dom.ain!wolf").  This is also included only if MAILER(`smtp')
1223	is also specified.
1224
1225Examples:
1226
1227On host grasp.insa-lyon.fr (UUCP host name "grasp"), the following
1228summarizes the sender rewriting for various mailers.
1229
1230Mailer          sender		rewriting in the envelope
1231------		------		-------------------------
1232uucp-{old,new}	wolf		grasp!wolf
1233uucp-dom	wolf		wolf@grasp.insa-lyon.fr
1234uucp-uudom	wolf		grasp.insa-lyon.fr!wolf
1235
1236uucp-{old,new}	wolf@fr.net	grasp!fr.net!wolf
1237uucp-dom	wolf@fr.net	wolf@fr.net
1238uucp-uudom	wolf@fr.net	fr.net!wolf
1239
1240uucp-{old,new}	somehost!wolf	grasp!somehost!wolf
1241uucp-dom	somehost!wolf	somehost!wolf@grasp.insa-lyon.fr
1242uucp-uudom	somehost!wolf	grasp.insa-lyon.fr!somehost!wolf
1243
1244If you are using one of the domainized UUCP mailers, you really want
1245to convert all UUCP addresses to domain format -- otherwise, it will
1246do it for you (and probably not the way you expected).  For example,
1247if you have the address foo!bar!baz (and you are not sending to foo),
1248the heuristics will add the @uucp.relay.name or @local.host.name to
1249this address.  However, if you map foo to foo.host.name first, it
1250will not add the local hostname.  You can do this using the uucpdomain
1251feature.
1252
1253
1254+-------------------+
1255| TWEAKING RULESETS |
1256+-------------------+
1257
1258For more complex configurations, you can define special rules.
1259The macro LOCAL_RULE_3 introduces rules that are used in canonicalizing
1260the names.  Any modifications made here are reflected in the header.
1261
1262A common use is to convert old UUCP addresses to SMTP addresses using
1263the UUCPSMTP macro.  For example:
1264
1265	LOCAL_RULE_3
1266	UUCPSMTP(`decvax',	`decvax.dec.com')
1267	UUCPSMTP(`research',	`research.att.com')
1268
1269will cause addresses of the form "decvax!user" and "research!user"
1270to be converted to "user@decvax.dec.com" and "user@research.att.com"
1271respectively.
1272
1273This could also be used to look up hosts in a database map:
1274
1275	LOCAL_RULE_3
1276	R$* < @ $+ > $*		$: $1 < @ $(hostmap $2 $) > $3
1277
1278This map would be defined in the LOCAL_CONFIG portion, as shown below.
1279
1280Similarly, LOCAL_RULE_0 can be used to introduce new parsing rules.
1281For example, new rules are needed to parse hostnames that you accept
1282via MX records.  For example, you might have:
1283
1284	LOCAL_RULE_0
1285	R$+ <@ host.dom.ain.>	$#uucp $@ cnmat $: $1 < @ host.dom.ain.>
1286
1287You would use this if you had installed an MX record for cnmat.Berkeley.EDU
1288pointing at this host; this rule catches the message and forwards it on
1289using UUCP.
1290
1291You can also tweak rulesets 1 and 2 using LOCAL_RULE_1 and LOCAL_RULE_2.
1292These rulesets are normally empty.
1293
1294A similar macro is LOCAL_CONFIG.  This introduces lines added after the
1295boilerplate option setting but before rulesets.  Do not declare rulesets in
1296the LOCAL_CONFIG section.  It can be used to declare local database maps or
1297whatever.  For example:
1298
1299	LOCAL_CONFIG
1300	Khostmap hash /etc/mail/hostmap
1301	Kyplocal nis -m hosts.byname
1302
1303
1304+---------------------------+
1305| MASQUERADING AND RELAYING |
1306+---------------------------+
1307
1308You can have your host masquerade as another using
1309
1310	MASQUERADE_AS(`host.domain')
1311
1312This causes mail being sent to be labeled as coming from the
1313indicated host.domain, rather than $j.  One normally masquerades as
1314one of one's own subdomains (for example, it's unlikely that
1315Berkeley would choose to masquerade as an MIT site).  This
1316behaviour is modified by a plethora of FEATUREs; in particular, see
1317masquerade_envelope, allmasquerade, limited_masquerade, and
1318masquerade_entire_domain.
1319
1320The masquerade name is not normally canonified, so it is important
1321that it be your One True Name, that is, fully qualified and not a
1322CNAME.  However, if you use a CNAME, the receiving side may canonify
1323it for you, so don't think you can cheat CNAME mapping this way.
1324
1325Normally the only addresses that are masqueraded are those that come
1326from this host (that is, are either unqualified or in class {w}, the list
1327of local domain names).  You can augment this list, which is realized
1328by class {M} using
1329
1330	MASQUERADE_DOMAIN(`otherhost.domain')
1331
1332The effect of this is that although mail to user@otherhost.domain
1333will not be delivered locally, any mail including any user@otherhost.domain
1334will, when relayed, be rewritten to have the MASQUERADE_AS address.
1335This can be a space-separated list of names.
1336
1337If these names are in a file, you can use
1338
1339	MASQUERADE_DOMAIN_FILE(`filename')
1340
1341to read the list of names from the indicated file (i.e., to add
1342elements to class {M}).
1343
1344To exempt hosts or subdomains from being masqueraded, you can use
1345
1346	MASQUERADE_EXCEPTION(`host.domain')
1347
1348This can come handy if you want to masquerade a whole domain
1349except for one (or a few) host(s).
1350
1351Normally only header addresses are masqueraded.  If you want to
1352masquerade the envelope as well, use
1353
1354	FEATURE(`masquerade_envelope')
1355
1356There are always users that need to be "exposed" -- that is, their
1357internal site name should be displayed instead of the masquerade name.
1358Root is an example (which has been "exposed" by default prior to 8.10).
1359You can add users to this list using
1360
1361	EXPOSED_USER(`usernames')
1362
1363This adds users to class {E}; you could also use something like
1364
1365	FE/etc/mail/exposed-users
1366
1367You can also arrange to relay all unqualified names (that is, names
1368without @host) to a relay host.  For example, if you have a central
1369email server, you might relay to that host so that users don't have
1370to have .forward files or aliases.  You can do this using
1371
1372	define(`LOCAL_RELAY', `mailer:hostname')
1373
1374The ``mailer:'' can be omitted, in which case the mailer defaults to
1375"relay".  There are some user names that you don't want relayed, perhaps
1376because of local aliases.  A common example is root, which may be
1377locally aliased.  You can add entries to this list using
1378
1379	LOCAL_USER(`usernames')
1380
1381This adds users to class {L}; you could also use something like
1382
1383	FL/etc/mail/local-users
1384
1385If you want all incoming mail sent to a centralized hub, as for a
1386shared /var/spool/mail scheme, use
1387
1388	define(`MAIL_HUB', `mailer:hostname')
1389
1390Again, ``mailer:'' defaults to "relay".  If you define both LOCAL_RELAY
1391and MAIL_HUB _AND_ you have FEATURE(`stickyhost'), unqualified names will
1392be sent to the LOCAL_RELAY and other local names will be sent to MAIL_HUB.
1393Note: there is a (long standing) bug which keeps this combination from
1394working for addresses of the form user+detail.
1395Names in class {L} will be delivered locally, so you MUST have aliases or
1396.forward files for them.
1397
1398For example, if you are on machine mastodon.CS.Berkeley.EDU and you have
1399FEATURE(`stickyhost'), the following combinations of settings will have the
1400indicated effects:
1401
1402email sent to....	eric			  eric@mastodon.CS.Berkeley.EDU
1403
1404LOCAL_RELAY set to	mail.CS.Berkeley.EDU	  (delivered locally)
1405mail.CS.Berkeley.EDU	  (no local aliasing)	    (aliasing done)
1406
1407MAIL_HUB set to		mammoth.CS.Berkeley.EDU	  mammoth.CS.Berkeley.EDU
1408mammoth.CS.Berkeley.EDU	  (aliasing done)	    (aliasing done)
1409
1410Both LOCAL_RELAY and	mail.CS.Berkeley.EDU	  mammoth.CS.Berkeley.EDU
1411MAIL_HUB set as above	  (no local aliasing)	    (aliasing done)
1412
1413If you do not have FEATURE(`stickyhost') set, then LOCAL_RELAY and
1414MAIL_HUB act identically, with MAIL_HUB taking precedence.
1415
1416If you want all outgoing mail to go to a central relay site, define
1417SMART_HOST as well.  Briefly:
1418
1419	LOCAL_RELAY applies to unqualified names (e.g., "eric").
1420	MAIL_HUB applies to names qualified with the name of the
1421		local host (e.g., "eric@mastodon.CS.Berkeley.EDU").
1422	SMART_HOST applies to names qualified with other hosts or
1423		bracketed addresses (e.g., "eric@mastodon.CS.Berkeley.EDU"
1424		or "eric@[127.0.0.1]").
1425
1426However, beware that other relays (e.g., UUCP_RELAY, BITNET_RELAY,
1427DECNET_RELAY, and FAX_RELAY) take precedence over SMART_HOST, so if you
1428really want absolutely everything to go to a single central site you will
1429need to unset all the other relays -- or better yet, find or build a
1430minimal config file that does this.
1431
1432For duplicate suppression to work properly, the host name is best
1433specified with a terminal dot:
1434
1435	define(`MAIL_HUB', `host.domain.')
1436	      note the trailing dot ---^
1437
1438
1439+--------------+
1440| LDAP ROUTING |
1441+--------------+
1442
1443FEATURE(`ldap_routing') can be used to implement the IETF Internet Draft
1444LDAP Schema for Intranet Mail Routing
1445(draft-lachman-laser-ldap-mail-routing-01).  This feature enables
1446LDAP-based rerouting of a particular address to either a different host
1447or a different address.  The LDAP lookup is first attempted on the full
1448address (e.g., user@example.com) and then on the domain portion
1449(e.g., @example.com).  Be sure to setup your domain for LDAP routing using
1450LDAPROUTE_DOMAIN(), e.g.:
1451
1452	LDAPROUTE_DOMAIN(`example.com')
1453
1454By default, the feature will use the schemas as specified in the draft
1455and will not reject addresses not found by the LDAP lookup.  However,
1456this behavior can be changed by giving additional arguments to the FEATURE()
1457command:
1458
1459	FEATURE(`ldap_routing', <mailHost>, <mailRoutingAddress>, <bounce>)
1460
1461where <mailHost> is a map definition describing how to lookup an alternative
1462mail host for a particular address; <mailRoutingAddress> is a map definition
1463describing how to lookup an alternative address for a particular address; and
1464the <bounce> argument, if present and not the word "passthru", dictates
1465that mail should be bounced if neither a mailHost nor mailRoutingAddress
1466is found.
1467
1468The default <mailHost> map definition is:
1469
1470	ldap -1 -v mailHost -k (&(objectClass=inetLocalMailRecipient)
1471				 (mailLocalAddress=%0))
1472
1473The default <mailRoutingAddress> map definition is:
1474
1475	ldap -1 -v mailRoutingAddress -k (&(objectClass=inetLocalMailRecipient)
1476					   (mailLocalAddress=%0))
1477
1478Note that neither includes the LDAP server hostname (-h server) or base DN
1479(-b o=org,c=COUNTRY), both necessary for LDAP queries.  It is presumed that
1480your .mc file contains a setting for the confLDAP_DEFAULT_SPEC option with
1481these settings.  If this is not the case, the map definitions should be
1482changed as described above.
1483
1484The following possibilities exist as a result of an LDAP lookup on an
1485address:
1486
1487	mailHost is	mailRoutingAddress is	Results in
1488	-----------	---------------------	----------
1489	set to a	set			mail delivered to
1490	"local" host				mailRoutingAddress
1491
1492	set to a	not set			delivered to
1493	"local" host				original address
1494
1495	set to a	set			mailRoutingAddress
1496	remote host				relayed to mailHost
1497
1498	set to a	not set			original address
1499	remote host				relayed to mailHost
1500
1501	not set		set			mail delivered to
1502						mailRoutingAddress
1503
1504	not set		not set			delivered to
1505						original address *OR*
1506						bounced as unknown user
1507
1508The term "local" host above means the host specified is in class {w}.
1509Note that the last case depends on whether the third argument is given
1510to the FEATURE() command.  The default is to deliver the message to the
1511original address.
1512
1513The LDAP entries should be set up with an objectClass of
1514inetLocalMailRecipient and the address be listed in a mailLocalAddress
1515attribute.  If present, there must be only one mailHost attribute and it
1516must contain a fully qualified host name as its value.  Similarly, if
1517present, there must be only one mailRoutingAddress attribute and it must
1518contain an RFC 822 compliant address.  Some example LDAP records (in ldif
1519format):
1520
1521	dn: uid=tom, o=example.com, c=US
1522	objectClass: inetLocalMailRecipient
1523	mailLocalAddress: tom@example.com
1524	mailRoutingAddress: thomas@mailhost.example.com
1525
1526This would deliver mail for tom@example.com to thomas@mailhost.example.com.
1527
1528	dn: uid=dick, o=example.com, c=US
1529	objectClass: inetLocalMailRecipient
1530	mailLocalAddress: dick@example.com
1531	mailHost: eng.example.com
1532
1533This would relay mail for dick@example.com to the same address but redirect
1534the mail to MX records listed for the host eng.example.com.
1535
1536	dn: uid=harry, o=example.com, c=US
1537	objectClass: inetLocalMailRecipient
1538	mailLocalAddress: harry@example.com
1539	mailHost: mktmail.example.com
1540	mailRoutingAddress: harry@mkt.example.com
1541
1542This would relay mail for harry@example.com to the MX records listed for
1543the host mktmail.example.com using the new address harry@mkt.example.com
1544when talking to that host.
1545
1546	dn: uid=virtual.example.com, o=example.com, c=US
1547	objectClass: inetLocalMailRecipient
1548	mailLocalAddress: @virtual.example.com
1549	mailHost: server.example.com
1550	mailRoutingAddress: virtual@example.com
1551
1552This would send all mail destined for any username @virtual.example.com to
1553the machine server.example.com's MX servers and deliver to the address
1554virtual@example.com on that relay machine.
1555
1556
1557+---------------------------------+
1558| ANTI-SPAM CONFIGURATION CONTROL |
1559+---------------------------------+
1560
1561The primary anti-spam features available in sendmail are:
1562
1563* Relaying is denied by default.
1564* Better checking on sender information.
1565* Access database.
1566* Header checks.
1567
1568Relaying (transmission of messages from a site outside your host (class
1569{w}) to another site except yours) is denied by default.  Note that this
1570changed in sendmail 8.9; previous versions allowed relaying by default.
1571If you really want to revert to the old behaviour, you will need to use
1572FEATURE(`promiscuous_relay').  You can allow certain domains to relay
1573through your server by adding their domain name or IP address to class
1574{R} using RELAY_DOMAIN() and RELAY_DOMAIN_FILE() or via the access database
1575(described below).  The file consists (like any other file based class)
1576of entries listed on separate lines, e.g.,
1577
1578	sendmail.org
1579	128.32
1580	1:2:3:4:5:6:7
1581	host.mydomain.com
1582
1583If you use
1584
1585	FEATURE(`relay_entire_domain')
1586
1587then any host in any of your local domains (that is, class {m})
1588will be relayed (that is, you will accept mail either to or from any
1589host in your domain).
1590
1591You can also allow relaying based on the MX records of the host
1592portion of an incoming recipient address by using
1593
1594	FEATURE(`relay_based_on_MX')
1595
1596For example, if your server receives a recipient of user@domain.com
1597and domain.com lists your server in its MX records, the mail will be
1598accepted for relay to domain.com.  Note that this will stop spammers
1599from using your host to relay spam but it will not stop outsiders from
1600using your server as a relay for their site (that is, they set up an
1601MX record pointing to your mail server, and you will relay mail addressed
1602to them without any prior arrangement).  Along the same lines,
1603
1604	FEATURE(`relay_local_from')
1605
1606will allow relaying if the sender specifies a return path (i.e.
1607MAIL FROM: <user@domain>) domain which is a local domain.  This a
1608dangerous feature as it will allow spammers to spam using your mail
1609server by simply specifying a return address of user@your.domain.com.
1610It should not be used unless absolutely necessary.
1611A slightly better solution is
1612
1613	FEATURE(`relay_mail_from')
1614
1615which allows relaying if the mail sender is listed as RELAY in the
1616access map.  If an optional argument `domain' is given, the domain
1617portion of the mail sender is also checked to allowing relaying.
1618This option only works together with the tag From: for the LHS of
1619the access map entries (see below: Finer control...).
1620
1621
1622If source routing is used in the recipient address (i.e.
1623RCPT TO: <user%site.com@othersite.com>), sendmail will check
1624user@site.com for relaying if othersite.com is an allowed relay host
1625in either class {R}, class {m} if FEATURE(`relay_entire_domain') is used,
1626or the access database if FEATURE(`access_db') is used.  To prevent
1627the address from being stripped down, use:
1628
1629	FEATURE(`loose_relay_check')
1630
1631If you think you need to use this feature, you probably do not.  This
1632should only be used for sites which have no control over the addresses
1633that they provide a gateway for.  Use this FEATURE with caution as it
1634can allow spammers to relay through your server if not setup properly.
1635
1636NOTICE: It is possible to relay mail through a system which the anti-relay
1637rules do not prevent: the case of a system that does use FEATURE(`nouucp',
1638`nospecial') (system A) and relays local messages to a mail hub (e.g., via
1639LOCAL_RELAY or LUSER_RELAY) (system B).  If system B doesn't use
1640FEATURE(`nouucp') at all, addresses of the form
1641<example.net!user@local.host> would be relayed to <user@example.net>.
1642System A doesn't recognize `!' as an address separator and therefore
1643forwards it to the mail hub which in turns relays it because it came from
1644a trusted local host.  So if a mailserver allows UUCP (bang-format)
1645addresses, all systems from which it allows relaying should do the same
1646or reject those addresses.
1647
1648As of 8.9, sendmail will refuse mail if the MAIL FROM: parameter has
1649an unresolvable domain (i.e., one that DNS, your local name service,
1650or special case rules in ruleset 3 cannot locate).  If you want to
1651continue to accept such domains, e.g., because you are inside a
1652firewall that has only a limited view of the Internet host name space
1653(note that you will not be able to return mail to them unless you have
1654some "smart host" forwarder), use
1655
1656	FEATURE(`accept_unresolvable_domains')
1657
1658sendmail will also refuse mail if the MAIL FROM: parameter is not
1659fully qualified (i.e., contains a domain as well as a user).  If you
1660want to continue to accept such senders, use
1661
1662	FEATURE(`accept_unqualified_senders')
1663
1664Setting the DaemonPortOptions modifier 'u' overrides the default behavior,
1665i.e., unqualified addresses are accepted even without this FEATURE.  If
1666this FEATURE is not used, the DaemonPortOptions modifier 'f' can be used
1667to enforce fully qualified addresses.
1668
1669An ``access'' database can be created to accept or reject mail from
1670selected domains.  For example, you may choose to reject all mail
1671originating from known spammers.  To enable such a database, use
1672
1673	FEATURE(`access_db')
1674
1675The FEATURE macro can accept a second parameter giving the key file
1676definition for the database; for example
1677
1678	FEATURE(`access_db', `hash /etc/mail/access')
1679
1680Remember, since /etc/mail/access is a database, after creating the text
1681file as described below, you must use makemap to create the database
1682map.  For example:
1683
1684	makemap hash /etc/mail/access < /etc/mail/access
1685
1686The table itself uses e-mail addresses, domain names, and network
1687numbers as keys.  For example,
1688
1689	spammer@aol.com		REJECT
1690	cyberspammer.com	REJECT
1691	192.168.212		REJECT
1692
1693would refuse mail from spammer@aol.com, any user from cyberspammer.com
1694(or any host within the cyberspammer.com domain), and any host on the
1695192.168.212.* network.
1696
1697The value part of the map can contain:
1698
1699	OK		Accept mail even if other rules in the
1700			running ruleset would reject it, for example,
1701			if the domain name is unresolvable.
1702	RELAY		Accept mail addressed to the indicated domain or
1703			received from the indicated domain for relaying
1704			through your SMTP server.  RELAY also serves as
1705			an implicit OK for the other checks.
1706	REJECT		Reject the sender or recipient with a general
1707			purpose message.
1708	DISCARD		Discard the message completely using the
1709			$#discard mailer.  For sender addresses it
1710			indicates that you should discard anything
1711			received from the indicated domain.  If it
1712			is used for recipients, it affects only
1713			the designated recipients, not the whole
1714			message.
1715	### any text	where ### is an RFC 821 compliant error code
1716			and "any text" is a message to return for
1717			the command.
1718	ERROR:### any text
1719			as above, but useful to mark error messages as such.
1720	ERROR:D.S.N:### any text
1721			where D.S.N is an RFC 1893 compliant error code
1722			and the rest as above.
1723
1724For example:
1725
1726	cyberspammer.com	550 We don't accept mail from spammers
1727	okay.cyberspammer.com	OK
1728	sendmail.org		RELAY
1729	128.32			RELAY
1730	1:2:3:4:5:6:7		RELAY
1731	[127.0.0.3]		OK
1732	[1:2:3:4:5:6:7:8]	OK
1733
1734would accept mail from okay.cyberspammer.com, but would reject mail from
1735all other hosts at cyberspammer.com with the indicated message.  It would
1736allow relaying mail from and to any hosts in the sendmail.org domain, and
1737allow relaying from the 128.32.*.* network and the IPv6 1:2:3:4:5:6:7:*
1738network.  The latter two entries are for checks against ${client_name} if
1739the IP address doesn't resolve to a hostname (or is considered as "may be
1740forged").
1741
1742Warning: if you change the RFC 821 compliant error code from the default
1743value of 550, then you should probably also change the RFC 1893 compliant
1744error code to match it.  For example, if you use
1745
1746	user@example.com	450 mailbox full
1747
1748the error returned would be "450 4.0.0 mailbox full" which is wrong.
1749Use "450 4.2.2 mailbox full" or "ERROR:4.2.2:450 mailbox full"
1750instead.
1751
1752Note, UUCP users may need to add hostname.UUCP to the access database
1753or class {R}.  If you also use:
1754
1755	FEATURE(`relay_hosts_only')
1756
1757then the above example will allow relaying for sendmail.org, but not
1758hosts within the sendmail.org domain.  Note that this will also require
1759hosts listed in class {R} to be fully qualified host names.
1760
1761You can also use the access database to block sender addresses based on
1762the username portion of the address.  For example:
1763
1764	FREE.STEALTH.MAILER@	550 Spam not accepted
1765
1766Note that you must include the @ after the username to signify that
1767this database entry is for checking only the username portion of the
1768sender address.
1769
1770If you use:
1771
1772	FEATURE(`blacklist_recipients')
1773
1774then you can add entries to the map for local users, hosts in your
1775domains, or addresses in your domain which should not receive mail:
1776
1777	badlocaluser@		550 Mailbox disabled for this username
1778	host.mydomain.com	550 That host does not accept mail
1779	user@otherhost.mydomain.com	550 Mailbox disabled for this recipient
1780
1781This would prevent a recipient of badlocaluser@mydomain.com, any
1782user at host.mydomain.com, and the single address
1783user@otherhost.mydomain.com from receiving mail.  Please note: a
1784local username must be now tagged with an @ (this is consistent
1785with the check of the sender address, and hence it is possible to
1786distinguish between hostnames and usernames).  Enabling this feature
1787will keep you from sending mails to all addresses that have an
1788error message or REJECT as value part in the access map.  Taking
1789the example from above:
1790
1791	spammer@aol.com		REJECT
1792	cyberspammer.com	REJECT
1793
1794Mail can't be sent to spammer@aol.com or anyone at cyberspammer.com.
1795
1796There is also a ``Realtime Blackhole List'' run by the MAPS project
1797at http://maps.vix.com/.  This is a database maintained in DNS of
1798spammers.  To use this database, use
1799
1800	FEATURE(`dnsbl')
1801
1802This will cause sendmail to reject mail from any site in the
1803Realtime Blackhole List database.  You can specify an alternative
1804RBL domain to check by specifying an argument to the FEATURE.
1805A second argument can be used to change the default error message
1806Mail from $&{client_addr} refused by blackhole site DOMAIN
1807where DOMAIN is replaced by the first argument.  This FEATURE can
1808be included several times to query different DNS based rejection
1809lists, e.g., the dial-up user list (see http://maps.vix.com/dul/).
1810
1811The features described above make use of the check_relay, check_mail,
1812and check_rcpt rulesets.  If you wish to include your own checks,
1813you can put your checks in the rulesets Local_check_relay,
1814Local_check_mail, and Local_check_rcpt.  For example if you wanted to
1815block senders with all numeric usernames (i.e. 2312343@bigisp.com),
1816you would use Local_check_mail and the new regex map:
1817
1818	LOCAL_CONFIG
1819	Kallnumbers regex -a@MATCH ^[0-9]+$
1820
1821	LOCAL_RULESETS
1822	SLocal_check_mail
1823	# check address against various regex checks
1824	R$*				$: $>Parse0 $>3 $1
1825	R$+ < @ bigisp.com. > $*	$: $(allnumbers $1 $)
1826	R@MATCH				$#error $: 553 Header Error
1827
1828These rules are called with the original arguments of the corresponding
1829check_* ruleset.  If the local ruleset returns $#OK, no further checking
1830is done by the features described above and the mail is accepted.  If the
1831local ruleset resolves to a mailer (such as $#error or $#discard), the
1832appropriate action is taken.  Otherwise, the results of the local
1833rewriting are ignored.
1834
1835Finer control by using tags for the LHS of the access map
1836
1837Read this section only if the options listed so far are not sufficient
1838for your purposes.  There is now the option to tag entries in the
1839access map according to their type.  Three tags are available:
1840
1841	Connect:	connection information (${client_addr}, ${client_name})
1842	From:		sender
1843	To:		recipient
1844
1845If the required item is looked up in a map, it will be tried first
1846with the corresponding tag in front, then (as fallback to enable
1847backward compatibility) without any tag.  For example,
1848
1849	From:spammer@some.dom	REJECT
1850	To:friend.domain	RELAY
1851	Connect:friend.domain	OK
1852	Connect:from.domain	RELAY
1853	From:good@another.dom	OK
1854	From:another.dom	REJECT
1855
1856This would deny mails from spammer@some.dom but you could still
1857send mail to that address even if FEATURE(`blacklist_recipients')
1858is enabled.  Your system will allow relaying to friend.domain, but
1859not from it (unless enabled by other means).  Connections from that
1860domain will be allowed even if it ends up in one of the DNS based
1861rejection lists.  Relaying is enabled from from.domain but not to
1862it (since relaying is based on the connection information for
1863outgoing relaying, the tag Connect: must be used; for incoming
1864relaying, which is based on the recipient address, To: must be
1865used).  The last two entries allow mails from good@another.dom but
1866reject mail from all other addresses with another.dom as domain
1867part.
1868
1869Delay all checks
1870
1871By using FEATURE(`delay_checks') the rulesets check_mail and check_relay
1872will not be called when a client connects or issues a MAIL command,
1873respectively.  Instead, those rulesets will be called by the check_rcpt
1874ruleset; they will be skipped if a sender has been authenticated using
1875a "trusted" mechanism, i.e., one that is defined via TRUST_AUTH_MECH().
1876If check_mail returns an error then the RCPT TO command will be rejected
1877with that error.  If it returns some other result starting with $# then
1878check_relay will be skipped.  If the sender address (or a part of it) is
1879listed in the access map and it has a RHS of OK or RELAY, then check_relay
1880will be skipped.  This has an interesting side effect: if your domain is
1881my.domain and you have
1882
1883	my.domain	RELAY
1884
1885in the access map, then all e-mail with a sender address of
1886<user@my.domain> gets through, even if check_relay would reject it
1887(e.g., based on the hostname or IP address).  This allows spammers
1888to get around DNS based blacklist by faking the sender address.  To
1889avoid this problem you have to use tagged entries:
1890
1891	To:my.domain		RELAY
1892	Connect:my.domain	RELAY
1893
1894if you need those entries at all (class {R} may take care of them).
1895 
1896FEATURE(`delay_checks') can take an optional argument:
1897
1898	FEATURE(`delay_checks', `friend')
1899		 enables spamfriend test
1900	FEATURE(`delay_checks', `hater')
1901		 enables spamhater test
1902
1903If such an argument is given, the recipient will be looked up in the access
1904map (using the tag To:).  If the argument is `friend', then the other
1905rulesets will be skipped if the recipient address is found and has RHS
1906spamfriend.  If the argument is `hater', then the other rulesets will be
1907applied if the recipient address is found and has RHS spamhater.
1908
1909This allows for simple exceptions from the tests, e.g., by activating
1910the spamfriend option and having
1911
1912	To:abuse@	SPAMFRIEND
1913
1914in the access map, mail to abuse@localdomain will get through.  It is
1915also possible to specify a full address or an address with +detail:
1916
1917	To:abuse@abuse.my.domain	SPAMFRIEND
1918	To:me+abuse@		SPAMFRIEND
1919
1920
1921Header Checks
1922
1923You can also reject mail on the basis of the contents of headers.
1924This is done by adding a ruleset call to the 'H' header definition command
1925in sendmail.cf.  For example, this can be used to check the validity of
1926a Message-ID: header:
1927
1928	LOCAL_RULESETS
1929	HMessage-Id: $>CheckMessageId
1930
1931	SCheckMessageId
1932	R< $+ @ $+ >		$@ OK
1933	R$*			$#error $: 553 Header Error
1934
1935The alternative format:
1936
1937	HSubject: $>+CheckSubject
1938
1939that is, $>+ instead of $>, gives the full Subject: header including
1940comments to the ruleset (comments in parentheses () are stripped
1941by default).
1942
1943A default ruleset for headers which don't have a specific ruleset
1944defined for them can be given by:
1945
1946	H*: $>CheckHdr
1947
1948After all of the headers are read, the check_eoh ruleset will be called for
1949any final header-related checks.  The ruleset is called with the number of
1950headers and the size of all of the headers in bytes separated by $|.  One
1951example usage is to reject messages which do not have a Message-Id:
1952header.  However, the Message-Id: header is *NOT* a required header and is
1953not a guaranteed spam indicator.  This ruleset is an example and should
1954probably not be used in production.
1955
1956	LOCAL_CONFIG
1957	Kstorage macro
1958
1959	LOCAL_RULESETS
1960	HMessage-Id: $>CheckMessageId
1961
1962	SCheckMessageId
1963	# Record the presence of the header
1964	R$*			$: $(storage {MessageIdCheck} $@ OK $) $1
1965	R< $+ @ $+ >		$@ OK
1966	R$*			$#error $: 553 Header Error
1967
1968	Scheck_eoh
1969	# Check the macro
1970	R$*			$: < $&{MessageIdCheck} >
1971	# Clear the macro for the next message
1972	R$*			$: $(storage {MessageIdCheck} $) $1
1973	# Has a Message-Id: header
1974	R< $+ >			$@ OK
1975	# Allow missing Message-Id: from local mail
1976	R$*			$: < $&{client_name} >
1977	R< >			$@ OK
1978	R< $=w >		$@ OK
1979	# Otherwise, reject the mail
1980	R$*			$#error $: 553 Header Error
1981
1982+--------------------------------+
1983| STARTTLS                       |
1984+--------------------------------+
1985
1986In this text, cert will be used as an abreviation for X.509 certificate,
1987DN is the distinguished name of a cert, and CA is a certification authority.
1988
1989Macros related to STARTTLS are:
1990
1991${cert_issuer} holds the DN of the CA (the cert issuer).
1992${cert_subject} holds the DN of the cert (called the cert subject).
1993${tls_version} the TLS/SSL version used for the connection, e.g., TLSv1,
1994	SSLv3, SSLv2.
1995${cipher} the cipher used for the connection, e.g., EDH-DSS-DES-CBC3-SHA,
1996	EDH-RSA-DES-CBC-SHA, DES-CBC-MD5, DES-CBC3-SHA.
1997${cipher_bits} the keylength (in bits) of the symmetric encryption algorithm
1998	used for the connection.
1999${verify} holds the result of the verification of the presented cert. Possible
2000	values are:
2001	OK	verification succeeded.
2002	NO	no cert presented.
2003	FAIL	cert presented but could not be verified, e.g., the signing
2004		CA is missing.
2005	NONE	STARTTLS has not been performed.
2006	TEMP	temporary error occurred.
2007	PROTOCOL some protocol error occurred.
2008	SOFTWARE STARTTLS handshake failed.
2009${server_name}	the name of the server of the current outgoing SMTP
2010	connection.
2011${server_addr}	the address of the server of the current outgoing SMTP
2012	connection.
2013
2014Relaying
2015
2016SMTP STARTTLS can allow relaying for senders who have successfully
2017authenticated themselves. This is done in the ruleset RelayAuth. If the
2018verification of the cert failed (${verify} != OK), relaying is subject to
2019the usual rules. Otherwise the DN of the issuer is looked up in the access
2020map using the tag CERTISSUER. If the resulting value is RELAY, relaying is
2021allowed. If it is SUBJECT, the DN of the cert subject is looked up next in
2022the access map. using the tag CERTSUBJECT. If the value is RELAY, relaying
2023is allowed.
2024
2025To make things a bit more flexible (or complicated), the values for
2026${cert_issuer} and ${cert_subject} can be optionally modified by regular
2027expressions defined in the m4 variables _CERT_REGEX_ISSUER_ and
2028_CERT_REGEX_SUBJECT_, respectively. To avoid problems with those macros in
2029rulesets and map lookups, they are modified as follows: each non-printable
2030character and the characters '<', '>', '(', ')', '"', '+' are replaced by
2031their HEX value with a leading '+'. For example:
2032
2033/C=US/ST=California/O=endmail.org/OU=private/CN=Darth Mail (Cert)/Email=
2034darth+cert@endmail.org
2035
2036is encoded as:
2037
2038/C=US/ST=California/O=endmail.org/OU=private/CN=
2039Darth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org
2040
2041(line breaks have been inserted for readability).
2042
2043Of course it is also possible to write a simple rulesets that allows
2044relaying for everyone who can present a cert that can be verified, e.g.,
2045
2046LOCAL_RULESETS
2047SLocal_check_rcpt
2048R$*	$: $&{verify}
2049ROK	$# OK
2050
2051Allowing Connections
2052
2053The rulesets tls_server and tls_client are used to decide whether an SMTP
2054connection is accepted (or should continue).
2055
2056tls_server is called when sendmail acts as client after a STARTTLS command
2057(should) have been issued. The parameter is the value of ${verify}.
2058
2059tls_client is called when sendmail acts as server, after a STARTTLS command
2060has been issued, and from check_mail. The parameter is the value of
2061${verify} and STARTTLS or MAIL, respectively.
2062
2063Both rulesets behave the same. If no access map is in use, the connection
2064will be accepted unless ${verify} is SOFTWARE, in which case the connection
2065is always aborted.  Otherwise, ${client_name} (${server_name}) is looked
2066up in the access map using the tag TLS_Srv (or TLS_Clt), which is done
2067with the ruleset LookUpDomain. If no entry is found, ${client_addr}
2068(${server_addr}) is looked up in the access map (same tag, ruleset
2069LookUpAddr). If this doesn't result in an entry either, just the tag is
2070looked up in the access map (included the trailing :).  The result of the
2071lookups is then used to call the ruleset tls_connection, which checks the
2072requirement specified by the RHS in the access map against the actual
2073parameters of the current TLS connection, esp. ${verify} and
2074${cipher_bits}. Legal RHSs in the access map are:
2075
2076VERIFY		verification must have succeeded
2077VERIFY:bits	verification must have succeeded and ${cipher_bits} must
2078		be greater than or equal bits.
2079ENCR:bits	${cipher_bits} must be greater than or equal bits.
2080
2081The RHS can optionally be prefixed by TEMP+ or PERM+ to select a temporary
2082or permanent error. The default is a temporary error code (403 4.7.0)
2083unless the macro TLS_PERM_ERR is set during generation of the .cf file.
2084
2085If a certain level of encryption is required, then it might also be
2086possible that this level is provided by the security layer from a SASL
2087algorithm, e.g., DIGEST-MD5.
2088
2089Example: e-mail send to secure.example.com should only use an encrypted
2090connection. e-mail received from hosts within the laptop.example.com domain
2091should only be accepted if they have been authenticated.
2092TLS_Srv:secure.example.com      ENCR:112
2093TLS_Clt:laptop.example.com      PERM+VERIFY:112
2094
2095Received: Header
2096
2097The Received: header reveals whether STARTTLS has been used. It contains an
2098extra line:
2099
2100(using ${tls_version} with cipher ${cipher} (${cipher_bits} bits) verified ${verify})
2101
2102+--------------------------------+
2103| SMTP AUTHENTICATION            |
2104+--------------------------------+
2105
2106The macros ${auth_authen}, ${auth_author}, and ${auth_type} can be
2107used in anti-relay rulesets to allow relaying for those users that
2108authenticated themselves.  A very simple example is:
2109
2110SLocal_check_rcpt
2111R$*		$: $&{auth_type}
2112R$+		$# OK
2113
2114which checks whether a user has successfully authenticated using
2115any available mechanism.  Depending on the setup of the CYRUS SASL
2116library, more sophisticated rulesets might be required, e.g.,
2117
2118SLocal_check_rcpt
2119R$*		$: $&{auth_type} $| $&{auth_authen}
2120RDIGEST-MD5 $| $+@$=w	$# OK
2121
2122to allow relaying for users that authenticated using DIGEST-MD5
2123and have an identity in the local domains.
2124
2125The ruleset Strust_auth is used to determine whether a given AUTH=
2126parameter (that is passed to this ruleset) should be trusted.  This
2127ruleset may make use of the other ${auth_*} macros.  Only if the
2128ruleset resolves to the error mailer, the AUTH= parameter is not
2129trusted.  A user supplied ruleset Local_trust_auth can be written
2130to modify the default behavior, which only trust the AUTH=
2131parameter if it is identical to the authenticated user.
2132
2133Per default, relaying is allowed for any user who authenticated
2134via a "trusted" mechanism, i.e., one that is defined via
2135TRUST_AUTH_MECH(`list of mechanisms')
2136
2137If the selected mechanism provides a security layer the number of
2138bits used for the key of the symmetric cipher is stored in the
2139macro ${auth_ssf}.
2140
2141+--------------------------------+
2142| ADDING NEW MAILERS OR RULESETS |
2143+--------------------------------+
2144
2145Sometimes you may need to add entirely new mailers or rulesets.  They
2146should be introduced with the constructs MAILER_DEFINITIONS and
2147LOCAL_RULESETS respectively.  For example:
2148
2149	MAILER_DEFINITIONS
2150	Mmymailer, ...
2151	...
2152
2153	LOCAL_RULESETS
2154	Smyruleset
2155	...
2156
2157
2158#if _FFR_MILTER
2159+---------------------------+
2160| ADDING NEW MAILER FILTERS |
2161+---------------------------+
2162
2163Sendmail supports mail filters to filter incoming SMTP messages according
2164to the "Sendmail Mail Filter API" documentation.  These filters can be
2165configured in your mc file using the two commands:
2166
2167	MAIL_FILTER(`name', `equates')
2168	INPUT_MAIL_FILTER(`name', `equates')
2169
2170The first command, MAIL_FILTER(), simply defines a filter with the given
2171name and equates.  For example:
2172
2173	MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
2174
2175This creates the equivalent sendmail.cf entry:
2176
2177	Xarchive, S=local:/var/run/archivesock, F=R
2178
2179The INPUT_MAIL_FILTER() command performs the same actions as MAIL_FILTER
2180but also populates the m4 variable `confINPUT_MAIL_FILTERS' with the name
2181of the filter such that the filter will actually be called by sendmail.
2182
2183For example, the two commands:
2184
2185	INPUT_MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
2186	INPUT_MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T')
2187
2188are equivalent to the three commands:
2189
2190	MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
2191	MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T')
2192	define(`confINPUT_MAIL_FILTERS', `archive, spamcheck')
2193
2194In general, INPUT_MAIL_FILTER() should be used unless you need to define
2195more filters than you want to use for `confINPUT_MAIL_FILTERS'.
2196
2197Note that setting `confINPUT_MAIL_FILTERS' after any INPUT_MAIL_FILTER()
2198commands will clear the list created by the prior INPUT_MAIL_FILTER()
2199commands.
2200#endif /* _FFR_MILTER */
2201
2202
2203+-------------------------------+
2204| NON-SMTP BASED CONFIGURATIONS |
2205+-------------------------------+
2206
2207These configuration files are designed primarily for use by
2208SMTP-based sites.  They may not be well tuned for UUCP-only or
2209UUCP-primarily nodes (the latter is defined as a small local net
2210connected to the rest of the world via UUCP).  However, there is
2211one hook to handle some special cases.
2212
2213You can define a ``smart host'' that understands a richer address syntax
2214using:
2215
2216	define(`SMART_HOST', `mailer:hostname')
2217
2218In this case, the ``mailer:'' defaults to "relay".  Any messages that
2219can't be handled using the usual UUCP rules are passed to this host.
2220
2221If you are on a local SMTP-based net that connects to the outside
2222world via UUCP, you can use LOCAL_NET_CONFIG to add appropriate rules.
2223For example:
2224
2225	define(`SMART_HOST', `uucp-new:uunet')
2226	LOCAL_NET_CONFIG
2227	R$* < @ $* .$m. > $*	$#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3
2228
2229This will cause all names that end in your domain name ($m) via
2230SMTP; anything else will be sent via uucp-new (smart UUCP) to uunet.
2231If you have FEATURE(`nocanonify'), you may need to omit the dots after
2232the $m.  If you are running a local DNS inside your domain which is
2233not otherwise connected to the outside world, you probably want to
2234use:
2235
2236	define(`SMART_HOST', `smtp:fire.wall.com')
2237	LOCAL_NET_CONFIG
2238	R$* < @ $* . > $*	$#smtp $@ $2. $: $1 < @ $2. > $3
2239
2240That is, send directly only to things you found in your DNS lookup;
2241anything else goes through SMART_HOST.
2242
2243You may need to turn off the anti-spam rules in order to accept
2244UUCP mail with FEATURE(`promiscuous_relay') and
2245FEATURE(`accept_unresolvable_domains').
2246
2247
2248+-----------+
2249| WHO AM I? |
2250+-----------+
2251
2252Normally, the $j macro is automatically defined to be your fully
2253qualified domain name (FQDN).  Sendmail does this by getting your
2254host name using gethostname and then calling gethostbyname on the
2255result.  For example, in some environments gethostname returns
2256only the root of the host name (such as "foo"); gethostbyname is
2257supposed to return the FQDN ("foo.bar.com").  In some (fairly rare)
2258cases, gethostbyname may fail to return the FQDN.  In this case
2259you MUST define confDOMAIN_NAME to be your fully qualified domain
2260name.  This is usually done using:
2261
2262	Dmbar.com
2263	define(`confDOMAIN_NAME', `$w.$m')dnl
2264
2265
2266+-----------------------------------+
2267| ACCEPTING MAIL FOR MULTIPLE NAMES |
2268+-----------------------------------+
2269
2270If your host is known by several different names, you need to augment
2271class {w}.  This is a list of names by which your host is known, and
2272anything sent to an address using a host name in this list will be
2273treated as local mail.  You can do this in two ways:  either create the
2274file /etc/mail/local-host-names containing a list of your aliases (one per
2275line), and use ``FEATURE(`use_cw_file')'' in the .mc file, or add
2276``LOCAL_DOMAIN(`alias.host.name')''.  Be sure you use the fully-qualified
2277name of the host, rather than a short name.
2278
2279If you want to have different address in different domains, take
2280a look at the virtusertable feature, which is also explained at
2281http://www.sendmail.org/virtual-hosting.html
2282
2283
2284+--------------------+
2285| USING MAILERTABLES |
2286+--------------------+
2287
2288To use FEATURE(`mailertable'), you will have to create an external
2289database containing the routing information for various domains.
2290For example, a mailertable file in text format might be:
2291
2292	.my.domain		xnet:%1.my.domain
2293	uuhost1.my.domain	uucp-new:uuhost1
2294	.bitnet			smtp:relay.bit.net
2295
2296This should normally be stored in /etc/mail/mailertable.  The actual
2297database version of the mailertable is built using:
2298
2299	makemap hash /etc/mail/mailertable < /etc/mail/mailertable
2300
2301The semantics are simple.  Any LHS entry that does not begin with
2302a dot matches the full host name indicated.  LHS entries beginning
2303with a dot match anything ending with that domain name -- that is,
2304they can be thought of as having a leading "*" wildcard.  Matching
2305is done in order of most-to-least qualified -- for example, even
2306though ".my.domain" is listed first in the above example, an entry
2307of "uuhost1.my.domain" will match the second entry since it is
2308more explicit.  Note: e-mail to "user@my.domain" does not match
2309any entry in the above table. You need to have something like:
2310
2311	my.domain		esmtp:host.my.domain
2312
2313The RHS should always be a "mailer:host" pair.  The mailer is the
2314configuration name of a mailer (that is, an {M} line in the
2315sendmail.cf file).  The "host" will be the hostname passed to
2316that mailer.  In domain-based matches (that is, those with leading
2317dots) the "%1" may be used to interpolate the wildcarded part of
2318the host name.  For example, the first line above sends everything
2319addressed to "anything.my.domain" to that same host name, but using
2320the (presumably experimental) xnet mailer.
2321
2322In some cases you may want to temporarily turn off MX records,
2323particularly on gateways.  For example, you may want to MX
2324everything in a domain to one machine that then forwards it
2325directly.  To do this, you might use the DNS configuration:
2326
2327	*.domain.	IN	MX	0	relay.machine
2328
2329and on relay.machine use the mailertable:
2330
2331	.domain		smtp:[gateway.domain]
2332
2333The [square brackets] turn off MX records for this host only.
2334If you didn't do this, the mailertable would use the MX record
2335again, which would give you an MX loop.
2336
2337
2338+--------------------------------+
2339| USING USERDB TO MAP FULL NAMES |
2340+--------------------------------+
2341
2342The user database was not originally intended for mapping full names
2343to login names (e.g., Eric.Allman => eric), but some people are using
2344it that way.  (it is recommended that you set up aliases for this
2345purpose instead -- since you can specify multiple alias files, this
2346is fairly easy.)  The intent was to locate the default maildrop at
2347a site, but allow you to override this by sending to a specific host.
2348
2349If you decide to set up the user database in this fashion, it is
2350imperative that you not use FEATURE(`stickyhost') -- otherwise,
2351e-mail sent to Full.Name@local.host.name will be rejected.
2352
2353To build the internal form of the user database, use:
2354
2355	makemap btree /etc/mail/userdb < /etc/mail/userdb.txt
2356
2357As a general rule, it is an extremely bad idea to using full names
2358as e-mail addresses, since they are not in any sense unique.  For
2359example, the Unix software-development community has at least two
2360well-known Peter Deutsches, and at one time Bell Labs had two
2361Stephen R. Bournes with offices along the same hallway.  Which one
2362will be forced to suffer the indignity of being Stephen_R_Bourne_2?
2363The less famous of the two, or the one that was hired later?
2364
2365Finger should handle full names (and be fuzzy).  Mail should use
2366handles, and not be fuzzy.
2367
2368
2369+--------------------------------+
2370| MISCELLANEOUS SPECIAL FEATURES |
2371+--------------------------------+
2372
2373Plussed users
2374	Sometimes it is convenient to merge configuration on a
2375	centralized mail machine, for example, to forward all
2376	root mail to a mail server.  In this case it might be
2377	useful to be able to treat the root addresses as a class
2378	of addresses with subtle differences.  You can do this
2379	using plussed users.  For example, a client might include
2380	the alias:
2381
2382		root:  root+client1@server
2383
2384	On the server, this will match an alias for "root+client1".
2385	If that is not found, the alias "root+*" will be tried,
2386	then "root".
2387
2388
2389+----------------+
2390| SECURITY NOTES |
2391+----------------+
2392
2393A lot of sendmail security comes down to you.  Sendmail 8 is much
2394more careful about checking for security problems than previous
2395versions, but there are some things that you still need to watch
2396for.  In particular:
2397
2398* Make sure the aliases file isn't writable except by trusted
2399  system personnel.  This includes both the text and database
2400  version.
2401
2402* Make sure that other files that sendmail reads, such as the
2403  mailertable, are only writable by trusted system personnel.
2404
2405* The queue directory should not be world writable PARTICULARLY
2406  if your system allows "file giveaways" (that is, if a non-root
2407  user can chown any file they own to any other user).
2408
2409* If your system allows file giveaways, DO NOT create a publically
2410  writable directory for forward files.  This will allow anyone
2411  to steal anyone else's e-mail.  Instead, create a script that
2412  copies the .forward file from users' home directories once a
2413  night (if you want the non-NFS-mounted forward directory).
2414
2415* If your system allows file giveaways, you'll find that
2416  sendmail is much less trusting of :include: files -- in
2417  particular, you'll have to have /SENDMAIL/ANY/SHELL/ in
2418  /etc/shells before they will be trusted (that is, before
2419  files and programs listed in them will be honored).
2420
2421In general, file giveaways are a mistake -- if you can turn them
2422off, do so.
2423
2424
2425+--------------------------------+
2426| TWEAKING CONFIGURATION OPTIONS |
2427+--------------------------------+
2428
2429There are a large number of configuration options that don't normally
2430need to be changed.  However, if you feel you need to tweak them, you
2431can define the following M4 variables.  This list is shown in four
2432columns:  the name you define, the default value for that definition,
2433the option or macro that is affected (either Ox for an option or Dx
2434for a macro), and a brief description.  Greater detail of the semantics
2435can be found in the Installation and Operations Guide.
2436
2437Some options are likely to be deprecated in future versions -- that is,
2438the option is only included to provide back-compatibility.  These are
2439marked with "*".
2440
2441Remember that these options are M4 variables, and hence may need to
2442be quoted.  In particular, arguments with commas will usually have to
2443be ``double quoted, like this phrase'' to avoid having the comma
2444confuse things.  This is common for alias file definitions and for
2445the read timeout.
2446
2447M4 Variable Name	Configuration	Description & [Default]
2448================	=============	=======================
2449confMAILER_NAME		$n macro	[MAILER-DAEMON] The sender name used
2450					for internally generated outgoing
2451					messages.
2452confDOMAIN_NAME		$j macro	If defined, sets $j.  This should
2453					only be done if your system cannot
2454					determine your local domain name,
2455					and then it should be set to
2456					$w.Foo.COM, where Foo.COM is your
2457					domain name.
2458confCF_VERSION		$Z macro	If defined, this is appended to the
2459					configuration version name.
2460confFROM_HEADER		From:		[$?x$x <$g>$|$g$.] The format of an
2461					internally generated From: address.
2462confRECEIVED_HEADER	Received:
2463		[$?sfrom $s $.$?_($?s$|from $.$_)
2464			$.$?{auth_type}(authenticated)
2465			$.by $j ($v/$Z)$?r with $r$. id $i$?u
2466			for $u; $|;
2467			$.$b]
2468					The format of the Received: header
2469					in messages passed through this host.
2470					It is unwise to try to change this.
2471confCW_FILE		Fw class	[/etc/mail/local-host-names] Name
2472					of file used to get the local
2473					additions to class {w} (local host
2474					names).
2475confCT_FILE		Ft class	[/etc/mail/trusted-users] Name of
2476					file used to get the local additions
2477					to class {t} (trusted users).
2478confCR_FILE		FR class	[/etc/mail/relay-domains] Name of
2479					file used to get the local additions
2480					to class {R} (hosts allowed to relay).
2481confTRUSTED_USERS	Ct class	[no default] Names of users to add to
2482					the list of trusted users.  This list
2483					always includes root, uucp, and daemon.
2484					See also FEATURE(`use_ct_file').
2485confTRUSTED_USER	TrustedUser	[no default] Trusted user for file
2486					ownership and starting the daemon.
2487					Not to be confused with
2488					confTRUSTED_USERS (see above).
2489confSMTP_MAILER		-		[esmtp] The mailer name used when
2490					SMTP connectivity is required.
2491					One of "smtp", "smtp8",
2492					"esmtp", or "dsmtp".
2493confUUCP_MAILER		-		[uucp-old] The mailer to be used by
2494					default for bang-format recipient
2495					addresses.  See also discussion of
2496					class {U}, class {Y}, and class {Z}
2497					in the MAILER(`uucp') section.
2498confLOCAL_MAILER	-		[local] The mailer name used when
2499					local connectivity is required.
2500					Almost always "local".
2501confRELAY_MAILER	-		[relay] The default mailer name used
2502					for relaying any mail (e.g., to a
2503					BITNET_RELAY, a SMART_HOST, or
2504					whatever).  This can reasonably be
2505					"uucp-new" if you are on a
2506					UUCP-connected site.
2507confSEVEN_BIT_INPUT	SevenBitInput	[False] Force input to seven bits?
2508confEIGHT_BIT_HANDLING	EightBitMode	[pass8] 8-bit data handling
2509confALIAS_WAIT		AliasWait	[10m] Time to wait for alias file
2510					rebuild until you get bored and
2511					decide that the apparently pending
2512					rebuild failed.
2513confMIN_FREE_BLOCKS	MinFreeBlocks	[100] Minimum number of free blocks on
2514					queue filesystem to accept SMTP mail.
2515					(Prior to 8.7 this was minfree/maxsize,
2516					where minfree was the number of free
2517					blocks and maxsize was the maximum
2518					message size.  Use confMAX_MESSAGE_SIZE
2519					for the second value now.)
2520confMAX_MESSAGE_SIZE	MaxMessageSize	[infinite] The maximum size of messages
2521					that will be accepted (in bytes).
2522confBLANK_SUB		BlankSub	[.] Blank (space) substitution
2523					character.
2524confCON_EXPENSIVE	HoldExpensive	[False] Avoid connecting immediately
2525					to mailers marked expensive.
2526confCHECKPOINT_INTERVAL	CheckpointInterval
2527					[10] Checkpoint queue files every N
2528					recipients.
2529confDELIVERY_MODE	DeliveryMode	[background] Default delivery mode.
2530confAUTO_REBUILD	AutoRebuildAliases
2531					[False] Automatically rebuild alias
2532					file if needed.
2533					There is a potential for a denial
2534					of service attack if this is set.
2535					This option is deprecated and will
2536					be removed from a future version.
2537confERROR_MODE		ErrorMode	[print] Error message mode.
2538confERROR_MESSAGE	ErrorHeader	[undefined] Error message header/file.
2539confSAVE_FROM_LINES	SaveFromLine	Save extra leading From_ lines.
2540confTEMP_FILE_MODE	TempFileMode	[0600] Temporary file mode.
2541confMATCH_GECOS		MatchGECOS	[False] Match GECOS field.
2542confMAX_HOP		MaxHopCount	[25] Maximum hop count.
2543confIGNORE_DOTS*	IgnoreDots	[False; always False in -bs or -bd
2544					mode] Ignore dot as terminator for
2545					incoming messages?
2546confBIND_OPTS		ResolverOptions	[undefined] Default options for DNS
2547					resolver.
2548confMIME_FORMAT_ERRORS*	SendMimeErrors	[True] Send error messages as MIME-
2549					encapsulated messages per RFC 1344.
2550confFORWARD_PATH	ForwardPath	[$z/.forward.$w:$z/.forward]
2551					The colon-separated list of places to
2552					search for .forward files.  N.B.: see
2553					the Security Notes section.
2554confMCI_CACHE_SIZE	ConnectionCacheSize
2555					[2] Size of open connection cache.
2556confMCI_CACHE_TIMEOUT	ConnectionCacheTimeout
2557					[5m] Open connection cache timeout.
2558confHOST_STATUS_DIRECTORY HostStatusDirectory
2559					[undefined] If set, host status is kept
2560					on disk between sendmail runs in the
2561					named directory tree.  This need not be
2562					a full pathname, in which case it is
2563					interpreted relative to the queue
2564					directory.
2565confSINGLE_THREAD_DELIVERY  SingleThreadDelivery
2566					[False] If this option and the
2567					HostStatusDirectory option are both
2568					set, single thread deliveries to other
2569					hosts.  That is, don't allow any two
2570					sendmails on this host to connect
2571					simultaneously to any other single
2572					host.  This can slow down delivery in
2573					some cases, in particular since a
2574					cached but otherwise idle connection
2575					to a host will prevent other sendmails
2576					from connecting to the other host.
2577confUSE_ERRORS_TO*	UseErrorsTo	[False] Use the Errors-To: header to
2578					deliver error messages.  This should
2579					not be necessary because of general
2580					acceptance of the envelope/header
2581					distinction.
2582confLOG_LEVEL		LogLevel	[9] Log level.
2583confME_TOO		MeToo		[True] Include sender in group
2584					expansions.  This option is
2585					deprecated and will be removed from
2586					a future version.
2587confCHECK_ALIASES	CheckAliases	[False] Check RHS of aliases when
2588					running newaliases.  Since this does
2589					DNS lookups on every address, it can
2590					slow down the alias rebuild process
2591					considerably on large alias files.
2592confOLD_STYLE_HEADERS*	OldStyleHeaders	[True] Assume that headers without
2593					special chars are old style.
2594confCLIENT_OPTIONS	ClientPortOptions
2595					[none] Options for outgoing SMTP client
2596					connections.
2597confPRIVACY_FLAGS	PrivacyOptions	[authwarnings] Privacy flags.
2598confCOPY_ERRORS_TO	PostmasterCopy	[undefined] Address for additional
2599					copies of all error messages.
2600confQUEUE_FACTOR	QueueFactor	[600000] Slope of queue-only function.
2601confDONT_PRUNE_ROUTES	DontPruneRoutes	[False] Don't prune down route-addr
2602					syntax addresses to the minimum
2603					possible.
2604confSAFE_QUEUE*		SuperSafe	[True] Commit all messages to disk
2605					before forking.
2606confTO_INITIAL		Timeout.initial	[5m] The timeout waiting for a response
2607					on the initial connect.
2608confTO_CONNECT		Timeout.connect	[0] The timeout waiting for an initial
2609					connect() to complete.  This can only
2610					shorten connection timeouts; the kernel
2611					silently enforces an absolute maximum
2612					(which varies depending on the system).
2613confTO_ICONNECT		Timeout.iconnect
2614					[undefined] Like Timeout.connect, but
2615					applies only to the very first attempt
2616					to connect to a host in a message.
2617					This allows a single very fast pass
2618					followed by more careful delivery
2619					attempts in the future.
2620confTO_HELO		Timeout.helo	[5m] The timeout waiting for a response
2621					to a HELO or EHLO command.
2622confTO_MAIL		Timeout.mail	[10m] The timeout waiting for a
2623					response to the MAIL command.
2624confTO_RCPT		Timeout.rcpt	[1h] The timeout waiting for a response
2625					to the RCPT command.
2626confTO_DATAINIT		Timeout.datainit
2627					[5m] The timeout waiting for a 354
2628					response from the DATA command.
2629confTO_DATABLOCK	Timeout.datablock
2630					[1h] The timeout waiting for a block
2631					during DATA phase.
2632confTO_DATAFINAL	Timeout.datafinal
2633					[1h] The timeout waiting for a response
2634					to the final "." that terminates a
2635					message.
2636confTO_RSET		Timeout.rset	[5m] The timeout waiting for a response
2637					to the RSET command.
2638confTO_QUIT		Timeout.quit	[2m] The timeout waiting for a response
2639					to the QUIT command.
2640confTO_MISC		Timeout.misc	[2m] The timeout waiting for a response
2641					to other SMTP commands.
2642confTO_COMMAND		Timeout.command	[1h] In server SMTP, the timeout
2643					waiting	for a command to be issued.
2644confTO_IDENT		Timeout.ident	[5s] The timeout waiting for a
2645					response to an IDENT query.
2646confTO_FILEOPEN		Timeout.fileopen
2647					[60s] The timeout waiting for a file
2648					(e.g., :include: file) to be opened.
2649confTO_CONTROL		Timeout.control
2650					[2m] The timeout for a complete
2651					control socket transaction to complete.
2652confTO_QUEUERETURN	Timeout.queuereturn
2653					[5d] The timeout before a message is
2654					returned as undeliverable.
2655confTO_QUEUERETURN_NORMAL
2656			Timeout.queuereturn.normal
2657					[undefined] As above, for normal
2658					priority messages.
2659confTO_QUEUERETURN_URGENT
2660			Timeout.queuereturn.urgent
2661					[undefined] As above, for urgent
2662					priority messages.
2663confTO_QUEUERETURN_NONURGENT
2664			Timeout.queuereturn.non-urgent
2665					[undefined] As above, for non-urgent
2666					(low) priority messages.
2667confTO_QUEUEWARN	Timeout.queuewarn
2668					[4h] The timeout before a warning
2669					message is sent to the sender telling
2670					them that the message has been
2671					deferred.
2672confTO_QUEUEWARN_NORMAL	Timeout.queuewarn.normal
2673					[undefined] As above, for normal
2674					priority messages.
2675confTO_QUEUEWARN_URGENT	Timeout.queuewarn.urgent
2676					[undefined] As above, for urgent
2677					priority messages.
2678confTO_QUEUEWARN_NONURGENT
2679			Timeout.queuewarn.non-urgent
2680					[undefined] As above, for non-urgent
2681					(low) priority messages.
2682confTO_HOSTSTATUS	Timeout.hoststatus
2683					[30m] How long information about host
2684					statuses will be maintained before it
2685					is considered stale and the host should
2686					be retried.  This applies both within
2687					a single queue run and to persistent
2688					information (see below).
2689confTO_RESOLVER_RETRANS	Timeout.resolver.retrans
2690					[varies] Sets the resolver's
2691					retransmition time interval (in
2692					seconds).  Sets both
2693					Timeout.resolver.retrans.first and
2694					Timeout.resolver.retrans.normal.
2695confTO_RESOLVER_RETRANS_FIRST  Timeout.resolver.retrans.first
2696					[varies] Sets the resolver's
2697					retransmition time interval (in
2698					seconds) for the first attempt to
2699					deliver a message.
2700confTO_RESOLVER_RETRANS_NORMAL  Timeout.resolver.retrans.normal
2701					[varies] Sets the resolver's
2702					retransmition time interval (in
2703					seconds) for all resolver lookups
2704					except the first delivery attempt.
2705confTO_RESOLVER_RETRY	Timeout.resolver.retry
2706					[varies] Sets the number of times
2707					to retransmit a resolver query.
2708					Sets both
2709					Timeout.resolver.retry.first and
2710					Timeout.resolver.retry.normal.
2711confTO_RESOLVER_RETRY_FIRST  Timeout.resolver.retry.first
2712					[varies] Sets the number of times
2713					to retransmit a resolver query for
2714					the first attempt to deliver a
2715					message.
2716confTO_RESOLVER_RETRY_NORMAL  Timeout.resolver.retry.normal
2717					[varies] Sets the number of times
2718					to retransmit a resolver query for
2719					all resolver lookups except the
2720					first delivery attempt.
2721confTIME_ZONE		TimeZoneSpec	[USE_SYSTEM] Time zone info -- can be
2722					USE_SYSTEM to use the system's idea,
2723					USE_TZ to use the user's TZ envariable,
2724					or something else to force that value.
2725confDEF_USER_ID		DefaultUser	[1:1] Default user id.
2726confUSERDB_SPEC		UserDatabaseSpec
2727					[undefined] User database
2728					specification.
2729confFALLBACK_MX		FallbackMXhost	[undefined] Fallback MX host.
2730confTRY_NULL_MX_LIST	TryNullMXList	[False] If this host is the best MX
2731					for a host and other arrangements
2732					haven't been made, try connecting
2733					to the host directly; normally this
2734					would be a config error.
2735confQUEUE_LA		QueueLA		[varies] Load average at which
2736					queue-only function kicks in.
2737					Default values is (8 * numproc)
2738					where numproc is the number of
2739					processors online (if that can be
2740					determined).
2741confREFUSE_LA		RefuseLA	[varies] Load average at which
2742					incoming SMTP connections are
2743					refused.  Default values is (12 *
2744					numproc) where numproc is the
2745					number of processors online (if
2746					that can be determined).
2747confMAX_ALIAS_RECURSION	MaxAliasRecursion
2748					[10] Maximum depth of alias recursion.
2749confMAX_DAEMON_CHILDREN	MaxDaemonChildren
2750					[undefined] The maximum number of
2751					children the daemon will permit.  After
2752					this number, connections will be
2753					rejected.  If not set or <= 0, there is
2754					no limit.
2755confMAX_HEADERS_LENGTH	MaxHeadersLength
2756					[undefined] Maximum length of the sum
2757					of all headers.
2758confMAX_MIME_HEADER_LENGTH  MaxMimeHeaderLength
2759					[undefined] Maximum length of
2760					certain MIME header field values.
2761confCONNECTION_RATE_THROTTLE ConnectionRateThrottle
2762					[undefined] The maximum number of
2763					connections permitted per second.
2764					After this many connections are
2765					accepted, further connections will be
2766					delayed.  If not set or <= 0, there is
2767					no limit.
2768confWORK_RECIPIENT_FACTOR
2769			RecipientFactor	[30000] Cost of each recipient.
2770confSEPARATE_PROC	ForkEachJob	[False] Run all deliveries in a
2771					separate process.
2772confWORK_CLASS_FACTOR	ClassFactor	[1800] Priority multiplier for class.
2773confWORK_TIME_FACTOR	RetryFactor	[90000] Cost of each delivery attempt.
2774confQUEUE_SORT_ORDER	QueueSortOrder	[Priority] Queue sort algorithm:
2775					Priority, Host, Filename, or Time.
2776confMIN_QUEUE_AGE	MinQueueAge	[0] The minimum amount of time a job
2777					must sit in the queue between queue
2778					runs.  This allows you to set the
2779					queue run interval low for better
2780					responsiveness without trying all
2781					jobs in each run.
2782confDEF_CHAR_SET	DefaultCharSet	[unknown-8bit] When converting
2783					unlabeled 8 bit input to MIME, the
2784					character set to use by default.
2785confSERVICE_SWITCH_FILE	ServiceSwitchFile
2786					[/etc/mail/service.switch] The file
2787					to use for the service switch on
2788					systems that do not have a
2789					system-defined switch.
2790confHOSTS_FILE		HostsFile	[/etc/hosts] The file to use when doing
2791					"file" type access of hosts names.
2792confDIAL_DELAY		DialDelay	[0s] If a connection fails, wait this
2793					long and try again.  Zero means "don't
2794					retry".  This is to allow "dial on
2795					demand" connections to have enough time
2796					to complete a connection.
2797confNO_RCPT_ACTION	NoRecipientAction
2798					[none] What to do if there are no legal
2799					recipient fields (To:, Cc: or Bcc:)
2800					in the message.  Legal values can
2801					be "none" to just leave the
2802					nonconforming message as is, "add-to"
2803					to add a To: header with all the
2804					known recipients (which may expose
2805					blind recipients), "add-apparently-to"
2806					to do the same but use Apparently-To:
2807					instead of To:, "add-bcc" to add an
2808					empty Bcc: header, or
2809					"add-to-undisclosed" to add the header
2810					``To: undisclosed-recipients:;''.
2811confSAFE_FILE_ENV	SafeFileEnvironment
2812					[undefined] If set, sendmail will do a
2813					chroot() into this directory before
2814					writing files.
2815confCOLON_OK_IN_ADDR	ColonOkInAddr	[True unless Configuration Level > 6]
2816					If set, colons are treated as a regular
2817					character in addresses.  If not set,
2818					they are treated as the introducer to
2819					the RFC 822 "group" syntax.  Colons are
2820					handled properly in route-addrs.  This
2821					option defaults on for V5 and lower
2822					configuration files.
2823confMAX_QUEUE_RUN_SIZE	MaxQueueRunSize	[0] If set, limit the maximum size of
2824					any given queue run to this number of
2825					entries.  Essentially, this will stop
2826					reading each queue directory after this
2827					number of entries are reached; it does
2828					_not_ pick the highest priority jobs,
2829					so this should be as large as your
2830					system can tolerate.  If not set, there
2831					is no limit.
2832confDONT_EXPAND_CNAMES	DontExpandCnames
2833					[False] If set, $[ ... $] lookups that
2834					do DNS based lookups do not expand
2835					CNAME records.  This currently violates
2836					the published standards, but the IETF
2837					seems to be moving toward legalizing
2838					this.  For example, if "FTP.Foo.ORG"
2839					is a CNAME for "Cruft.Foo.ORG", then
2840					with this option set a lookup of
2841					"FTP" will return "FTP.Foo.ORG"; if
2842					clear it returns "Cruft.FOO.ORG".  N.B.
2843					you may not see any effect until your
2844					downstream neighbors stop doing CNAME
2845					lookups as well.
2846confFROM_LINE		UnixFromLine	[From $g $d] The From_ line used
2847					when sending to files or programs.
2848confSINGLE_LINE_FROM_HEADER  SingleLineFromHeader
2849					[False] From: lines that have
2850					embedded newlines are unwrapped
2851					onto one line.
2852confALLOW_BOGUS_HELO	AllowBogusHELO	[False] Allow HELO SMTP command that
2853					does not include a host name.
2854confMUST_QUOTE_CHARS	MustQuoteChars	[.'] Characters to be quoted in a full
2855					name phrase (@,;:\()[] are automatic).
2856confOPERATORS		OperatorChars	[.:%@!^/[]+] Address operator
2857					characters.
2858confSMTP_LOGIN_MSG	SmtpGreetingMessage
2859					[$j Sendmail $v/$Z; $b]
2860					The initial (spontaneous) SMTP
2861					greeting message.  The word "ESMTP"
2862					will be inserted between the first and
2863					second words to convince other
2864					sendmails to try to speak ESMTP.
2865confDONT_INIT_GROUPS	DontInitGroups	[False] If set, the initgroups(3)
2866					routine will never be invoked.  You
2867					might want to do this if you are
2868					running NIS and you have a large group
2869					map, since this call does a sequential
2870					scan of the map; in a large site this
2871					can cause your ypserv to run
2872					essentially full time.  If you set
2873					this, agents run on behalf of users
2874					will only have their primary
2875					(/etc/passwd) group permissions.
2876confUNSAFE_GROUP_WRITES	UnsafeGroupWrites
2877					[False] If set, group-writable
2878					:include: and .forward files are
2879					considered "unsafe", that is, programs
2880					and files cannot be directly referenced
2881					from such files.  World-writable files
2882					are always considered unsafe.
2883confCONNECT_ONLY_TO	ConnectOnlyTo	[undefined] override connection
2884					address (for testing).
2885confCONTROL_SOCKET_NAME	ControlSocketName
2886					[undefined] Control socket for daemon
2887					management.
2888confDOUBLE_BOUNCE_ADDRESS  DoubleBounceAddress
2889					[postmaster] If an error occurs when
2890					sending an error message, send that
2891					"double bounce" error message to this
2892					address.
2893confDEAD_LETTER_DROP	DeadLetterDrop	[undefined] Filename to save bounce
2894					messages which could not be returned
2895					to the user or sent to postmaster.
2896					If not set, the queue file will
2897					be renamed.
2898confRRT_IMPLIES_DSN	RrtImpliesDsn	[False] Return-Receipt-To: header
2899					implies DSN request.
2900confRUN_AS_USER		RunAsUser	[undefined] If set, become this user
2901					when reading and delivering mail.
2902					Causes all file reads (e.g., .forward
2903					and :include: files) to be done as
2904					this user.  Also, all programs will
2905					be run as this user, and all output
2906					files will be written as this user.
2907					Intended for use only on firewalls
2908					where users do not have accounts.
2909confMAX_RCPTS_PER_MESSAGE  MaxRecipientsPerMessage
2910					[infinite] If set, allow no more than
2911					the specified number of recipients in
2912					an SMTP envelope.  Further recipients
2913					receive a 452 error code (i.e., they
2914					are deferred for the next delivery
2915					attempt).
2916confDONT_PROBE_INTERFACES  DontProbeInterfaces
2917					[False] If set, sendmail will _not_
2918					insert the names and addresses of any
2919					local interfaces into class {w}
2920					(list of known "equivalent" addresses).
2921					If you set this, you must also include
2922					some support for these addresses (e.g.,
2923					in a mailertable entry) -- otherwise,
2924					mail to addresses in this list will
2925					bounce with a configuration error.
2926confPID_FILE		PidFile		[system dependent] Location of pid
2927					file.
2928confPROCESS_TITLE_PREFIX  ProcessTitlePrefix
2929					[undefined] Prefix string for the
2930					process title shown on 'ps' listings.
2931confDONT_BLAME_SENDMAIL	DontBlameSendmail
2932					[safe] Override sendmail's file
2933					safety checks.  This will definitely
2934					compromise system security and should
2935					not be used unless absolutely
2936					necessary.
2937confREJECT_MSG		-		[550 Access denied] The message
2938					given if the access database contains
2939					REJECT in the value portion.
2940confDF_BUFFER_SIZE	DataFileBufferSize
2941					[4096] The maximum size of a
2942					memory-buffered data (df) file
2943					before a disk-based file is used.
2944confXF_BUFFER_SIZE	XScriptFileBufferSize
2945					[4096] The maximum size of a
2946					memory-buffered transcript (xf)
2947					file before a disk-based file is
2948					used.
2949confAUTH_MECHANISMS	AuthMechanisms	[GSSAPI KERBEROS_V4 DIGEST-MD5
2950					CRAM-MD5] List of authentication
2951					mechanisms for AUTH (separated by
2952					spaces).  The advertised list of
2953					authentication mechanisms will be the
2954					intersection of this list and the list
2955					of available mechanisms as determined
2956					by the CYRUS SASL library.
2957confDEF_AUTH_INFO	DefaultAuthInfo	[undefined] Filename that contains
2958					authentication information for
2959					outgoing connections.  This file
2960					must contain the user id, the
2961					authorization id, the password
2962					(plain text), and the realm to use,
2963					each on a separate line and must be
2964					readable by root (or the trusted
2965					user) only.  If no realm is
2966					specified, $j is used.
2967
2968					NOTE: Currently, AuthMechanisms is
2969					used to determine the list of
2970					mechanisms to use on an outgoing
2971					connection.  Sites which require a
2972					different list of mechanisms for
2973					incoming connections and outgoing
2974					connections will have the ability
2975					to do this in 8.11 by specifying a
2976					list of mechanisms as the fifth
2977					line of the DefaultAuthInfo file.
2978					If no mechanisms are given in the
2979					file, AuthMechanisms is used.  The
2980					code for doing so is included as
2981					in the sendmail source code but
2982					disabled.  It can be enabled by
2983					recompiling sendmail with:
2984					-D_FFR_DEFAUTHINFO_MECHS
2985confAUTH_OPTIONS	AuthOptions	[undefined] If this options is 'A'
2986					then the AUTH= parameter for the
2987					MAIL FROM command is only issued
2988					when authentication succeeded.
2989confLDAP_DEFAULT_SPEC	LDAPDefaultSpec	[undefined] Default map
2990					specification for LDAP maps.  The
2991					value should only contain LDAP
2992					specific settings such as "-h host
2993					-p port -d bindDN", etc.  The
2994					settings will be used for all LDAP
2995					maps unless they are specified in
2996					the individual map specification
2997					('K' command).
2998confCACERT_PATH		CACERTPath	[undefined] Path to directory
2999					with certs of CAs.
3000confCACERT		CACERTFile	[undefined] File containing one CA
3001					cert.
3002confSERVER_CERT		ServerCertFile	[undefined] File containing the
3003					cert of the server, i.e., this cert
3004					is used when sendmail acts as
3005					server.
3006confSERVER_KEY		ServerKeyFile	[undefined] File containing the
3007					private key belonging to the server
3008					cert.
3009confCLIENT_CERT		ClientCertFile	[undefined] File containing the
3010					cert of the client, i.e., this cert
3011					is used when sendmail acts as
3012					client.
3013confCLIENT_KEY		ClientKeyFile	[undefined] File containing the
3014					private key belonging to the client
3015					cert.
3016confDH_PARAMETERS	DHParameters	[undefined] File containing the
3017					DH parameters.
3018confRAND_FILE		RandFile	[undefined] File containing random
3019					data or the name of the Unix socket
3020					if EGD is used.  STARTTLS requires
3021					this option if the compile flag
3022					HASURANDOM is not set (see
3023					sendmail/README).
3024
3025See also the description of OSTYPE for some parameters that can be
3026tweaked (generally pathnames to mailers).
3027
3028DaemonPortOptions are a special case since multiple daemons can be
3029defined.  This can be done via
3030
3031	DAEMON_OPTIONS(`field1=value1,field2=value2,...')
3032
3033If DAEMON_OPTIONS is not used, then the default is
3034
3035	DAEMON_OPTIONS(`Port=smtp, Name=MTA')
3036	DAEMON_OPTIONS(`Port=587, Name=MSA, M=E')
3037
3038If you use one DAEMON_OPTIONS macro, it will alter the parameters
3039of the first of these.  The second will still be defaulted; it
3040represents a "Message Submission Agent" (MSA) as defined by RFC
30412476 (see below).  To turn off the default definition for the MSA,
3042use FEATURE(`no_default_msa') (see also FEATURES).  If you use
3043additional DAEMON_OPTIONS macros, they will add additional daemons.
3044
3045Example 1:  To change the port for the SMTP listener, while
3046still using the MSA default, use
3047	DAEMON_OPTIONS(`Port=925, Name=MTA')
3048
3049Example 2:  To change the port for the MSA daemon, while still
3050using the default SMTP port, use
3051	FEATURE(`no_default_msa')
3052	DAEMON_OPTIONS(`Name=MTA')
3053	DAEMON_OPTIONS(`Port=987, Name=MSA, M=E')
3054
3055Note that if the first of those DAEMON_OPTIONS lines were omitted, then
3056there would be no listener on the standard SMTP port.
3057
3058Example 3: To listen on both IPv4 and IPv6 interfaces, use
3059
3060	DAEMON_OPTIONS(`Name=MTA-v4, Family=inet')
3061	DAEMON_OPTIONS(`Name=MTA-v6, Family=inet6')
3062
3063A "Message Submission Agent" still uses all of the same rulesets for
3064processing the message (and therefore still allows message rejection via
3065the check_* rulesets).  In accordance with the RFC, the MSA will ensure
3066that all domains in the envelope are fully qualified if the message is
3067relayed to another MTA.  It will also enforce the normal address syntax
3068rules and log error messages.  Additionally, by using the M=a modifier
3069you can require authentication before messages are accepted by the MSA.
3070Finally, the M=E modifier shown above disables ETRN as required by RFC
30712476.
3072
3073
3074+-----------+
3075| HIERARCHY |
3076+-----------+
3077
3078Within this directory are several subdirectories, to wit:
3079
3080m4		General support routines.  These are typically
3081		very important and should not be changed without
3082		very careful consideration.
3083
3084cf		The configuration files themselves.  They have
3085		".mc" suffixes, and must be run through m4 to
3086		become complete.  The resulting output should
3087		have a ".cf" suffix.
3088
3089ostype		Definitions describing a particular operating
3090		system type.  These should always be referenced
3091		using the OSTYPE macro in the .mc file.  Examples
3092		include "bsd4.3", "bsd4.4", "sunos3.5", and
3093		"sunos4.1".
3094
3095domain		Definitions describing a particular domain, referenced
3096		using the DOMAIN macro in the .mc file.  These are
3097		site dependent; for example, "CS.Berkeley.EDU.m4"
3098		describes hosts in the CS.Berkeley.EDU subdomain.
3099
3100mailer		Descriptions of mailers.   These are referenced using
3101		the MAILER macro in the .mc file.
3102
3103sh		Shell files used when building the .cf file from the
3104		.mc file in the cf subdirectory.
3105
3106feature		These hold special orthogonal features that you might
3107		want to include.  They should be referenced using
3108		the FEATURE macro.
3109
3110hack		Local hacks.  These can be referenced using the HACK
3111		macro.  They shouldn't be of more than voyeuristic
3112		interest outside the .Berkeley.EDU domain, but who knows?
3113
3114siteconfig	Site configuration -- e.g., tables of locally connected
3115		UUCP sites.
3116
3117
3118+------------------------+
3119| ADMINISTRATIVE DETAILS |
3120+------------------------+
3121
3122The following sections detail usage of certain internal parts of the
3123sendmail.cf file.  Read them carefully if you are trying to modify
3124the current model.  If you find the above descriptions adequate, these
3125should be {boring, confusing, tedious, ridiculous} (pick one or more).
3126
3127RULESETS (* means built in to sendmail)
3128
3129   0 *	Parsing
3130   1 *	Sender rewriting
3131   2 *	Recipient rewriting
3132   3 *	Canonicalization
3133   4 *	Post cleanup
3134   5 *	Local address rewrite (after aliasing)
3135  1x	mailer rules (sender qualification)
3136  2x	mailer rules (recipient qualification)
3137  3x	mailer rules (sender header qualification)
3138  4x	mailer rules (recipient header qualification)
3139  5x	mailer subroutines (general)
3140  6x	mailer subroutines (general)
3141  7x	mailer subroutines (general)
3142  8x	reserved
3143  90	Mailertable host stripping
3144  96	Bottom half of Ruleset 3 (ruleset 6 in old sendmail)
3145  97	Hook for recursive ruleset 0 call (ruleset 7 in old sendmail)
3146  98	Local part of ruleset 0 (ruleset 8 in old sendmail)
3147  99	Guaranteed null (for debugging)
3148
3149
3150MAILERS
3151
3152   0	local, prog	local and program mailers
3153   1	[e]smtp, relay	SMTP channel
3154   2	uucp-*		UNIX-to-UNIX Copy Program
3155   3	netnews		Network News delivery
3156   4	fax		Sam Leffler's HylaFAX software
3157   5	mail11		DECnet mailer
3158
3159
3160MACROS
3161
3162   A
3163   B	Bitnet Relay
3164   C	DECnet Relay
3165   D	The local domain -- usually not needed
3166   E	reserved for X.400 Relay
3167   F	FAX Relay
3168   G
3169   H	mail Hub (for mail clusters)
3170   I
3171   J
3172   K
3173   L	Luser Relay
3174   M	Masquerade (who you claim to be)
3175   N
3176   O
3177   P
3178   Q
3179   R	Relay (for unqualified names)
3180   S	Smart Host
3181   T
3182   U	my UUCP name (if you have a UUCP connection)
3183   V	UUCP Relay (class {V} hosts)
3184   W	UUCP Relay (class {W} hosts)
3185   X	UUCP Relay (class {X} hosts)
3186   Y	UUCP Relay (all other hosts)
3187   Z	Version number
3188
3189
3190CLASSES
3191
3192   A
3193   B	domains that are candidates for bestmx lookup
3194   C
3195   D
3196   E	addresses that should not seem to come from $M
3197   F	hosts this system forward for
3198   G	domains that should be looked up in genericstable
3199   H
3200   I
3201   J
3202   K
3203   L	addresses that should not be forwarded to $R
3204   M	domains that should be mapped to $M
3205   N	host/domains that should not be mapped to $M
3206   O	operators that indicate network operations (cannot be in local names)
3207   P	top level pseudo-domains: BITNET, DECNET, FAX, UUCP, etc.
3208   Q
3209   R	domains this system is willing to relay (pass anti-spam filters)
3210   S
3211   T
3212   U	locally connected UUCP hosts
3213   V	UUCP hosts connected to relay $V
3214   W	UUCP hosts connected to relay $W
3215   X	UUCP hosts connected to relay $X
3216   Y	locally connected smart UUCP hosts
3217   Z	locally connected domain-ized UUCP hosts
3218   .	the class containing only a dot
3219   [	the class containing only a left bracket
3220
3221
3222M4 DIVERSIONS
3223
3224   1	Local host detection and resolution
3225   2	Local Ruleset 3 additions
3226   3	Local Ruleset 0 additions
3227   4	UUCP Ruleset 0 additions
3228   5	locally interpreted names (overrides $R)
3229   6	local configuration (at top of file)
3230   7	mailer definitions
3231   8	DNS based blacklists
3232   9	special local rulesets (1 and 2)
3233
3234$Revision: 8.383.2.1.2.15 $, Last updated $Date: 2000/07/19 22:27:29 $
3235