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 # @(#)cc.mc 1.2 (Berkeley) 1/3/89
11 # @(#)proto.mc 1.20 (Berkeley) 1/25/89
13 # built by phil on Wed Jan 25 11:47:29 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
34 #############################
35 ### Setup Information ###
36 #############################
39 ######################
41 ######################
46 # Internet relay host -- machines in our domain that are not
47 # registered with the NIC will be "hidden" behind this relay machine
48 # with the % kludge, although SMTP delivery will still be performed
49 # by the sending machine. Someday this will go away.
61 # my official hostname
70 # Internal ("fake") domains that we use in rewriting
75 ############################################################
76 ############################################################
78 ##### BERKELEY HOSTS REGISTERED WITH THE NIC
80 ############################################################
81 ############################################################
102 ######################
104 ######################
109 ######################
111 ######################
117 # delimiter (operator) characters
119 # format of a total name
122 De$j Sendmail $v/$Z ready at $b
128 # location of alias file
130 # wait up to ten minutes for alias file rebuild
132 # substitution for space (blank) characters
134 # (don't) connect to "expensive" mailers
136 # default delivery mode (deliver in background)
138 # temporary file mode
142 # location of help file
143 OH/usr/lib/sendmail.hf
146 # default network name
148 # default messages to old style
152 # read timeout -- violates protocols
155 OS/usr/lib/sendmail.st
156 # queue up everything before starting transmission
158 # default timeout interval
160 # time zone names (V6 only)
166 # load average at which we just queue messages
168 # load average at which we refuse connections
171 ###########################
172 # Message precedences #
173 ###########################
176 Pspecial-delivery=100
180 #####################
182 #####################
188 #########################
189 # Format of headers #
190 #########################
192 H?P?Return-Path: <$g>
193 HReceived: $?sfrom $s $.by $j ($v/$Z)
202 # H?l?Received-Date: $b
203 H?M?Resent-Message-Id: <$t.$i@$j>
204 H?M?Message-Id: <$t.$i@$j>
208 ###########################
209 ### Rewriting Rules ###
210 ###########################
213 ################################
214 # Sender Field Pre-rewriting #
215 ################################
217 #R$*<$*>$* $1$2$3 defocus
219 ###################################
220 # Recipient Field Pre-rewriting #
221 ###################################
223 #R$*<$*>$* $1$2$3 defocus
227 #################################
228 # Final Output Post-rewriting #
229 #################################
232 R@ $@ handle <> error addr
234 # resolve numeric addresses to name if possible
235 R$*<@[$+]>$* $:$1<@$[[$2]$]>$3 lookup numeric internet addr
237 # externalize local domain info
238 R$*<$+>$* $1$2$3 defocus
239 R@$+:@$+:$+ @$1,@$2:$3 <route-addr> canonical
241 # UUCP must always be presented in old form
242 R$+@$-.UUCP $2!$1 u@h.UUCP => h!u
244 # delete duplicate local names
245 R$+%$=w@$=w $1@$w u%host@host => u@host
246 R$+%$=w@$=w.$D $1@$w u%host@host => u@host
249 ###########################
250 # Name Canonicalization #
251 ###########################
254 # handle "from:<>" special case
255 R$*<>$* $@@ turn into magic token
257 # basic textual canonicalization -- note RFC733 heuristic here
258 R$*<$*<$*<$+>$*>$*>$* $4 3-level <> nesting
259 R$*<$*<$+>$*>$* $3 2-level <> nesting
260 R$*<$+>$* $2 basic RFC821/822 parsing
262 # make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
263 R@$+,$+ @$1:$2 change all "," to ":"
265 # localize and dispose of route-based addresses
266 R@$+:$+ $@$>6<@$1>:$2 handle <route-addr>
268 # more miscellaneous cleanup
269 R$+ $:$>8$1 host dependent cleanup
270 R$+:$*;@$+ $@$1:$2;@$3 list syntax
271 R$+:$*; $@$1:$2; list syntax
272 R$+@$+ $:$1<@$2> focus on domain
273 R$+<$+@$+> $1$2<@$3> move gaze right
274 R$+<@$+> $@$>6$1<@$2> already canonical
276 # convert old-style addresses to a domain-based address
277 R$+^$+ $1!$2 convert ^ to !
278 R$-!$+ $@$>6$2<@$1.UUCP> resolve uucp names
279 R$+.$-!$+ $@$>6$3<@$1.$2> domain uucps
280 R$+!$+ $@$>6$2<@$1.UUCP> uucp subdomains
281 R$+%$+ $:$>9$1%$2 user%host
282 R$+<@$+> $@$>6$1<@$2> already canonical
283 R$-.$+ $@$>6$2<@$1> host.user
286 #################################
287 # special local conversions #
288 #################################
291 R$*<@$=w>$* $:$1<@$w>$3 get into u@$w form
292 R$*<@$=w.$D>$* $:$1<@$w>$3
293 R$*<@$=U.UUCP>$* $:$1<@$w>$3
295 ################################
296 # Change rightmost % to @. #
297 ################################
300 R$*%$* $1@$2 First make them all @'s.
301 R$*@$*@$* $1%$2@$3 Undo all but the last.
302 R$*@$* $@$1<@$2> Put back the brackets.
311 ############################################################
312 ############################################################
314 ##### Local and Program Mailer specification
316 ############################################################
317 ############################################################
319 Mlocal, P=/bin/mail, F=rlsDFMmn, S=10, R=20, A=mail -d $u
320 Mprog, P=/bin/sh, F=lsDFMe, S=10, R=20, A=sh -c $u
323 R@ $n errors to mailer-daemon
326 ############################################################
327 ############################################################
329 ##### Local Domain SMTP Mailer specification
331 ##### Messages processed by this specification are assumed to remain
332 ##### the local domain. Hence, they can refer to hosts that are
333 ##### not registered in the NIC host table.
335 ############################################################
336 ############################################################
338 Mtcpld, P=[IPC], F=mDFMueXLC, S=17, R=27, A=IPC $h, E=\r\n
342 # cleanup forwarding a bit
343 R$*<$*>$* $1$2$3 defocus
344 R$* $:$>3$1 canonicalize
345 R$*%$*<@$w> $:$>9$1%$2 user%localhost@localdomain
347 # pass <route-addr>'s through
348 R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
350 # map colons to dots everywhere
351 R$*:$* $1.$2 map colons to dots
353 # output local host as user@host.domain
354 R$- $@$1<@$w> user w/o host
355 R$+<@$w> $@$1<@$w> this host
356 R$+<@$=w> $@$1<@$w> or an alias
357 R$+<@$-> $:$1<@$[$2$]> ask nameserver
358 R$+<@$w> $@$1<@$w> this host
359 R$+<@$-> $@$1<@$2.$D> if nameserver fails
361 # if not local, and not a "fake" domain, ask the nameserver
362 R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
363 R$+<@[$+]> $@$1<@[$2]> already ok
365 # output fake domains as user%fake@relay
367 R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.bitnet
368 R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
369 R$+<@$+.UUCP> $@$2!$1<@$w> user@host.UUCP
375 R$*<$*>$* $1$2$3 defocus
376 R$* $:$>3$1 now canonical form
377 R$*%$*<@$w> $:$>9$1%$2 user%localhost@localdomain
379 # pass <route-addr>'s through
380 R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
382 # map colons to dots everywhere
383 R$*:$* $1.$2 map colons to dots
385 # output local host as user@host.domain
386 R$- $@$1<@$w> user w/o host
387 R$+<@$w> $@$1<@$w> this host
388 R$+<@$=w> $@$1<@$w> or an alias
389 R$+<@$-> $:$1<@$[$2$]> ask nameserver
390 R$+<@$w> $@$1<@$w> this host
391 R$+<@$-> $@$1<@$2.$D> if nameserver fails
393 # if not local, and not a "fake" domain, ask the nameserver
394 R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
395 R$+<@[$+]> $@$1<@[$2]> already ok
397 # output fake domains as user%fake@relay
399 R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.BITNET
400 R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
401 R$+<@$+.UUCP> $@$2!$1 user@host.UUCP
405 ############################################################
406 ############################################################
408 ##### Internet SMTP Mailer specification
410 ##### Messages processed by this specification are assumed to leave
411 ##### the local domain -- hence, they must be canonical according to
412 ##### RFC822 etc. This means that machines not registered with
413 ##### the NIC must be hidden behind our Internet relay.
415 ############################################################
416 ############################################################
418 Mtcp, P=[IPC], F=mDFMueXLC, S=14, R=24, A=IPC $h, E=\r\n
422 # pass <route-addr>'s through
423 R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
425 # map colons to dots everywhere
426 R$*:$* $1.$2 map colons to dots
428 # output local host in user@host.domain syntax
429 R$- $1<@$w> user w/o host
430 R$+<@$=w> $:$1<@$w> this host
431 R$+<@$-> $:$1<@$[$2$]> canonicalize into dom
432 R$+<@$-> $:$1<@$2.$D> if nameserver fails
433 R$+<@$=N.$D> $@$1<@$2.$D> nic-reg hosts are ok
434 R$+<@$*.$D> $@$1%$2.$D<@$A> else -> u%h@gateway
436 # if not local, and not a "fake" domain, ask the nameserver
437 R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
438 R$+<@[$+]> $@$1<@[$2]> already ok
440 # output internal ("fake") domains as "user%host@relay"
442 R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.BITNET
443 R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
444 R$+<@$+.UUCP> $@$2!$1<@$w> user@host.UUCP
450 R$*<$*>$* $1$2$3 defocus
451 R$* $:$>3$1 now canonical form
453 # pass <route-addr>'s through
454 R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
456 # map colons to dots everywhere.....
457 R$*:$* $1.$2 map colons to dots
459 # output local host in user@host.domain syntax
460 R$- $1<@$w> user w/o host
461 R$+<@$=w> $:$1<@$w> this host
462 R$+<@$-> $:$1<@$[$2$]> canonicalize into dom
463 R$+<@$-> $:$1<@$2.$D> if nameserver fails
464 R$+<@$=N.$D> $@$1<@$2.$D> nic-reg hosts are ok
465 R$+<@$*.$D> $@$1%$2.$D<@$A> else -> u%h@gateway
467 # if not local, and not a "fake" domain, ask the nameserver
468 R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
469 R$+<@[$+]> $@$1<@[$2]> already ok
471 # Hide fake domains behind relays
473 R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.BITNET
474 R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
475 R$+<@$+.UUCP> $@$2!$1 user@host.UUCP
481 #####################
483 #####################
486 ############################################################
487 ############################################################
489 ##### RULESET ZERO PREAMBLE
491 ##### The beginning of ruleset zero is constant through all
492 ##### configurations.
494 ############################################################
495 ############################################################
499 # first make canonical
500 R$*<$*>$* $1$2$3 defocus
501 R$+ $:$>3$1 make canonical
503 # handle special cases
504 R$*<@[$+]>$* $:$1<@$[[$2]$]>$3 numeric internet addr
505 R$*<@[$+]>$* $#tcp$@[$2]$:$1@[$2]$3 numeric internet spec
508 R@ $#error$:Invalid address handle <> form
510 # canonicalize using the nameserver if not internal domain
511 R$*<@$*.$~I>$* $:$1<@$[$2.$3$]>$4
512 R$*<@$->$* $:$1<@$[$2$]>$3
513 R$*<@$->$* $:$1<@$2.$D>$3 if nameserver fails
515 # now delete the local info
516 R<@$w>:$* $@$>0$1 @here:... -> ...
517 R$*<@$w> $@$>0$1 ...@here -> ...
519 ##################################
520 # End of ruleset zero preamble #
521 ##################################
524 ###############################################
525 ### Machine dependent part of Rule Zero ###
526 ###############################################
532 # resolve fake top level domains by forwarding to other hosts
533 R$*<@$+.BITNET>$* $#tcp$@$B$:$1<@$2.BITNET>$3 user@host.BITNET
534 R$*<@$+.CSNET>$* $#tcp$@$C$:$1<@$2.CSNET>$3 user@host.CSNET
537 # forward non-local UUCP traffic to our UUCP relay
538 R$*<@$*.UUCP>$* $#tcpld$@$R$:$1<@$2.UUCP> uucp mail
540 # hide behind our internet relay when talking to people in the arpa domain
541 R$*<@$*.arpa>$* $#tcp$@$2.arpa$:$1<@$2.arpa>$3 user@host.arpa
543 # but speak domains to them if they speak domains too
544 R$*<@$*>$* $#tcpld$@$2$:$1<@$2>$3 user@host.domain
546 # remaining names must be local
547 R$+ $#local$:$1 everything else