# Copyright (c) 1983 Eric P. Allman
# Copyright (c) 1983 Regents of the University of California.
# All rights reserved. The Berkeley software License Agreement
# specifies the terms and conditions for redistribution.
# @(#)cchem.mc 1.2 (Berkeley) 1/3/89
# @(#)proto.mc 1.20 (Berkeley) 1/25/89
# built by phil on Wed Jan 25 11:47:38 PST 1989
# in /usr/src/local/nettables/sendmail.cf/cf on monet.Berkeley.EDU
############################################################
############################################################
##### SENDMAIL CONFIGURATION FILE
############################################################
############################################################
# file containing our internet aliases
#############################
### Setup Information ###
#############################
# Internet relay host -- machines in our domain that are not
# registered with the NIC will be "hidden" behind this relay machine
# with the % kludge, although SMTP delivery will still be performed
# by the sending machine. Someday this will go away.
# Internal ("fake") domains that we use in rewriting
############################################################
############################################################
##### BERKELEY HOSTS REGISTERED WITH THE NIC
############################################################
############################################################
# delimiter (operator) characters
De$j Sendmail $v/$Z ready at $b
# wait up to ten minutes for alias file rebuild
# substitution for space (blank) characters
# (don't) connect to "expensive" mailers
# default delivery mode (deliver in background)
# default messages to old style
# read timeout -- violates protocols
# queue up everything before starting transmission
# default timeout interval
# time zone names (V6 only)
# load average at which we just queue messages
# load average at which we refuse connections
###########################
###########################
#########################
#########################
HReceived: $?sfrom $s $.by $j ($v/$Z)
H?M?Resent-Message-Id: <$t.$i@$j>
H?M?Message-Id: <$t.$i@$j>
###########################
###########################
################################
# Sender Field Pre-rewriting #
################################
#R$*<$*>$* $1$2$3 defocus
###################################
# Recipient Field Pre-rewriting #
###################################
#R$*<$*>$* $1$2$3 defocus
#################################
# Final Output Post-rewriting #
#################################
R@ $@ handle <> error addr
# resolve numeric addresses to name if possible
R$*<@[$+]>$* $:$1<@$[[$2]$]>$3 lookup numeric internet addr
# externalize local domain info
R@$+:@$+:$+ @$1,@$2:$3 <route-addr> canonical
# UUCP must always be presented in old form
R$+@$-.UUCP $2!$1 u@h.UUCP => h!u
# delete duplicate local names
R$+%$=w@$=w $1@$w u%host@host => u@host
R$+%$=w@$=w.$D $1@$w u%host@host => u@host
###########################
# Name Canonicalization #
###########################
# handle "from:<>" special case
R$*<>$* $@@ turn into magic token
# basic textual canonicalization -- note RFC733 heuristic here
R$*<$*<$*<$+>$*>$*>$* $4 3-level <> nesting
R$*<$*<$+>$*>$* $3 2-level <> nesting
R$*<$+>$* $2 basic RFC821/822 parsing
# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
R@$+,$+ @$1:$2 change all "," to ":"
# localize and dispose of route-based addresses
R@$+:$+ $@$>6<@$1>:$2 handle <route-addr>
# more miscellaneous cleanup
R$+ $:$>8$1 host dependent cleanup
R$+:$*;@$+ $@$1:$2;@$3 list syntax
R$+:$*; $@$1:$2; list syntax
R$+@$+ $:$1<@$2> focus on domain
R$+<$+@$+> $1$2<@$3> move gaze right
R$+<@$+> $@$>6$1<@$2> already canonical
# convert old-style addresses to a domain-based address
R$+^$+ $1!$2 convert ^ to !
R$-!$+ $@$>6$2<@$1.UUCP> resolve uucp names
R$+.$-!$+ $@$>6$3<@$1.$2> domain uucps
R$+!$+ $@$>6$2<@$1.UUCP> uucp subdomains
R$+%$+ $:$>9$1%$2 user%host
R$+<@$+> $@$>6$1<@$2> already canonical
R$-.$+ $@$>6$2<@$1> host.user
#################################
# special local conversions #
#################################
R$*<@$=w>$* $:$1<@$w>$3 get into u@$w form
R$*<@$=w.$D>$* $:$1<@$w>$3
R$*<@$=U.UUCP>$* $:$1<@$w>$3
################################
# Change rightmost % to @. #
################################
R$*%$* $1@$2 First make them all @'s.
R$*@$*@$* $1%$2@$3 Undo all but the last.
R$*@$* $@$1<@$2> Put back the brackets.
############################################################
############################################################
##### Local and Program Mailer specification
############################################################
############################################################
Mlocal, P=/bin/mail, F=rlsDFMmn, S=10, R=20, A=mail -d $u
Mprog, P=/bin/sh, F=lsDFMe, S=10, R=20, A=sh -c $u
R@ $n errors to mailer-daemon
############################################################
############################################################
##### Local Domain SMTP Mailer specification
##### Messages processed by this specification are assumed to remain
##### the local domain. Hence, they can refer to hosts that are
##### not registered in the NIC host table.
############################################################
############################################################
Mtcpld, P=[IPC], F=mDFMueXLC, S=17, R=27, A=IPC $h, E=\r\n
# cleanup forwarding a bit
R$*%$*<@$w> $:$>9$1%$2 user%localhost@localdomain
# pass <route-addr>'s through
R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
# map colons to dots everywhere
R$*:$* $1.$2 map colons to dots
# output local host as user@host.domain
R$- $@$1<@$w> user w/o host
R$+<@$w> $@$1<@$w> this host
R$+<@$=w> $@$1<@$w> or an alias
R$+<@$-> $:$1<@$[$2$]> ask nameserver
R$+<@$w> $@$1<@$w> this host
R$+<@$-> $@$1<@$2.$D> if nameserver fails
# if not local, and not a "fake" domain, ask the nameserver
R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
R$+<@[$+]> $@$1<@[$2]> already ok
# output fake domains as user%fake@relay
R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.bitnet
R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
R$+<@$+.UUCP> $@$2!$1<@$w> user@host.UUCP
R$* $:$>3$1 now canonical form
R$*%$*<@$w> $:$>9$1%$2 user%localhost@localdomain
# pass <route-addr>'s through
R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
# map colons to dots everywhere
R$*:$* $1.$2 map colons to dots
# output local host as user@host.domain
R$- $@$1<@$w> user w/o host
R$+<@$w> $@$1<@$w> this host
R$+<@$=w> $@$1<@$w> or an alias
R$+<@$-> $:$1<@$[$2$]> ask nameserver
R$+<@$w> $@$1<@$w> this host
R$+<@$-> $@$1<@$2.$D> if nameserver fails
# if not local, and not a "fake" domain, ask the nameserver
R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
R$+<@[$+]> $@$1<@[$2]> already ok
# output fake domains as user%fake@relay
R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.BITNET
R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
R$+<@$+.UUCP> $@$2!$1 user@host.UUCP
############################################################
############################################################
##### Internet SMTP Mailer specification
##### Messages processed by this specification are assumed to leave
##### the local domain -- hence, they must be canonical according to
##### RFC822 etc. This means that machines not registered with
##### the NIC must be hidden behind our Internet relay.
############################################################
############################################################
Mtcp, P=[IPC], F=mDFMueXLC, S=14, R=24, A=IPC $h, E=\r\n
# pass <route-addr>'s through
R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
# map colons to dots everywhere
R$*:$* $1.$2 map colons to dots
# output local host in user@host.domain syntax
R$- $1<@$w> user w/o host
R$+<@$=w> $:$1<@$w> this host
R$+<@$-> $:$1<@$[$2$]> canonicalize into dom
R$+<@$-> $:$1<@$2.$D> if nameserver fails
R$+<@$=N.$D> $@$1<@$2.$D> nic-reg hosts are ok
R$+<@$*.$D> $@$1%$2.$D<@$A> else -> u%h@gateway
# if not local, and not a "fake" domain, ask the nameserver
R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
R$+<@[$+]> $@$1<@[$2]> already ok
# output internal ("fake") domains as "user%host@relay"
R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.BITNET
R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
R$+<@$+.UUCP> $@$2!$1<@$w> user@host.UUCP
R$* $:$>3$1 now canonical form
# pass <route-addr>'s through
R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr>
# map colons to dots everywhere.....
R$*:$* $1.$2 map colons to dots
# output local host in user@host.domain syntax
R$- $1<@$w> user w/o host
R$+<@$=w> $:$1<@$w> this host
R$+<@$-> $:$1<@$[$2$]> canonicalize into dom
R$+<@$-> $:$1<@$2.$D> if nameserver fails
R$+<@$=N.$D> $@$1<@$2.$D> nic-reg hosts are ok
R$+<@$*.$D> $@$1%$2.$D<@$A> else -> u%h@gateway
# if not local, and not a "fake" domain, ask the nameserver
R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain
R$+<@[$+]> $@$1<@[$2]> already ok
# Hide fake domains behind relays
R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.BITNET
R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET
R$+<@$+.UUCP> $@$2!$1 user@host.UUCP
############################################################
############################################################
##### RULESET ZERO PREAMBLE
##### The beginning of ruleset zero is constant through all
############################################################
############################################################
R$+ $:$>3$1 make canonical
R$*<@[$+]>$* $:$1<@$[[$2]$]>$3 numeric internet addr
R$*<@[$+]>$* $#tcp$@[$2]$:$1@[$2]$3 numeric internet spec
R@ $#error$:Invalid address handle <> form
# canonicalize using the nameserver if not internal domain
R$*<@$*.$~I>$* $:$1<@$[$2.$3$]>$4
R$*<@$->$* $:$1<@$[$2$]>$3
R$*<@$->$* $:$1<@$2.$D>$3 if nameserver fails
# now delete the local info
R<@$w>:$* $@$>0$1 @here:... -> ...
R$*<@$w> $@$>0$1 ...@here -> ...
##################################
# End of ruleset zero preamble #
##################################
###############################################
### Machine dependent part of Rule Zero ###
###############################################
# resolve fake top level domains by forwarding to other hosts
R$*<@$+.BITNET>$* $#tcp$@$B$:$1<@$2.BITNET>$3 user@host.BITNET
R$*<@$+.CSNET>$* $#tcp$@$C$:$1<@$2.CSNET>$3 user@host.CSNET
# forward non-local UUCP traffic to our UUCP relay
R$*<@$*.UUCP>$* $#tcpld$@$R$:$1<@$2.UUCP> uucp mail
# hide behind our internet relay when talking to people in the arpa domain
R$*<@$*.arpa>$* $#tcp$@$2.arpa$:$1<@$2.arpa>$3 user@host.arpa
# but speak domains to them if they speak domains too
R$*<@$*>$* $#tcpld$@$2$:$1<@$2>$3 user@host.domain
# remaining names must be local
R$+ $#local$:$1 everything else