xref: /csrg-svn/usr.sbin/sendmail/cf/README (revision 67960)
151220Seric
251220Seric
357246Seric		NEW SENDMAIL CONFIGURATION FILES
451220Seric
557246Seric		Eric Allman <eric@CS.Berkeley.EDU>
651220Seric
7*67960Seric		@(#)README	8.41 (Berkeley) 11/21/94
851220Seric
951220Seric
1057246SericThis document describes the sendmail configuration files being used
1167469Sericat Berkeley.  These use features in the new (R8) sendmail; they will
1267469Sericnot work on other versions.
1351220Seric
1457246SericThese configuration files are probably not as general as previous
1565957Sericversions, and don't handle as many of the weird cases automagically.
1657246SericI was able to simplify by them for two reasons.  First, the network
1757246Serichas become more consistent -- for example, at this point, everyone
1857246Sericon the internet is supposed to be running a name server, so hacks to
1957246Serichandle NIC-registered hosts can go away.  Second, I assumed that a
2057246Sericsubdomain would be running SMTP internally -- UUCP is presumed to be
2157246Serica long-haul protocol.  I realize that this is not universal, but it
2257246Sericdoes describe the vast majority of sites with which I am familiar,
2357246Sericincluding those outside the US.
2451220Seric
2565957SericOf course, the downside of this is that if you do live in a weird
2665957Sericworld, things are going to get weirder for you.  I'm sorry about that,
2757246Sericbut at the time we at Berkeley had a problem, and it seemed like the
2857246Sericright thing to do.
2951220Seric
3057247SericThis package requires a post-V7 version of m4; if you are running the
3157247Seric4.2bsd, SysV.2, or 7th Edition version, I suggest finding a friend with
3257247Serica newer version.  You can m4-expand on their system, then run locally.
3365002SericSunOS's /usr/5bin/m4 or BSD-Net/2's m4 both work.  GNU m4 version 1.1
3465002Sericalso works.  Unfortunately, I'm told that the M4 on BSDI 1.0 doesn't
3565002Sericwork -- you'll have to use a Net/2 or GNU version.
3651220Seric
3758284SericIF YOU DON'T HAVE A BERKELEY MAKE, don't despair!  Just run
3864371Seric"m4 foo.mc > foo.cf" -- that should be all you need.  There is also
3964371Serica fairly crude (but functional) Makefile.dist that works on the
4064371Sericold version of make.
4158284Seric
4258284SericTo get started, you may want to look at tcpproto.mc (for TCP-only
4364324Sericsites), uucpproto.mc (for UUCP-only sites), and clientproto.mc (for
4464324Sericclusters of clients using a single mail host).  Others are versions
4558284Sericthat we use at Berkeley, although not all are in current use.  For
4658284Sericexample, ucbarpa has gone away, but I've left ucbarpa.mc in because
4758284Sericit demonstrates some interesting techniques.
4858284Seric
4957246SericI'm not pretending that this README describes everything that these
5057246Sericconfiguration files can do; clever people can probably tweak them
5157246Sericto great effect.  But it should get you started.
5257246Seric
5365509Seric*******************************************************************
5465509Seric***  BE SURE YOU CUSTOMIZE THESE FILES!  They have some		***
5565509Seric***  Berkeley-specific assumptions built in, such as the name	***
5665509Seric***  of our UUCP-relay.  You'll want to create your own domain	***
5765509Seric***  description, and use that in place of domain/Berkeley.m4.	***
5865509Seric*******************************************************************
5958087Seric
6065509Seric
6157246Seric+--------------------------+
6257246Seric| INTRODUCTION AND EXAMPLE |
6357246Seric+--------------------------+
6457246Seric
6557246SericConfiguration files are contained in the subdirectory "cf", with a
6657246Sericsuffix ".mc".  They must be run through "m4" to produce a ".cf" file.
6757246Seric
6851220SericLet's examine a typical .mc file (cf/cs-exposed.mc):
6951220Seric
7051220Seric	divert(-1)
7151220Seric	#
7251220Seric	# Copyright (c) 1983 Eric P. Allman
7351220Seric	# Copyright (c) 1988 The Regents of the University of California.
7451220Seric	# All rights reserved.
7551220Seric	#
7651220Seric	# Redistribution and use in source and binary forms are permitted
7751220Seric	# provided that the above copyright notice and this paragraph are
7851220Seric	# duplicated in all such forms and that any documentation,
7951220Seric	# advertising materials, and other materials related to such
8051220Seric	# distribution and use acknowledge that the software was developed
8151220Seric	# by the University of California, Berkeley.  The name of the
8251220Seric	# University may not be used to endorse or promote products derived
8351220Seric	# from this software without specific prior written permission.
8451220Seric	# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
8551220Seric	# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
8651220Seric	# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
8751220Seric	#
8851220Seric
8957246SericThe divert(-1) will delete the crud in the resulting output file.
9057247SericThe copyright notice is what your lawyers require.  Our lawyers require
9157246Sericthe one that I've included in my files. A copyleft is a copyright by
9257246Sericanother name.
9351220Seric
9457246SericThe next line MUST be
9557246Seric
9651220Seric	include(`../m4/cf.m4')
9751220Seric
9857246SericThis will pull in the M4 macros you will need to make sense of
9957246Sericeverything else.  As the saying goes, don't think about it, just
10057246Sericdo it.  If you don't do it, don't bother reading the rest of this
10157246Sericfile.
10251220Seric
10356778Seric	VERSIONID(`<SCCS or RCS version id>')
10451220Seric
10551220SericVERSIONID is a macro that stuffs the version information into the
10651220Sericresulting file.  We use SCCS; you could use RCS, something else, or
10757246Sericomit it completely.  This is not the same as the version id included
10857246Sericin SMTP greeting messages -- this is defined in m4/version.m4.
10951220Seric
11051268Seric	DOMAIN(cs.exposed)
11151220Seric
11251220SericThis example exposes the host inside of the CS subdomain -- that is,
11351220Sericit doesn't try to hide the name of the workstation to the outside
11451220Sericworld.  Changing this to DOMAIN(cs.hidden) would have made outgoing
11551220Sericmessages refer to "<username>@CS.Berkeley.EDU" instead of using the
11663857Sericlocal hostname.  Internally this is effected by using
11757246Seric"MASQUERADE_AS(CS.Berkeley.EDU)".
11851220Seric
11951268Seric	MAILER(smtp)
12051220Seric
12151309SericThese describe the mailers used at the default CS site site.  The
12251309Sericlocal mailer is always included automatically.
12351220Seric
12458087Seric
12557246Seric+--------+
12657246Seric| OSTYPE |
12757246Seric+--------+
12857246Seric
12951220SericNote that cf/cs-exposed.mc omits an OSTYPE macro -- this assumes
13051220Sericdefault Computer Science Division environment.  There are several
13157247Sericexplicit environments available: bsd4.3, bsd4.4, hpux, irix, osf1,
13257247Sericriscos4.5, sunos3.5, sunos4.1, and ultrix4.1.  These change things
13357247Sericlike the location of the alias file and queue directory.  Some of
13457247Sericthese files are identical to one another.
13551220Seric
13657246SericOperating system definitions are easy to write.  They may define
13757246Sericthe following variables (everything defaults, so an ostype file
13857246Sericmay be empty).
13951220Seric
14057246SericALIAS_FILE		[/etc/aliases] The location of the text version
14159761Seric			of the alias file(s).  It can be a comma-separated
14266790Seric			list of names (but be sure you quote values with
14366790Seric			comments in them -- for example, use
14466790Seric				define(`ALIAS_FILE', `a,b')
14566790Seric			to get "a" and "b" both listed as alias files;
14666790Seric			otherwise the define() primitive only sees "a").
14757246SericHELP_FILE		[/usr/lib/sendmail.hf] The name of the file
14857246Seric			containing information printed in response to
14957246Seric			the SMTP HELP command.
15057246SericQUEUE_DIR		[/var/spool/mqueue] The directory containing
15157246Seric			queue files.
15257246SericSTATUS_FILE		[/etc/sendmail.st] The file containing status
15357246Seric			information.
15458087SericLOCAL_MAILER_PATH	[/bin/mail] The program used to deliver local mail.
15564153SericLOCAL_MAILER_FLAGS	[rmn] The flags used by the local mailer.  The
15664153Seric			flags lsDFM are always included.
15763761SericLOCAL_MAILER_ARGS	[mail -d $u] The arguments passed to deliver local
15863761Seric			mail.
15958087SericLOCAL_SHELL_PATH	[/bin/sh] The shell used to deliver piped email.
16063791SericLOCAL_SHELL_FLAGS	[eu] The flags used by the shell mailer.  The
16163791Seric			flags lsDFM are always included.
16263791SericLOCAL_SHELL_ARGS	[sh -c $u] The arguments passed to deliver "prog"
16363791Seric			mail.
16458087SericUSENET_MAILER_PATH	[/usr/lib/news/inews] The name of the program
16558087Seric			used to submit news.
16658087SericUSENET_MAILER_FLAGS	[rlsDFMmn] The mailer flags for the usenet mailer.
16758087SericUSENET_MAILER_ARGS	[-m -h -n] The command line arguments for the
16858087Seric			usenet mailer.
16965911SericUSENET_MAILER_MAX	[100000] The maximum size of messages that will
17065911Seric			be accepted by the usenet mailer.
17163857SericSMTP_MAILER_FLAGS	[undefined] Flags added to SMTP mailer.  Default
17267915Seric			flags are `mDFMUX' for all SMTP-based mailers; the
17367915Seric			"esmtp" mailer adds `a' and "smtp8" adds `8'.
17465911SericSMTP_MAILER_MAX		[undefined] The maximum size of messages that will
17567915Seric			be transported using the smtp, smtp8, or esmtp
17667915Seric			mailers.
17767915SericSMTP_MAILER_ARGS	[IPC $h] The arguments passed to the smtp mailer.
17867915Seric			About the only reason you would want to change this
17967915Seric			would be to change the default port.
18067915SericESMTP_MAILER_ARGS	[IPC $h] The arguments passed to the esmtp mailer.
18167915SericSMTP8_MAILER_ARGS	[IPC $h] The arguments passed to the smtp8 mailer.
18267915SericRELAY_MAILER_ARGS	[IPC $h] The arguments passed to the relay mailer.
18363857SericUUCP_MAILER_FLAGS	[undefined] Flags added to UUCP mailer.  Default
18463857Seric			flags are `DFMhuU' (and `m' for suucp mailer, minus
18563857Seric			`U' for uucp-dom mailer).
18663761SericUUCP_MAILER_ARGS	[uux - -r -z -a$f -gC $h!rmail ($u)] The arguments
18763761Seric			passed to the UUCP mailer.
18863791SericUUCP_MAX_SIZE		[100000] The maximum size message accepted for
18963791Seric			transmission by the UUCP mailers.
19065911SericFAX_MAILER_PATH		[/usr/local/lib/fax/mailfax] The program used to
19165911Seric			submit FAX messages.
19265911SericFAX_MAILER_MAX		[100000] The maximum size message accepted for
19365911Seric			transmission by FAX.
19467934SericPOP_MAILER_PATH		[/usr/lib/mh/spop] The pathname of the POP mailer.
19567934SericPOP_MAILER_FLAGS	[Penu] Flags added to POP mailer.  Flags "lsDFM"
19667934Seric			are always added.
19767934SericPOP_MAILER_ARGS		[pop $u] The arguments passed to the POP mailer.
19867942SericPROCMAIL_MAILER_FLAGS	[Shu] Flags added to Procmail mailer.  Flags
19967942Seric			``DFMmn'' are always set.
20067942SericPROCMAIL_MAILER_ARGS	[procmail -m $h $f $u] The arguments passed to
20167942Seric			the Procmail mailer.
20257246Seric
20357246Seric+---------+
20457246Seric| DOMAINS |
20557246Seric+---------+
20657246Seric
20757246SericYou will probably want to collect domain-dependent defines into one
20857246Sericfile, referenced by the DOMAIN macro.  For example, our Berkeley
20957246Sericdomain file includes definitions for several internal distinguished
21057246Serichosts:
21157246Seric
21257246SericUUCP_RELAY	The host that will forward UUCP-addressed email.
21357246Seric		If not defined, all UUCP sites must be directly
21464028Seric		connected.
21557246SericBITNET_RELAY	The host that will forward BITNET-addressed email.
21657246Seric		If not defined, the .BITNET pseudo-domain won't work.
21757246SericLOCAL_RELAY	The site that will handle unqualified names -- that
21857246Seric		is, names with out an @domain extension.  If not set,
21957246Seric		they are assumed to belong on this machine.  This
22057246Seric		allows you to have a central site to store a
22157246Seric		company- or department-wide alias database.  This
22257246Seric		only works at small sites, and there are better
22364028Seric		methods.
22467915SericLUSER_RELAY	The site that will handle lusers -- that is, apparently
22567915Seric		local names that aren't local accounts or aliases.
22657246Seric
22767915SericAny of these can be either ``mailer:hostname'' (in which case the
22864028Sericmailer is the internal mailer name, such as ``suucp'' and the hostname
22964028Sericis the name of the host as appropriate for that mailer) or just a
23064028Seric``hostname'', in which case a default mailer type (usually ``relay'',
23164153Serica variant on SMTP) is used.  WARNING: if you have a wildcard MX
23264153Sericrecord matching your domain, you probably want to define these to
23364153Serichave a trailing dot so that you won't get the mail diverted back
23464153Sericto yourself.
23564028Seric
23657246SericThe domain file can also be used to define a domain name, if needed
23757982Seric(using "DD<domain>") and set certain site-wide features.  If all hosts
23857982Sericat your site masquerade behind one email name, you could also use
23957982SericMASQUERADE_AS here.
24057246Seric
24158408SericYou do not have to define a domain -- in particular, if you are a
24258408Sericsingle machine sitting off somewhere, it is probably more work than
24358408Sericit's worth.  This is just a mechanism for combining "domain dependent
24458408Sericknowledge" into one place.
24558408Seric
24657246Seric+---------+
24757246Seric| MAILERS |
24857246Seric+---------+
24957246Seric
25051220SericThere are fewer mailers supported in this version than the previous
25151220Sericversion, owing mostly to a simpler world.
25251220Seric
25351220Sericlocal		The local and prog mailers.  You will almost always
25451220Seric		need these; the only exception is if you relay ALL
25557247Seric		your mail to another site.  This mailer is included
25657247Seric		automatically.
25751220Seric
25851220Sericsmtp		The Simple Mail Transport Protocol mailer.  This does
25951220Seric		not hide hosts behind a gateway or another other
26051220Seric		such hack; it assumes a world where everyone is
26163761Seric		running the name server.  This file actually defines
26267915Seric		four mailers: "smtp" for regular (old-style) SMTP to
26363761Seric		other servers, "esmtp" for extended SMTP to other
26467915Seric		servers, "smtp8" to do SMTP to other servers without
26567915Seric		converting 8-bit data to MIME (essentially, this is
26667915Seric		your statement that you know the other end is 8-bit
26767915Seric		clean even if it doesn't say so), and "relay" for
26867915Seric		transmission to our RELAY_HOST, LUSER_RELAY, or
26967915Seric		MAILER_HUB.
27051220Seric
27151220Sericuucp		The Unix-to-Unix Copy Program mailer.  Actually, this
27267471Seric		defines two mailers, "uucp-old" (a.k.a. "uucp") and
27367471Seric		"uucp-new" (a.k.a. "suucp").  The latter is for when you
27467471Seric		know that the UUCP mailer at the other end can handle
27567471Seric		multiple recipients in one transfer.  If the smtp mailer
27667471Seric		is also included in your configuration, two other mailers
27767471Seric		("uucp-dom" and "uucp-uudom") are also defined.  When you
27867471Seric		include the uucp mailer, sendmail looks for all names in
27965218Seric		the $=U class and sends them to the uucp-old mailer; all
28065218Seric		names in the $=Y class are sent to uucp-new; and all
28165218Seric		names in the $=Z class are sent to uucp-uudom.  Note that
28257246Seric		this is a function of what version of rmail runs on
28357246Seric		the receiving end, and hence may be out of your control.
28465218Seric		See the section below describing UUCP mailers in more
28565218Seric		detail.
28651220Seric
28758087Sericusenet		Usenet (network news) delivery.  If this is specified,
28858087Seric		an extra rule is added to ruleset 0 that forwards all
28958087Seric		local email for users named ``group.usenet'' to the
29058087Seric		``inews'' program.  Note that this works for all groups,
29158087Seric		and may be considered a security problem.
29258087Seric
29358363Sericfax		Facsimile transmission.  This is experimental and based
29458363Seric		on Sam Leffler's FlexFAX software.  For more information,
29558363Seric		see below.
29658087Seric
29765148Sericpop		Post Office Protocol.
29858363Seric
29967942Sericprocmail	An interface to procmail (does not come with sendmail).
30067942Seric		This is designed to be used in mailertables.  For example,
30167942Seric		a common question is "how do I forward all mail for a given
30267942Seric		domain to a single person?".  If you have this mailer
30367942Seric		defined, you could set up a mailertable reading:
30467942Seric
30567942Seric			host.com	procmail:/etc/procmailrcs/host.com
30667942Seric
30767942Seric		with the file /etc/procmailrcs/host.com reading:
30867942Seric
30967942Seric			:0	# forward mail for host.com
31067942Seric			! -oi -f $1 person@other.host
31167942Seric
31267942Seric		This would arrange for (anything)@host.com to be sent
31367942Seric		to person@other.host.  Within the procmail script, $1 is
31467942Seric		the name of the sender and $2 is the name of the recipient.
31567942Seric		If you use this with FEATURE(local_procmail), the FEATURE
31667942Seric		should be listed first.
31767942Seric
31867929SericThe local mailer accepts addresses of the form "user+detail", where
31967929Sericthe "+detail" is not used for mailbox matching but is available
32067942Sericto certain local mail programs (in particular, see FEATURE(local_procmail)).
32167929SericFor example, "eric", "eric+sendmail", and "eric+sww" all indicate
32267929Sericthe same user, but additional arguments <null>, "sendmail", and "sww"
32367929Sericmay be provided for use in sorting mail.
32465148Seric
32567929Seric
32657246Seric+----------+
32757246Seric| FEATURES |
32857246Seric+----------+
32951268Seric
33057246SericSpecial features can be requested using the "FEATURE" macro.  For
33157246Sericexample, the .mc line:
33257246Seric
33357246Seric	FEATURE(use_cw_file)
33457246Seric
33557246Serictells sendmail that you want to have it read an /etc/sendmail.cw
33658782Sericfile to get values for class $=w.  The FEATURE may contain a single
33758782Sericoptional parameter -- for example:
33857246Seric
33958782Seric	FEATURE(mailertable, dbm /usr/lib/mailertable)
34058782Seric
34158782SericAvailable features are:
34258782Seric
34357246Sericuse_cw_file	Read the file /etc/sendmail.cw file to get alternate
34457246Seric		names for this host.  This might be used if you were
34557246Seric		on a host that MXed for a dynamic set of other
34657246Seric		hosts.  If the set is static, just including the line
34757246Seric		"Cw<name1> <name2> ..." is probably superior.
34858408Seric		The actual filename can be overridden by redefining
34958408Seric		confCW_FILE.
35064324Seric
35158087Sericredirect	Reject all mail addressed to "address.REDIRECT" with
35258087Seric		a ``551 User not local; please try <address>'' message.
35358087Seric		If this is set, you can alias people who have left
35458087Seric		to their new address with ".REDIRECT" appended.
35564324Seric
35658284Sericnouucp		Don't do anything special with UUCP addresses at all.
35764324Seric
35859080Sericnocanonify	Don't pass addresses to $[ ... $] for canonification.
35959080Seric		This would generally only be used by sites that only
36059080Seric		act as mail gateways or which have user agents that do
36164028Seric		full canonification themselves.  You may also want to
36264028Seric		use "define(`confBIND_OPTS',`-DNSRCH -DEFNAMES')" to
36364028Seric		turn off the usual resolver options that do a similar
36464028Seric		thing.
36564324Seric
36667917Sericstickyhost	If set, email sent to "user@local.host" are marked
36758526Seric		as "sticky" -- that is, the local addresses aren't
36858526Seric		matched against UDB and don't go through ruleset 5.
36967915Seric		This is used if you want a set up where "user" is
37067915Seric		not necessarily the same as "user@local.host", e.g.,
37167915Seric		to make a distinct domain-wide namespace.  Prior to
37267915Seric		8.7 this was the default, and notsticky was used to
37367915Seric		turn this off.
37464324Seric
37558782Sericmailertable	Include a "mailer table" which can be used to override
37658782Seric		routing for particular domains.  The argument of the
37758782Seric		FEATURE may be the key definition.  If none is specified,
37858782Seric		the definition used is:
37964164Seric			hash -o /etc/mailertable
38063761Seric		Keys in this database are fully qualified domain names
38163761Seric		or partial domains preceded by a dot -- for example,
38263761Seric		"vangogh.CS.Berkeley.EDU" or ".CS.Berkeley.EDU".
38363761Seric		Values must be of the form:
38458782Seric			mailer:domain
38563761Seric		where "mailer" is the internal mailer name, and "domain"
38663761Seric		is where to send the message.  These maps are not
38763761Seric		reflected into the message header.
38864324Seric
38963761Sericdomaintable	Include a "domain table" which can be used to provide
39067451Seric		domain name mapping.  Use of this should really be
39167451Seric		limited to your own domains.  It may be useful if you
39267451Seric		change names (e.g., your company changes names from
39367451Seric		oldname.com to newname.com).  The argument of the
39467451Seric		FEATURE may be the key definition.  If none is specified,
39567451Seric		the definition used is:
39664164Seric			hash -o /etc/domaintable
39767451Seric		The key in this table is the domain name; the value is
39867451Seric		the new (fully qualified) domain.  Anything in the
39963761Seric		domaintable is reflected into headers; that is, this
40063761Seric		is done in ruleset 3.
40164324Seric
40259034Sericbitdomain	Look up bitnet hosts in a table to try to turn them into
40359034Seric		internet addresses.  The table can be built using the
40464153Seric		bitdomain program contributed by John Gardiner Myers.
40559034Seric		The argument of the FEATURE may be the key definition; if
40659034Seric		none is specified, the definition used is:
40764164Seric			hash -o /etc/bitdomain.db
40859034Seric		Keys are the bitnet hostname; values are the corresponding
40959034Seric		internet hostname.
41064324Seric
41159037Sericuucpdomain	Similar feature for UUCP hosts.  The default map definition
41259037Seric		is:
41364164Seric			hash -o /etc/uudomain.db
41459037Seric		At the moment there is no automagic tool to build this
41559037Seric		database.
41664324Seric
41760263Sericalways_add_domain
41860263Seric		Include the local host domain even on locally delivered
41960263Seric		mail.  Normally it is not added unless it is already
42060263Seric		present.
42164324Seric
42263761Sericallmasquerade	If masquerading is enabled (using MASQUERADE_AS), this
42363761Seric		feature will cause recipient addresses to also masquerade
42463761Seric		as being from the masquerade host.  Normally they get
42563761Seric		the local hostname.  Although this may be right for
42663761Seric		ordinary users, it can break local aliases.  For example,
42763761Seric		if you send to "localalias", the originating sendmail will
42863761Seric		find that alias and send to all members, but send the
42963761Seric		message with "To: localalias@masqueradehost".  Since that
43063761Seric		alias likely does not exist, replies will fail.  Use this
43163761Seric		feature ONLY if you can guarantee that the ENTIRE
43263761Seric		namespace on your masquerade host supersets all the
43363761Seric		local entries.
43464324Seric
43564153Sericnodns		We aren't running DNS at our site (for example,
43664153Seric		we are UUCP-only connected).  It's hard to consider
43764153Seric		this a "feature", but hey, it had to go somewhere.
43857246Seric
43964324Sericnullclient	This is a special case -- it creates a stripped down
44064324Seric		configuration file containing nothing but support for
44164394Seric		forwarding all mail to a central hub via a local
44264394Seric		SMTP-based network.  The argument is the name of that
44364394Seric		hub.
44464394Seric
44564394Seric		The only other feature that should be used in conjunction
44664394Seric		with this one is "nocanonify" (this causes addresses to
44764394Seric		be sent unqualified via the SMTP connection; normally
44864394Seric		they are qualifed with the masquerade name, which
44964394Seric		defaults to the name of the hub machine).  No mailers
45064394Seric		should be defined.  No aliasing or forwarding is done.
45157246Seric
45267942Sericlocal_procmail	Use procmail as the local mailer.  This mailer can
45367929Seric		make use of the "user+indicator@local.host" syntax;
45467929Seric		normally the +indicator is just tossed, but by default
45567929Seric		it is passed as the -a argument to procmail.  The
45667929Seric		argument to this feature is the pathname of procmail,
45767929Seric		which defaults to /usr/local/bin/procmail.
45864324Seric
45967929Seric
46057246Seric+-------+
46157246Seric| HACKS |
46257246Seric+-------+
46357246Seric
46457246SericSome things just can't be called features.  To make this clear,
46557247Sericthey go in the hack subdirectory and are referenced using the HACK
46657246Sericmacro.  These will tend to be site-dependent.  The release
46757246Sericincludes the Berkeley-dependent "cssubdomain" hack (that makes
46857246Sericsendmail accept local names in either Berkeley.EDU or CS.Berkeley.EDU;
46957246Sericthis is intended as a short-term aid while we move hosts into
47057246Sericsubdomains.
47157246Seric
47258087Seric
47357246Seric+--------------------+
47457246Seric| SITE CONFIGURATION |
47557246Seric+--------------------+
47657246Seric
47757246SericComplex sites will need more local configuration information, such as
47857246Sericlists of UUCP hosts they speak with directly.  This can get a bit more
47957246Serictricky.  For an example of a "complex" site, see cf/ucbvax.mc.
48057246Seric
48166336SericIf your host is known by several different names, you need to augment
48266336Sericthe $=w class.  This is a list of names by which you are known, and
48366336Sericanything sent to an address using a host name in this list will be
48466336Serictreated as local mail.  You can do this in two ways: either create
48566336Sericthe file /etc/sendmail.cw containing a list of your aliases (one per
48666336Sericline), and use ``FEATURE(use_cw_file)'' in the .mc file, or add the
48766336Sericline:
48866336Seric
48966336Seric	Cw alias.host.name
49066336Seric
49166336Sericat the end of that file.  See the ``vangogh.mc'' file for an example.
49266336SericBe sure you use the fully-qualified name of the host, rather than a
49366336Sericshort name.
49466336Seric
49557246SericThe SITECONFIG macro allows you to indirectly reference site-dependent
49657246Sericconfiguration information stored in the siteconfig subdirectory.  For
49757246Sericexample, the line
49857246Seric
49957246Seric	SITECONFIG(uucp.ucbvax, ucbvax, U)
50057246Seric
50157246Sericreads the file uucp.ucbvax for local connection information.  The
50257246Sericsecond parameter is the local name (in this case just "ucbvax" since
50366336Sericit is locally connected, and hence a UUCP hostname).  The third
50466336Sericparameter is the name of both a macro to store the local name (in
50566336Sericthis case, $U) and the name of the class (e.g., $=U) in which to store
50666336Sericthe host information read from the file.  Another SITECONFIG line reads
50757246Seric
50857246Seric	SITECONFIG(uucp.ucbarpa, ucbarpa.Berkeley.EDU, W)
50957246Seric
51057246SericThis says that the file uucp.ucbarpa contains the list of UUCP sites
51157246Sericconnected to ucbarpa.Berkeley.EDU.  The $=W class will be used to
51266336Sericstore this list, and $W is defined to be ucbarpa.Berkeley.EDU, that
51366336Sericis, the name of the relay to which the hosts listed in uucp.ucbarpa
51466336Sericare connected.  [The machine ucbarpa is gone now, but I've left
51557246Sericthis out-of-date configuration file around to demonstrate how you
51657246Sericmight do this.]
51757246Seric
51866336SericNote that the case of SITECONFIG with a third parameter of ``U'' is
51966336Sericspecial; the second parameter is assumed to be the UUCP name of the
52066336Sericlocal site, rather than the name of a remote site, and the UUCP name
52166336Sericis entered into $=w (the list of local hostnames) as $U.UUCP.
52266336Seric
52357246SericThe siteconfig file (e.g., siteconfig/uucp.ucbvax.m4) contains nothing
52457246Sericmore than a sequence of SITE macros describing connectivity.  For
52557246Sericexample:
52657246Seric
52757246Seric	SITE(cnmat)
52857246Seric	SITE(sgi olympus)
52957246Seric
53057246SericThe second example demonstrates that you can use two names on the
53157246Sericsame line; these are usually aliases for the same host (or are at
53257246Sericleast in the same company).
53357246Seric
53458087Seric
53565218Seric+--------------------+
53665218Seric| USING UUCP MAILERS |
53765218Seric+--------------------+
53865218Seric
53965218SericIt's hard to get UUCP mailers right because of the extremely ad hoc
54065218Sericnature of UUCP addressing.  These config files are really designed
54165218Sericfor domain-based addressing, even for UUCP sites.
54265218Seric
54365218SericThere are four UUCP mailers available.  The choice of which one to
54465218Sericuse is partly a matter of local preferences and what is running at
54565218Sericthe other end of your UUCP connection.  Unlike good protocols that
54665218Sericdefine what will go over the wire, UUCP uses the policy that you
54765218Sericshould do what is right for the other end; if they change, you have
54865218Sericto change.  This makes it hard to do the right thing, and discourages
54965218Sericpeople from updating their software.  In general, if you can avoid
55065218SericUUCP, please do.
55165218Seric
55265218SericThe major choice is whether to go for a domainized scheme or a
55365218Sericnon-domainized scheme.  This depends entirely on what the other
55465218Sericend will recognize.  If at all possible, you should encourage the
55565218Sericother end to go to a domain-based system -- non-domainized addresses
55665218Sericdon't work entirely properly.
55765218Seric
55865218SericThe four mailers are:
55965218Seric
56065218Seric    uucp-old (obsolete name: "uucp")
56165218Seric	This is the oldest, the worst (but the closest to UUCP) way of
56265218Seric	sending messages accros UUCP connections.  It does bangify
56365218Seric	everything and prepends $U (your UUCP name) to the sender's
56465218Seric	address (which can already be a bang path itself).  It can
56565218Seric	only send to one address at a time, so it spends a lot of
56665218Seric	time copying duplicates of messages.  Avoid this if at all
56765218Seric	possible.
56865218Seric
56965218Seric    uucp-new (obsolete name: "suucp")
57065218Seric	The same as above, except that it assumes that in one rmail
57165218Seric	command you can specify several recipients.  It still has a
57265218Seric	lot of other problems.
57365218Seric
57465218Seric    uucp-dom
57565218Seric	This UUCP mailer keeps everything as domain addresses.
57667471Seric	Basically, it uses the SMTP mailer rewriting rules.  This mailer
57767471Seric	is only included if MAILER(smtp) is also specified.
57865218Seric
57965218Seric	Unfortunately, a lot of UUCP mailer transport agents require
58065218Seric	bangified addresses in the envelope, although you can use
58165218Seric	domain-based addresses in the message header.  (The envelope
58265218Seric	shows up as the From_ line on UNIX mail.)  So....
58365218Seric
58465218Seric    uucp-uudom
58565218Seric	This is a cross between uucp-new (for the envelope addresses)
58665218Seric	and uucp-dom (for the header addresses).  It bangifies the
58765218Seric	envelope sender (From_ line in messages) without adding the
58865218Seric	local hostname, unless there is no host name on the address
58965218Seric	at all (e.g., "wolf") or the host component is a UUCP host name
59065218Seric	instead of a domain name ("somehost!wolf" instead of
59167471Seric	"some.dom.ain!wolf").  This is also included only if MAILER(smtp)
59267471Seric	is also specified.
59365218Seric
59465218SericExamples:
59565218Seric
59665218SericWe are on host grasp.insa-lyon.fr (UUCP host name "grasp").  The
59765218Sericfollowing summarizes the sender rewriting for various mailers.
59865218Seric
59965218SericMailer          sender		rewriting in the envelope
60065218Seric------		------		-------------------------
60165218Sericuucp-{old,new}	wolf		grasp!wolf
60265218Sericuucp-dom	wolf		wolf@grasp.insa-lyon.fr
60365218Sericuucp-uudom	wolf		grasp.insa-lyon.fr!wolf
60465218Seric
60565218Sericuucp-{old,new}	wolf@fr.net	grasp!fr.net!wolf
60665218Sericuucp-dom	wolf@fr.net	wolf@fr.net
60765218Sericuucp-uudom	wolf@fr.net	fr.net!wolf
60865218Seric
60965218Sericuucp-{old,new}	somehost!wolf	grasp!somehost!wolf
61065218Sericuucp-dom	somehost!wolf	somehost!wolf@grasp.insa-lyon.fr
61165218Sericuucp-uudom	somehost!wolf	grasp.insa-lyon.fr!somehost!wolf
61265218Seric
61365218SericIf you are using one of the domainized UUCP mailers, you really want
61465218Sericto convert all UUCP addresses to domain format -- otherwise, it will
61565218Sericdo it for you (and probably not the way you expected).  For example,
61665218Sericif you have the address foo!bar!baz (and you are not sending to foo),
61765218Sericthe heuristics will add the @uucp.relay.name or @local.host.name to
61865218Sericthis address.  However, if you map foo to foo.host.name first, it
61965218Sericwill not add the local hostname.  You can do this using the uucpdomain
62065218Sericfeature.
62165218Seric
62265218Seric
62357246Seric+-------------------+
62457246Seric| TWEAKING RULESETS |
62557246Seric+-------------------+
62657246Seric
62751268SericFor more complex configurations, you can define special rules.
62851268SericThe macro LOCAL_RULE_3 introduces rules that are used in canonicalizing
62951268Sericthe names.  Any modifications made here are reflected in the header.
63051268Seric
63151268SericA common use is to convert old UUCP addreses to SMTP addresses using
63251268Sericthe UUCPSMTP macro.  For example:
63351268Seric
63451268Seric	LOCAL_RULE_3
63551268Seric	UUCPSMTP(decvax,	decvax.dec.com)
63651268Seric	UUCPSMTP(research,	research.att.com)
63751268Seric
63851268Sericwill cause addresses of the form "decvax!user" and "research!user"
63951268Sericto be converted to "user@decvax.dec.com" and "user@research.att.com"
64051268Sericrespectively.
64151268Seric
64265957SericThis could also be used to look up hosts in a database map:
64357246Seric
64457246Seric	LOCAL_RULE_3
64557246Seric	R$* < @ $+ > $*		$: $1 < @ $(hostmap $2 $) > $3
64657246Seric
64757246SericThis map would be defined in the LOCAL_CONFIG portion, as shown below.
64857246Seric
64951268SericSimilarly, LOCAL_RULE_0 can be used to introduce new parsing rules.
65051268SericFor example, new rules are needed to parse hostnames that you accept
65151309Sericvia MX records.  For example, you might have:
65251268Seric
65351309Seric	LOCAL_RULE_0
65465986Seric	R$+ <@ host.dom.ain.>	$#uucp $@ cnmat $: $1 < @ host.dom.ain.>
65551309Seric
65651309SericYou would use this if you had installed an MX record for cnmat.Berkeley.EDU
65751309Sericpointing at this host; this rule catches the message and forwards it on
65851309Sericusing UUCP.
65951309Seric
66058681SericYou can also tweak rulesets 1 and 2 using LOCAL_RULE_1 and LOCAL_RULE_2.
66158681SericThese rulesets are normally empty.
66258681Seric
66357246SericA similar macro is LOCAL_CONFIG.  This introduces lines added after the
66457246Sericboilerplate option setting but before rulesets, and can be used to
66557945Sericdeclare local database maps or whatever.  For example:
66651268Seric
66757246Seric	LOCAL_CONFIG
66857246Seric	Khostmap hash /etc/hostmap.db
66957246Seric	Kyplocal nis -m hosts.byname
67051220Seric
67158087Seric
67257246Seric+---------------------------+
67357246Seric| MASQUERADING AND RELAYING |
67457246Seric+---------------------------+
67557246Seric
67657246SericYou can have your host masquerade as another using
67757246Seric
67857246Seric	MASQUERADE_AS(host.domain)
67957246Seric
68065957SericThis causes outgoing SMTP mail to be labeled as coming from the
68157246Sericindicated domain, rather than $j.  One normally masquerades as one
68265957Sericof one's own subdomains (for example, it's unlikely that I would
68357246Sericchoose to masquerade as an MIT site).
68457246Seric
68564153SericThe masquerade name is not normally canonified, so it is important
68664153Sericthat it be your One True Name, that is, fully qualified and not a
68764153SericCNAME.
68864153Seric
68957246Sericthere are always users that need to be "exposed" -- that is, their
69057246Sericinternal site name should be displayed instead of the masquerade name.
69157246SericRoot is an example.  You can add users to this list using
69257246Seric
69357246Seric	EXPOSED_USER(usernames)
69457246Seric
69557246SericThis adds users to class E; you could also use something like
69657246Seric
69757246Seric	FE/etc/sendmail.cE
69857246Seric
69957246SericYou can also arrange to relay all unqualified names (that is, names
70057246Sericwithout @host) to a relay host.  For example, if you have a central
70157246Sericemail server, you might relay to that host so that users don't have
70257246Sericto have .forward files or aliases.  You can do this using
70357246Seric
70458071Seric	define(`LOCAL_RELAY', mailer:hostname)
70557246Seric
70658071SericThe ``mailer:'' can be omitted, in which case the mailer defaults to
70758071Seric"smtp".  There are some user names that you don't want relayed, perhaps
70858071Sericbecause of local aliases.  A common example is root, which may be
70958071Sericlocally aliased.  You can add entries to this list using
71057246Seric
71157246Seric	LOCAL_USER(usernames)
71257246Seric
71357246SericThis adds users to class L; you could also use something like
71457246Seric
71557246Seric	FL/etc/sendmail.cL
71657246Seric
71764153SericIf you want all incoming mail sent to a centralized hub, as for a
71864153Sericshared /var/spool/mail scheme, use
71957591Seric
72058071Seric	define(`MAIL_HUB', mailer:hostname)
72157591Seric
72258071SericAgain, ``mailer:'' defaults to "smtp".  If you define both LOCAL_RELAY
72366047Sericand MAIL_HUB, unqualified names will be sent to the LOCAL_RELAY and
72466047Sericother local names will be sent to MAIL_HUB.  Names in $=L will be
72566047Sericdelivered locally, so you MUST have aliases or .forward files for them.
72666047Seric
72766047SericFor example, if are on machine mastodon.CS.Berkeley.EDU, the following
72858071Sericcombinations of settings will have the indicated effects:
72957591Seric
73057591Sericemail sent to....	eric			  eric@mastodon.CS.Berkeley.EDU
73157591Seric
73257591SericLOCAL_RELAY set to	mail.CS.Berkeley.EDU	  (delivered locally)
73357591Sericmail.CS.Berkeley.EDU
73457591Seric
73557591SericMAIL_HUB set to		mammoth.CS.Berkeley.EDU	  mammoth.CS.Berkeley.EDU
73657591Sericmammoth.CS.Berkeley.EDU
73757591Seric
73857591SericBoth LOCAL_RELAY and	mail.CS.Berkeley.EDU	  mammoth.CS.Berkeley.EDU
73957591SericMAIL_HUB set as above
74057591Seric
74164153SericIf you want all outgoing mail to go to a central relay site, define
74264153SericSMART_HOST as well.  Briefly:
74358071Seric
74464153Seric	LOCAL_RELAY applies to unqualifed names (e.g., "eric").
74564153Seric	MAIL_HUB applies to names qualified with the name of the
74664153Seric		local host (e.g., "eric@mastodon.CS.Berkeley.EDU").
74764153Seric	SMART_HOST applies to names qualified with other hosts.
74864153Seric
74964153SericHowever, beware that other relays (e.g., UUCP_RELAY, BITNET_RELAY, and
75064153SericFAX_RELAY) take precedence over SMART_HOST, so if you really want
75164153Sericabsolutely everything to go to a single central site you will need to
75264153Sericunset all the other relays -- or better yet, find or build a minimal
75364153Sericconfig file that does this.
75464153Seric
75564153Seric
75658071Seric+-------------------------------+
75758071Seric| NON-SMTP BASED CONFIGURATIONS |
75858071Seric+-------------------------------+
75958071Seric
76058071SericThese configuration files are designed primarily for use by SMTP-based
76158071Sericsites.  I don't pretend that they are well tuned for UUCP-only or
76258071SericUUCP-primarily nodes (the latter is defined as a small local net
76358071Sericconnected to the rest of the world via UUCP).  However, there is one
76458071Serichook to handle some special cases.
76558071Seric
76658071SericYou can define a ``smart host'' that understands a richer address syntax
76758071Sericusing:
76858071Seric
76958071Seric	define(`SMART_HOST', mailer:hostname)
77058071Seric
77164028SericIn this case, the ``mailer:'' defaults to "relay".  Any messages that
77258071Sericcan't be handled using the usual UUCP rules are passed to this host.
77358071Seric
77458071SericIf you are on a local SMTP-based net that connects to the outside
77558071Sericworld via UUCP, you can use LOCAL_NET_CONFIG to add appropriate rules.
77658071SericFor example:
77758071Seric
77858071Seric	define(`SMART_HOST', suucp:uunet)
77958071Seric	LOCAL_NET_CONFIG
78063761Seric	R$* < @ $* .$m. > $*	$#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3
78158071Seric
78258071SericThis will cause all names that end in your domain name ($m) via
78358071SericSMTP; anything else will be sent via suucp (smart UUCP) to uunet.
78463761SericIf you have FEATURE(nocanonify), you may need to omit the dots after
78563761Sericthe $m.  If you are running a local DNS inside your domain which is
78663761Sericnot otherwise connected to the outside world, you probably want to
78763761Sericuse:
78858071Seric
78963761Seric	define(`SMART_HOST', smtp:fire.wall.com)
79063761Seric	LOCAL_NET_CONFIG
79163761Seric	R$* < @ $* . > $*	$#smtp $@ $2. $: $1 < @ $2. > $3
79258071Seric
79363761SericThat is, send directly only to things you found in your DNS lookup;
79463761Sericanything else goes through SMART_HOST.
79563761Seric
79664153SericIf you are not running DNS at all, it is important to use
79764153SericFEATURE(nodns) to avoid having sendmail queue everything waiting
79864153Sericfor the name server to come up.
79963761Seric
80064153Seric
80164259Seric+-----------+
80264259Seric| WHO AM I? |
80364259Seric+-----------+
80464259Seric
80564259SericNormally, the $j macro is automatically defined to be your fully
80664259Sericqualified domain name (FQDN).  Sendmail does this by getting your
80764259Serichost name using gethostname and then calling gethostbyname on the
80864259Sericresult.  For example, in some environments gethostname returns
80964259Sericonly the root of the host name (such as "foo"); gethostbyname is
81064259Sericsupposed to return the FQDN ("foo.bar.com").  In some (fairly rare)
81164259Sericcases, gethostbyname may fail to return the FQDN.  In this case
81264259Sericyou MUST define confDOMAIN_NAME to be your fully qualified domain
81364259Sericname.  This is usually done using:
81464259Seric
81564259Seric	Dmbar.com
81664259Seric	define(`confDOMAIN_NAME', `$w.$m')dnl
81764259Seric
81864259Seric
81964028Seric+--------------------+
82064028Seric| USING MAILERTABLES |
82164028Seric+--------------------+
82264028Seric
82364028SericTo use FEATURE(mailertable), you will have to create an external
82464028Sericdatabase containing the routing information for various domains.
82564028SericFor example, a mailertable file in text format might be:
82664028Seric
82764028Seric	.my.domain		xnet:%1.my.domain
82864028Seric	uuhost1.my.domain	suucp:uuhost1
82964028Seric	.bitnet			smtp:relay.bit.net
83064028Seric
83164028SericThis should normally be stored in /etc/mailertable.  The actual
83264028Sericdatabase version of the mailertable is built using:
83364028Seric
83464028Seric	makemap hash /etc/mailertable.db < /etc/mailertable
83564028Seric
83664028SericThe semantics are simple.  Any LHS entry that does not begin with
83764028Serica dot matches the full host name indicated.  LHS entries beginning
83864028Sericwith a dot match anything ending with that domain name -- that is,
83964028Sericthey can be thought of as having a leading "*" wildcard.  Matching
84064028Sericis done in order of most-to-least qualified -- for example, even
84164028Sericthough ".my.domain" is listed first in the above example, an entry
84264028Sericof "uuhost1.my.domain" will match the second entry since it is
84364028Sericmore explicit.
84464028Seric
84564028SericThe RHS should always be a "mailer:host" pair.  The mailer is the
84664028Sericconfiguration name of a mailer (that is, an `M' line in the
84764028Sericsendmail.cf file).  The "host" will be the hostname passed to
84864028Sericthat mailer.  In domain-based matches (that is, those with leading
84964028Sericdots) the "%1" may be used to interpolate the wildcarded part of
85064028Sericthe host name.  For example, the first line above sends everything
85164028Sericaddressed to "anything.my.domain" to that same host name, but using
85264028Sericthe (presumably experimental) xnet mailer.
85364028Seric
85467915SericIn some cases you may want to temporarily turn off MX records,
85567915Sericparticularly on gateways.  For example, you may want to MX
85667915Sericeverything in a domain to one machine that then forwards it
85767915Sericdirectly.  To do this, you might use the DNS configuration:
85864028Seric
85967915Seric	*.domain.	IN	MX	0	relay.machine
86067915Seric
86167915Sericand on relay.machine use the mailertable:
86267915Seric
86367915Seric	.domain		smtp:[gateway.domain]
86467915Seric
86567915SericThe [square brackets] turn off MX records for this host only.
86667915SericIf you didn't do this, the mailertable would use the MX record
86767915Sericagain, which would give you an MX loop.
86867915Seric
86967915Seric
87064153Seric+--------------------------------+
87164153Seric| USING USERDB TO MAP FULL NAMES |
87264153Seric+--------------------------------+
87364153Seric
87464153SericThe user database was not originally intended for mapping full names
87564153Sericto login names (e.g., Eric.Allman => eric), but some people are using
87664153Sericit that way.  (I would recommend that you set up aliases for this
87764153Sericpurpose instead -- since you can specify multiple alias files, this
87864153Sericis fairly easy.)  The intent was to locate the default maildrop at
87964153Serica site, but allow you to override this by sending to a specific host.
88064153Seric
88164153SericIf you decide to set up the user database in this fashion, it is
88267917Sericimperative that you not use FEATURE(stickyhost) -- otherwise,
88364153Serice-mail sent to Full.Name@local.host.name will be rejected.
88464153Seric
88567917SericTo build the internal form of the user database, use:
88664153Seric
88764259Seric	makemap btree /usr/data/base.db < /usr/data/base.txt
88864259Seric
88964259Seric
89067539Seric+--------------------------------+
89167539Seric| MISCELLANEOUS SPECIAL FEATURES |
89267539Seric+--------------------------------+
89367539Seric
89467539SericDOTTED_USER(name)
89567539Seric	Sometimes it is convenient to merge configuration on a
89667539Seric	centralized mail machine, for example, to forward all
89767539Seric	root mail to a mail server.  In this case it might be
89867539Seric	useful to be able to treat the root addresses as a class
89967539Seric	of addresses with subtle differences.  You can do this
90067539Seric	using dotted users.  For example, a client might include
90167539Seric	the alias:
90267539Seric
90367539Seric		root:  root.client1@server
90467539Seric
90567539Seric	On the server, the mail configuration would include:
90667539Seric
90767539Seric		DOTTED_USER(root)
90867539Seric
90967539Seric	Aliases on the server that would match this address would
91067539Seric	be "root.client", "root.*", and "root", tried in that
91167539Seric	order.  You can specify multiple addresses either by
91267539Seric	joining them in one DOTTTED_USER macro or by having
91367539Seric	multiple macros:
91467539Seric
91567539Seric		DOTTED_USER(root)
91667539Seric		DOTTED_USER(postmaster mailer-daemon)
91767539Seric
91867539Seric	defines three dotted users.
91967539Seric
92067539Seric
921*67960Seric+----------------+
922*67960Seric| SECURITY NOTES |
923*67960Seric+----------------+
924*67960Seric
925*67960SericA lot of sendmail security comes down to you.  Sendmail 8 is much
926*67960Sericmore careful about checking for security problems than previous
927*67960Sericversions, but there are some things that you still need to watch
928*67960Sericfor.  In particular:
929*67960Seric
930*67960Seric* Make sure the aliases file isn't writable except by trusted
931*67960Seric  system personnel.  This includes both the text and database
932*67960Seric  version.
933*67960Seric
934*67960Seric* Make sure that other files that sendmail reads, such as the
935*67960Seric  mailertable, is only writable by trusted system personnel.
936*67960Seric
937*67960Seric* The queue directory should not be world writable PARTICULARLY
938*67960Seric  if your system allows "file giveaways" (that is, if a non-root
939*67960Seric  user can chown any file they own to any other user).
940*67960Seric
941*67960Seric* If your system allows file giveaways, DO NOT create a publically
942*67960Seric  writable directory for forward files.  This will allow anyone
943*67960Seric  to steal anyone else's e-mail.  Instead, create a script that
944*67960Seric  copies the .forward file from users' home directories once a
945*67960Seric  night (if you want the non-NFS-mounted forward directory).
946*67960Seric
947*67960Seric* If your system allows file giveaways, you'll find that
948*67960Seric  sendmail is much less trusting of :include: files -- in
949*67960Seric  particular, you'll have to have /SENDMAIL/ANY/SHELL/ in
950*67960Seric  /etc/shells before they will be trusted (that is, before
951*67960Seric  files and programs listed in them will be honored).
952*67960Seric
953*67960SericIn general, file giveaways are a mistake -- if you can turn them
954*67960Sericoff I recommend you do so.
955*67960Seric
956*67960Seric
95758363Seric+------------------+
95858363Seric| FlexFAX SOFTWARE |
95958363Seric+------------------+
96058363Seric
96158363SericSam Leffler's FlexFAX software is still in beta test -- but he expects a
96258363Sericpublic version out "later this week" [as of 3/1/93].  The following
96358363Sericblurb is direct from Sam:
96458363Seric
96564498Seric	$Header: /usr/people/sam/fax/RCS/HOWTO,v 1.14 93/05/24 11:42:16 sam Exp $
96658363Seric
96758363Seric	How To Obtain This Software (in case all you get is this file)
96864498Seric	--------------------------------------------------------------
96958363Seric	The source code is available for public ftp on
97064498Seric	    sgi.com			sgi/fax/v2.1.src.tar.Z
97158363Seric		(192.48.153.1)
97258363Seric
97358363Seric	You can also obtain inst'able images for Silicon Graphics machines from
97464498Seric	    sgi.com			sgi/fax/v2.1.inst.tar
97558363Seric		(192.48.153.1)
97658363Seric
97758363Seric	For example,
97858363Seric	    % ftp -n sgi.com
97958363Seric	    ....
98058363Seric	    ftp> user anonymous
98158363Seric	    ... <type in password>
98258363Seric	    ftp> cd sgi/fax
98358363Seric	    ftp> binary
98464498Seric	    ftp> get v2.1.src.tar.Z
98558363Seric
98664498Seric	In general, the latest version of the 2.1 release of the software is
98764498Seric	always available as "v2.1.src.tar.Z" or "v2.1.inst.tar" in the ftp
98864498Seric	directory.  This file is a link to the appropriate released version (so
98964498Seric	don't waste your time retrieving the linked file as well!) Any files of
99064498Seric	the form v2.1.*.patch are shell scripts that can be used to patch older
99164498Seric	versions of the source code.  For example, the file v2.1.0.patch would
99264498Seric	contain patches to update v2.1.0.tar.Z.  (Note to beta testers: this is
99364498Seric	different than the naming conventions used during beta testing.) Patch
99464498Seric	files only work to go between consecutive versions, so if you are
99564498Seric	multiple versions behind the latest release, you will need to apply
99664498Seric	each patch file between your current version and the latest.
99764498Seric
99864498Seric
99964498Seric	Obtaining the Software by Electronic Mail
100064498Seric	-----------------------------------------
100164498Seric	Do not send me requests for the software; they will be ignored (without
100264498Seric	response).  If you cannot use FTP at all, there is a service called
100364498Seric	"ftpmail" available from gatekeeper.dec.com:  you can send e-mail to
100464498Seric	this machine and it will use FTP to retrieve files for you and send you
100564498Seric	the files back again via e-mail.  To find out more about the ftpmail
100658363Seric	service, send a message to "ftpmail@gatekeeper.dec.com" whose body
100758363Seric	consists of the single line "help".
100858363Seric
100964498Seric
101064498Seric	Obtaining the Software Within Silicon Graphics
101164498Seric	----------------------------------------------
101258363Seric	Internal to Silicon Graphics there are inst'able images on the host
101364498Seric	flake.asd in the directory /usr/dist.  Thus you can do something like:
101458363Seric
101564498Seric	    % inst -f flake.asd.sgi.com:/usr/dist/flexfax
101658363Seric
101764498Seric	to install the latest version of the software on your machine.
101858363Seric
101964498Seric
102064498Seric	What to do Once You've Retrieved Stuff
102164498Seric	--------------------------------------
102258363Seric	The external distributions come in a compressed or uncompressed tar
102358363Seric	file.  To extract the source distribution:
102458363Seric
102564498Seric	    % zcat v2.1.src.tar.Z | tar xf -
102658363Seric
102758363Seric	(uncompress and extract individual files in current directory).  To
102858363Seric	unpack and install the client portion of the inst'able distribution:
102958363Seric
103058363Seric	    % mkdir dist
103164498Seric	    % cd dist; tar xf ../v2.1.inst.tar; cd ..
103258363Seric	    % inst -f dist/flexfax
103358363Seric	    ...
103458363Seric	    inst> go
103558363Seric
103658363Seric	(Note, the dist subdirectory is because some versions of inst fail if
103764498Seric	the files are in the current directory.) Server binaries are also
103864498Seric	included in the inst'able images as flexfax.server.*.  They are not
103964498Seric	installed by default, so to get them also you need to do:
104058363Seric
104158363Seric	    % inst -f flexfax
104258363Seric	    ...
104358363Seric	    inst> install flexfax.server.*
104458363Seric	    inst> go
104558363Seric
104664498Seric	The SGI binaries were built for Version 4.0.5H of the IRIX operating
104758363Seric	system.  They should work w/o problem on earlier versions of the
104858363Seric	system, but I have not fully tested this.  Also, note that to install a
104958363Seric	server on an SGI machine, you need to have installed the Display
105058363Seric	PostScript execution environment product (dps_eoe).  Otherwise, the fax
105158363Seric	server will not be able to convert PostScript to facsimile for
105258363Seric	transmission.
105358363Seric
105464498Seric	If you are working from the source distribution, look at the file
105564498Seric	README in the top of the source tree.  If you are working from the inst
105664498Seric	images, the subsystem flexfax.man.readme contains the README file and
105764498Seric	other useful pieces of information--the installed files are placed in
105864498Seric	the directory /usr/local/doc/flexfax).  Basically you will need to run
105964498Seric	the faxaddmodem script to setup and configure your fax modem.  Consult
106064498Seric	the README file and the manual page for faxaddmodem for information.
106158363Seric
106258363Seric
106364498Seric	FlexFAX Mail List
106464498Seric	-----------------
106558363Seric	A mailing list for users of this software is located on sgi.com.
106658363Seric	If you want to join this mailing list or have a list-related request
106758363Seric	such as getting your name removed from it, send a request to
106858363Seric
106964498Seric	    majordomo@whizzer.wpd.sgi.com
107058363Seric
107164498Seric	For example, to subscribe, send the line "subscribe flexfax" in
107264498Seric	the body of your message.  The line "help" will return a list of
107364498Seric	the commands understood by the mailing list management software.
107464498Seric
107558363Seric	Submissions (including bug reports) should be directed to:
107658363Seric
107758363Seric	    flexfax@sgi.com
107858363Seric
107964498Seric	When corresponding about this software please always specify what
108064498Seric	version you have, what system you're running on, and, if the problem is
108164498Seric	specific to your modem, identify the modem and firmware revision.
108258363Seric
108364498Seric
108457945Seric+--------------------------------+
108557945Seric| TWEAKING CONFIGURATION OPTIONS |
108657945Seric+--------------------------------+
108757945Seric
108857945SericThere are a large number of configuration options that don't normally
108957945Sericneed to be changed.  However, if you feel you need to tweak them, you
109057945Sericcan define the following M4 variables.  This list is shown in four
109157945Sericcolumns:  the name you define, the default value for that definition,
109257945Sericthe option or macro that is affected (either Ox for an option or Dx
109357945Sericfor a macro), and a brief description.  Greater detail of the semantics
109457945Sericcan be found in the Installation and Operations Guide.
109557945Seric
109663582SericSome options are likely to be deprecated in future versions -- that is,
109763582Sericthe option is only included to provide back-compatibility.  These are
109863582Sericmarked with "*".
109963582Seric
110065002SericRemember that these options are M4 variables, and hence may need to
110165002Sericbe quoted.  In particular, arguments with commas will usually have to
110265002Sericbe ``double quoted, like this phrase'' to avoid having the comma
110365002Sericconfuse things.  This is common for alias file definitions and for
110465002Sericthe read timeout.
110565002Seric
110657945SericM4 Variable Name	Default		Mac/Opt	Description
110765002Seric================	=======		=======	===========
110857945SericconfMAILER_NAME		MAILER-DAEMON	Dn	The sender name used for
110957945Seric						internally generated
111057945Seric						outgoing messages.
111158681SericconfFROM_LINE		From $g  $d	Dl	The From_ line used when
111258681Seric						sending to files or programs.
111357945SericconfFROM_HEADER		$?x$x <$g>$|$g$.	The format of an internally
111457945Seric					Dq	generated From: address.
111567929SericconfOPERATORS		.:%@!^/[]+	Do	Address operator characters.
111664153SericconfSMTP_LOGIN_MSG	$j Sendmail $v/$Z ready at $b
111757945Seric					De	The initial (spontaneous)
111857945Seric						SMTP greeting message.
111967820SericconfRECEIVED_HEADER	$?sfrom $s $.$?_($?s$|from $.$_) $.by $j ($v/$Z)$?r with $r$. id $i$?u for $u$.; $b
112067820Seric					HReceived
112167820Seric						The format of the Received:
112267820Seric						header in messages passed
112367820Seric						through this host.  It is
112467820Seric						unwise to try to change this.
112559743SericconfSEVEN_BIT_INPUT	False		O7	Force input to seven bits?
112667551SericconfEIGHT_BIT_HANDLING	pass8		O8	8-bit data handling
112757945SericconfALIAS_WAIT		10		Oa	Wait (in minutes) for alias
112857945Seric						file rebuild.
112958087SericconfMIN_FREE_BLOCKS	4		Ob	Minimum number of free blocks
113058087Seric						on queue filesystem to accept
113158087Seric						SMTP mail.
113257945SericconfBLANK_SUB		.		OB	Blank (space) substitution
113357945Seric						character.
113465619SericconfCON_EXPENSIVE	False		Oc	Avoid connecting immediately
113565619Seric						to mailers marked expensive?
113657945SericconfCHECKPOINT_INTERVAL	10		OC	Checkpoint queue files
113757945Seric						every N recipients.
113857945SericconfDELIVERY_MODE	background	Od	Default delivery mode.
113957945SericconfAUTO_REBUILD	False		OD	Automatically rebuild
114057945Seric						alias file if needed.
114157945SericconfERROR_MODE		(undefined)	Oe	Error message mode.
114257945SericconfERROR_MESSAGE	(undefined)	OE	Error message header/file.
114357945SericconfSAVE_FROM_LINES	False		Of	Save extra leading
114457945Seric						From_ lines.
114557945SericconfTEMP_FILE_MODE	0600		OF	Temporary file mode.
114657945SericconfDEF_GROUP_ID	1		Og	Default group id.
114757945SericconfMATCH_GECOS		False		OG	Match GECOS field.
114857945SericconfMAX_HOP		17		Oh	Maximum hop count.
114963582SericconfIGNORE_DOTS		False		Oi *	Ignore dot as terminator
115057945Seric						for incoming messages?
115157945SericconfBIND_OPTS		(empty)		OI	Default options for BIND.
115263582SericconfMIME_FORMAT_ERRORS	True		Oj *	Send error messages as MIME-
115359743Seric						encapsulated messages per
115459743Seric						RFC 1344.
115564153SericconfFORWARD_PATH	(undefined)	OJ	The colon-separated list of
115664153Seric						places to search for .forward
1157*67960Seric						files.  N.B.: see the Security
1158*67960Seric						Notes section.
115957945SericconfMCI_CACHE_SIZE	2		Ok	Size of open connection cache.
116057945SericconfMCI_CACHE_TIMEOUT	5m		OK	Open connection cache timeout.
116163582SericconfUSE_ERRORS_TO	False		Ol *	Use the Errors-To: header to
116263582Seric						deliver error messages.  This
116363582Seric						should not be necessary because
116463582Seric						of general acceptance of the
116563582Seric						envelope/header distinction.
116657945SericconfLOG_LEVEL		9		OL	Log level.
116757945SericconfME_TOO		False		Om	Include sender in group
116857945Seric						expansions.
116957945SericconfCHECK_ALIASES	True		On	Check RHS of aliases when
117057945Seric						running newaliases.
117163582SericconfOLD_STYLE_HEADERS	True		Oo *	Assume that headers without
117257945Seric						special chars are old style.
117358859SericconfDAEMON_OPTIONS	(undefined)	OO	SMTP daemon options.
117458806SericconfPRIVACY_FLAGS	authwarnings	Op	Privacy flags.
117557945SericconfCOPY_ERRORS_TO	(undefined)	OP	Address for additional copies
117657945Seric						of all error messages.
117757945SericconfQUEUE_FACTOR	(undefined)	Oq	Slope of queue-only function
117858116SericconfREAD_TIMEOUT	(undefined)	Or	SMTP read timeouts.
117967811SericconfDONT_PRUNE_ROUTES	False		OR	Don't prune down route-addr
118067811Seric						syntax addresses to the
118167811Seric						minimum possible.
118263582SericconfSAFE_QUEUE		True		Os *	Commit all messages to disk
118357945Seric						before forking.
118458806SericconfMESSAGE_TIMEOUT	5d/4h		OT	Timeout for messages before
118558806Seric						sending error/warning message.
118659317SericconfTIME_ZONE		USE_SYSTEM	Ot	Time zone info -- can be
118757945Seric						USE_SYSTEM to use the system's
118857945Seric						idea, USE_TZ to use the user's
118957945Seric						TZ envariable, or something
119057945Seric						else to force that value.
119157945SericconfDEF_USER_ID		1		Ou	Default user id.
119258718SericconfUSERDB_SPEC		(undefined)	OU	User database specification.
119358859SericconfFALLBACK_MX		(undefined)	OV	Fallback MX host.
119463857SericconfTRY_NULL_MX_LIST	False		Ow	If we are the best MX for a
119563857Seric						host and haven't made other
119663857Seric						arrangements, try connecting
119763857Seric						to the host directly; normally
119863857Seric						this would be a config error.
119957945SericconfQUEUE_LA		8		Ox	Load average at which queue-only
120057945Seric						function kicks in.
120157945SericconfREFUSE_LA		12		OX	Load average at which incoming
120257945Seric						SMTP connections are refused.
120363582SericconfWORK_RECIPIENT_FACTOR
120463582Seric			(undefined)	Oy	Cost of each recipient.
120563582SericconfSEPARATE_PROC	False		OY	Run all deliveries in a
120657945Seric						separate process.
120757945SericconfWORK_CLASS_FACTOR	(undefined)	Oz	Priority multiplier for class.
120857945SericconfWORK_TIME_FACTOR	(undefined)	OZ	Cost of each delivery attempt.
120958408SericconfCW_FILE		/etc/sendmail.cw	Name of file used to get the
121058408Seric					Fw	local additions to the $=w
121158408Seric						class.
121264153SericconfSMTP_MAILER		smtp		-	The mailer name used when
121363972Seric						SMTP connectivity is required.
121467915Seric						One of "smtp", "smtp8", or
121567915Seric						"esmtp".
121663999SericconfLOCAL_MAILER	local		-	The mailer name used when
121763999Seric						local connectivity is required.
121863999Seric						Almost always "local".
121964028SericconfRELAY_MAILER	relay		-	The default mailer name used
122064028Seric						for relaying any mail (e.g.,
122164028Seric						to a BITNET_RELAY, a
122264028Seric						SMART_HOST, or whatever).
122364028Seric						This can reasonably be "suucp"
122464028Seric						if you are on a UUCP-connected
122564028Seric						site.
122664259SericconfDOMAIN_NAME		(undefined)	Dj	If defined, sets $j.
122757945Seric
122858087Seric
122957246Seric+-----------+
123057246Seric| HIERARCHY |
123157246Seric+-----------+
123257246Seric
123351220SericWithin this directory are several subdirectories, to wit:
123451220Seric
123551220Sericm4		General support routines.  These are typically
123651220Seric		very important and should not be changed without
123757247Seric		very careful consideration.
123851220Seric
123951220Sericcf		The configuration files themselves.  They have
124051220Seric		".mc" suffixes, and must be run through m4 to
124151220Seric		become complete.  The resulting output should
124251220Seric		have a ".cf" suffix.
124351220Seric
124451220Sericostype		Definitions describing a particular operating
124551220Seric		system type.  These should always be referenced
124651220Seric		using the OSTYPE macro in the .mc file.  Examples
124751220Seric		include "bsd4.3", "bsd4.4", "sunos3.5", and
124851220Seric		"sunos4.1".
124951220Seric
125051220Sericdomain		Definitions describing a particular domain, referenced
125151220Seric		using the DOMAIN macro in the .mc file.  These are
125251220Seric		site dependent; for example, we contribute "cs.exposed.m4"
125351220Seric		and "cs.hidden.m4" which both describe hosts in the
125451220Seric		CS.Berkeley.EDU subdomain; the former displays the local
125551220Seric		hostname (e.g., mammoth.CS.Berkeley.EDU), whereas the
125651220Seric		latter does its best to hide the identity of the local
125751220Seric		workstation inside the CS subdomain.
125851220Seric
125951220Sericmailer		Descriptions of mailers.   These are referenced using
126051220Seric		the MAILER macro in the .mc file.
126151220Seric
126251220Sericsh		Shell files used when building the .cf file from the
126351220Seric		.mc file in the cf subdirectory.
126451220Seric
126551220Sericfeature		These hold special orthogonal features that you might
126651220Seric		want to include.  They should be referenced using
126751220Seric		the FEATURE macro.
126851220Seric
126951220Serichack		Local hacks.  These can be referenced using the HACK
127051220Seric		macro.  They shouldn't be of more than voyeuristic
127151220Seric		interest outside the .Berkeley.EDU domain, but who knows?
127265957Seric		We've all got our own peccadillos.
127351220Seric
127451268Sericsiteconfig	Site configuration -- e.g., tables of locally connected
127551268Seric		UUCP sites.
127651220Seric
127751268Seric
127857246Seric+------------------------+
127957246Seric| ADMINISTRATIVE DETAILS |
128057246Seric+------------------------+
128151220Seric
128251220SericThe following sections detail usage of certain internal parts of the
128351220Sericsendmail.cf file.  Read them carefully if you are trying to modify
128451220Sericthe current model.  If you find the above descriptions adequate, these
128551220Sericshould be {boring, confusing, tedious, ridiculous} (pick one or more).
128651220Seric
128751220SericRULESETS (* means built in to sendmail)
128851220Seric
128951220Seric   0 *	Parsing
129051220Seric   1 *	Sender rewriting
129151220Seric   2 *	Recipient rewriting
129251220Seric   3 *	Canonicalization
129351220Seric   4 *	Post cleanup
129454839Seric   5 *	Local address rewrite (after aliasing)
129560539Seric  1x	mailer rules (sender qualification)
129660539Seric  2x	mailer rules (recipient qualification)
129764801Seric  3x	mailer rules (sender header qualification)
129864801Seric  4x	mailer rules (recipient header qualification)
129964801Seric  5x	mailer subroutines (general)
130064801Seric  6x	mailer subroutines (general)
130164801Seric  7x	mailer subroutines (general)
130264801Seric  8x	reserved
130360539Seric  90	Mailertable host stripping
130460892Seric  96	Bottom half of Ruleset 3 (ruleset 6 in old sendmail)
130560892Seric  97	Hook for recursive ruleset 0 call (ruleset 7 in old sendmail)
130663857Seric  98	Local part of ruleset 0 (ruleset 8 in old sendmail)
130751220Seric
130851220Seric
130951220SericMAILERS
131051220Seric
131151220Seric   0	local, prog	local and program mailers
131265218Seric   1	[e]smtp, relay	SMTP channel
131365218Seric   2	uucp-*		UNIX-to-UNIX Copy Program
131458087Seric   3	netnews		Network News delivery
131558363Seric   4	fax		Sam Leffler's FlexFAX software
131651220Seric
131751220Seric
131851220SericMACROS
131951220Seric
132051220Seric   A
132151220Seric   B	Bitnet Relay
132265182Seric   C
132354839Seric   D	The local domain -- usually not needed
132451220Seric   E
132558363Seric   F	FAX Relay
132651220Seric   G
132757591Seric   H	mail Hub (for mail clusters)
132851220Seric   I
132951220Seric   J
133051220Seric   K
133167915Seric   L	Luser Relay
133251220Seric   M	Masquerade (who I claim to be)
133351220Seric   N
133451220Seric   O
133551220Seric   P
133651220Seric   Q
133751220Seric   R	Relay (for unqualified names)
133858071Seric   S	Smart Host
133951220Seric   T
134051309Seric   U	my UUCP name (if I have a UUCP connection)
134151309Seric   V	UUCP Relay (class V hosts)
134251220Seric   W	UUCP Relay (class W hosts)
134351220Seric   X	UUCP Relay (class X hosts)
134451309Seric   Y	UUCP Relay (all other hosts)
134551220Seric   Z	Version number
134651220Seric
134751220Seric
134851220SericCLASSES
134951220Seric
135051220Seric   A
135151220Seric   B
135251220Seric   C
135367539Seric   D	"dotted" users
135457246Seric   E	addresses that should not seem to come from $M
135554839Seric   F	hosts we forward for
135651220Seric   G
135751220Seric   H
135851220Seric   I
135951220Seric   J
136051220Seric   K
136151220Seric   L	addresses that should not be forwarded to $R
136251220Seric   M
136351220Seric   N
136451220Seric   O	operators that indicate network operations (cannot be in local names)
136560211Seric   P	top level pseudo-domains: BITNET, FAX, UUCP, etc.
136651220Seric   Q
136751220Seric   R
136851220Seric   S
136951220Seric   T
137051220Seric   U	locally connected UUCP hosts
137151309Seric   V	UUCP hosts connected to relay $V
137251309Seric   W	UUCP hosts connected to relay $W
137351309Seric   X	UUCP hosts connected to relay $X
137451309Seric   Y	locally connected smart UUCP hosts
137564153Seric   Z	locally connected domain-ized UUCP hosts
137654839Seric   .	the class containing only a dot
137751220Seric
137851220Seric
137951220SericM4 DIVERSIONS
138051220Seric
138158071Seric   1	Local host detection and resolution
138258071Seric   2	Local Ruleset 3 additions
138358071Seric   3	Local Ruleset 0 additions
138451268Seric   4	UUCP Ruleset 0 additions
138551309Seric   5	locally interpreted names (overrides $R)
138654839Seric   6	local configuration (at top of file)
138751220Seric   7	mailer definitions
138866099Seric   8
138958681Seric   9	special local rulesets (1 and 2)
1390