xref: /csrg-svn/usr.sbin/sendmail/cf/m4/proto.m4 (revision 60212)
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*60212SericVERSIONID(`@(#)proto.m4	6.39 (Berkeley) 05/21/93')
1251222Seric
1351322SericMAILER(local)dnl
1451222Seric
1552646Sericifdef(`_OLD_SENDMAIL_', `dnl',
1658119Seric`# level 4 config file format
1758119SericV4')
1852646Seric
1951222Seric##################
2051222Seric#   local info   #
2151222Seric##################
2251222Seric
23*60212SericCP.
24*60212Seric
2551889SericCwlocalhost
2651887Sericifdef(`USE_CW_FILE',
2751889Seric`# file containing names of hosts for which we receive email
2858406SericCONCAT(`Fw', confCW_FILE)', `dnl')
2951222Seric
3051222Sericifdef(`UUCP_RELAY',
3151222Seric`# UUCP relay host
3251281SericCONCAT(DY, UUCP_RELAY)
33*60212SericCPUUCP
3457944Seric
3551222Seric')dnl
3651222Sericifdef(`BITNET_RELAY',
3751222Seric`#  BITNET relay host
3851222SericCONCAT(DB, BITNET_RELAY)
39*60212SericCPBITNET
4057944Seric
4151222Seric')dnl
4251222Sericifdef(`CSNET_RELAY',
4351222Seric`# CSNET relay host
4451222SericCONCAT(DC, CSNET_RELAY)
45*60212SericCPCSNET
4657944Seric
4751222Seric')dnl
4858364Sericifdef(`FAX_RELAY',
4958364Seric`# FAX relay host
5058364SericCONCAT(DF, FAX_RELAY)
51*60212SericCPFAX
5258364Seric
5358364Seric')dnl
5458070Sericifdef(`SMART_HOST',
5558070Seric`# "Smart" UUCP relay host
5658070SericCONCAT(DS, SMART_HOST)
5751222Seric
5858070Seric')dnl
5958781Sericifdef(`MAILER_TABLE',
6058781Seric`# Mailer table (overriding domains)
6158781SericKmailertable MAILER_TABLE
6258781Seric
6358781Seric')dnl
6451222Seric# who I send unqualified names to (null means deliver locally)
6551222SericCONCAT(DR, ifdef(`LOCAL_RELAY', LOCAL_RELAY))
6651222Seric
6757527Seric# who gets all local email traffic ($R has precedence for unqualified names)
6857527SericCONCAT(DH, ifdef(`MAIL_HUB', MAIL_HUB))
6957527Seric
7058070Seric# my official hostname ($w or $w.$D)
7158070SericCONCAT(Dj$w, ifdef(`NEED_DOMAIN', .$D))
7258070Seric
7358070Seric# who I masquerade as (can be $j)
7458070SericCONCAT(DM, ifdef(`MASQUERADE_NAME', MASQUERADE_NAME, $j))
7558070Seric
7657245Seric# class L: names that should be delivered locally, even if we have a relay
7757245Seric# class E: names that should be exposed as from this host, even if we masquerade
7851279SericCLroot
7957245SericCEroot
8051279Sericundivert(5)dnl
8151279Seric
8251222Seric# operators that cannot be in local usernames (i.e., network indicators)
8358288SericCO @ % ifdef(`_NO_UUCP_', `', `!')
8451222Seric
8551322Seric# a class with just dot (for identifying canonical names)
8651322SericC..
8751322Seric
8858808Sericifdef(`_OLD_SENDMAIL_', `dnl',
8958808Seric`# dequoting map
9058808SericKdequote dequote')
9157944Seric
9259033Sericundivert(6)dnl
9359033Seric
9457944Seric######################
9557944Seric#   Special macros   #
9657944Seric######################
9757944Seric
9857944Seric# SMTP initial login message
9957944SericCONCAT(De, confSMTP_LOGIN_MSG)
10057944Seric
10157944Seric# UNIX initial From header format
10257944SericCONCAT(Dl, confFROM_LINE)
10357944Seric
10457944Seric# my name for error messages
10557944SericCONCAT(Dn, confMAILER_NAME)
10657944Seric
10757944Seric# delimiter (operator) characters
10857944SericCONCAT(Do, confOPERATORS)
10957944Seric
11057944Seric# format of a total name
11157944SericCONCAT(Dq, ifdef(`confFROM_HEADER', confFROM_HEADER,
11257944Seric	ifdef(`_OLD_SENDMAIL_', `$g$?x ($x)$.', `$?x$x <$g>$|$g$.')))
11357944Sericinclude(`../m4/version.m4')
11457944Seric
11557944Seric###############
11657944Seric#   Options   #
11757944Seric###############
11857944Seric
11959887Seric# strip message body to 7 bits on input?
12059887SericCONCAT(O7, confSEVEN_BIT_INPUT)
12157944Seric
12257944Seric# wait (in minutes) for alias file rebuild
12357944SericCONCAT(Oa, confALIAS_WAIT)
12457944Seric
12557944Seric# location of alias file
12657944SericCONCAT(OA, ifdef(`ALIAS_FILE', ALIAS_FILE, /etc/aliases))
12757944Seric
12858084Seric# minimum number of free blocks on filesystem
12958084SericCONCAT(Ob, confMIN_FREE_BLOCKS)
13058084Seric
13157944Seric# substitution for space (blank) characters
13257944SericCONCAT(OB, confBLANK_SUB)
13357944Seric
13457944Seric# connect to "expensive" mailers on initial submission?
13557944SericCONCAT(Oc, confCON_EXPENSIVE)
13657944Seric
13757944Seric# checkpoint queue runs after every N successful deliveries
13857944SericCONCAT(OC, confCHECKPOINT_INTERVAL)
13957944Seric
14057944Seric# default delivery mode
14157944SericCONCAT(Od, confDELIVERY_MODE)
14257944Seric
14357944Seric# automatically rebuild the alias database?
14457944SericCONCAT(OD, confAUTO_REBUILD)
14557944Seric
14657944Seric# error message header/file */
14757944Sericifdef(`confERROR_MESSAGE',
14857944Seric	concat(OE, confERROR_MESSAGE),
14957944Seric	#OE/etc/sendmail.oE)
15057944Seric
15157944Seric# error mode
15257944Sericifdef(`confERROR_MODE',
15357944Seric	concat(Oe, confERROR_MODE),
15457944Seric	#Oep)
15557944Seric
15657944Seric# save Unix-style "From_" lines at top of header?
15757944SericCONCAT(Of, confSAVE_FROM_LINES)
15857944Seric
15957944Seric# temporary file mode
16057944SericCONCAT(OF, confTEMP_FILE_MODE)
16157944Seric
16257944Seric# match recipients against GECOS field?
16357944SericCONCAT(OG, confMATCH_GECOS)
16457944Seric
16557944Seric# default GID
16657944SericCONCAT(Og, confDEF_GROUP_ID)
16757944Seric
16857944Seric# maximum hop count
16957944SericCONCAT(Oh, confMAX_HOP)
17057944Seric
17157944Seric# location of help file
17257944SericCONCAT(OH, ifdef(`HELP_FILE', HELP_FILE, /usr/lib/sendmail.hf))
17357944Seric
17457944Seric# ignore dots as terminators in incoming messages?
17557944SericCONCAT(Oi, confIGNORE_DOTS)
17657944Seric
17757944Seric# Insist that the BIND name server be running to resolve names
17857944Sericifdef(`confBIND_OPTS',
17957944Seric	CONCAT(OI, confBIND_OPTS),
18057944Seric	#OI)
18157944Seric
18259887Seric# deliver MIME-encapsulated error messages?
18359887SericCONCAT(Oj, confMIME_FORMAT_ERRORS)
18459887Seric
18557944Seric# Forward file search path
18657944Sericifdef(`confFORWARD_PATH',
18757944Seric	CONCAT(OJ, confFORWARD_PATH),
18857944Seric	#OJ/var/forward/$u:$z/.forward.$w:$z/.forward)
18957944Seric
19057944Seric# open connection cache size
19157944SericCONCAT(Ok, confMCI_CACHE_SIZE)
19257944Seric
19357944Seric# open connection cache timeout
19457944SericCONCAT(OK, confMCI_CACHE_TIMEOUT)
19557944Seric
19657944Seric# log level
19757944SericCONCAT(OL, confLOG_LEVEL)
19857944Seric
19957944Seric# send to me too, even in an alias expansion?
20057944SericCONCAT(Om, confME_TOO)
20157944Seric
20257944Seric# verify RHS in newaliases?
20357944SericCONCAT(On, confCHECK_ALIASES)
20457944Seric
20557944Seric# default messages to old style headers if no special punctuation?
20657944SericCONCAT(Oo, confOLD_STYLE_HEADERS)
20757944Seric
20858860Seric# SMTP daemon options
20958860Sericifdef(`confDAEMON_OPTIONS',
21058860Seric	CONCAT(OO, confDAEMON_OPTIONS),
21158860Seric	#OOPort=esmtp)
21258860Seric
21358084Seric# privacy flags
21458084SericCONCAT(Op, confPRIVACY_FLAGS)
21558084Seric
21657944Seric# who (if anyone) should get extra copies of error messages
21757944Sericifdef(`confCOPY_ERRORS_TO',
21857944Seric	CONCAT(OP, confCOPY_ERRORS_TO),
21957944Seric	#OPPostmaster)
22057944Seric
22157944Seric# slope of queue-only function
22257944Sericifdef(`confQUEUE_FACTOR',
22357944Seric	CONCAT(Oq, confQUEUE_FACTOR),
22457944Seric	#Oq600000)
22557944Seric
22657944Seric# queue directory
22757944SericCONCAT(OQ, ifdef(`QUEUE_DIR', QUEUE_DIR, /var/spool/mqueue))
22857944Seric
22957944Seric# read timeout -- now OK per RFC 1123 section 5.3.2
23058119Sericifdef(`confREAD_TIMEOUT',
23158119Seric	CONCAT(Or, confREAD_TIMEOUT),
23258119Seric	#Ordatablock=10m)
23357944Seric
23457944Seric# queue up everything before forking?
23557944SericCONCAT(Os, confSAFE_QUEUE)
23657944Seric
23757944Seric# status file
23857944SericCONCAT(OS, ifdef(`STATUS_FILE', STATUS_FILE, /etc/sendmail.st))
23957944Seric
24057944Seric# default message timeout interval
24157944SericCONCAT(OT, confMESSAGE_TIMEOUT)
24257944Seric
24357944Seric# time zone handling:
24457944Seric#  if undefined, use system default
24557944Seric#  if defined but null, use TZ envariable passed in
24657944Seric#  if defined and non-null, use that info
24757944Sericifelse(confTIME_ZONE, `USE_SYSTEM', `#Ot',
24857944Seric	confTIME_ZONE, `USE_TZ', `',
24957944Seric	`CONCAT(Ot, confTIME_ZONE)')
25057944Seric
25157944Seric# default UID
25257944SericCONCAT(Ou, confDEF_USER_ID)
25357944Seric
25451887Seric# list of locations of user database file (null means no lookup)
25558720SericOU`'ifdef(`confUSERDB_SPEC', `confUSERDB_SPEC')
25651222Seric
25758860Seric# fallback MX host
25858860Sericifdef(`confFALLBACK_MX',
25958860Seric	CONCAT(OV, confFALLBACK_MX),
26058860Seric	#OVfall.back.host.net)
26158860Seric
26257944Seric# load average at which we just queue messages
26357944SericCONCAT(Ox, confQUEUE_LA)
26457944Seric
26557944Seric# load average at which we refuse connections
26657944SericCONCAT(OX, confREFUSE_LA)
26757944Seric
26857944Seric# work recipient factor
26957944Sericifdef(`confWORK_RECIPIENT_FACTOR',
27057944Seric	CONCAT(Oy, confWORK_RECIPIENT_FACTOR),
27157944Seric	#Oy30000)
27257944Seric
27357944Seric# deliver each queued job in a separate process?
27457944SericCONCAT(OY, confSEPARATE_PROC)
27557944Seric
27657944Seric# work class factor
27757944Sericifdef(`confWORK_CLASS_FACTOR',
27857944Seric	CONCAT(Oz, confWORK_CLASS_FACTOR),
27957944Seric	#Oz1800)
28057944Seric
28157944Seric# work time factor
28257944Sericifdef(`confWORK_TIME_FACTOR',
28357944Seric	CONCAT(OZ, confWORK_TIME_FACTOR),
28457944Seric	#OZ90000)
28557944Seric
28657944Seric###########################
28757944Seric#   Message precedences   #
28857944Seric###########################
28957944Seric
29057944SericPfirst-class=0
29157944SericPspecial-delivery=100
29258070SericPlist=-30
29357944SericPbulk=-60
29457944SericPjunk=-100
29557944Seric
29657944Seric#####################
29757944Seric#   Trusted users   #
29857944Seric#####################
29957944Seric
30057944SericTroot
30157944SericTdaemon
30257944SericTuucp
30357944Seric
30457944Seric#########################
30557944Seric#   Format of headers   #
30657944Seric#########################
30757944Seric
30858679SericH?P?Return-Path: $g
30958959SericHReceived: $?sfrom $s $.$?_($_) $.by $j ($v/$Z) id $i; $b
31057944SericH?D?Resent-Date: $a
31157944SericH?D?Date: $a
31257944SericH?F?Resent-From: $q
31357944SericH?F?From: $q
31457944SericH?x?Full-Name: $x
31557944SericHSubject:
31657944Seric# HPosted-Date: $a
31757944Seric# H?l?Received-Date: $b
31857944SericH?M?Resent-Message-Id: <$t.$i@$j>
31957944SericH?M?Message-Id: <$t.$i@$j>
32051222Seric#
32151222Seric######################################################################
32251222Seric######################################################################
32351222Seric#####
32451222Seric#####			REWRITING RULES
32551222Seric#####
32651222Seric######################################################################
32751222Seric######################################################################
32851222Seric
32958678Sericundivert(9)dnl
33051222Seric
33151222Seric###########################################
33251222Seric###  Rulset 3 -- Name Canonicalization  ###
33351222Seric###########################################
33451260SericS3
33551222Seric
33658499Seric# handle null input and list syntax (translate to <@> special case)
33758499SericR$@			$@ <@>
33858707SericR$*:;$*			$@ $1 :; <@>
33958174Seric
34051222Seric# basic textual canonicalization -- note RFC733 heuristic here
34157012SericR$*<$*>$*<$*>$*		<$2>$3$4$5			strip multiple <> <>
34258158SericR$*<$*<$+>$*>$*		<$3>$5				2-level <> nesting
34358499SericR$*<>$*			$@ <@>				MAIL FROM:<> case
34451222SericR$*<$+>$*		$2				basic RFC821/822 parsing
34551222Seric
34651222Seric# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
34755416SericR@ $+ , $+		@ $1 : $2			change all "," to ":"
34851222Seric
34951222Seric# localize and dispose of route-based addresses
35055416SericR@ $+ : $+		$@ $>6 < @$1 > : $2		handle <route-addr>
35151222Seric
35251222Seric# find focus for list syntax
35355416SericR $+ : $* ; @ $+	$@ $>6 $1 : $2 ; < @ $3 >	list syntax
35455416SericR $+ : $* ;		$@ $1 : $2;			list syntax
35551222Seric
35651222Seric# find focus for @ syntax addresses
35755416SericR$+ @ $+		$: $1 < @ $2 >			focus on domain
35855416SericR$+ < $+ @ $+ >		$1 $2 < @ $3 >			move gaze right
35955416SericR$+ < @ $+ >		$@ $>6 $1 < @ $2 >		already canonical
36051222Seric
36158288Sericifdef(`_NO_UUCP_', `dnl',
36258288Seric`# convert old-style addresses to a domain-based address
36355416SericR$- ! $+		$@ $>6 $2 < @ $1 .UUCP >	resolve uucp names
36455416SericR$+ . $- ! $+		$@ $>6 $3 < @ $1 . $2 >		domain uucps
36558288SericR$+ ! $+		$@ $>6 $2 < @ $1 .UUCP >	uucp subdomains')
36651222Seric
36751222Seric# if we have % signs, take the rightmost one
36855416SericR$* % $*		$1 @ $2				First make them all @s.
36955416SericR$* @ $* @ $*		$1 % $2 @ $3			Undo all but the last.
37055416SericR$* @ $*		$@ $>6 $1 < @ $2 >		Insert < > and finish
37151222Seric
37251222Seric# else we must be a local name
37351222Seric
37451222Seric
37551222Seric###############################################
37651222Seric###  Ruleset 6 -- bottom half of ruleset 3  ###
37751222Seric###############################################
37851222Seric
37957245Seric#  At this point, everything should be in a "local_part<@domain>extra" format.
38051222SericS6
38151222Seric
38251222Seric# handle special cases for local names
38351322SericR$* < @ $=w > $*		$: $1 < @ $j . > $3		no domain at all
38455416SericR$* < @ $=w . UUCP > $*		$: $1 < @ $j . > $3		.UUCP domain
38551889Sericundivert(2)dnl
38651222Seric
38759081Sericifdef(`_NO_UUCP_', `dnl',
38859081Seric`ifdef(`UUCP_RELAY',
38951274Seric`# pass UUCP addresses straight through
39055416SericR$* < @ $+ . UUCP > $*		$@ $1 < @ $2 . UUCP > $3',
39151274Seric`# if really UUCP, handle it immediately
39251322Sericifdef(`_CLASS_U_',
39355416Seric`R$* < @ $=U . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
39451322Sericifdef(`_CLASS_V_',
39555416Seric`R$* < @ $=V . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
39651322Sericifdef(`_CLASS_W_',
39755416Seric`R$* < @ $=W . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
39851322Sericifdef(`_CLASS_X_',
39955416Seric`R$* < @ $=X . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
40051322Sericifdef(`_CLASS_Y_',
40155416Seric`R$* < @ $=Y . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
40251267Seric
40351267Seric# try UUCP traffic as a local address
40455416SericR$* < @ $+ . UUCP > $*		$: $1 < @ $[ $2 $] . UUCP > $3
40551992Sericifdef(`_OLD_SENDMAIL_',
40655416Seric`R$* < @ $+ . $+ . UUCP > $*		$@ $1 < @ $2 . $3 . > $4',
40755416Seric`R$* < @ $+ . . UUCP > $*		$@ $1 < @ $2 . > $3')')
40859081Seric')
40959081Sericifdef(`_NO_CANONIFY_', `dnl',
41059081Seric`# pass to name server to make hostname canonical
411*60212SericR$* < @ $* $~P > $*		$: $1 < @ $[ $2 $3 $] > $4
41259081Seric')
41351889Seric# handle possible alternate names
41451889SericR$* < @ $=w . $m . > $*		$: $1 < @ $j . > $3
41551889SericR$* < @ $=w . $m > $*		$: $1 < @ $j . > $3
41651889Sericundivert(8)dnl
41751889Seric
41851322Seric# if this is the local hostname, make sure we treat is as canonical
41951322SericR$* < @ $j > $*			$: $1 < @ $j . > $2
42051222Seric
42151322Seric
42251222Seric##################################################
42351222Seric###  Ruleset 4 -- Final Output Post-rewriting  ###
42451222Seric##################################################
42551222SericS4
42651222Seric
42758499SericR$*<@>			$@ $1				handle <> and list:;
42851222Seric
42951222Seric# resolve numeric addresses to name if possible
43051322SericR$* < @ [ $+ ] > $*	$: $1 < @ $[ [$2] $] > $3	lookup numeric internet addr
43151222Seric
43251322Seric# strip trailing dot off possibly canonical name
43351322SericR$* < @ $+ . > $*	$1 < @ $2 > $3
43451322Seric
43551222Seric# externalize local domain info
43651322SericR$* < $+ > $*		$1 $2 $3			defocus
43751322SericR@ $+ : @ $+ : $+	@ $1 , @ $2 : $3		<route-addr> canonical
43851997SericR@ $*			$@ @ $1				... and exit
43951222Seric
44058288Sericifdef(`_NO_UUCP_', `dnl',
44158288Seric`# UUCP must always be presented in old form
44258288SericR$+ @ $- . UUCP		$2!$1				u@h.UUCP => h!u')
44351222Seric
44451222Seric# delete duplicate local names
44551322SericR$+ % $=w @ $=w		$1 @ $j				u%host@host => u@host
44651222Seric
44751222Seric
44851222Seric
44951222Seric#############################################################
45051222Seric###   Ruleset 7 -- recanonicalize and call ruleset zero   ###
45151222Seric###		   (used for recursive calls)		  ###
45251222Seric#############################################################
45351222Seric
45451222SericS7
45551222SericR$*			$: $>3 $1
45651222SericR$*			$@ $>0 $1
45751222Seric
45851222Seric
45951222Seric######################################
46051222Seric###   Ruleset 0 -- Parse Address   ###
46151222Seric######################################
46251222Seric
46351222SericS0
46451222Seric
46558562SericR<@>			$#local $: <>			special case error msgs
46659887SericR$*:;<@>		$#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
46758340Seric
46855416Sericifdef(`_MAILER_smtp_',
46955416Seric`# handle numeric address spec
47051322SericR$* < @ [ $+ ] > $*	$: $1 < @ $[ [$2] $] > $3	numeric internet addr
47155416SericR$* < @ [ $+ ] > $*	$#smtp $@ [$2] $: $1 @ [$2] $3	numeric internet spec',
47256785Seric`dnl')
47351222Seric
47451887Seric# now delete the local info -- note $=O to find characters that cause forwarding
47558482SericR$* < @ > $*		$@ $>7 $1			user@ => user
47651322SericR< @ $j . > : $*	$@ $>7 $1			@here:... -> ...
47751322SericR$* $=O $* < @ $j . >	$@ $>7 $1 $2 $3			...@here -> ...
47858781Sericifdef(`MAILER_TABLE',
47958781Seric`
48058781Seric# try mailer table lookup
48158854SericR$* < @ $+ > $*		$: $1 < @ $(mailertable $2 $) > $3
48259635SericR$* < @ $-:$+ > $*	$# $2 $@ $3 $: $1 < @ $3 > $4	found a match',
48358781Seric`dnl')
48451222Seric
48551222Seric# short circuit local delivery so forwarded email works
48658516Sericifdef(`_LOCAL_NOT_STICKY_',
48758516Seric`R$=L < @ $j . >		$#local $: @ $1			special local names
48858516SericR$+ < @ $j . >		$#local $: $1			dispose directly',
48958516Seric`R$+ < @ $j . >		$: $1 < @ $j @ $H >		first try hub
49051992Sericifdef(`_OLD_SENDMAIL_',
49159635Seric`R$+ < $+ @ $-:$+ >	$# $3 $@ $4 $: $1 < $2 >	yep ....
49259635SericR$+ < $+ @ $+ >		$#relay $@ $3 $: $1 < $2 >	yep ....
49357527SericR$+ < $+ @ >		$#local $: $1			nope, local address',
49457527Seric`R$+ < $+ @ $+ >		$#local $: $1			yep ....
49558516SericR$+ < $+ @ >		$#local $: @ $1			nope, local address')')
49651222Sericundivert(3)dnl
49751260Sericundivert(4)dnl
49851260Seric
49955416Seric# resolve remotely connected UUCP links (if any)
50051285Sericifdef(`_CLASS_V_',
50159635Seric`R$* < @ $=V . UUCP > $*		$#smtp $@ $V $: <@ $V> : $1 @ $2.UUCP $3',
50252044Seric	`dnl')
50351285Sericifdef(`_CLASS_W_',
50459635Seric`R$* < @ $=W . UUCP > $*		$#smtp $@ $W $: <@ $W> : $1 @ $2.UUCP $3',
50552044Seric	`dnl')
50651285Sericifdef(`_CLASS_X_',
50759635Seric`R$* < @ $=X . UUCP > $*		$#smtp $@ $X $: <@ $X> : $1 @ $2.UUCP $3',
50852044Seric	`dnl')
50951260Seric
51051222Seric# resolve fake top level domains by forwarding to other hosts
51151222Sericifdef(`BITNET_RELAY',
512*60212Seric`R$*<@$+.BITNET>$*	$#smtp $@ $B. $: $1 <@$2.BITNET> $3	user@host.BITNET',
51351222Seric	`dnl')
51451222Sericifdef(`CSNET_RELAY',
515*60212Seric`R$*<@$+.CSNET>$*	$#smtp $@ $C. $: $1 <@$2.CSNET> $3	user@host.CSNET',
51651222Seric	`dnl')
51758364Sericifdef(`_MAILER_fax_',
51858364Seric`R$+ < @ $+ .FAX >	$#fax $@ $2 $: $1			user@host.FAX',
51958364Seric`ifdef(`FAX_RELAY',
520*60212Seric`R$*<@$+.FAX>$*		$#smtp $@ $F. $: $1 <@$2.FAX> $3	user@host.FAX',
52158364Seric	`dnl')')
52251222Seric
52351260Sericifdef(`UUCP_RELAY',
52451260Seric`# forward non-local UUCP traffic to our UUCP relay
525*60212SericR$*<@$*.UUCP>$*		$#smtp $@ $Y. $: <@ $Y> : $1 @ $2.UUCP $3	uucp mail',
52655416Seric`ifdef(`_MAILER_uucp_',
52751260Seric`# forward other UUCP traffic straight to UUCP
52859604SericR< @ $+ .UUCP > : $+	$#uucp $@ $1 $: $2			@host.UUCP:...
52951322SericR$+ < @ $+ .UUCP >	$#uucp $@ $2 $: $1			user@host.UUCP',
53051260Seric	`dnl')')
53151222Seric
53258070Sericifdef(`_LOCAL_RULES_',
53358070Seric`# figure out what should stay in our local mail system
53458070Sericundivert(1)',
53558070Seric`ifdef(`_MAILER_smtp_',
53655416Seric`# deal with other remote names
53759635SericR$* < @ $* > $*		$#smtp $@ $2 $: $1 < @ $2 > $3		user@host.domain')')
53858070Sericifdef(`SMART_HOST', `
53958070Seric# pass names that still have a host to a smarthost
54058070SericR$* < @ $* > $*		$: < $S > $1 < @ $2 > $3	glue on smarthost name
54159635SericR<$-:$+> $* < @$* > $*	$# $1 $@ $2 $: $3 < @ $4 > $5	if non-null, use it
54259635SericR<$+> $* < @$* > $*	$#suucp $@ $1 $: $2 < @ $3 > $4	if non-null, use it
54358070SericR<> $* < @ $* > $*	$1 < @ $2 > $3			else strip off gunk',
54458070Seric`ifdef(`_LOCAL_RULES_', `
54558070Seric# reject messages that have host names we do not understand
54658070SericR$* < @ $* > $*		$#error $@ NOHOST $: Unrecognized host name $2',
54758070Seric`dnl')')
54858084Sericifdef(`_MAILER_USENET_', `
54958084Seric# addresses sent to net.group.USENET will get forwarded to a newsgroup
55058096SericR$+ . USENET		$# usenet $: $1')
55151222Seric
55251992Sericifdef(`_OLD_SENDMAIL_',
55351887Seric`# forward remaining names to local relay, if any
55452041SericR$=L			$#local $: $1			special local names
55552041SericR$+			$: $1 < @ $R >			append relay
55657527SericR$+ < @ >		$: $1 < @ $H >			no relay, try hub
55757527SericR$+ < @ >		$#local $: $1			no relay or hub: local
55857527SericR$+ < @ $j  >		$#local $: $1			we are relay/hub: local
55958070SericR$+ < @ $-:$+ >		$# $2 $@ $3 $: $1		deliver to relay/hub
56058771SericR$+ < @ $+ >		$#relay $@ $2 $: $1		deliver to relay/hub',
56158811Seric
56258811Seric`# if this is quoted, strip the quotes and try again
56358811SericR$+			$: $(dequote $1 $)		strip quotes
56458811SericR$* $=O $*		$@ $>7 $1 $2 $3			try again
56558811Seric
56658811Seric# handle locally delivered names
56752041SericR$=L			$#local $: @ $1			special local names
56852041SericR$+			$#local $: $1			regular local names
56951222Seric
57055416Seric###########################################################################
57155416Seric###   Ruleset 5 -- special rewriting after aliases have been expanded   ###
57255416Seric###		   (new sendmail only)					###
57355416Seric###########################################################################
57451222Seric
57551322SericS5
57651322Seric
57758808Seric# see if we have a relay or a hub
57858808SericR$+			$: $1 < @ $R >
57957527SericR$+ < @ >		$: $1 < @ $H >			no relay, try hub
58057527SericR$+ < @ $j >		$@ $1				we are relay/hub: local
58158070SericR$+ < @ $-:$+ >		$# $2 $@ $3 $: $1		send to relay or hub
58258808Sericifdef(`_MAILER_smtp_',
58358808Seric`R$+ < @ $+ >		$#relay $@ $2 $: $1		send to relay or hub')')
58451222Seric#
58551222Seric######################################################################
58651222Seric######################################################################
58751222Seric#####
58856790Seric`#####			MAILER DEFINITIONS'
58951222Seric#####
59051222Seric######################################################################
59151222Seric######################################################################
59251222Sericundivert(7)dnl
593