date and time created 93/12/15 06:36:42 by eric
[unix-history] / usr / src / usr.sbin / sendmail / cf / README
CommitLineData
7ace9d88 1
7ace9d88 2
4a51b074 3 NEW SENDMAIL CONFIGURATION FILES
7ace9d88 4
4a51b074 5 Eric Allman <eric@CS.Berkeley.EDU>
7ace9d88 6
418602bc 7 @(#)README 8.17 (Berkeley) %G%
7ace9d88 8
7ace9d88 9
4a51b074 10This document describes the sendmail configuration files being used
5dd53c38 11at Berkeley. These use features in the new (R8) sendmail, and although
4a51b074 12there is an ``OLDSENDMAIL'' mode, they haven't really been tested on
fd82c288 13old versions of sendmail and cannot be expected to work well.
4a51b074
EA
14
15These configuration files are probably not as general as previous
16versions, and don't handle as many of the wierd cases automagically.
17I was able to simplify by them for two reasons. First, the network
18has become more consistent -- for example, at this point, everyone
19on the internet is supposed to be running a name server, so hacks to
20handle NIC-registered hosts can go away. Second, I assumed that a
21subdomain would be running SMTP internally -- UUCP is presumed to be
22a long-haul protocol. I realize that this is not universal, but it
23does describe the vast majority of sites with which I am familiar,
24including those outside the US.
25
26Of course, the downside of this is that if you do live in a wierd
27world, things are going to get wierder for you. I'm sorry about that,
28but at the time we at Berkeley had a problem, and it seemed like the
29right thing to do.
30
fd82c288
EA
31This package requires a post-V7 version of m4; if you are running the
324.2bsd, SysV.2, or 7th Edition version, I suggest finding a friend with
33a newer version. You can m4-expand on their system, then run locally.
a7e36c1b
EA
34SunOS's /usr/5bin/m4 or BSD-Net/2's m4 both work. GNU m4 version 1.1
35also works. Unfortunately, I'm told that the M4 on BSDI 1.0 doesn't
36work -- you'll have to use a Net/2 or GNU version.
7ace9d88 37
a33031f5 38IF YOU DON'T HAVE A BERKELEY MAKE, don't despair! Just run
445bdec1
EA
39"m4 foo.mc > foo.cf" -- that should be all you need. There is also
40a fairly crude (but functional) Makefile.dist that works on the
41old version of make.
a33031f5
EA
42
43To get started, you may want to look at tcpproto.mc (for TCP-only
f51c9ac8
EA
44sites), uucpproto.mc (for UUCP-only sites), and clientproto.mc (for
45clusters of clients using a single mail host). Others are versions
a33031f5
EA
46that we use at Berkeley, although not all are in current use. For
47example, ucbarpa has gone away, but I've left ucbarpa.mc in because
48it demonstrates some interesting techniques.
49
4a51b074
EA
50I'm not pretending that this README describes everything that these
51configuration files can do; clever people can probably tweak them
52to great effect. But it should get you started.
53
bee9d799 54
4a51b074
EA
55+--------------------------+
56| INTRODUCTION AND EXAMPLE |
57+--------------------------+
58
59Configuration files are contained in the subdirectory "cf", with a
60suffix ".mc". They must be run through "m4" to produce a ".cf" file.
61
7ace9d88
EA
62Let's examine a typical .mc file (cf/cs-exposed.mc):
63
64 divert(-1)
65 #
66 # Copyright (c) 1983 Eric P. Allman
67 # Copyright (c) 1988 The Regents of the University of California.
68 # All rights reserved.
69 #
70 # Redistribution and use in source and binary forms are permitted
71 # provided that the above copyright notice and this paragraph are
72 # duplicated in all such forms and that any documentation,
73 # advertising materials, and other materials related to such
74 # distribution and use acknowledge that the software was developed
75 # by the University of California, Berkeley. The name of the
76 # University may not be used to endorse or promote products derived
77 # from this software without specific prior written permission.
78 # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
79 # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
80 # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
81 #
82
4a51b074 83The divert(-1) will delete the crud in the resulting output file.
fd82c288 84The copyright notice is what your lawyers require. Our lawyers require
4a51b074
EA
85the one that I've included in my files. A copyleft is a copyright by
86another name.
87
88The next line MUST be
7ace9d88
EA
89
90 include(`../m4/cf.m4')
91
4a51b074
EA
92This will pull in the M4 macros you will need to make sense of
93everything else. As the saying goes, don't think about it, just
94do it. If you don't do it, don't bother reading the rest of this
95file.
7ace9d88 96
8897fcb1 97 VERSIONID(`<SCCS or RCS version id>')
7ace9d88
EA
98
99VERSIONID is a macro that stuffs the version information into the
100resulting file. We use SCCS; you could use RCS, something else, or
4a51b074
EA
101omit it completely. This is not the same as the version id included
102in SMTP greeting messages -- this is defined in m4/version.m4.
7ace9d88 103
9df1b56b 104 DOMAIN(cs.exposed)
7ace9d88
EA
105
106This example exposes the host inside of the CS subdomain -- that is,
107it doesn't try to hide the name of the workstation to the outside
108world. Changing this to DOMAIN(cs.hidden) would have made outgoing
109messages refer to "<username>@CS.Berkeley.EDU" instead of using the
5dd53c38 110local hostname. Internally this is effected by using
4a51b074 111"MASQUERADE_AS(CS.Berkeley.EDU)".
7ace9d88 112
9df1b56b 113 MAILER(smtp)
7ace9d88 114
c573210d
EA
115These describe the mailers used at the default CS site site. The
116local mailer is always included automatically.
7ace9d88 117
bee9d799 118
4a51b074
EA
119+--------+
120| OSTYPE |
121+--------+
122
7ace9d88
EA
123Note that cf/cs-exposed.mc omits an OSTYPE macro -- this assumes
124default Computer Science Division environment. There are several
fd82c288
EA
125explicit environments available: bsd4.3, bsd4.4, hpux, irix, osf1,
126riscos4.5, sunos3.5, sunos4.1, and ultrix4.1. These change things
127like the location of the alias file and queue directory. Some of
128these files are identical to one another.
4a51b074
EA
129
130Operating system definitions are easy to write. They may define
131the following variables (everything defaults, so an ostype file
132may be empty).
133
134ALIAS_FILE [/etc/aliases] The location of the text version
00d0b5bf
EA
135 of the alias file(s). It can be a comma-separated
136 list of names.
4a51b074
EA
137HELP_FILE [/usr/lib/sendmail.hf] The name of the file
138 containing information printed in response to
139 the SMTP HELP command.
4a51b074
EA
140QUEUE_DIR [/var/spool/mqueue] The directory containing
141 queue files.
142STATUS_FILE [/etc/sendmail.st] The file containing status
143 information.
bee9d799 144LOCAL_MAILER_PATH [/bin/mail] The program used to deliver local mail.
2e9b6f6e
EA
145LOCAL_MAILER_FLAGS [rmn] The flags used by the local mailer. The
146 flags lsDFM are always included.
d8b2ad36
EA
147LOCAL_MAILER_ARGS [mail -d $u] The arguments passed to deliver local
148 mail.
bee9d799 149LOCAL_SHELL_PATH [/bin/sh] The shell used to deliver piped email.
1c61e291
EA
150LOCAL_SHELL_FLAGS [eu] The flags used by the shell mailer. The
151 flags lsDFM are always included.
152LOCAL_SHELL_ARGS [sh -c $u] The arguments passed to deliver "prog"
153 mail.
bee9d799
EA
154USENET_MAILER_PATH [/usr/lib/news/inews] The name of the program
155 used to submit news.
156USENET_MAILER_FLAGS [rlsDFMmn] The mailer flags for the usenet mailer.
157USENET_MAILER_ARGS [-m -h -n] The command line arguments for the
158 usenet mailer.
5dd53c38
EA
159SMTP_MAILER_FLAGS [undefined] Flags added to SMTP mailer. Default
160 flags are `mDFMUX' (and `a' for esmtp mailer).
161UUCP_MAILER_FLAGS [undefined] Flags added to UUCP mailer. Default
162 flags are `DFMhuU' (and `m' for suucp mailer, minus
163 `U' for uucp-dom mailer).
d8b2ad36
EA
164UUCP_MAILER_ARGS [uux - -r -z -a$f -gC $h!rmail ($u)] The arguments
165 passed to the UUCP mailer.
1c61e291
EA
166UUCP_MAX_SIZE [100000] The maximum size message accepted for
167 transmission by the UUCP mailers.
4a51b074
EA
168HOSTMAP_SPEC [dbm -o /etc/hostmap] The value for the builtin
169 hostmap key definition. You can redefine this
170 to change the class, flags, and filename of
171 the hostmap. The default flag (-o) makes this
172 map optional.
173
4a51b074
EA
174+---------+
175| DOMAINS |
176+---------+
177
178You will probably want to collect domain-dependent defines into one
179file, referenced by the DOMAIN macro. For example, our Berkeley
180domain file includes definitions for several internal distinguished
181hosts:
182
183UUCP_RELAY The host that will forward UUCP-addressed email.
184 If not defined, all UUCP sites must be directly
bb3c21c3 185 connected.
4a51b074
EA
186BITNET_RELAY The host that will forward BITNET-addressed email.
187 If not defined, the .BITNET pseudo-domain won't work.
188CSNET_RELAY The host that will forward CSNET-addressed email.
189 If not defined, the .CSNET pseudo-domain won't work.
190LOCAL_RELAY The site that will handle unqualified names -- that
191 is, names with out an @domain extension. If not set,
192 they are assumed to belong on this machine. This
193 allows you to have a central site to store a
194 company- or department-wide alias database. This
195 only works at small sites, and there are better
bb3c21c3
EA
196 methods.
197
198Each of these can be either ``mailer:hostname'' (in which case the
199mailer is the internal mailer name, such as ``suucp'' and the hostname
200is the name of the host as appropriate for that mailer) or just a
201``hostname'', in which case a default mailer type (usually ``relay'',
2e9b6f6e
EA
202a variant on SMTP) is used. WARNING: if you have a wildcard MX
203record matching your domain, you probably want to define these to
204have a trailing dot so that you won't get the mail diverted back
205to yourself.
4a51b074
EA
206
207The domain file can also be used to define a domain name, if needed
6f02ae2f
EA
208(using "DD<domain>") and set certain site-wide features. If all hosts
209at your site masquerade behind one email name, you could also use
210MASQUERADE_AS here.
4a51b074 211
dec2b686
EA
212You do not have to define a domain -- in particular, if you are a
213single machine sitting off somewhere, it is probably more work than
214it's worth. This is just a mechanism for combining "domain dependent
215knowledge" into one place.
216
4a51b074
EA
217+---------+
218| MAILERS |
219+---------+
7ace9d88
EA
220
221There are fewer mailers supported in this version than the previous
222version, owing mostly to a simpler world.
223
224local The local and prog mailers. You will almost always
225 need these; the only exception is if you relay ALL
fd82c288
EA
226 your mail to another site. This mailer is included
227 automatically.
7ace9d88
EA
228
229smtp The Simple Mail Transport Protocol mailer. This does
230 not hide hosts behind a gateway or another other
231 such hack; it assumes a world where everyone is
d8b2ad36
EA
232 running the name server. This file actually defines
233 three mailers: "smtp" for regular (old-style) SMTP to
234 other servers, "esmtp" for extended SMTP to other
235 servers, and "relay" for transmission to our
236 RELAY_HOST or MAILER_HUB.
7ace9d88
EA
237
238uucp The Unix-to-Unix Copy Program mailer. Actually, this
239 defines two mailers, "uucp" and "suucp". The latter
240 is for when you know that the UUCP mailer at the other
241 end can handle multiple recipients in one transfer.
4a51b074
EA
242 When you invoke this, sendmail looks for all names in
243 the $=U class and sends them to the uucp mailer; all
244 names in the $=Y class are sent to suucp. Note that
245 this is a function of what version of rmail runs on
246 the receiving end, and hence may be out of your control.
5dd53c38
EA
247 If smtp is defined, it also defines a "uucp-dom" mailer
248 that uses domain-style rewriting.
4a51b074 249
bee9d799
EA
250usenet Usenet (network news) delivery. If this is specified,
251 an extra rule is added to ruleset 0 that forwards all
252 local email for users named ``group.usenet'' to the
253 ``inews'' program. Note that this works for all groups,
254 and may be considered a security problem.
255
63013ec3
EA
256fax Facsimile transmission. This is experimental and based
257 on Sam Leffler's FlexFAX software. For more information,
258 see below.
259
418602bc
EA
260pop Post Office Protocol.
261
bee9d799 262
4a51b074
EA
263+----------+
264| FEATURES |
265+----------+
266
267Special features can be requested using the "FEATURE" macro. For
268example, the .mc line:
269
270 FEATURE(use_cw_file)
271
272tells sendmail that you want to have it read an /etc/sendmail.cw
3ad658d7
EA
273file to get values for class $=w. The FEATURE may contain a single
274optional parameter -- for example:
275
276 FEATURE(mailertable, dbm /usr/lib/mailertable)
277
278Available features are:
4a51b074
EA
279
280use_cw_file Read the file /etc/sendmail.cw file to get alternate
281 names for this host. This might be used if you were
282 on a host that MXed for a dynamic set of other
283 hosts. If the set is static, just including the line
284 "Cw<name1> <name2> ..." is probably superior.
dec2b686
EA
285 The actual filename can be overridden by redefining
286 confCW_FILE.
f51c9ac8 287
bee9d799
EA
288redirect Reject all mail addressed to "address.REDIRECT" with
289 a ``551 User not local; please try <address>'' message.
290 If this is set, you can alias people who have left
291 to their new address with ".REDIRECT" appended.
f51c9ac8 292
a33031f5 293nouucp Don't do anything special with UUCP addresses at all.
f51c9ac8 294
928fba03
EA
295nocanonify Don't pass addresses to $[ ... $] for canonification.
296 This would generally only be used by sites that only
297 act as mail gateways or which have user agents that do
bb3c21c3
EA
298 full canonification themselves. You may also want to
299 use "define(`confBIND_OPTS',`-DNSRCH -DEFNAMES')" to
300 turn off the usual resolver options that do a similar
301 thing.
f51c9ac8 302
da99e870
EA
303notsticky By default, email sent to "user@local.host" are marked
304 as "sticky" -- that is, the local addresses aren't
305 matched against UDB and don't go through ruleset 5.
306 This features disables this treatment. It would
307 normally be used on network gateway machines.
f51c9ac8 308
3ad658d7
EA
309mailertable Include a "mailer table" which can be used to override
310 routing for particular domains. The argument of the
311 FEATURE may be the key definition. If none is specified,
312 the definition used is:
6e8cccfc 313 hash -o /etc/mailertable
d8b2ad36
EA
314 Keys in this database are fully qualified domain names
315 or partial domains preceded by a dot -- for example,
316 "vangogh.CS.Berkeley.EDU" or ".CS.Berkeley.EDU".
317 Values must be of the form:
3ad658d7 318 mailer:domain
d8b2ad36
EA
319 where "mailer" is the internal mailer name, and "domain"
320 is where to send the message. These maps are not
321 reflected into the message header.
f51c9ac8 322
d8b2ad36
EA
323domaintable Include a "domain table" which can be used to provide
324 full domains on unqualified (single word) hosts. The
325 argument of the FEATURE may be the key definition. If
326 none is specified, the definition used is:
6e8cccfc 327 hash -o /etc/domaintable
d8b2ad36
EA
328 The key in this table is the unqualified host name; the
329 value is the fully qualified domain. Anything in the
330 domaintable is reflected into headers; that is, this
331 is done in ruleset 3.
f51c9ac8 332
d1593b1a
EA
333bitdomain Look up bitnet hosts in a table to try to turn them into
334 internet addresses. The table can be built using the
2e9b6f6e 335 bitdomain program contributed by John Gardiner Myers.
d1593b1a
EA
336 The argument of the FEATURE may be the key definition; if
337 none is specified, the definition used is:
6e8cccfc 338 hash -o /etc/bitdomain.db
d1593b1a
EA
339 Keys are the bitnet hostname; values are the corresponding
340 internet hostname.
f51c9ac8 341
4f1c78c0
EA
342uucpdomain Similar feature for UUCP hosts. The default map definition
343 is:
6e8cccfc 344 hash -o /etc/uudomain.db
4f1c78c0
EA
345 At the moment there is no automagic tool to build this
346 database.
f51c9ac8 347
c62d746c
EA
348always_add_domain
349 Include the local host domain even on locally delivered
350 mail. Normally it is not added unless it is already
351 present.
f51c9ac8 352
d8b2ad36
EA
353allmasquerade If masquerading is enabled (using MASQUERADE_AS), this
354 feature will cause recipient addresses to also masquerade
355 as being from the masquerade host. Normally they get
356 the local hostname. Although this may be right for
357 ordinary users, it can break local aliases. For example,
358 if you send to "localalias", the originating sendmail will
359 find that alias and send to all members, but send the
360 message with "To: localalias@masqueradehost". Since that
361 alias likely does not exist, replies will fail. Use this
362 feature ONLY if you can guarantee that the ENTIRE
363 namespace on your masquerade host supersets all the
364 local entries.
f51c9ac8 365
2e9b6f6e
EA
366nodns We aren't running DNS at our site (for example,
367 we are UUCP-only connected). It's hard to consider
368 this a "feature", but hey, it had to go somewhere.
4a51b074 369
f51c9ac8
EA
370nullclient This is a special case -- it creates a stripped down
371 configuration file containing nothing but support for
de0c51e7
EA
372 forwarding all mail to a central hub via a local
373 SMTP-based network. The argument is the name of that
374 hub.
375
376 The only other feature that should be used in conjunction
377 with this one is "nocanonify" (this causes addresses to
378 be sent unqualified via the SMTP connection; normally
379 they are qualifed with the masquerade name, which
380 defaults to the name of the hub machine). No mailers
381 should be defined. No aliasing or forwarding is done.
f51c9ac8 382
bee9d799 383
4a51b074
EA
384+-------+
385| HACKS |
386+-------+
387
388Some things just can't be called features. To make this clear,
fd82c288 389they go in the hack subdirectory and are referenced using the HACK
4a51b074
EA
390macro. These will tend to be site-dependent. The release
391includes the Berkeley-dependent "cssubdomain" hack (that makes
392sendmail accept local names in either Berkeley.EDU or CS.Berkeley.EDU;
393this is intended as a short-term aid while we move hosts into
394subdomains.
395
bee9d799 396
4a51b074
EA
397+--------------------+
398| SITE CONFIGURATION |
399+--------------------+
400
401Complex sites will need more local configuration information, such as
402lists of UUCP hosts they speak with directly. This can get a bit more
403tricky. For an example of a "complex" site, see cf/ucbvax.mc.
404
405The SITECONFIG macro allows you to indirectly reference site-dependent
406configuration information stored in the siteconfig subdirectory. For
407example, the line
408
409 SITECONFIG(uucp.ucbvax, ucbvax, U)
410
411reads the file uucp.ucbvax for local connection information. The
412second parameter is the local name (in this case just "ucbvax" since
413it is locally connected, and hence a UUCP hostname) and the name of
414the class in which to store the host information. Another SITECONFIG
415line reads
416
417 SITECONFIG(uucp.ucbarpa, ucbarpa.Berkeley.EDU, W)
418
419This says that the file uucp.ucbarpa contains the list of UUCP sites
420connected to ucbarpa.Berkeley.EDU. The $=W class will be used to
421store this list. [The machine ucbarpa is gone now, but I've left
422this out-of-date configuration file around to demonstrate how you
423might do this.]
424
425The siteconfig file (e.g., siteconfig/uucp.ucbvax.m4) contains nothing
426more than a sequence of SITE macros describing connectivity. For
427example:
428
429 SITE(cnmat)
430 SITE(sgi olympus)
431
432The second example demonstrates that you can use two names on the
433same line; these are usually aliases for the same host (or are at
434least in the same company).
435
bee9d799 436
4a51b074
EA
437+-------------------+
438| TWEAKING RULESETS |
439+-------------------+
9df1b56b
EA
440
441For more complex configurations, you can define special rules.
442The macro LOCAL_RULE_3 introduces rules that are used in canonicalizing
443the names. Any modifications made here are reflected in the header.
444
445A common use is to convert old UUCP addreses to SMTP addresses using
446the UUCPSMTP macro. For example:
447
448 LOCAL_RULE_3
449 UUCPSMTP(decvax, decvax.dec.com)
450 UUCPSMTP(research, research.att.com)
451
452will cause addresses of the form "decvax!user" and "research!user"
453to be converted to "user@decvax.dec.com" and "user@research.att.com"
454respectively.
455
4a51b074
EA
456This could also be used to look hosts in a database map:
457
458 LOCAL_RULE_3
459 R$* < @ $+ > $* $: $1 < @ $(hostmap $2 $) > $3
460
461This map would be defined in the LOCAL_CONFIG portion, as shown below.
462
9df1b56b
EA
463Similarly, LOCAL_RULE_0 can be used to introduce new parsing rules.
464For example, new rules are needed to parse hostnames that you accept
c573210d
EA
465via MX records. For example, you might have:
466
467 LOCAL_RULE_0
468 R$+ < @ cnmat.Berkeley.EDU > $#uucp $@ cnmat $: $1
469
470You would use this if you had installed an MX record for cnmat.Berkeley.EDU
471pointing at this host; this rule catches the message and forwards it on
472using UUCP.
9df1b56b 473
06630be3
EA
474You can also tweak rulesets 1 and 2 using LOCAL_RULE_1 and LOCAL_RULE_2.
475These rulesets are normally empty.
476
4a51b074
EA
477A similar macro is LOCAL_CONFIG. This introduces lines added after the
478boilerplate option setting but before rulesets, and can be used to
a151c868 479declare local database maps or whatever. For example:
4a51b074
EA
480
481 LOCAL_CONFIG
482 Khostmap hash /etc/hostmap.db
483 Kyplocal nis -m hosts.byname
4a51b074 484
bee9d799 485
4a51b074
EA
486+---------------------------+
487| MASQUERADING AND RELAYING |
488+---------------------------+
489
490You can have your host masquerade as another using
491
492 MASQUERADE_AS(host.domain)
9df1b56b 493
4a51b074
EA
494This causes outgoing SMTP mail to be labelled as coming from the
495indicated domain, rather than $j. One normally masquerades as one
496of your own subdomains (for example, it's unlikely that I would
497choose to masquerade as an MIT site).
498
2e9b6f6e
EA
499The masquerade name is not normally canonified, so it is important
500that it be your One True Name, that is, fully qualified and not a
501CNAME.
502
4a51b074
EA
503there are always users that need to be "exposed" -- that is, their
504internal site name should be displayed instead of the masquerade name.
505Root is an example. You can add users to this list using
506
507 EXPOSED_USER(usernames)
508
509This adds users to class E; you could also use something like
510
511 FE/etc/sendmail.cE
512
513You can also arrange to relay all unqualified names (that is, names
514without @host) to a relay host. For example, if you have a central
515email server, you might relay to that host so that users don't have
516to have .forward files or aliases. You can do this using
517
28b51619 518 define(`LOCAL_RELAY', mailer:hostname)
4a51b074 519
28b51619
EA
520The ``mailer:'' can be omitted, in which case the mailer defaults to
521"smtp". There are some user names that you don't want relayed, perhaps
522because of local aliases. A common example is root, which may be
523locally aliased. You can add entries to this list using
4a51b074
EA
524
525 LOCAL_USER(usernames)
526
527This adds users to class L; you could also use something like
528
529 FL/etc/sendmail.cL
530
2e9b6f6e
EA
531If you want all incoming mail sent to a centralized hub, as for a
532shared /var/spool/mail scheme, use
34e49bd3 533
28b51619 534 define(`MAIL_HUB', mailer:hostname)
34e49bd3 535
28b51619
EA
536Again, ``mailer:'' defaults to "smtp". If you define both LOCAL_RELAY
537and MAIL_HUB, unqualified names and names in class L will be sent to
538the LOCAL_RELAY and other local names will be sent to MAIL_HUB. For
539example, if are on machine mastodon.CS.Berkeley.EDU, the following
540combinations of settings will have the indicated effects:
34e49bd3
EA
541
542email sent to.... eric eric@mastodon.CS.Berkeley.EDU
543
544LOCAL_RELAY set to mail.CS.Berkeley.EDU (delivered locally)
545mail.CS.Berkeley.EDU
546
547MAIL_HUB set to mammoth.CS.Berkeley.EDU mammoth.CS.Berkeley.EDU
548mammoth.CS.Berkeley.EDU
549
550Both LOCAL_RELAY and mail.CS.Berkeley.EDU mammoth.CS.Berkeley.EDU
551MAIL_HUB set as above
552
2e9b6f6e
EA
553If you want all outgoing mail to go to a central relay site, define
554SMART_HOST as well. Briefly:
555
556 LOCAL_RELAY applies to unqualifed names (e.g., "eric").
557 MAIL_HUB applies to names qualified with the name of the
558 local host (e.g., "eric@mastodon.CS.Berkeley.EDU").
559 SMART_HOST applies to names qualified with other hosts.
560
561However, beware that other relays (e.g., UUCP_RELAY, BITNET_RELAY, and
562FAX_RELAY) take precedence over SMART_HOST, so if you really want
563absolutely everything to go to a single central site you will need to
564unset all the other relays -- or better yet, find or build a minimal
565config file that does this.
566
28b51619
EA
567
568+-------------------------------+
569| NON-SMTP BASED CONFIGURATIONS |
570+-------------------------------+
571
572These configuration files are designed primarily for use by SMTP-based
573sites. I don't pretend that they are well tuned for UUCP-only or
574UUCP-primarily nodes (the latter is defined as a small local net
575connected to the rest of the world via UUCP). However, there is one
576hook to handle some special cases.
577
578You can define a ``smart host'' that understands a richer address syntax
579using:
580
581 define(`SMART_HOST', mailer:hostname)
582
bb3c21c3 583In this case, the ``mailer:'' defaults to "relay". Any messages that
28b51619
EA
584can't be handled using the usual UUCP rules are passed to this host.
585
586If you are on a local SMTP-based net that connects to the outside
587world via UUCP, you can use LOCAL_NET_CONFIG to add appropriate rules.
588For example:
589
590 define(`SMART_HOST', suucp:uunet)
591 LOCAL_NET_CONFIG
d8b2ad36 592 R$* < @ $* .$m. > $* $#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3
28b51619
EA
593
594This will cause all names that end in your domain name ($m) via
595SMTP; anything else will be sent via suucp (smart UUCP) to uunet.
d8b2ad36
EA
596If you have FEATURE(nocanonify), you may need to omit the dots after
597the $m. If you are running a local DNS inside your domain which is
598not otherwise connected to the outside world, you probably want to
599use:
600
601 define(`SMART_HOST', smtp:fire.wall.com)
602 LOCAL_NET_CONFIG
603 R$* < @ $* . > $* $#smtp $@ $2. $: $1 < @ $2. > $3
604
605That is, send directly only to things you found in your DNS lookup;
606anything else goes through SMART_HOST.
28b51619 607
2e9b6f6e
EA
608If you are not running DNS at all, it is important to use
609FEATURE(nodns) to avoid having sendmail queue everything waiting
610for the name server to come up.
611
28b51619 612
f7e8be31
EA
613+-----------+
614| WHO AM I? |
615+-----------+
616
617Normally, the $j macro is automatically defined to be your fully
618qualified domain name (FQDN). Sendmail does this by getting your
619host name using gethostname and then calling gethostbyname on the
620result. For example, in some environments gethostname returns
621only the root of the host name (such as "foo"); gethostbyname is
622supposed to return the FQDN ("foo.bar.com"). In some (fairly rare)
623cases, gethostbyname may fail to return the FQDN. In this case
624you MUST define confDOMAIN_NAME to be your fully qualified domain
625name. This is usually done using:
626
627 Dmbar.com
628 define(`confDOMAIN_NAME', `$w.$m')dnl
629
630
bb3c21c3
EA
631+--------------------+
632| USING MAILERTABLES |
633+--------------------+
634
635To use FEATURE(mailertable), you will have to create an external
636database containing the routing information for various domains.
637For example, a mailertable file in text format might be:
638
639 .my.domain xnet:%1.my.domain
640 uuhost1.my.domain suucp:uuhost1
641 .bitnet smtp:relay.bit.net
642
643This should normally be stored in /etc/mailertable. The actual
644database version of the mailertable is built using:
645
646 makemap hash /etc/mailertable.db < /etc/mailertable
647
648The semantics are simple. Any LHS entry that does not begin with
649a dot matches the full host name indicated. LHS entries beginning
650with a dot match anything ending with that domain name -- that is,
651they can be thought of as having a leading "*" wildcard. Matching
652is done in order of most-to-least qualified -- for example, even
653though ".my.domain" is listed first in the above example, an entry
654of "uuhost1.my.domain" will match the second entry since it is
655more explicit.
656
657The RHS should always be a "mailer:host" pair. The mailer is the
658configuration name of a mailer (that is, an `M' line in the
659sendmail.cf file). The "host" will be the hostname passed to
660that mailer. In domain-based matches (that is, those with leading
661dots) the "%1" may be used to interpolate the wildcarded part of
662the host name. For example, the first line above sends everything
663addressed to "anything.my.domain" to that same host name, but using
664the (presumably experimental) xnet mailer.
665
666
2e9b6f6e
EA
667+--------------------------------+
668| USING USERDB TO MAP FULL NAMES |
669+--------------------------------+
670
671The user database was not originally intended for mapping full names
672to login names (e.g., Eric.Allman => eric), but some people are using
673it that way. (I would recommend that you set up aliases for this
674purpose instead -- since you can specify multiple alias files, this
675is fairly easy.) The intent was to locate the default maildrop at
676a site, but allow you to override this by sending to a specific host.
677
678If you decide to set up the user database in this fashion, it is
679imperative that you also specify FEATURE(notsticky) -- otherwise,
680e-mail sent to Full.Name@local.host.name will be rejected.
681
f7e8be31
EA
682To build the internal form of the user databae, use:
683
684 makemap btree /usr/data/base.db < /usr/data/base.txt
685
2e9b6f6e 686
63013ec3
EA
687+------------------+
688| FlexFAX SOFTWARE |
689+------------------+
690
691Sam Leffler's FlexFAX software is still in beta test -- but he expects a
692public version out "later this week" [as of 3/1/93]. The following
693blurb is direct from Sam:
694
d1ad6cf3 695 $Header: /usr/people/sam/fax/RCS/HOWTO,v 1.14 93/05/24 11:42:16 sam Exp $
63013ec3
EA
696
697 How To Obtain This Software (in case all you get is this file)
d1ad6cf3 698 --------------------------------------------------------------
63013ec3 699 The source code is available for public ftp on
d1ad6cf3 700 sgi.com sgi/fax/v2.1.src.tar.Z
63013ec3
EA
701 (192.48.153.1)
702
703 You can also obtain inst'able images for Silicon Graphics machines from
d1ad6cf3 704 sgi.com sgi/fax/v2.1.inst.tar
63013ec3
EA
705 (192.48.153.1)
706
707 For example,
708 % ftp -n sgi.com
709 ....
710 ftp> user anonymous
711 ... <type in password>
712 ftp> cd sgi/fax
713 ftp> binary
d1ad6cf3
EA
714 ftp> get v2.1.src.tar.Z
715
716 In general, the latest version of the 2.1 release of the software is
717 always available as "v2.1.src.tar.Z" or "v2.1.inst.tar" in the ftp
718 directory. This file is a link to the appropriate released version (so
719 don't waste your time retrieving the linked file as well!) Any files of
720 the form v2.1.*.patch are shell scripts that can be used to patch older
721 versions of the source code. For example, the file v2.1.0.patch would
722 contain patches to update v2.1.0.tar.Z. (Note to beta testers: this is
723 different than the naming conventions used during beta testing.) Patch
724 files only work to go between consecutive versions, so if you are
725 multiple versions behind the latest release, you will need to apply
726 each patch file between your current version and the latest.
727
728
729 Obtaining the Software by Electronic Mail
730 -----------------------------------------
731 Do not send me requests for the software; they will be ignored (without
732 response). If you cannot use FTP at all, there is a service called
733 "ftpmail" available from gatekeeper.dec.com: you can send e-mail to
734 this machine and it will use FTP to retrieve files for you and send you
735 the files back again via e-mail. To find out more about the ftpmail
63013ec3
EA
736 service, send a message to "ftpmail@gatekeeper.dec.com" whose body
737 consists of the single line "help".
738
d1ad6cf3
EA
739
740 Obtaining the Software Within Silicon Graphics
741 ----------------------------------------------
63013ec3 742 Internal to Silicon Graphics there are inst'able images on the host
d1ad6cf3 743 flake.asd in the directory /usr/dist. Thus you can do something like:
63013ec3 744
d1ad6cf3 745 % inst -f flake.asd.sgi.com:/usr/dist/flexfax
63013ec3 746
d1ad6cf3 747 to install the latest version of the software on your machine.
63013ec3 748
d1ad6cf3
EA
749
750 What to do Once You've Retrieved Stuff
751 --------------------------------------
63013ec3
EA
752 The external distributions come in a compressed or uncompressed tar
753 file. To extract the source distribution:
754
d1ad6cf3 755 % zcat v2.1.src.tar.Z | tar xf -
63013ec3
EA
756
757 (uncompress and extract individual files in current directory). To
758 unpack and install the client portion of the inst'able distribution:
759
760 % mkdir dist
d1ad6cf3 761 % cd dist; tar xf ../v2.1.inst.tar; cd ..
63013ec3
EA
762 % inst -f dist/flexfax
763 ...
764 inst> go
765
766 (Note, the dist subdirectory is because some versions of inst fail if
d1ad6cf3
EA
767 the files are in the current directory.) Server binaries are also
768 included in the inst'able images as flexfax.server.*. They are not
769 installed by default, so to get them also you need to do:
63013ec3
EA
770
771 % inst -f flexfax
772 ...
773 inst> install flexfax.server.*
774 inst> go
775
d1ad6cf3 776 The SGI binaries were built for Version 4.0.5H of the IRIX operating
63013ec3
EA
777 system. They should work w/o problem on earlier versions of the
778 system, but I have not fully tested this. Also, note that to install a
779 server on an SGI machine, you need to have installed the Display
780 PostScript execution environment product (dps_eoe). Otherwise, the fax
781 server will not be able to convert PostScript to facsimile for
782 transmission.
783
d1ad6cf3
EA
784 If you are working from the source distribution, look at the file
785 README in the top of the source tree. If you are working from the inst
786 images, the subsystem flexfax.man.readme contains the README file and
787 other useful pieces of information--the installed files are placed in
788 the directory /usr/local/doc/flexfax). Basically you will need to run
789 the faxaddmodem script to setup and configure your fax modem. Consult
790 the README file and the manual page for faxaddmodem for information.
63013ec3 791
63013ec3 792
d1ad6cf3
EA
793 FlexFAX Mail List
794 -----------------
63013ec3
EA
795 A mailing list for users of this software is located on sgi.com.
796 If you want to join this mailing list or have a list-related request
797 such as getting your name removed from it, send a request to
798
d1ad6cf3
EA
799 majordomo@whizzer.wpd.sgi.com
800
801 For example, to subscribe, send the line "subscribe flexfax" in
802 the body of your message. The line "help" will return a list of
803 the commands understood by the mailing list management software.
63013ec3
EA
804
805 Submissions (including bug reports) should be directed to:
806
807 flexfax@sgi.com
808
d1ad6cf3
EA
809 When corresponding about this software please always specify what
810 version you have, what system you're running on, and, if the problem is
811 specific to your modem, identify the modem and firmware revision.
812
63013ec3 813
a151c868
EA
814+--------------------------------+
815| TWEAKING CONFIGURATION OPTIONS |
816+--------------------------------+
817
818There are a large number of configuration options that don't normally
819need to be changed. However, if you feel you need to tweak them, you
820can define the following M4 variables. This list is shown in four
821columns: the name you define, the default value for that definition,
822the option or macro that is affected (either Ox for an option or Dx
823for a macro), and a brief description. Greater detail of the semantics
824can be found in the Installation and Operations Guide.
825
fb32c2a1
EA
826Some options are likely to be deprecated in future versions -- that is,
827the option is only included to provide back-compatibility. These are
828marked with "*".
829
a7e36c1b
EA
830Remember that these options are M4 variables, and hence may need to
831be quoted. In particular, arguments with commas will usually have to
832be ``double quoted, like this phrase'' to avoid having the comma
833confuse things. This is common for alias file definitions and for
834the read timeout.
835
a151c868 836M4 Variable Name Default Mac/Opt Description
a7e36c1b 837================ ======= ======= ===========
a151c868
EA
838confMAILER_NAME MAILER-DAEMON Dn The sender name used for
839 internally generated
840 outgoing messages.
06630be3
EA
841confFROM_LINE From $g $d Dl The From_ line used when
842 sending to files or programs.
a151c868
EA
843confFROM_HEADER $?x$x <$g>$|$g$. The format of an internally
844 Dq generated From: address.
845confOPERATORS .:%@!^/[] Do Address operator characters.
2e9b6f6e 846confSMTP_LOGIN_MSG $j Sendmail $v/$Z ready at $b
a151c868
EA
847 De The initial (spontaneous)
848 SMTP greeting message.
f6232b5e 849confSEVEN_BIT_INPUT False O7 Force input to seven bits?
a151c868
EA
850confALIAS_WAIT 10 Oa Wait (in minutes) for alias
851 file rebuild.
bee9d799
EA
852confMIN_FREE_BLOCKS 4 Ob Minimum number of free blocks
853 on queue filesystem to accept
854 SMTP mail.
a151c868
EA
855confBLANK_SUB . OB Blank (space) substitution
856 character.
857confCON_EXPENSIVE False Oc Connect immediately to
858 mailers marked expensive?
859confCHECKPOINT_INTERVAL 10 OC Checkpoint queue files
860 every N recipients.
861confDELIVERY_MODE background Od Default delivery mode.
862confAUTO_REBUILD False OD Automatically rebuild
863 alias file if needed.
864confERROR_MODE (undefined) Oe Error message mode.
865confERROR_MESSAGE (undefined) OE Error message header/file.
866confSAVE_FROM_LINES False Of Save extra leading
867 From_ lines.
868confTEMP_FILE_MODE 0600 OF Temporary file mode.
869confDEF_GROUP_ID 1 Og Default group id.
870confMATCH_GECOS False OG Match GECOS field.
871confMAX_HOP 17 Oh Maximum hop count.
fb32c2a1 872confIGNORE_DOTS False Oi * Ignore dot as terminator
a151c868
EA
873 for incoming messages?
874confBIND_OPTS (empty) OI Default options for BIND.
fb32c2a1 875confMIME_FORMAT_ERRORS True Oj * Send error messages as MIME-
f6232b5e
EA
876 encapsulated messages per
877 RFC 1344.
2e9b6f6e
EA
878confFORWARD_PATH (undefined) OJ The colon-separated list of
879 places to search for .forward
880 files.
a151c868
EA
881confMCI_CACHE_SIZE 2 Ok Size of open connection cache.
882confMCI_CACHE_TIMEOUT 5m OK Open connection cache timeout.
fb32c2a1
EA
883confUSE_ERRORS_TO False Ol * Use the Errors-To: header to
884 deliver error messages. This
885 should not be necessary because
886 of general acceptance of the
887 envelope/header distinction.
a151c868
EA
888confLOG_LEVEL 9 OL Log level.
889confME_TOO False Om Include sender in group
890 expansions.
891confCHECK_ALIASES True On Check RHS of aliases when
892 running newaliases.
fb32c2a1 893confOLD_STYLE_HEADERS True Oo * Assume that headers without
a151c868 894 special chars are old style.
4c230f32 895confDAEMON_OPTIONS (undefined) OO SMTP daemon options.
88ce9b1c 896confPRIVACY_FLAGS authwarnings Op Privacy flags.
a151c868
EA
897confCOPY_ERRORS_TO (undefined) OP Address for additional copies
898 of all error messages.
899confQUEUE_FACTOR (undefined) Oq Slope of queue-only function
33f90dbe 900confREAD_TIMEOUT (undefined) Or SMTP read timeouts.
fb32c2a1 901confSAFE_QUEUE True Os * Commit all messages to disk
a151c868 902 before forking.
88ce9b1c
EA
903confMESSAGE_TIMEOUT 5d/4h OT Timeout for messages before
904 sending error/warning message.
386fe59f 905confTIME_ZONE USE_SYSTEM Ot Time zone info -- can be
a151c868
EA
906 USE_SYSTEM to use the system's
907 idea, USE_TZ to use the user's
908 TZ envariable, or something
909 else to force that value.
910confDEF_USER_ID 1 Ou Default user id.
39ed20b0 911confUSERDB_SPEC (undefined) OU User database specification.
4c230f32 912confFALLBACK_MX (undefined) OV Fallback MX host.
5dd53c38
EA
913confTRY_NULL_MX_LIST False Ow If we are the best MX for a
914 host and haven't made other
915 arrangements, try connecting
916 to the host directly; normally
917 this would be a config error.
a151c868
EA
918confQUEUE_LA 8 Ox Load average at which queue-only
919 function kicks in.
920confREFUSE_LA 12 OX Load average at which incoming
921 SMTP connections are refused.
a151c868 922confWORK_RECIPIENT_FACTOR
fb32c2a1
EA
923 (undefined) Oy Cost of each recipient.
924confSEPARATE_PROC False OY Run all deliveries in a
925 separate process.
a151c868
EA
926confWORK_CLASS_FACTOR (undefined) Oz Priority multiplier for class.
927confWORK_TIME_FACTOR (undefined) OZ Cost of each delivery attempt.
dec2b686
EA
928confCW_FILE /etc/sendmail.cw Name of file used to get the
929 Fw local additions to the $=w
930 class.
2e9b6f6e 931confSMTP_MAILER smtp - The mailer name used when
cf36aa8d
EA
932 SMTP connectivity is required.
933 Either "smtp" or "esmtp".
2c840221
EA
934confLOCAL_MAILER local - The mailer name used when
935 local connectivity is required.
936 Almost always "local".
bb3c21c3
EA
937confRELAY_MAILER relay - The default mailer name used
938 for relaying any mail (e.g.,
939 to a BITNET_RELAY, a
940 SMART_HOST, or whatever).
941 This can reasonably be "suucp"
942 if you are on a UUCP-connected
943 site.
f7e8be31 944confDOMAIN_NAME (undefined) Dj If defined, sets $j.
a151c868 945
bee9d799 946
4a51b074
EA
947+-----------+
948| HIERARCHY |
949+-----------+
7ace9d88
EA
950
951Within this directory are several subdirectories, to wit:
952
953m4 General support routines. These are typically
954 very important and should not be changed without
fd82c288 955 very careful consideration.
7ace9d88
EA
956
957cf The configuration files themselves. They have
958 ".mc" suffixes, and must be run through m4 to
959 become complete. The resulting output should
960 have a ".cf" suffix.
961
962ostype Definitions describing a particular operating
963 system type. These should always be referenced
964 using the OSTYPE macro in the .mc file. Examples
965 include "bsd4.3", "bsd4.4", "sunos3.5", and
966 "sunos4.1".
967
968domain Definitions describing a particular domain, referenced
969 using the DOMAIN macro in the .mc file. These are
970 site dependent; for example, we contribute "cs.exposed.m4"
971 and "cs.hidden.m4" which both describe hosts in the
972 CS.Berkeley.EDU subdomain; the former displays the local
973 hostname (e.g., mammoth.CS.Berkeley.EDU), whereas the
974 latter does its best to hide the identity of the local
975 workstation inside the CS subdomain.
976
977mailer Descriptions of mailers. These are referenced using
978 the MAILER macro in the .mc file.
979
980sh Shell files used when building the .cf file from the
981 .mc file in the cf subdirectory.
982
983feature These hold special orthogonal features that you might
984 want to include. They should be referenced using
985 the FEATURE macro.
986
987hack Local hacks. These can be referenced using the HACK
988 macro. They shouldn't be of more than voyeuristic
989 interest outside the .Berkeley.EDU domain, but who knows?
990 We've all got our own peccadilloes.
991
9df1b56b
EA
992siteconfig Site configuration -- e.g., tables of locally connected
993 UUCP sites.
994
7ace9d88 995
4a51b074
EA
996+------------------------+
997| ADMINISTRATIVE DETAILS |
998+------------------------+
7ace9d88
EA
999
1000The following sections detail usage of certain internal parts of the
1001sendmail.cf file. Read them carefully if you are trying to modify
1002the current model. If you find the above descriptions adequate, these
1003should be {boring, confusing, tedious, ridiculous} (pick one or more).
1004
1005RULESETS (* means built in to sendmail)
1006
1007 0 * Parsing
1008 1 * Sender rewriting
1009 2 * Recipient rewriting
1010 3 * Canonicalization
1011 4 * Post cleanup
f5baef19 1012 5 * Local address rewrite (after aliasing)
b197efaa
EA
1013 1x mailer rules (sender qualification)
1014 2x mailer rules (recipient qualification)
0409c6a2
EA
1015 3x mailer rules (sender header qualification)
1016 4x mailer rules (recipient header qualification)
1017 5x mailer subroutines (general)
1018 6x mailer subroutines (general)
1019 7x mailer subroutines (general)
1020 8x reserved
b197efaa 1021 90 Mailertable host stripping
f7ffd8e3
EA
1022 96 Bottom half of Ruleset 3 (ruleset 6 in old sendmail)
1023 97 Hook for recursive ruleset 0 call (ruleset 7 in old sendmail)
5dd53c38 1024 98 Local part of ruleset 0 (ruleset 8 in old sendmail)
7ace9d88
EA
1025
1026
1027MAILERS
1028
1029 0 local, prog local and program mailers
1030 1 smtp SMTP channel
bee9d799
EA
1031 2 uucp UNIX-to-UNIX Copy Program
1032 3 netnews Network News delivery
63013ec3 1033 4 fax Sam Leffler's FlexFAX software
7ace9d88
EA
1034
1035
1036MACROS
1037
1038 A
1039 B Bitnet Relay
1040 C CSNET Relay
f5baef19 1041 D The local domain -- usually not needed
7ace9d88 1042 E
63013ec3 1043 F FAX Relay
7ace9d88 1044 G
34e49bd3 1045 H mail Hub (for mail clusters)
7ace9d88
EA
1046 I
1047 J
1048 K
1049 L
1050 M Masquerade (who I claim to be)
1051 N
1052 O
1053 P
1054 Q
1055 R Relay (for unqualified names)
28b51619 1056 S Smart Host
7ace9d88 1057 T
c573210d
EA
1058 U my UUCP name (if I have a UUCP connection)
1059 V UUCP Relay (class V hosts)
7ace9d88
EA
1060 W UUCP Relay (class W hosts)
1061 X UUCP Relay (class X hosts)
c573210d 1062 Y UUCP Relay (all other hosts)
7ace9d88
EA
1063 Z Version number
1064
1065
1066CLASSES
1067
1068 A
1069 B
1070 C
1071 D
4a51b074 1072 E addresses that should not seem to come from $M
f5baef19 1073 F hosts we forward for
7ace9d88
EA
1074 G
1075 H
1076 I
1077 J
1078 K
1079 L addresses that should not be forwarded to $R
1080 M
1081 N
1082 O operators that indicate network operations (cannot be in local names)
91626fee 1083 P top level pseudo-domains: BITNET, FAX, UUCP, etc.
7ace9d88
EA
1084 Q
1085 R
1086 S
1087 T
1088 U locally connected UUCP hosts
c573210d
EA
1089 V UUCP hosts connected to relay $V
1090 W UUCP hosts connected to relay $W
1091 X UUCP hosts connected to relay $X
1092 Y locally connected smart UUCP hosts
2e9b6f6e 1093 Z locally connected domain-ized UUCP hosts
f5baef19 1094 . the class containing only a dot
7ace9d88
EA
1095
1096
1097M4 DIVERSIONS
1098
28b51619
EA
1099 1 Local host detection and resolution
1100 2 Local Ruleset 3 additions
1101 3 Local Ruleset 0 additions
9df1b56b 1102 4 UUCP Ruleset 0 additions
c573210d 1103 5 locally interpreted names (overrides $R)
f5baef19 1104 6 local configuration (at top of file)
7ace9d88 1105 7 mailer definitions
f5baef19 1106 8 special local name recognition (late in ruleset 3)
06630be3 1107 9 special local rulesets (1 and 2)