3 # Copyright (c) 1983 Eric P. Allman
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.
10 # @(#)okeeffe.mc 1.3 (Berkeley) 1/3/89
11 # @(#)proto.mc 1.20 (Berkeley) 1/25/89
13 # built by phil on Wed Jan 25 11:47:02 PST 1989
14 # in /usr/src/local/nettables/sendmail.cf/cf on monet.Berkeley.EDU
16 ############################################################
17 ############################################################
19 ##### SENDMAIL CONFIGURATION FILE
21 ############################################################
22 ############################################################
29 # file containing our internet aliases
30 Fw/usr/lib/sendmail.cw
36 # local UUCP connections
44 #############################
45 ### Setup Information ###
46 #############################
49 ######################
51 ######################
56 # Internet relay host -- machines in our domain that are not
57 # registered with the NIC will be "hidden" behind this relay machine
58 # with the % kludge, although SMTP delivery will still be performed
59 # by the sending machine. Someday this will go away.
71 # my official hostname
80 # Internal ("fake") domains that we use in rewriting
85 ############################################################
86 ############################################################
88 ##### BERKELEY HOSTS REGISTERED WITH THE NIC
90 ############################################################
91 ############################################################
112 ######################
114 ######################
119 ######################
121 ######################
127 # delimiter (operator) characters
129 # format of a total name
132 De$j Sendmail $v/$Z ready at $b
138 # location of alias file
140 # wait up to ten minutes for alias file rebuild
142 # substitution for space (blank) characters
144 # (don't) connect to "expensive" mailers
146 # default delivery mode (deliver in background)
148 # temporary file mode
152 # location of help file
153 OH/usr/lib/sendmail.hf
156 # default network name
158 # default messages to old style
162 # read timeout -- violates protocols
165 OS/usr/lib/sendmail.st
166 # queue up everything before starting transmission
168 # default timeout interval
170 # time zone names (V6 only)
176 # load average at which we just queue messages
178 # load average at which we refuse connections
181 ###########################
182 # Message precedences #
183 ###########################
186 Pspecial-delivery=100
190 #####################
192 #####################
198 #########################
199 # Format of headers #
200 #########################
202 H?P?Return-Path: <$g>
203 HReceived: $?sfrom $s $.by $j ($v/$Z)
212 # H?l?Received-Date: $b
213 H?M?Resent-Message-Id: <$t.$i@$j>
214 H?M?Message-Id: <$t.$i@$j>
218 ###########################
219 ### Rewriting Rules ###
220 ###########################
223 ################################
224 # Sender Field Pre-rewriting #
225 ################################
227 #R$*<$*>$* $1$2$3 defocus
229 ###################################
230 # Recipient Field Pre-rewriting #
231 ###################################
233 #R$*<$*>$* $1$2$3 defocus
237 #################################
238 # Final Output Post-rewriting #
239 #################################
242 R@ $@ handle <> error addr
244 # resolve numeric addresses to name if possible
245 R$*<@[$+]>$* $:$1<@$[[$2]$]>$3 lookup numeric internet addr
247 # externalize local domain info
248 R$*<$+>$* $1$2$3 defocus
249 R@$+:@$+:$+ @$1,@$2:$3 <route-addr> canonical
251 # UUCP must always be presented in old form
252 R$+@$-.UUCP $2!$1 u@h.UUCP => h!u
254 # delete duplicate local names
255 R$+%$=w@$=w $1@$w u%host@host => u@host
256 R$+%$=w@$=w.$D $1@$w u%host@host => u@host
259 ###########################
260 # Name Canonicalization #
261 ###########################
264 # handle "from:<>" special case
265 R$*<>$* $@@ turn into magic token
267 # basic textual canonicalization -- note RFC733 heuristic here
268 R$*<$*<$*<$+>$*>$*>$* $4 3-level <> nesting
269 R$*<$*<$+>$*>$* $3 2-level <> nesting
270 R$*<$+>$* $2 basic RFC821/822 parsing
272 # make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
273 R@$+,$+ @$1:$2 change all "," to ":"
275 # localize and dispose of route-based addresses
276 R@$+:$+ $@$>6<@$1>:$2 handle <route-addr>
278 # more miscellaneous cleanup
279 R$+ $:$>8$1 host dependent cleanup
280 R$+:$*;@$+ $@$1:$2;@$3 list syntax
281 R$+:$*; $@$1:$2; list syntax
282 R$+@$+ $:$1<@$2> focus on domain
283 R$+<$+@$+> $1$2<@$3> move gaze right
284 R$+<@$+> $@$>6$1<@$2> already canonical
286 # convert old-style addresses to a domain-based address
287 R$+^$+ $1!$2 convert ^ to !
288 R$-!$+ $@$>6$2<@$1.UUCP> resolve uucp names
289 R$+.$-!$+ $@$>6$3<@$1.$2> domain uucps
290 R$+!$+ $@$>6$2<@$1.UUCP> uucp subdomains
291 R$+%$+ $:$>9$1%$2 user%host
292 R$+<@$+> $@$>6$1<@$2> already canonical
293 R$-.$+ $@$>6$2<@$1> host.user
296 #################################
297 # special local conversions #
298 #################################
301 R$*<@$=w>$* $:$1<@$w>$3 get into u@$w form
302 R$*<@$=w.$D>$* $:$1<@$w>$3
303 R$*<@$=U.UUCP>$* $:$1<@$w>$3
305 ################################
306 # Change rightmost % to @. #
307 ################################
310 R$*%$* $1@$2 First make them all @'s.
311 R$*@$*@$* $1%$2@$3 Undo all but the last.
312 R$*@$* $@$1<@$2> Put back the brackets.
321 ############################################################
322 ############################################################
324 ##### Local and Program Mailer specification
326 ############################################################
327 ############################################################
329 Mlocal, P=/bin/mail, F=rlsDFMmn, S=10, R=20, A=mail -d $u
330 Mprog, P=/bin/sh, F=lsDFMe, S=10, R=20, A=sh -c $u
333 R@ $n errors to mailer-daemon
336 ############################################################
337 ############################################################
339 ##### Local Domain SMTP Mailer specification
341 ##### Messages processed by this specification are assumed to remain
342 ##### the local domain. Hence, they can refer to hosts that are
343 ##### not registered in the NIC host table.
345 ############################################################
346 ############################################################
348 Mtcpld, P=[IPC], F=mDFMueXLC, S=17, R=27, A=IPC $h, E=\r\n
352 # cleanup forwarding a bit
353 R$*<$*>$* $1$2$3 defocus
354 R$* $:$>3$1 canonicalize
355 R$*%$*<@$w> $:$>9$1%$2 user%localhost@localdomain
357 # pass <route-addr>'s through
358 R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
360 # map colons to dots everywhere
361 R$*:$* $1.$2 map colons to dots
363 # output local host as user@host.domain
364 R$- $@$1<@$w> user w/o host
365 R$+<@$w> $@$1<@$w> this host
366 R$+<@$=w> $@$1<@$w> or an alias
367 R$+<@$-> $:$1<@$[$2$]> ask nameserver
368 R$+<@$w> $@$1<@$w> this host
369 R$+<@$-> $@$1<@$2.$D> if nameserver fails
371 # if not local, and not a "fake" domain, ask the nameserver
372 R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
373 R$+<@[$+]> $@$1<@[$2]> already ok
375 # output fake domains as user%fake@relay
377 R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.bitnet
378 R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
379 R$+<@$+.UUCP> $@$2!$1<@$w> user@host.UUCP
385 R$*<$*>$* $1$2$3 defocus
386 R$* $:$>3$1 now canonical form
387 R$*%$*<@$w> $:$>9$1%$2 user%localhost@localdomain
389 # pass <route-addr>'s through
390 R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
392 # map colons to dots everywhere
393 R$*:$* $1.$2 map colons to dots
395 # output local host as user@host.domain
396 R$- $@$1<@$w> user w/o host
397 R$+<@$w> $@$1<@$w> this host
398 R$+<@$=w> $@$1<@$w> or an alias
399 R$+<@$-> $:$1<@$[$2$]> ask nameserver
400 R$+<@$w> $@$1<@$w> this host
401 R$+<@$-> $@$1<@$2.$D> if nameserver fails
403 # if not local, and not a "fake" domain, ask the nameserver
404 R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
405 R$+<@[$+]> $@$1<@[$2]> already ok
407 # output fake domains as user%fake@relay
409 R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.BITNET
410 R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
411 R$+<@$+.UUCP> $@$2!$1 user@host.UUCP
415 ############################################################
416 ############################################################
418 ##### Internet SMTP Mailer specification
420 ##### Messages processed by this specification are assumed to leave
421 ##### the local domain -- hence, they must be canonical according to
422 ##### RFC822 etc. This means that machines not registered with
423 ##### the NIC must be hidden behind our Internet relay.
425 ############################################################
426 ############################################################
428 Mtcp, P=[IPC], F=mDFMueXLC, S=14, R=24, A=IPC $h, E=\r\n
432 # pass <route-addr>'s through
433 R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
435 # map colons to dots everywhere
436 R$*:$* $1.$2 map colons to dots
438 # output local host in user@host.domain syntax
439 R$- $1<@$w> user w/o host
440 R$+<@$=w> $:$1<@$w> this host
441 R$+<@$-> $:$1<@$[$2$]> canonicalize into dom
442 R$+<@$-> $:$1<@$2.$D> if nameserver fails
443 R$+<@$=N.$D> $@$1<@$2.$D> nic-reg hosts are ok
444 R$+<@$*.$D> $@$1%$2.$D<@$A> else -> u%h@gateway
446 # if not local, and not a "fake" domain, ask the nameserver
447 R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
448 R$+<@[$+]> $@$1<@[$2]> already ok
450 # output internal ("fake") domains as "user%host@relay"
452 R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.BITNET
453 R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
454 R$+<@$+.UUCP> $@$2!$1<@$w> user@host.UUCP
460 R$*<$*>$* $1$2$3 defocus
461 R$* $:$>3$1 now canonical form
463 # pass <route-addr>'s through
464 R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
466 # map colons to dots everywhere.....
467 R$*:$* $1.$2 map colons to dots
469 # output local host in user@host.domain syntax
470 R$- $1<@$w> user w/o host
471 R$+<@$=w> $:$1<@$w> this host
472 R$+<@$-> $:$1<@$[$2$]> canonicalize into dom
473 R$+<@$-> $:$1<@$2.$D> if nameserver fails
474 R$+<@$=N.$D> $@$1<@$2.$D> nic-reg hosts are ok
475 R$+<@$*.$D> $@$1%$2.$D<@$A> else -> u%h@gateway
477 # if not local, and not a "fake" domain, ask the nameserver
478 R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
479 R$+<@[$+]> $@$1<@[$2]> already ok
481 # Hide fake domains behind relays
483 R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.BITNET
484 R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
485 R$+<@$+.UUCP> $@$2!$1 user@host.UUCP
489 ############################################################
490 ############################################################
492 ##### UUCP Mailer specification
494 ############################################################
495 ############################################################
498 Muucp, P=/usr/bin/uux, F=DFMhuU, S=13, R=23, M=100000,
499 A=uux - -r -z -a$f -gC $h!rmail ($u)
502 R$+ $:$>5$1 convert to old style
503 R$*<@$=w>$* $1<@$w>$2 resolve abbreviations
504 R$*<@$->$* $1<@$2.$D>$3 resolve abbreviations
505 R$+<@$+> $2!$1 uucpize (no @'s in addr)
506 R$w!$+ $1 strip local name
507 R$+ $:$U!$1 stick on our host name
508 R$=U!$-%$- $:$1!$2@$3.$D ucbvax!user@host.domain
511 R$+ $:$>5$1 convert to old style
512 R$*<@$=w>$* $1<@$w>$2 resolve abbreviations
513 R$*<@$->$* $1<@$2.$D>$3 resolve abbreviations
514 R$+<@$w> $U!$1 a!b@here -> here!a!b
515 R$=U!$+ $2 here!a!b -> a!b
516 # sanity ... should not happen.
517 R$=U.$D!$+ $2 strip local name.domain
520 ############################################################
521 ############################################################
523 ##### Provide Backward Compatibility
525 ############################################################
526 ############################################################
528 #####################################################
529 # General code to convert back to old style names #
530 #####################################################
533 R$+<@$w> $1 strip host
534 R$+<@$-.UUCP> $2!$1 u@host.UUCP => host!u
538 #####################
540 #####################
543 ############################################################
544 ############################################################
546 ##### RULESET ZERO PREAMBLE
548 ##### The beginning of ruleset zero is constant through all
549 ##### configurations.
551 ############################################################
552 ############################################################
556 # first make canonical
557 R$*<$*>$* $1$2$3 defocus
558 R$+ $:$>3$1 make canonical
560 # handle special cases
561 R$*<@[$+]>$* $:$1<@$[[$2]$]>$3 numeric internet addr
562 R$*<@[$+]>$* $#tcp$@[$2]$:$1@[$2]$3 numeric internet spec
565 R@ $#error$:Invalid address handle <> form
567 # canonicalize using the nameserver if not internal domain
568 R$*<@$*.$~I>$* $:$1<@$[$2.$3$]>$4
569 R$*<@$->$* $:$1<@$[$2$]>$3
570 R$*<@$->$* $:$1<@$2.$D>$3 if nameserver fails
572 # now delete the local info
573 R<@$w>:$* $@$>0$1 @here:... -> ...
574 R$*<@$w> $@$>0$1 ...@here -> ...
576 ##################################
577 # End of ruleset zero preamble #
578 ##################################
581 ###############################################
582 ### Machine dependent part of Rule Zero ###
583 ###############################################
587 # resolve local UUCP connections
588 R<@$=V.UUCP>:$+ $#uucp$@$1$:$2 @host.UUCP:...
589 R$+<@$=V.UUCP> $#uucp$@$2$:$1 user@host.UUCP
592 # resolve fake top level domains by forwarding to other hosts
593 R$*<@$+.BITNET>$* $#tcp$@$B$:$1<@$2.BITNET>$3 user@host.BITNET
594 R$*<@$+.CSNET>$* $#tcp$@$C$:$1<@$2.CSNET>$3 user@host.CSNET
597 # forward non-local UUCP traffic to our UUCP relay
598 R$*<@$*.UUCP>$* $#tcpld$@$R$:$1<@$2.UUCP> uucp mail
600 # resolve SMTP traffic
601 R$*<@$*.$D>$* $#tcpld$@$2.$D$:$1<@$2.$D>$3 user@host.ourdomain
602 R$*<@$+>$* $#tcp$@$2$:$1<@$2>$3 user@host.ourdomain
604 # remaining names must be local
605 R$+ $#local$:$1 everything else