xref: /csrg-svn/usr.sbin/sendmail/cf/m4/proto.m4 (revision 60894)
151222Sericdivert(-1)
251222Seric#
351222Seric# Copyright (c) 1983 Eric P. Allman
451222Seric# Copyright (c) 1988 The Regents of the University of California.
551222Seric# All rights reserved.
651222Seric#
751222Seric# %sccs.include.redist.sh%
851222Seric#
951222Sericdivert(0)
1051222Seric
11*60894SericVERSIONID(`@(#)proto.m4	6.42 (Berkeley) 06/01/93')
1251222Seric
1351322SericMAILER(local)dnl
1451222Seric
15*60894Sericifdef(`_OLD_SENDMAIL_',
16*60894Seric`define(`_SET_96_', 6)dnl
17*60894Sericdefine(`_SET_97_', 7)dnl',
1858119Seric`# level 4 config file format
19*60894SericV4
20*60894Sericdefine(`_SET_96_', 96)dnl
21*60894Sericdefine(`_SET_97_', 97)dnl')
2252646Seric
2351222Seric##################
2451222Seric#   local info   #
2551222Seric##################
2651222Seric
2760212SericCP.
2860212Seric
2951889SericCwlocalhost
3051887Sericifdef(`USE_CW_FILE',
3151889Seric`# file containing names of hosts for which we receive email
3258406SericCONCAT(`Fw', confCW_FILE)', `dnl')
3351222Seric
3451222Sericifdef(`UUCP_RELAY',
3551222Seric`# UUCP relay host
3651281SericCONCAT(DY, UUCP_RELAY)
3760212SericCPUUCP
3857944Seric
3951222Seric')dnl
4051222Sericifdef(`BITNET_RELAY',
4151222Seric`#  BITNET relay host
4251222SericCONCAT(DB, BITNET_RELAY)
4360212SericCPBITNET
4457944Seric
4551222Seric')dnl
4651222Sericifdef(`CSNET_RELAY',
4751222Seric`# CSNET relay host
4851222SericCONCAT(DC, CSNET_RELAY)
4960212SericCPCSNET
5057944Seric
5151222Seric')dnl
5258364Sericifdef(`FAX_RELAY',
5358364Seric`# FAX relay host
5458364SericCONCAT(DF, FAX_RELAY)
5560212SericCPFAX
5658364Seric
5758364Seric')dnl
5858070Sericifdef(`SMART_HOST',
5958070Seric`# "Smart" UUCP relay host
6058070SericCONCAT(DS, SMART_HOST)
6151222Seric
6258070Seric')dnl
6358781Sericifdef(`MAILER_TABLE',
6458781Seric`# Mailer table (overriding domains)
6558781SericKmailertable MAILER_TABLE
6658781Seric
6758781Seric')dnl
6851222Seric# who I send unqualified names to (null means deliver locally)
6951222SericCONCAT(DR, ifdef(`LOCAL_RELAY', LOCAL_RELAY))
7051222Seric
7157527Seric# who gets all local email traffic ($R has precedence for unqualified names)
7257527SericCONCAT(DH, ifdef(`MAIL_HUB', MAIL_HUB))
7357527Seric
7458070Seric# my official hostname ($w or $w.$D)
7558070SericCONCAT(Dj$w, ifdef(`NEED_DOMAIN', .$D))
7658070Seric
7758070Seric# who I masquerade as (can be $j)
7858070SericCONCAT(DM, ifdef(`MASQUERADE_NAME', MASQUERADE_NAME, $j))
7958070Seric
8057245Seric# class L: names that should be delivered locally, even if we have a relay
8157245Seric# class E: names that should be exposed as from this host, even if we masquerade
8251279SericCLroot
8357245SericCEroot
8451279Sericundivert(5)dnl
8551279Seric
8651222Seric# operators that cannot be in local usernames (i.e., network indicators)
8758288SericCO @ % ifdef(`_NO_UUCP_', `', `!')
8851222Seric
8951322Seric# a class with just dot (for identifying canonical names)
9051322SericC..
9151322Seric
9258808Sericifdef(`_OLD_SENDMAIL_', `dnl',
9358808Seric`# dequoting map
9458808SericKdequote dequote')
9557944Seric
9659033Sericundivert(6)dnl
9759033Seric
9857944Seric######################
9957944Seric#   Special macros   #
10057944Seric######################
10157944Seric
10257944Seric# SMTP initial login message
10357944SericCONCAT(De, confSMTP_LOGIN_MSG)
10457944Seric
10557944Seric# UNIX initial From header format
10657944SericCONCAT(Dl, confFROM_LINE)
10757944Seric
10857944Seric# my name for error messages
10957944SericCONCAT(Dn, confMAILER_NAME)
11057944Seric
11157944Seric# delimiter (operator) characters
11257944SericCONCAT(Do, confOPERATORS)
11357944Seric
11457944Seric# format of a total name
11557944SericCONCAT(Dq, ifdef(`confFROM_HEADER', confFROM_HEADER,
11657944Seric	ifdef(`_OLD_SENDMAIL_', `$g$?x ($x)$.', `$?x$x <$g>$|$g$.')))
11757944Sericinclude(`../m4/version.m4')
11857944Seric
11957944Seric###############
12057944Seric#   Options   #
12157944Seric###############
12257944Seric
12359887Seric# strip message body to 7 bits on input?
12459887SericCONCAT(O7, confSEVEN_BIT_INPUT)
12557944Seric
12657944Seric# wait (in minutes) for alias file rebuild
12757944SericCONCAT(Oa, confALIAS_WAIT)
12857944Seric
12957944Seric# location of alias file
13057944SericCONCAT(OA, ifdef(`ALIAS_FILE', ALIAS_FILE, /etc/aliases))
13157944Seric
13258084Seric# minimum number of free blocks on filesystem
13358084SericCONCAT(Ob, confMIN_FREE_BLOCKS)
13458084Seric
13557944Seric# substitution for space (blank) characters
13657944SericCONCAT(OB, confBLANK_SUB)
13757944Seric
13857944Seric# connect to "expensive" mailers on initial submission?
13957944SericCONCAT(Oc, confCON_EXPENSIVE)
14057944Seric
14157944Seric# checkpoint queue runs after every N successful deliveries
14257944SericCONCAT(OC, confCHECKPOINT_INTERVAL)
14357944Seric
14457944Seric# default delivery mode
14557944SericCONCAT(Od, confDELIVERY_MODE)
14657944Seric
14757944Seric# automatically rebuild the alias database?
14857944SericCONCAT(OD, confAUTO_REBUILD)
14957944Seric
15057944Seric# error message header/file */
15157944Sericifdef(`confERROR_MESSAGE',
15257944Seric	concat(OE, confERROR_MESSAGE),
15357944Seric	#OE/etc/sendmail.oE)
15457944Seric
15557944Seric# error mode
15657944Sericifdef(`confERROR_MODE',
15757944Seric	concat(Oe, confERROR_MODE),
15857944Seric	#Oep)
15957944Seric
16057944Seric# save Unix-style "From_" lines at top of header?
16157944SericCONCAT(Of, confSAVE_FROM_LINES)
16257944Seric
16357944Seric# temporary file mode
16457944SericCONCAT(OF, confTEMP_FILE_MODE)
16557944Seric
16657944Seric# match recipients against GECOS field?
16757944SericCONCAT(OG, confMATCH_GECOS)
16857944Seric
16957944Seric# default GID
17057944SericCONCAT(Og, confDEF_GROUP_ID)
17157944Seric
17257944Seric# maximum hop count
17357944SericCONCAT(Oh, confMAX_HOP)
17457944Seric
17557944Seric# location of help file
17657944SericCONCAT(OH, ifdef(`HELP_FILE', HELP_FILE, /usr/lib/sendmail.hf))
17757944Seric
17857944Seric# ignore dots as terminators in incoming messages?
17957944SericCONCAT(Oi, confIGNORE_DOTS)
18057944Seric
18157944Seric# Insist that the BIND name server be running to resolve names
18257944Sericifdef(`confBIND_OPTS',
18357944Seric	CONCAT(OI, confBIND_OPTS),
18457944Seric	#OI)
18557944Seric
18659887Seric# deliver MIME-encapsulated error messages?
18759887SericCONCAT(Oj, confMIME_FORMAT_ERRORS)
18859887Seric
18957944Seric# Forward file search path
19057944Sericifdef(`confFORWARD_PATH',
19157944Seric	CONCAT(OJ, confFORWARD_PATH),
19257944Seric	#OJ/var/forward/$u:$z/.forward.$w:$z/.forward)
19357944Seric
19457944Seric# open connection cache size
19557944SericCONCAT(Ok, confMCI_CACHE_SIZE)
19657944Seric
19757944Seric# open connection cache timeout
19857944SericCONCAT(OK, confMCI_CACHE_TIMEOUT)
19957944Seric
20057944Seric# log level
20157944SericCONCAT(OL, confLOG_LEVEL)
20257944Seric
20357944Seric# send to me too, even in an alias expansion?
20457944SericCONCAT(Om, confME_TOO)
20557944Seric
20657944Seric# verify RHS in newaliases?
20757944SericCONCAT(On, confCHECK_ALIASES)
20857944Seric
20957944Seric# default messages to old style headers if no special punctuation?
21057944SericCONCAT(Oo, confOLD_STYLE_HEADERS)
21157944Seric
21258860Seric# SMTP daemon options
21358860Sericifdef(`confDAEMON_OPTIONS',
21458860Seric	CONCAT(OO, confDAEMON_OPTIONS),
21558860Seric	#OOPort=esmtp)
21658860Seric
21758084Seric# privacy flags
21858084SericCONCAT(Op, confPRIVACY_FLAGS)
21958084Seric
22057944Seric# who (if anyone) should get extra copies of error messages
22157944Sericifdef(`confCOPY_ERRORS_TO',
22257944Seric	CONCAT(OP, confCOPY_ERRORS_TO),
22357944Seric	#OPPostmaster)
22457944Seric
22557944Seric# slope of queue-only function
22657944Sericifdef(`confQUEUE_FACTOR',
22757944Seric	CONCAT(Oq, confQUEUE_FACTOR),
22857944Seric	#Oq600000)
22957944Seric
23057944Seric# queue directory
23157944SericCONCAT(OQ, ifdef(`QUEUE_DIR', QUEUE_DIR, /var/spool/mqueue))
23257944Seric
23357944Seric# read timeout -- now OK per RFC 1123 section 5.3.2
23458119Sericifdef(`confREAD_TIMEOUT',
23558119Seric	CONCAT(Or, confREAD_TIMEOUT),
23658119Seric	#Ordatablock=10m)
23757944Seric
23857944Seric# queue up everything before forking?
23957944SericCONCAT(Os, confSAFE_QUEUE)
24057944Seric
24157944Seric# status file
24257944SericCONCAT(OS, ifdef(`STATUS_FILE', STATUS_FILE, /etc/sendmail.st))
24357944Seric
24457944Seric# default message timeout interval
24557944SericCONCAT(OT, confMESSAGE_TIMEOUT)
24657944Seric
24757944Seric# time zone handling:
24857944Seric#  if undefined, use system default
24957944Seric#  if defined but null, use TZ envariable passed in
25057944Seric#  if defined and non-null, use that info
25157944Sericifelse(confTIME_ZONE, `USE_SYSTEM', `#Ot',
25257944Seric	confTIME_ZONE, `USE_TZ', `',
25357944Seric	`CONCAT(Ot, confTIME_ZONE)')
25457944Seric
25557944Seric# default UID
25657944SericCONCAT(Ou, confDEF_USER_ID)
25757944Seric
25851887Seric# list of locations of user database file (null means no lookup)
25958720SericOU`'ifdef(`confUSERDB_SPEC', `confUSERDB_SPEC')
26051222Seric
26158860Seric# fallback MX host
26258860Sericifdef(`confFALLBACK_MX',
26358860Seric	CONCAT(OV, confFALLBACK_MX),
26458860Seric	#OVfall.back.host.net)
26558860Seric
26657944Seric# load average at which we just queue messages
26757944SericCONCAT(Ox, confQUEUE_LA)
26857944Seric
26957944Seric# load average at which we refuse connections
27057944SericCONCAT(OX, confREFUSE_LA)
27157944Seric
27257944Seric# work recipient factor
27357944Sericifdef(`confWORK_RECIPIENT_FACTOR',
27457944Seric	CONCAT(Oy, confWORK_RECIPIENT_FACTOR),
27557944Seric	#Oy30000)
27657944Seric
27757944Seric# deliver each queued job in a separate process?
27857944SericCONCAT(OY, confSEPARATE_PROC)
27957944Seric
28057944Seric# work class factor
28157944Sericifdef(`confWORK_CLASS_FACTOR',
28257944Seric	CONCAT(Oz, confWORK_CLASS_FACTOR),
28357944Seric	#Oz1800)
28457944Seric
28557944Seric# work time factor
28657944Sericifdef(`confWORK_TIME_FACTOR',
28757944Seric	CONCAT(OZ, confWORK_TIME_FACTOR),
28857944Seric	#OZ90000)
28957944Seric
29057944Seric###########################
29157944Seric#   Message precedences   #
29257944Seric###########################
29357944Seric
29457944SericPfirst-class=0
29557944SericPspecial-delivery=100
29658070SericPlist=-30
29757944SericPbulk=-60
29857944SericPjunk=-100
29957944Seric
30057944Seric#####################
30157944Seric#   Trusted users   #
30257944Seric#####################
30357944Seric
30457944SericTroot
30557944SericTdaemon
30657944SericTuucp
30757944Seric
30857944Seric#########################
30957944Seric#   Format of headers   #
31057944Seric#########################
31157944Seric
31258679SericH?P?Return-Path: $g
313*60894SericHReceived: $?sfrom $s $.$?_($_) $.by $j ($v/$Z)$?r with $r$. id $i; $b
31457944SericH?D?Resent-Date: $a
31557944SericH?D?Date: $a
31657944SericH?F?Resent-From: $q
31757944SericH?F?From: $q
31857944SericH?x?Full-Name: $x
31957944SericHSubject:
32057944Seric# HPosted-Date: $a
32157944Seric# H?l?Received-Date: $b
32257944SericH?M?Resent-Message-Id: <$t.$i@$j>
32357944SericH?M?Message-Id: <$t.$i@$j>
32451222Seric#
32551222Seric######################################################################
32651222Seric######################################################################
32751222Seric#####
32851222Seric#####			REWRITING RULES
32951222Seric#####
33051222Seric######################################################################
33151222Seric######################################################################
33251222Seric
33358678Sericundivert(9)dnl
33451222Seric
33551222Seric###########################################
33651222Seric###  Rulset 3 -- Name Canonicalization  ###
33751222Seric###########################################
33851260SericS3
33951222Seric
34058499Seric# handle null input and list syntax (translate to <@> special case)
34158499SericR$@			$@ <@>
34258707SericR$*:;$*			$@ $1 :; <@>
34358174Seric
34451222Seric# basic textual canonicalization -- note RFC733 heuristic here
34557012SericR$*<$*>$*<$*>$*		<$2>$3$4$5			strip multiple <> <>
34658158SericR$*<$*<$+>$*>$*		<$3>$5				2-level <> nesting
34758499SericR$*<>$*			$@ <@>				MAIL FROM:<> case
34851222SericR$*<$+>$*		$2				basic RFC821/822 parsing
34951222Seric
35051222Seric# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
35155416SericR@ $+ , $+		@ $1 : $2			change all "," to ":"
35251222Seric
35351222Seric# localize and dispose of route-based addresses
354*60894SericR@ $+ : $+		$@ $>_SET_96_ < @$1 > : $2		handle <route-addr>
35551222Seric
35651222Seric# find focus for list syntax
357*60894SericR $+ : $* ; @ $+	$@ $>_SET_96_ $1 : $2 ; < @ $3 >	list syntax
35855416SericR $+ : $* ;		$@ $1 : $2;			list syntax
35951222Seric
36051222Seric# find focus for @ syntax addresses
36155416SericR$+ @ $+		$: $1 < @ $2 >			focus on domain
36255416SericR$+ < $+ @ $+ >		$1 $2 < @ $3 >			move gaze right
363*60894SericR$+ < @ $+ >		$@ $>_SET_96_ $1 < @ $2 >		already canonical
36451222Seric
36558288Sericifdef(`_NO_UUCP_', `dnl',
36658288Seric`# convert old-style addresses to a domain-based address
367*60894SericR$- ! $+		$@ $>_SET_96_ $2 < @ $1 .UUCP >	resolve uucp names
368*60894SericR$+ . $- ! $+		$@ $>_SET_96_ $3 < @ $1 . $2 >		domain uucps
369*60894SericR$+ ! $+		$@ $>_SET_96_ $2 < @ $1 .UUCP >	uucp subdomains')
37051222Seric
37151222Seric# if we have % signs, take the rightmost one
37255416SericR$* % $*		$1 @ $2				First make them all @s.
37355416SericR$* @ $* @ $*		$1 % $2 @ $3			Undo all but the last.
374*60894SericR$* @ $*		$@ $>_SET_96_ $1 < @ $2 >		Insert < > and finish
37551222Seric
37651222Seric# else we must be a local name
37751222Seric
37851222Seric
379*60894Seric################################################
380*60894Seric###  Ruleset _SET_96_ -- bottom half of ruleset 3  ###
381*60894Seric################################################
38251222Seric
38357245Seric#  At this point, everything should be in a "local_part<@domain>extra" format.
384*60894SericS`'_SET_96_
38551222Seric
38651222Seric# handle special cases for local names
38760262SericR$* < @ localhost > $*		$: $1 < @ $j . > $2		no domain at all
38860262SericR$* < @ localhost . $m > $*	$: $1 < @ $j . > $2		local domain
38960262Sericifdef(`_NO_UUCP_', `dnl',
39060262Seric`R$* < @ localhost . UUCP > $*	$: $1 < @ $j . > $2		.UUCP domain')
39151889Sericundivert(2)dnl
39251222Seric
39359081Sericifdef(`_NO_UUCP_', `dnl',
39459081Seric`ifdef(`UUCP_RELAY',
39551274Seric`# pass UUCP addresses straight through
39655416SericR$* < @ $+ . UUCP > $*		$@ $1 < @ $2 . UUCP > $3',
39751274Seric`# if really UUCP, handle it immediately
39851322Sericifdef(`_CLASS_U_',
39955416Seric`R$* < @ $=U . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
40051322Sericifdef(`_CLASS_V_',
40155416Seric`R$* < @ $=V . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
40251322Sericifdef(`_CLASS_W_',
40355416Seric`R$* < @ $=W . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
40451322Sericifdef(`_CLASS_X_',
40555416Seric`R$* < @ $=X . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
40651322Sericifdef(`_CLASS_Y_',
40755416Seric`R$* < @ $=Y . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
40851267Seric
40951267Seric# try UUCP traffic as a local address
41055416SericR$* < @ $+ . UUCP > $*		$: $1 < @ $[ $2 $] . UUCP > $3
41151992Sericifdef(`_OLD_SENDMAIL_',
41255416Seric`R$* < @ $+ . $+ . UUCP > $*		$@ $1 < @ $2 . $3 . > $4',
41355416Seric`R$* < @ $+ . . UUCP > $*		$@ $1 < @ $2 . > $3')')
41459081Seric')
41559081Sericifdef(`_NO_CANONIFY_', `dnl',
41659081Seric`# pass to name server to make hostname canonical
41760212SericR$* < @ $* $~P > $*		$: $1 < @ $[ $2 $3 $] > $4
41859081Seric')
41951889Sericundivert(8)dnl
42051889Seric
42151322Seric# if this is the local hostname, make sure we treat is as canonical
42251322SericR$* < @ $j > $*			$: $1 < @ $j . > $2
42351222Seric
42451322Seric
42551222Seric##################################################
42651222Seric###  Ruleset 4 -- Final Output Post-rewriting  ###
42751222Seric##################################################
42851222SericS4
42951222Seric
43058499SericR$*<@>			$@ $1				handle <> and list:;
43151222Seric
43251222Seric# resolve numeric addresses to name if possible
43351322SericR$* < @ [ $+ ] > $*	$: $1 < @ $[ [$2] $] > $3	lookup numeric internet addr
43451222Seric
43551322Seric# strip trailing dot off possibly canonical name
43651322SericR$* < @ $+ . > $*	$1 < @ $2 > $3
43751322Seric
43851222Seric# externalize local domain info
43951322SericR$* < $+ > $*		$1 $2 $3			defocus
44051322SericR@ $+ : @ $+ : $+	@ $1 , @ $2 : $3		<route-addr> canonical
44151997SericR@ $*			$@ @ $1				... and exit
44251222Seric
44358288Sericifdef(`_NO_UUCP_', `dnl',
44458288Seric`# UUCP must always be presented in old form
44558288SericR$+ @ $- . UUCP		$2!$1				u@h.UUCP => h!u')
44651222Seric
44751222Seric# delete duplicate local names
44851322SericR$+ % $=w @ $=w		$1 @ $j				u%host@host => u@host
44951222Seric
45051222Seric
45151222Seric
452*60894Seric##############################################################
453*60894Seric###   Ruleset _SET_97_ -- recanonicalize and call ruleset zero   ###
454*60894Seric###		   (used for recursive calls)		   ###
455*60894Seric##############################################################
45651222Seric
457*60894SericS`'_SET_97_
45851222SericR$*			$: $>3 $1
45951222SericR$*			$@ $>0 $1
46051222Seric
46151222Seric
46251222Seric######################################
46351222Seric###   Ruleset 0 -- Parse Address   ###
46451222Seric######################################
46551222Seric
46651222SericS0
46751222Seric
46858562SericR<@>			$#local $: <>			special case error msgs
46959887SericR$*:;<@>		$#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
47058340Seric
47155416Sericifdef(`_MAILER_smtp_',
47255416Seric`# handle numeric address spec
47351322SericR$* < @ [ $+ ] > $*	$: $1 < @ $[ [$2] $] > $3	numeric internet addr
47455416SericR$* < @ [ $+ ] > $*	$#smtp $@ [$2] $: $1 @ [$2] $3	numeric internet spec',
47556785Seric`dnl')
47651222Seric
47751887Seric# now delete the local info -- note $=O to find characters that cause forwarding
478*60894SericR$* < @ > $*		$@ $>_SET_97_ $1			user@ => user
479*60894SericR< @ $=w . > : $*	$@ $>_SET_97_ $2			@here:... -> ...
480*60894SericR$* $=O $* < @ $=w . >	$@ $>_SET_97_ $1 $2 $3			...@here -> ...
48158781Sericifdef(`MAILER_TABLE',
48258781Seric`
48358781Seric# try mailer table lookup
48460540SericR$* <@ $+ > $*		$: < $2 > $1 < @ $2 > $3	extract host name
48560540SericR<$+ . > $*		$: < $1 > $2			strip trailing dot
48660540SericR<$- . $+ > $*		$: < $(mailertable .$2 $: $) > $3	lookup
48760540SericR<$- : $+ > $*		$# $1 $@ $2 $: $3		check -- resolved?
48860540SericR<$- . $+ > $*		$: $>90 <$2> $3			try domain',
48958781Seric`dnl')
49051222Seric
49151222Seric# short circuit local delivery so forwarded email works
49258516Sericifdef(`_LOCAL_NOT_STICKY_',
493*60894Seric`R$=L < @ $=w . >		$#local $: @ $1			special local names
494*60894SericR$+ < @ $=w . >		$#local $: $1			dispose directly',
495*60894Seric`R$+ < @ $=w . >		$: $1 < @ $2 @ $H >		first try hub
49651992Sericifdef(`_OLD_SENDMAIL_',
49759635Seric`R$+ < $+ @ $-:$+ >	$# $3 $@ $4 $: $1 < $2 >	yep ....
49859635SericR$+ < $+ @ $+ >		$#relay $@ $3 $: $1 < $2 >	yep ....
49957527SericR$+ < $+ @ >		$#local $: $1			nope, local address',
50057527Seric`R$+ < $+ @ $+ >		$#local $: $1			yep ....
50158516SericR$+ < $+ @ >		$#local $: @ $1			nope, local address')')
50251222Sericundivert(3)dnl
50351260Sericundivert(4)dnl
50451260Seric
50555416Seric# resolve remotely connected UUCP links (if any)
50651285Sericifdef(`_CLASS_V_',
50759635Seric`R$* < @ $=V . UUCP > $*		$#smtp $@ $V $: <@ $V> : $1 @ $2.UUCP $3',
50852044Seric	`dnl')
50951285Sericifdef(`_CLASS_W_',
51059635Seric`R$* < @ $=W . UUCP > $*		$#smtp $@ $W $: <@ $W> : $1 @ $2.UUCP $3',
51152044Seric	`dnl')
51251285Sericifdef(`_CLASS_X_',
51359635Seric`R$* < @ $=X . UUCP > $*		$#smtp $@ $X $: <@ $X> : $1 @ $2.UUCP $3',
51452044Seric	`dnl')
51551260Seric
51651222Seric# resolve fake top level domains by forwarding to other hosts
51751222Sericifdef(`BITNET_RELAY',
51860212Seric`R$*<@$+.BITNET>$*	$#smtp $@ $B. $: $1 <@$2.BITNET> $3	user@host.BITNET',
51951222Seric	`dnl')
52051222Sericifdef(`CSNET_RELAY',
52160212Seric`R$*<@$+.CSNET>$*	$#smtp $@ $C. $: $1 <@$2.CSNET> $3	user@host.CSNET',
52251222Seric	`dnl')
52358364Sericifdef(`_MAILER_fax_',
52458364Seric`R$+ < @ $+ .FAX >	$#fax $@ $2 $: $1			user@host.FAX',
52558364Seric`ifdef(`FAX_RELAY',
52660212Seric`R$*<@$+.FAX>$*		$#smtp $@ $F. $: $1 <@$2.FAX> $3	user@host.FAX',
52758364Seric	`dnl')')
52851222Seric
52951260Sericifdef(`UUCP_RELAY',
53051260Seric`# forward non-local UUCP traffic to our UUCP relay
53160212SericR$*<@$*.UUCP>$*		$#smtp $@ $Y. $: <@ $Y> : $1 @ $2.UUCP $3	uucp mail',
53255416Seric`ifdef(`_MAILER_uucp_',
53351260Seric`# forward other UUCP traffic straight to UUCP
53459604SericR< @ $+ .UUCP > : $+	$#uucp $@ $1 $: $2			@host.UUCP:...
53551322SericR$+ < @ $+ .UUCP >	$#uucp $@ $2 $: $1			user@host.UUCP',
53651260Seric	`dnl')')
53751222Seric
53858070Sericifdef(`_LOCAL_RULES_',
53958070Seric`# figure out what should stay in our local mail system
54058070Sericundivert(1)',
54158070Seric`ifdef(`_MAILER_smtp_',
54255416Seric`# deal with other remote names
54359635SericR$* < @ $* > $*		$#smtp $@ $2 $: $1 < @ $2 > $3		user@host.domain')')
54458070Sericifdef(`SMART_HOST', `
54558070Seric# pass names that still have a host to a smarthost
54658070SericR$* < @ $* > $*		$: < $S > $1 < @ $2 > $3	glue on smarthost name
54759635SericR<$-:$+> $* < @$* > $*	$# $1 $@ $2 $: $3 < @ $4 > $5	if non-null, use it
54859635SericR<$+> $* < @$* > $*	$#suucp $@ $1 $: $2 < @ $3 > $4	if non-null, use it
54958070SericR<> $* < @ $* > $*	$1 < @ $2 > $3			else strip off gunk',
55058070Seric`ifdef(`_LOCAL_RULES_', `
55158070Seric# reject messages that have host names we do not understand
55258070SericR$* < @ $* > $*		$#error $@ NOHOST $: Unrecognized host name $2',
55358070Seric`dnl')')
55458084Sericifdef(`_MAILER_USENET_', `
55558084Seric# addresses sent to net.group.USENET will get forwarded to a newsgroup
55658096SericR$+ . USENET		$# usenet $: $1')
55751222Seric
55851992Sericifdef(`_OLD_SENDMAIL_',
55951887Seric`# forward remaining names to local relay, if any
56052041SericR$=L			$#local $: $1			special local names
56152041SericR$+			$: $1 < @ $R >			append relay
56257527SericR$+ < @ >		$: $1 < @ $H >			no relay, try hub
56357527SericR$+ < @ >		$#local $: $1			no relay or hub: local
564*60894SericR$+ < @ $=w  >		$#local $: $1			we are relay/hub: local
56558070SericR$+ < @ $-:$+ >		$# $2 $@ $3 $: $1		deliver to relay/hub
56658771SericR$+ < @ $+ >		$#relay $@ $2 $: $1		deliver to relay/hub',
56758811Seric
56858811Seric`# if this is quoted, strip the quotes and try again
56958811SericR$+			$: $(dequote $1 $)		strip quotes
570*60894SericR$* $=O $*		$@ $>_SET_97_ $1 $2 $3			try again
57158811Seric
57258811Seric# handle locally delivered names
57352041SericR$=L			$#local $: @ $1			special local names
57452041SericR$+			$#local $: $1			regular local names
57551222Seric
57655416Seric###########################################################################
57755416Seric###   Ruleset 5 -- special rewriting after aliases have been expanded   ###
57855416Seric###		   (new sendmail only)					###
57955416Seric###########################################################################
58051222Seric
58151322SericS5
58251322Seric
58358808Seric# see if we have a relay or a hub
58458808SericR$+			$: $1 < @ $R >
58557527SericR$+ < @ >		$: $1 < @ $H >			no relay, try hub
586*60894SericR$+ < @ $=w >		$@ $1				we are relay/hub: local
58758070SericR$+ < @ $-:$+ >		$# $2 $@ $3 $: $1		send to relay or hub
58858808Sericifdef(`_MAILER_smtp_',
58958808Seric`R$+ < @ $+ >		$#relay $@ $2 $: $1		send to relay or hub')')
59060540Sericifdef(`MAILER_TABLE',
59160540Seric`
59260540Seric
59360540Seric###########################################################################
59460540Seric###  Ruleset 90 -- try domain part of mailertable entry 		###
59560540Seric###		   (new sendmail only)					###
59660540Seric###########################################################################
59760540Seric
59860540SericS90
59960540SericR<$- . $+ > $*		$: < $(mailertable .$2 $: $) > $3	lookup
60060540SericR<$- : $+ > $*		$# $1 $@ $2 $: $3		check -- resolved?
601*60894SericR<$- . $+ > $*		$@ $>90 <$2> $3			no -- strip & try again
60260540SericR<$*> $*		$@ $2				no match',
60360540Seric`dnl')
60451222Seric#
60551222Seric######################################################################
60651222Seric######################################################################
60751222Seric#####
60856790Seric`#####			MAILER DEFINITIONS'
60951222Seric#####
61051222Seric######################################################################
61151222Seric######################################################################
61251222Sericundivert(7)dnl
613