xref: /csrg-svn/usr.sbin/sendmail/cf/m4/proto.m4 (revision 58860)
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*58860SericVERSIONID(`@(#)proto.m4	6.30 (Berkeley) 03/29/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
2658406SericCONCAT(`Fw', confCW_FILE)', `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
4358364Sericifdef(`FAX_RELAY',
4458364Seric`# FAX relay host
4558364SericCONCAT(DF, FAX_RELAY)
4658364Seric
4758364Seric')dnl
4858070Sericifdef(`SMART_HOST',
4958070Seric`# "Smart" UUCP relay host
5058070SericCONCAT(DS, SMART_HOST)
5151222Seric
5258070Seric')dnl
5358781Sericifdef(`MAILER_TABLE',
5458781Seric`# Mailer table (overriding domains)
5558781SericKmailertable MAILER_TABLE
5658781Seric
5758781Seric')dnl
5851222Seric# who I send unqualified names to (null means deliver locally)
5951222SericCONCAT(DR, ifdef(`LOCAL_RELAY', LOCAL_RELAY))
6051222Seric
6157527Seric# who gets all local email traffic ($R has precedence for unqualified names)
6257527SericCONCAT(DH, ifdef(`MAIL_HUB', MAIL_HUB))
6357527Seric
6458070Seric# my official hostname ($w or $w.$D)
6558070SericCONCAT(Dj$w, ifdef(`NEED_DOMAIN', .$D))
6658070Seric
6758070Seric# who I masquerade as (can be $j)
6858070SericCONCAT(DM, ifdef(`MASQUERADE_NAME', MASQUERADE_NAME, $j))
6958070Seric
7057245Seric# class L: names that should be delivered locally, even if we have a relay
7157245Seric# class E: names that should be exposed as from this host, even if we masquerade
7251279SericCLroot
7357245SericCEroot
7451279Sericundivert(5)dnl
7551279Seric
7651222Seric# operators that cannot be in local usernames (i.e., network indicators)
7758288SericCO @ % ifdef(`_NO_UUCP_', `', `!')
7851222Seric
7951322Seric# a class with just dot (for identifying canonical names)
8051322SericC..
8151322Seric
8258808Sericifdef(`_OLD_SENDMAIL_', `dnl',
8358808Seric`# dequoting map
8458808SericKdequote dequote')
8557944Seric
8657944Seric######################
8757944Seric#   Special macros   #
8857944Seric######################
8957944Seric
9057944Seric# SMTP initial login message
9157944SericCONCAT(De, confSMTP_LOGIN_MSG)
9257944Seric
9357944Seric# UNIX initial From header format
9457944SericCONCAT(Dl, confFROM_LINE)
9557944Seric
9657944Seric# my name for error messages
9757944SericCONCAT(Dn, confMAILER_NAME)
9857944Seric
9957944Seric# delimiter (operator) characters
10057944SericCONCAT(Do, confOPERATORS)
10157944Seric
10257944Seric# format of a total name
10357944SericCONCAT(Dq, ifdef(`confFROM_HEADER', confFROM_HEADER,
10457944Seric	ifdef(`_OLD_SENDMAIL_', `$g$?x ($x)$.', `$?x$x <$g>$|$g$.')))
10557944Sericinclude(`../m4/version.m4')
10657944Seric
10757944Seric###############
10857944Seric#   Options   #
10957944Seric###############
11057944Seric
11157944Seric# preserve 8 bits on message body on input?
11257944SericCONCAT(O8, confEIGHT_BIT_INPUT)
11357944Seric
11457944Seric# wait (in minutes) for alias file rebuild
11557944SericCONCAT(Oa, confALIAS_WAIT)
11657944Seric
11757944Seric# location of alias file
11857944SericCONCAT(OA, ifdef(`ALIAS_FILE', ALIAS_FILE, /etc/aliases))
11957944Seric
12058084Seric# minimum number of free blocks on filesystem
12158084SericCONCAT(Ob, confMIN_FREE_BLOCKS)
12258084Seric
12357944Seric# substitution for space (blank) characters
12457944SericCONCAT(OB, confBLANK_SUB)
12557944Seric
12657944Seric# connect to "expensive" mailers on initial submission?
12757944SericCONCAT(Oc, confCON_EXPENSIVE)
12857944Seric
12957944Seric# checkpoint queue runs after every N successful deliveries
13057944SericCONCAT(OC, confCHECKPOINT_INTERVAL)
13157944Seric
13257944Seric# default delivery mode
13357944SericCONCAT(Od, confDELIVERY_MODE)
13457944Seric
13557944Seric# automatically rebuild the alias database?
13657944SericCONCAT(OD, confAUTO_REBUILD)
13757944Seric
13857944Seric# error message header/file */
13957944Sericifdef(`confERROR_MESSAGE',
14057944Seric	concat(OE, confERROR_MESSAGE),
14157944Seric	#OE/etc/sendmail.oE)
14257944Seric
14357944Seric# error mode
14457944Sericifdef(`confERROR_MODE',
14557944Seric	concat(Oe, confERROR_MODE),
14657944Seric	#Oep)
14757944Seric
14857944Seric# save Unix-style "From_" lines at top of header?
14957944SericCONCAT(Of, confSAVE_FROM_LINES)
15057944Seric
15157944Seric# temporary file mode
15257944SericCONCAT(OF, confTEMP_FILE_MODE)
15357944Seric
15457944Seric# match recipients against GECOS field?
15557944SericCONCAT(OG, confMATCH_GECOS)
15657944Seric
15757944Seric# default GID
15857944SericCONCAT(Og, confDEF_GROUP_ID)
15957944Seric
16057944Seric# maximum hop count
16157944SericCONCAT(Oh, confMAX_HOP)
16257944Seric
16357944Seric# location of help file
16457944SericCONCAT(OH, ifdef(`HELP_FILE', HELP_FILE, /usr/lib/sendmail.hf))
16557944Seric
16657944Seric# ignore dots as terminators in incoming messages?
16757944SericCONCAT(Oi, confIGNORE_DOTS)
16857944Seric
16957944Seric# Insist that the BIND name server be running to resolve names
17057944Sericifdef(`confBIND_OPTS',
17157944Seric	CONCAT(OI, confBIND_OPTS),
17257944Seric	#OI)
17357944Seric
17457944Seric# Forward file search path
17557944Sericifdef(`confFORWARD_PATH',
17657944Seric	CONCAT(OJ, confFORWARD_PATH),
17757944Seric	#OJ/var/forward/$u:$z/.forward.$w:$z/.forward)
17857944Seric
17957944Seric# open connection cache size
18057944SericCONCAT(Ok, confMCI_CACHE_SIZE)
18157944Seric
18257944Seric# open connection cache timeout
18357944SericCONCAT(OK, confMCI_CACHE_TIMEOUT)
18457944Seric
18557944Seric# log level
18657944SericCONCAT(OL, confLOG_LEVEL)
18757944Seric
18857944Seric# send to me too, even in an alias expansion?
18957944SericCONCAT(Om, confME_TOO)
19057944Seric
19157944Seric# verify RHS in newaliases?
19257944SericCONCAT(On, confCHECK_ALIASES)
19357944Seric
19457944Seric# default messages to old style headers if no special punctuation?
19557944SericCONCAT(Oo, confOLD_STYLE_HEADERS)
19657944Seric
197*58860Seric# SMTP daemon options
198*58860Sericifdef(`confDAEMON_OPTIONS',
199*58860Seric	CONCAT(OO, confDAEMON_OPTIONS),
200*58860Seric	#OOPort=esmtp)
201*58860Seric
20258084Seric# privacy flags
20358084SericCONCAT(Op, confPRIVACY_FLAGS)
20458084Seric
20557944Seric# who (if anyone) should get extra copies of error messages
20657944Sericifdef(`confCOPY_ERRORS_TO',
20757944Seric	CONCAT(OP, confCOPY_ERRORS_TO),
20857944Seric	#OPPostmaster)
20957944Seric
21057944Seric# slope of queue-only function
21157944Sericifdef(`confQUEUE_FACTOR',
21257944Seric	CONCAT(Oq, confQUEUE_FACTOR),
21357944Seric	#Oq600000)
21457944Seric
21557944Seric# queue directory
21657944SericCONCAT(OQ, ifdef(`QUEUE_DIR', QUEUE_DIR, /var/spool/mqueue))
21757944Seric
21857944Seric# read timeout -- now OK per RFC 1123 section 5.3.2
21958119Sericifdef(`confREAD_TIMEOUT',
22058119Seric	CONCAT(Or, confREAD_TIMEOUT),
22158119Seric	#Ordatablock=10m)
22257944Seric
22357944Seric# queue up everything before forking?
22457944SericCONCAT(Os, confSAFE_QUEUE)
22557944Seric
22657944Seric# status file
22757944SericCONCAT(OS, ifdef(`STATUS_FILE', STATUS_FILE, /etc/sendmail.st))
22857944Seric
22957944Seric# default message timeout interval
23057944SericCONCAT(OT, confMESSAGE_TIMEOUT)
23157944Seric
23257944Seric# time zone handling:
23357944Seric#  if undefined, use system default
23457944Seric#  if defined but null, use TZ envariable passed in
23557944Seric#  if defined and non-null, use that info
23657944Sericifelse(confTIME_ZONE, `USE_SYSTEM', `#Ot',
23757944Seric	confTIME_ZONE, `USE_TZ', `',
23857944Seric	`CONCAT(Ot, confTIME_ZONE)')
23957944Seric
24057944Seric# default UID
24157944SericCONCAT(Ou, confDEF_USER_ID)
24257944Seric
24351887Seric# list of locations of user database file (null means no lookup)
24458720SericOU`'ifdef(`confUSERDB_SPEC', `confUSERDB_SPEC')
24551222Seric
246*58860Seric# fallback MX host
247*58860Sericifdef(`confFALLBACK_MX',
248*58860Seric	CONCAT(OV, confFALLBACK_MX),
249*58860Seric	#OVfall.back.host.net)
250*58860Seric
25157944Seric# load average at which we just queue messages
25257944SericCONCAT(Ox, confQUEUE_LA)
25357944Seric
25457944Seric# load average at which we refuse connections
25557944SericCONCAT(OX, confREFUSE_LA)
25657944Seric
25757944Seric# work recipient factor
25857944Sericifdef(`confWORK_RECIPIENT_FACTOR',
25957944Seric	CONCAT(Oy, confWORK_RECIPIENT_FACTOR),
26057944Seric	#Oy30000)
26157944Seric
26257944Seric# deliver each queued job in a separate process?
26357944SericCONCAT(OY, confSEPARATE_PROC)
26457944Seric
26557944Seric# work class factor
26657944Sericifdef(`confWORK_CLASS_FACTOR',
26757944Seric	CONCAT(Oz, confWORK_CLASS_FACTOR),
26857944Seric	#Oz1800)
26957944Seric
27057944Seric# work time factor
27157944Sericifdef(`confWORK_TIME_FACTOR',
27257944Seric	CONCAT(OZ, confWORK_TIME_FACTOR),
27357944Seric	#OZ90000)
27457944Seric
27557944Seric###########################
27657944Seric#   Message precedences   #
27757944Seric###########################
27857944Seric
27957944SericPfirst-class=0
28057944SericPspecial-delivery=100
28158070SericPlist=-30
28257944SericPbulk=-60
28357944SericPjunk=-100
28457944Seric
28557944Seric#####################
28657944Seric#   Trusted users   #
28757944Seric#####################
28857944Seric
28957944SericTroot
29057944SericTdaemon
29157944SericTuucp
29257944Seric
29357944Seric#########################
29457944Seric#   Format of headers   #
29557944Seric#########################
29657944Seric
29758679SericH?P?Return-Path: $g
29857944SericHReceived: $?sfrom $s $.by $j ($v/$Z) id $i; $b
29957944SericH?D?Resent-Date: $a
30057944SericH?D?Date: $a
30157944SericH?F?Resent-From: $q
30257944SericH?F?From: $q
30357944SericH?x?Full-Name: $x
30457944SericHSubject:
30557944Seric# HPosted-Date: $a
30657944Seric# H?l?Received-Date: $b
30757944SericH?M?Resent-Message-Id: <$t.$i@$j>
30857944SericH?M?Message-Id: <$t.$i@$j>
30956786Sericundivert(6)dnl
31051222Seric#
31151222Seric######################################################################
31251222Seric######################################################################
31351222Seric#####
31451222Seric#####			REWRITING RULES
31551222Seric#####
31651222Seric######################################################################
31751222Seric######################################################################
31851222Seric
31958678Sericundivert(9)dnl
32051222Seric
32151222Seric###########################################
32251222Seric###  Rulset 3 -- Name Canonicalization  ###
32351222Seric###########################################
32451260SericS3
32551222Seric
32658499Seric# handle null input and list syntax (translate to <@> special case)
32758499SericR$@			$@ <@>
32858707SericR$*:;$*			$@ $1 :; <@>
32958174Seric
33051222Seric# basic textual canonicalization -- note RFC733 heuristic here
33157012SericR$*<$*>$*<$*>$*		<$2>$3$4$5			strip multiple <> <>
33258158SericR$*<$*<$+>$*>$*		<$3>$5				2-level <> nesting
33358499SericR$*<>$*			$@ <@>				MAIL FROM:<> case
33451222SericR$*<$+>$*		$2				basic RFC821/822 parsing
33551222Seric
33651222Seric# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
33755416SericR@ $+ , $+		@ $1 : $2			change all "," to ":"
33851222Seric
33951222Seric# localize and dispose of route-based addresses
34055416SericR@ $+ : $+		$@ $>6 < @$1 > : $2		handle <route-addr>
34151222Seric
34251222Seric# find focus for list syntax
34355416SericR $+ : $* ; @ $+	$@ $>6 $1 : $2 ; < @ $3 >	list syntax
34455416SericR $+ : $* ;		$@ $1 : $2;			list syntax
34551222Seric
34651222Seric# find focus for @ syntax addresses
34755416SericR$+ @ $+		$: $1 < @ $2 >			focus on domain
34855416SericR$+ < $+ @ $+ >		$1 $2 < @ $3 >			move gaze right
34955416SericR$+ < @ $+ >		$@ $>6 $1 < @ $2 >		already canonical
35051222Seric
35158288Sericifdef(`_NO_UUCP_', `dnl',
35258288Seric`# convert old-style addresses to a domain-based address
35355416SericR$- ! $+		$@ $>6 $2 < @ $1 .UUCP >	resolve uucp names
35455416SericR$+ . $- ! $+		$@ $>6 $3 < @ $1 . $2 >		domain uucps
35558288SericR$+ ! $+		$@ $>6 $2 < @ $1 .UUCP >	uucp subdomains')
35651222Seric
35751222Seric# if we have % signs, take the rightmost one
35855416SericR$* % $*		$1 @ $2				First make them all @s.
35955416SericR$* @ $* @ $*		$1 % $2 @ $3			Undo all but the last.
36055416SericR$* @ $*		$@ $>6 $1 < @ $2 >		Insert < > and finish
36151222Seric
36251222Seric# else we must be a local name
36351222Seric
36451222Seric
36551222Seric###############################################
36651222Seric###  Ruleset 6 -- bottom half of ruleset 3  ###
36751222Seric###############################################
36851222Seric
36957245Seric#  At this point, everything should be in a "local_part<@domain>extra" format.
37051222SericS6
37151222Seric
37251222Seric# handle special cases for local names
37351322SericR$* < @ $=w > $*		$: $1 < @ $j . > $3		no domain at all
37455416SericR$* < @ $=w . UUCP > $*		$: $1 < @ $j . > $3		.UUCP domain
37551889Sericundivert(2)dnl
37651222Seric
37751274Sericifdef(`UUCP_RELAY',
37851274Seric`# pass UUCP addresses straight through
37955416SericR$* < @ $+ . UUCP > $*		$@ $1 < @ $2 . UUCP > $3',
38051274Seric`# if really UUCP, handle it immediately
38151322Sericifdef(`_CLASS_U_',
38255416Seric`R$* < @ $=U . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
38351322Sericifdef(`_CLASS_V_',
38455416Seric`R$* < @ $=V . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
38551322Sericifdef(`_CLASS_W_',
38655416Seric`R$* < @ $=W . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
38751322Sericifdef(`_CLASS_X_',
38855416Seric`R$* < @ $=X . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
38951322Sericifdef(`_CLASS_Y_',
39055416Seric`R$* < @ $=Y . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
39151267Seric
39251267Seric# try UUCP traffic as a local address
39355416SericR$* < @ $+ . UUCP > $*		$: $1 < @ $[ $2 $] . UUCP > $3
39451992Sericifdef(`_OLD_SENDMAIL_',
39555416Seric`R$* < @ $+ . $+ . UUCP > $*		$@ $1 < @ $2 . $3 . > $4',
39655416Seric`R$* < @ $+ . . UUCP > $*		$@ $1 < @ $2 . > $3')')
39751267Seric
39851222Seric# pass to name server to make hostname canonical
39951322SericR$* < @ $* $~. > $*		$: $1 < @ $[ $2 $3 $] > $4
40051222Seric
40151889Seric# handle possible alternate names
40251889SericR$* < @ $=w . $m . > $*		$: $1 < @ $j . > $3
40351889SericR$* < @ $=w . $m > $*		$: $1 < @ $j . > $3
40451889Sericundivert(8)dnl
40551889Seric
40651322Seric# if this is the local hostname, make sure we treat is as canonical
40751322SericR$* < @ $j > $*			$: $1 < @ $j . > $2
40851222Seric
40951322Seric
41051222Seric##################################################
41151222Seric###  Ruleset 4 -- Final Output Post-rewriting  ###
41251222Seric##################################################
41351222SericS4
41451222Seric
41558499SericR$*<@>			$@ $1				handle <> and list:;
41651222Seric
41751222Seric# resolve numeric addresses to name if possible
41851322SericR$* < @ [ $+ ] > $*	$: $1 < @ $[ [$2] $] > $3	lookup numeric internet addr
41951222Seric
42051322Seric# strip trailing dot off possibly canonical name
42151322SericR$* < @ $+ . > $*	$1 < @ $2 > $3
42251322Seric
42351222Seric# externalize local domain info
42451322SericR$* < $+ > $*		$1 $2 $3			defocus
42551322SericR@ $+ : @ $+ : $+	@ $1 , @ $2 : $3		<route-addr> canonical
42651997SericR@ $*			$@ @ $1				... and exit
42751222Seric
42858288Sericifdef(`_NO_UUCP_', `dnl',
42958288Seric`# UUCP must always be presented in old form
43058288SericR$+ @ $- . UUCP		$2!$1				u@h.UUCP => h!u')
43151222Seric
43251222Seric# delete duplicate local names
43351322SericR$+ % $=w @ $=w		$1 @ $j				u%host@host => u@host
43451222Seric
43551222Seric
43651222Seric
43751222Seric#############################################################
43851222Seric###   Ruleset 7 -- recanonicalize and call ruleset zero   ###
43951222Seric###		   (used for recursive calls)		  ###
44051222Seric#############################################################
44151222Seric
44251222SericS7
44351222SericR$*			$: $>3 $1
44451222SericR$*			$@ $>0 $1
44551222Seric
44651222Seric
44751222Seric######################################
44851222Seric###   Ruleset 0 -- Parse Address   ###
44951222Seric######################################
45051222Seric
45151222SericS0
45251222Seric
45358562SericR<@>			$#local $: <>			special case error msgs
45458340Seric
45555416Sericifdef(`_MAILER_smtp_',
45655416Seric`# handle numeric address spec
45751322SericR$* < @ [ $+ ] > $*	$: $1 < @ $[ [$2] $] > $3	numeric internet addr
45855416SericR$* < @ [ $+ ] > $*	$#smtp $@ [$2] $: $1 @ [$2] $3	numeric internet spec',
45956785Seric`dnl')
46051222Seric
46151887Seric# now delete the local info -- note $=O to find characters that cause forwarding
46258482SericR$* < @ > $*		$@ $>7 $1			user@ => user
46351322SericR< @ $j . > : $*	$@ $>7 $1			@here:... -> ...
46451322SericR$* $=O $* < @ $j . >	$@ $>7 $1 $2 $3			...@here -> ...
46558781Sericifdef(`MAILER_TABLE',
46658781Seric`
46758781Seric# try mailer table lookup
46858854SericR$* < @ $+ > $*		$: $1 < @ $(mailertable $2 $) > $3
46958781SericR$* < @ $-:$+ > $*	$# $2 $@ $3 $: $1 < @ $3 > $4	found a match',
47058781Seric`dnl')
47151222Seric
47251222Seric# short circuit local delivery so forwarded email works
47358516Sericifdef(`_LOCAL_NOT_STICKY_',
47458516Seric`R$=L < @ $j . >		$#local $: @ $1			special local names
47558516SericR$+ < @ $j . >		$#local $: $1			dispose directly',
47658516Seric`R$+ < @ $j . >		$: $1 < @ $j @ $H >		first try hub
47751992Sericifdef(`_OLD_SENDMAIL_',
47858070Seric`R$+ < $+ @ $-:$+ >	$# $3 $@ $4 $: $1 < $2 >	yep ....
47958771SericR$+ < $+ @ $+ >		$#relay $@ $3 $: $1 < $2 >	yep ....
48057527SericR$+ < $+ @ >		$#local $: $1			nope, local address',
48157527Seric`R$+ < $+ @ $+ >		$#local $: $1			yep ....
48258516SericR$+ < $+ @ >		$#local $: @ $1			nope, local address')')
48351222Sericundivert(3)dnl
48451260Sericundivert(4)dnl
48551260Seric
48655416Seric# resolve remotely connected UUCP links (if any)
48751285Sericifdef(`_CLASS_V_',
48852044Seric`R$* < @ $=V . UUCP > $*		$#smtp $@ $V $: <@ $V> : $1 @ $2.UUCP $3',
48952044Seric	`dnl')
49051285Sericifdef(`_CLASS_W_',
49152044Seric`R$* < @ $=W . UUCP > $*		$#smtp $@ $W $: <@ $W> : $1 @ $2.UUCP $3',
49252044Seric	`dnl')
49351285Sericifdef(`_CLASS_X_',
49452044Seric`R$* < @ $=X . UUCP > $*		$#smtp $@ $X $: <@ $X> : $1 @ $2.UUCP $3',
49552044Seric	`dnl')
49651260Seric
49751222Seric# resolve fake top level domains by forwarding to other hosts
49851222Sericifdef(`BITNET_RELAY',
49952044Seric`R$*<@$+.BITNET>$*	$#smtp $@ $B $: $1 <@$2.BITNET> $3	user@host.BITNET',
50051222Seric	`dnl')
50151222Sericifdef(`CSNET_RELAY',
50252044Seric`R$*<@$+.CSNET>$*	$#smtp $@ $C $: $1 <@$2.CSNET> $3	user@host.CSNET',
50351222Seric	`dnl')
50458364Sericifdef(`_MAILER_fax_',
50558364Seric`R$+ < @ $+ .FAX >	$#fax $@ $2 $: $1			user@host.FAX',
50658364Seric`ifdef(`FAX_RELAY',
50758364Seric`R$*<@$+.FAX>$*		$#smtp $@ $F $: $1 <@$2.FAX> $3		user@host.FAX',
50858364Seric	`dnl')')
50951222Seric
51051260Sericifdef(`UUCP_RELAY',
51151260Seric`# forward non-local UUCP traffic to our UUCP relay
51252044SericR$*<@$*.UUCP>$*		$#smtp $@ $Y $: <@ $Y> : $1 @ $2.UUCP $3	uucp mail',
51355416Seric`ifdef(`_MAILER_uucp_',
51451260Seric`# forward other UUCP traffic straight to UUCP
51551260SericR< @ $+ .UUCP > : $+	$#uucp $@ $1 $: $1:$2			@host.UUCP:...
51651322SericR$+ < @ $+ .UUCP >	$#uucp $@ $2 $: $1			user@host.UUCP',
51751260Seric	`dnl')')
51851222Seric
51958070Sericifdef(`_LOCAL_RULES_',
52058070Seric`# figure out what should stay in our local mail system
52158070Sericundivert(1)',
52258070Seric`ifdef(`_MAILER_smtp_',
52355416Seric`# deal with other remote names
52458070SericR$* < @ $* > $*		$#smtp $@ $2 $: $1 < @ $2 > $3		user@host.domain')')
52558070Sericifdef(`SMART_HOST', `
52658070Seric# pass names that still have a host to a smarthost
52758070SericR$* < @ $* > $*		$: < $S > $1 < @ $2 > $3	glue on smarthost name
52858070SericR<$-:$+> $* < @$* > $*	$# $1 $@ $2 $: $3 < @ $4 > $5	if non-null, use it
52958070SericR<$+> $* < @$* > $*	$#suucp $@ $1 $: $2 < @ $3 > $4	if non-null, use it
53058070SericR<> $* < @ $* > $*	$1 < @ $2 > $3			else strip off gunk',
53158070Seric`ifdef(`_LOCAL_RULES_', `
53258070Seric# reject messages that have host names we do not understand
53358070SericR$* < @ $* > $*		$#error $@ NOHOST $: Unrecognized host name $2',
53458070Seric`dnl')')
53558084Sericifdef(`_MAILER_USENET_', `
53658084Seric# addresses sent to net.group.USENET will get forwarded to a newsgroup
53758096SericR$+ . USENET		$# usenet $: $1')
53851222Seric
53951992Sericifdef(`_OLD_SENDMAIL_',
54051887Seric`# forward remaining names to local relay, if any
54152041SericR$=L			$#local $: $1			special local names
54252041SericR$+			$: $1 < @ $R >			append relay
54357527SericR$+ < @ >		$: $1 < @ $H >			no relay, try hub
54457527SericR$+ < @ >		$#local $: $1			no relay or hub: local
54557527SericR$+ < @ $j  >		$#local $: $1			we are relay/hub: local
54658070SericR$+ < @ $-:$+ >		$# $2 $@ $3 $: $1		deliver to relay/hub
54758771SericR$+ < @ $+ >		$#relay $@ $2 $: $1		deliver to relay/hub',
54858811Seric
54958811Seric`# if this is quoted, strip the quotes and try again
55058811SericR$+			$: $(dequote $1 $)		strip quotes
55158811SericR$* $=O $*		$@ $>7 $1 $2 $3			try again
55258811Seric
55358811Seric# handle locally delivered names
55452041SericR$=L			$#local $: @ $1			special local names
55552041SericR$+			$#local $: $1			regular local names
55651222Seric
55755416Seric###########################################################################
55855416Seric###   Ruleset 5 -- special rewriting after aliases have been expanded   ###
55955416Seric###		   (new sendmail only)					###
56055416Seric###########################################################################
56151222Seric
56251322SericS5
56351322Seric
56458808Seric# see if we have a relay or a hub
56558808SericR$+			$: $1 < @ $R >
56657527SericR$+ < @ >		$: $1 < @ $H >			no relay, try hub
56757527SericR$+ < @ $j >		$@ $1				we are relay/hub: local
56858070SericR$+ < @ $-:$+ >		$# $2 $@ $3 $: $1		send to relay or hub
56958808Sericifdef(`_MAILER_smtp_',
57058808Seric`R$+ < @ $+ >		$#relay $@ $2 $: $1		send to relay or hub')')
57151222Seric#
57251222Seric######################################################################
57351222Seric######################################################################
57451222Seric#####
57556790Seric`#####			MAILER DEFINITIONS'
57651222Seric#####
57751222Seric######################################################################
57851222Seric######################################################################
57951222Sericundivert(7)dnl
580