xref: /original-bsd/usr.sbin/sendmail/cf/m4/proto.m4 (revision bacd16ee)
1divert(-1)
2#
3# Copyright (c) 1983 Eric P. Allman
4# Copyright (c) 1988, 1993
5#	The Regents of the University of California.  All rights reserved.
6#
7# %sccs.include.redist.sh%
8#
9divert(0)
10
11VERSIONID(`@(#)proto.m4	8.4 (Berkeley) 07/18/93')
12
13MAILER(local)dnl
14
15ifdef(`_OLD_SENDMAIL_',
16`define(`_SET_96_', 6)dnl
17define(`_SET_97_', 7)dnl
18define(`_SET_98_', 8)dnl',
19`# level 4 config file format
20V4
21define(`_SET_96_', 96)dnl
22define(`_SET_97_', 97)dnl
23define(`_SET_98_', 98)dnl')
24
25##################
26#   local info   #
27##################
28
29CP.
30
31Cwlocalhost
32ifdef(`USE_CW_FILE',
33`# file containing names of hosts for which we receive email
34CONCAT(`Fw', confCW_FILE)', `dnl')
35
36ifdef(`UUCP_RELAY',
37`# UUCP relay host
38CONCAT(DY, UUCP_RELAY)
39CPUUCP
40
41')dnl
42ifdef(`BITNET_RELAY',
43`#  BITNET relay host
44CONCAT(DB, BITNET_RELAY)
45CPBITNET
46
47')dnl
48ifdef(`CSNET_RELAY',
49`# CSNET relay host
50CONCAT(DC, CSNET_RELAY)
51CPCSNET
52
53')dnl
54ifdef(`FAX_RELAY',
55`# FAX relay host
56CONCAT(DF, FAX_RELAY)
57CPFAX
58
59')dnl
60ifdef(`SMART_HOST',
61`# "Smart" UUCP relay host
62CONCAT(DS, SMART_HOST)
63
64')dnl
65ifdef(`MAILER_TABLE',
66`# Mailer table (overriding domains)
67Kmailertable MAILER_TABLE
68
69')dnl
70ifdef(`DOMAIN_TABLE',
71`# Domain table (adding domains)
72Kdomaintable DOMAIN_TABLE
73
74')dnl
75# who I send unqualified names to (null means deliver locally)
76CONCAT(DR, ifdef(`LOCAL_RELAY', LOCAL_RELAY))
77
78# who gets all local email traffic ($R has precedence for unqualified names)
79CONCAT(DH, ifdef(`MAIL_HUB', MAIL_HUB))
80
81# my official hostname ($w or $w.$D)
82CONCAT(Dj$w, ifdef(`NEED_DOMAIN', .$D))
83
84# who I masquerade as (can be $j)
85CONCAT(DM, ifdef(`MASQUERADE_NAME', MASQUERADE_NAME, $j))
86
87# class L: names that should be delivered locally, even if we have a relay
88# class E: names that should be exposed as from this host, even if we masquerade
89CLroot
90CEroot
91undivert(5)dnl
92
93# operators that cannot be in local usernames (i.e., network indicators)
94CO @ % ifdef(`_NO_UUCP_', `', `!')
95
96# a class with just dot (for identifying canonical names)
97C..
98
99ifdef(`_OLD_SENDMAIL_', `dnl',
100`# dequoting map
101Kdequote dequote')
102
103undivert(6)dnl
104
105######################
106#   Special macros   #
107######################
108
109# SMTP initial login message
110CONCAT(De, confSMTP_LOGIN_MSG)
111
112# UNIX initial From header format
113CONCAT(Dl, confFROM_LINE)
114
115# my name for error messages
116CONCAT(Dn, confMAILER_NAME)
117
118# delimiter (operator) characters
119CONCAT(Do, confOPERATORS)
120
121# format of a total name
122CONCAT(Dq, ifdef(`confFROM_HEADER', confFROM_HEADER,
123	ifdef(`_OLD_SENDMAIL_', `$g$?x ($x)$.', `$?x$x <$g>$|$g$.')))
124include(`../m4/version.m4')
125
126###############
127#   Options   #
128###############
129
130# strip message body to 7 bits on input?
131CONCAT(O7, confSEVEN_BIT_INPUT)
132
133# wait (in minutes) for alias file rebuild
134CONCAT(Oa, confALIAS_WAIT)
135
136# location of alias file
137CONCAT(OA, ifdef(`ALIAS_FILE', ALIAS_FILE, /etc/aliases))
138
139# minimum number of free blocks on filesystem
140CONCAT(Ob, confMIN_FREE_BLOCKS)
141
142# substitution for space (blank) characters
143CONCAT(OB, confBLANK_SUB)
144
145# connect to "expensive" mailers on initial submission?
146CONCAT(Oc, confCON_EXPENSIVE)
147
148# checkpoint queue runs after every N successful deliveries
149CONCAT(OC, confCHECKPOINT_INTERVAL)
150
151# default delivery mode
152CONCAT(Od, confDELIVERY_MODE)
153
154# automatically rebuild the alias database?
155CONCAT(OD, confAUTO_REBUILD)
156
157# error message header/file */
158ifdef(`confERROR_MESSAGE',
159	CONCAT(OE, confERROR_MESSAGE),
160	#OE/etc/sendmail.oE)
161
162# error mode
163ifdef(`confERROR_MODE',
164	CONCAT(Oe, confERROR_MODE),
165	#Oep)
166
167# save Unix-style "From_" lines at top of header?
168CONCAT(Of, confSAVE_FROM_LINES)
169
170# temporary file mode
171CONCAT(OF, confTEMP_FILE_MODE)
172
173# match recipients against GECOS field?
174CONCAT(OG, confMATCH_GECOS)
175
176# default GID
177CONCAT(Og, confDEF_GROUP_ID)
178
179# maximum hop count
180CONCAT(Oh, confMAX_HOP)
181
182# location of help file
183CONCAT(OH, ifdef(`HELP_FILE', HELP_FILE, /usr/lib/sendmail.hf))
184
185# ignore dots as terminators in incoming messages?
186CONCAT(Oi, confIGNORE_DOTS)
187
188# Insist that the BIND name server be running to resolve names
189ifdef(`confBIND_OPTS',
190	CONCAT(OI, confBIND_OPTS),
191	#OI)
192
193# deliver MIME-encapsulated error messages?
194CONCAT(Oj, confMIME_FORMAT_ERRORS)
195
196# Forward file search path
197ifdef(`confFORWARD_PATH',
198	CONCAT(OJ, confFORWARD_PATH),
199	#OJ/var/forward/$u:$z/.forward.$w:$z/.forward)
200
201# open connection cache size
202CONCAT(Ok, confMCI_CACHE_SIZE)
203
204# open connection cache timeout
205CONCAT(OK, confMCI_CACHE_TIMEOUT)
206
207# use Errors-To: header?
208CONCAT(Ol, confUSE_ERRORS_TO)
209
210# log level
211CONCAT(OL, confLOG_LEVEL)
212
213# send to me too, even in an alias expansion?
214CONCAT(Om, confME_TOO)
215
216# verify RHS in newaliases?
217CONCAT(On, confCHECK_ALIASES)
218
219# default messages to old style headers if no special punctuation?
220CONCAT(Oo, confOLD_STYLE_HEADERS)
221
222# SMTP daemon options
223ifdef(`confDAEMON_OPTIONS',
224	CONCAT(OO, confDAEMON_OPTIONS),
225	#OOPort=esmtp)
226
227# privacy flags
228CONCAT(Op, confPRIVACY_FLAGS)
229
230# who (if anyone) should get extra copies of error messages
231ifdef(`confCOPY_ERRORS_TO',
232	CONCAT(OP, confCOPY_ERRORS_TO),
233	#OPPostmaster)
234
235# slope of queue-only function
236ifdef(`confQUEUE_FACTOR',
237	CONCAT(Oq, confQUEUE_FACTOR),
238	#Oq600000)
239
240# queue directory
241CONCAT(OQ, ifdef(`QUEUE_DIR', QUEUE_DIR, /var/spool/mqueue))
242
243# read timeout -- now OK per RFC 1123 section 5.3.2
244ifdef(`confREAD_TIMEOUT',
245	CONCAT(Or, confREAD_TIMEOUT),
246	#Ordatablock=10m)
247
248# queue up everything before forking?
249CONCAT(Os, confSAFE_QUEUE)
250
251# status file
252CONCAT(OS, ifdef(`STATUS_FILE', STATUS_FILE, /etc/sendmail.st))
253
254# default message timeout interval
255CONCAT(OT, confMESSAGE_TIMEOUT)
256
257# time zone handling:
258#  if undefined, use system default
259#  if defined but null, use TZ envariable passed in
260#  if defined and non-null, use that info
261ifelse(confTIME_ZONE, `USE_SYSTEM', `#Ot',
262	confTIME_ZONE, `USE_TZ', `',
263	`CONCAT(Ot, confTIME_ZONE)')
264
265# default UID
266CONCAT(Ou, confDEF_USER_ID)
267
268# list of locations of user database file (null means no lookup)
269OU`'ifdef(`confUSERDB_SPEC', `confUSERDB_SPEC')
270
271# fallback MX host
272ifdef(`confFALLBACK_MX',
273	CONCAT(OV, confFALLBACK_MX),
274	#OVfall.back.host.net)
275
276# if we are the best MX host for a site, try it directly instead of config err
277CONCAT(Ow, confTRY_NULL_MX_LIST)
278
279# load average at which we just queue messages
280CONCAT(Ox, confQUEUE_LA)
281
282# load average at which we refuse connections
283CONCAT(OX, confREFUSE_LA)
284
285# work recipient factor
286ifdef(`confWORK_RECIPIENT_FACTOR',
287	CONCAT(Oy, confWORK_RECIPIENT_FACTOR),
288	#Oy30000)
289
290# deliver each queued job in a separate process?
291CONCAT(OY, confSEPARATE_PROC)
292
293# work class factor
294ifdef(`confWORK_CLASS_FACTOR',
295	CONCAT(Oz, confWORK_CLASS_FACTOR),
296	#Oz1800)
297
298# work time factor
299ifdef(`confWORK_TIME_FACTOR',
300	CONCAT(OZ, confWORK_TIME_FACTOR),
301	#OZ90000)
302
303###########################
304#   Message precedences   #
305###########################
306
307Pfirst-class=0
308Pspecial-delivery=100
309Plist=-30
310Pbulk=-60
311Pjunk=-100
312
313#####################
314#   Trusted users   #
315#####################
316
317Troot
318Tdaemon
319Tuucp
320
321#########################
322#   Format of headers   #
323#########################
324
325H?P?Return-Path: $g
326HReceived: $?sfrom $s $.$?_($_) $.by $j ($v/$Z)$?r with $r$. id $i; $b
327H?D?Resent-Date: $a
328H?D?Date: $a
329H?F?Resent-From: $q
330H?F?From: $q
331H?x?Full-Name: $x
332HSubject:
333# HPosted-Date: $a
334# H?l?Received-Date: $b
335H?M?Resent-Message-Id: <$t.$i@$j>
336H?M?Message-Id: <$t.$i@$j>
337#
338######################################################################
339######################################################################
340#####
341#####			REWRITING RULES
342#####
343######################################################################
344######################################################################
345
346undivert(9)dnl
347
348###########################################
349###  Rulset 3 -- Name Canonicalization  ###
350###########################################
351S3
352
353# handle null input and list syntax (translate to <@> special case)
354R$@			$@ <@>
355R$*:;$*			$@ $1 :; <@>
356
357# basic textual canonicalization -- note RFC733 heuristic here
358R$*<$*>$*<$*>$*		<$2>$3$4$5			strip multiple <> <>
359R$*<$*<$+>$*>$*		<$3>$5				2-level <> nesting
360R$*<>$*			$@ <@>				MAIL FROM:<> case
361R$*<$+>$*		$2				basic RFC821/822 parsing
362
363# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
364R@ $+ , $+		@ $1 : $2			change all "," to ":"
365
366# localize and dispose of route-based addresses
367R@ $+ : $+		$@ $>_SET_96_ < @$1 > : $2		handle <route-addr>
368
369# find focus for list syntax
370R $+ : $* ; @ $+	$@ $>_SET_96_ $1 : $2 ; < @ $3 >	list syntax
371R $+ : $* ;		$@ $1 : $2;			list syntax
372
373# find focus for @ syntax addresses
374R$+ @ $+		$: $1 < @ $2 >			focus on domain
375R$+ < $+ @ $+ >		$1 $2 < @ $3 >			move gaze right
376R$+ < @ $+ >		$@ $>_SET_96_ $1 < @ $2 >		already canonical
377
378ifdef(`_NO_UUCP_', `dnl',
379`# convert old-style addresses to a domain-based address
380R$- ! $+		$@ $>_SET_96_ $2 < @ $1 .UUCP >	resolve uucp names
381R$+ . $- ! $+		$@ $>_SET_96_ $3 < @ $1 . $2 >		domain uucps
382R$+ ! $+		$@ $>_SET_96_ $2 < @ $1 .UUCP >	uucp subdomains')
383
384# if we have % signs, take the rightmost one
385R$* % $*		$1 @ $2				First make them all @s.
386R$* @ $* @ $*		$1 % $2 @ $3			Undo all but the last.
387R$* @ $*		$@ $>_SET_96_ $1 < @ $2 >		Insert < > and finish
388
389# else we must be a local name
390
391
392################################################
393###  Ruleset _SET_96_ -- bottom half of ruleset 3  ###
394################################################
395
396#  At this point, everything should be in a "local_part<@domain>extra" format.
397S`'_SET_96_
398
399# handle special cases for local names
400R$* < @ localhost > $*		$: $1 < @ $j . > $2		no domain at all
401R$* < @ localhost . $m > $*	$: $1 < @ $j . > $2		local domain
402ifdef(`_NO_UUCP_', `dnl',
403`R$* < @ localhost . UUCP > $*	$: $1 < @ $j . > $2		.UUCP domain')
404ifdef(`DOMAIN_TABLE', `
405# look up unqualified domains in the domain table
406R$* < @ $- > $*			$: $1 < @ $(domaintable $2 $) > $3',
407`dnl')
408undivert(2)dnl
409
410ifdef(`_NO_UUCP_', `dnl',
411`ifdef(`UUCP_RELAY',
412`# pass UUCP addresses straight through
413R$* < @ $+ . UUCP > $*		$@ $1 < @ $2 . UUCP > $3',
414`# if really UUCP, handle it immediately
415ifdef(`_CLASS_U_',
416`R$* < @ $=U . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
417ifdef(`_CLASS_V_',
418`R$* < @ $=V . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
419ifdef(`_CLASS_W_',
420`R$* < @ $=W . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
421ifdef(`_CLASS_X_',
422`R$* < @ $=X . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
423ifdef(`_CLASS_Y_',
424`R$* < @ $=Y . UUCP > $*	$@ $1 < @ $2 . UUCP > $3', `dnl')
425
426# try UUCP traffic as a local address
427R$* < @ $+ . UUCP > $*		$: $1 < @ $[ $2 $] . UUCP > $3
428ifdef(`_OLD_SENDMAIL_',
429`R$* < @ $+ . $+ . UUCP > $*		$@ $1 < @ $2 . $3 . > $4',
430`R$* < @ $+ . . UUCP > $*		$@ $1 < @ $2 . > $3')')
431')
432ifdef(`_NO_CANONIFY_',
433`# make sure local host names appear canonical
434R$* < @ $=w > $*		$: $1 < @ $2 . > $3',
435`# pass to name server to make hostname canonical
436R$* < @ $* $~P > $*		$: $1 < @ $[ $2 $3 $] > $4')
437
438undivert(8)dnl
439
440# if this is the local hostname, make sure we treat is as canonical
441R$* < @ $j > $*			$: $1 < @ $j . > $2
442
443
444##################################################
445###  Ruleset 4 -- Final Output Post-rewriting  ###
446##################################################
447S4
448
449R$*<@>			$@ $1				handle <> and list:;
450
451# resolve numeric addresses to name if possible
452R$* < @ [ $+ ] > $*	$: $1 < @ $[ [$2] $] > $3	lookup numeric internet addr
453
454# strip trailing dot off possibly canonical name
455R$* < @ $+ . > $*	$1 < @ $2 > $3
456
457# externalize local domain info
458R$* < $+ > $*		$1 $2 $3			defocus
459R@ $+ : @ $+ : $+	@ $1 , @ $2 : $3		<route-addr> canonical
460R@ $*			$@ @ $1				... and exit
461
462ifdef(`_NO_UUCP_', `dnl',
463`# UUCP must always be presented in old form
464R$+ @ $- . UUCP		$2!$1				u@h.UUCP => h!u')
465
466# delete duplicate local names
467R$+ % $=w @ $=w		$1 @ $j				u%host@host => u@host
468
469
470
471##############################################################
472###   Ruleset _SET_97_ -- recanonicalize and call ruleset zero   ###
473###		   (used for recursive calls)		   ###
474##############################################################
475
476S`'_SET_97_
477R$*			$: $>3 $1
478R$*			$@ $>0 $1
479
480
481######################################
482###   Ruleset 0 -- Parse Address   ###
483######################################
484
485S0
486
487R<@>			$#local $: <>			special case error msgs
488R$*:;<@>		$#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
489
490ifdef(`_MAILER_smtp_',
491`# handle numeric address spec
492ifdef(`_NO_CANONIFY_', `dnl',
493`R$* < @ [ $+ ] > $*	$: $1 < @ $[ [$2] $] > $3	numeric internet addr')
494R$* < @ [ $+ ] > $*	$: $>_SET_98_ $1 < @ [ $2 ] > $3	numeric internet spec
495R$* < @ [ $+ ] > $*	$#smtp $@ [$2] $: $1 @ [$2] $3	still numeric: send',
496	`dnl')
497
498# now delete the local info -- note $=O to find characters that cause forwarding
499R$* < @ > $*		$@ $>_SET_97_ $1			user@ => user
500R< @ $=w . > : $*	$@ $>_SET_97_ $2			@here:... -> ...
501R$* $=O $* < @ $=w . >	$@ $>_SET_97_ $1 $2 $3			...@here -> ...
502ifdef(`MAILER_TABLE',
503`
504# try mailer table lookup
505R$* <@ $+ > $*		$: < $2 > $1 < @ $2 > $3	extract host name
506R< $+ . > $*		$: < $1 > $2			strip trailing dot
507R< $+ > $*		$: < $(mailertable $1 $) > $2	lookup
508R< $- : $+ > $*		$# $1 $@ $2 $: $3		check -- resolved?
509R< $+ > $*		$: $>90 <$1> $2			try domain',
510`dnl')
511
512# short circuit local delivery so forwarded email works
513ifdef(`_LOCAL_NOT_STICKY_',
514`R$=L < @ $=w . >		$#local $: @ $1			special local names
515R$+ < @ $=w . >		$#local $: $1			dispose directly',
516`R$+ < @ $=w . >		$: $1 < @ $2 @ $H >		first try hub
517ifdef(`_OLD_SENDMAIL_',
518`R$+ < $+ @ $-:$+ >	$# $3 $@ $4 $: $1 < $2 >	yep ....
519R$+ < $+ @ $+ >		$#relay $@ $3 $: $1 < $2 >	yep ....
520R$+ < $+ @ >		$#local $: $1			nope, local address',
521`R$+ < $+ @ $+ >		$#local $: $1			yep ....
522R$+ < $+ @ >		$#local $: @ $1			nope, local address')')
523
524# handle local hacks
525R$*			$: $>_SET_98_ $1
526undivert(4)dnl
527
528ifdef(`_NO_UUCP_', `dnl',
529`# resolve remotely connected UUCP links (if any)
530ifdef(`_CLASS_V_',
531`R$* < @ $=V . UUCP > $*		$: < $V > <@ $V> : $1 @ $2.UUCP $3
532R< $- : $+ > $*			$# $1 $@ $2 $: $3	$=V UUCP routing
533R< $+ > $*			$#smtp $@ $1 $: $2
534R<> $*				$: $1			else strip off gunk',
535	`dnl')
536ifdef(`_CLASS_W_',
537`R$* < @ $=W . UUCP > $*		$: < $W > <@ $W> : $1 @ $2.UUCP $3
538R< $- : $+ > $*			$# $1 $@ $2 $: $3	$=W UUCP routing
539R< $+ > $*			$#smtp $@ $1 $: $2
540R<> $*				$: $1			else strip off gunk',
541	`dnl')
542ifdef(`_CLASS_X_',
543`R$* < @ $=X . UUCP > $*		$: < $X > <@ $X> : $1 @ $2.UUCP $3
544R< $- : $+ > $*			$# $1 $@ $2 $: $3	$=X UUCP routing
545R< $+ > $*			$#smtp $@ $1 $: $2
546R<> $*				$: $1			else strip off gunk',
547	`dnl')')
548
549# resolve fake top level domains by forwarding to other hosts
550ifdef(`BITNET_RELAY',
551`R$*<@$+.BITNET>$*	$: < $B > $1 <@$2.BITNET> $3	user@host.BITNET
552R< $- : $+ > $*		$# $1 $@ $2 $: $3
553R< $+ > $*		$#smtp $@ $1 $: $2
554R<> $*			$: $1				else strip off gunk',
555	`dnl')
556ifdef(`CSNET_RELAY',
557`R$*<@$+.CSNET>$*	$: < $C > $1 <@$2.CSNET> $3	user@host.CSNET
558R< $- : $+ > $*		$# $1 $@ $2 $: $3
559R< $+ > $*		$#smtp $@ $1 $: $2
560R<> $*			$: $1				else strip off gunk',
561	`dnl')
562ifdef(`_MAILER_fax_',
563`R$+ < @ $+ .FAX >	$#fax $@ $2 $: $1		user@host.FAX',
564`ifdef(`FAX_RELAY',
565`R$*<@$+.FAX>$*		$: < $F > $1 <@$2.FAX> $3	user@host.FAX
566R< $- : $+ > $*		$# $1 $@ $2 $: $3
567R< $+ > $*		$#smtp $@ $1 $: $2
568R<> $*			$: $1				else strip off gunk',
569	`dnl')')
570
571ifdef(`UUCP_RELAY',
572`# forward non-local UUCP traffic to our UUCP relay
573R$*<@$*.UUCP>$*		$: < $Y > <@ $Y> : $1 @ $2.UUCP $3	uucp mail
574R< $- : $+ > $*		$# $1 $@ $2 $: $3
575R< $+ > $*		$#smtp $@ $1 $: $2
576R<> $*			$: $1				else strip off gunk',
577`ifdef(`_MAILER_uucp_',
578`# forward other UUCP traffic straight to UUCP
579R< @ $+ .UUCP > : $+	$#uucp $@ $1 $: $2		@host.UUCP:...
580R$+ < @ $+ .UUCP >	$#uucp $@ $2 $: $1		user@host.UUCP',
581	`dnl')')
582ifdef(`_MAILER_USENET_', `
583# addresses sent to net.group.USENET will get forwarded to a newsgroup
584R$+ . USENET		$# usenet $: $1',
585	`dnl')
586
587ifdef(`_LOCAL_RULES_',
588`# figure out what should stay in our local mail system
589undivert(1)', `dnl')
590
591ifdef(`SMART_HOST', `
592# pass names that still have a host to a smarthost
593R$* < @ $* > $*		$: < $S > $1 < @ $2 > $3	glue on smarthost name
594R< $- : $+ > $*		$# $1 $@ $2 $: $3		if non-null, use it
595R< $+ > $*		$#suucp $@ $1 $: $2		if non-null, use it
596R<> $*			$: $1				else strip off gunk',
597
598`ifdef(`_LOCAL_RULES_', `
599# reject messages that have host names we do not understand
600R$* < @ $* > $*		$#error $@ NOHOST $: Unrecognized host name $2',
601`ifdef(`_MAILER_smtp_',
602`# deal with other remote names
603R$* < @ $* > $*		$#smtp $@ $2 $: $1 < @ $2 > $3		user@host.domain')')')
604
605ifdef(`_OLD_SENDMAIL_',
606`# forward remaining names to local relay, if any
607R$=L			$#local $: $1			special local names
608R$+			$: $1 < @ $R >			append relay
609R$+ < @ >		$: $1 < @ $H >			no relay, try hub
610R$+ < @ >		$#local $: $1			no relay or hub: local
611R$+ < @ $=w  >		$#local $: $1			we are relay/hub: local
612R$+ < @ $-:$+ >		$# $2 $@ $3 $: $1		deliver to relay/hub
613R$+ < @ $+ >		$#relay $@ $2 $: $1		deliver to relay/hub',
614
615`# if this is quoted, strip the quotes and try again
616R$+			$: $(dequote $1 $)		strip quotes
617R$* $=O $*		$@ $>_SET_97_ $1 $2 $3			try again
618
619# handle locally delivered names
620R$=L			$#local $: @ $1			special local names
621R$+			$#local $: $1			regular local names
622
623###########################################################################
624###   Ruleset 5 -- special rewriting after aliases have been expanded   ###
625###		   (new sendmail only)					###
626###########################################################################
627
628S5
629
630# see if we have a relay or a hub
631R$+			$: $1 < @ $R >
632R$+ < @ >		$: $1 < @ $H >			no relay, try hub
633R$+ < @ $=w >		$@ $1				we are relay/hub: local
634R$+ < @ $-:$+ >		$# $2 $@ $3 $: $1		send to relay or hub
635ifdef(`_MAILER_smtp_',
636`R$+ < @ $+ >		$#relay $@ $2 $: $1		send to relay or hub')')
637ifdef(`MAILER_TABLE',
638`
639
640###################################################################
641###  Ruleset 90 -- try domain part of mailertable entry 	###
642###		   (new sendmail only)				###
643###################################################################
644
645S90
646R<$- . $+ > $*		$: < $(mailertable .$2 $) > $3	lookup
647R<$- : $+ > $*		$# $1 $@ $2 $: $3		check -- resolved?
648R< . $+ > $*		$@ $>90 <$1> $2			no -- strip & try again
649R<$*> $*		$@ $2				no match',
650`dnl')
651
652###################################################################
653###  Ruleset _SET_98_ -- local part of ruleset zero (can be null)	###
654###################################################################
655
656S`'_SET_98_
657undivert(3)dnl
658#
659######################################################################
660######################################################################
661#####
662`#####			MAILER DEFINITIONS'
663#####
664######################################################################
665######################################################################
666undivert(7)dnl
667