xref: /csrg-svn/usr.sbin/sendmail/cf/README (revision 54839)
1*54839Seric@(#)README	2.4 (Berkeley) 07/09/92
251220Seric
351220SericThis document describes the sendmail configuration files being used
451220Sericat Berkeley.  There have been several previous versions.  This file
551220Sericis being written on 24 July 1991, and will probably not be generally
651220Sericavailable for several months.
751220Seric
851220SericINSTALLING A NEW SITE CONFIGURATION
951220Seric
1051220SericConfiguration files are contained in the subdirectory "cf", with a
1151220Sericsuffix ".mc".  They must be run through "m4" to produce a ".cf" file.
1251220Seric
1351220SericEvery .mc file SHOULD begin with:
1451220Seric
1551220Seric	divert(-1)
1651220Seric	COPYRIGHT NOTICE
1751220Seric	divert(0)
1851220Seric
1951220SericIf you don't care about copyrights, you can omit this.  If you try
2051220Sericto patent this, I'll be very, very pissed.  I haven't patented a lot
2151220Sericof hot ideas so that you can use them; I expect reciprocal courtesy.
2251220SericA copyleft is a copyright by another name.
2351220Seric
2451220SericThe copyright, if any, MUST be followed by:
2551220Seric
2651220Seric	include(../m4/cf.m4)
2751220Seric
2851220SericThis will pull in the M4 macros you will need to make sense of
2951220Sericeverything else.  As the saying goes, don't think about it, just
3051220Sericdo it.  If you don't do it, don't bother reading the rest of this
3151220Sericfile.
3251220Seric
3351220SericAt this point, let me make one thing perfectly clear.  I am a rope
3451220Sericsalesman.  I sell you rope.  I haven't produced a new M4 system
3551220Sericthat detects latent bugs, nor have I tried to fix the old one.
3651220Seric(However, I have decided to rely on a post-V7 version; if you
3751220Sericare running the 4.2bsd, SysV.2, or 7th Edition version, I suggest
3851220Sericfinding a friend with a newer version.  You can m4-expand on
3951220Serictheir system, then run locally.)
4051220Seric
4151220SericLet's examine a typical .mc file (cf/cs-exposed.mc):
4251220Seric
4351220Seric	divert(-1)
4451220Seric	#
4551220Seric	# Copyright (c) 1983 Eric P. Allman
4651220Seric	# Copyright (c) 1988 The Regents of the University of California.
4751220Seric	# All rights reserved.
4851220Seric	#
4951220Seric	# Redistribution and use in source and binary forms are permitted
5051220Seric	# provided that the above copyright notice and this paragraph are
5151220Seric	# duplicated in all such forms and that any documentation,
5251220Seric	# advertising materials, and other materials related to such
5351220Seric	# distribution and use acknowledge that the software was developed
5451220Seric	# by the University of California, Berkeley.  The name of the
5551220Seric	# University may not be used to endorse or promote products derived
5651220Seric	# from this software without specific prior written permission.
5751220Seric	# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
5851220Seric	# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
5951220Seric	# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
6051220Seric	#
6151220Seric
6251220SericIf you copy this file and modify it, you should maintain this copyright
6351220Sericnotice.  If you actually start from scratch you can delete it -- but be
6451220Serichonest!
6551220Seric
6651220Seric	include(`../m4/cf.m4')
6751220Seric
6851220SericYou need this line!
6951220Seric
7051268Seric	VERSIONID(<SCCS or RCS version id>)
7151220Seric
7251220SericVERSIONID is a macro that stuffs the version information into the
7351220Sericresulting file.  We use SCCS; you could use RCS, something else, or
7451220Sericomit it completely.
7551220Seric
7651268Seric	DOMAIN(cs.exposed)
7751220Seric
7851220SericThis example exposes the host inside of the CS subdomain -- that is,
7951220Sericit doesn't try to hide the name of the workstation to the outside
8051220Sericworld.  Changing this to DOMAIN(cs.hidden) would have made outgoing
8151220Sericmessages refer to "<username>@CS.Berkeley.EDU" instead of using the
8251220Sericlocal hostname.  This can also be effected by using:
8351220Seric
8451220Seric	define(`MASQUERADE_AS', `masquerade.host.name.domain.name')dnl
8551220Seric
8651220Sericin the ".mc" file.
8751220Seric
8851268Seric	MAILER(smtp)
8951220Seric
9051309SericThese describe the mailers used at the default CS site site.  The
9151309Sericlocal mailer is always included automatically.
9251220Seric
9351220SericNote that cf/cs-exposed.mc omits an OSTYPE macro -- this assumes
9451220Sericdefault Computer Science Division environment.  There are several
9551220Sericenvironments available: bsd4.3, bsd4.4, riscos4.5, sunos3.5,
9651220Sericsunos4.1, and ultrix4.1.  These change things like the location
9751220Sericof the alias file and queue directory.
9851220Seric
9951220SericMAILERS
10051220Seric
10151220SericThere are fewer mailers supported in this version than the previous
10251220Sericversion, owing mostly to a simpler world.
10351220Seric
10451220Sericlocal		The local and prog mailers.  You will almost always
10551220Seric		need these; the only exception is if you relay ALL
10651220Seric		your mail to another site.
10751220Seric
10851220Sericsmtp		The Simple Mail Transport Protocol mailer.  This does
10951220Seric		not hide hosts behind a gateway or another other
11051220Seric		such hack; it assumes a world where everyone is
11151220Seric		running the name server.
11251220Seric
11351220Sericuucp		The Unix-to-Unix Copy Program mailer.  Actually, this
11451220Seric		defines two mailers, "uucp" and "suucp".  The latter
11551220Seric		is for when you know that the UUCP mailer at the other
11651220Seric		end can handle multiple recipients in one transfer.
11751220Seric
11851268SericEXTENSIONS
11951268Seric
12051268SericFor more complex configurations, you can define special rules.
12151268SericThe macro LOCAL_RULE_3 introduces rules that are used in canonicalizing
12251268Sericthe names.  Any modifications made here are reflected in the header.
12351268Seric
12451268SericA common use is to convert old UUCP addreses to SMTP addresses using
12551268Sericthe UUCPSMTP macro.  For example:
12651268Seric
12751268Seric	LOCAL_RULE_3
12851268Seric	UUCPSMTP(decvax,	decvax.dec.com)
12951268Seric	UUCPSMTP(research,	research.att.com)
13051268Seric
13151268Sericwill cause addresses of the form "decvax!user" and "research!user"
13251268Sericto be converted to "user@decvax.dec.com" and "user@research.att.com"
13351268Sericrespectively.
13451268Seric
13551268SericSimilarly, LOCAL_RULE_0 can be used to introduce new parsing rules.
13651268SericFor example, new rules are needed to parse hostnames that you accept
13751309Sericvia MX records.  For example, you might have:
13851268Seric
13951309Seric	LOCAL_RULE_0
14051309Seric	R$+ < @ cnmat.Berkeley.EDU >	$#uucp $@ cnmat $: $1
14151309Seric
14251309SericYou would use this if you had installed an MX record for cnmat.Berkeley.EDU
14351309Sericpointing at this host; this rule catches the message and forwards it on
14451309Sericusing UUCP.
14551309Seric
14651268Seric????
14751268Seric
14851220SericHIERARCHY
14951220Seric
15051220SericWithin this directory are several subdirectories, to wit:
15151220Seric
15251220Sericm4		General support routines.  These are typically
15351220Seric		very important and should not be changed without
15451220Seric		contacting your lawyer.
15551220Seric
15651220Sericcf		The configuration files themselves.  They have
15751220Seric		".mc" suffixes, and must be run through m4 to
15851220Seric		become complete.  The resulting output should
15951220Seric		have a ".cf" suffix.
16051220Seric
16151220Sericostype		Definitions describing a particular operating
16251220Seric		system type.  These should always be referenced
16351220Seric		using the OSTYPE macro in the .mc file.  Examples
16451220Seric		include "bsd4.3", "bsd4.4", "sunos3.5", and
16551220Seric		"sunos4.1".
16651220Seric
16751220Sericdomain		Definitions describing a particular domain, referenced
16851220Seric		using the DOMAIN macro in the .mc file.  These are
16951220Seric		site dependent; for example, we contribute "cs.exposed.m4"
17051220Seric		and "cs.hidden.m4" which both describe hosts in the
17151220Seric		CS.Berkeley.EDU subdomain; the former displays the local
17251220Seric		hostname (e.g., mammoth.CS.Berkeley.EDU), whereas the
17351220Seric		latter does its best to hide the identity of the local
17451220Seric		workstation inside the CS subdomain.
17551220Seric
17651220Sericmailer		Descriptions of mailers.   These are referenced using
17751220Seric		the MAILER macro in the .mc file.
17851220Seric
17951220Sericsh		Shell files used when building the .cf file from the
18051220Seric		.mc file in the cf subdirectory.
18151220Seric
18251220Sericfeature		These hold special orthogonal features that you might
18351220Seric		want to include.  They should be referenced using
18451220Seric		the FEATURE macro.
18551220Seric
18651220Serichack		Local hacks.  These can be referenced using the HACK
18751220Seric		macro.  They shouldn't be of more than voyeuristic
18851220Seric		interest outside the .Berkeley.EDU domain, but who knows?
18951220Seric		We've all got our own peccadilloes.
19051220Seric
19151268Sericsiteconfig	Site configuration -- e.g., tables of locally connected
19251268Seric		UUCP sites.
19351220Seric
19451268Seric
19551220SericADMINISTRATIVE DETAILS
19651220Seric
19751220SericThe following sections detail usage of certain internal parts of the
19851220Sericsendmail.cf file.  Read them carefully if you are trying to modify
19951220Sericthe current model.  If you find the above descriptions adequate, these
20051220Sericshould be {boring, confusing, tedious, ridiculous} (pick one or more).
20151220Seric
20251220SericRULESETS (* means built in to sendmail)
20351220Seric
20451220Seric   0 *	Parsing
20551220Seric   1 *	Sender rewriting
20651220Seric   2 *	Recipient rewriting
20751220Seric   3 *	Canonicalization
20851220Seric   4 *	Post cleanup
209*54839Seric   5 *	Local address rewrite (after aliasing)
21051220Seric   6	Bottom half of Ruleset 3
211*54839Seric   7	Back compatibility for UUCP
21251220Seric   8	"host dependent cleanup" -- unused?
21351220Seric   9	change rightmost % to @ -- needed?
21451220Seric
21551220Seric
21651220SericMAILERS
21751220Seric
21851220Seric   0	local, prog	local and program mailers
21951220Seric   1	smtp		SMTP channel
22051220Seric   2	uucp
22151220Seric
22251220Seric
22351220SericMACROS
22451220Seric
22551220Seric   A
22651220Seric   B	Bitnet Relay
22751220Seric   C	CSNET Relay
228*54839Seric   D	The local domain -- usually not needed
22951220Seric   E
23051220Seric   F
23151220Seric   G
23251220Seric   H
23351220Seric   I
23451220Seric   J
23551220Seric   K
23651220Seric   L
23751220Seric   M	Masquerade (who I claim to be)
23851220Seric   N
23951220Seric   O
24051220Seric   P
24151220Seric   Q
24251220Seric   R	Relay (for unqualified names)
24351220Seric   S
24451220Seric   T
24551309Seric   U	my UUCP name (if I have a UUCP connection)
24651309Seric   V	UUCP Relay (class V hosts)
24751220Seric   W	UUCP Relay (class W hosts)
24851220Seric   X	UUCP Relay (class X hosts)
24951309Seric   Y	UUCP Relay (all other hosts)
25051220Seric   Z	Version number
25151220Seric
25251220Seric
25351220SericCLASSES
25451220Seric
25551220Seric   A
25651220Seric   B
25751220Seric   C
25851220Seric   D
25951220Seric   E
260*54839Seric   F	hosts we forward for
26151220Seric   G
26251220Seric   H
26351220Seric   I
26451220Seric   J
26551220Seric   K
26651220Seric   L	addresses that should not be forwarded to $R
26751220Seric   M
26851220Seric   N
26951220Seric   O	operators that indicate network operations (cannot be in local names)
27051220Seric   P
27151220Seric   Q
27251220Seric   R
27351220Seric   S
27451220Seric   T
27551220Seric   U	locally connected UUCP hosts
27651309Seric   V	UUCP hosts connected to relay $V
27751309Seric   W	UUCP hosts connected to relay $W
27851309Seric   X	UUCP hosts connected to relay $X
27951309Seric   Y	locally connected smart UUCP hosts
28051220Seric   Z
281*54839Seric   .	the class containing only a dot
28251220Seric
28351220Seric
28451220SericM4 DIVERSIONS
28551220Seric
28651220Seric   1	Versions
28751220Seric   2	Local Ruleset 0 additions
28851220Seric   3	Local Ruleset 3 additions
28951268Seric   4	UUCP Ruleset 0 additions
29051309Seric   5	locally interpreted names (overrides $R)
291*54839Seric   6	local configuration (at top of file)
29251220Seric   7	mailer definitions
293*54839Seric   8	special local name recognition (late in ruleset 3)
29451220Seric   9
295