1 # Copyright (c) 1983 Eric P. Allman
2 # Copyright (c) 1988 The Regents of the University of California.
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
8 # 1. Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # 2. Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
13 # 3. All advertising materials mentioning features or use of this software
14 # must display the following acknowledgement:
15 # This product includes software developed by the University of
16 # California, Berkeley and its contributors.
17 # 4. Neither the name of the University nor the names of its contributors
18 # may be used to endorse or promote products derived from this software
19 # without specific prior written permission.
21 # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 # @(#)sendmail.cf 5.2 (Berkeley) 4/23/91
36 # built by root on Mon Aug 21 13:47:04 PDT 1989
37 # in /usr/src/local/nettables/sendmail.cf/cf on monet.Berkeley.EDU
39 ############################################################
40 ############################################################
42 ##### SENDMAIL CONFIGURATION FILE
44 ############################################################
45 ############################################################
52 # file containing our internet aliases
59 # local UUCP connections
67 #############################
68 ### Setup Information ###
69 #############################
72 ######################
74 ######################
79 # Internet relay host -- machines in our domain that are not
80 # registered with the NIC will be "hidden" behind this relay machine
81 # with the % kludge, although SMTP delivery will still be performed
82 # by the sending machine. Someday this will go away.
94 # my official hostname
103 # Internal ("fake") domains that we use in rewriting
108 ############################################################
109 ############################################################
111 ##### BERKELEY HOSTS REGISTERED WITH THE NIC
113 ############################################################
114 ############################################################
135 ######################
137 ######################
142 ######################
144 ######################
150 # delimiter (operator) characters
152 # format of a total name
155 De$j Sendmail $v/$Z ready at $b
161 # location of alias file
163 # wait up to ten minutes for alias file rebuild
165 # substitution for space (blank) characters
167 # (don't) connect to "expensive" mailers
169 # default delivery mode (deliver in background)
171 # temporary file mode
175 # location of help file
176 OH/usr/share/misc/sendmail.hf
179 # default network name
181 # default messages to old style
185 # read timeout -- violates protocols
188 OS/var/log/sendmail.st
189 # queue up everything before starting transmission
191 # default timeout interval
193 # time zone names (V6 only)
199 # load average at which we just queue messages
201 # load average at which we refuse connections
204 ###########################
205 # Message precedences #
206 ###########################
209 Pspecial-delivery=100
213 #####################
215 #####################
221 #########################
222 # Format of headers #
223 #########################
225 H?P?Return-Path: <$g>
226 HReceived: $?sfrom $s $.by $j ($v/$Z)
235 # H?l?Received-Date: $b
236 H?M?Resent-Message-Id: <$t.$i@$j>
237 H?M?Message-Id: <$t.$i@$j>
241 ###########################
242 ### Rewriting Rules ###
243 ###########################
246 ################################
247 # Sender Field Pre-rewriting #
248 ################################
250 #R$*<$*>$* $1$2$3 defocus
252 ###################################
253 # Recipient Field Pre-rewriting #
254 ###################################
256 #R$*<$*>$* $1$2$3 defocus
260 #################################
261 # Final Output Post-rewriting #
262 #################################
265 R@ $@ handle <> error addr
267 # resolve numeric addresses to name if possible
268 R$*<@[$+]>$* $:$1<@$[[$2]$]>$3 lookup numeric internet addr
270 # externalize local domain info
271 R$*<$+>$* $1$2$3 defocus
272 R@$+:@$+:$+ @$1,@$2:$3 <route-addr> canonical
274 # UUCP must always be presented in old form
275 R$+@$-.UUCP $2!$1 u@h.UUCP => h!u
277 # delete duplicate local names
278 R$+%$=w@$=w $1@$w u%host@host => u@host
279 R$+%$=w@$=w.$D $1@$w u%host@host => u@host
282 ###########################
283 # Name Canonicalization #
284 ###########################
287 # handle "from:<>" special case
288 R$*<>$* $@@ turn into magic token
290 # basic textual canonicalization -- note RFC733 heuristic here
291 R$*<$*<$*<$+>$*>$*>$* $4 3-level <> nesting
292 R$*<$*<$+>$*>$* $3 2-level <> nesting
293 R$*<$+>$* $2 basic RFC821/822 parsing
295 # make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
296 R@$+,$+ @$1:$2 change all "," to ":"
298 # localize and dispose of route-based addresses
299 R@$+:$+ $@$>6<@$1>:$2 handle <route-addr>
301 # more miscellaneous cleanup
302 R$+ $:$>8$1 host dependent cleanup
303 R$+:$*;@$+ $@$1:$2;@$3 list syntax
304 R$+:$*; $@$1:$2; list syntax
305 R$+@$+ $:$1<@$2> focus on domain
306 R$+<$+@$+> $1$2<@$3> move gaze right
307 R$+<@$+> $@$>6$1<@$2> already canonical
309 # convert old-style addresses to a domain-based address
310 R$+^$+ $1!$2 convert ^ to !
311 R$-!$+ $@$>6$2<@$1.UUCP> resolve uucp names
312 R$+.$-!$+ $@$>6$3<@$1.$2> domain uucps
313 R$+!$+ $@$>6$2<@$1.UUCP> uucp subdomains
314 R$+%$+ $:$>9$1%$2 user%host
315 R$+<@$+> $@$>6$1<@$2> already canonical
316 R$-.$+ $@$>6$2<@$1> host.user
319 #################################
320 # special local conversions #
321 #################################
324 R$*<@$=w>$* $:$1<@$w>$3 get into u@$w form
325 R$*<@$=w.$D>$* $:$1<@$w>$3
326 R$*<@$=U.UUCP>$* $:$1<@$w>$3
329 ################################
330 # Change rightmost % to @. #
331 ################################
334 R$*%$* $1@$2 First make them all @'s.
335 R$*@$*@$* $1%$2@$3 Undo all but the last.
336 R$*@$* $@$1<@$2> Put back the brackets.
345 ############################################################
346 ############################################################
348 ##### Local and Program Mailer specification
350 ############################################################
351 ############################################################
353 Mlocal, P=/usr/libexec/delivermail, F=lsDFMmn, S=10, R=20, A=mail -r $g -d $u
354 Mprog, P=/bin/sh, F=lsDFMe, S=10, R=20, A=sh -c $u
357 R@ $n errors to mailer-daemon
360 ############################################################
361 ############################################################
363 ##### Local Domain SMTP Mailer specification
365 ##### Messages processed by this specification are assumed to remain
366 ##### the local domain. Hence, they can refer to hosts that are
367 ##### not registered in the NIC host table.
369 ############################################################
370 ############################################################
372 Mtcpld, P=[IPC], F=mDFMueXLC, S=17, R=27, A=IPC $h, E=\r\n
376 # cleanup forwarding a bit
377 R$*<$*>$* $1$2$3 defocus
378 R$* $:$>3$1 canonicalize
379 R$*%$*<@$w> $:$>9$1%$2 user%localhost@localdomain
381 # pass <route-addr>'s through
382 R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
384 # map colons to dots everywhere
385 R$*:$* $1.$2 map colons to dots
389 # output local host as user@host.domain
390 R$- $@$1<@$w> user w/o host
391 R$+<@$w> $@$1<@$w> this host
392 R$+<@$=w> $@$1<@$w> or an alias
393 R$+<@$-> $:$1<@$[$2$]> ask nameserver
394 R$+<@$w> $@$1<@$w> this host
395 R$+<@$-> $@$1<@$2.$D> if nameserver fails
397 # if not local, and not a "fake" domain, ask the nameserver
398 R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
399 R$+<@[$+]> $@$1<@[$2]> already ok
401 # output fake domains as user%fake@relay
403 R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.bitnet
404 R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
405 R$+<@$+.UUCP> $@$2!$1<@$w> user@host.UUCP
411 R$*<$*>$* $1$2$3 defocus
412 R$* $:$>3$1 now canonical form
413 R$*%$*<@$w> $:$>9$1%$2 user%localhost@localdomain
415 # pass <route-addr>'s through
416 R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
418 # map colons to dots everywhere
419 R$*:$* $1.$2 map colons to dots
421 # output local host as user@host.domain
422 R$- $@$1<@$w> user w/o host
423 R$+<@$w> $@$1<@$w> this host
424 R$+<@$=w> $@$1<@$w> or an alias
425 R$+<@$-> $:$1<@$[$2$]> ask nameserver
426 R$+<@$w> $@$1<@$w> this host
427 R$+<@$-> $@$1<@$2.$D> if nameserver fails
429 # if not local, and not a "fake" domain, ask the nameserver
430 R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
431 R$+<@[$+]> $@$1<@[$2]> already ok
433 # output fake domains as user%fake@relay
435 R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.BITNET
436 R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
437 R$+<@$+.UUCP> $@$2!$1 user@host.UUCP
441 ############################################################
442 ############################################################
444 ##### Internet SMTP Mailer specification
446 ##### Messages processed by this specification are assumed to leave
447 ##### the local domain -- hence, they must be canonical according to
448 ##### RFC822 etc. This means that machines not registered with
449 ##### the NIC must be hidden behind our Internet relay.
451 ############################################################
452 ############################################################
454 Mtcp, P=[IPC], F=mDFMueXLC, S=14, R=24, A=IPC $h, E=\r\n
458 # pass <route-addr>'s through
459 R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
461 # map colons to dots everywhere
462 R$*:$* $1.$2 map colons to dots
464 # output local host in user@host.domain syntax
465 R$- $1<@$w> user w/o host
466 R$+<@$=w> $:$1<@$w> this host
467 R$+<@$-> $:$1<@$[$2$]> canonicalize into dom
468 R$+<@$-> $:$1<@$2.$D> if nameserver fails
469 R$+<@$=N.$D> $@$1<@$2.$D> nic-reg hosts are ok
470 R$+<@$*.$D> $@$1%$2.$D<@$A> else -> u%h@gateway
472 # if not local, and not a "fake" domain, ask the nameserver
473 R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
474 R$+<@[$+]> $@$1<@[$2]> already ok
476 # output internal ("fake") domains as "user%host@relay"
478 R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.BITNET
479 R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
480 R$+<@$+.UUCP> $@$2!$1<@$w> user@host.UUCP
486 R$*<$*>$* $1$2$3 defocus
487 R$* $:$>3$1 now canonical form
489 # pass <route-addr>'s through
490 R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
492 # map colons to dots everywhere.....
493 R$*:$* $1.$2 map colons to dots
495 # output local host in user@host.domain syntax
496 R$- $1<@$w> user w/o host
497 R$+<@$=w> $:$1<@$w> this host
498 R$+<@$-> $:$1<@$[$2$]> canonicalize into dom
499 R$+<@$-> $:$1<@$2.$D> if nameserver fails
500 R$+<@$=N.$D> $@$1<@$2.$D> nic-reg hosts are ok
501 R$+<@$*.$D> $@$1%$2.$D<@$A> else -> u%h@gateway
503 # if not local, and not a "fake" domain, ask the nameserver
504 R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
505 R$+<@[$+]> $@$1<@[$2]> already ok
507 # Hide fake domains behind relays
509 R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.BITNET
510 R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
511 R$+<@$+.UUCP> $@$2!$1 user@host.UUCP
515 ############################################################
516 ############################################################
518 ##### UUCP Mailer specification
520 ############################################################
521 ############################################################
524 Muucp, P=/usr/bin/uux, F=DFMhuU, S=13, R=23, M=100000,
525 A=uux - -r -z -a$f -gC $h!rmail ($u)
528 R$+ $:$>5$1 convert to old style
529 R$*<@$=w>$* $1<@$w>$2 resolve abbreviations
530 R$*<@$->$* $1<@$2.$D>$3 resolve abbreviations
531 R$+<@$+> $2!$1 uucpize (no @'s in addr)
532 R$w!$+ $1 strip local name
533 R$+ $:$U!$1 stick on our host name
534 R$=U!$-%$- $:$1!$2@$3.$D ucbvax!user@host.domain
537 R$+ $:$>5$1 convert to old style
538 R$*<@$=w>$* $1<@$w>$2 resolve abbreviations
539 R$*<@$->$* $1<@$2.$D>$3 resolve abbreviations
540 R$+<@$w> $U!$1 a!b@here -> here!a!b
541 R$=U!$+ $2 here!a!b -> a!b
542 # sanity ... should not happen.
543 R$=U.$D!$+ $2 strip local name.domain
546 ############################################################
547 ############################################################
549 ##### Provide Backward Compatibility
551 ############################################################
552 ############################################################
554 #####################################################
555 # General code to convert back to old style names #
556 #####################################################
559 R$+<@$w> $1 strip host
560 R$+<@$-.UUCP> $2!$1 u@host.UUCP => host!u
564 #####################
566 #####################
569 ############################################################
570 ############################################################
572 ##### RULESET ZERO PREAMBLE
574 ##### The beginning of ruleset zero is constant through all
575 ##### configurations.
577 ############################################################
578 ############################################################
582 # first make canonical
583 R$*<$*>$* $1$2$3 defocus
584 R$+ $:$>3$1 make canonical
586 # handle special cases
587 R$*<@[$+]>$* $:$1<@$[[$2]$]>$3 numeric internet addr
588 R$*<@[$+]>$* $#tcp$@[$2]$:$1@[$2]$3 numeric internet spec
591 R@ $#error$:Invalid address handle <> form
593 # canonicalize using the nameserver if not internal domain
594 R$*<@$*.$~I>$* $:$1<@$[$2.$3$]>$4
595 R$*<@$->$* $:$1<@$[$2$]>$3
596 R$*<@$->$* $:$1<@$2.$D>$3 if nameserver fails
598 # now delete the local info
599 R<@$w>:$* $@$>0$1 @here:... -> ...
600 R$*<@$w> $@$>0$1 ...@here -> ...
602 ##################################
603 # End of ruleset zero preamble #
604 ##################################
607 ###############################################
608 ### Machine dependent part of Rule Zero ###
609 ###############################################
613 # resolve local UUCP connections
614 R<@$=V.UUCP>:$+ $#uucp$@$1$:$2 @host.UUCP:...
615 R$+<@$=V.UUCP> $#uucp$@$2$:$1 user@host.UUCP
620 # resolve fake top level domains by forwarding to other hosts
621 R$*<@$+.BITNET>$* $#tcp$@$B$:$1<@$2.BITNET>$3 user@host.BITNET
622 R$*<@$+.CSNET>$* $#tcp$@$C$:$1<@$2.CSNET>$3 user@host.CSNET
625 # forward non-local UUCP traffic to our UUCP relay
626 R$*<@$*.UUCP>$* $#tcpld$@$R$:$1<@$2.UUCP> uucp mail
628 # resolve SMTP traffic
629 R$*<@$*.$D>$* $#tcpld$@$2.$D$:$1<@$2.$D>$3 user@host.ourdomain
630 R$*<@$+>$* $#tcp$@$2$:$1<@$2>$3 user@host.ourdomain
632 # remaining names must be local
633 R$+ $#local$:$1 everything else