xref: /csrg-svn/usr.sbin/sendmail/cf/m4/proto.m4 (revision 59033)
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*59033SericVERSIONID(`@(#)proto.m4	6.33 (Berkeley) 04/10/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
86*59033Sericundivert(6)dnl
87*59033Seric
8857944Seric######################
8957944Seric#   Special macros   #
9057944Seric######################
9157944Seric
9257944Seric# SMTP initial login message
9357944SericCONCAT(De, confSMTP_LOGIN_MSG)
9457944Seric
9557944Seric# UNIX initial From header format
9657944SericCONCAT(Dl, confFROM_LINE)
9757944Seric
9857944Seric# my name for error messages
9957944SericCONCAT(Dn, confMAILER_NAME)
10057944Seric
10157944Seric# delimiter (operator) characters
10257944SericCONCAT(Do, confOPERATORS)
10357944Seric
10457944Seric# format of a total name
10557944SericCONCAT(Dq, ifdef(`confFROM_HEADER', confFROM_HEADER,
10657944Seric	ifdef(`_OLD_SENDMAIL_', `$g$?x ($x)$.', `$?x$x <$g>$|$g$.')))
10757944Sericinclude(`../m4/version.m4')
10857944Seric
10957944Seric###############
11057944Seric#   Options   #
11157944Seric###############
11257944Seric
11357944Seric# preserve 8 bits on message body on input?
11457944SericCONCAT(O8, confEIGHT_BIT_INPUT)
11557944Seric
11657944Seric# wait (in minutes) for alias file rebuild
11757944SericCONCAT(Oa, confALIAS_WAIT)
11857944Seric
11957944Seric# location of alias file
12057944SericCONCAT(OA, ifdef(`ALIAS_FILE', ALIAS_FILE, /etc/aliases))
12157944Seric
12258084Seric# minimum number of free blocks on filesystem
12358084SericCONCAT(Ob, confMIN_FREE_BLOCKS)
12458084Seric
12557944Seric# substitution for space (blank) characters
12657944SericCONCAT(OB, confBLANK_SUB)
12757944Seric
12857944Seric# connect to "expensive" mailers on initial submission?
12957944SericCONCAT(Oc, confCON_EXPENSIVE)
13057944Seric
13157944Seric# checkpoint queue runs after every N successful deliveries
13257944SericCONCAT(OC, confCHECKPOINT_INTERVAL)
13357944Seric
13457944Seric# default delivery mode
13557944SericCONCAT(Od, confDELIVERY_MODE)
13657944Seric
13757944Seric# automatically rebuild the alias database?
13857944SericCONCAT(OD, confAUTO_REBUILD)
13957944Seric
14057944Seric# error message header/file */
14157944Sericifdef(`confERROR_MESSAGE',
14257944Seric	concat(OE, confERROR_MESSAGE),
14357944Seric	#OE/etc/sendmail.oE)
14457944Seric
14557944Seric# error mode
14657944Sericifdef(`confERROR_MODE',
14757944Seric	concat(Oe, confERROR_MODE),
14857944Seric	#Oep)
14957944Seric
15057944Seric# save Unix-style "From_" lines at top of header?
15157944SericCONCAT(Of, confSAVE_FROM_LINES)
15257944Seric
15357944Seric# temporary file mode
15457944SericCONCAT(OF, confTEMP_FILE_MODE)
15557944Seric
15657944Seric# match recipients against GECOS field?
15757944SericCONCAT(OG, confMATCH_GECOS)
15857944Seric
15957944Seric# default GID
16057944SericCONCAT(Og, confDEF_GROUP_ID)
16157944Seric
16257944Seric# maximum hop count
16357944SericCONCAT(Oh, confMAX_HOP)
16457944Seric
16557944Seric# location of help file
16657944SericCONCAT(OH, ifdef(`HELP_FILE', HELP_FILE, /usr/lib/sendmail.hf))
16757944Seric
16857944Seric# ignore dots as terminators in incoming messages?
16957944SericCONCAT(Oi, confIGNORE_DOTS)
17057944Seric
17157944Seric# Insist that the BIND name server be running to resolve names
17257944Sericifdef(`confBIND_OPTS',
17357944Seric	CONCAT(OI, confBIND_OPTS),
17457944Seric	#OI)
17557944Seric
17657944Seric# Forward file search path
17757944Sericifdef(`confFORWARD_PATH',
17857944Seric	CONCAT(OJ, confFORWARD_PATH),
17957944Seric	#OJ/var/forward/$u:$z/.forward.$w:$z/.forward)
18057944Seric
18157944Seric# open connection cache size
18257944SericCONCAT(Ok, confMCI_CACHE_SIZE)
18357944Seric
18457944Seric# open connection cache timeout
18557944SericCONCAT(OK, confMCI_CACHE_TIMEOUT)
18657944Seric
18757944Seric# log level
18857944SericCONCAT(OL, confLOG_LEVEL)
18957944Seric
19057944Seric# send to me too, even in an alias expansion?
19157944SericCONCAT(Om, confME_TOO)
19257944Seric
19357944Seric# verify RHS in newaliases?
19457944SericCONCAT(On, confCHECK_ALIASES)
19557944Seric
19657944Seric# default messages to old style headers if no special punctuation?
19757944SericCONCAT(Oo, confOLD_STYLE_HEADERS)
19857944Seric
19958860Seric# SMTP daemon options
20058860Sericifdef(`confDAEMON_OPTIONS',
20158860Seric	CONCAT(OO, confDAEMON_OPTIONS),
20258860Seric	#OOPort=esmtp)
20358860Seric
20458084Seric# privacy flags
20558084SericCONCAT(Op, confPRIVACY_FLAGS)
20658084Seric
20757944Seric# who (if anyone) should get extra copies of error messages
20857944Sericifdef(`confCOPY_ERRORS_TO',
20957944Seric	CONCAT(OP, confCOPY_ERRORS_TO),
21057944Seric	#OPPostmaster)
21157944Seric
21257944Seric# slope of queue-only function
21357944Sericifdef(`confQUEUE_FACTOR',
21457944Seric	CONCAT(Oq, confQUEUE_FACTOR),
21557944Seric	#Oq600000)
21657944Seric
21757944Seric# queue directory
21857944SericCONCAT(OQ, ifdef(`QUEUE_DIR', QUEUE_DIR, /var/spool/mqueue))
21957944Seric
22057944Seric# read timeout -- now OK per RFC 1123 section 5.3.2
22158119Sericifdef(`confREAD_TIMEOUT',
22258119Seric	CONCAT(Or, confREAD_TIMEOUT),
22358119Seric	#Ordatablock=10m)
22457944Seric
22557944Seric# queue up everything before forking?
22657944SericCONCAT(Os, confSAFE_QUEUE)
22757944Seric
22857944Seric# status file
22957944SericCONCAT(OS, ifdef(`STATUS_FILE', STATUS_FILE, /etc/sendmail.st))
23057944Seric
23157944Seric# default message timeout interval
23257944SericCONCAT(OT, confMESSAGE_TIMEOUT)
23357944Seric
23457944Seric# time zone handling:
23557944Seric#  if undefined, use system default
23657944Seric#  if defined but null, use TZ envariable passed in
23757944Seric#  if defined and non-null, use that info
23857944Sericifelse(confTIME_ZONE, `USE_SYSTEM', `#Ot',
23957944Seric	confTIME_ZONE, `USE_TZ', `',
24057944Seric	`CONCAT(Ot, confTIME_ZONE)')
24157944Seric
24257944Seric# default UID
24357944SericCONCAT(Ou, confDEF_USER_ID)
24457944Seric
24551887Seric# list of locations of user database file (null means no lookup)
24658720SericOU`'ifdef(`confUSERDB_SPEC', `confUSERDB_SPEC')
24751222Seric
24858860Seric# fallback MX host
24958860Sericifdef(`confFALLBACK_MX',
25058860Seric	CONCAT(OV, confFALLBACK_MX),
25158860Seric	#OVfall.back.host.net)
25258860Seric
25357944Seric# load average at which we just queue messages
25457944SericCONCAT(Ox, confQUEUE_LA)
25557944Seric
25657944Seric# load average at which we refuse connections
25757944SericCONCAT(OX, confREFUSE_LA)
25857944Seric
25957944Seric# work recipient factor
26057944Sericifdef(`confWORK_RECIPIENT_FACTOR',
26157944Seric	CONCAT(Oy, confWORK_RECIPIENT_FACTOR),
26257944Seric	#Oy30000)
26357944Seric
26457944Seric# deliver each queued job in a separate process?
26557944SericCONCAT(OY, confSEPARATE_PROC)
26657944Seric
26757944Seric# work class factor
26857944Sericifdef(`confWORK_CLASS_FACTOR',
26957944Seric	CONCAT(Oz, confWORK_CLASS_FACTOR),
27057944Seric	#Oz1800)
27157944Seric
27257944Seric# work time factor
27357944Sericifdef(`confWORK_TIME_FACTOR',
27457944Seric	CONCAT(OZ, confWORK_TIME_FACTOR),
27557944Seric	#OZ90000)
27657944Seric
27757944Seric###########################
27857944Seric#   Message precedences   #
27957944Seric###########################
28057944Seric
28157944SericPfirst-class=0
28257944SericPspecial-delivery=100
28358070SericPlist=-30
28457944SericPbulk=-60
28557944SericPjunk=-100
28657944Seric
28757944Seric#####################
28857944Seric#   Trusted users   #
28957944Seric#####################
29057944Seric
29157944SericTroot
29257944SericTdaemon
29357944SericTuucp
29457944Seric
29557944Seric#########################
29657944Seric#   Format of headers   #
29757944Seric#########################
29857944Seric
29958679SericH?P?Return-Path: $g
30058959SericHReceived: $?sfrom $s $.$?_($_) $.by $j ($v/$Z) id $i; $b
30157944SericH?D?Resent-Date: $a
30257944SericH?D?Date: $a
30357944SericH?F?Resent-From: $q
30457944SericH?F?From: $q
30557944SericH?x?Full-Name: $x
30657944SericHSubject:
30757944Seric# HPosted-Date: $a
30857944Seric# H?l?Received-Date: $b
30957944SericH?M?Resent-Message-Id: <$t.$i@$j>
31057944SericH?M?Message-Id: <$t.$i@$j>
31151222Seric#
31251222Seric######################################################################
31351222Seric######################################################################
31451222Seric#####
31551222Seric#####			REWRITING RULES
31651222Seric#####
31751222Seric######################################################################
31851222Seric######################################################################
31951222Seric
32058678Sericundivert(9)dnl
32151222Seric
32251222Seric###########################################
32351222Seric###  Rulset 3 -- Name Canonicalization  ###
32451222Seric###########################################
32551260SericS3
32651222Seric
32758499Seric# handle null input and list syntax (translate to <@> special case)
32858499SericR$@			$@ <@>
32958707SericR$*:;$*			$@ $1 :; <@>
33058174Seric
33151222Seric# basic textual canonicalization -- note RFC733 heuristic here
33257012SericR$*<$*>$*<$*>$*		<$2>$3$4$5			strip multiple <> <>
33358158SericR$*<$*<$+>$*>$*		<$3>$5				2-level <> nesting
33458499SericR$*<>$*			$@ <@>				MAIL FROM:<> case
33551222SericR$*<$+>$*		$2				basic RFC821/822 parsing
33651222Seric
33751222Seric# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
33855416SericR@ $+ , $+		@ $1 : $2			change all "," to ":"
33951222Seric
34051222Seric# localize and dispose of route-based addresses
34155416SericR@ $+ : $+		$@ $>6 < @$1 > : $2		handle <route-addr>
34251222Seric
34351222Seric# find focus for list syntax
34455416SericR $+ : $* ; @ $+	$@ $>6 $1 : $2 ; < @ $3 >	list syntax
34555416SericR $+ : $* ;		$@ $1 : $2;			list syntax
34651222Seric
34751222Seric# find focus for @ syntax addresses
34855416SericR$+ @ $+		$: $1 < @ $2 >			focus on domain
34955416SericR$+ < $+ @ $+ >		$1 $2 < @ $3 >			move gaze right
35055416SericR$+ < @ $+ >		$@ $>6 $1 < @ $2 >		already canonical
35151222Seric
35258288Sericifdef(`_NO_UUCP_', `dnl',
35358288Seric`# convert old-style addresses to a domain-based address
35455416SericR$- ! $+		$@ $>6 $2 < @ $1 .UUCP >	resolve uucp names
35555416SericR$+ . $- ! $+		$@ $>6 $3 < @ $1 . $2 >		domain uucps
35658288SericR$+ ! $+		$@ $>6 $2 < @ $1 .UUCP >	uucp subdomains')
35751222Seric
35851222Seric# if we have % signs, take the rightmost one
35955416SericR$* % $*		$1 @ $2				First make them all @s.
36055416SericR$* @ $* @ $*		$1 % $2 @ $3			Undo all but the last.
36155416SericR$* @ $*		$@ $>6 $1 < @ $2 >		Insert < > and finish
36251222Seric
36351222Seric# else we must be a local name
36451222Seric
36551222Seric
36651222Seric###############################################
36751222Seric###  Ruleset 6 -- bottom half of ruleset 3  ###
36851222Seric###############################################
36951222Seric
37057245Seric#  At this point, everything should be in a "local_part<@domain>extra" format.
37151222SericS6
37251222Seric
37351222Seric# handle special cases for local names
37451322SericR$* < @ $=w > $*		$: $1 < @ $j . > $3		no domain at all
37555416SericR$* < @ $=w . UUCP > $*		$: $1 < @ $j . > $3		.UUCP domain
37651889Sericundivert(2)dnl
37751222Seric
37859030Seric# hide non-local unqualified addresses behind sending domain
37959030SericR$* < @ $&s > $*		$: $1 < @ $&s @ > $2		avoid loops
38059030SericR$* < @ $- > $*			$: $1 < @ $2 @ $&r > $3		append protocol
38159030SericR$* < @ $+ @ > $*		$: $1 < @ $2 > $3		local mail
38259030SericR< @ $- @ $+ > $*		$@ $>6 < @ $&s > : @ $1 $3	route-addr
38359030SericR$* < @ $- @ $+ >		$@ $>6 $1 % $2 < @ $&s >	non-route-addr
38459030Seric
38551274Sericifdef(`UUCP_RELAY',
38651274Seric`# pass UUCP addresses straight through
38755416SericR$* < @ $+ . UUCP > $*		$@ $1 < @ $2 . UUCP > $3',
38851274Seric`# if really UUCP, handle it immediately
38951322Sericifdef(`_CLASS_U_',
39055416Seric`R$* < @ $=U . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
39151322Sericifdef(`_CLASS_V_',
39255416Seric`R$* < @ $=V . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
39351322Sericifdef(`_CLASS_W_',
39455416Seric`R$* < @ $=W . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
39551322Sericifdef(`_CLASS_X_',
39655416Seric`R$* < @ $=X . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
39751322Sericifdef(`_CLASS_Y_',
39855416Seric`R$* < @ $=Y . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
39951267Seric
40051267Seric# try UUCP traffic as a local address
40155416SericR$* < @ $+ . UUCP > $*		$: $1 < @ $[ $2 $] . UUCP > $3
40251992Sericifdef(`_OLD_SENDMAIL_',
40355416Seric`R$* < @ $+ . $+ . UUCP > $*		$@ $1 < @ $2 . $3 . > $4',
40455416Seric`R$* < @ $+ . . UUCP > $*		$@ $1 < @ $2 . > $3')')
40551267Seric
40651222Seric# pass to name server to make hostname canonical
40751322SericR$* < @ $* $~. > $*		$: $1 < @ $[ $2 $3 $] > $4
40851222Seric
40951889Seric# handle possible alternate names
41051889SericR$* < @ $=w . $m . > $*		$: $1 < @ $j . > $3
41151889SericR$* < @ $=w . $m > $*		$: $1 < @ $j . > $3
41251889Sericundivert(8)dnl
41351889Seric
41451322Seric# if this is the local hostname, make sure we treat is as canonical
41551322SericR$* < @ $j > $*			$: $1 < @ $j . > $2
41651222Seric
41751322Seric
41851222Seric##################################################
41951222Seric###  Ruleset 4 -- Final Output Post-rewriting  ###
42051222Seric##################################################
42151222SericS4
42251222Seric
42358499SericR$*<@>			$@ $1				handle <> and list:;
42451222Seric
42551222Seric# resolve numeric addresses to name if possible
42651322SericR$* < @ [ $+ ] > $*	$: $1 < @ $[ [$2] $] > $3	lookup numeric internet addr
42751222Seric
42851322Seric# strip trailing dot off possibly canonical name
42951322SericR$* < @ $+ . > $*	$1 < @ $2 > $3
43051322Seric
43151222Seric# externalize local domain info
43251322SericR$* < $+ > $*		$1 $2 $3			defocus
43351322SericR@ $+ : @ $+ : $+	@ $1 , @ $2 : $3		<route-addr> canonical
43451997SericR@ $*			$@ @ $1				... and exit
43551222Seric
43658288Sericifdef(`_NO_UUCP_', `dnl',
43758288Seric`# UUCP must always be presented in old form
43858288SericR$+ @ $- . UUCP		$2!$1				u@h.UUCP => h!u')
43951222Seric
44051222Seric# delete duplicate local names
44151322SericR$+ % $=w @ $=w		$1 @ $j				u%host@host => u@host
44251222Seric
44351222Seric
44451222Seric
44551222Seric#############################################################
44651222Seric###   Ruleset 7 -- recanonicalize and call ruleset zero   ###
44751222Seric###		   (used for recursive calls)		  ###
44851222Seric#############################################################
44951222Seric
45051222SericS7
45151222SericR$*			$: $>3 $1
45251222SericR$*			$@ $>0 $1
45351222Seric
45451222Seric
45551222Seric######################################
45651222Seric###   Ruleset 0 -- Parse Address   ###
45751222Seric######################################
45851222Seric
45951222SericS0
46051222Seric
46158562SericR<@>			$#local $: <>			special case error msgs
46258340Seric
46355416Sericifdef(`_MAILER_smtp_',
46455416Seric`# handle numeric address spec
46551322SericR$* < @ [ $+ ] > $*	$: $1 < @ $[ [$2] $] > $3	numeric internet addr
46655416SericR$* < @ [ $+ ] > $*	$#smtp $@ [$2] $: $1 @ [$2] $3	numeric internet spec',
46756785Seric`dnl')
46851222Seric
46951887Seric# now delete the local info -- note $=O to find characters that cause forwarding
47058482SericR$* < @ > $*		$@ $>7 $1			user@ => user
47151322SericR< @ $j . > : $*	$@ $>7 $1			@here:... -> ...
47251322SericR$* $=O $* < @ $j . >	$@ $>7 $1 $2 $3			...@here -> ...
47358781Sericifdef(`MAILER_TABLE',
47458781Seric`
47558781Seric# try mailer table lookup
47658854SericR$* < @ $+ > $*		$: $1 < @ $(mailertable $2 $) > $3
47758781SericR$* < @ $-:$+ > $*	$# $2 $@ $3 $: $1 < @ $3 > $4	found a match',
47858781Seric`dnl')
47951222Seric
48051222Seric# short circuit local delivery so forwarded email works
48158516Sericifdef(`_LOCAL_NOT_STICKY_',
48258516Seric`R$=L < @ $j . >		$#local $: @ $1			special local names
48358516SericR$+ < @ $j . >		$#local $: $1			dispose directly',
48458516Seric`R$+ < @ $j . >		$: $1 < @ $j @ $H >		first try hub
48551992Sericifdef(`_OLD_SENDMAIL_',
48658070Seric`R$+ < $+ @ $-:$+ >	$# $3 $@ $4 $: $1 < $2 >	yep ....
48758771SericR$+ < $+ @ $+ >		$#relay $@ $3 $: $1 < $2 >	yep ....
48857527SericR$+ < $+ @ >		$#local $: $1			nope, local address',
48957527Seric`R$+ < $+ @ $+ >		$#local $: $1			yep ....
49058516SericR$+ < $+ @ >		$#local $: @ $1			nope, local address')')
49151222Sericundivert(3)dnl
49251260Sericundivert(4)dnl
49351260Seric
49455416Seric# resolve remotely connected UUCP links (if any)
49551285Sericifdef(`_CLASS_V_',
49652044Seric`R$* < @ $=V . UUCP > $*		$#smtp $@ $V $: <@ $V> : $1 @ $2.UUCP $3',
49752044Seric	`dnl')
49851285Sericifdef(`_CLASS_W_',
49952044Seric`R$* < @ $=W . UUCP > $*		$#smtp $@ $W $: <@ $W> : $1 @ $2.UUCP $3',
50052044Seric	`dnl')
50151285Sericifdef(`_CLASS_X_',
50252044Seric`R$* < @ $=X . UUCP > $*		$#smtp $@ $X $: <@ $X> : $1 @ $2.UUCP $3',
50352044Seric	`dnl')
50451260Seric
50551222Seric# resolve fake top level domains by forwarding to other hosts
50651222Sericifdef(`BITNET_RELAY',
50752044Seric`R$*<@$+.BITNET>$*	$#smtp $@ $B $: $1 <@$2.BITNET> $3	user@host.BITNET',
50851222Seric	`dnl')
50951222Sericifdef(`CSNET_RELAY',
51052044Seric`R$*<@$+.CSNET>$*	$#smtp $@ $C $: $1 <@$2.CSNET> $3	user@host.CSNET',
51151222Seric	`dnl')
51258364Sericifdef(`_MAILER_fax_',
51358364Seric`R$+ < @ $+ .FAX >	$#fax $@ $2 $: $1			user@host.FAX',
51458364Seric`ifdef(`FAX_RELAY',
51558364Seric`R$*<@$+.FAX>$*		$#smtp $@ $F $: $1 <@$2.FAX> $3		user@host.FAX',
51658364Seric	`dnl')')
51751222Seric
51851260Sericifdef(`UUCP_RELAY',
51951260Seric`# forward non-local UUCP traffic to our UUCP relay
52052044SericR$*<@$*.UUCP>$*		$#smtp $@ $Y $: <@ $Y> : $1 @ $2.UUCP $3	uucp mail',
52155416Seric`ifdef(`_MAILER_uucp_',
52251260Seric`# forward other UUCP traffic straight to UUCP
52351260SericR< @ $+ .UUCP > : $+	$#uucp $@ $1 $: $1:$2			@host.UUCP:...
52451322SericR$+ < @ $+ .UUCP >	$#uucp $@ $2 $: $1			user@host.UUCP',
52551260Seric	`dnl')')
52651222Seric
52758070Sericifdef(`_LOCAL_RULES_',
52858070Seric`# figure out what should stay in our local mail system
52958070Sericundivert(1)',
53058070Seric`ifdef(`_MAILER_smtp_',
53155416Seric`# deal with other remote names
53258070SericR$* < @ $* > $*		$#smtp $@ $2 $: $1 < @ $2 > $3		user@host.domain')')
53358070Sericifdef(`SMART_HOST', `
53458070Seric# pass names that still have a host to a smarthost
53558070SericR$* < @ $* > $*		$: < $S > $1 < @ $2 > $3	glue on smarthost name
53658070SericR<$-:$+> $* < @$* > $*	$# $1 $@ $2 $: $3 < @ $4 > $5	if non-null, use it
53758070SericR<$+> $* < @$* > $*	$#suucp $@ $1 $: $2 < @ $3 > $4	if non-null, use it
53858070SericR<> $* < @ $* > $*	$1 < @ $2 > $3			else strip off gunk',
53958070Seric`ifdef(`_LOCAL_RULES_', `
54058070Seric# reject messages that have host names we do not understand
54158070SericR$* < @ $* > $*		$#error $@ NOHOST $: Unrecognized host name $2',
54258070Seric`dnl')')
54358084Sericifdef(`_MAILER_USENET_', `
54458084Seric# addresses sent to net.group.USENET will get forwarded to a newsgroup
54558096SericR$+ . USENET		$# usenet $: $1')
54651222Seric
54751992Sericifdef(`_OLD_SENDMAIL_',
54851887Seric`# forward remaining names to local relay, if any
54952041SericR$=L			$#local $: $1			special local names
55052041SericR$+			$: $1 < @ $R >			append relay
55157527SericR$+ < @ >		$: $1 < @ $H >			no relay, try hub
55257527SericR$+ < @ >		$#local $: $1			no relay or hub: local
55357527SericR$+ < @ $j  >		$#local $: $1			we are relay/hub: local
55458070SericR$+ < @ $-:$+ >		$# $2 $@ $3 $: $1		deliver to relay/hub
55558771SericR$+ < @ $+ >		$#relay $@ $2 $: $1		deliver to relay/hub',
55658811Seric
55758811Seric`# if this is quoted, strip the quotes and try again
55858811SericR$+			$: $(dequote $1 $)		strip quotes
55958811SericR$* $=O $*		$@ $>7 $1 $2 $3			try again
56058811Seric
56158811Seric# handle locally delivered names
56252041SericR$=L			$#local $: @ $1			special local names
56352041SericR$+			$#local $: $1			regular local names
56451222Seric
56555416Seric###########################################################################
56655416Seric###   Ruleset 5 -- special rewriting after aliases have been expanded   ###
56755416Seric###		   (new sendmail only)					###
56855416Seric###########################################################################
56951222Seric
57051322SericS5
57151322Seric
57258808Seric# see if we have a relay or a hub
57358808SericR$+			$: $1 < @ $R >
57457527SericR$+ < @ >		$: $1 < @ $H >			no relay, try hub
57557527SericR$+ < @ $j >		$@ $1				we are relay/hub: local
57658070SericR$+ < @ $-:$+ >		$# $2 $@ $3 $: $1		send to relay or hub
57758808Sericifdef(`_MAILER_smtp_',
57858808Seric`R$+ < @ $+ >		$#relay $@ $2 $: $1		send to relay or hub')')
57951222Seric#
58051222Seric######################################################################
58151222Seric######################################################################
58251222Seric#####
58356790Seric`#####			MAILER DEFINITIONS'
58451222Seric#####
58551222Seric######################################################################
58651222Seric######################################################################
58751222Sericundivert(7)dnl
588