document option `w'; fix Pell's name; fix page numbering
[unix-history] / usr / src / usr.sbin / sendmail / cf / m4 / proto.m4
CommitLineData
f25ecb3d
EA
1divert(-1)
2#
3# Copyright (c) 1983 Eric P. Allman
cb1a7064
KB
4# Copyright (c) 1988, 1993
5# The Regents of the University of California. All rights reserved.
f25ecb3d
EA
6#
7# %sccs.include.redist.sh%
8#
9divert(0)
10
d8ebcd49 11VERSIONID(`@(#)proto.m4 8.3 (Berkeley) %G%')
f25ecb3d 12
6f403f33 13MAILER(local)dnl
f25ecb3d 14
576bbd75
EA
15ifdef(`_OLD_SENDMAIL_',
16`define(`_SET_96_', 6)dnl
d8ebcd49
EA
17define(`_SET_97_', 7)dnl
18define(`_SET_98_', 8)dnl',
e46fc989 19`# level 4 config file format
576bbd75
EA
20V4
21define(`_SET_96_', 96)dnl
d8ebcd49
EA
22define(`_SET_97_', 97)dnl
23define(`_SET_98_', 98)dnl')
242270da 24
f25ecb3d
EA
25##################
26# local info #
27##################
28
7df175c3
EA
29CP.
30
dacf3c9f 31Cwlocalhost
5461a68b 32ifdef(`USE_CW_FILE',
dacf3c9f 33`# file containing names of hosts for which we receive email
a719f50c 34CONCAT(`Fw', confCW_FILE)', `dnl')
f25ecb3d
EA
35
36ifdef(`UUCP_RELAY',
37`# UUCP relay host
8038f5d5 38CONCAT(DY, UUCP_RELAY)
7df175c3 39CPUUCP
a151c868 40
f25ecb3d
EA
41')dnl
42ifdef(`BITNET_RELAY',
43`# BITNET relay host
44CONCAT(DB, BITNET_RELAY)
7df175c3 45CPBITNET
a151c868 46
f25ecb3d
EA
47')dnl
48ifdef(`CSNET_RELAY',
49`# CSNET relay host
50CONCAT(DC, CSNET_RELAY)
7df175c3 51CPCSNET
a151c868 52
d2e7dfa9
EA
53')dnl
54ifdef(`FAX_RELAY',
55`# FAX relay host
56CONCAT(DF, FAX_RELAY)
7df175c3 57CPFAX
d2e7dfa9 58
f25ecb3d 59')dnl
97dcbde7
EA
60ifdef(`SMART_HOST',
61`# "Smart" UUCP relay host
62CONCAT(DS, SMART_HOST)
f25ecb3d 63
8d95d628
EA
64')dnl
65ifdef(`MAILER_TABLE',
66`# Mailer table (overriding domains)
67Kmailertable MAILER_TABLE
68
e653dde7
EA
69')dnl
70ifdef(`DOMAIN_TABLE',
71`# Domain table (adding domains)
72Kdomaintable DOMAIN_TABLE
73
97dcbde7 74')dnl
f25ecb3d
EA
75# who I send unqualified names to (null means deliver locally)
76CONCAT(DR, ifdef(`LOCAL_RELAY', LOCAL_RELAY))
77
22bc0471
EA
78# who gets all local email traffic ($R has precedence for unqualified names)
79CONCAT(DH, ifdef(`MAIL_HUB', MAIL_HUB))
80
97dcbde7
EA
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
45eb1b8f
EA
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
3eb5f759 89CLroot
45eb1b8f 90CEroot
3eb5f759
EA
91undivert(5)dnl
92
f25ecb3d 93# operators that cannot be in local usernames (i.e., network indicators)
1429c39b 94CO @ % ifdef(`_NO_UUCP_', `', `!')
f25ecb3d 95
6f403f33
EA
96# a class with just dot (for identifying canonical names)
97C..
98
32014295
EA
99ifdef(`_OLD_SENDMAIL_', `dnl',
100`# dequoting map
101Kdequote dequote')
f25ecb3d 102
9863b6e1
EA
103undivert(6)dnl
104
a151c868
EA
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)
f25ecb3d 120
a151c868
EA
121# format of a total name
122CONCAT(Dq, ifdef(`confFROM_HEADER', confFROM_HEADER,
123 ifdef(`_OLD_SENDMAIL_', `$g$?x ($x)$.', `$?x$x <$g>$|$g$.')))
f25ecb3d 124include(`../m4/version.m4')
a151c868
EA
125
126###############
127# Options #
128###############
129
0b8c3ec1
EA
130# strip message body to 7 bits on input?
131CONCAT(O7, confSEVEN_BIT_INPUT)
a151c868
EA
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
63381843
EA
139# minimum number of free blocks on filesystem
140CONCAT(Ob, confMIN_FREE_BLOCKS)
141
a151c868
EA
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',
3ce008de 159 CONCAT(OE, confERROR_MESSAGE),
a151c868
EA
160 #OE/etc/sendmail.oE)
161
162# error mode
163ifdef(`confERROR_MODE',
3ce008de 164 CONCAT(Oe, confERROR_MODE),
a151c868
EA
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
0b8c3ec1
EA
193# deliver MIME-encapsulated error messages?
194CONCAT(Oj, confMIME_FORMAT_ERRORS)
195
a151c868
EA
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
b28237e4
EA
207# use Errors-To: header?
208CONCAT(Ol, confUSE_ERRORS_TO)
209
a151c868
EA
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
4c230f32
EA
222# SMTP daemon options
223ifdef(`confDAEMON_OPTIONS',
224 CONCAT(OO, confDAEMON_OPTIONS),
225 #OOPort=esmtp)
226
63381843
EA
227# privacy flags
228CONCAT(Op, confPRIVACY_FLAGS)
229
a151c868
EA
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
e46fc989
EA
244ifdef(`confREAD_TIMEOUT',
245 CONCAT(Or, confREAD_TIMEOUT),
246 #Ordatablock=10m)
a151c868
EA
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)
bd00122c 269OU`'ifdef(`confUSERDB_SPEC', `confUSERDB_SPEC')
a151c868 270
4c230f32
EA
271# fallback MX host
272ifdef(`confFALLBACK_MX',
273 CONCAT(OV, confFALLBACK_MX),
274 #OVfall.back.host.net)
275
d8ebcd49
EA
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
a151c868
EA
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
97dcbde7 309Plist=-30
a151c868
EA
310Pbulk=-60
311Pjunk=-100
312
313#####################
314# Trusted users #
315#####################
316
317Troot
318Tdaemon
319Tuucp
320
321#########################
322# Format of headers #
323#########################
324
e0a38185 325H?P?Return-Path: $g
576bbd75 326HReceived: $?sfrom $s $.$?_($_) $.by $j ($v/$Z)$?r with $r$. id $i; $b
a151c868
EA
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>
f25ecb3d
EA
337#\f
338######################################################################
339######################################################################
340#####
341##### REWRITING RULES
342#####
343######################################################################
344######################################################################
345
da9b1c77 346undivert(9)dnl
f25ecb3d
EA
347
348###########################################
349### Rulset 3 -- Name Canonicalization ###
350###########################################
755e2424 351S3
f25ecb3d 352
66fe2d65
EA
353# handle null input and list syntax (translate to <@> special case)
354R$@ $@ <@>
23ae62a0 355R$*:;$* $@ $1 :; <@>
77e96a45 356
f25ecb3d 357# basic textual canonicalization -- note RFC733 heuristic here
ce25e438 358R$*<$*>$*<$*>$* <$2>$3$4$5 strip multiple <> <>
4850f6e1 359R$*<$*<$+>$*>$* <$3>$5 2-level <> nesting
66fe2d65 360R$*<>$* $@ <@> MAIL FROM:<> case
f25ecb3d
EA
361R$*<$+>$* $2 basic RFC821/822 parsing
362
363# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
56ec6f89 364R@ $+ , $+ @ $1 : $2 change all "," to ":"
f25ecb3d
EA
365
366# localize and dispose of route-based addresses
576bbd75 367R@ $+ : $+ $@ $>_SET_96_ < @$1 > : $2 handle <route-addr>
f25ecb3d
EA
368
369# find focus for list syntax
576bbd75 370R $+ : $* ; @ $+ $@ $>_SET_96_ $1 : $2 ; < @ $3 > list syntax
56ec6f89 371R $+ : $* ; $@ $1 : $2; list syntax
f25ecb3d
EA
372
373# find focus for @ syntax addresses
56ec6f89
EA
374R$+ @ $+ $: $1 < @ $2 > focus on domain
375R$+ < $+ @ $+ > $1 $2 < @ $3 > move gaze right
576bbd75 376R$+ < @ $+ > $@ $>_SET_96_ $1 < @ $2 > already canonical
f25ecb3d 377
1429c39b
EA
378ifdef(`_NO_UUCP_', `dnl',
379`# convert old-style addresses to a domain-based address
576bbd75
EA
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')
f25ecb3d
EA
383
384# if we have % signs, take the rightmost one
56ec6f89
EA
385R$* % $* $1 @ $2 First make them all @s.
386R$* @ $* @ $* $1 % $2 @ $3 Undo all but the last.
576bbd75 387R$* @ $* $@ $>_SET_96_ $1 < @ $2 > Insert < > and finish
f25ecb3d
EA
388
389# else we must be a local name
390
391
576bbd75
EA
392################################################
393### Ruleset _SET_96_ -- bottom half of ruleset 3 ###
394################################################
f25ecb3d 395
45eb1b8f 396# At this point, everything should be in a "local_part<@domain>extra" format.
576bbd75 397S`'_SET_96_
f25ecb3d
EA
398
399# handle special cases for local names
89906048
EA
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')
e653dde7
EA
404ifdef(`DOMAIN_TABLE', `
405# look up unqualified domains in the domain table
406R$* < @ $- > $* $: $1 < @ $(domaintable $2 $) > $3',
407`dnl')
dacf3c9f 408undivert(2)dnl
80961747 409
f5ade8ff
EA
410ifdef(`_NO_UUCP_', `dnl',
411`ifdef(`UUCP_RELAY',
1ab66980 412`# pass UUCP addresses straight through
56ec6f89 413R$* < @ $+ . UUCP > $* $@ $1 < @ $2 . UUCP > $3',
1ab66980 414`# if really UUCP, handle it immediately
6f403f33 415ifdef(`_CLASS_U_',
56ec6f89 416`R$* < @ $=U . UUCP > $* $@ $1 < @ $2 . UUCP > $3', `dnl')
6f403f33 417ifdef(`_CLASS_V_',
56ec6f89 418`R$* < @ $=V . UUCP > $* $@ $1 < @ $2 . UUCP > $3', `dnl')
6f403f33 419ifdef(`_CLASS_W_',
56ec6f89 420`R$* < @ $=W . UUCP > $* $@ $1 < @ $2 . UUCP > $3', `dnl')
6f403f33 421ifdef(`_CLASS_X_',
56ec6f89 422`R$* < @ $=X . UUCP > $* $@ $1 < @ $2 . UUCP > $3', `dnl')
6f403f33 423ifdef(`_CLASS_Y_',
56ec6f89 424`R$* < @ $=Y . UUCP > $* $@ $1 < @ $2 . UUCP > $3', `dnl')
80961747
EA
425
426# try UUCP traffic as a local address
56ec6f89 427R$* < @ $+ . UUCP > $* $: $1 < @ $[ $2 $] . UUCP > $3
82960e03 428ifdef(`_OLD_SENDMAIL_',
56ec6f89
EA
429`R$* < @ $+ . $+ . UUCP > $* $@ $1 < @ $2 . $3 . > $4',
430`R$* < @ $+ . . UUCP > $* $@ $1 < @ $2 . > $3')')
f5ade8ff 431')
ad8d5f97
EA
432ifdef(`_NO_CANONIFY_',
433`# make sure local host names appear canonical
434R$* < @ $=w > $* $: $1 < @ $2 . > $3',
f5ade8ff 435`# pass to name server to make hostname canonical
ad8d5f97
EA
436R$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4')
437
dacf3c9f
EA
438undivert(8)dnl
439
6f403f33
EA
440# if this is the local hostname, make sure we treat is as canonical
441R$* < @ $j > $* $: $1 < @ $j . > $2
f25ecb3d 442
f25ecb3d
EA
443
444##################################################
445### Ruleset 4 -- Final Output Post-rewriting ###
446##################################################
447S4
448
66fe2d65 449R$*<@> $@ $1 handle <> and list:;
f25ecb3d
EA
450
451# resolve numeric addresses to name if possible
6f403f33
EA
452R$* < @ [ $+ ] > $* $: $1 < @ $[ [$2] $] > $3 lookup numeric internet addr
453
454# strip trailing dot off possibly canonical name
455R$* < @ $+ . > $* $1 < @ $2 > $3
f25ecb3d
EA
456
457# externalize local domain info
6f403f33
EA
458R$* < $+ > $* $1 $2 $3 defocus
459R@ $+ : @ $+ : $+ @ $1 , @ $2 : $3 <route-addr> canonical
9d6b5c00 460R@ $* $@ @ $1 ... and exit
f25ecb3d 461
1429c39b
EA
462ifdef(`_NO_UUCP_', `dnl',
463`# UUCP must always be presented in old form
464R$+ @ $- . UUCP $2!$1 u@h.UUCP => h!u')
f25ecb3d
EA
465
466# delete duplicate local names
6f403f33 467R$+ % $=w @ $=w $1 @ $j u%host@host => u@host
f25ecb3d
EA
468
469
470
576bbd75
EA
471##############################################################
472### Ruleset _SET_97_ -- recanonicalize and call ruleset zero ###
473### (used for recursive calls) ###
474##############################################################
f25ecb3d 475
576bbd75 476S`'_SET_97_
f25ecb3d
EA
477R$* $: $>3 $1
478R$* $@ $>0 $1
479
480
481######################################
482### Ruleset 0 -- Parse Address ###
483######################################
484
485S0
486
00948e88 487R<@> $#local $: <> special case error msgs
0b8c3ec1 488R$*:;<@> $#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
89d51ef0 489
56ec6f89
EA
490ifdef(`_MAILER_smtp_',
491`# handle numeric address spec
d8ebcd49
EA
492ifdef(`_NO_CANONIFY_',
493`R$* < @ [ $+ ] > $* $: $1 < @ $[ [$2] $] > $3 numeric internet addr',
494 `dnl')
495R$* < @ [ $+ ] > $* $: $>_SET_98_ $1 < @ [ $2 ] > $3 numeric internet spec
496R$* < @ [ $+ ] > $* $#smtp $@ [$2] $: $1 @ [$2] $3 still numeric: send',
497 `dnl')
f25ecb3d 498
5461a68b 499# now delete the local info -- note $=O to find characters that cause forwarding
576bbd75
EA
500R$* < @ > $* $@ $>_SET_97_ $1 user@ => user
501R< @ $=w . > : $* $@ $>_SET_97_ $2 @here:... -> ...
502R$* $=O $* < @ $=w . > $@ $>_SET_97_ $1 $2 $3 ...@here -> ...
8d95d628
EA
503ifdef(`MAILER_TABLE',
504`
505# try mailer table lookup
7d426e19 506R$* < @ $-:$+ > $* $# $2 $@ $3 $: $1 @ $3 $4 found a match',
8d95d628 507`dnl')
f25ecb3d
EA
508
509# short circuit local delivery so forwarded email works
2664707d 510ifdef(`_LOCAL_NOT_STICKY_',
576bbd75
EA
511`R$=L < @ $=w . > $#local $: @ $1 special local names
512R$+ < @ $=w . > $#local $: $1 dispose directly',
513`R$+ < @ $=w . > $: $1 < @ $2 @ $H > first try hub
82960e03 514ifdef(`_OLD_SENDMAIL_',
7d426e19
EA
515`R$+ < $+ @ $-:$+ > $# $3 $@ $4 $: $1 $2 yep ....
516R$+ < $+ @ $+ > $#relay $@ $3 $: $1 $2 yep ....
22bc0471
EA
517R$+ < $+ @ > $#local $: $1 nope, local address',
518`R$+ < $+ @ $+ > $#local $: $1 yep ....
2664707d 519R$+ < $+ @ > $#local $: @ $1 nope, local address')')
d8ebcd49
EA
520
521# handle local hacks
522R$* $: $>_SET_98_ $1
755e2424
EA
523undivert(4)dnl
524
979297f9
EA
525ifdef(`_NO_UUCP_', `dnl',
526`# resolve remotely connected UUCP links (if any)
708a514b 527ifdef(`_CLASS_V_',
7d426e19 528`R$* < @ $=V . UUCP > $* $#smtp $@ $V $: @ $V : $1 @ $2.UUCP $3',
47523c33 529 `dnl')
708a514b 530ifdef(`_CLASS_W_',
7d426e19 531`R$* < @ $=W . UUCP > $* $#smtp $@ $W $: @ $W : $1 @ $2.UUCP $3',
47523c33 532 `dnl')
708a514b 533ifdef(`_CLASS_X_',
7d426e19 534`R$* < @ $=X . UUCP > $* $#smtp $@ $X $: @ $X : $1 @ $2.UUCP $3',
979297f9 535 `dnl')')
755e2424 536
f25ecb3d
EA
537# resolve fake top level domains by forwarding to other hosts
538ifdef(`BITNET_RELAY',
7d426e19 539`R$*<@$+.BITNET>$* $#smtp $@ $B $: $1 @ $2 . BITNET $3 user@host.BITNET',
f25ecb3d
EA
540 `dnl')
541ifdef(`CSNET_RELAY',
7d426e19 542`R$*<@$+.CSNET>$* $#smtp $@ $C $: $1 @ $2 . CSNET $3 user@host.CSNET',
f25ecb3d 543 `dnl')
d2e7dfa9 544ifdef(`_MAILER_fax_',
d8ebcd49 545`R$+ < @ $+ .FAX > $#fax $@ $2 $: $1 user@host.FAX',
d2e7dfa9 546`ifdef(`FAX_RELAY',
7d426e19 547`R$*<@$+.FAX>$* $#smtp $@ $F $: $1 @ $2 . FAX $3 user@host.FAX',
d2e7dfa9 548 `dnl')')
f25ecb3d 549
755e2424
EA
550ifdef(`UUCP_RELAY',
551`# forward non-local UUCP traffic to our UUCP relay
7d426e19 552R$*<@$*.UUCP>$* $#smtp $@ $Y $: @ $Y : $1 @ $2.UUCP $3 uucp mail',
56ec6f89 553`ifdef(`_MAILER_uucp_',
755e2424 554`# forward other UUCP traffic straight to UUCP
d8ebcd49
EA
555R< @ $+ .UUCP > : $+ $#uucp $@ $1 $: $2 @host.UUCP:...
556R$+ < @ $+ .UUCP > $#uucp $@ $2 $: $1 user@host.UUCP',
755e2424
EA
557 `dnl')')
558
e653dde7
EA
559ifdef(`_MAILER_USENET_', `
560# addresses sent to net.group.USENET will get forwarded to a newsgroup
561R$+ . USENET $# usenet $: $1',
562`dnl')
563
97dcbde7
EA
564ifdef(`_LOCAL_RULES_',
565`# figure out what should stay in our local mail system
7d426e19 566R$* < @ $* > $* $#smtp $@ $2 $: $1 @ $2 $3 user@host.domain')')
97dcbde7
EA
567ifdef(`SMART_HOST', `
568# pass names that still have a host to a smarthost
569R$* < @ $* > $* $: < $S > $1 < @ $2 > $3 glue on smarthost name
d8ebcd49
EA
570R< $- : $+ > $* $# $1 $@ $2 $: $3 if non-null, use it
571R< $+ > $* $#suucp $@ $1 $: $2 if non-null, use it
572R<> $* $: $1 else strip off gunk',
e653dde7 573
97dcbde7
EA
574`ifdef(`_LOCAL_RULES_', `
575# reject messages that have host names we do not understand
576R$* < @ $* > $* $#error $@ NOHOST $: Unrecognized host name $2',
e653dde7
EA
577`ifdef(`_MAILER_smtp_',
578`# deal with other remote names
579R$* < @ $* > $* $#smtp $@ $2 $: $1 < @ $2 > $3 user@host.domain')')')
f25ecb3d 580
82960e03 581ifdef(`_OLD_SENDMAIL_',
5461a68b 582`# forward remaining names to local relay, if any
37e8750f
EA
583R$=L $#local $: $1 special local names
584R$+ $: $1 < @ $R > append relay
22bc0471
EA
585R$+ < @ > $: $1 < @ $H > no relay, try hub
586R$+ < @ > $#local $: $1 no relay or hub: local
576bbd75 587R$+ < @ $=w > $#local $: $1 we are relay/hub: local
97dcbde7 588R$+ < @ $-:$+ > $# $2 $@ $3 $: $1 deliver to relay/hub
0d8911b2 589R$+ < @ $+ > $#relay $@ $2 $: $1 deliver to relay/hub',
ccfcf4aa
EA
590
591`# if this is quoted, strip the quotes and try again
592R$+ $: $(dequote $1 $) strip quotes
576bbd75 593R$* $=O $* $@ $>_SET_97_ $1 $2 $3 try again
ccfcf4aa
EA
594
595# handle locally delivered names
37e8750f
EA
596R$=L $#local $: @ $1 special local names
597R$+ $#local $: $1 regular local names
6f403f33 598
56ec6f89
EA
599###########################################################################
600### Ruleset 5 -- special rewriting after aliases have been expanded ###
601### (new sendmail only) ###
602###########################################################################
f25ecb3d 603
6f403f33 604S5
f25ecb3d 605
32014295
EA
606# see if we have a relay or a hub
607R$+ $: $1 < @ $R >
22bc0471 608R$+ < @ > $: $1 < @ $H > no relay, try hub
576bbd75 609R$+ < @ $=w > $@ $1 we are relay/hub: local
97dcbde7 610R$+ < @ $-:$+ > $# $2 $@ $3 $: $1 send to relay or hub
32014295
EA
611ifdef(`_MAILER_smtp_',
612`R$+ < @ $+ > $#relay $@ $2 $: $1 send to relay or hub')')
bc09d8d3
EA
613ifdef(`MAILER_TABLE',
614`
615
d8ebcd49
EA
616###################################################################
617### Ruleset 90 -- try domain part of mailertable entry ###
618### (new sendmail only) ###
619###################################################################
bc09d8d3
EA
620
621S90
b28237e4 622R<$- . $+ > $* $: < $(mailertable .$2 $) > $3 lookup
bc09d8d3 623R<$- : $+ > $* $# $1 $@ $2 $: $3 check -- resolved?
5ee21648 624R< . $+ > $* $@ $>90 <$1> $2 no -- strip & try again
bc09d8d3
EA
625R<$*> $* $@ $2 no match',
626`dnl')
d8ebcd49
EA
627
628###################################################################
629### Ruleset _SET_98_ -- local part of ruleset zero (can be null) ###
630###################################################################
631
632S`'_SET_98_
633undivert(3)dnl
f25ecb3d
EA
634#\f
635######################################################################
636######################################################################
637#####
ec174858 638`##### MAILER DEFINITIONS'
f25ecb3d
EA
639#####
640######################################################################
641######################################################################
f25ecb3d 642undivert(7)dnl