xref: /csrg-svn/usr.sbin/sendmail/cf/m4/proto.m4 (revision 58364)
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*58364SericVERSIONID(`@(#)proto.m4	6.15 (Berkeley) 03/02/93')
1251222Seric
1351322SericMAILER(local)dnl
1451222Seric
1552646Sericifdef(`_OLD_SENDMAIL_', `dnl',
1658119Seric`# level 4 config file format
1758119SericV4')
1852646Seric
1951222Seric##################
2051222Seric#   local info   #
2151222Seric##################
2251222Seric
2351889SericCwlocalhost
2451887Sericifdef(`USE_CW_FILE',
2551889Seric`# file containing names of hosts for which we receive email
2651222SericFw/etc/sendmail.cw', `dnl')
2751222Seric
2851222Sericifdef(`UUCP_RELAY',
2951222Seric`# UUCP relay host
3051281SericCONCAT(DY, UUCP_RELAY)
3157944Seric
3251222Seric')dnl
3351222Sericifdef(`BITNET_RELAY',
3451222Seric`#  BITNET relay host
3551222SericCONCAT(DB, BITNET_RELAY)
3657944Seric
3751222Seric')dnl
3851222Sericifdef(`CSNET_RELAY',
3951222Seric`# CSNET relay host
4051222SericCONCAT(DC, CSNET_RELAY)
4157944Seric
4251222Seric')dnl
43*58364Sericifdef(`FAX_RELAY',
44*58364Seric`# FAX relay host
45*58364SericCONCAT(DF, FAX_RELAY)
46*58364Seric
47*58364Seric')dnl
4858070Sericifdef(`SMART_HOST',
4958070Seric`# "Smart" UUCP relay host
5058070SericCONCAT(DS, SMART_HOST)
5151222Seric
5258070Seric')dnl
5351222Seric# who I send unqualified names to (null means deliver locally)
5451222SericCONCAT(DR, ifdef(`LOCAL_RELAY', LOCAL_RELAY))
5551222Seric
5657527Seric# who gets all local email traffic ($R has precedence for unqualified names)
5757527SericCONCAT(DH, ifdef(`MAIL_HUB', MAIL_HUB))
5857527Seric
5958070Seric# my official hostname ($w or $w.$D)
6058070SericCONCAT(Dj$w, ifdef(`NEED_DOMAIN', .$D))
6158070Seric
6258070Seric# who I masquerade as (can be $j)
6358070SericCONCAT(DM, ifdef(`MASQUERADE_NAME', MASQUERADE_NAME, $j))
6458070Seric
6557245Seric# class L: names that should be delivered locally, even if we have a relay
6657245Seric# class E: names that should be exposed as from this host, even if we masquerade
6751279SericCLroot
6857245SericCEroot
6951279Sericundivert(5)dnl
7051279Seric
7151222Seric# operators that cannot be in local usernames (i.e., network indicators)
7258288SericCO @ % ifdef(`_NO_UUCP_', `', `!')
7351222Seric
7451322Seric# a class with just dot (for identifying canonical names)
7551322SericC..
7651322Seric
7757944Seric
7857944Seric######################
7957944Seric#   Special macros   #
8057944Seric######################
8157944Seric
8257944Seric# SMTP initial login message
8357944SericCONCAT(De, confSMTP_LOGIN_MSG)
8457944Seric
8557944Seric# UNIX initial From header format
8657944SericCONCAT(Dl, confFROM_LINE)
8757944Seric
8857944Seric# my name for error messages
8957944SericCONCAT(Dn, confMAILER_NAME)
9057944Seric
9157944Seric# delimiter (operator) characters
9257944SericCONCAT(Do, confOPERATORS)
9357944Seric
9457944Seric# format of a total name
9557944SericCONCAT(Dq, ifdef(`confFROM_HEADER', confFROM_HEADER,
9657944Seric	ifdef(`_OLD_SENDMAIL_', `$g$?x ($x)$.', `$?x$x <$g>$|$g$.')))
9757944Sericinclude(`../m4/version.m4')
9857944Seric
9957944Seric###############
10057944Seric#   Options   #
10157944Seric###############
10257944Seric
10357944Seric# preserve 8 bits on message body on input?
10457944SericCONCAT(O8, confEIGHT_BIT_INPUT)
10557944Seric
10657944Seric# wait (in minutes) for alias file rebuild
10757944SericCONCAT(Oa, confALIAS_WAIT)
10857944Seric
10957944Seric# location of alias file
11057944SericCONCAT(OA, ifdef(`ALIAS_FILE', ALIAS_FILE, /etc/aliases))
11157944Seric
11258084Seric# minimum number of free blocks on filesystem
11358084SericCONCAT(Ob, confMIN_FREE_BLOCKS)
11458084Seric
11557944Seric# substitution for space (blank) characters
11657944SericCONCAT(OB, confBLANK_SUB)
11757944Seric
11857944Seric# connect to "expensive" mailers on initial submission?
11957944SericCONCAT(Oc, confCON_EXPENSIVE)
12057944Seric
12157944Seric# checkpoint queue runs after every N successful deliveries
12257944SericCONCAT(OC, confCHECKPOINT_INTERVAL)
12357944Seric
12457944Seric# default delivery mode
12557944SericCONCAT(Od, confDELIVERY_MODE)
12657944Seric
12757944Seric# automatically rebuild the alias database?
12857944SericCONCAT(OD, confAUTO_REBUILD)
12957944Seric
13057944Seric# error message header/file */
13157944Sericifdef(`confERROR_MESSAGE',
13257944Seric	concat(OE, confERROR_MESSAGE),
13357944Seric	#OE/etc/sendmail.oE)
13457944Seric
13557944Seric# error mode
13657944Sericifdef(`confERROR_MODE',
13757944Seric	concat(Oe, confERROR_MODE),
13857944Seric	#Oep)
13957944Seric
14057944Seric# save Unix-style "From_" lines at top of header?
14157944SericCONCAT(Of, confSAVE_FROM_LINES)
14257944Seric
14357944Seric# temporary file mode
14457944SericCONCAT(OF, confTEMP_FILE_MODE)
14557944Seric
14657944Seric# match recipients against GECOS field?
14757944SericCONCAT(OG, confMATCH_GECOS)
14857944Seric
14957944Seric# default GID
15057944SericCONCAT(Og, confDEF_GROUP_ID)
15157944Seric
15257944Seric# maximum hop count
15357944SericCONCAT(Oh, confMAX_HOP)
15457944Seric
15557944Seric# location of help file
15657944SericCONCAT(OH, ifdef(`HELP_FILE', HELP_FILE, /usr/lib/sendmail.hf))
15757944Seric
15857944Seric# ignore dots as terminators in incoming messages?
15957944SericCONCAT(Oi, confIGNORE_DOTS)
16057944Seric
16157944Seric# Insist that the BIND name server be running to resolve names
16257944Sericifdef(`confBIND_OPTS',
16357944Seric	CONCAT(OI, confBIND_OPTS),
16457944Seric	#OI)
16557944Seric
16657944Seric# Forward file search path
16757944Sericifdef(`confFORWARD_PATH',
16857944Seric	CONCAT(OJ, confFORWARD_PATH),
16957944Seric	#OJ/var/forward/$u:$z/.forward.$w:$z/.forward)
17057944Seric
17157944Seric# open connection cache size
17257944SericCONCAT(Ok, confMCI_CACHE_SIZE)
17357944Seric
17457944Seric# open connection cache timeout
17557944SericCONCAT(OK, confMCI_CACHE_TIMEOUT)
17657944Seric
17757944Seric# log level
17857944SericCONCAT(OL, confLOG_LEVEL)
17957944Seric
18057944Seric# send to me too, even in an alias expansion?
18157944SericCONCAT(Om, confME_TOO)
18257944Seric
18357944Seric# verify RHS in newaliases?
18457944SericCONCAT(On, confCHECK_ALIASES)
18557944Seric
18657944Seric# default messages to old style headers if no special punctuation?
18757944SericCONCAT(Oo, confOLD_STYLE_HEADERS)
18857944Seric
18958084Seric# privacy flags
19058084SericCONCAT(Op, confPRIVACY_FLAGS)
19158084Seric
19257944Seric# who (if anyone) should get extra copies of error messages
19357944Sericifdef(`confCOPY_ERRORS_TO',
19457944Seric	CONCAT(OP, confCOPY_ERRORS_TO),
19557944Seric	#OPPostmaster)
19657944Seric
19757944Seric# slope of queue-only function
19857944Sericifdef(`confQUEUE_FACTOR',
19957944Seric	CONCAT(Oq, confQUEUE_FACTOR),
20057944Seric	#Oq600000)
20157944Seric
20257944Seric# queue directory
20357944SericCONCAT(OQ, ifdef(`QUEUE_DIR', QUEUE_DIR, /var/spool/mqueue))
20457944Seric
20557944Seric# read timeout -- now OK per RFC 1123 section 5.3.2
20658119Sericifdef(`confREAD_TIMEOUT',
20758119Seric	CONCAT(Or, confREAD_TIMEOUT),
20858119Seric	#Ordatablock=10m)
20957944Seric
21057944Seric# queue up everything before forking?
21157944SericCONCAT(Os, confSAFE_QUEUE)
21257944Seric
21357944Seric# status file
21457944SericCONCAT(OS, ifdef(`STATUS_FILE', STATUS_FILE, /etc/sendmail.st))
21557944Seric
21657944Seric# default message timeout interval
21757944SericCONCAT(OT, confMESSAGE_TIMEOUT)
21857944Seric
21957944Seric# time zone handling:
22057944Seric#  if undefined, use system default
22157944Seric#  if defined but null, use TZ envariable passed in
22257944Seric#  if defined and non-null, use that info
22357944Sericifelse(confTIME_ZONE, `USE_SYSTEM', `#Ot',
22457944Seric	confTIME_ZONE, `USE_TZ', `',
22557944Seric	`CONCAT(Ot, confTIME_ZONE)')
22657944Seric
22757944Seric# default UID
22857944SericCONCAT(Ou, confDEF_USER_ID)
22957944Seric
23051887Seric# list of locations of user database file (null means no lookup)
23157944SericCONCAT(OU, ifdef(`USERDB_SPEC', `USERDB_SPEC'))
23251222Seric
23357944Seric# load average at which we just queue messages
23457944SericCONCAT(Ox, confQUEUE_LA)
23557944Seric
23657944Seric# load average at which we refuse connections
23757944SericCONCAT(OX, confREFUSE_LA)
23857944Seric
23957944Seric# work recipient factor
24057944Sericifdef(`confWORK_RECIPIENT_FACTOR',
24157944Seric	CONCAT(Oy, confWORK_RECIPIENT_FACTOR),
24257944Seric	#Oy30000)
24357944Seric
24457944Seric# deliver each queued job in a separate process?
24557944SericCONCAT(OY, confSEPARATE_PROC)
24657944Seric
24757944Seric# work class factor
24857944Sericifdef(`confWORK_CLASS_FACTOR',
24957944Seric	CONCAT(Oz, confWORK_CLASS_FACTOR),
25057944Seric	#Oz1800)
25157944Seric
25257944Seric# work time factor
25357944Sericifdef(`confWORK_TIME_FACTOR',
25457944Seric	CONCAT(OZ, confWORK_TIME_FACTOR),
25557944Seric	#OZ90000)
25657944Seric
25757944Seric###########################
25857944Seric#   Message precedences   #
25957944Seric###########################
26057944Seric
26157944SericPfirst-class=0
26257944SericPspecial-delivery=100
26358070SericPlist=-30
26457944SericPbulk=-60
26557944SericPjunk=-100
26657944Seric
26757944Seric#####################
26857944Seric#   Trusted users   #
26957944Seric#####################
27057944Seric
27157944SericTroot
27257944SericTdaemon
27357944SericTuucp
27457944Seric
27557944Seric#########################
27657944Seric#   Format of headers   #
27757944Seric#########################
27857944Seric
27957944SericH?P?Return-Path: <$?<$<$|$g$.>
28057944SericHReceived: $?sfrom $s $.by $j ($v/$Z) id $i; $b
28157944SericH?D?Resent-Date: $a
28257944SericH?D?Date: $a
28357944SericH?F?Resent-From: $q
28457944SericH?F?From: $q
28557944SericH?x?Full-Name: $x
28657944SericHSubject:
28757944Seric# HPosted-Date: $a
28857944Seric# H?l?Received-Date: $b
28957944SericH?M?Resent-Message-Id: <$t.$i@$j>
29057944SericH?M?Message-Id: <$t.$i@$j>
29156786Sericundivert(6)dnl
29251222Seric#
29351222Seric######################################################################
29451222Seric######################################################################
29551222Seric#####
29651222Seric#####			REWRITING RULES
29751222Seric#####
29851222Seric######################################################################
29951222Seric######################################################################
30051222Seric
30151222Seric
30251222Seric###########################################
30351222Seric###  Rulset 3 -- Name Canonicalization  ###
30451222Seric###########################################
30551260SericS3
30651222Seric
30758174Seric# handle null input (translate to <> special case)
30858340SericR$@			$@ <>
30958174Seric
31051222Seric# basic textual canonicalization -- note RFC733 heuristic here
31157012SericR$*<$*>$*<$*>$*		<$2>$3$4$5			strip multiple <> <>
31258158SericR$*<$*<$+>$*>$*		<$3>$5				2-level <> nesting
31358340SericR$*<>$*			$@ <>				MAIL FROM:<> case
31451222SericR$*<$+>$*		$2				basic RFC821/822 parsing
31551222Seric
31651222Seric# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
31755416SericR@ $+ , $+		@ $1 : $2			change all "," to ":"
31851222Seric
31951222Seric# localize and dispose of route-based addresses
32055416SericR@ $+ : $+		$@ $>6 < @$1 > : $2		handle <route-addr>
32151222Seric
32251222Seric# find focus for list syntax
32355416SericR $+ : $* ; @ $+	$@ $>6 $1 : $2 ; < @ $3 >	list syntax
32455416SericR $+ : $* ;		$@ $1 : $2;			list syntax
32551222Seric
32651222Seric# find focus for @ syntax addresses
32755416SericR$+ @ $+		$: $1 < @ $2 >			focus on domain
32855416SericR$+ < $+ @ $+ >		$1 $2 < @ $3 >			move gaze right
32955416SericR$+ < @ $+ >		$@ $>6 $1 < @ $2 >		already canonical
33051222Seric
33158288Sericifdef(`_NO_UUCP_', `dnl',
33258288Seric`# convert old-style addresses to a domain-based address
33355416SericR$- ! $+		$@ $>6 $2 < @ $1 .UUCP >	resolve uucp names
33455416SericR$+ . $- ! $+		$@ $>6 $3 < @ $1 . $2 >		domain uucps
33558288SericR$+ ! $+		$@ $>6 $2 < @ $1 .UUCP >	uucp subdomains')
33651222Seric
33751222Seric# if we have % signs, take the rightmost one
33855416SericR$* % $*		$1 @ $2				First make them all @s.
33955416SericR$* @ $* @ $*		$1 % $2 @ $3			Undo all but the last.
34055416SericR$* @ $*		$@ $>6 $1 < @ $2 >		Insert < > and finish
34151222Seric
34251222Seric# else we must be a local name
34351222Seric
34451222Seric
34551222Seric###############################################
34651222Seric###  Ruleset 6 -- bottom half of ruleset 3  ###
34751222Seric###############################################
34851222Seric
34957245Seric#  At this point, everything should be in a "local_part<@domain>extra" format.
35051222SericS6
35151222Seric
35251222Seric# handle special cases for local names
35351322SericR$* < @ $=w > $*		$: $1 < @ $j . > $3		no domain at all
35455416SericR$* < @ $=w . UUCP > $*		$: $1 < @ $j . > $3		.UUCP domain
35551889Sericundivert(2)dnl
35651222Seric
35751274Sericifdef(`UUCP_RELAY',
35851274Seric`# pass UUCP addresses straight through
35955416SericR$* < @ $+ . UUCP > $*		$@ $1 < @ $2 . UUCP > $3',
36051274Seric`# if really UUCP, handle it immediately
36151322Sericifdef(`_CLASS_U_',
36255416Seric`R$* < @ $=U . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
36351322Sericifdef(`_CLASS_V_',
36455416Seric`R$* < @ $=V . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
36551322Sericifdef(`_CLASS_W_',
36655416Seric`R$* < @ $=W . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
36751322Sericifdef(`_CLASS_X_',
36855416Seric`R$* < @ $=X . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
36951322Sericifdef(`_CLASS_Y_',
37055416Seric`R$* < @ $=Y . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
37151267Seric
37251267Seric# try UUCP traffic as a local address
37355416SericR$* < @ $+ . UUCP > $*		$: $1 < @ $[ $2 $] . UUCP > $3
37451992Sericifdef(`_OLD_SENDMAIL_',
37555416Seric`R$* < @ $+ . $+ . UUCP > $*		$@ $1 < @ $2 . $3 . > $4',
37655416Seric`R$* < @ $+ . . UUCP > $*		$@ $1 < @ $2 . > $3')')
37751267Seric
37851222Seric# pass to name server to make hostname canonical
37951322SericR$* < @ $* $~. > $*		$: $1 < @ $[ $2 $3 $] > $4
38051222Seric
38151889Seric# handle possible alternate names
38251889SericR$* < @ $=w . $m . > $*		$: $1 < @ $j . > $3
38351889SericR$* < @ $=w . $m > $*		$: $1 < @ $j . > $3
38451889Sericundivert(8)dnl
38551889Seric
38651322Seric# if this is the local hostname, make sure we treat is as canonical
38751322SericR$* < @ $j > $*			$: $1 < @ $j . > $2
38851222Seric
38951322Seric
39051222Seric##################################################
39151222Seric###  Ruleset 4 -- Final Output Post-rewriting  ###
39251222Seric##################################################
39351222SericS4
39451222Seric
39558340SericR<>			$@				handle <> error addr
39651222Seric
39751222Seric# resolve numeric addresses to name if possible
39851322SericR$* < @ [ $+ ] > $*	$: $1 < @ $[ [$2] $] > $3	lookup numeric internet addr
39951222Seric
40051322Seric# strip trailing dot off possibly canonical name
40151322SericR$* < @ $+ . > $*	$1 < @ $2 > $3
40251322Seric
40351222Seric# externalize local domain info
40451322SericR$* < $+ > $*		$1 $2 $3			defocus
40551322SericR@ $+ : @ $+ : $+	@ $1 , @ $2 : $3		<route-addr> canonical
40651997SericR@ $*			$@ @ $1				... and exit
40751222Seric
40858288Sericifdef(`_NO_UUCP_', `dnl',
40958288Seric`# UUCP must always be presented in old form
41058288SericR$+ @ $- . UUCP		$2!$1				u@h.UUCP => h!u')
41151222Seric
41251222Seric# delete duplicate local names
41351322SericR$+ % $=w @ $=w		$1 @ $j				u%host@host => u@host
41451222Seric
41551222Seric
41651222Seric
41751222Seric#############################################################
41851222Seric###   Ruleset 7 -- recanonicalize and call ruleset zero   ###
41951222Seric###		   (used for recursive calls)		  ###
42051222Seric#############################################################
42151222Seric
42251222SericS7
42351222SericR$*			$: $>3 $1
42451222SericR$*			$@ $>0 $1
42551222Seric
42651222Seric
42751222Seric######################################
42851222Seric###   Ruleset 0 -- Parse Address   ###
42951222Seric######################################
43051222Seric
43151222SericS0
43251222Seric
43358340SericR<>			$#local $: <>			special case error msgs
43458340Seric
43555416Sericifdef(`_MAILER_smtp_',
43655416Seric`# handle numeric address spec
43751322SericR$* < @ [ $+ ] > $*	$: $1 < @ $[ [$2] $] > $3	numeric internet addr
43855416SericR$* < @ [ $+ ] > $*	$#smtp $@ [$2] $: $1 @ [$2] $3	numeric internet spec',
43956785Seric`dnl')
44051222Seric
44151887Seric# now delete the local info -- note $=O to find characters that cause forwarding
44251322SericR< @ $j . > : $*	$@ $>7 $1			@here:... -> ...
44351322SericR$* $=O $* < @ $j . >	$@ $>7 $1 $2 $3			...@here -> ...
44451222Seric
44551222Seric# short circuit local delivery so forwarded email works
44657527SericR$+ < @ $j . >		$: $1 < @ $j @ $H >		first try hub
44751992Sericifdef(`_OLD_SENDMAIL_',
44858070Seric`R$+ < $+ @ $-:$+ >	$# $3 $@ $4 $: $1 < $2 >	yep ....
44958070SericR$+ < $+ @ $+ >		$#smtp $@ $3 $: $1 < $2 >	yep ....
45057527SericR$+ < $+ @ >		$#local $: $1			nope, local address',
45157527Seric`R$+ < $+ @ $+ >		$#local $: $1			yep ....
45257527SericR$+ < $+ @ >		$#local $: @ $1			nope, local address')
45351222Sericundivert(3)dnl
45451260Sericundivert(4)dnl
45551260Seric
45655416Seric# resolve remotely connected UUCP links (if any)
45751285Sericifdef(`_CLASS_V_',
45852044Seric`R$* < @ $=V . UUCP > $*		$#smtp $@ $V $: <@ $V> : $1 @ $2.UUCP $3',
45952044Seric	`dnl')
46051285Sericifdef(`_CLASS_W_',
46152044Seric`R$* < @ $=W . UUCP > $*		$#smtp $@ $W $: <@ $W> : $1 @ $2.UUCP $3',
46252044Seric	`dnl')
46351285Sericifdef(`_CLASS_X_',
46452044Seric`R$* < @ $=X . UUCP > $*		$#smtp $@ $X $: <@ $X> : $1 @ $2.UUCP $3',
46552044Seric	`dnl')
46651260Seric
46751222Seric# resolve fake top level domains by forwarding to other hosts
46851222Sericifdef(`BITNET_RELAY',
46952044Seric`R$*<@$+.BITNET>$*	$#smtp $@ $B $: $1 <@$2.BITNET> $3	user@host.BITNET',
47051222Seric	`dnl')
47151222Sericifdef(`CSNET_RELAY',
47252044Seric`R$*<@$+.CSNET>$*	$#smtp $@ $C $: $1 <@$2.CSNET> $3	user@host.CSNET',
47351222Seric	`dnl')
474*58364Sericifdef(`_MAILER_fax_',
475*58364Seric`R$+ < @ $+ .FAX >	$#fax $@ $2 $: $1			user@host.FAX',
476*58364Seric`ifdef(`FAX_RELAY',
477*58364Seric`R$*<@$+.FAX>$*		$#smtp $@ $F $: $1 <@$2.FAX> $3		user@host.FAX',
478*58364Seric	`dnl')')
47951222Seric
48051260Sericifdef(`UUCP_RELAY',
48151260Seric`# forward non-local UUCP traffic to our UUCP relay
48252044SericR$*<@$*.UUCP>$*		$#smtp $@ $Y $: <@ $Y> : $1 @ $2.UUCP $3	uucp mail',
48355416Seric`ifdef(`_MAILER_uucp_',
48451260Seric`# forward other UUCP traffic straight to UUCP
48551260SericR< @ $+ .UUCP > : $+	$#uucp $@ $1 $: $1:$2			@host.UUCP:...
48651322SericR$+ < @ $+ .UUCP >	$#uucp $@ $2 $: $1			user@host.UUCP',
48751260Seric	`dnl')')
48851222Seric
48958070Sericifdef(`_LOCAL_RULES_',
49058070Seric`# figure out what should stay in our local mail system
49158070Sericundivert(1)',
49258070Seric`ifdef(`_MAILER_smtp_',
49355416Seric`# deal with other remote names
49458070SericR$* < @ $* > $*		$#smtp $@ $2 $: $1 < @ $2 > $3		user@host.domain')')
49558070Sericifdef(`SMART_HOST', `
49658070Seric# pass names that still have a host to a smarthost
49758070SericR$* < @ $* > $*		$: < $S > $1 < @ $2 > $3	glue on smarthost name
49858070SericR<$-:$+> $* < @$* > $*	$# $1 $@ $2 $: $3 < @ $4 > $5	if non-null, use it
49958070SericR<$+> $* < @$* > $*	$#suucp $@ $1 $: $2 < @ $3 > $4	if non-null, use it
50058070SericR<> $* < @ $* > $*	$1 < @ $2 > $3			else strip off gunk',
50158070Seric`ifdef(`_LOCAL_RULES_', `
50258070Seric# reject messages that have host names we do not understand
50358070SericR$* < @ $* > $*		$#error $@ NOHOST $: Unrecognized host name $2',
50458070Seric`dnl')')
50558084Sericifdef(`_MAILER_USENET_', `
50658084Seric# addresses sent to net.group.USENET will get forwarded to a newsgroup
50758096SericR$+ . USENET		$# usenet $: $1')
50851222Seric
50951992Sericifdef(`_OLD_SENDMAIL_',
51051887Seric`# forward remaining names to local relay, if any
51152041SericR$=L			$#local $: $1			special local names
51252041SericR$+			$: $1 < @ $R >			append relay
51357527SericR$+ < @ >		$: $1 < @ $H >			no relay, try hub
51457527SericR$+ < @ >		$#local $: $1			no relay or hub: local
51557527SericR$+ < @ $j  >		$#local $: $1			we are relay/hub: local
51658070SericR$+ < @ $-:$+ >		$# $2 $@ $3 $: $1		deliver to relay/hub
51757527SericR$+ < @ $+ >		$#smtp $@ $2 $: $1		deliver to relay/hub',
51851992Seric`# handle locally delivered names
51952041SericR$=L			$#local $: @ $1			special local names
52052041SericR$+			$#local $: $1			regular local names
52151222Seric
52255416Seric###########################################################################
52355416Seric###   Ruleset 5 -- special rewriting after aliases have been expanded   ###
52455416Seric###		   (new sendmail only)					###
52555416Seric###########################################################################
52651222Seric
52751322SericS5
52851322Seric
52955416Sericifdef(`_MAILER_smtp_',
53055416Seric`R$+			$: $1 < @ $R >
53157527SericR$+ < @ >		$: $1 < @ $H >			no relay, try hub
53257527SericR$+ < @ $j >		$@ $1				we are relay/hub: local
53358070SericR$+ < @ $-:$+ >		$# $2 $@ $3 $: $1		send to relay or hub
53457527SericR$+ < @ $+ >		$#smtp $@ $2 $: $1		send to relay or hub')')
53551222Seric#
53651222Seric######################################################################
53751222Seric######################################################################
53851222Seric#####
53956790Seric`#####			MAILER DEFINITIONS'
54051222Seric#####
54151222Seric######################################################################
54251222Seric######################################################################
54351222Sericundivert(7)dnl
544