Add diclaimer of copyright to _osname() manual page.
[unix-history] / usr.sbin / sendmail / cf / cf / tcpproto.cf
CommitLineData
15637ed4
RG
1#
2# Sendmail
3# Copyright (c) 1983 Eric P. Allman
4# Berkeley, California
5#
6# Copyright (c) 1983 Regents of the University of California.
7# All rights reserved. The Berkeley software License Agreement
8# specifies the terms and conditions for redistribution.
9#
10# @(#)tcpproto.mc 1.2 (Berkeley) 1/24/89
11# @(#)proto.mc 1.20 (Berkeley) 1/25/89
12#
13# built by phil on Wed Jan 25 11:48:18 PST 1989
14# in /usr/src/local/nettables/sendmail.cf/cf on monet.Berkeley.EDU
15#
16############################################################
17############################################################
18#####
19##### SENDMAIL CONFIGURATION FILE
20#####
21############################################################
22############################################################
23
24
25##################
26# local info #
27##################
28
29# file containing our internet aliases
30Fw/usr/lib/sendmail.cw
31
32
33
34#############################
35### Setup Information ###
36#############################
37
38
39######################
40# General Macros #
41######################
42
43# local domain name
44DDYOUR_DOMAIN_GOES_HERE
45
46
47
48# UUCP relay host
49DRYOUR_UUCP_RELAY_GOES_HERE
50
51# csnet relay host
52DCYOUR_CSNET_RELAY_GOES_HERE
53
54# bitnet relay host
55DBYOUR_BITNET_RELAY_GOES_HERE
56
57# my official hostname
58Dj$w
59
60
61
62###############
63# Classes #
64###############
65
66# Internal ("fake") domains that we use in rewriting
67CIUUCP BITNET CSNET
68
69
70
71
72######################
73# Version Number #
74######################
75
76DZ1.34
77
78
79######################
80# Special macros #
81######################
82
83# my name
84DnMAILER-DAEMON
85# UNIX header format
86DlFrom $g $d
87# delimiter (operator) characters
88Do.:%@!^=/[]
89# format of a total name
90Dq$g$?x ($x)$.
91# SMTP login message
92De$j Sendmail $v/$Z ready at $b
93
94###############
95# Options #
96###############
97
98# location of alias file
99OA/usr/lib/aliases
100# wait up to ten minutes for alias file rebuild
101Oa10
102# substitution for space (blank) characters
103OB.
104# (don't) connect to "expensive" mailers
105#Oc
106# default delivery mode (deliver in background)
107Odbackground
108# temporary file mode
109OF0600
110# default GID
111Og1
112# location of help file
113OH/usr/lib/sendmail.hf
114# log level
115OL9
116# default network name
117ONARPA
118# default messages to old style
119Oo
120# queue directory
121OQ/usr/spool/mqueue
122# read timeout -- violates protocols
123Or2h
124# status file
125OS/usr/lib/sendmail.st
126# queue up everything before starting transmission
127Os
128# default timeout interval
129OT3d
130# time zone names (V6 only)
131OtPST,PDT
132# default UID
133Ou1
134# wizard's password
135OW*
136# load average at which we just queue messages
137Ox8
138# load average at which we refuse connections
139OX12
140
141###########################
142# Message precedences #
143###########################
144
145Pfirst-class=0
146Pspecial-delivery=100
147Pbulk=-60
148Pjunk=-100
149
150#####################
151# Trusted users #
152#####################
153
154Troot
155Tdaemon
156Tuucp
157
158#########################
159# Format of headers #
160#########################
161
162H?P?Return-Path: <$g>
163HReceived: $?sfrom $s $.by $j ($v/$Z)
164 id $i; $b
165H?D?Resent-Date: $a
166H?D?Date: $a
167H?F?Resent-From: $q
168H?F?From: $q
169H?x?Full-Name: $x
170HSubject:
171# HPosted-Date: $a
172# H?l?Received-Date: $b
173H?M?Resent-Message-Id: <$t.$i@$j>
174H?M?Message-Id: <$t.$i@$j>
175
176
177
178###########################
179### Rewriting Rules ###
180###########################
181
182
183################################
184# Sender Field Pre-rewriting #
185################################
186S1
187#R$*<$*>$* $1$2$3 defocus
188
189###################################
190# Recipient Field Pre-rewriting #
191###################################
192S2
193#R$*<$*>$* $1$2$3 defocus
194
195
196
197#################################
198# Final Output Post-rewriting #
199#################################
200S4
201
202R@ $@ handle <> error addr
203
204# resolve numeric addresses to name if possible
205R$*<@[$+]>$* $:$1<@$[[$2]$]>$3 lookup numeric internet addr
206
207# externalize local domain info
208R$*<$+>$* $1$2$3 defocus
209R@$+:@$+:$+ @$1,@$2:$3 <route-addr> canonical
210
211# UUCP must always be presented in old form
212R$+@$-.UUCP $2!$1 u@h.UUCP => h!u
213
214# delete duplicate local names
215R$+%$=w@$=w $1@$w u%host@host => u@host
216R$+%$=w@$=w.$D $1@$w u%host@host => u@host
217
218
219###########################
220# Name Canonicalization #
221###########################
222S3
223
224# handle "from:<>" special case
225R$*<>$* $@@ turn into magic token
226
227# basic textual canonicalization -- note RFC733 heuristic here
228R$*<$*<$*<$+>$*>$*>$* $4 3-level <> nesting
229R$*<$*<$+>$*>$* $3 2-level <> nesting
230R$*<$+>$* $2 basic RFC821/822 parsing
231
232# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
233R@$+,$+ @$1:$2 change all "," to ":"
234
235# localize and dispose of route-based addresses
236R@$+:$+ $@$>6<@$1>:$2 handle <route-addr>
237
238# more miscellaneous cleanup
239R$+ $:$>8$1 host dependent cleanup
240R$+:$*;@$+ $@$1:$2;@$3 list syntax
241R$+:$*; $@$1:$2; list syntax
242R$+@$+ $:$1<@$2> focus on domain
243R$+<$+@$+> $1$2<@$3> move gaze right
244R$+<@$+> $@$>6$1<@$2> already canonical
245
246# convert old-style addresses to a domain-based address
247R$+^$+ $1!$2 convert ^ to !
248R$-!$+ $@$>6$2<@$1.UUCP> resolve uucp names
249R$+.$-!$+ $@$>6$3<@$1.$2> domain uucps
250R$+!$+ $@$>6$2<@$1.UUCP> uucp subdomains
251R$+%$+ $:$>9$1%$2 user%host
252R$+<@$+> $@$>6$1<@$2> already canonical
253R$-.$+ $@$>6$2<@$1> host.user
254
255
256#################################
257# special local conversions #
258#################################
259
260S6
261R$*<@$=w>$* $:$1<@$w>$3 get into u@$w form
262R$*<@$=w.$D>$* $:$1<@$w>$3
263R$*<@$=U.UUCP>$* $:$1<@$w>$3
264
265################################
266# Change rightmost % to @. #
267################################
268
269S9
270R$*%$* $1@$2 First make them all @'s.
271R$*@$*@$* $1%$2@$3 Undo all but the last.
272R$*@$* $@$1<@$2> Put back the brackets.
273
274
275
276###################
277### Mailers ###
278###################
279
280
281############################################################
282############################################################
283#####
284##### Local and Program Mailer specification
285#####
286############################################################
287############################################################
288
289Mlocal, P=/bin/mail, F=rlsDFMmn, S=10, R=20, A=mail -d $u
290Mprog, P=/bin/sh, F=lsDFMe, S=10, R=20, A=sh -c $u
291
292S10
293R@ $n errors to mailer-daemon
294
295
296############################################################
297############################################################
298#####
299##### Local Domain SMTP Mailer specification
300#####
301##### Messages processed by this specification are assumed to remain
302##### the local domain. Hence, they can refer to hosts that are
303##### not registered in the NIC host table.
304#####
305############################################################
306############################################################
307
308Mtcpld, P=[IPC], F=mDFMueXLC, S=17, R=27, A=IPC $h, E=\r\n
309
310S17
311
312# cleanup forwarding a bit
313R$*<$*>$* $1$2$3 defocus
314R$* $:$>3$1 canonicalize
315R$*%$*<@$w> $:$>9$1%$2 user%localhost@localdomain
316
317# pass <route-addr>'s through
318R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
319
320# map colons to dots everywhere
321R$*:$* $1.$2 map colons to dots
322
323# output local host as user@host.domain
324R$- $@$1<@$w> user w/o host
325R$+<@$w> $@$1<@$w> this host
326R$+<@$=w> $@$1<@$w> or an alias
327R$+<@$-> $:$1<@$[$2$]> ask nameserver
328R$+<@$w> $@$1<@$w> this host
329R$+<@$-> $@$1<@$2.$D> if nameserver fails
330
331# if not local, and not a "fake" domain, ask the nameserver
332R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
333R$+<@[$+]> $@$1<@[$2]> already ok
334
335# output fake domains as user%fake@relay
336
337R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.bitnet
338R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
339R$+<@$+.UUCP> $@$2!$1<@$w> user@host.UUCP
340
341
342S27
343
344# cleanup
345R$*<$*>$* $1$2$3 defocus
346R$* $:$>3$1 now canonical form
347R$*%$*<@$w> $:$>9$1%$2 user%localhost@localdomain
348
349# pass <route-addr>'s through
350R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
351
352# map colons to dots everywhere
353R$*:$* $1.$2 map colons to dots
354
355# output local host as user@host.domain
356R$- $@$1<@$w> user w/o host
357R$+<@$w> $@$1<@$w> this host
358R$+<@$=w> $@$1<@$w> or an alias
359R$+<@$-> $:$1<@$[$2$]> ask nameserver
360R$+<@$w> $@$1<@$w> this host
361R$+<@$-> $@$1<@$2.$D> if nameserver fails
362
363# if not local, and not a "fake" domain, ask the nameserver
364R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
365R$+<@[$+]> $@$1<@[$2]> already ok
366
367# output fake domains as user%fake@relay
368
369R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.BITNET
370R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
371R$+<@$+.UUCP> $@$2!$1 user@host.UUCP
372
373
374
375############################################################
376############################################################
377#####
378##### Internet SMTP Mailer specification
379#####
380##### Messages processed by this specification are assumed to leave
381##### the local domain -- hence, they must be canonical according to
382##### RFC822 etc. This means that machines not registered with
383##### the NIC must be hidden behind our Internet relay.
384#####
385############################################################
386############################################################
387
388Mtcp, P=[IPC], F=mDFMueXLC, S=14, R=24, A=IPC $h, E=\r\n
389
390S14
391
392# pass <route-addr>'s through
393R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
394
395# map colons to dots everywhere
396R$*:$* $1.$2 map colons to dots
397
398# output local host in user@host.domain syntax
399R$- $1<@$w> user w/o host
400R$+<@$=w> $:$1<@$w> this host
401R$+<@$-> $:$1<@$[$2$]> canonicalize into dom
402R$+<@$-> $:$1<@$2.$D> if nameserver fails
403R$+<@$=N.$D> $@$1<@$2.$D> nic-reg hosts are ok
404R$+<@$*.$D> $@$1%$2.$D<@$A> else -> u%h@gateway
405
406# if not local, and not a "fake" domain, ask the nameserver
407R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
408R$+<@[$+]> $@$1<@[$2]> already ok
409
410# output internal ("fake") domains as "user%host@relay"
411
412R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.BITNET
413R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
414R$+<@$+.UUCP> $@$2!$1<@$w> user@host.UUCP
415
416
417S24
418
419# put in <> kludge
420R$*<$*>$* $1$2$3 defocus
421R$* $:$>3$1 now canonical form
422
423# pass <route-addr>'s through
424R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
425
426# map colons to dots everywhere.....
427R$*:$* $1.$2 map colons to dots
428
429# output local host in user@host.domain syntax
430R$- $1<@$w> user w/o host
431R$+<@$=w> $:$1<@$w> this host
432R$+<@$-> $:$1<@$[$2$]> canonicalize into dom
433R$+<@$-> $:$1<@$2.$D> if nameserver fails
434R$+<@$=N.$D> $@$1<@$2.$D> nic-reg hosts are ok
435R$+<@$*.$D> $@$1%$2.$D<@$A> else -> u%h@gateway
436
437# if not local, and not a "fake" domain, ask the nameserver
438R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
439R$+<@[$+]> $@$1<@[$2]> already ok
440
441# Hide fake domains behind relays
442
443R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.BITNET
444R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
445R$+<@$+.UUCP> $@$2!$1 user@host.UUCP
446
447
448
449
450
451#####################
452### Rule Zero ###
453#####################
454
455
456############################################################
457############################################################
458#####
459##### RULESET ZERO PREAMBLE
460#####
461##### The beginning of ruleset zero is constant through all
462##### configurations.
463#####
464############################################################
465############################################################
466
467S0
468
469# first make canonical
470R$*<$*>$* $1$2$3 defocus
471R$+ $:$>3$1 make canonical
472
473# handle special cases
474R$*<@[$+]>$* $:$1<@$[[$2]$]>$3 numeric internet addr
475R$*<@[$+]>$* $#tcp$@[$2]$:$1@[$2]$3 numeric internet spec
476R$+ $:$>6$1
477R$-<@$w> $#local$:$1
478R@ $#error$:Invalid address handle <> form
479
480# canonicalize using the nameserver if not internal domain
481R$*<@$*.$~I>$* $:$1<@$[$2.$3$]>$4
482R$*<@$->$* $:$1<@$[$2$]>$3
483R$*<@$->$* $:$1<@$2.$D>$3 if nameserver fails
484
485# now delete the local info
486R<@$w>:$* $@$>0$1 @here:... -> ...
487R$*<@$w> $@$>0$1 ...@here -> ...
488
489##################################
490# End of ruleset zero preamble #
491##################################
492
493
494###############################################
495### Machine dependent part of Rule Zero ###
496###############################################
497
498
499
500
501
502# resolve fake top level domains by forwarding to other hosts
503R$*<@$+.BITNET>$* $#tcp$@$B$:$1<@$2.BITNET>$3 user@host.BITNET
504R$*<@$+.CSNET>$* $#tcp$@$C$:$1<@$2.CSNET>$3 user@host.CSNET
505
506
507# forward non-local UUCP traffic to our UUCP relay
508R$*<@$*.UUCP>$* $#tcpld$@$R$:$1<@$2.UUCP> uucp mail
509
510# hide behind our internet relay when talking to people in the arpa domain
511R$*<@$*.arpa>$* $#tcp$@$2.arpa$:$1<@$2.arpa>$3 user@host.arpa
512
513# but speak domains to them if they speak domains too
514R$*<@$*>$* $#tcpld$@$2$:$1<@$2>$3 user@host.domain
515
516# remaining names must be local
517R$+ $#local$:$1 everything else