xref: /titanic_52/usr/src/cmd/sendmail/cf/README (revision e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027f)
1
2		SENDMAIL CONFIGURATION FILES
3
4This document describes the sendmail configuration files.  It
5explains how to create a sendmail.cf file for use with sendmail.
6It also describes how to set options for sendmail which are explained
7in the Sendmail Installation and Operation guide, which can be found
8on-line at http://www.sendmail.org/%7Eca/email/doc8.12/op.html .
9Recall this URL throughout this document when references to
10doc/op/op.* are made.
11
12Table of Content:
13
14INTRODUCTION AND EXAMPLE
15A BRIEF INTRODUCTION TO M4
16FILE LOCATIONS
17OSTYPE
18DOMAINS
19MAILERS
20FEATURES
21HACKS
22SITE CONFIGURATION
23USING UUCP MAILERS
24TWEAKING RULESETS
25MASQUERADING AND RELAYING
26USING LDAP FOR ALIASES, MAPS, AND CLASSES
27LDAP ROUTING
28ANTI-SPAM CONFIGURATION CONTROL
29CONNECTION CONTROL
30STARTTLS
31ADDING NEW MAILERS OR RULESETS
32ADDING NEW MAIL FILTERS
33QUEUE GROUP DEFINITIONS
34NON-SMTP BASED CONFIGURATIONS
35WHO AM I?
36ACCEPTING MAIL FOR MULTIPLE NAMES
37USING MAILERTABLES
38USING USERDB TO MAP FULL NAMES
39MISCELLANEOUS SPECIAL FEATURES
40SECURITY NOTES
41TWEAKING CONFIGURATION OPTIONS
42MESSAGE SUBMISSION PROGRAM
43FORMAT OF FILES AND MAPS
44DIRECTORY LAYOUT
45ADMINISTRATIVE DETAILS
46
47
48+--------------------------+
49| INTRODUCTION AND EXAMPLE |
50+--------------------------+
51
52Configuration files are contained in the subdirectory "cf", with a
53suffix ".mc".  They must be run through "m4" to produce a ".cf" file.
54You must pre-load "cf.m4":
55
56	m4 ${CFDIR}/m4/cf.m4 config.mc > config.cf
57
58Alternatively, you can simply:
59
60	cd ${CFDIR}/cf
61	/usr/ccs/bin/make config.cf
62
63where ${CFDIR} is the root of the cf directory and config.mc is the
64name of your configuration file.  If you are running a version of M4
65that understands the __file__ builtin (versions of GNU m4 >= 0.75 do
66this, but the versions distributed with 4.4BSD and derivatives do not)
67or the -I flag (ditto), then ${CFDIR} can be in an arbitrary directory.
68For "traditional" versions, ${CFDIR} ***MUST*** be "..", or you MUST
69use -D_CF_DIR_=/path/to/cf/dir/ -- note the trailing slash!  For example:
70
71	m4 -D_CF_DIR_=${CFDIR}/ ${CFDIR}/m4/cf.m4 config.mc > config.cf
72
73Let's examine a typical .mc file:
74
75	divert(-1)
76	#
77	# Copyright (c) 1998-2005 Sendmail, Inc. and its suppliers.
78	#	All rights reserved.
79	# Copyright (c) 1983 Eric P. Allman.  All rights reserved.
80	# Copyright (c) 1988, 1993
81	#	The Regents of the University of California.  All rights reserved.
82	#
83	# By using this file, you agree to the terms and conditions set
84	# forth in the LICENSE file which can be found at the top level of
85	# the sendmail distribution.
86	#
87
88	#
89	#  This is a Berkeley-specific configuration file for HP-UX 9.x.
90	#  It applies only to the Computer Science Division at Berkeley,
91	#  and should not be used elsewhere.   It is provided on the sendmail
92	#  distribution as a sample only.  To create your own configuration
93	#  file, create an appropriate domain file in ../domain, change the
94	#  `DOMAIN' macro below to reference that file, and copy the result
95	#  to a name of your own choosing.
96	#
97	divert(0)
98
99The divert(-1) will delete the crud in the resulting output file.
100The copyright notice can be replaced by whatever your lawyers require;
101our lawyers require the one that is included in these files.  A copyleft
102is a copyright by another name.  The divert(0) restores regular output.
103
104	VERSIONID(`<SCCS or RCS version id>')
105
106VERSIONID is a macro that stuffs the version information into the
107resulting file.  You could use SCCS, RCS, CVS, something else, or
108omit it completely.  This is not the same as the version id included
109in SMTP greeting messages -- this is defined in m4/version.m4.
110
111	OSTYPE(`hpux9')dnl
112
113You must specify an OSTYPE to properly configure things such as the
114pathname of the help and status files, the flags needed for the local
115mailer, and other important things.  If you omit it, you will get an
116error when you try to build the configuration.  Look at the ostype
117directory for the list of known operating system types.
118
119	DOMAIN(`CS.Berkeley.EDU')dnl
120
121This example is specific to the Computer Science Division at Berkeley.
122You can use "DOMAIN(`generic')" to get a sufficiently bland definition
123that may well work for you, or you can create a customized domain
124definition appropriate for your environment.
125
126	MAILER(`local')
127	MAILER(`smtp')
128
129These describe the mailers used at the default CS site.  The local
130mailer is always included automatically.  Beware: MAILER declarations
131should only be followed by LOCAL_* sections.  The general rules are
132that the order should be:
133
134	VERSIONID
135	OSTYPE
136	DOMAIN
137	FEATURE
138	local macro definitions
139	MAILER
140	LOCAL_CONFIG
141	LOCAL_RULE_*
142	LOCAL_RULESETS
143
144There are a few exceptions to this rule.  Local macro definitions which
145influence a FEATURE() should be done before that feature.  For example,
146a define(`PROCMAIL_MAILER_PATH', ...) should be done before
147FEATURE(`local_procmail').
148
149
150+----------------------------+
151| A BRIEF INTRODUCTION TO M4 |
152+----------------------------+
153
154Sendmail uses the M4 macro processor to ``compile'' the configuration
155files.  The most important thing to know is that M4 is stream-based,
156that is, it doesn't understand about lines.  For this reason, in some
157places you may see the word ``dnl'', which stands for ``delete
158through newline''; essentially, it deletes all characters starting
159at the ``dnl'' up to and including the next newline character.  In
160most cases sendmail uses this only to avoid lots of unnecessary
161blank lines in the output.
162
163Other important directives are define(A, B) which defines the macro
164``A'' to have value ``B''.  Macros are expanded as they are read, so
165one normally quotes both values to prevent expansion.  For example,
166
167	define(`SMART_HOST', `smart.foo.com')
168
169One word of warning:  M4 macros are expanded even in lines that appear
170to be comments.  For example, if you have
171
172	# See FEATURE(`foo') above
173
174it will not do what you expect, because the FEATURE(`foo') will be
175expanded.  This also applies to
176
177	# And then define the $X macro to be the return address
178
179because ``define'' is an M4 keyword.  If you want to use them, surround
180them with directed quotes, `like this'.
181
182Since m4 uses single quotes (opening "`" and closing "'") to quote
183arguments, those quotes can't be used in arguments.  For example,
184it is not possible to define a rejection message containing a single
185quote. Usually there are simple workarounds by changing those
186messages; in the worst case it might be ok to change the value
187directly in the generated .cf file, which however is not advised.
188
189+----------------+
190| FILE LOCATIONS |
191+----------------+
192
193sendmail 8.9 has introduced a new configuration directory for sendmail
194related files, /etc/mail.  The new files available for sendmail 8.9 --
195the class {R} /etc/mail/relay-domains and the access database
196/etc/mail/access -- take advantage of this new directory.  Beginning with
1978.10, all files will use this directory by default (some options may be
198set by OSTYPE() files).  This new directory should help to restore
199uniformity to sendmail's file locations.
200
201Below is a table of some of the common changes:
202
203Old filename			New filename
204------------			------------
205/etc/bitdomain			/etc/mail/bitdomain
206/etc/domaintable		/etc/mail/domaintable
207/etc/genericstable		/etc/mail/genericstable
208/etc/uudomain			/etc/mail/uudomain
209/etc/virtusertable		/etc/mail/virtusertable
210/etc/userdb			/etc/mail/userdb
211
212/etc/aliases			/etc/mail/aliases
213/etc/sendmail/aliases		/etc/mail/aliases
214/etc/ucbmail/aliases		/etc/mail/aliases
215/usr/adm/sendmail/aliases	/etc/mail/aliases
216/usr/lib/aliases		/etc/mail/aliases
217/usr/lib/mail/aliases		/etc/mail/aliases
218/usr/ucblib/aliases		/etc/mail/aliases
219
220/etc/sendmail.cw		/etc/mail/local-host-names
221/etc/mail/sendmail.cw		/etc/mail/local-host-names
222/etc/sendmail/sendmail.cw	/etc/mail/local-host-names
223
224/etc/sendmail.ct		/etc/mail/trusted-users
225
226/etc/sendmail.oE		/etc/mail/error-header
227
228/etc/sendmail.hf		/etc/mail/helpfile
229/etc/mail/sendmail.hf		/etc/mail/helpfile
230/usr/ucblib/sendmail.hf		/etc/mail/helpfile
231/etc/ucbmail/sendmail.hf	/etc/mail/helpfile
232/usr/lib/sendmail.hf		/etc/mail/helpfile
233/usr/share/lib/sendmail.hf	/etc/mail/helpfile
234/usr/share/misc/sendmail.hf	/etc/mail/helpfile
235/share/misc/sendmail.hf		/etc/mail/helpfile
236
237/etc/service.switch		/etc/mail/service.switch
238
239/etc/sendmail.st		/etc/mail/statistics
240/etc/mail/sendmail.st		/etc/mail/statistics
241/etc/mailer/sendmail.st		/etc/mail/statistics
242/etc/sendmail/sendmail.st	/etc/mail/statistics
243/usr/lib/sendmail.st		/etc/mail/statistics
244/usr/ucblib/sendmail.st		/etc/mail/statistics
245
246Note that all of these paths actually use a new m4 macro MAIL_SETTINGS_DIR
247to create the pathnames.  The default value of this variable is
248`/etc/mail/'.  If you set this macro to a different value, you MUST include
249a trailing slash.
250
251Notice: all filenames used in a .mc (or .cf) file should be absolute
252(starting at the root, i.e., with '/').  Relative filenames most
253likely cause surprises during operations (unless otherwise noted).
254
255
256+--------+
257| OSTYPE |
258+--------+
259
260You MUST define an operating system environment, or the configuration
261file build will puke.  There are several environments available; look
262at the "ostype" directory for the current list.  This macro changes
263things like the location of the alias file and queue directory.  Some
264of these files are identical to one another.
265
266It is IMPERATIVE that the OSTYPE occur before any MAILER definitions.
267In general, the OSTYPE macro should go immediately after any version
268information, and MAILER definitions should always go last.
269
270Operating system definitions are usually easy to write.  They may define
271the following variables (everything defaults, so an ostype file may be
272empty).  Unfortunately, the list of configuration-supported systems is
273not as broad as the list of source-supported systems, since many of
274the source contributors do not include corresponding ostype files.
275
276ALIAS_FILE		[/etc/mail/aliases] The location of the text version
277			of the alias file(s).  It can be a comma-separated
278			list of names (but be sure you quote values with
279			commas in them -- for example, use
280				define(`ALIAS_FILE', `a,b')
281			to get "a" and "b" both listed as alias files;
282			otherwise the define() primitive only sees "a").
283HELP_FILE		[/etc/mail/helpfile] The name of the file
284			containing information printed in response to
285			the SMTP HELP command.
286QUEUE_DIR		[/var/spool/mqueue] The directory containing
287			queue files.  To use multiple queues, supply
288			a value ending with an asterisk.  For
289			example, /var/spool/mqueue/qd* will use all of the
290			directories or symbolic links to directories
291			beginning with 'qd' in /var/spool/mqueue as queue
292			directories.  The names 'qf', 'df', and 'xf' are
293			reserved as specific subdirectories for the
294			corresponding queue file types as explained in
295			doc/op/op.me.  See also QUEUE GROUP DEFINITIONS.
296MSP_QUEUE_DIR		[/var/spool/clientmqueue] The directory containing
297			queue files for the MSP (Mail Submission Program).
298STATUS_FILE		[/etc/mail/statistics] The file containing status
299			information.
300LOCAL_MAILER_PATH	[/bin/mail] The program used to deliver local mail.
301LOCAL_MAILER_FLAGS	[Prmn9] The flags used by the local mailer.  The
302			flags lsDFMAw5:/|@q are always included.
303LOCAL_MAILER_ARGS	[mail -d $u] The arguments passed to deliver local
304			mail.
305LOCAL_MAILER_MAX	[undefined] If defined, the maximum size of local
306			mail that you are willing to accept.
307LOCAL_MAILER_MAXMSGS	[undefined] If defined, the maximum number of
308			messages to deliver in a single connection.  Only
309			useful for LMTP local mailers.
310LOCAL_MAILER_CHARSET	[undefined] If defined, messages containing 8-bit data
311			that ARRIVE from an address that resolves to the
312			local mailer and which are converted to MIME will be
313			labeled with this character set.
314LOCAL_MAILER_EOL	[undefined] If defined, the string to use as the
315			end of line for the local mailer.
316LOCAL_MAILER_DSN_DIAGNOSTIC_CODE
317			[X-Unix] The DSN Diagnostic-Code value for the
318			local mailer.  This should be changed with care.
319LOCAL_SHELL_PATH	[/bin/sh] The shell used to deliver piped email.
320LOCAL_SHELL_FLAGS	[eu9] The flags used by the shell mailer.  The
321			flags lsDFM are always included.
322LOCAL_SHELL_ARGS	[sh -c $u] The arguments passed to deliver "prog"
323			mail.
324LOCAL_SHELL_DIR		[$z:/] The directory search path in which the
325			shell should run.
326LOCAL_MAILER_QGRP	[undefined] The queue group for the local mailer.
327SMTP_MAILER_FLAGS	[undefined] Flags added to SMTP mailer.  Default
328			flags are `mDFMuX' for all SMTP-based mailers; the
329			"esmtp" mailer adds `a'; "smtp8" adds `8'; and
330			"dsmtp" adds `%'.
331RELAY_MAILER_FLAGS	[undefined] Flags added to the relay mailer.  Default
332			flags are `mDFMuX' for all SMTP-based mailers; the
333			relay mailer adds `a8'.  If this is not defined,
334			then SMTP_MAILER_FLAGS is used.
335SMTP_MAILER_MAX		[undefined] The maximum size of messages that will
336			be transported using the smtp, smtp8, esmtp, or dsmtp
337			mailers.
338SMTP_MAILER_MAXMSGS	[undefined] If defined, the maximum number of
339			messages to deliver in a single connection for the
340			smtp, smtp8, esmtp, or dsmtp mailers.
341SMTP_MAILER_MAXRCPTS	[undefined] If defined, the maximum number of
342			recipients to deliver in a single connection for the
343			smtp, smtp8, esmtp, or dsmtp mailers.
344SMTP_MAILER_ARGS	[TCP $h] The arguments passed to the smtp mailer.
345			About the only reason you would want to change this
346			would be to change the default port.
347ESMTP_MAILER_ARGS	[TCP $h] The arguments passed to the esmtp mailer.
348SMTP8_MAILER_ARGS	[TCP $h] The arguments passed to the smtp8 mailer.
349DSMTP_MAILER_ARGS	[TCP $h] The arguments passed to the dsmtp mailer.
350RELAY_MAILER_ARGS	[TCP $h] The arguments passed to the relay mailer.
351SMTP_MAILER_QGRP	[undefined] The queue group for the smtp mailer.
352ESMTP_MAILER_QGRP	[undefined] The queue group for the esmtp mailer.
353SMTP8_MAILER_QGRP	[undefined] The queue group for the smtp8 mailer.
354DSMTP_MAILER_QGRP	[undefined] The queue group for the dsmtp mailer.
355RELAY_MAILER_QGRP	[undefined] The queue group for the relay mailer.
356RELAY_MAILER_MAXMSGS	[undefined] If defined, the maximum number of
357			messages to deliver in a single connection for the
358			relay mailer.
359SMTP_MAILER_CHARSET	[undefined] If defined, messages containing 8-bit data
360			that ARRIVE from an address that resolves to one of
361			the SMTP mailers and which are converted to MIME will
362			be labeled with this character set.
363SMTP_MAILER_LL		[990] The maximum line length for SMTP mailers
364			(except the relay mailer).
365RELAY_MAILER_LL		[2040] The maximum line length for the relay mailer.
366UUCP_MAILER_PATH	[/usr/bin/uux] The program used to send UUCP mail.
367UUCP_MAILER_FLAGS	[undefined] Flags added to UUCP mailer.  Default
368			flags are `DFMhuU' (and `m' for uucp-new mailer,
369			minus `U' for uucp-dom mailer).
370UUCP_MAILER_ARGS	[uux - -r -z -a$g -gC $h!rmail ($u)] The arguments
371			passed to the UUCP mailer.
372UUCP_MAILER_MAX		[100000] The maximum size message accepted for
373			transmission by the UUCP mailers.
374UUCP_MAILER_CHARSET	[undefined] If defined, messages containing 8-bit data
375			that ARRIVE from an address that resolves to one of
376			the UUCP mailers and which are converted to MIME will
377			be labeled with this character set.
378UUCP_MAILER_QGRP	[undefined] The queue group for the UUCP mailers.
379PROCMAIL_MAILER_PATH	[/usr/local/bin/procmail] The path to the procmail
380			program.  This is also used by
381			FEATURE(`local_procmail').
382PROCMAIL_MAILER_FLAGS	[SPhnu9] Flags added to Procmail mailer.  Flags
383			DFM are always set.  This is NOT used by
384			FEATURE(`local_procmail'); tweak LOCAL_MAILER_FLAGS
385			instead.
386PROCMAIL_MAILER_ARGS	[procmail -Y -m $h $f $u] The arguments passed to
387			the Procmail mailer.  This is NOT used by
388			FEATURE(`local_procmail'); tweak LOCAL_MAILER_ARGS
389			instead.
390PROCMAIL_MAILER_MAX	[undefined] If set, the maximum size message that
391			will be accepted by the procmail mailer.
392PROCMAIL_MAILER_QGRP	[undefined] The queue group for the procmail mailer.
393confEBINDIR		[/usr/libexec] The directory for executables.
394			Currently used for FEATURE(`local_lmtp') and
395			FEATURE(`smrsh').
396LOCAL_PROG_QGRP		[undefined] The queue group for the prog mailer.
397
398Note: to tweak Name_MAILER_FLAGS use the macro MODIFY_MAILER_FLAGS:
399MODIFY_MAILER_FLAGS(`Name', `change') where Name is the first part
400of the macro Name_MAILER_FLAGS (note: that means Name is entirely in
401upper case) and change can be: flags that should be used directly
402(thus overriding the default value), or if it starts with `+' (`-')
403then those flags are added to (removed from) the default value.
404Example:
405
406	MODIFY_MAILER_FLAGS(`LOCAL', `+e')
407
408will add the flag `e' to LOCAL_MAILER_FLAGS.  Notice: there are
409several smtp mailers all of which are manipulated individually.
410See the section MAILERS for the available mailer names.
411WARNING: The FEATUREs local_lmtp and local_procmail set LOCAL_MAILER_FLAGS
412unconditionally, i.e., without respecting any definitions in an
413OSTYPE setting.
414
415
416+---------+
417| DOMAINS |
418+---------+
419
420You will probably want to collect domain-dependent defines into one
421file, referenced by the DOMAIN macro.  For example, the Berkeley
422domain file includes definitions for several internal distinguished
423hosts:
424
425UUCP_RELAY	The host that will accept UUCP-addressed email.
426		If not defined, all UUCP sites must be directly
427		connected.
428BITNET_RELAY	The host that will accept BITNET-addressed email.
429		If not defined, the .BITNET pseudo-domain won't work.
430DECNET_RELAY	The host that will accept DECNET-addressed email.
431		If not defined, the .DECNET pseudo-domain and addresses
432		of the form node::user will not work.
433FAX_RELAY	The host that will accept mail to the .FAX pseudo-domain.
434		The "fax" mailer overrides this value.
435LOCAL_RELAY	The site that will handle unqualified names -- that
436		is, names without an @domain extension.
437		Normally MAIL_HUB is preferred for this function.
438		LOCAL_RELAY is mostly useful in conjunction with
439		FEATURE(`stickyhost') -- see the discussion of
440		stickyhost below.  If not set, they are assumed to
441		belong on this machine.  This allows you to have a
442		central site to store a company- or department-wide
443		alias database.  This only works at small sites,
444		and only with some user agents.
445LUSER_RELAY	The site that will handle lusers -- that is, apparently
446		local names that aren't local accounts or aliases.  To
447		specify a local user instead of a site, set this to
448		``local:username''.
449
450Any of these can be either ``mailer:hostname'' (in which case the
451mailer is the internal mailer name, such as ``uucp-new'' and the hostname
452is the name of the host as appropriate for that mailer) or just a
453``hostname'', in which case a default mailer type (usually ``relay'',
454a variant on SMTP) is used.  WARNING: if you have a wildcard MX
455record matching your domain, you probably want to define these to
456have a trailing dot so that you won't get the mail diverted back
457to yourself.
458
459The domain file can also be used to define a domain name, if needed
460(using "DD<domain>") and set certain site-wide features.  If all hosts
461at your site masquerade behind one email name, you could also use
462MASQUERADE_AS here.
463
464You do not have to define a domain -- in particular, if you are a
465single machine sitting off somewhere, it is probably more work than
466it's worth.  This is just a mechanism for combining "domain dependent
467knowledge" into one place.
468
469
470+---------+
471| MAILERS |
472+---------+
473
474There are fewer mailers supported in this version than the previous
475version, owing mostly to a simpler world.  As a general rule, put the
476MAILER definitions last in your .mc file.
477
478local		The local and prog mailers.  You will almost always
479		need these; the only exception is if you relay ALL
480		your mail to another site.  This mailer is included
481		automatically.
482
483smtp		The Simple Mail Transport Protocol mailer.  This does
484		not hide hosts behind a gateway or another other
485		such hack; it assumes a world where everyone is
486		running the name server.  This file actually defines
487		five mailers: "smtp" for regular (old-style) SMTP to
488		other servers, "esmtp" for extended SMTP to other
489		servers, "smtp8" to do SMTP to other servers without
490		converting 8-bit data to MIME (essentially, this is
491		your statement that you know the other end is 8-bit
492		clean even if it doesn't say so), "dsmtp" to do on
493		demand delivery, and "relay" for transmission to the
494		RELAY_HOST, LUSER_RELAY, or MAIL_HUB.
495
496uucp		The UNIX-to-UNIX Copy Program mailer.  Actually, this
497		defines two mailers, "uucp-old" (a.k.a. "uucp") and
498		"uucp-new" (a.k.a. "suucp").  The latter is for when you
499		know that the UUCP mailer at the other end can handle
500		multiple recipients in one transfer.  If the smtp mailer
501		is included in your configuration, two other mailers
502		("uucp-dom" and "uucp-uudom") are also defined [warning: you
503		MUST specify MAILER(`smtp') before MAILER(`uucp')].  When you
504		include the uucp mailer, sendmail looks for all names in
505		class {U} and sends them to the uucp-old mailer; all
506		names in class {Y} are sent to uucp-new; and all
507		names in class {Z} are sent to uucp-uudom.  Note that
508		this is a function of what version of rmail runs on
509		the receiving end, and hence may be out of your control.
510		See the section below describing UUCP mailers in more
511		detail.
512
513procmail	An interface to procmail (does not come with sendmail).
514		This is designed to be used in mailertables.  For example,
515		a common question is "how do I forward all mail for a given
516		domain to a single person?".  If you have this mailer
517		defined, you could set up a mailertable reading:
518
519			host.com	procmail:/etc/procmailrcs/host.com
520
521		with the file /etc/procmailrcs/host.com reading:
522
523			:0	# forward mail for host.com
524			! -oi -f $1 person@other.host
525
526		This would arrange for (anything)@host.com to be sent
527		to person@other.host.  In a procmail script, $1 is the
528		name of the sender and $2 is the name of the recipient.
529		If you use this with FEATURE(`local_procmail'), the FEATURE
530		should be listed first.
531
532		Of course there are other ways to solve this particular
533		problem, e.g., a catch-all entry in a virtusertable.
534
535The local mailer accepts addresses of the form "user+detail", where
536the "+detail" is not used for mailbox matching but is available
537to certain local mail programs (in particular, see
538FEATURE(`local_procmail')).  For example, "eric", "eric+sendmail", and
539"eric+sww" all indicate the same user, but additional arguments <null>,
540"sendmail", and "sww" may be provided for use in sorting mail.
541
542
543+----------+
544| FEATURES |
545+----------+
546
547Special features can be requested using the "FEATURE" macro.  For
548example, the .mc line:
549
550	FEATURE(`use_cw_file')
551
552tells sendmail that you want to have it read an /etc/mail/local-host-names
553file to get values for class {w}.  A FEATURE may contain up to 9
554optional parameters -- for example:
555
556	FEATURE(`mailertable', `dbm /usr/lib/mailertable')
557
558The default database map type for the table features can be set with
559
560	define(`DATABASE_MAP_TYPE', `dbm')
561
562which would set it to use ndbm databases.  The default is the Berkeley DB
563hash database format.  Note that you must still declare a database map type
564if you specify an argument to a FEATURE.  DATABASE_MAP_TYPE is only used
565if no argument is given for the FEATURE.  It must be specified before any
566feature that uses a map.
567
568Also, features which can take a map definition as an argument can also take
569the special keyword `LDAP'.  If that keyword is used, the map will use the
570LDAP definition described in the ``USING LDAP FOR ALIASES, MAPS, AND
571CLASSES'' section below.
572
573Available features are:
574
575use_cw_file	Read the file /etc/mail/local-host-names file to get
576		alternate names for this host.  This might be used if you
577		were on a host that MXed for a dynamic set of other hosts.
578		If the set is static, just including the line "Cw<name1>
579		<name2> ..." (where the names are fully qualified domain
580		names) is probably superior.  The actual filename can be
581		overridden by redefining confCW_FILE.
582
583use_ct_file	Read the file /etc/mail/trusted-users file to get the
584		names of users that will be ``trusted'', that is, able to
585		set their envelope from address using -f without generating
586		a warning message.  The actual filename can be overridden
587		by redefining confCT_FILE.
588
589redirect	Reject all mail addressed to "address.REDIRECT" with
590		a ``551 User has moved; please try <address>'' message.
591		If this is set, you can alias people who have left
592		to their new address with ".REDIRECT" appended.
593
594nouucp		Don't route UUCP addresses.  This feature takes one
595		parameter:
596		`reject': reject addresses which have "!" in the local
597			part unless it originates from a system
598			that is allowed to relay.
599		`nospecial': don't do anything special with "!".
600		Warnings: 1. See the notice in the anti-spam section.
601		2. don't remove "!" from OperatorChars if `reject' is
602		given as parameter.
603
604nocanonify	Don't pass addresses to $[ ... $] for canonification
605		by default, i.e., host/domain names are considered canonical,
606		except for unqualified names, which must not be used in this
607		mode (violation of the standard).  It can be changed by
608		setting the DaemonPortOptions modifiers (M=).  That is,
609		FEATURE(`nocanonify') will be overridden by setting the
610		'c' flag.  Conversely, if FEATURE(`nocanonify') is not used,
611		it can be emulated by setting the 'C' flag
612		(DaemonPortOptions=Modifiers=C).  This would generally only
613		be used by sites that only act as mail gateways or which have
614		user agents that do full canonification themselves.  You may
615		also want to use
616		"define(`confBIND_OPTS', `-DNSRCH -DEFNAMES')" to turn off
617		the usual resolver options that do a similar thing.
618
619		An exception list for FEATURE(`nocanonify') can be
620		specified with CANONIFY_DOMAIN or CANONIFY_DOMAIN_FILE,
621		i.e., a list of domains which are nevertheless passed to
622		$[ ... $] for canonification.  This is useful to turn on
623		canonification for local domains, e.g., use
624		CANONIFY_DOMAIN(`my.domain my') to canonify addresses
625		which end in "my.domain" or "my".
626		Another way to require canonification in the local
627		domain is CANONIFY_DOMAIN(`$=m').
628
629		A trailing dot is added to addresses with more than
630		one component in it such that other features which
631		expect a trailing dot (e.g., virtusertable) will
632		still work.
633
634		If `canonify_hosts' is specified as parameter, i.e.,
635		FEATURE(`nocanonify', `canonify_hosts'), then
636		addresses which have only a hostname, e.g.,
637		<user@host>, will be canonified (and hopefully fully
638		qualified), too.
639
640stickyhost	This feature is sometimes used with LOCAL_RELAY,
641		although it can be used for a different effect with
642		MAIL_HUB.
643
644		When used without MAIL_HUB, email sent to
645		"user@local.host" are marked as "sticky" -- that
646		is, the local addresses aren't matched against UDB,
647		don't go through ruleset 5, and are not forwarded to
648		the LOCAL_RELAY (if defined).
649
650		With MAIL_HUB, mail addressed to "user@local.host"
651		is forwarded to the mail hub, with the envelope
652		address still remaining "user@local.host".
653		Without stickyhost, the envelope would be changed
654		to "user@mail_hub", in order to protect against
655		mailing loops.
656
657mailertable	Include a "mailer table" which can be used to override
658		routing for particular domains (which are not in class {w},
659		i.e.  local host names).  The argument of the FEATURE may be
660		the key definition.  If none is specified, the definition
661		used is:
662
663			hash /etc/mail/mailertable
664
665		Keys in this database are fully qualified domain names
666		or partial domains preceded by a dot -- for example,
667		"vangogh.CS.Berkeley.EDU" or ".CS.Berkeley.EDU".  As a
668		special case of the latter, "." matches any domain not
669		covered by other keys.  Values must be of the form:
670			mailer:domain
671		where "mailer" is the internal mailer name, and "domain"
672		is where to send the message.  These maps are not
673		reflected into the message header.  As a special case,
674		the forms:
675			local:user
676		will forward to the indicated user using the local mailer,
677			local:
678		will forward to the original user in the e-mail address
679		using the local mailer, and
680			error:code message
681			error:D.S.N:code message
682		will give an error message with the indicated SMTP reply
683		code and message, where D.S.N is an RFC 1893 compliant
684		error code.
685
686domaintable	Include a "domain table" which can be used to provide
687		domain name mapping.  Use of this should really be
688		limited to your own domains.  It may be useful if you
689		change names (e.g., your company changes names from
690		oldname.com to newname.com).  The argument of the
691		FEATURE may be the key definition.  If none is specified,
692		the definition used is:
693
694			hash /etc/mail/domaintable
695
696		The key in this table is the domain name; the value is
697		the new (fully qualified) domain.  Anything in the
698		domaintable is reflected into headers; that is, this
699		is done in ruleset 3.
700
701bitdomain	Look up bitnet hosts in a table to try to turn them into
702		internet addresses.  The table can be built using the
703		bitdomain program contributed by John Gardiner Myers.
704		The argument of the FEATURE may be the key definition; if
705		none is specified, the definition used is:
706
707			hash /etc/mail/bitdomain
708
709		Keys are the bitnet hostname; values are the corresponding
710		internet hostname.
711
712uucpdomain	Similar feature for UUCP hosts.  The default map definition
713		is:
714
715			hash /etc/mail/uudomain
716
717		At the moment there is no automagic tool to build this
718		database.
719
720always_add_domain
721		Include the local host domain even on locally delivered
722		mail.  Normally it is not added on unqualified names.
723		However, if you use a shared message store but do not use
724		the same user name space everywhere, you may need the host
725		name on local names.  An optional argument specifies
726		another domain to be added than the local.
727
728allmasquerade	If masquerading is enabled (using MASQUERADE_AS), this
729		feature will cause recipient addresses to also masquerade
730		as being from the masquerade host.  Normally they get
731		the local hostname.  Although this may be right for
732		ordinary users, it can break local aliases.  For example,
733		if you send to "localalias", the originating sendmail will
734		find that alias and send to all members, but send the
735		message with "To: localalias@masqueradehost".  Since that
736		alias likely does not exist, replies will fail.  Use this
737		feature ONLY if you can guarantee that the ENTIRE
738		namespace on your masquerade host supersets all the
739		local entries.
740
741limited_masquerade
742		Normally, any hosts listed in class {w} are masqueraded.  If
743		this feature is given, only the hosts listed in class {M} (see
744		below:  MASQUERADE_DOMAIN) are masqueraded.  This is useful
745		if you have several domains with disjoint namespaces hosted
746		on the same machine.
747
748masquerade_entire_domain
749		If masquerading is enabled (using MASQUERADE_AS) and
750		MASQUERADE_DOMAIN (see below) is set, this feature will
751		cause addresses to be rewritten such that the masquerading
752		domains are actually entire domains to be hidden.  All
753		hosts within the masquerading domains will be rewritten
754		to the masquerade name (used in MASQUERADE_AS).  For example,
755		if you have:
756
757			MASQUERADE_AS(`masq.com')
758			MASQUERADE_DOMAIN(`foo.org')
759			MASQUERADE_DOMAIN(`bar.com')
760
761		then *foo.org and *bar.com are converted to masq.com.  Without
762		this feature, only foo.org and bar.com are masqueraded.
763
764		    NOTE: only domains within your jurisdiction and
765		    current hierarchy should be masqueraded using this.
766
767local_no_masquerade
768		This feature prevents the local mailer from masquerading even
769		if MASQUERADE_AS is used.  MASQUERADE_AS will only have effect
770		on addresses of mail going outside the local domain.
771
772masquerade_envelope
773		If masquerading is enabled (using MASQUERADE_AS) or the
774		genericstable is in use, this feature will cause envelope
775		addresses to also masquerade as being from the masquerade
776		host.  Normally only the header addresses are masqueraded.
777
778genericstable	This feature will cause unqualified addresses (i.e., without
779		a domain) and addresses with a domain listed in class {G}
780		to be looked up in a map and turned into another ("generic")
781		form, which can change both the domain name and the user name.
782		Notice: if you use an MSP (as it is default starting with
783		8.12), the MTA will only receive qualified addresses from the
784		MSP (as required by the RFCs).  Hence you need to add your
785		domain to class {G}.  This feature is similar to the userdb
786		functionality.  The same types of addresses as for
787		masquerading are looked up, i.e., only header sender
788		addresses unless the allmasquerade and/or masquerade_envelope
789		features are given.  Qualified addresses must have the domain
790		part in class {G}; entries can be added to this class by the
791		macros GENERICS_DOMAIN or GENERICS_DOMAIN_FILE (analogously
792		to MASQUERADE_DOMAIN and MASQUERADE_DOMAIN_FILE, see below).
793
794		The argument of FEATURE(`genericstable') may be the map
795		definition; the default map definition is:
796
797			hash /etc/mail/genericstable
798
799		The key for this table is either the full address, the domain
800		(with a leading @; the localpart is passed as first argument)
801		or the unqualified username (tried in the order mentioned);
802		the value is the new user address.  If the new user address
803		does not include a domain, it will be qualified in the standard
804		manner, i.e., using $j or the masquerade name.  Note that the
805		address being looked up must be fully qualified.  For local
806		mail, it is necessary to use FEATURE(`always_add_domain')
807		for the addresses to be qualified.
808		The "+detail" of an address is passed as %1, so entries like
809
810			old+*@foo.org	new+%1@example.com
811			gen+*@foo.org	%1@example.com
812
813		and other forms are possible.
814
815generics_entire_domain
816		If the genericstable is enabled and GENERICS_DOMAIN or
817		GENERICS_DOMAIN_FILE is used, this feature will cause
818		addresses to be searched in the map if their domain
819		parts are subdomains of elements in class {G}.
820
821virtusertable	A domain-specific form of aliasing, allowing multiple
822		virtual domains to be hosted on one machine.  For example,
823		if the virtuser table contains:
824
825			info@foo.com	foo-info
826			info@bar.com	bar-info
827			joe@bar.com	error:nouser 550 No such user here
828			jax@bar.com	error:5.7.0:550 Address invalid
829			@baz.org	jane@example.net
830
831		then mail addressed to info@foo.com will be sent to the
832		address foo-info, mail addressed to info@bar.com will be
833		delivered to bar-info, and mail addressed to anyone at baz.org
834		will be sent to jane@example.net, mail to joe@bar.com will
835		be rejected with the specified error message, and mail to
836		jax@bar.com will also have a RFC 1893 compliant error code
837		5.7.0.
838
839		The username from the original address is passed
840		as %1 allowing:
841
842			@foo.org	%1@example.com
843
844		meaning someone@foo.org will be sent to someone@example.com.
845		Additionally, if the local part consists of "user+detail"
846		then "detail" is passed as %2 and "+detail" is passed as %3
847		when a match against user+* is attempted, so entries like
848
849			old+*@foo.org	new+%2@example.com
850			gen+*@foo.org	%2@example.com
851			+*@foo.org	%1%3@example.com
852			X++@foo.org	Z%3@example.com
853			@bar.org	%1%3
854
855		and other forms are possible.  Note: to preserve "+detail"
856		for a default case (@domain) %1%3 must be used as RHS.
857		There are two wildcards after "+": "+" matches only a non-empty
858		detail, "*" matches also empty details, e.g., user+@foo.org
859		matches +*@foo.org but not ++@foo.org.  This can be used
860		to ensure that the parameters %2 and %3 are not empty.
861
862		All the host names on the left hand side (foo.com, bar.com,
863		and baz.org) must be in class {w} or class {VirtHost}.  The
864		latter can be defined by the macros VIRTUSER_DOMAIN or
865		VIRTUSER_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
866		MASQUERADE_DOMAIN_FILE, see below).  If VIRTUSER_DOMAIN or
867		VIRTUSER_DOMAIN_FILE is used, then the entries of class
868		{VirtHost} are added to class {R}, i.e., relaying is allowed
869		to (and from) those domains.  The default map definition is:
870
871			hash /etc/mail/virtusertable
872
873		A new definition can be specified as the second argument of
874		the FEATURE macro, such as
875
876			FEATURE(`virtusertable', `dbm /etc/mail/virtusers')
877
878virtuser_entire_domain
879		If the virtusertable is enabled and VIRTUSER_DOMAIN or
880		VIRTUSER_DOMAIN_FILE is used, this feature will cause
881		addresses to be searched in the map if their domain
882		parts are subdomains of elements in class {VirtHost}.
883
884ldap_routing	Implement LDAP-based e-mail recipient routing according to
885		the Internet Draft draft-lachman-laser-ldap-mail-routing-01.
886		This provides a method to re-route addresses with a
887		domain portion in class {LDAPRoute} to either a
888		different mail host or a different address.  Hosts can
889		be added to this class using LDAPROUTE_DOMAIN and
890		LDAPROUTE_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
891		MASQUERADE_DOMAIN_FILE, see below).
892
893		See the LDAP ROUTING section below for more information.
894
895nullclient	This is a special case -- it creates a configuration file
896		containing nothing but support for forwarding all mail to a
897		central hub via a local SMTP-based network.  The argument
898		is the name of that hub.
899
900		The only other feature that should be used in conjunction
901		with this one is FEATURE(`nocanonify').  No mailers
902		should be defined.  No aliasing or forwarding is done.
903
904local_lmtp	Use an LMTP capable local mailer.  The argument to this
905		feature is the pathname of an LMTP capable mailer.  By
906		default, mail.local is used.  This is expected to be the
907		mail.local which came with the 8.9 distribution which is
908		LMTP capable.  The path to mail.local is set by the
909		confEBINDIR m4 variable -- making the default
910		LOCAL_MAILER_PATH /usr/libexec/mail.local.
911		If a different LMTP capable mailer is used, its pathname
912		can be specified as second parameter and the arguments
913		passed to it (A=) as third parameter, e.g.,
914
915			FEATURE(`local_lmtp', `/usr/local/bin/lmtp', `lmtp')
916
917		WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally,
918		i.e., without respecting any definitions in an OSTYPE setting.
919
920local_procmail	Use procmail or another delivery agent as the local mailer.
921		The argument to this feature is the pathname of the
922		delivery agent, which defaults to PROCMAIL_MAILER_PATH.
923		Note that this does NOT use PROCMAIL_MAILER_FLAGS or
924		PROCMAIL_MAILER_ARGS for the local mailer; tweak
925		LOCAL_MAILER_FLAGS and LOCAL_MAILER_ARGS instead, or
926		specify the appropriate parameters.  When procmail is used,
927		the local mailer can make use of the
928		"user+indicator@local.host" syntax; normally the +indicator
929		is just tossed, but by default it is passed as the -a
930		argument to procmail.
931
932		This feature can take up to three arguments:
933
934		1. Path to the mailer program
935		   [default: /usr/local/bin/procmail]
936		2. Argument vector including name of the program
937		   [default: procmail -Y -a $h -d $u]
938		3. Flags for the mailer [default: SPfhn9]
939
940		Empty arguments cause the defaults to be taken.
941		Note that if you are on a system with a broken
942		setreuid() call, you may need to add -f $f to the procmail
943		argument vector to pass the proper sender to procmail.
944
945		For example, this allows it to use the maildrop
946		(http://www.flounder.net/~mrsam/maildrop/) mailer instead
947		by specifying:
948
949		FEATURE(`local_procmail', `/usr/local/bin/maildrop',
950		 `maildrop -d $u')
951
952		or scanmails using:
953
954		FEATURE(`local_procmail', `/usr/local/bin/scanmails')
955
956		WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally,
957		i.e.,  without respecting any definitions in an OSTYPE setting.
958
959bestmx_is_local	Accept mail as though locally addressed for any host that
960		lists us as the best possible MX record.  This generates
961		additional DNS traffic, but should be OK for low to
962		medium traffic hosts.  The argument may be a set of
963		domains, which will limit the feature to only apply to
964		these domains -- this will reduce unnecessary DNS
965		traffic.  THIS FEATURE IS FUNDAMENTALLY INCOMPATIBLE WITH
966		WILDCARD MX RECORDS!!!  If you have a wildcard MX record
967		that matches your domain, you cannot use this feature.
968
969smrsh		Use the SendMail Restricted SHell (smrsh) provided
970		with the distribution instead of /bin/sh for mailing
971		to programs.  This improves the ability of the local
972		system administrator to control what gets run via
973		e-mail.  If an argument is provided it is used as the
974		pathname to smrsh; otherwise, the path defined by
975		confEBINDIR is used for the smrsh binary -- by default,
976		/usr/libexec/smrsh is assumed.
977
978promiscuous_relay
979		By default, the sendmail configuration files do not permit
980		mail relaying (that is, accepting mail from outside your
981		local host (class {w}) and sending it to another host than
982		your local host).  This option sets your site to allow
983		mail relaying from any site to any site.  In almost all
984		cases, it is better to control relaying more carefully
985		with the access map, class {R}, or authentication.  Domains
986		can be added to class {R} by the macros RELAY_DOMAIN or
987		RELAY_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
988		MASQUERADE_DOMAIN_FILE, see below).
989
990relay_entire_domain
991		This option allows any host in your domain as defined by
992		class {m} to use your server for relaying.  Notice: make
993		sure that your domain is not just a top level domain,
994		e.g., com.  This can happen if you give your host a name
995		like example.com instead of host.example.com.
996
997relay_hosts_only
998		By default, names that are listed as RELAY in the access
999		db and class {R} are treated as domain names, not host names.
1000		For example, if you specify ``foo.com'', then mail to or
1001		from foo.com, abc.foo.com, or a.very.deep.domain.foo.com
1002		will all be accepted for relaying.  This feature changes
1003		the behaviour to lookup individual host names only.
1004
1005relay_based_on_MX
1006		Turns on the ability to allow relaying based on the MX
1007		records of the host portion of an incoming recipient; that
1008		is, if an MX record for host foo.com points to your site,
1009		you will accept and relay mail addressed to foo.com.  See
1010		description below for more information before using this
1011		feature.  Also, see the KNOWNBUGS entry regarding bestmx
1012		map lookups.
1013
1014		FEATURE(`relay_based_on_MX') does not necessarily allow
1015		routing of these messages which you expect to be allowed,
1016		if route address syntax (or %-hack syntax) is used.  If
1017		this is a problem, add entries to the access-table or use
1018		FEATURE(`loose_relay_check').
1019
1020relay_mail_from
1021		Allows relaying if the mail sender is listed as RELAY in
1022		the access map.  If an optional argument `domain' (this
1023		is the literal word `domain', not a placeholder) is given,
1024		relaying can be allowed just based on the domain portion
1025		of the sender address.  This feature should only be used if
1026		absolutely necessary as the sender address can be easily
1027		forged.  Use of this feature requires the "From:" tag to
1028		be used for the key in the access map; see the discussion
1029		of tags and FEATURE(`relay_mail_from') in the section on
1030		anti-spam configuration control.
1031
1032relay_local_from
1033		Allows relaying if the domain portion of the mail sender
1034		is a local host.  This should only be used if absolutely
1035		necessary as it opens a window for spammers.  Specifically,
1036		they can send mail to your mail server that claims to be
1037		from your domain (either directly or via a routed address),
1038		and you will go ahead and relay it out to arbitrary hosts
1039		on the Internet.
1040
1041accept_unqualified_senders
1042		Normally, MAIL FROM: commands in the SMTP session will be
1043		refused if the connection is a network connection and the
1044		sender address does not include a domain name.  If your
1045		setup sends local mail unqualified (i.e., MAIL FROM:<joe>),
1046		you will need to use this feature to accept unqualified
1047		sender addresses.  Setting the DaemonPortOptions modifier
1048		'u' overrides the default behavior, i.e., unqualified
1049		addresses are accepted even without this FEATURE.
1050		If this FEATURE is not used, the DaemonPortOptions modifier
1051		'f' can be used to enforce fully qualified addresses.
1052
1053accept_unresolvable_domains
1054		Normally, MAIL FROM: commands in the SMTP session will be
1055		refused if the host part of the argument to MAIL FROM:
1056		cannot be located in the host name service (e.g., an A or
1057		MX record in DNS).  If you are inside a firewall that has
1058		only a limited view of the Internet host name space, this
1059		could cause problems.  In this case you probably want to
1060		use this feature to accept all domains on input, even if
1061		they are unresolvable.
1062
1063access_db	Turns on the access database feature.  The access db gives
1064		you the ability to allow or refuse to accept mail from
1065		specified domains for administrative reasons.  Moreover,
1066		it can control the behavior of sendmail in various situations.
1067		By default, the access database specification is:
1068
1069			hash -T<TMPF> /etc/mail/access
1070
1071		See the anti-spam configuration control section for further
1072		important information about this feature.  Notice:
1073		"-T<TMPF>" is meant literal, do not replace it by anything.
1074
1075blacklist_recipients
1076		Turns on the ability to block incoming mail for certain
1077		recipient usernames, hostnames, or addresses.  For
1078		example, you can block incoming mail to user nobody,
1079		host foo.mydomain.com, or guest@bar.mydomain.com.
1080		These specifications are put in the access db as
1081		described in the anti-spam configuration control section
1082		later in this document.
1083
1084delay_checks	The rulesets check_mail and check_relay will not be called
1085		when a client connects or issues a MAIL command, respectively.
1086		Instead, those rulesets will be called by the check_rcpt
1087		ruleset; they will be skipped under certain circumstances.
1088		See "Delay all checks" in the anti-spam configuration control
1089		section.  Note: this feature is incompatible to the versions
1090		in 8.10 and 8.11.
1091
1092use_client_ptr	If this feature is enabled then check_relay will override
1093		its first argument with $&{client_ptr}.  This is useful for
1094		rejections based on the unverified hostname of client,
1095		which turns on the same behavior as in earlier sendmail
1096		versions when delay_checks was not in use.  See doc/op/op.*
1097		about check_relay, {client_name}, and {client_ptr}.
1098
1099dnsbl		Turns on rejection, discarding, or quarantining of hosts
1100		found in a DNS based list.  The first argument is used as
1101		the domain in which blocked hosts are listed.  A second
1102		argument can be used to change the default error message,
1103		or select one of the operations `discard' and 'quarantine'.
1104		Without that second argument, the error message will be
1105
1106			Rejected: IP-ADDRESS listed at SERVER
1107
1108		where IP-ADDRESS and SERVER are replaced by the appropriate
1109		information.  By default, temporary lookup failures are
1110		ignored.  This behavior can be changed by specifying a
1111		third argument, which must be either `t' or a full error
1112		message.  See the anti-spam configuration control section for
1113		an example.  The dnsbl feature can be included several times
1114		to query different DNS based rejection lists.  See also
1115		enhdnsbl for an enhanced version.
1116
1117		Set the DNSBL_MAP mc option to change the default map
1118		definition from `host'.  Set the DNSBL_MAP_OPT mc option
1119		to add additional options to the map specification used.
1120
1121		Some DNS based rejection lists cause failures if asked
1122		for AAAA records. If your sendmail version is compiled
1123		with IPv6 support (NETINET6) and you experience this
1124		problem, add
1125
1126			define(`DNSBL_MAP', `dns -R A')
1127
1128		before the first use of this feature.  Alternatively you
1129		can use enhdnsbl instead (see below).  Moreover, this
1130		statement can be used to reduce the number of DNS retries,
1131		e.g.,
1132
1133			define(`DNSBL_MAP', `dns -R A -r2')
1134
1135		See below (EDNSBL_TO) for an explanation.
1136
1137enhdnsbl	Enhanced version of dnsbl (see above).  Further arguments
1138		(up to 5) can be used to specify specific return values
1139		from lookups.  Temporary lookup failures are ignored unless
1140		a third argument is given, which must be either `t' or a full
1141		error message.  By default, any successful lookup will
1142		generate an error.  Otherwise the result of the lookup is
1143		compared with the supplied argument(s), and only if a match
1144		occurs an error is generated.  For example,
1145
1146		FEATURE(`enhdnsbl', `dnsbl.example.com', `', `t', `127.0.0.2.')
1147
1148		will reject the e-mail if the lookup returns the value
1149		``127.0.0.2.'', or generate a 451 response if the lookup
1150		temporarily failed.  The arguments can contain metasymbols
1151		as they are allowed in the LHS of rules.  As the example
1152		shows, the default values are also used if an empty argument,
1153		i.e., `', is specified.  This feature requires that sendmail
1154		has been compiled with the flag DNSMAP (see sendmail/README).
1155
1156		Set the EDNSBL_TO mc option to change the DNS retry count
1157		from the default value of 5, this can be very useful when
1158		a DNS server is not responding, which in turn may cause
1159		clients to time out (an entry stating
1160
1161			did not issue MAIL/EXPN/VRFY/ETRN
1162
1163		will be logged).
1164
1165ratecontrol	Enable simple ruleset to do connection rate control
1166		checking.  This requires entries in access_db of the form
1167
1168			ClientRate:IP.ADD.RE.SS		LIMIT
1169
1170		The RHS specifies the maximum number of connections
1171		(an integer number) over the time interval defined
1172		by ConnectionRateWindowSize, where 0 means unlimited.
1173
1174		Take the following example:
1175
1176			ClientRate:10.1.2.3		4
1177			ClientRate:127.0.0.1		0
1178			ClientRate:			10
1179
1180		10.1.2.3 can only make up to 4 connections, the
1181		general limit it 10, and 127.0.0.1 can make an unlimited
1182		number of connections per ConnectionRateWindowSize.
1183
1184		See also CONNECTION CONTROL.
1185
1186conncontrol	Enable a simple check of the number of incoming SMTP
1187		connections.  This requires entries in access_db of the
1188		form
1189
1190			ClientConn:IP.ADD.RE.SS		LIMIT
1191
1192		The RHS specifies the maximum number of open connections
1193		(an integer number).
1194
1195		Take the following example:
1196
1197			ClientConn:10.1.2.3		4
1198			ClientConn:127.0.0.1		0
1199			ClientConn:			10
1200
1201		10.1.2.3 can only have up to 4 open connections, the
1202		general limit it 10, and 127.0.0.1 does not have any
1203		explicit limit.
1204
1205		See also CONNECTION CONTROL.
1206
1207mtamark		Experimental support for "Marking Mail Transfer Agents in
1208		Reverse DNS with TXT RRs" (MTAMark), see
1209		draft-stumpf-dns-mtamark-01.  Optional arguments are:
1210
1211		1. Error message, default:
1212
1213			550 Rejected: $&{client_addr} not listed as MTA
1214
1215		2. Temporary lookup failures are ignored unless a second
1216		argument is given, which must be either `t' or a full
1217		error message.
1218
1219		3. Lookup prefix, default: _perm._smtp._srv.  This should
1220		not be changed unless the draft changes it.
1221
1222		Example:
1223
1224			FEATURE(`mtamark', `', `t')
1225
1226lookupdotdomain	Look up also .domain in the access map.  This allows to
1227		match only subdomains.  It does not work well with
1228		FEATURE(`relay_hosts_only'), because most lookups for
1229		subdomains are suppressed by the latter feature.
1230
1231loose_relay_check
1232		Normally, if % addressing is used for a recipient, e.g.
1233		user%site@othersite, and othersite is in class {R}, the
1234		check_rcpt ruleset will strip @othersite and recheck
1235		user@site for relaying.  This feature changes that
1236		behavior.  It should not be needed for most installations.
1237
1238preserve_luser_host
1239		Preserve the name of the recipient host if LUSER_RELAY is
1240		used.  Without this option, the domain part of the
1241		recipient address will be replaced by the host specified as
1242		LUSER_RELAY.  This feature only works if the hostname is
1243		passed to the mailer (see mailer triple in op.me).  Note
1244		that in the default configuration the local mailer does not
1245		receive the hostname, i.e., the mailer triple has an empty
1246		hostname.
1247
1248preserve_local_plus_detail
1249		Preserve the +detail portion of the address when passing
1250		address to local delivery agent.  Disables alias and
1251		.forward +detail stripping (e.g., given user+detail, only
1252		that address will be looked up in the alias file; user+* and
1253		user will not be looked up).  Only use if the local
1254		delivery agent in use supports +detail addressing.
1255
1256compat_check	Enable ruleset check_compat to look up pairs of addresses
1257		with the Compat: tag --	Compat:sender<@>recipient -- in the
1258		access map.  Valid values for the RHS include
1259			DISCARD	silently discard recipient
1260			TEMP:	return a temporary error
1261			ERROR:	return a permanent error
1262		In the last two cases, a 4xy/5xy SMTP reply code should
1263		follow the colon.
1264
1265no_default_msa	Don't generate the default MSA daemon, i.e.,
1266		DAEMON_OPTIONS(`Port=587,Name=MSA,M=E')
1267		To define a MSA daemon with other parameters, use this
1268		FEATURE and introduce new settings via DAEMON_OPTIONS().
1269
1270msp		Defines config file for Message Submission Program.
1271		See cf/submit.mc for how
1272		to use it.  An optional argument can be used to override
1273		the default of `[localhost]' to use as host to send all
1274		e-mails to.  Note that MX records will be used if the
1275		specified hostname is not in square brackets (e.g.,
1276		[hostname]).  If `MSA' is specified as second argument then
1277		port 587 is used to contact the server.  Example:
1278
1279			FEATURE(`msp', `', `MSA')
1280
1281		Some more hints about possible changes can be found below
1282		in the section MESSAGE SUBMISSION PROGRAM.
1283
1284		Note: Due to many problems, submit.mc uses
1285
1286			FEATURE(`msp', `[127.0.0.1]')
1287
1288		by default.  If you have a machine with IPv6 only,
1289		change it to
1290
1291			FEATURE(`msp', `[IPv6:::1]')
1292
1293		If you want to continue using '[localhost]', (the behavior
1294		up to 8.12.6), use
1295
1296			FEATURE(`msp')
1297
1298queuegroup	A simple example how to select a queue group based
1299		on the full e-mail address or the domain of the
1300		recipient.  Selection is done via entries in the
1301		access map using the tag QGRP:, for example:
1302
1303			QGRP:example.com	main
1304			QGRP:friend@some.org	others
1305			QGRP:my.domain		local
1306
1307		where "main", "others", and "local" are names of
1308		queue groups.  If an argument is specified, it is used
1309		as default queue group.
1310
1311		Note: please read the warning in doc/op/op.me about
1312		queue groups and possible queue manipulations.
1313
1314greet_pause	Adds the greet_pause ruleset which enables open proxy
1315		and SMTP slamming protection.  The feature can take an
1316		argument specifying the milliseconds to wait:
1317
1318			FEATURE(`greet_pause', `5000')  dnl 5 seconds
1319
1320		If FEATURE(`access_db') is enabled, an access database
1321		lookup with the GreetPause tag is done using client
1322		hostname, domain, IP address, or subnet to determine the
1323		pause time:
1324
1325			GreetPause:my.domain	0
1326			GreetPause:example.com	5000
1327			GreetPause:10.1.2	2000
1328			GreetPause:127.0.0.1	0
1329
1330		When using FEATURE(`access_db'), the optional
1331		FEATURE(`greet_pause') argument becomes the default if
1332		nothing is found in the access database.  A ruleset called
1333		Local_greet_pause can be used for local modifications, e.g.,
1334
1335			LOCAL_RULESETS
1336			SLocal_greet_pause
1337			R$*		$: $&{daemon_flags}
1338			R$* a $*	$# 0
1339
1340block_bad_helo	Reject messages from SMTP clients which provide a HELO/EHLO
1341		argument which is either unqualified, or is one of our own
1342		names (i.e., the server name instead of the client name).
1343
1344require_rdns	Reject mail from connecting SMTP clients without proper
1345		rDNS (reverse DNS), functional gethostbyaddr() resolution.
1346
1347		The basic policy is to reject message with a 5xx error if
1348		the IP address fails to resolve.  However, if this is a
1349		temporary failure, a 4xx temporary failure is returned.
1350		If the look-up succeeds, but returns an apparently forged
1351		value, this is treated as a temporary failure with a 4xx
1352		error code.
1353
1354		EXCEPTIONS:
1355
1356		Exceptions based on access entries are discussed below.
1357		Any IP address matched using $=R (the "relay-domains" file)
1358		is excepted from the rules.  Since we have explicitly
1359		allowed relaying for this host, based on IP address, we
1360		ignore the rDNS failure.
1361
1362		The philosophical assumption here is that most users do
1363		not control their rDNS.  They should be able to send mail
1364		through their ISP, whether or not they have valid rDNS.
1365		The class $=R, roughly speaking, contains those IP addresses
1366		and address ranges for which we are the ISP, or are acting
1367		as if the ISP.
1368
1369		If `delay_checks' is in effect (recommended), then any
1370		sender who has authenticated is also excepted from the
1371		restrictions.  This happens because the rules produced by
1372		this FEATURE() will not be applied to authenticated senders
1373		(assuming `delay_checks').
1374
1375		ACCESS MAP ENTRIES:
1376
1377		Entries such as
1378			Connect:1.2.3.4		OK
1379			Connect:1.2		RELAY
1380		will whitelist IP address 1.2.3.4, so that the rDNS
1381		blocking does apply to that IP address
1382
1383		Entries such as
1384			Connect:1.2.3.4		REJECT
1385		will have the effect of forcing a temporary failure for
1386		that address to be treated as a permanent failure.
1387
1388badmx		Reject envelope sender addresses (MAIL) whose domain part
1389		resolves to a "bad" MX record.  By default these are
1390		MX records which resolve to A records that match the
1391		regular expression:
1392
1393		^(127\.|10\.|0\.0\.0\.0)
1394
1395		This default regular expression can be overridden by
1396		specifying an argument, e.g.,
1397
1398		FEATURE(`badmx', `^127\.0\.0\.1')
1399
1400		Note: this feature requires that the sendmail binary
1401		has been compiled with the options MAP_REGEX and
1402		DNSMAP.
1403
1404+--------------------+
1405| USING UUCP MAILERS |
1406+--------------------+
1407
1408It's hard to get UUCP mailers right because of the extremely ad hoc
1409nature of UUCP addressing.  These config files are really designed
1410for domain-based addressing, even for UUCP sites.
1411
1412There are four UUCP mailers available.  The choice of which one to
1413use is partly a matter of local preferences and what is running at
1414the other end of your UUCP connection.  Unlike good protocols that
1415define what will go over the wire, UUCP uses the policy that you
1416should do what is right for the other end; if they change, you have
1417to change.  This makes it hard to do the right thing, and discourages
1418people from updating their software.  In general, if you can avoid
1419UUCP, please do.
1420
1421The major choice is whether to go for a domainized scheme or a
1422non-domainized scheme.  This depends entirely on what the other
1423end will recognize.  If at all possible, you should encourage the
1424other end to go to a domain-based system -- non-domainized addresses
1425don't work entirely properly.
1426
1427The four mailers are:
1428
1429    uucp-old (obsolete name: "uucp")
1430	This is the oldest, the worst (but the closest to UUCP) way of
1431	sending messages across UUCP connections.  It does bangify
1432	everything and prepends $U (your UUCP name) to the sender's
1433	address (which can already be a bang path itself).  It can
1434	only send to one address at a time, so it spends a lot of
1435	time copying duplicates of messages.  Avoid this if at all
1436	possible.
1437
1438    uucp-new (obsolete name: "suucp")
1439	The same as above, except that it assumes that in one rmail
1440	command you can specify several recipients.  It still has a
1441	lot of other problems.
1442
1443    uucp-dom
1444	This UUCP mailer keeps everything as domain addresses.
1445	Basically, it uses the SMTP mailer rewriting rules.  This mailer
1446	is only included if MAILER(`smtp') is specified before
1447	MAILER(`uucp').
1448
1449	Unfortunately, a lot of UUCP mailer transport agents require
1450	bangified addresses in the envelope, although you can use
1451	domain-based addresses in the message header.  (The envelope
1452	shows up as the From_ line on UNIX mail.)  So....
1453
1454    uucp-uudom
1455	This is a cross between uucp-new (for the envelope addresses)
1456	and uucp-dom (for the header addresses).  It bangifies the
1457	envelope sender (From_ line in messages) without adding the
1458	local hostname, unless there is no host name on the address
1459	at all (e.g., "wolf") or the host component is a UUCP host name
1460	instead of a domain name ("somehost!wolf" instead of
1461	"some.dom.ain!wolf").  This is also included only if MAILER(`smtp')
1462	is also specified earlier.
1463
1464Examples:
1465
1466On host grasp.insa-lyon.fr (UUCP host name "grasp"), the following
1467summarizes the sender rewriting for various mailers.
1468
1469Mailer		sender		rewriting in the envelope
1470------		------		-------------------------
1471uucp-{old,new}	wolf		grasp!wolf
1472uucp-dom	wolf		wolf@grasp.insa-lyon.fr
1473uucp-uudom	wolf		grasp.insa-lyon.fr!wolf
1474
1475uucp-{old,new}	wolf@fr.net	grasp!fr.net!wolf
1476uucp-dom	wolf@fr.net	wolf@fr.net
1477uucp-uudom	wolf@fr.net	fr.net!wolf
1478
1479uucp-{old,new}	somehost!wolf	grasp!somehost!wolf
1480uucp-dom	somehost!wolf	somehost!wolf@grasp.insa-lyon.fr
1481uucp-uudom	somehost!wolf	grasp.insa-lyon.fr!somehost!wolf
1482
1483If you are using one of the domainized UUCP mailers, you really want
1484to convert all UUCP addresses to domain format -- otherwise, it will
1485do it for you (and probably not the way you expected).  For example,
1486if you have the address foo!bar!baz (and you are not sending to foo),
1487the heuristics will add the @uucp.relay.name or @local.host.name to
1488this address.  However, if you map foo to foo.host.name first, it
1489will not add the local hostname.  You can do this using the uucpdomain
1490feature.
1491
1492
1493+-------------------+
1494| TWEAKING RULESETS |
1495+-------------------+
1496
1497For more complex configurations, you can define special rules.
1498The macro LOCAL_RULE_3 introduces rules that are used in canonicalizing
1499the names.  Any modifications made here are reflected in the header.
1500
1501A common use is to convert old UUCP addresses to SMTP addresses using
1502the UUCPSMTP macro.  For example:
1503
1504	LOCAL_RULE_3
1505	UUCPSMTP(`decvax',	`decvax.dec.com')
1506	UUCPSMTP(`research',	`research.att.com')
1507
1508will cause addresses of the form "decvax!user" and "research!user"
1509to be converted to "user@decvax.dec.com" and "user@research.att.com"
1510respectively.
1511
1512This could also be used to look up hosts in a database map:
1513
1514	LOCAL_RULE_3
1515	R$* < @ $+ > $*		$: $1 < @ $(hostmap $2 $) > $3
1516
1517This map would be defined in the LOCAL_CONFIG portion, as shown below.
1518
1519Similarly, LOCAL_RULE_0 can be used to introduce new parsing rules.
1520For example, new rules are needed to parse hostnames that you accept
1521via MX records.  For example, you might have:
1522
1523	LOCAL_RULE_0
1524	R$+ <@ host.dom.ain.>	$#uucp $@ cnmat $: $1 < @ host.dom.ain.>
1525
1526You would use this if you had installed an MX record for cnmat.Berkeley.EDU
1527pointing at this host; this rule catches the message and forwards it on
1528using UUCP.
1529
1530You can also tweak rulesets 1 and 2 using LOCAL_RULE_1 and LOCAL_RULE_2.
1531These rulesets are normally empty.
1532
1533A similar macro is LOCAL_CONFIG.  This introduces lines added after the
1534boilerplate option setting but before rulesets.  Do not declare rulesets in
1535the LOCAL_CONFIG section.  It can be used to declare local database maps or
1536whatever.  For example:
1537
1538	LOCAL_CONFIG
1539	Khostmap hash /etc/mail/hostmap
1540	Kyplocal nis -m hosts.byname
1541
1542
1543+---------------------------+
1544| MASQUERADING AND RELAYING |
1545+---------------------------+
1546
1547You can have your host masquerade as another using
1548
1549	MASQUERADE_AS(`host.domain')
1550
1551This causes mail being sent to be labeled as coming from the
1552indicated host.domain, rather than $j.  One normally masquerades as
1553one of one's own subdomains (for example, it's unlikely that
1554Berkeley would choose to masquerade as an MIT site).  This
1555behaviour is modified by a plethora of FEATUREs; in particular, see
1556masquerade_envelope, allmasquerade, limited_masquerade, and
1557masquerade_entire_domain.
1558
1559The masquerade name is not normally canonified, so it is important
1560that it be your One True Name, that is, fully qualified and not a
1561CNAME.  However, if you use a CNAME, the receiving side may canonify
1562it for you, so don't think you can cheat CNAME mapping this way.
1563
1564Normally the only addresses that are masqueraded are those that come
1565from this host (that is, are either unqualified or in class {w}, the list
1566of local domain names).  You can augment this list, which is realized
1567by class {M} using
1568
1569	MASQUERADE_DOMAIN(`otherhost.domain')
1570
1571The effect of this is that although mail to user@otherhost.domain
1572will not be delivered locally, any mail including any user@otherhost.domain
1573will, when relayed, be rewritten to have the MASQUERADE_AS address.
1574This can be a space-separated list of names.
1575
1576If these names are in a file, you can use
1577
1578	MASQUERADE_DOMAIN_FILE(`filename')
1579
1580to read the list of names from the indicated file (i.e., to add
1581elements to class {M}).
1582
1583To exempt hosts or subdomains from being masqueraded, you can use
1584
1585	MASQUERADE_EXCEPTION(`host.domain')
1586
1587This can come handy if you want to masquerade a whole domain
1588except for one (or a few) host(s).  If these names are in a file,
1589you can use
1590
1591	MASQUERADE_EXCEPTION_FILE(`filename')
1592
1593Normally only header addresses are masqueraded.  If you want to
1594masquerade the envelope as well, use
1595
1596	FEATURE(`masquerade_envelope')
1597
1598There are always users that need to be "exposed" -- that is, their
1599internal site name should be displayed instead of the masquerade name.
1600Root is an example (which has been "exposed" by default prior to 8.10).
1601You can add users to this list using
1602
1603	EXPOSED_USER(`usernames')
1604
1605This adds users to class {E}; you could also use
1606
1607	EXPOSED_USER_FILE(`filename')
1608
1609You can also arrange to relay all unqualified names (that is, names
1610without @host) to a relay host.  For example, if you have a central
1611email server, you might relay to that host so that users don't have
1612to have .forward files or aliases.  You can do this using
1613
1614	define(`LOCAL_RELAY', `mailer:hostname')
1615
1616The ``mailer:'' can be omitted, in which case the mailer defaults to
1617"relay".  There are some user names that you don't want relayed, perhaps
1618because of local aliases.  A common example is root, which may be
1619locally aliased.  You can add entries to this list using
1620
1621	LOCAL_USER(`usernames')
1622
1623This adds users to class {L}; you could also use
1624
1625	LOCAL_USER_FILE(`filename')
1626
1627If you want all incoming mail sent to a centralized hub, as for a
1628shared /var/spool/mail scheme, use
1629
1630	define(`MAIL_HUB', `mailer:hostname')
1631
1632Again, ``mailer:'' defaults to "relay".  If you define both LOCAL_RELAY
1633and MAIL_HUB _AND_ you have FEATURE(`stickyhost'), unqualified names will
1634be sent to the LOCAL_RELAY and other local names will be sent to MAIL_HUB.
1635Note: there is a (long standing) bug which keeps this combination from
1636working for addresses of the form user+detail.
1637Names in class {L} will be delivered locally, so you MUST have aliases or
1638.forward files for them.
1639
1640For example, if you are on machine mastodon.CS.Berkeley.EDU and you have
1641FEATURE(`stickyhost'), the following combinations of settings will have the
1642indicated effects:
1643
1644email sent to....	eric			  eric@mastodon.CS.Berkeley.EDU
1645
1646LOCAL_RELAY set to	mail.CS.Berkeley.EDU	  (delivered locally)
1647mail.CS.Berkeley.EDU	  (no local aliasing)	    (aliasing done)
1648
1649MAIL_HUB set to		mammoth.CS.Berkeley.EDU	  mammoth.CS.Berkeley.EDU
1650mammoth.CS.Berkeley.EDU	  (aliasing done)	    (aliasing done)
1651
1652Both LOCAL_RELAY and	mail.CS.Berkeley.EDU	  mammoth.CS.Berkeley.EDU
1653MAIL_HUB set as above	  (no local aliasing)	    (aliasing done)
1654
1655If you do not have FEATURE(`stickyhost') set, then LOCAL_RELAY and
1656MAIL_HUB act identically, with MAIL_HUB taking precedence.
1657
1658If you want all outgoing mail to go to a central relay site, define
1659SMART_HOST as well.  Briefly:
1660
1661	LOCAL_RELAY applies to unqualified names (e.g., "eric").
1662	MAIL_HUB applies to names qualified with the name of the
1663		local host (e.g., "eric@mastodon.CS.Berkeley.EDU").
1664	SMART_HOST applies to names qualified with other hosts or
1665		bracketed addresses (e.g., "eric@mastodon.CS.Berkeley.EDU"
1666		or "eric@[127.0.0.1]").
1667
1668However, beware that other relays (e.g., UUCP_RELAY, BITNET_RELAY,
1669DECNET_RELAY, and FAX_RELAY) take precedence over SMART_HOST, so if you
1670really want absolutely everything to go to a single central site you will
1671need to unset all the other relays -- or better yet, find or build a
1672minimal config file that does this.
1673
1674For duplicate suppression to work properly, the host name is best
1675specified with a terminal dot:
1676
1677	define(`MAIL_HUB', `host.domain.')
1678	      note the trailing dot ---^
1679
1680
1681+-------------------------------------------+
1682| USING LDAP FOR ALIASES, MAPS, AND CLASSES |
1683+-------------------------------------------+
1684
1685LDAP can be used for aliases, maps, and classes by either specifying your
1686own LDAP map specification or using the built-in default LDAP map
1687specification.  The built-in default specifications all provide lookups
1688which match against either the machine's fully qualified hostname (${j}) or
1689a "cluster".  The cluster allows you to share LDAP entries among a large
1690number of machines without having to enter each of the machine names into
1691each LDAP entry.  To set the LDAP cluster name to use for a particular
1692machine or set of machines, set the confLDAP_CLUSTER m4 variable to a
1693unique name.  For example:
1694
1695	define(`confLDAP_CLUSTER', `Servers')
1696
1697Here, the word `Servers' will be the cluster name.  As an example, assume
1698that smtp.sendmail.org, etrn.sendmail.org, and mx.sendmail.org all belong
1699to the Servers cluster.
1700
1701Some of the LDAP LDIF examples below show use of the Servers cluster.
1702Every entry must have either a sendmailMTAHost or sendmailMTACluster
1703attribute or it will be ignored.  Be careful as mixing clusters and
1704individual host records can have surprising results (see the CAUTION
1705sections below).
1706
1707See the file cf/sendmail.schema for the actual LDAP schemas.  Note that
1708this schema (and therefore the lookups and examples below) is experimental
1709at this point as it has had little public review.  Therefore, it may change
1710in future versions.  Feedback via sendmail-YYYY@support.sendmail.org is
1711encouraged (replace YYYY with the current year, e.g., 2005).
1712
1713-------
1714Aliases
1715-------
1716
1717The ALIAS_FILE (O AliasFile) option can be set to use LDAP for alias
1718lookups.  To use the default schema, simply use:
1719
1720	define(`ALIAS_FILE', `ldap:')
1721
1722By doing so, you will use the default schema which expands to a map
1723declared as follows:
1724
1725	ldap -k (&(objectClass=sendmailMTAAliasObject)
1726		  (sendmailMTAAliasGrouping=aliases)
1727		  (|(sendmailMTACluster=${sendmailMTACluster})
1728		    (sendmailMTAHost=$j))
1729		  (sendmailMTAKey=%0))
1730	     -v sendmailMTAAliasValue,sendmailMTAAliasSearch:FILTER:sendmailMTAAliasObject,sendmailMTAAliasURL:URL:sendmailMTAAliasObject
1731
1732
1733NOTE: The macros shown above ${sendmailMTACluster} and $j are not actually
1734used when the binary expands the `ldap:' token as the AliasFile option is
1735not actually macro-expanded when read from the sendmail.cf file.
1736
1737Example LDAP LDIF entries might be:
1738
1739	dn: sendmailMTAKey=sendmail-list, dc=sendmail, dc=org
1740	objectClass: sendmailMTA
1741	objectClass: sendmailMTAAlias
1742	objectClass: sendmailMTAAliasObject
1743	sendmailMTAAliasGrouping: aliases
1744	sendmailMTAHost: etrn.sendmail.org
1745	sendmailMTAKey: sendmail-list
1746	sendmailMTAAliasValue: ca@example.org
1747	sendmailMTAAliasValue: eric
1748	sendmailMTAAliasValue: gshapiro@example.com
1749
1750	dn: sendmailMTAKey=owner-sendmail-list, dc=sendmail, dc=org
1751	objectClass: sendmailMTA
1752	objectClass: sendmailMTAAlias
1753	objectClass: sendmailMTAAliasObject
1754	sendmailMTAAliasGrouping: aliases
1755	sendmailMTAHost: etrn.sendmail.org
1756	sendmailMTAKey: owner-sendmail-list
1757	sendmailMTAAliasValue: eric
1758
1759	dn: sendmailMTAKey=postmaster, dc=sendmail, dc=org
1760	objectClass: sendmailMTA
1761	objectClass: sendmailMTAAlias
1762	objectClass: sendmailMTAAliasObject
1763	sendmailMTAAliasGrouping: aliases
1764	sendmailMTACluster: Servers
1765	sendmailMTAKey: postmaster
1766	sendmailMTAAliasValue: eric
1767
1768Here, the aliases sendmail-list and owner-sendmail-list will be available
1769only on etrn.sendmail.org but the postmaster alias will be available on
1770every machine in the Servers cluster (including etrn.sendmail.org).
1771
1772CAUTION: aliases are additive so that entries like these:
1773
1774	dn: sendmailMTAKey=bob, dc=sendmail, dc=org
1775	objectClass: sendmailMTA
1776	objectClass: sendmailMTAAlias
1777	objectClass: sendmailMTAAliasObject
1778	sendmailMTAAliasGrouping: aliases
1779	sendmailMTACluster: Servers
1780	sendmailMTAKey: bob
1781	sendmailMTAAliasValue: eric
1782
1783	dn: sendmailMTAKey=bobetrn, dc=sendmail, dc=org
1784	objectClass: sendmailMTA
1785	objectClass: sendmailMTAAlias
1786	objectClass: sendmailMTAAliasObject
1787	sendmailMTAAliasGrouping: aliases
1788	sendmailMTAHost: etrn.sendmail.org
1789	sendmailMTAKey: bob
1790	sendmailMTAAliasValue: gshapiro
1791
1792would mean that on all of the hosts in the cluster, mail to bob would go to
1793eric EXCEPT on etrn.sendmail.org in which case it would go to BOTH eric and
1794gshapiro.
1795
1796If you prefer not to use the default LDAP schema for your aliases, you can
1797specify the map parameters when setting ALIAS_FILE.  For example:
1798
1799	define(`ALIAS_FILE', `ldap:-k (&(objectClass=mailGroup)(mail=%0)) -v mgrpRFC822MailMember')
1800
1801----
1802Maps
1803----
1804
1805FEATURE()'s which take an optional map definition argument (e.g., access,
1806mailertable, virtusertable, etc.) can instead take the special keyword
1807`LDAP', e.g.:
1808
1809	FEATURE(`access_db', `LDAP')
1810	FEATURE(`virtusertable', `LDAP')
1811
1812When this keyword is given, that map will use LDAP lookups consisting of
1813the objectClass sendmailMTAClassObject, the attribute sendmailMTAMapName
1814with the map name, a search attribute of sendmailMTAKey, and the value
1815attribute sendmailMTAMapValue.
1816
1817The values for sendmailMTAMapName are:
1818
1819	FEATURE()		sendmailMTAMapName
1820	---------		------------------
1821	access_db		access
1822	authinfo		authinfo
1823	bitdomain		bitdomain
1824	domaintable		domain
1825	genericstable		generics
1826	mailertable		mailer
1827	uucpdomain		uucpdomain
1828	virtusertable		virtuser
1829
1830For example, FEATURE(`mailertable', `LDAP') would use the map definition:
1831
1832	Kmailertable ldap -k (&(objectClass=sendmailMTAMapObject)
1833			       (sendmailMTAMapName=mailer)
1834			       (|(sendmailMTACluster=${sendmailMTACluster})
1835				 (sendmailMTAHost=$j))
1836			       (sendmailMTAKey=%0))
1837			  -1 -v sendmailMTAMapValue,sendmailMTAMapSearch:FILTER:sendmailMTAMapObject,sendmailMTAMapURL:URL:sendmailMTAMapObject
1838
1839An example LDAP LDIF entry using this map might be:
1840
1841	dn: sendmailMTAMapName=mailer, dc=sendmail, dc=org
1842	objectClass: sendmailMTA
1843	objectClass: sendmailMTAMap
1844	sendmailMTACluster: Servers
1845	sendmailMTAMapName: mailer
1846
1847	dn: sendmailMTAKey=example.com, sendmailMTAMapName=mailer, dc=sendmail, dc=org
1848	objectClass: sendmailMTA
1849	objectClass: sendmailMTAMap
1850	objectClass: sendmailMTAMapObject
1851	sendmailMTAMapName: mailer
1852	sendmailMTACluster: Servers
1853	sendmailMTAKey: example.com
1854	sendmailMTAMapValue: relay:[smtp.example.com]
1855
1856CAUTION: If your LDAP database contains the record above and *ALSO* a host
1857specific record such as:
1858
1859	dn: sendmailMTAKey=example.com@etrn, sendmailMTAMapName=mailer, dc=sendmail, dc=org
1860	objectClass: sendmailMTA
1861	objectClass: sendmailMTAMap
1862	objectClass: sendmailMTAMapObject
1863	sendmailMTAMapName: mailer
1864	sendmailMTAHost: etrn.sendmail.org
1865	sendmailMTAKey: example.com
1866	sendmailMTAMapValue: relay:[mx.example.com]
1867
1868then these entries will give unexpected results.  When the lookup is done
1869on etrn.sendmail.org, the effect is that there is *NO* match at all as maps
1870require a single match.  Since the host etrn.sendmail.org is also in the
1871Servers cluster, LDAP would return two answers for the example.com map key
1872in which case sendmail would treat this as no match at all.
1873
1874If you prefer not to use the default LDAP schema for your maps, you can
1875specify the map parameters when using the FEATURE().  For example:
1876
1877	FEATURE(`access_db', `ldap:-1 -k (&(objectClass=mapDatabase)(key=%0)) -v value')
1878
1879-------
1880Classes
1881-------
1882
1883Normally, classes can be filled via files or programs.  As of 8.12, they
1884can also be filled via map lookups using a new syntax:
1885
1886	F{ClassName}mapkey@mapclass:mapspec
1887
1888mapkey is optional and if not provided the map key will be empty.  This can
1889be used with LDAP to read classes from LDAP.  Note that the lookup is only
1890done when sendmail is initially started.  Use the special value `@LDAP' to
1891use the default LDAP schema.  For example:
1892
1893	RELAY_DOMAIN_FILE(`@LDAP')
1894
1895would put all of the attribute sendmailMTAClassValue values of LDAP records
1896with objectClass sendmailMTAClass and an attribute sendmailMTAClassName of
1897'R' into class $={R}.  In other words, it is equivalent to the LDAP map
1898specification:
1899
1900	F{R}@ldap:-k (&(objectClass=sendmailMTAClass)
1901		       (sendmailMTAClassName=R)
1902		       (|(sendmailMTACluster=${sendmailMTACluster})
1903			 (sendmailMTAHost=$j)))
1904		  -v sendmailMTAClassValue,sendmailMTAClassSearch:FILTER:sendmailMTAClass,sendmailMTAClassURL:URL:sendmailMTAClass
1905
1906NOTE: The macros shown above ${sendmailMTACluster} and $j are not actually
1907used when the binary expands the `@LDAP' token as class declarations are
1908not actually macro-expanded when read from the sendmail.cf file.
1909
1910This can be used with class related commands such as RELAY_DOMAIN_FILE(),
1911MASQUERADE_DOMAIN_FILE(), etc:
1912
1913	Command				sendmailMTAClassName
1914	-------				--------------------
1915	CANONIFY_DOMAIN_FILE()		Canonify
1916	EXPOSED_USER_FILE()		E
1917	GENERICS_DOMAIN_FILE()		G
1918	LDAPROUTE_DOMAIN_FILE()		LDAPRoute
1919	LDAPROUTE_EQUIVALENT_FILE()	LDAPRouteEquiv
1920	LOCAL_USER_FILE()		L
1921	MASQUERADE_DOMAIN_FILE()	M
1922	MASQUERADE_EXCEPTION_FILE()	N
1923	RELAY_DOMAIN_FILE()		R
1924	VIRTUSER_DOMAIN_FILE()		VirtHost
1925
1926You can also add your own as any 'F'ile class of the form:
1927
1928	F{ClassName}@LDAP
1929	  ^^^^^^^^^
1930will use "ClassName" for the sendmailMTAClassName.
1931
1932An example LDAP LDIF entry would look like:
1933
1934	dn: sendmailMTAClassName=R, dc=sendmail, dc=org
1935	objectClass: sendmailMTA
1936	objectClass: sendmailMTAClass
1937	sendmailMTACluster: Servers
1938	sendmailMTAClassName: R
1939	sendmailMTAClassValue: sendmail.org
1940	sendmailMTAClassValue: example.com
1941	sendmailMTAClassValue: 10.56.23
1942
1943CAUTION: If your LDAP database contains the record above and *ALSO* a host
1944specific record such as:
1945
1946	dn: sendmailMTAClassName=R@etrn.sendmail.org, dc=sendmail, dc=org
1947	objectClass: sendmailMTA
1948	objectClass: sendmailMTAClass
1949	sendmailMTAHost: etrn.sendmail.org
1950	sendmailMTAClassName: R
1951	sendmailMTAClassValue: example.com
1952
1953the result will be similar to the aliases caution above.  When the lookup
1954is done on etrn.sendmail.org, $={R} would contain all of the entries (from
1955both the cluster match and the host match).  In other words, the effective
1956is additive.
1957
1958If you prefer not to use the default LDAP schema for your classes, you can
1959specify the map parameters when using the class command.  For example:
1960
1961	VIRTUSER_DOMAIN_FILE(`@ldap:-k (&(objectClass=virtHosts)(host=*)) -v host')
1962
1963Remember, macros can not be used in a class declaration as the binary does
1964not expand them.
1965
1966
1967+--------------+
1968| LDAP ROUTING |
1969+--------------+
1970
1971FEATURE(`ldap_routing') can be used to implement the IETF Internet Draft
1972LDAP Schema for Intranet Mail Routing
1973(draft-lachman-laser-ldap-mail-routing-01).  This feature enables
1974LDAP-based rerouting of a particular address to either a different host
1975or a different address.  The LDAP lookup is first attempted on the full
1976address (e.g., user@example.com) and then on the domain portion
1977(e.g., @example.com).  Be sure to setup your domain for LDAP routing using
1978LDAPROUTE_DOMAIN(), e.g.:
1979
1980	LDAPROUTE_DOMAIN(`example.com')
1981
1982Additionally, you can specify equivalent domains for LDAP routing using
1983LDAPROUTE_EQUIVALENT() and LDAPROUTE_EQUIVALENT_FILE().  'Equivalent'
1984hostnames are mapped to $M (the masqueraded hostname for the server) before
1985the LDAP query.  For example, if the mail is addressed to
1986user@host1.example.com, normally the LDAP lookup would only be done for
1987'user@host1.example.com' and '@host1.example.com'.   However, if
1988LDAPROUTE_EQUIVALENT(`host1.example.com') is used, the lookups would also be
1989done on 'user@example.com' and '@example.com' after attempting the
1990host1.example.com lookups.
1991
1992By default, the feature will use the schemas as specified in the draft
1993and will not reject addresses not found by the LDAP lookup.  However,
1994this behavior can be changed by giving additional arguments to the FEATURE()
1995command:
1996
1997 FEATURE(`ldap_routing', <mailHost>, <mailRoutingAddress>, <bounce>,
1998		 <detail>, <nodomain>, <tempfail>)
1999
2000where <mailHost> is a map definition describing how to lookup an alternative
2001mail host for a particular address; <mailRoutingAddress> is a map definition
2002describing how to lookup an alternative address for a particular address;
2003the <bounce> argument, if present and not the word "passthru", dictates
2004that mail should be bounced if neither a mailHost nor mailRoutingAddress
2005is found, if set to "sendertoo", the sender will be rejected if not
2006found in LDAP; and <detail> indicates what actions to take if the address
2007contains +detail information -- `strip' tries the lookup with the +detail
2008and if no matches are found, strips the +detail and tries the lookup again;
2009`preserve', does the same as `strip' but if a mailRoutingAddress match is
2010found, the +detail information is copied to the new address; the <nodomain>
2011argument, if present, will prevent the @domain lookup if the full
2012address is not found in LDAP; the <tempfail> argument, if set to
2013"tempfail", instructs the rules to give an SMTP 4XX temporary
2014error if the LDAP server gives the MTA a temporary failure, or if set to
2015"queue" (the default), the MTA will locally queue the mail.
2016
2017The default <mailHost> map definition is:
2018
2019	ldap -1 -T<TMPF> -v mailHost -k (&(objectClass=inetLocalMailRecipient)
2020				 (mailLocalAddress=%0))
2021
2022The default <mailRoutingAddress> map definition is:
2023
2024	ldap -1 -T<TMPF> -v mailRoutingAddress
2025			 -k (&(objectClass=inetLocalMailRecipient)
2026			      (mailLocalAddress=%0))
2027
2028Note that neither includes the LDAP server hostname (-h server) or base DN
2029(-b o=org,c=COUNTRY), both necessary for LDAP queries.  It is presumed that
2030your .mc file contains a setting for the confLDAP_DEFAULT_SPEC option with
2031these settings.  If this is not the case, the map definitions should be
2032changed as described above.  The "-T<TMPF>" is required in any user
2033specified map definition to catch temporary errors.
2034
2035The following possibilities exist as a result of an LDAP lookup on an
2036address:
2037
2038	mailHost is	mailRoutingAddress is	Results in
2039	-----------	---------------------	----------
2040	set to a	set			mail delivered to
2041	"local" host				mailRoutingAddress
2042
2043	set to a	not set			delivered to
2044	"local" host				original address
2045
2046	set to a	set			mailRoutingAddress
2047	remote host				relayed to mailHost
2048
2049	set to a	not set			original address
2050	remote host				relayed to mailHost
2051
2052	not set		set			mail delivered to
2053						mailRoutingAddress
2054
2055	not set		not set			delivered to
2056						original address *OR*
2057						bounced as unknown user
2058
2059The term "local" host above means the host specified is in class {w}.  If
2060the result would mean sending the mail to a different host, that host is
2061looked up in the mailertable before delivery.
2062
2063Note that the last case depends on whether the third argument is given
2064to the FEATURE() command.  The default is to deliver the message to the
2065original address.
2066
2067The LDAP entries should be set up with an objectClass of
2068inetLocalMailRecipient and the address be listed in a mailLocalAddress
2069attribute.  If present, there must be only one mailHost attribute and it
2070must contain a fully qualified host name as its value.  Similarly, if
2071present, there must be only one mailRoutingAddress attribute and it must
2072contain an RFC 822 compliant address.  Some example LDAP records (in LDIF
2073format):
2074
2075	dn: uid=tom, o=example.com, c=US
2076	objectClass: inetLocalMailRecipient
2077	mailLocalAddress: tom@example.com
2078	mailRoutingAddress: thomas@mailhost.example.com
2079
2080This would deliver mail for tom@example.com to thomas@mailhost.example.com.
2081
2082	dn: uid=dick, o=example.com, c=US
2083	objectClass: inetLocalMailRecipient
2084	mailLocalAddress: dick@example.com
2085	mailHost: eng.example.com
2086
2087This would relay mail for dick@example.com to the same address but redirect
2088the mail to MX records listed for the host eng.example.com (unless the
2089mailertable overrides).
2090
2091	dn: uid=harry, o=example.com, c=US
2092	objectClass: inetLocalMailRecipient
2093	mailLocalAddress: harry@example.com
2094	mailHost: mktmail.example.com
2095	mailRoutingAddress: harry@mkt.example.com
2096
2097This would relay mail for harry@example.com to the MX records listed for
2098the host mktmail.example.com using the new address harry@mkt.example.com
2099when talking to that host.
2100
2101	dn: uid=virtual.example.com, o=example.com, c=US
2102	objectClass: inetLocalMailRecipient
2103	mailLocalAddress: @virtual.example.com
2104	mailHost: server.example.com
2105	mailRoutingAddress: virtual@example.com
2106
2107This would send all mail destined for any username @virtual.example.com to
2108the machine server.example.com's MX servers and deliver to the address
2109virtual@example.com on that relay machine.
2110
2111
2112+---------------------------------+
2113| ANTI-SPAM CONFIGURATION CONTROL |
2114+---------------------------------+
2115
2116The primary anti-spam features available in sendmail are:
2117
2118* Relaying is denied by default.
2119* Better checking on sender information.
2120* Access database.
2121* Header checks.
2122
2123Relaying (transmission of messages from a site outside your host (class
2124{w}) to another site except yours) is denied by default.  Note that this
2125changed in sendmail 8.9; previous versions allowed relaying by default.
2126If you really want to revert to the old behaviour, you will need to use
2127FEATURE(`promiscuous_relay').  You can allow certain domains to relay
2128through your server by adding their domain name or IP address to class
2129{R} using RELAY_DOMAIN() and RELAY_DOMAIN_FILE() or via the access database
2130(described below).  Note that IPv6 addresses must be prefaced with "IPv6:".
2131The file consists (like any other file based class) of entries listed on
2132separate lines, e.g.,
2133
2134	sendmail.org
2135	128.32
2136	IPv6:2002:c0a8:02c7
2137	IPv6:2002:c0a8:51d2::23f4
2138	host.mydomain.com
2139	[UNIX:localhost]
2140
2141Notice: the last entry allows relaying for connections via a UNIX
2142socket to the MTA/MSP.  This might be necessary if your configuration
2143doesn't allow relaying by other means in that case, e.g., by having
2144localhost.$m in class {R} (make sure $m is not just a top level
2145domain).
2146
2147If you use
2148
2149	FEATURE(`relay_entire_domain')
2150
2151then any host in any of your local domains (that is, class {m})
2152will be relayed (that is, you will accept mail either to or from any
2153host in your domain).
2154
2155You can also allow relaying based on the MX records of the host
2156portion of an incoming recipient address by using
2157
2158	FEATURE(`relay_based_on_MX')
2159
2160For example, if your server receives a recipient of user@domain.com
2161and domain.com lists your server in its MX records, the mail will be
2162accepted for relay to domain.com.  This feature may cause problems
2163if MX lookups for the recipient domain are slow or time out.  In that
2164case, mail will be temporarily rejected.  It is usually better to
2165maintain a list of hosts/domains for which the server acts as relay.
2166Note also that this feature will stop spammers from using your host
2167to relay spam but it will not stop outsiders from using your server
2168as a relay for their site (that is, they set up an MX record pointing
2169to your mail server, and you will relay mail addressed to them
2170without any prior arrangement).  Along the same lines,
2171
2172	FEATURE(`relay_local_from')
2173
2174will allow relaying if the sender specifies a return path (i.e.
2175MAIL FROM:<user@domain>) domain which is a local domain.  This is a
2176dangerous feature as it will allow spammers to spam using your mail
2177server by simply specifying a return address of user@your.domain.com.
2178It should not be used unless absolutely necessary.
2179A slightly better solution is
2180
2181	FEATURE(`relay_mail_from')
2182
2183which allows relaying if the mail sender is listed as RELAY in the
2184access map.  If an optional argument `domain' (this is the literal
2185word `domain', not a placeholder) is given, the domain portion of
2186the mail sender is also checked to allowing relaying.  This option
2187only works together with the tag From: for the LHS of the access
2188map entries.  This feature allows spammers to abuse your mail server
2189by specifying a return address that you enabled in your access file.
2190This may be harder to figure out for spammers, but it should not
2191be used unless necessary.  Instead use STARTTLS to
2192allow relaying for roaming users.
2193
2194
2195If source routing is used in the recipient address (e.g.,
2196RCPT TO:<user%site.com@othersite.com>), sendmail will check
2197user@site.com for relaying if othersite.com is an allowed relay host
2198in either class {R}, class {m} if FEATURE(`relay_entire_domain') is used,
2199or the access database if FEATURE(`access_db') is used.  To prevent
2200the address from being stripped down, use:
2201
2202	FEATURE(`loose_relay_check')
2203
2204If you think you need to use this feature, you probably do not.  This
2205should only be used for sites which have no control over the addresses
2206that they provide a gateway for.  Use this FEATURE with caution as it
2207can allow spammers to relay through your server if not setup properly.
2208
2209NOTICE: It is possible to relay mail through a system which the anti-relay
2210rules do not prevent: the case of a system that does use FEATURE(`nouucp',
2211`nospecial') (system A) and relays local messages to a mail hub (e.g., via
2212LOCAL_RELAY or LUSER_RELAY) (system B).  If system B doesn't use
2213FEATURE(`nouucp') at all, addresses of the form
2214<example.net!user@local.host> would be relayed to <user@example.net>.
2215System A doesn't recognize `!' as an address separator and therefore
2216forwards it to the mail hub which in turns relays it because it came from
2217a trusted local host.  So if a mailserver allows UUCP (bang-format)
2218addresses, all systems from which it allows relaying should do the same
2219or reject those addresses.
2220
2221As of 8.9, sendmail will refuse mail if the MAIL FROM: parameter has
2222an unresolvable domain (i.e., one that DNS, your local name service,
2223or special case rules in ruleset 3 cannot locate).  This also applies
2224to addresses that use domain literals, e.g., <user@[1.2.3.4]>, if the
2225IP address can't be mapped to a host name.  If you want to continue
2226to accept such domains, e.g., because you are inside a firewall that
2227has only a limited view of the Internet host name space (note that you
2228will not be able to return mail to them unless you have some "smart
2229host" forwarder), use
2230
2231	FEATURE(`accept_unresolvable_domains')
2232
2233Alternatively, you can allow specific addresses by adding them to
2234the access map, e.g.,
2235
2236	From:unresolvable.domain	OK
2237	From:[1.2.3.4]			OK
2238	From:[1.2.4]			OK
2239
2240Notice: domains which are temporarily unresolvable are (temporarily)
2241rejected with a 451 reply code.  If those domains should be accepted
2242(which is discouraged) then you can use
2243
2244	LOCAL_CONFIG
2245	C{ResOk}TEMP
2246
2247sendmail will also refuse mail if the MAIL FROM: parameter is not
2248fully qualified (i.e., contains a domain as well as a user).  If you
2249want to continue to accept such senders, use
2250
2251	FEATURE(`accept_unqualified_senders')
2252
2253Setting the DaemonPortOptions modifier 'u' overrides the default behavior,
2254i.e., unqualified addresses are accepted even without this FEATURE.  If
2255this FEATURE is not used, the DaemonPortOptions modifier 'f' can be used
2256to enforce fully qualified domain names.
2257
2258An ``access'' database can be created to accept or reject mail from
2259selected domains.  For example, you may choose to reject all mail
2260originating from known spammers.  To enable such a database, use
2261
2262	FEATURE(`access_db')
2263
2264Notice: the access database is applied to the envelope addresses
2265and the connection information, not to the header.
2266
2267The FEATURE macro can accept as second parameter the key file
2268definition for the database; for example
2269
2270	FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access_map')
2271
2272Notice: If a second argument is specified it must contain the option
2273`-T<TMPF>' as shown above.  The optional parameters may be
2274
2275	`skip'			enables SKIP as value part (see below).
2276	`lookupdotdomain'	another way to enable the feature of the
2277				same name (see above).
2278	`relaytofulladdress'	enable entries of the form
2279				To:user@example.com	RELAY
2280				to allow relaying to just a specific
2281				e-mail address instead of an entire domain.
2282
2283Remember, since /etc/mail/access is a database, after creating the text
2284file as described below, you must use makemap to create the database
2285map.  For example:
2286
2287	makemap hash /etc/mail/access < /etc/mail/access
2288
2289The table itself uses e-mail addresses, domain names, and network
2290numbers as keys.  Note that IPv6 addresses must be prefaced with "IPv6:".
2291For example,
2292
2293	From:spammer@aol.com			REJECT
2294	From:cyberspammer.com			REJECT
2295	Connect:cyberspammer.com		REJECT
2296	Connect:TLD				REJECT
2297	Connect:192.168.212			REJECT
2298	Connect:IPv6:2002:c0a8:02c7		RELAY
2299	Connect:IPv6:2002:c0a8:51d2::23f4	REJECT
2300
2301would refuse mail from spammer@aol.com, any user from cyberspammer.com
2302(or any host within the cyberspammer.com domain), any host in the entire
2303top level domain TLD, 192.168.212.* network, and the IPv6 address
23042002:c0a8:51d2::23f4.  It would allow relay for the IPv6 network
23052002:c0a8:02c7::/48.
2306
2307Entries in the access map should be tagged according to their type.
2308Three tags are available:
2309
2310	Connect:	connection information (${client_addr}, ${client_name})
2311	From:		envelope sender
2312	To:		envelope recipient
2313
2314Notice: untagged entries are deprecated.
2315
2316If the required item is looked up in a map, it will be tried first
2317with the corresponding tag in front, then (as fallback to enable
2318backward compatibility) without any tag, unless the specific feature
2319requires a tag.  For example,
2320
2321	From:spammer@some.dom	REJECT
2322	To:friend.domain	RELAY
2323	Connect:friend.domain	OK
2324	Connect:from.domain	RELAY
2325	From:good@another.dom	OK
2326	From:another.dom	REJECT
2327
2328This would deny mails from spammer@some.dom but you could still
2329send mail to that address even if FEATURE(`blacklist_recipients')
2330is enabled.  Your system will allow relaying to friend.domain, but
2331not from it (unless enabled by other means).  Connections from that
2332domain will be allowed even if it ends up in one of the DNS based
2333rejection lists.  Relaying is enabled from from.domain but not to
2334it (since relaying is based on the connection information for
2335outgoing relaying, the tag Connect: must be used; for incoming
2336relaying, which is based on the recipient address, To: must be
2337used).  The last two entries allow mails from good@another.dom but
2338reject mail from all other addresses with another.dom as domain
2339part.
2340
2341
2342The value part of the map can contain:
2343
2344	OK		Accept mail even if other rules in the running
2345			ruleset would reject it, for example, if the domain
2346			name is unresolvable.  "Accept" does not mean
2347			"relay", but at most acceptance for local
2348			recipients.  That is, OK allows less than RELAY.
2349	RELAY		Accept mail addressed to the indicated domain
2350			(or address if `relaytofulladdress' is set) or
2351			received from the indicated domain for relaying
2352			through your SMTP server.  RELAY also serves as
2353			an implicit OK for the other checks.
2354	REJECT		Reject the sender or recipient with a general
2355			purpose message.
2356	DISCARD		Discard the message completely using the
2357			$#discard mailer.  If it is used in check_compat,
2358			it affects only the designated recipient, not
2359			the whole message as it does in all other cases.
2360			This should only be used if really necessary.
2361	SKIP		This can only be used for host/domain names
2362			and IP addresses/nets.  It will abort the current
2363			search for this entry without accepting or rejecting
2364			it but causing the default action.
2365	### any text	where ### is an RFC 821 compliant error code and
2366			"any text" is a message to return for the command.
2367			The entire string should be quoted to avoid
2368			surprises:
2369
2370				"### any text"
2371
2372			Otherwise sendmail formats the text as email
2373			addresses, e.g., it may remove spaces.
2374			This type is deprecated, use one of the two
2375			ERROR:  entries below instead.
2376	ERROR:### any text
2377			as above, but useful to mark error messages as such.
2378			If quotes need to be used to avoid modifications
2379			(see above), they should be placed like this:
2380
2381				ERROR:"### any text"
2382
2383	ERROR:D.S.N:### any text
2384			where D.S.N is an RFC 1893 compliant error code
2385			and the rest as above.  If quotes need to be used
2386			to avoid modifications, they should be placed
2387			like this:
2388
2389				ERROR:D.S.N:"### any text"
2390
2391	QUARANTINE:any text
2392			Quarantine the message using the given text as the
2393			quarantining reason.
2394
2395For example:
2396
2397	From:cyberspammer.com	ERROR:"550 We don't accept mail from spammers"
2398	From:okay.cyberspammer.com	OK
2399	Connect:sendmail.org		RELAY
2400	To:sendmail.org			RELAY
2401	Connect:128.32			RELAY
2402	Connect:128.32.2		SKIP
2403	Connect:IPv6:1:2:3:4:5:6:7	RELAY
2404	Connect:suspicious.example.com	QUARANTINE:Mail from suspicious host
2405	Connect:[127.0.0.3]		OK
2406	Connect:[IPv6:1:2:3:4:5:6:7:8]	OK
2407
2408would accept mail from okay.cyberspammer.com, but would reject mail
2409from all other hosts at cyberspammer.com with the indicated message.
2410It would allow relaying mail from and to any hosts in the sendmail.org
2411domain, and allow relaying from the IPv6 1:2:3:4:5:6:7:* network
2412and from the 128.32.*.* network except for the 128.32.2.* network,
2413which shows how SKIP is useful to exempt subnets/subdomains.  The
2414last two entries are for checks against ${client_name} if the IP
2415address doesn't resolve to a hostname (or is considered as "may be
2416forged").  That is, using square brackets means these are host
2417names, not network numbers.
2418
2419Warning: if you change the RFC 821 compliant error code from the default
2420value of 550, then you should probably also change the RFC 1893 compliant
2421error code to match it.  For example, if you use
2422
2423	To:user@example.com	ERROR:450 mailbox full
2424
2425the error returned would be "450 5.0.0 mailbox full" which is wrong.
2426Use "ERROR:4.2.2:450 mailbox full" instead.
2427
2428Note, UUCP users may need to add hostname.UUCP to the access database
2429or class {R}.
2430
2431If you also use:
2432
2433	FEATURE(`relay_hosts_only')
2434
2435then the above example will allow relaying for sendmail.org, but not
2436hosts within the sendmail.org domain.  Note that this will also require
2437hosts listed in class {R} to be fully qualified host names.
2438
2439You can also use the access database to block sender addresses based on
2440the username portion of the address.  For example:
2441
2442	From:FREE.STEALTH.MAILER@	ERROR:550 Spam not accepted
2443
2444Note that you must include the @ after the username to signify that
2445this database entry is for checking only the username portion of the
2446sender address.
2447
2448If you use:
2449
2450	FEATURE(`blacklist_recipients')
2451
2452then you can add entries to the map for local users, hosts in your
2453domains, or addresses in your domain which should not receive mail:
2454
2455	To:badlocaluser@	ERROR:550 Mailbox disabled for badlocaluser
2456	To:host.my.TLD		ERROR:550 That host does not accept mail
2457	To:user@other.my.TLD	ERROR:550 Mailbox disabled for this recipient
2458
2459This would prevent a recipient of badlocaluser in any of the local
2460domains (class {w}), any user at host.my.TLD, and the single address
2461user@other.my.TLD from receiving mail.  Please note: a local username
2462must be now tagged with an @ (this is consistent with the check of
2463the sender address, and hence it is possible to distinguish between
2464hostnames and usernames).  Enabling this feature will keep you from
2465sending mails to all addresses that have an error message or REJECT
2466as value part in the access map.  Taking the example from above:
2467
2468	spammer@aol.com		REJECT
2469	cyberspammer.com	REJECT
2470
2471Mail can't be sent to spammer@aol.com or anyone at cyberspammer.com.
2472That's why tagged entries should be used.
2473
2474There are several DNS based blacklists which can be found by
2475querying a search engine.  These are databases of spammers
2476maintained in DNS.  To use such a database, specify
2477
2478	FEATURE(`dnsbl', `dnsbl.example.com')
2479
2480This will cause sendmail to reject mail from any site listed in the
2481DNS based blacklist.  You must select a DNS based blacklist domain
2482to check by specifying an argument to the FEATURE.  The default
2483error message is
2484
2485	Rejected: IP-ADDRESS listed at SERVER
2486
2487where IP-ADDRESS and SERVER are replaced by the appropriate
2488information.  A second argument can be used to specify a different
2489text or action.  For example,
2490
2491	FEATURE(`dnsbl', `dnsbl.example.com', `quarantine')
2492
2493would quarantine the message if the client IP address is listed
2494at `dnsbl.example.com'.
2495
2496By default, temporary lookup failures are ignored
2497and hence cause the connection not to be rejected by the DNS based
2498rejection list.  This behavior can be changed by specifying a third
2499argument, which must be either `t' or a full error message.  For
2500example:
2501
2502	FEATURE(`dnsbl', `dnsbl.example.com', `',
2503	`"451 Temporary lookup failure for " $&{client_addr} " in dnsbl.example.com"')
2504
2505If `t' is used, the error message is:
2506
2507	451 Temporary lookup failure of IP-ADDRESS at SERVER
2508
2509where IP-ADDRESS and SERVER are replaced by the appropriate
2510information.
2511
2512This FEATURE can be included several times to query different
2513DNS based rejection lists.
2514
2515Notice: to avoid checking your own local domains against those
2516blacklists, use the access_db feature and add:
2517
2518	Connect:10.1		OK
2519	Connect:127.0.0.1	RELAY
2520
2521to the access map, where 10.1 is your local network.  You may
2522want to use "RELAY" instead of "OK" to allow also relaying
2523instead of just disabling the DNS lookups in the blacklists.
2524
2525
2526The features described above make use of the check_relay, check_mail,
2527and check_rcpt rulesets.  Note that check_relay checks the SMTP
2528client hostname and IP address when the connection is made to your
2529server.  It does not check if a mail message is being relayed to
2530another server.  That check is done in check_rcpt.  If you wish to
2531include your own checks, you can put your checks in the rulesets
2532Local_check_relay, Local_check_mail, and Local_check_rcpt.  For
2533example if you wanted to block senders with all numeric usernames
2534(i.e. 2312343@bigisp.com), you would use Local_check_mail and the
2535regex map:
2536
2537	LOCAL_CONFIG
2538	Kallnumbers regex -a@MATCH ^[0-9]+$
2539
2540	LOCAL_RULESETS
2541	SLocal_check_mail
2542	# check address against various regex checks
2543	R$*				$: $>Parse0 $>3 $1
2544	R$+ < @ bigisp.com. > $*	$: $(allnumbers $1 $)
2545	R@MATCH				$#error $: 553 Header Error
2546
2547These rules are called with the original arguments of the corresponding
2548check_* ruleset.  If the local ruleset returns $#OK, no further checking
2549is done by the features described above and the mail is accepted.  If
2550the local ruleset resolves to a mailer (such as $#error or $#discard),
2551the appropriate action is taken.  Other results starting with $# are
2552interpreted by sendmail and may lead to unspecified behavior.  Note: do
2553NOT create a mailer with the name OK.  Return values that do not start
2554with $# are ignored, i.e., normal processing continues.
2555
2556Delay all checks
2557----------------
2558
2559By using FEATURE(`delay_checks') the rulesets check_mail and check_relay
2560will not be called when a client connects or issues a MAIL command,
2561respectively.  Instead, those rulesets will be called by the check_rcpt
2562ruleset; they will be skipped if a sender has been authenticated using
2563a "trusted" mechanism, i.e., one that is defined via TRUST_AUTH_MECH().
2564If check_mail returns an error then the RCPT TO command will be rejected
2565with that error.  If it returns some other result starting with $# then
2566check_relay will be skipped.  If the sender address (or a part of it) is
2567listed in the access map and it has a RHS of OK or RELAY, then check_relay
2568will be skipped.  This has an interesting side effect: if your domain is
2569my.domain and you have
2570
2571	my.domain	RELAY
2572
2573in the access map, then any e-mail with a sender address of
2574<user@my.domain> will not be rejected by check_relay even though
2575it would match the hostname or IP address.  This allows spammers
2576to get around DNS based blacklist by faking the sender address.  To
2577avoid this problem you have to use tagged entries:
2578
2579	To:my.domain		RELAY
2580	Connect:my.domain	RELAY
2581
2582if you need those entries at all (class {R} may take care of them).
2583
2584FEATURE(`delay_checks') can take an optional argument:
2585
2586	FEATURE(`delay_checks', `friend')
2587		 enables spamfriend test
2588	FEATURE(`delay_checks', `hater')
2589		 enables spamhater test
2590
2591If such an argument is given, the recipient will be looked up in the
2592access map (using the tag Spam:).  If the argument is `friend', then
2593the default behavior is to apply the other rulesets and make a SPAM
2594friend the exception.  The rulesets check_mail and check_relay will be
2595skipped only if the recipient address is found and has RHS FRIEND.  If
2596the argument is `hater', then the default behavior is to skip the rulesets
2597check_mail and check_relay and make a SPAM hater the exception.  The
2598other two rulesets will be applied only if the recipient address is
2599found and has RHS HATER.
2600
2601This allows for simple exceptions from the tests, e.g., by activating
2602the friend option and having
2603
2604	Spam:abuse@	FRIEND
2605
2606in the access map, mail to abuse@localdomain will get through (where
2607"localdomain" is any domain in class {w}).  It is also possible to
2608specify a full address or an address with +detail:
2609
2610	Spam:abuse@my.domain	FRIEND
2611	Spam:me+abuse@		FRIEND
2612	Spam:spam.domain	FRIEND
2613
2614Note: The required tag has been changed in 8.12 from To: to Spam:.
2615This change is incompatible to previous versions.  However, you can
2616(for now) simply add the new entries to the access map, the old
2617ones will be ignored.  As soon as you removed the old entries from
2618the access map, specify a third parameter (`n') to this feature and
2619the backward compatibility rules will not be in the generated .cf
2620file.
2621
2622Header Checks
2623-------------
2624
2625You can also reject mail on the basis of the contents of headers.
2626This is done by adding a ruleset call to the 'H' header definition command
2627in sendmail.cf.  For example, this can be used to check the validity of
2628a Message-ID: header:
2629
2630	LOCAL_CONFIG
2631	HMessage-Id: $>CheckMessageId
2632
2633	LOCAL_RULESETS
2634	SCheckMessageId
2635	R< $+ @ $+ >		$@ OK
2636	R$*			$#error $: 553 Header Error
2637
2638The alternative format:
2639
2640	HSubject: $>+CheckSubject
2641
2642that is, $>+ instead of $>, gives the full Subject: header including
2643comments to the ruleset (comments in parentheses () are stripped
2644by default).
2645
2646A default ruleset for headers which don't have a specific ruleset
2647defined for them can be given by:
2648
2649	H*: $>CheckHdr
2650
2651Notice:
26521. All rules act on tokens as explained in doc/op/op.{me,ps,txt}.
2653That may cause problems with simple header checks due to the
2654tokenization.  It might be simpler to use a regex map and apply it
2655to $&{currHeader}.
26562. There are no default rulesets coming with this distribution of
2657sendmail.  You can write your own or search the WWW for examples.
26583. When using a default ruleset for headers, the name of the header
2659currently being checked can be found in the $&{hdr_name} macro.
2660
2661After all of the headers are read, the check_eoh ruleset will be called for
2662any final header-related checks.  The ruleset is called with the number of
2663headers and the size of all of the headers in bytes separated by $|.  One
2664example usage is to reject messages which do not have a Message-Id:
2665header.  However, the Message-Id: header is *NOT* a required header and is
2666not a guaranteed spam indicator.  This ruleset is an example and should
2667probably not be used in production.
2668
2669	LOCAL_CONFIG
2670	Kstorage macro
2671	HMessage-Id: $>CheckMessageId
2672
2673	LOCAL_RULESETS
2674	SCheckMessageId
2675	# Record the presence of the header
2676	R$*			$: $(storage {MessageIdCheck} $@ OK $) $1
2677	R< $+ @ $+ >		$@ OK
2678	R$*			$#error $: 553 Header Error
2679
2680	Scheck_eoh
2681	# Check the macro
2682	R$*			$: < $&{MessageIdCheck} >
2683	# Clear the macro for the next message
2684	R$*			$: $(storage {MessageIdCheck} $) $1
2685	# Has a Message-Id: header
2686	R< $+ >			$@ OK
2687	# Allow missing Message-Id: from local mail
2688	R$*			$: < $&{client_name} >
2689	R< >			$@ OK
2690	R< $=w >		$@ OK
2691	# Otherwise, reject the mail
2692	R$*			$#error $: 553 Header Error
2693
2694
2695+--------------------+
2696| CONNECTION CONTROL |
2697+--------------------+
2698
2699The features ratecontrol and conncontrol allow to establish connection
2700limits per client IP address or net.  These features can limit the
2701rate of connections (connections per time unit) or the number of
2702incoming SMTP connections, respectively.  If enabled, appropriate
2703rulesets are called at the end of check_relay, i.e., after DNS
2704blacklists and generic access_db operations.  The features require
2705FEATURE(`access_db') to be listed earlier in the mc file.
2706
2707Note: FEATURE(`delay_checks') delays those connection control checks
2708after a recipient address has been received, hence making these
2709connection control features less useful.  To run the checks as early
2710as possible, specify the parameter `nodelay', e.g.,
2711
2712	FEATURE(`ratecontrol', `nodelay')
2713
2714In that case, FEATURE(`delay_checks') has no effect on connection
2715control (and it must be specified earlier in the mc file).
2716
2717An optional second argument `terminate' specifies whether the
2718rulesets should return the error code 421 which will cause
2719sendmail to terminate the session with that error if it is
2720returned from check_relay, i.e., not delayed as explained in
2721the previous paragraph.  Example:
2722
2723	FEATURE(`ratecontrol', `nodelay', `terminate')
2724
2725
2726+----------+
2727| STARTTLS |
2728+----------+
2729
2730In this text, cert will be used as an abbreviation for X.509 certificate,
2731DN (CN) is the distinguished (common) name of a cert, and CA is a
2732certification authority, which signs (issues) certs.
2733
2734For STARTTLS to be offered by sendmail you need to set at least
2735these variables (the file names and paths are just examples):
2736
2737	define(`confCACERT_PATH', `/etc/mail/certs/')
2738	define(`confCACERT', `/etc/mail/certs/CA.cert.pem')
2739	define(`confSERVER_CERT', `/etc/mail/certs/my.cert.pem')
2740	define(`confSERVER_KEY', `/etc/mail/certs/my.key.pem')
2741
2742On systems which do not have the compile flag HASURANDOM set (see
2743sendmail/README) you also must set confRAND_FILE.
2744
2745See doc/op/op.{me,ps,txt} for more information about these options,
2746especially the sections ``Certificates for STARTTLS'' and ``PRNG for
2747STARTTLS''.
2748
2749Macros related to STARTTLS are:
2750
2751${cert_issuer} holds the DN of the CA (the cert issuer).
2752${cert_subject} holds the DN of the cert (called the cert subject).
2753${cn_issuer} holds the CN of the CA (the cert issuer).
2754${cn_subject} holds the CN of the cert (called the cert subject).
2755${tls_version} the TLS/SSL version used for the connection, e.g., TLSv1,
2756	TLSv1/SSLv3, SSLv3, SSLv2.
2757${cipher} the cipher used for the connection, e.g., EDH-DSS-DES-CBC3-SHA,
2758	EDH-RSA-DES-CBC-SHA, DES-CBC-MD5, DES-CBC3-SHA.
2759${cipher_bits} the keylength (in bits) of the symmetric encryption algorithm
2760	used for the connection.
2761${verify} holds the result of the verification of the presented cert.
2762	Possible values are:
2763	OK	 verification succeeded.
2764	NO	 no cert presented.
2765	NOT	 no cert requested.
2766	FAIL	 cert presented but could not be verified,
2767		 e.g., the cert of the signing CA is missing.
2768	NONE	 STARTTLS has not been performed.
2769	TEMP	 temporary error occurred.
2770	PROTOCOL protocol error occurred (SMTP level).
2771	SOFTWARE STARTTLS handshake failed.
2772${server_name} the name of the server of the current outgoing SMTP
2773	connection.
2774${server_addr} the address of the server of the current outgoing SMTP
2775	connection.
2776
2777Relaying
2778--------
2779
2780SMTP STARTTLS can allow relaying for remote SMTP clients which have
2781successfully authenticated themselves.  If the verification of the cert
2782failed (${verify} != OK), relaying is subject to the usual rules.
2783Otherwise the DN of the issuer is looked up in the access map using the
2784tag CERTISSUER.  If the resulting value is RELAY, relaying is allowed.
2785If it is SUBJECT, the DN of the cert subject is looked up next in the
2786access map using the tag CERTSUBJECT.  If the value is RELAY, relaying
2787is allowed.
2788
2789To make things a bit more flexible (or complicated), the values for
2790${cert_issuer} and ${cert_subject} can be optionally modified by regular
2791expressions defined in the m4 variables _CERT_REGEX_ISSUER_ and
2792_CERT_REGEX_SUBJECT_, respectively.  To avoid problems with those macros in
2793rulesets and map lookups, they are modified as follows: each non-printable
2794character and the characters '<', '>', '(', ')', '"', '+', ' ' are replaced
2795by their HEX value with a leading '+'.  For example:
2796
2797/C=US/ST=California/O=endmail.org/OU=private/CN=Darth Mail (Cert)/Email=
2798darth+cert@endmail.org
2799
2800is encoded as:
2801
2802/C=US/ST=California/O=endmail.org/OU=private/CN=
2803Darth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org
2804
2805(line breaks have been inserted for readability).
2806
2807The  macros  which are subject to this encoding are ${cert_subject},
2808${cert_issuer},  ${cn_subject},  and ${cn_issuer}.
2809
2810Examples:
2811
2812To allow relaying for everyone who can present a cert signed by
2813
2814/C=US/ST=California/O=endmail.org/OU=private/CN=
2815Darth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org
2816
2817simply use:
2818
2819CertIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN=
2820Darth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org	RELAY
2821
2822To allow relaying only for a subset of machines that have a cert signed by
2823
2824/C=US/ST=California/O=endmail.org/OU=private/CN=
2825Darth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org
2826
2827use:
2828
2829CertIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN=
2830Darth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org	SUBJECT
2831CertSubject:/C=US/ST=California/O=endmail.org/OU=private/CN=
2832DeathStar/Email=deathstar@endmail.org		RELAY
2833
2834Notes:
2835- line breaks have been inserted after "CN=" for readability,
2836  each tagged entry must be one (long) line in the access map.
2837- if OpenSSL 0.9.7 or newer is used then the "Email=" part of a DN
2838  is replaced by "emailAddress=".
2839
2840Of course it is also possible to write a simple ruleset that allows
2841relaying for everyone who can present a cert that can be verified, e.g.,
2842
2843LOCAL_RULESETS
2844SLocal_check_rcpt
2845R$*	$: $&{verify}
2846ROK	$# OK
2847
2848Allowing Connections
2849--------------------
2850
2851The rulesets tls_server, tls_client, and tls_rcpt are used to decide whether
2852an SMTP connection is accepted (or should continue).
2853
2854tls_server is called when sendmail acts as client after a STARTTLS command
2855(should) have been issued.  The parameter is the value of ${verify}.
2856
2857tls_client is called when sendmail acts as server, after a STARTTLS command
2858has been issued, and from check_mail.  The parameter is the value of
2859${verify} and STARTTLS or MAIL, respectively.
2860
2861Both rulesets behave the same.  If no access map is in use, the connection
2862will be accepted unless ${verify} is SOFTWARE, in which case the connection
2863is always aborted.  For tls_server/tls_client, ${client_name}/${server_name}
2864is looked up in the access map using the tag TLS_Srv/TLS_Clt, which is done
2865with the ruleset LookUpDomain.  If no entry is found, ${client_addr}
2866(${server_addr}) is looked up in the access map (same tag, ruleset
2867LookUpAddr).  If this doesn't result in an entry either, just the tag is
2868looked up in the access map (included the trailing colon).  Notice:
2869requiring that e-mail is sent to a server only encrypted, e.g., via
2870
2871TLS_Srv:secure.domain	ENCR:112
2872
2873doesn't necessarily mean that e-mail sent to that domain is encrypted.
2874If the domain has multiple MX servers, e.g.,
2875
2876secure.domain.	IN MX 10	mail.secure.domain.
2877secure.domain.	IN MX 50	mail.other.domain.
2878
2879then mail to user@secure.domain may go unencrypted to mail.other.domain.
2880tls_rcpt can be used to address this problem.
2881
2882tls_rcpt is called before a RCPT TO: command is sent.  The parameter is the
2883current recipient.  This ruleset is only defined if FEATURE(`access_db')
2884is selected.  A recipient address user@domain is looked up in the access
2885map in four formats: TLS_Rcpt:user@domain, TLS_Rcpt:user@, TLS_Rcpt:domain,
2886and TLS_Rcpt:; the first match is taken.
2887
2888The result of the lookups is then used to call the ruleset TLS_connection,
2889which checks the requirement specified by the RHS in the access map against
2890the actual parameters of the current TLS connection, esp. ${verify} and
2891${cipher_bits}.  Legal RHSs in the access map are:
2892
2893VERIFY		verification must have succeeded
2894VERIFY:bits	verification must have succeeded and ${cipher_bits} must
2895		be greater than or equal bits.
2896ENCR:bits	${cipher_bits} must be greater than or equal bits.
2897
2898The RHS can optionally be prefixed by TEMP+ or PERM+ to select a temporary
2899or permanent error.  The default is a temporary error code (403 4.7.0)
2900unless the macro TLS_PERM_ERR is set during generation of the .cf file.
2901
2902If a certain level of encryption is required, then it might also be
2903possible that this level is provided by the security layer from a SASL
2904algorithm, e.g., DIGEST-MD5.
2905
2906Furthermore, there can be a list of extensions added.  Such a list
2907starts with '+' and the items are separated by '++'.  Allowed
2908extensions are:
2909
2910CN:name		name must match ${cn_subject}
2911CN		${server_name} must match ${cn_subject}
2912CS:name		name must match ${cert_subject}
2913CI:name		name must match ${cert_issuer}
2914
2915Example: e-mail sent to secure.example.com should only use an encrypted
2916connection.  E-mail received from hosts within the laptop.example.com domain
2917should only be accepted if they have been authenticated.  The host which
2918receives e-mail for darth@endmail.org must present a cert that uses the
2919CN smtp.endmail.org.
2920
2921TLS_Srv:secure.example.com      ENCR:112
2922TLS_Clt:laptop.example.com      PERM+VERIFY:112
2923TLS_Rcpt:darth@endmail.org	ENCR:112+CN:smtp.endmail.org
2924
2925
2926Disabling STARTTLS And Setting SMTP Server Features
2927---------------------------------------------------
2928
2929By default STARTTLS is used whenever possible.  However, there are
2930some broken MTAs that don't properly implement STARTTLS.  To be able
2931to send to (or receive from) those MTAs, the ruleset try_tls
2932(srv_features) can be used that work together with the access map.
2933Entries for the access map must be tagged with Try_TLS (Srv_Features)
2934and refer to the hostname or IP address of the connecting system.
2935A default case can be specified by using just the tag.  For example,
2936the following entries in the access map:
2937
2938	Try_TLS:broken.server	NO
2939	Srv_Features:my.domain	v
2940	Srv_Features:		V
2941
2942will turn off STARTTLS when sending to broken.server (or any host
2943in that domain), and request a client certificate during the TLS
2944handshake only for hosts in my.domain.  The valid entries on the RHS
2945for Srv_Features are listed in the Sendmail Installation and
2946Operations Guide.
2947
2948
2949Received: Header
2950----------------
2951
2952The Received: header reveals whether STARTTLS has been used.  It contains an
2953extra line:
2954
2955(version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify})
2956
2957
2958+--------------------------------+
2959| ADDING NEW MAILERS OR RULESETS |
2960+--------------------------------+
2961
2962Sometimes you may need to add entirely new mailers or rulesets.  They
2963should be introduced with the constructs MAILER_DEFINITIONS and
2964LOCAL_RULESETS respectively.  For example:
2965
2966	MAILER_DEFINITIONS
2967	Mmymailer, ...
2968	...
2969
2970	LOCAL_RULESETS
2971	Smyruleset
2972	...
2973
2974Local additions for the rulesets srv_features, try_tls, tls_rcpt,
2975tls_client, and tls_server can be made using LOCAL_SRV_FEATURES,
2976LOCAL_TRY_TLS, LOCAL_TLS_RCPT, LOCAL_TLS_CLIENT, and LOCAL_TLS_SERVER,
2977respectively.  For example, to add a local ruleset that decides
2978whether to try STARTTLS in a sendmail client, use:
2979
2980	LOCAL_TRY_TLS
2981	R...
2982
2983Note: you don't need to add a name for the ruleset, it is implicitly
2984defined by using the appropriate macro.
2985
2986
2987+-------------------------+
2988| ADDING NEW MAIL FILTERS |
2989+-------------------------+
2990
2991Sendmail supports mail filters to filter incoming SMTP messages according
2992to the "Sendmail Mail Filter API" documentation.  These filters can be
2993configured in your mc file using the two commands:
2994
2995	MAIL_FILTER(`name', `equates')
2996	INPUT_MAIL_FILTER(`name', `equates')
2997
2998The first command, MAIL_FILTER(), simply defines a filter with the given
2999name and equates.  For example:
3000
3001	MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
3002
3003This creates the equivalent sendmail.cf entry:
3004
3005	Xarchive, S=local:/var/run/archivesock, F=R
3006
3007The INPUT_MAIL_FILTER() command performs the same actions as MAIL_FILTER
3008but also populates the m4 variable `confINPUT_MAIL_FILTERS' with the name
3009of the filter such that the filter will actually be called by sendmail.
3010
3011For example, the two commands:
3012
3013	INPUT_MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
3014	INPUT_MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T')
3015
3016are equivalent to the three commands:
3017
3018	MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
3019	MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T')
3020	define(`confINPUT_MAIL_FILTERS', `archive, spamcheck')
3021
3022In general, INPUT_MAIL_FILTER() should be used unless you need to define
3023more filters than you want to use for `confINPUT_MAIL_FILTERS'.
3024
3025Note that setting `confINPUT_MAIL_FILTERS' after any INPUT_MAIL_FILTER()
3026commands will clear the list created by the prior INPUT_MAIL_FILTER()
3027commands.
3028
3029
3030+-------------------------+
3031| QUEUE GROUP DEFINITIONS |
3032+-------------------------+
3033
3034In addition to the queue directory (which is the default queue group
3035called "mqueue"), sendmail can deal with multiple queue groups, which
3036are collections of queue directories with the same behaviour.  Queue
3037groups can be defined using the command:
3038
3039	QUEUE_GROUP(`name', `equates')
3040
3041For details about queue groups, please see doc/op/op.{me,ps,txt}.
3042
3043+-------------------------------+
3044| NON-SMTP BASED CONFIGURATIONS |
3045+-------------------------------+
3046
3047These configuration files are designed primarily for use by
3048SMTP-based sites.  They may not be well tuned for UUCP-only or
3049UUCP-primarily nodes (the latter is defined as a small local net
3050connected to the rest of the world via UUCP).  However, there is
3051one hook to handle some special cases.
3052
3053You can define a ``smart host'' that understands a richer address syntax
3054using:
3055
3056	define(`SMART_HOST', `mailer:hostname')
3057
3058In this case, the ``mailer:'' defaults to "relay".  Any messages that
3059can't be handled using the usual UUCP rules are passed to this host.
3060
3061If you are on a local SMTP-based net that connects to the outside
3062world via UUCP, you can use LOCAL_NET_CONFIG to add appropriate rules.
3063For example:
3064
3065	define(`SMART_HOST', `uucp-new:uunet')
3066	LOCAL_NET_CONFIG
3067	R$* < @ $* .$m. > $*	$#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3
3068
3069This will cause all names that end in your domain name ($m) to be sent
3070via SMTP; anything else will be sent via uucp-new (smart UUCP) to uunet.
3071If you have FEATURE(`nocanonify'), you may need to omit the dots after
3072the $m.  If you are running a local DNS inside your domain which is
3073not otherwise connected to the outside world, you probably want to
3074use:
3075
3076	define(`SMART_HOST', `smtp:fire.wall.com')
3077	LOCAL_NET_CONFIG
3078	R$* < @ $* . > $*	$#smtp $@ $2. $: $1 < @ $2. > $3
3079
3080That is, send directly only to things you found in your DNS lookup;
3081anything else goes through SMART_HOST.
3082
3083You may need to turn off the anti-spam rules in order to accept
3084UUCP mail with FEATURE(`promiscuous_relay') and
3085FEATURE(`accept_unresolvable_domains').
3086
3087
3088+-----------+
3089| WHO AM I? |
3090+-----------+
3091
3092Normally, the $j macro is automatically defined to be your fully
3093qualified domain name (FQDN).  Sendmail does this by getting your
3094host name using gethostname and then calling gethostbyname on the
3095result.  For example, in some environments gethostname returns
3096only the root of the host name (such as "foo"); gethostbyname is
3097supposed to return the FQDN ("foo.bar.com").  In some (fairly rare)
3098cases, gethostbyname may fail to return the FQDN.  In this case
3099you MUST define confDOMAIN_NAME to be your fully qualified domain
3100name.  This is usually done using:
3101
3102	Dmbar.com
3103	define(`confDOMAIN_NAME', `$w.$m')dnl
3104
3105
3106+-----------------------------------+
3107| ACCEPTING MAIL FOR MULTIPLE NAMES |
3108+-----------------------------------+
3109
3110If your host is known by several different names, you need to augment
3111class {w}.  This is a list of names by which your host is known, and
3112anything sent to an address using a host name in this list will be
3113treated as local mail.  You can do this in two ways:  either create the
3114file /etc/mail/local-host-names containing a list of your aliases (one per
3115line), and use ``FEATURE(`use_cw_file')'' in the .mc file, or add
3116``LOCAL_DOMAIN(`alias.host.name')''.  Be sure you use the fully-qualified
3117name of the host, rather than a short name.
3118
3119If you want to have different address in different domains, take
3120a look at the virtusertable feature, which is also explained at
3121http://www.sendmail.org/virtual-hosting.html
3122
3123
3124+--------------------+
3125| USING MAILERTABLES |
3126+--------------------+
3127
3128To use FEATURE(`mailertable'), you will have to create an external
3129database containing the routing information for various domains.
3130For example, a mailertable file in text format might be:
3131
3132	.my.domain		xnet:%1.my.domain
3133	uuhost1.my.domain	uucp-new:uuhost1
3134	.bitnet			smtp:relay.bit.net
3135
3136This should normally be stored in /etc/mail/mailertable.  The actual
3137database version of the mailertable is built using:
3138
3139	makemap hash /etc/mail/mailertable < /etc/mail/mailertable
3140
3141The semantics are simple.  Any LHS entry that does not begin with
3142a dot matches the full host name indicated.  LHS entries beginning
3143with a dot match anything ending with that domain name (including
3144the leading dot) -- that is, they can be thought of as having a
3145leading ".+" regular expression pattern for a non-empty sequence of
3146characters.  Matching is done in order of most-to-least qualified
3147-- for example, even though ".my.domain" is listed first in the
3148above example, an entry of "uuhost1.my.domain" will match the second
3149entry since it is more explicit.  Note: e-mail to "user@my.domain"
3150does not match any entry in the above table.  You need to have
3151something like:
3152
3153	my.domain		esmtp:host.my.domain
3154
3155The RHS should always be a "mailer:host" pair.  The mailer is the
3156configuration name of a mailer (that is, an M line in the
3157sendmail.cf file).  The "host" will be the hostname passed to
3158that mailer.  In domain-based matches (that is, those with leading
3159dots) the "%1" may be used to interpolate the wildcarded part of
3160the host name.  For example, the first line above sends everything
3161addressed to "anything.my.domain" to that same host name, but using
3162the (presumably experimental) xnet mailer.
3163
3164In some cases you may want to temporarily turn off MX records,
3165particularly on gateways.  For example, you may want to MX
3166everything in a domain to one machine that then forwards it
3167directly.  To do this, you might use the DNS configuration:
3168
3169	*.domain.	IN	MX	0	relay.machine
3170
3171and on relay.machine use the mailertable:
3172
3173	.domain		smtp:[gateway.domain]
3174
3175The [square brackets] turn off MX records for this host only.
3176If you didn't do this, the mailertable would use the MX record
3177again, which would give you an MX loop.  Note that the use of
3178wildcard MX records is almost always a bad idea.  Please avoid
3179using them if possible.
3180
3181
3182+--------------------------------+
3183| USING USERDB TO MAP FULL NAMES |
3184+--------------------------------+
3185
3186The user database was not originally intended for mapping full names
3187to login names (e.g., Eric.Allman => eric), but some people are using
3188it that way.  (it is recommended that you set up aliases for this
3189purpose instead -- since you can specify multiple alias files, this
3190is fairly easy.)  The intent was to locate the default maildrop at
3191a site, but allow you to override this by sending to a specific host.
3192
3193If you decide to set up the user database in this fashion, it is
3194imperative that you not use FEATURE(`stickyhost') -- otherwise,
3195e-mail sent to Full.Name@local.host.name will be rejected.
3196
3197To build the internal form of the user database, use:
3198
3199	makemap btree /etc/mail/userdb < /etc/mail/userdb.txt
3200
3201As a general rule, it is an extremely bad idea to using full names
3202as e-mail addresses, since they are not in any sense unique.  For
3203example, the UNIX software-development community has at least two
3204well-known Peter Deutsches, and at one time Bell Labs had two
3205Stephen R. Bournes with offices along the same hallway.  Which one
3206will be forced to suffer the indignity of being Stephen_R_Bourne_2?
3207The less famous of the two, or the one that was hired later?
3208
3209Finger should handle full names (and be fuzzy).  Mail should use
3210handles, and not be fuzzy.
3211
3212
3213+--------------------------------+
3214| MISCELLANEOUS SPECIAL FEATURES |
3215+--------------------------------+
3216
3217Plussed users
3218	Sometimes it is convenient to merge configuration on a
3219	centralized mail machine, for example, to forward all
3220	root mail to a mail server.  In this case it might be
3221	useful to be able to treat the root addresses as a class
3222	of addresses with subtle differences.  You can do this
3223	using plussed users.  For example, a client might include
3224	the alias:
3225
3226		root:  root+client1@server
3227
3228	On the server, this will match an alias for "root+client1".
3229	If that is not found, the alias "root+*" will be tried,
3230	then "root".
3231
3232
3233+----------------+
3234| SECURITY NOTES |
3235+----------------+
3236
3237A lot of sendmail security comes down to you.  Sendmail 8 is much
3238more careful about checking for security problems than previous
3239versions, but there are some things that you still need to watch
3240for.  In particular:
3241
3242* Make sure the aliases file is not writable except by trusted
3243  system personnel.  This includes both the text and database
3244  version.
3245
3246* Make sure that other files that sendmail reads, such as the
3247  mailertable, are only writable by trusted system personnel.
3248
3249* The queue directory should not be world writable PARTICULARLY
3250  if your system allows "file giveaways" (that is, if a non-root
3251  user can chown any file they own to any other user).
3252
3253* If your system allows file giveaways, DO NOT create a publically
3254  writable directory for forward files.  This will allow anyone
3255  to steal anyone else's e-mail.  Instead, create a script that
3256  copies the .forward file from users' home directories once a
3257  night (if you want the non-NFS-mounted forward directory).
3258
3259* If your system allows file giveaways, you'll find that
3260  sendmail is much less trusting of :include: files -- in
3261  particular, you'll have to have /SENDMAIL/ANY/SHELL/ in
3262  /etc/shells before they will be trusted (that is, before
3263  files and programs listed in them will be honored).
3264
3265In general, file giveaways are a mistake -- if you can turn them
3266off, do so.
3267
3268
3269+--------------------------------+
3270| TWEAKING CONFIGURATION OPTIONS |
3271+--------------------------------+
3272
3273There are a large number of configuration options that don't normally
3274need to be changed.  However, if you feel you need to tweak them,
3275you can define the following M4 variables. Note that some of these
3276variables require formats that are defined in RFC 2821 or RFC 2822.
3277Before changing them you need to make sure you do not violate those
3278(and other relevant) RFCs.
3279
3280This list is shown in four columns:  the name you define, the default
3281value for that definition, the option or macro that is affected
3282(either Ox for an option or Dx for a macro), and a brief description.
3283
3284Some options are likely to be deprecated in future versions -- that is,
3285the option is only included to provide back-compatibility.  These are
3286marked with "*".
3287
3288Remember that these options are M4 variables, and hence may need to
3289be quoted.  In particular, arguments with commas will usually have to
3290be ``double quoted, like this phrase'' to avoid having the comma
3291confuse things.  This is common for alias file definitions and for
3292the read timeout.
3293
3294M4 Variable Name	Configuration	[Default] & Description
3295================	=============	=======================
3296confMAILER_NAME		$n macro	[MAILER-DAEMON] The sender name used
3297					for internally generated outgoing
3298					messages.
3299confDOMAIN_NAME		$j macro	If defined, sets $j.  This should
3300					only be done if your system cannot
3301					determine your local domain name,
3302					and then it should be set to
3303					$w.Foo.COM, where Foo.COM is your
3304					domain name.
3305confCF_VERSION		$Z macro	If defined, this is appended to the
3306					configuration version name.
3307confLDAP_CLUSTER	${sendmailMTACluster} macro
3308					If defined, this is the LDAP
3309					cluster to use for LDAP searches
3310					as described above in ``USING LDAP
3311					FOR ALIASES, MAPS, AND CLASSES''.
3312confFROM_HEADER		From:		[$?x$x <$g>$|$g$.] The format of an
3313					internally generated From: address.
3314confRECEIVED_HEADER	Received:
3315		[$?sfrom $s $.$?_($?s$|from $.$_)
3316			$.$?{auth_type}(authenticated)
3317			$.by $j ($v/$Z)$?r with $r$. id $i$?u
3318			for $u; $|;
3319			$.$b]
3320					The format of the Received: header
3321					in messages passed through this host.
3322					It is unwise to try to change this.
3323confMESSAGEID_HEADER	Message-Id:	[<$t.$i@$j>] The format of an
3324					internally generated Message-Id:
3325					header.
3326confCW_FILE		Fw class	[/etc/mail/local-host-names] Name
3327					of file used to get the local
3328					additions to class {w} (local host
3329					names).
3330confCT_FILE		Ft class	[/etc/mail/trusted-users] Name of
3331					file used to get the local additions
3332					to class {t} (trusted users).
3333confCR_FILE		FR class	[/etc/mail/relay-domains] Name of
3334					file used to get the local additions
3335					to class {R} (hosts allowed to relay).
3336confTRUSTED_USERS	Ct class	[no default] Names of users to add to
3337					the list of trusted users.  This list
3338					always includes root, uucp, and daemon.
3339					See also FEATURE(`use_ct_file').
3340confTRUSTED_USER	TrustedUser	[no default] Trusted user for file
3341					ownership and starting the daemon.
3342					Not to be confused with
3343					confTRUSTED_USERS (see above).
3344confSMTP_MAILER		-		[esmtp] The mailer name used when
3345					SMTP connectivity is required.
3346					One of "smtp", "smtp8",
3347					"esmtp", or "dsmtp".
3348confUUCP_MAILER		-		[uucp-old] The mailer to be used by
3349					default for bang-format recipient
3350					addresses.  See also discussion of
3351					class {U}, class {Y}, and class {Z}
3352					in the MAILER(`uucp') section.
3353confLOCAL_MAILER	-		[local] The mailer name used when
3354					local connectivity is required.
3355					Almost always "local".
3356confRELAY_MAILER	-		[relay] The default mailer name used
3357					for relaying any mail (e.g., to a
3358					BITNET_RELAY, a SMART_HOST, or
3359					whatever).  This can reasonably be
3360					"uucp-new" if you are on a
3361					UUCP-connected site.
3362confSEVEN_BIT_INPUT	SevenBitInput	[False] Force input to seven bits?
3363confEIGHT_BIT_HANDLING	EightBitMode	[pass8] 8-bit data handling
3364confALIAS_WAIT		AliasWait	[10m] Time to wait for alias file
3365					rebuild until you get bored and
3366					decide that the apparently pending
3367					rebuild failed.
3368confMIN_FREE_BLOCKS	MinFreeBlocks	[100] Minimum number of free blocks on
3369					queue filesystem to accept SMTP mail.
3370					(Prior to 8.7 this was minfree/maxsize,
3371					where minfree was the number of free
3372					blocks and maxsize was the maximum
3373					message size.  Use confMAX_MESSAGE_SIZE
3374					for the second value now.)
3375confMAX_MESSAGE_SIZE	MaxMessageSize	[infinite] The maximum size of messages
3376					that will be accepted (in bytes).
3377confBLANK_SUB		BlankSub	[.] Blank (space) substitution
3378					character.
3379confCON_EXPENSIVE	HoldExpensive	[False] Avoid connecting immediately
3380					to mailers marked expensive.
3381confCHECKPOINT_INTERVAL	CheckpointInterval
3382					[10] Checkpoint queue files every N
3383					recipients.
3384confDELIVERY_MODE	DeliveryMode	[background] Default delivery mode.
3385confERROR_MODE		ErrorMode	[print] Error message mode.
3386confERROR_MESSAGE	ErrorHeader	[undefined] Error message header/file.
3387confSAVE_FROM_LINES	SaveFromLine	Save extra leading From_ lines.
3388confTEMP_FILE_MODE	TempFileMode	[0600] Temporary file mode.
3389confMATCH_GECOS		MatchGECOS	[False] Match GECOS field.
3390confMAX_HOP		MaxHopCount	[25] Maximum hop count.
3391confIGNORE_DOTS*	IgnoreDots	[False; always False in -bs or -bd
3392					mode] Ignore dot as terminator for
3393					incoming messages?
3394confBIND_OPTS		ResolverOptions	[undefined] Default options for DNS
3395					resolver.
3396confMIME_FORMAT_ERRORS*	SendMimeErrors	[True] Send error messages as MIME-
3397					encapsulated messages per RFC 1344.
3398confFORWARD_PATH	ForwardPath	[$z/.forward.$w:$z/.forward]
3399					The colon-separated list of places to
3400					search for .forward files.  N.B.: see
3401					the Security Notes section.
3402confMCI_CACHE_SIZE	ConnectionCacheSize
3403					[2] Size of open connection cache.
3404confMCI_CACHE_TIMEOUT	ConnectionCacheTimeout
3405					[5m] Open connection cache timeout.
3406confHOST_STATUS_DIRECTORY HostStatusDirectory
3407					[undefined] If set, host status is kept
3408					on disk between sendmail runs in the
3409					named directory tree.  This need not be
3410					a full pathname, in which case it is
3411					interpreted relative to the queue
3412					directory.
3413confSINGLE_THREAD_DELIVERY  SingleThreadDelivery
3414					[False] If this option and the
3415					HostStatusDirectory option are both
3416					set, single thread deliveries to other
3417					hosts.  That is, don't allow any two
3418					sendmails on this host to connect
3419					simultaneously to any other single
3420					host.  This can slow down delivery in
3421					some cases, in particular since a
3422					cached but otherwise idle connection
3423					to a host will prevent other sendmails
3424					from connecting to the other host.
3425confUSE_ERRORS_TO*	UseErrorsTo	[False] Use the Errors-To: header to
3426					deliver error messages.  This should
3427					not be necessary because of general
3428					acceptance of the envelope/header
3429					distinction.
3430confLOG_LEVEL		LogLevel	[9] Log level.
3431confME_TOO		MeToo		[True] Include sender in group
3432					expansions.  This option is
3433					deprecated and will be removed from
3434					a future version.
3435confCHECK_ALIASES	CheckAliases	[False] Check RHS of aliases when
3436					running newaliases.  Since this does
3437					DNS lookups on every address, it can
3438					slow down the alias rebuild process
3439					considerably on large alias files.
3440confOLD_STYLE_HEADERS*	OldStyleHeaders	[True] Assume that headers without
3441					special chars are old style.
3442confPRIVACY_FLAGS	PrivacyOptions	[authwarnings] Privacy flags.
3443confCOPY_ERRORS_TO	PostmasterCopy	[undefined] Address for additional
3444					copies of all error messages.
3445confQUEUE_FACTOR	QueueFactor	[600000] Slope of queue-only function.
3446confQUEUE_FILE_MODE	QueueFileMode	[undefined] Default permissions for
3447					queue files (octal).  If not set,
3448					sendmail uses 0600 unless its real
3449					and effective uid are different in
3450					which case it uses 0644.
3451confDONT_PRUNE_ROUTES	DontPruneRoutes	[False] Don't prune down route-addr
3452					syntax addresses to the minimum
3453					possible.
3454confSAFE_QUEUE*		SuperSafe	[True] Commit all messages to disk
3455					before forking.
3456confTO_INITIAL		Timeout.initial	[5m] The timeout waiting for a response
3457					on the initial connect.
3458confTO_CONNECT		Timeout.connect	[0] The timeout waiting for an initial
3459					connect() to complete.  This can only
3460					shorten connection timeouts; the kernel
3461					silently enforces an absolute maximum
3462					(which varies depending on the system).
3463confTO_ICONNECT		Timeout.iconnect
3464					[undefined] Like Timeout.connect, but
3465					applies only to the very first attempt
3466					to connect to a host in a message.
3467					This allows a single very fast pass
3468					followed by more careful delivery
3469					attempts in the future.
3470confTO_ACONNECT		Timeout.aconnect
3471					[0] The overall timeout waiting for
3472					all connection for a single delivery
3473					attempt to succeed.  If 0, no overall
3474					limit is applied.
3475confTO_HELO		Timeout.helo	[5m] The timeout waiting for a response
3476					to a HELO or EHLO command.
3477confTO_MAIL		Timeout.mail	[10m] The timeout waiting for a
3478					response to the MAIL command.
3479confTO_RCPT		Timeout.rcpt	[1h] The timeout waiting for a response
3480					to the RCPT command.
3481confTO_DATAINIT		Timeout.datainit
3482					[5m] The timeout waiting for a 354
3483					response from the DATA command.
3484confTO_DATABLOCK	Timeout.datablock
3485					[1h] The timeout waiting for a block
3486					during DATA phase.
3487confTO_DATAFINAL	Timeout.datafinal
3488					[1h] The timeout waiting for a response
3489					to the final "." that terminates a
3490					message.
3491confTO_RSET		Timeout.rset	[5m] The timeout waiting for a response
3492					to the RSET command.
3493confTO_QUIT		Timeout.quit	[2m] The timeout waiting for a response
3494					to the QUIT command.
3495confTO_MISC		Timeout.misc	[2m] The timeout waiting for a response
3496					to other SMTP commands.
3497confTO_COMMAND		Timeout.command	[1h] In server SMTP, the timeout
3498					waiting	for a command to be issued.
3499confTO_IDENT		Timeout.ident	[5s] The timeout waiting for a
3500					response to an IDENT query.
3501confTO_FILEOPEN		Timeout.fileopen
3502					[60s] The timeout waiting for a file
3503					(e.g., :include: file) to be opened.
3504confTO_LHLO		Timeout.lhlo	[2m] The timeout waiting for a response
3505					to an LMTP LHLO command.
3506confTO_STARTTLS		Timeout.starttls
3507					[1h] The timeout waiting for a
3508					response to an SMTP STARTTLS command.
3509confTO_CONTROL		Timeout.control
3510					[2m] The timeout for a complete
3511					control socket transaction to complete.
3512confTO_QUEUERETURN	Timeout.queuereturn
3513					[5d] The timeout before a message is
3514					returned as undeliverable.
3515confTO_QUEUERETURN_NORMAL
3516			Timeout.queuereturn.normal
3517					[undefined] As above, for normal
3518					priority messages.
3519confTO_QUEUERETURN_URGENT
3520			Timeout.queuereturn.urgent
3521					[undefined] As above, for urgent
3522					priority messages.
3523confTO_QUEUERETURN_NONURGENT
3524			Timeout.queuereturn.non-urgent
3525					[undefined] As above, for non-urgent
3526					(low) priority messages.
3527confTO_QUEUERETURN_DSN
3528			Timeout.queuereturn.dsn
3529					[undefined] As above, for delivery
3530					status notification messages.
3531confTO_QUEUEWARN	Timeout.queuewarn
3532					[4h] The timeout before a warning
3533					message is sent to the sender telling
3534					them that the message has been
3535					deferred.
3536confTO_QUEUEWARN_NORMAL	Timeout.queuewarn.normal
3537					[undefined] As above, for normal
3538					priority messages.
3539confTO_QUEUEWARN_URGENT	Timeout.queuewarn.urgent
3540					[undefined] As above, for urgent
3541					priority messages.
3542confTO_QUEUEWARN_NONURGENT
3543			Timeout.queuewarn.non-urgent
3544					[undefined] As above, for non-urgent
3545					(low) priority messages.
3546confTO_QUEUEWARN_DSN
3547			Timeout.queuewarn.dsn
3548					[undefined] As above, for delivery
3549					status notification messages.
3550confTO_HOSTSTATUS	Timeout.hoststatus
3551					[30m] How long information about host
3552					statuses will be maintained before it
3553					is considered stale and the host should
3554					be retried.  This applies both within
3555					a single queue run and to persistent
3556					information (see below).
3557confTO_RESOLVER_RETRANS	Timeout.resolver.retrans
3558					[varies] Sets the resolver's
3559					retransmission time interval (in
3560					seconds).  Sets both
3561					Timeout.resolver.retrans.first and
3562					Timeout.resolver.retrans.normal.
3563confTO_RESOLVER_RETRANS_FIRST  Timeout.resolver.retrans.first
3564					[varies] Sets the resolver's
3565					retransmission time interval (in
3566					seconds) for the first attempt to
3567					deliver a message.
3568confTO_RESOLVER_RETRANS_NORMAL  Timeout.resolver.retrans.normal
3569					[varies] Sets the resolver's
3570					retransmission time interval (in
3571					seconds) for all resolver lookups
3572					except the first delivery attempt.
3573confTO_RESOLVER_RETRY	Timeout.resolver.retry
3574					[varies] Sets the number of times
3575					to retransmit a resolver query.
3576					Sets both
3577					Timeout.resolver.retry.first and
3578					Timeout.resolver.retry.normal.
3579confTO_RESOLVER_RETRY_FIRST  Timeout.resolver.retry.first
3580					[varies] Sets the number of times
3581					to retransmit a resolver query for
3582					the first attempt to deliver a
3583					message.
3584confTO_RESOLVER_RETRY_NORMAL  Timeout.resolver.retry.normal
3585					[varies] Sets the number of times
3586					to retransmit a resolver query for
3587					all resolver lookups except the
3588					first delivery attempt.
3589confTIME_ZONE		TimeZoneSpec	[USE_SYSTEM] Time zone info -- can be
3590					USE_SYSTEM to use the system's idea,
3591					USE_TZ to use the user's TZ envariable,
3592					or something else to force that value.
3593confDEF_USER_ID		DefaultUser	[1:1] Default user id.
3594confUSERDB_SPEC		UserDatabaseSpec
3595					[undefined] User database
3596					specification.
3597confFALLBACK_MX		FallbackMXhost	[undefined] Fallback MX host.
3598confFALLBACK_SMARTHOST	FallbackSmartHost
3599					[undefined] Fallback smart host.
3600confTRY_NULL_MX_LIST	TryNullMXList	[False] If this host is the best MX
3601					for a host and other arrangements
3602					haven't been made, try connecting
3603					to the host directly; normally this
3604					would be a config error.
3605confQUEUE_LA		QueueLA		[varies] Load average at which
3606					queue-only function kicks in.
3607					Default values is (8 * numproc)
3608					where numproc is the number of
3609					processors online (if that can be
3610					determined).
3611confREFUSE_LA		RefuseLA	[varies] Load average at which
3612					incoming SMTP connections are
3613					refused.  Default values is (12 *
3614					numproc) where numproc is the
3615					number of processors online (if
3616					that can be determined).
3617confREJECT_LOG_INTERVAL	RejectLogInterval	[3h] Log interval when
3618					refusing connections for this long.
3619confDELAY_LA		DelayLA		[0] Load average at which sendmail
3620					will sleep for one second on most
3621					SMTP commands and before accepting
3622					connections.  0 means no limit.
3623confMAX_ALIAS_RECURSION	MaxAliasRecursion
3624					[10] Maximum depth of alias recursion.
3625confMAX_DAEMON_CHILDREN	MaxDaemonChildren
3626					[undefined] The maximum number of
3627					children the daemon will permit.  After
3628					this number, connections will be
3629					rejected.  If not set or <= 0, there is
3630					no limit.
3631confMAX_HEADERS_LENGTH	MaxHeadersLength
3632					[32768] Maximum length of the sum
3633					of all headers.
3634confMAX_MIME_HEADER_LENGTH  MaxMimeHeaderLength
3635					[undefined] Maximum length of
3636					certain MIME header field values.
3637confCONNECTION_RATE_THROTTLE ConnectionRateThrottle
3638					[undefined] The maximum number of
3639					connections permitted per second per
3640					daemon.  After this many connections
3641					are accepted, further connections
3642					will be delayed.  If not set or <= 0,
3643					there is no limit.
3644confCONNECTION_RATE_WINDOW_SIZE ConnectionRateWindowSize
3645					[60s] Define the length of the
3646					interval for which the number of
3647					incoming connections is maintained.
3648confWORK_RECIPIENT_FACTOR
3649			RecipientFactor	[30000] Cost of each recipient.
3650confSEPARATE_PROC	ForkEachJob	[False] Run all deliveries in a
3651					separate process.
3652confWORK_CLASS_FACTOR	ClassFactor	[1800] Priority multiplier for class.
3653confWORK_TIME_FACTOR	RetryFactor	[90000] Cost of each delivery attempt.
3654confQUEUE_SORT_ORDER	QueueSortOrder	[Priority] Queue sort algorithm:
3655					Priority, Host, Filename, Random,
3656					Modification, or Time.
3657confMIN_QUEUE_AGE	MinQueueAge	[0] The minimum amount of time a job
3658					must sit in the queue between queue
3659					runs.  This allows you to set the
3660					queue run interval low for better
3661					responsiveness without trying all
3662					jobs in each run.
3663confDEF_CHAR_SET	DefaultCharSet	[unknown-8bit] When converting
3664					unlabeled 8 bit input to MIME, the
3665					character set to use by default.
3666confSERVICE_SWITCH_FILE	ServiceSwitchFile
3667					[/etc/mail/service.switch] The file
3668					to use for the service switch on
3669					systems that do not have a
3670					system-defined switch.
3671confHOSTS_FILE		HostsFile	[/etc/hosts] The file to use when doing
3672					"file" type access of hosts names.
3673confDIAL_DELAY		DialDelay	[0s] If a connection fails, wait this
3674					long and try again.  Zero means "don't
3675					retry".  This is to allow "dial on
3676					demand" connections to have enough time
3677					to complete a connection.
3678confNO_RCPT_ACTION	NoRecipientAction
3679					[none] What to do if there are no legal
3680					recipient fields (To:, Cc: or Bcc:)
3681					in the message.  Legal values can
3682					be "none" to just leave the
3683					nonconforming message as is, "add-to"
3684					to add a To: header with all the
3685					known recipients (which may expose
3686					blind recipients), "add-apparently-to"
3687					to do the same but use Apparently-To:
3688					instead of To: (strongly discouraged
3689					in accordance with IETF standards),
3690					"add-bcc" to add an empty Bcc:
3691					header, or "add-to-undisclosed" to
3692					add the header
3693					``To: undisclosed-recipients:;''.
3694confSAFE_FILE_ENV	SafeFileEnvironment
3695					[undefined] If set, sendmail will do a
3696					chroot() into this directory before
3697					writing files.
3698confCOLON_OK_IN_ADDR	ColonOkInAddr	[True unless Configuration Level > 6]
3699					If set, colons are treated as a regular
3700					character in addresses.  If not set,
3701					they are treated as the introducer to
3702					the RFC 822 "group" syntax.  Colons are
3703					handled properly in route-addrs.  This
3704					option defaults on for V5 and lower
3705					configuration files.
3706confMAX_QUEUE_RUN_SIZE	MaxQueueRunSize	[0] If set, limit the maximum size of
3707					any given queue run to this number of
3708					entries.  Essentially, this will stop
3709					reading each queue directory after this
3710					number of entries are reached; it does
3711					_not_ pick the highest priority jobs,
3712					so this should be as large as your
3713					system can tolerate.  If not set, there
3714					is no limit.
3715confMAX_QUEUE_CHILDREN	MaxQueueChildren
3716					[undefined] Limits the maximum number
3717					of concurrent queue runners active.
3718					This is to keep system resources used
3719					within a reasonable limit.  Relates to
3720					Queue Groups and ForkEachJob.
3721confMAX_RUNNERS_PER_QUEUE	MaxRunnersPerQueue
3722					[1] Only active when MaxQueueChildren
3723					defined.  Controls the maximum number
3724					of queue runners (aka queue children)
3725					active at the same time in a work
3726					group.  See also MaxQueueChildren.
3727confDONT_EXPAND_CNAMES	DontExpandCnames
3728					[False] If set, $[ ... $] lookups that
3729					do DNS based lookups do not expand
3730					CNAME records.  This currently violates
3731					the published standards, but the IETF
3732					seems to be moving toward legalizing
3733					this.  For example, if "FTP.Foo.ORG"
3734					is a CNAME for "Cruft.Foo.ORG", then
3735					with this option set a lookup of
3736					"FTP" will return "FTP.Foo.ORG"; if
3737					clear it returns "Cruft.FOO.ORG".  N.B.
3738					you may not see any effect until your
3739					downstream neighbors stop doing CNAME
3740					lookups as well.
3741confFROM_LINE		UnixFromLine	[From $g $d] The From_ line used
3742					when sending to files or programs.
3743confSINGLE_LINE_FROM_HEADER  SingleLineFromHeader
3744					[False] From: lines that have
3745					embedded newlines are unwrapped
3746					onto one line.
3747confALLOW_BOGUS_HELO	AllowBogusHELO	[False] Allow HELO SMTP command that
3748					does not include a host name.
3749confMUST_QUOTE_CHARS	MustQuoteChars	[.'] Characters to be quoted in a full
3750					name phrase (@,;:\()[] are automatic).
3751confOPERATORS		OperatorChars	[.:%@!^/[]+] Address operator
3752					characters.
3753confSMTP_LOGIN_MSG	SmtpGreetingMessage
3754					[$j Sendmail $v/$Z; $b]
3755					The initial (spontaneous) SMTP
3756					greeting message.  The word "ESMTP"
3757					will be inserted between the first and
3758					second words to convince other
3759					sendmails to try to speak ESMTP.
3760confDONT_INIT_GROUPS	DontInitGroups	[False] If set, the initgroups(3)
3761					routine will never be invoked.  You
3762					might want to do this if you are
3763					running NIS and you have a large group
3764					map, since this call does a sequential
3765					scan of the map; in a large site this
3766					can cause your ypserv to run
3767					essentially full time.  If you set
3768					this, agents run on behalf of users
3769					will only have their primary
3770					(/etc/passwd) group permissions.
3771confUNSAFE_GROUP_WRITES	UnsafeGroupWrites
3772					[True] If set, group-writable
3773					:include: and .forward files are
3774					considered "unsafe", that is, programs
3775					and files cannot be directly referenced
3776					from such files.  World-writable files
3777					are always considered unsafe.
3778					Notice: this option is deprecated and
3779					will be removed in future versions;
3780					Set GroupWritableForwardFileSafe
3781					and GroupWritableIncludeFileSafe in
3782					DontBlameSendmail if required.
3783confCONNECT_ONLY_TO	ConnectOnlyTo	[undefined] override connection
3784					address (for testing).
3785confCONTROL_SOCKET_NAME	ControlSocketName
3786					[undefined] Control socket for daemon
3787					management.
3788confDOUBLE_BOUNCE_ADDRESS  DoubleBounceAddress
3789					[postmaster] If an error occurs when
3790					sending an error message, send that
3791					"double bounce" error message to this
3792					address.  If it expands to an empty
3793					string, double bounces are dropped.
3794confDEAD_LETTER_DROP	DeadLetterDrop	[undefined] Filename to save bounce
3795					messages which could not be returned
3796					to the user or sent to postmaster.
3797					If not set, the queue file will
3798					be renamed.
3799confRRT_IMPLIES_DSN	RrtImpliesDsn	[False] Return-Receipt-To: header
3800					implies DSN request.
3801confRUN_AS_USER		RunAsUser	[undefined] If set, become this user
3802					when reading and delivering mail.
3803					Causes all file reads (e.g., .forward
3804					and :include: files) to be done as
3805					this user.  Also, all programs will
3806					be run as this user, and all output
3807					files will be written as this user.
3808confMAX_RCPTS_PER_MESSAGE  MaxRecipientsPerMessage
3809					[infinite] If set, allow no more than
3810					the specified number of recipients in
3811					an SMTP envelope.  Further recipients
3812					receive a 452 error code (i.e., they
3813					are deferred for the next delivery
3814					attempt).
3815confBAD_RCPT_THROTTLE	BadRcptThrottle	[infinite] If set and the specified
3816					number of recipients in a single SMTP
3817					transaction have been rejected, sleep
3818					for one second after each subsequent
3819					RCPT command in that transaction.
3820confDONT_PROBE_INTERFACES  DontProbeInterfaces
3821					[False] If set, sendmail will _not_
3822					insert the names and addresses of any
3823					local interfaces into class {w}
3824					(list of known "equivalent" addresses).
3825					If you set this, you must also include
3826					some support for these addresses (e.g.,
3827					in a mailertable entry) -- otherwise,
3828					mail to addresses in this list will
3829					bounce with a configuration error.
3830					If set to "loopback" (without
3831					quotes), sendmail will skip
3832					loopback interfaces (e.g., "lo0").
3833confPID_FILE		PidFile		[system dependent] Location of pid
3834					file.
3835confPROCESS_TITLE_PREFIX  ProcessTitlePrefix
3836					[undefined] Prefix string for the
3837					process title shown on 'ps' listings.
3838confDONT_BLAME_SENDMAIL	DontBlameSendmail
3839					[safe] Override sendmail's file
3840					safety checks.  This will definitely
3841					compromise system security and should
3842					not be used unless absolutely
3843					necessary.
3844confREJECT_MSG		-		[550 Access denied] The message
3845					given if the access database contains
3846					REJECT in the value portion.
3847confRELAY_MSG		-		[550 Relaying denied] The message
3848					given if an unauthorized relaying
3849					attempt is rejected.
3850confDF_BUFFER_SIZE	DataFileBufferSize
3851					[4096] The maximum size of a
3852					memory-buffered data (df) file
3853					before a disk-based file is used.
3854confXF_BUFFER_SIZE	XScriptFileBufferSize
3855					[4096] The maximum size of a
3856					memory-buffered transcript (xf)
3857					file before a disk-based file is
3858					used.
3859confTLS_SRV_OPTIONS	TLSSrvOptions	If this option is 'V' no client
3860					verification is performed, i.e.,
3861					the server doesn't ask for a
3862					certificate.
3863confLDAP_DEFAULT_SPEC	LDAPDefaultSpec	[undefined] Default map
3864					specification for LDAP maps.  The
3865					value should only contain LDAP
3866					specific settings such as "-h host
3867					-p port -d bindDN", etc.  The
3868					settings will be used for all LDAP
3869					maps unless they are specified in
3870					the individual map specification
3871					('K' command).
3872confCACERT_PATH		CACertPath	[undefined] Path to directory
3873					with certs of CAs.
3874confCACERT		CACertFile	[undefined] File containing one CA
3875					cert.
3876confSERVER_CERT		ServerCertFile	[undefined] File containing the
3877					cert of the server, i.e., this cert
3878					is used when sendmail acts as
3879					server.
3880confSERVER_KEY		ServerKeyFile	[undefined] File containing the
3881					private key belonging to the server
3882					cert.
3883confCLIENT_CERT		ClientCertFile	[undefined] File containing the
3884					cert of the client, i.e., this cert
3885					is used when sendmail acts as
3886					client.
3887confCLIENT_KEY		ClientKeyFile	[undefined] File containing the
3888					private key belonging to the client
3889					cert.
3890confCRL			CRLFile		[undefined] File containing certificate
3891					revocation status, useful for X.509v3
3892					authentication. Note that CRL requires
3893					at least OpenSSL version 0.9.7.
3894confDH_PARAMETERS	DHParameters	[undefined] File containing the
3895					DH parameters.
3896confRAND_FILE		RandFile	[undefined] File containing random
3897					data (use prefix file:) or the
3898					name of the UNIX socket if EGD is
3899					used (use prefix egd:).  STARTTLS
3900					requires this option if the compile
3901					flag HASURANDOM is not set (see
3902					sendmail/README).
3903confNICE_QUEUE_RUN	NiceQueueRun	[undefined]  If set, the priority of
3904					queue runners is set the given value
3905					(nice(3)).
3906confDIRECT_SUBMISSION_MODIFIERS	DirectSubmissionModifiers
3907					[undefined] Defines {daemon_flags}
3908					for direct submissions.
3909confUSE_MSP		UseMSP		[undefined] Use as mail submission
3910					program.
3911confDELIVER_BY_MIN	DeliverByMin	[0] Minimum time for Deliver By
3912					SMTP Service Extension (RFC 2852).
3913confREQUIRES_DIR_FSYNC	RequiresDirfsync	[true] RequiresDirfsync can
3914					be used to turn off the compile time
3915					flag REQUIRES_DIR_FSYNC at runtime.
3916					See sendmail/README for details.
3917confSHARED_MEMORY_KEY	SharedMemoryKey [0] Key for shared memory.
3918confSHARED_MEMORY_KEY_FILE
3919			SharedMemoryKeyFile
3920					[undefined] File where the
3921					automatically selected key for
3922					shared memory is stored.
3923confFAST_SPLIT		FastSplit	[1] If set to a value greater than
3924					zero, the initial MX lookups on
3925					addresses is suppressed when they
3926					are sorted which may result in
3927					faster envelope splitting.  If the
3928					mail is submitted directly from the
3929					command line, then the value also
3930					limits the number of processes to
3931					deliver the envelopes.
3932confMAILBOX_DATABASE	MailboxDatabase	[pw] Type of lookup to find
3933					information about local mailboxes.
3934confDEQUOTE_OPTS	-		[empty] Additional options for the
3935					dequote map.
3936confMAX_NOOP_COMMANDS	MaxNOOPCommands	[20] Maximum number of "useless"
3937					commands before the SMTP server
3938					will slow down responding.
3939confHELO_NAME		HeloName	If defined, use as name for EHLO/HELO
3940					command (instead of $j).
3941confINPUT_MAIL_FILTERS	InputMailFilters
3942					A comma separated list of filters
3943					which determines which filters and
3944					the invocation sequence are
3945					contacted for incoming SMTP
3946					messages.  If none are set, no
3947					filters will be contacted.
3948confMILTER_LOG_LEVEL	Milter.LogLevel	[9] Log level for input mail filter
3949					actions, defaults to LogLevel.
3950confMILTER_MACROS_CONNECT	Milter.macros.connect
3951					[j, _, {daemon_name}, {if_name},
3952					{if_addr}] Macros to transmit to
3953					milters when a session connection
3954					starts.
3955confMILTER_MACROS_HELO	Milter.macros.helo
3956					[{tls_version}, {cipher},
3957					{cipher_bits}, {cert_subject},
3958					{cert_issuer}] Macros to transmit to
3959					milters after HELO/EHLO command.
3960confMILTER_MACROS_ENVFROM	Milter.macros.envfrom
3961					[i, {auth_type}, {auth_authen},
3962					{auth_ssf}, {auth_author},
3963					{mail_mailer}, {mail_host},
3964					{mail_addr}] Macros to transmit to
3965					milters after MAIL FROM command.
3966confMILTER_MACROS_ENVRCPT	Milter.macros.envrcpt
3967					[{rcpt_mailer}, {rcpt_host},
3968					{rcpt_addr}] Macros to transmit to
3969					milters after RCPT TO command.
3970confMILTER_MACROS_EOM		Milter.macros.eom
3971					[{msg_id}] Macros to transmit to
3972					milters after DATA command.
3973
3974
3975See also the description of OSTYPE for some parameters that can be
3976tweaked (generally pathnames to mailers).
3977
3978ClientPortOptions and DaemonPortOptions are special cases since multiple
3979clients/daemons can be defined.  This can be done via
3980
3981	CLIENT_OPTIONS(`field1=value1,field2=value2,...')
3982	DAEMON_OPTIONS(`field1=value1,field2=value2,...')
3983
3984Note that multiple CLIENT_OPTIONS() commands (and therefore multiple
3985ClientPortOptions settings) are allowed in order to give settings for each
3986protocol family (e.g., one for Family=inet and one for Family=inet6).  A
3987restriction placed on one family only affects outgoing connections on that
3988particular family.
3989
3990If DAEMON_OPTIONS is not used, then the default is
3991
3992	DAEMON_OPTIONS(`Port=smtp, Name=MTA')
3993	DAEMON_OPTIONS(`Port=587, Name=MSA, M=E')
3994
3995If you use one DAEMON_OPTIONS macro, it will alter the parameters
3996of the first of these.  The second will still be defaulted; it
3997represents a "Message Submission Agent" (MSA) as defined by RFC
39982476 (see below).  To turn off the default definition for the MSA,
3999use FEATURE(`no_default_msa') (see also FEATURES).  If you use
4000additional DAEMON_OPTIONS macros, they will add additional daemons.
4001
4002Example 1:  To change the port for the SMTP listener, while
4003still using the MSA default, use
4004	DAEMON_OPTIONS(`Port=925, Name=MTA')
4005
4006Example 2:  To change the port for the MSA daemon, while still
4007using the default SMTP port, use
4008	FEATURE(`no_default_msa')
4009	DAEMON_OPTIONS(`Name=MTA')
4010	DAEMON_OPTIONS(`Port=987, Name=MSA, M=E')
4011
4012Note that if the first of those DAEMON_OPTIONS lines were omitted, then
4013there would be no listener on the standard SMTP port.
4014
4015Example 3: To listen on both IPv4 and IPv6 interfaces, use
4016
4017	DAEMON_OPTIONS(`Name=MTA-v4, Family=inet')
4018	DAEMON_OPTIONS(`Name=MTA-v6, Family=inet6')
4019
4020A "Message Submission Agent" still uses all of the same rulesets for
4021processing the message (and therefore still allows message rejection via
4022the check_* rulesets).  In accordance with the RFC, the MSA will ensure
4023that all domains in envelope addresses are fully qualified if the message
4024is relayed to another MTA.  It will also enforce the normal address syntax
4025rules and log error messages.  Additionally, by using the M=a modifier you
4026can require authentication before messages are accepted by the MSA.
4027Notice: Do NOT use the 'a' modifier on a public accessible MTA!  Finally,
4028the M=E modifier shown above disables ETRN as required by RFC 2476.
4029
4030Mail filters can be defined using the INPUT_MAIL_FILTER() and MAIL_FILTER()
4031commands:
4032
4033	INPUT_MAIL_FILTER(`sample', `S=local:/var/run/f1.sock')
4034	MAIL_FILTER(`myfilter', `S=inet:3333@localhost')
4035
4036The INPUT_MAIL_FILTER() command causes the filter(s) to be called in the
4037same order they were specified by also setting confINPUT_MAIL_FILTERS.  A
4038filter can be defined without adding it to the input filter list by using
4039MAIL_FILTER() instead of INPUT_MAIL_FILTER() in your .mc file.
4040Alternatively, you can reset the list of filters and their order by setting
4041confINPUT_MAIL_FILTERS option after all INPUT_MAIL_FILTER() commands in
4042your .mc file.
4043
4044
4045+----------------------------+
4046| MESSAGE SUBMISSION PROGRAM |
4047+----------------------------+
4048
4049This section contains a list of caveats and
4050a few hints how for those who want to tweak the default configuration
4051for it (which is installed as submit.cf).
4052
4053Notice: do not add options/features to submit.mc unless you are
4054absolutely sure you need them.  Options you may want to change
4055include:
4056
4057- confTRUSTED_USERS, FEATURE(`use_ct_file'), and confCT_FILE for
4058  avoiding X-Authentication warnings.
4059- confTIME_ZONE to change it from the default `USE_TZ'.
4060- confDELIVERY_MODE is set to interactive in msp.m4 instead
4061  of the default background mode.
4062- FEATURE(stickyhost) and LOCAL_RELAY to send unqualified addresses
4063  to the LOCAL_RELAY instead of the default relay.
4064
4065The MSP performs hostname canonicalization by default.  Mail may end
4066up for various DNS related reasons in the MSP queue.  This problem
4067can be minimized by using
4068
4069	FEATURE(`nocanonify', `canonify_hosts')
4070	define(`confDIRECT_SUBMISSION_MODIFIERS', `C')
4071
4072See the discussion about nocanonify for possible side effects.
4073
4074Some things are not intended to work with the MSP.  These include
4075features that influence the delivery process (e.g., mailertable,
4076aliases), or those that are only important for a SMTP server (e.g.,
4077virtusertable, DaemonPortOptions, multiple queues).  Moreover,
4078relaxing certain restrictions (RestrictQueueRun, permissions on
4079queue directory) or adding features (e.g., enabling prog/file mailer)
4080can cause security problems.
4081
4082Other things don't work well with the MSP and require tweaking or
4083workarounds.
4084
4085The file and the map created by makemap should be owned by smmsp,
4086its group should be smmsp, and it should have mode 640.
4087
4088feature/msp.m4 defines almost all settings for the MSP.  Most of
4089those should not be changed at all.  Some of the features and options
4090can be overridden if really necessary.  It is a bit tricky to do
4091this, because it depends on the actual way the option is defined
4092in feature/msp.m4.  If it is directly defined (i.e., define()) then
4093the modified value must be defined after
4094
4095	FEATURE(`msp')
4096
4097If it is conditionally defined (i.e., ifdef()) then the desired
4098value must be defined before the FEATURE line in the .mc file.
4099To see how the options are defined read feature/msp.m4.
4100
4101
4102+--------------------------+
4103| FORMAT OF FILES AND MAPS |
4104+--------------------------+
4105
4106Files that define classes, i.e., F{classname}, consist of lines
4107each of which contains a single element of the class.  For example,
4108/etc/mail/local-host-names may have the following content:
4109
4110my.domain
4111another.domain
4112
4113Maps must be created using makemap(8) , e.g.,
4114
4115	makemap hash MAP < MAP
4116
4117In general, a text file from which a map is created contains lines
4118of the form
4119
4120key	value
4121
4122where 'key' and 'value' are also called LHS and RHS, respectively.
4123By default, the delimiter between LHS and RHS is a non-empty sequence
4124of white space characters.
4125
4126
4127+------------------+
4128| DIRECTORY LAYOUT |
4129+------------------+
4130
4131Within this directory are several subdirectories, to wit:
4132
4133m4		General support routines.  These are typically
4134		very important and should not be changed without
4135		very careful consideration.
4136
4137cf		The configuration files themselves.  They have
4138		".mc" suffixes, and must be run through m4 to
4139		become complete.  The resulting output should
4140		have a ".cf" suffix.
4141
4142ostype		Definitions describing a particular operating
4143		system type.  These should always be referenced
4144		using the OSTYPE macro in the .mc file.  Examples
4145		include "bsd4.3", "bsd4.4", "sunos3.5", and
4146		"sunos4.1".
4147
4148domain		Definitions describing a particular domain, referenced
4149		using the DOMAIN macro in the .mc file.  These are
4150		site dependent; for example, "CS.Berkeley.EDU.m4"
4151		describes hosts in the CS.Berkeley.EDU subdomain.
4152
4153mailer		Descriptions of mailers.  These are referenced using
4154		the MAILER macro in the .mc file.
4155
4156sh		Shell files used when building the .cf file from the
4157		.mc file in the cf subdirectory.
4158
4159feature		These hold special orthogonal features that you might
4160		want to include.  They should be referenced using
4161		the FEATURE macro.
4162
4163hack		Local hacks.  These can be referenced using the HACK
4164		macro.  They shouldn't be of more than voyeuristic
4165		interest outside the .Berkeley.EDU domain, but who knows?
4166
4167siteconfig	Site configuration -- e.g., tables of locally connected
4168		UUCP sites.
4169
4170
4171+------------------------+
4172| ADMINISTRATIVE DETAILS |
4173+------------------------+
4174
4175The following sections detail usage of certain internal parts of the
4176sendmail.cf file.  Read them carefully if you are trying to modify
4177the current model.  If you find the above descriptions adequate, these
4178should be {boring, confusing, tedious, ridiculous} (pick one or more).
4179
4180RULESETS (* means built in to sendmail)
4181
4182   0 *	Parsing
4183   1 *	Sender rewriting
4184   2 *	Recipient rewriting
4185   3 *	Canonicalization
4186   4 *	Post cleanup
4187   5 *	Local address rewrite (after aliasing)
4188  1x	mailer rules (sender qualification)
4189  2x	mailer rules (recipient qualification)
4190  3x	mailer rules (sender header qualification)
4191  4x	mailer rules (recipient header qualification)
4192  5x	mailer subroutines (general)
4193  6x	mailer subroutines (general)
4194  7x	mailer subroutines (general)
4195  8x	reserved
4196  90	Mailertable host stripping
4197  96	Bottom half of Ruleset 3 (ruleset 6 in old sendmail)
4198  97	Hook for recursive ruleset 0 call (ruleset 7 in old sendmail)
4199  98	Local part of ruleset 0 (ruleset 8 in old sendmail)
4200
4201
4202MAILERS
4203
4204   0	local, prog	local and program mailers
4205   1	[e]smtp, relay	SMTP channel
4206   2	uucp-*		UNIX-to-UNIX Copy Program
4207   3	netnews		Network News delivery
4208   4	fax		Sam Leffler's HylaFAX software
4209   5	mail11		DECnet mailer
4210
4211
4212MACROS
4213
4214   A
4215   B	Bitnet Relay
4216   C	DECnet Relay
4217   D	The local domain -- usually not needed
4218   E	reserved for X.400 Relay
4219   F	FAX Relay
4220   G
4221   H	mail Hub (for mail clusters)
4222   I
4223   J
4224   K
4225   L	Luser Relay
4226   M	Masquerade (who you claim to be)
4227   N
4228   O
4229   P
4230   Q
4231   R	Relay (for unqualified names)
4232   S	Smart Host
4233   T
4234   U	my UUCP name (if you have a UUCP connection)
4235   V	UUCP Relay (class {V} hosts)
4236   W	UUCP Relay (class {W} hosts)
4237   X	UUCP Relay (class {X} hosts)
4238   Y	UUCP Relay (all other hosts)
4239   Z	Version number
4240
4241
4242CLASSES
4243
4244   A
4245   B	domains that are candidates for bestmx lookup
4246   C
4247   D
4248   E	addresses that should not seem to come from $M
4249   F	hosts this system forward for
4250   G	domains that should be looked up in genericstable
4251   H
4252   I
4253   J
4254   K
4255   L	addresses that should not be forwarded to $R
4256   M	domains that should be mapped to $M
4257   N	host/domains that should not be mapped to $M
4258   O	operators that indicate network operations (cannot be in local names)
4259   P	top level pseudo-domains: BITNET, DECNET, FAX, UUCP, etc.
4260   Q
4261   R	domains this system is willing to relay (pass anti-spam filters)
4262   S
4263   T
4264   U	locally connected UUCP hosts
4265   V	UUCP hosts connected to relay $V
4266   W	UUCP hosts connected to relay $W
4267   X	UUCP hosts connected to relay $X
4268   Y	locally connected smart UUCP hosts
4269   Z	locally connected domain-ized UUCP hosts
4270   .	the class containing only a dot
4271   [	the class containing only a left bracket
4272
4273
4274M4 DIVERSIONS
4275
4276   1	Local host detection and resolution
4277   2	Local Ruleset 3 additions
4278   3	Local Ruleset 0 additions
4279   4	UUCP Ruleset 0 additions
4280   5	locally interpreted names (overrides $R)
4281   6	local configuration (at top of file)
4282   7	mailer definitions
4283   8	DNS based blacklists
4284   9	special local rulesets (1 and 2)
4285
4286$Revision: 8.716 $, Last updated $Date: 2007/01/08 18:32:25 $
4287ident	"%Z%%M%	%I%	%E% SMI"
4288