home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 4.0 PR1 / NeXT_NEXTSTEP_4.0_PR1_(beta).rar / Openstep4-Pr1User.iso / private / etc / sendmail / sendmail.mailhost.cf < prev    next >
Text File  |  1995-09-02  |  10KB  |  356 lines

  1. ############################################################
  2. #
  3. #    Sendmail configuration file for "MAIN MACHINES"
  4. #
  5. #    You should install this file as /etc/sendmail/sendmail.cf
  6. #    if your machine is the main (or only) mail-relaying
  7. #    machine in your domain.  Then edit the file to
  8. #    customize it for your network configuration.
  9. #
  10. #    See the paper "Sendmail Installation and Administration Guide"
  11. #    for more information on the format of this file.
  12. #
  13. #    @(#)main.mc 1.0 88/10/26 NeXT; from SMI 3.2/4.3 NFSSRC
  14. #
  15.  
  16. ###    local info
  17.  
  18.  
  19. # my fully qualified hostname, $j, is now set by sendmail internally
  20. #Dj$?m$w.$m$|$w$.
  21. # if you want the gateway to assume the identity of its parent domain, use:
  22. #Dj$m
  23.  
  24. # Major relay mailer - typical choice is "ddn" if you are on the
  25. # Defense Data Network (e.g. Arpanet or Milnet).  All mail for
  26. # non-local domains will be forwarded to the major relay host using
  27. # the major relay mailer.  We chose "uucp" as the default because most
  28. # isolated networks use it to link their network with the outside
  29. # world.
  30. #
  31. # If you want to use a relay mailer, examine ruleset 0.  There are some
  32. # rules that need to be uncommented
  33. DMuucp
  34.  
  35. # major relay host: use the $M mailer to send mail to other domains
  36. # To have mail automatically forwarded to other domains, you should
  37. # replace this with the name of your major relay host.
  38. DR mail-relay
  39. CR mail-relay
  40.  
  41. # local UUCP connections - output from the uuname command
  42. FV|/usr/bin/uuname
  43.  
  44. # options that you probably want on a mailhost:
  45.  
  46. # checkpoint the queue after this many receipients
  47. OC10
  48.  
  49. # refuse to send tiny messages to more than these recipients
  50. Ob10
  51.  
  52. ############################################################
  53. #####
  54. #####        General configuration information
  55. #####
  56.  
  57. # local domain name
  58. #
  59. # This is now set from the resolver configuration call.  If the domain
  60. # name you would like to have appear in your mail headers is different
  61. # from your Internet domain name, edit and uncomment the following to
  62. # be your mail domain name.
  63. # DmPodunk.EDU
  64.  
  65. # Version number of configuration file
  66. DVNX3.0M
  67.  
  68.  
  69. ###   Standard macros
  70.  
  71. # name used for error messages
  72. DnMailer-Agent
  73. # UNIX header format
  74. DlFrom $g  $d
  75. # delimiter (operator) characters
  76. Do.:%@!^=/[]
  77. # format of a total name
  78. Dq$?x$x $.<$g>
  79. # SMTP login message
  80. De$j Sendmail $v/$V ready at $b
  81.  
  82. ###   Options
  83.  
  84. # Remote mode - send through server if mailbox directory is mounted
  85. OR
  86. # location of alias file
  87. OA/etc/sendmail/aliases
  88. # default delivery mode (deliver in background)
  89. Odbackground
  90. # rebuild the alias file automagically
  91. OD
  92. # temporary file mode -- 0600 for secure mail, 0644 for permissive
  93. OF0600
  94. # default GID
  95. Og1
  96. # location of help file
  97. OH/usr/lib/sendmail.hf
  98. # log level
  99. OL9
  100. # default messages to old style
  101. Oo
  102. # To Cc postmaster on error replies I generate, uncomment the next line
  103. # OPPostmaster
  104. # queue directory
  105. OQ/usr/spool/mqueue
  106. # read timeout for SMTP protocols
  107. Or15m
  108. # status file -- none
  109. # OS/etc/sendmail/sendmail.st
  110. # queue up everything before starting transmission, for safety
  111. Os
  112. # return queued mail after this long
  113. OT3d
  114. # default UID
  115. Ou1
  116.  
  117. ###   Message precedences
  118. Pfirst-class=0
  119. Pspecial-delivery=100
  120. Pjunk=-100
  121.  
  122. ###   Trusted users
  123. Troot agent daemon uucp
  124.  
  125. ###   Format of headers 
  126. H?P?Return-Path: <$g>
  127. HReceived: $?sfrom $s $.by $j ($v/$V)
  128.     id $i; $b
  129. H?D?Resent-Date: $a
  130. H?D?Date: $a
  131. H?F?Resent-From: $q
  132. H?F?From: $q
  133. H?x?Full-Name: $x
  134. HSubject:
  135. H?M?Resent-Message-Id: <$t.$i@$j>
  136. H?M?Message-Id: <$t.$i@$j>
  137. HErrors-To:
  138.  
  139. ###########################
  140. ###   Rewriting rules   ###
  141. ###########################
  142.  
  143.  
  144. #  Sender Field Pre-rewriting
  145. S1
  146. # None needed.
  147.  
  148. #  Recipient Field Pre-rewriting
  149. S2
  150. # None needed.
  151.  
  152. # Name Canonicalization
  153.  
  154. # Internal format of names within the rewriting rules is:
  155. #     anything<@host.domain.domain...>anything
  156. # We try to get every kind of name into this format, except for local
  157. # names, which have no host part.  The reason for the "<>" stuff is
  158. # that the relevant host name could be on the front of the name (for
  159. # source routing), or on the back (normal form).  We enclose the one that
  160. # we want to route on in the <>'s to make it easy to find.
  161. S3
  162.  
  163. # handle "from:<>" special case
  164. R<>            $@@                turn into magic token
  165.  
  166. # basic textual canonicalization
  167. R$*<$+>$*        $2                basic RFC822 parsing
  168.  
  169. # make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
  170. R@$+,$+:$+        @$1:$2:$3            change all "," to ":"
  171. R@$+:$+            $@$>6<@$1>:$2            src route canonical
  172.  
  173. R$+:$*;@$+        $@$1:$2;@$3            list syntax
  174. R$+@$+            $:$1<@$2>            focus on domain
  175. R$+<$+@$+>        $1$2<@$3>            move gaze right
  176. R$+<@$+>        $@$>6$1<@$2>            already canonical
  177.  
  178. # convert old-style names to domain-based names
  179. # All old-style names parse from left to right, without precedence.
  180. R$-!$+            $@$>6$2<@$1.uucp>        uucphost!user
  181. R$-.$+!$+        $@$>6$3<@$1.$2>            host.domain!user
  182. R$+%$+            $:$1%%$2            user%host
  183. R$+%%$+%$+        $1%$2%%$3            move gaze right
  184. R$+%%$+            $@$>3$1@$2            re-canonicalize
  185.  
  186. #  Final Output Post-rewriting 
  187. S4
  188. R$+<@$+.uucp>        $2!$1                u@h.uucp => h!u
  189. R$+            $: $>9 $1            Clean up addr
  190. R$*<$+>$*        $1$2$3                defocus
  191.  
  192.  
  193. #  Clean up an name for passing to a mailer
  194. #  (but leave it focused)
  195. S9
  196. R@            $@$n                handle <> error addr
  197. R$*<$*LOCAL>$*        $1<$2$m>$3            change local info
  198. R<@$+>$*:$+:$+        <@$1>$2,$3:$4            <route-addr> canonical
  199.  
  200.  
  201. #############################################################
  202. #####
  203. #####        Rewriting rules
  204. #####
  205.  
  206. # special local conversions
  207. S6
  208. R$*<@$*.uucp>$*        $@$1<@$2.uucp>$3        no change to UUCP hosts
  209. R$*<@$+>$*        $:$1<@$[$2$]>$3            find canonical hostname
  210. R$*<@$*$=m>$*        $1<@$2LOCAL>$4            convert local domain
  211.  
  212. ############################################################
  213. #####
  214. #####        Local and Program Mailer specification
  215. #####
  216. Mlocal,    P=/bin/mail, F=rlsDFMnuP, S=10, R=20, A=mail -d $u
  217. Mprog,    P=/bin/sh,   F=lsDFMeuP,  S=10, R=20, A=sh -c $u
  218.  
  219. S10
  220. # None needed.
  221.  
  222. S20
  223. # None needed.
  224.  
  225. ############################################################
  226. #####
  227. #####        Ethernet Mailer specification
  228. #####
  229. #####    Messages processed by this configuration are assumed to remain
  230. #####    in the same domain.  This really has nothing particular to do
  231. #####   with Ethernet - the name is historical.
  232.  
  233. Mether,    P=[TCP], F=mDFMuX, S=11, R=21, A=TCP $h
  234. S11
  235. R$*<@$+>$*        $@$1<@$2>$3            already ok
  236. R$+            $@$1<@$w>            tack on our hostname
  237.  
  238. S21
  239. # None needed.
  240.  
  241.  
  242.  
  243. ############################################################
  244. #####
  245. #####    General code to convert back to old style UUCP names
  246. #####
  247. S5
  248. R$+<@LOCAL>        $@ $w!$1            name@LOCAL => host!name
  249. R$+<@$-.LOCAL>        $@ $2!$1            u@h.LOCAL => h!u
  250. R$+<@$+.uucp>        $@ $2!$1            u@h.uucp => h!u
  251. R$+<@$*>        $@ $2!$1            u@h => h!u
  252. # Route-addrs do not work here.  Punt til uucp-mail comes up with something.
  253. R<@$+>$*        $@ @$1$2            just defocus and punt
  254. R$*<$*>$*        $@ $1$2$3            Defocus strange stuff
  255.  
  256. ############################################################
  257. #####
  258. #####        UUCP Mailer specification
  259. #####
  260. Muucp,    P=/usr/bin/uux, F=mDFMhuU, S=13, R=23, E=\n,
  261.     A=uux - -r $h!rmail ($u)
  262.  
  263. # Convert uucp sender (From) field
  264. S13
  265. R$+            $:$>5$1                convert to old style
  266. R$=w!$+            $2                strip local name
  267. R$+            $:$w!$1                stick on real host name
  268.  
  269. # Convert uucp recipient (To, Cc) fields
  270. S23
  271. R$+            $:$>5$1                convert to old style
  272.  
  273.  
  274. ############################################################
  275. #####
  276. #####        DDN Mailer specification
  277. #####
  278. #####    Send mail on the Defense Data Network
  279. #####       (such as Arpanet or Milnet)
  280.  
  281. Mddn,    P=[TCP], F=mDFMuCX, S=22, R=22, A=TCP $h, E=\r\n
  282.  
  283. # map containing the inverse of mail.aliases
  284. DZmail.byaddr
  285.  
  286. S22
  287. R$*<@LOCAL>$*        $:$1
  288. R$-<@$->        $:$>3${Z$1@$2$}            invert aliases
  289. R$*<@$+.$*>$*        $@$1<@$2.$3>$4            already ok
  290. R$+<@$+>$*        $@$1<@$2.$m>$3            tack on our domain
  291. R$+            $@$1<@$j>            tack on our hostname
  292.  
  293.  
  294. ############################################################
  295. #
  296. #        RULESET ZERO
  297. #
  298. #    This is the ruleset that determines which mailer a name goes to.
  299.  
  300. # Ruleset 30 just calls rulesets 3 then 0.
  301. S30
  302. R$*            $: $>3 $1            First canonicalize
  303. R$*            $@ $>0 $1            Then rerun ruleset 0
  304.  
  305. S0
  306. # On entry, the address has been canonicalized and focused by ruleset 3.
  307. # Handle special cases.....
  308. R@            $#local $:$n            handle <> form
  309. # For numeric spec, you can't pass spec on to receiver, since rcvr's
  310. # are not smart enough to know that [x.y.z.a] is their own name.
  311. R<@[$+]>:$*        $:$>9 <@[$1]>:$2        Clean it up, then...
  312. R<@[$+]>:$*        $#ether $@[$1] $:$2        numeric internet spec
  313. R<@[$+]>,$*        $#ether $@[$1] $:$2        numeric internet spec
  314. R$*<@[$+]>        $#ether $@[$2] $:$1        numeric internet spec
  315.  
  316. # resolve the local hostname to "LOCAL".
  317. R$*<$*$=w.LOCAL>$*    $1<$2LOCAL>$4            thishost.LOCAL
  318. R$*<$*$=w.uucp>$*    $1<$2LOCAL>$4            thishost.uucp
  319. R$*<$*$=w>$*        $1<$2LOCAL>$4            thishost
  320.  
  321. # Mail addressed explicitly to the domain gateway (us)
  322. R$*<@LOCAL>        $@$>30$1            strip our name, retry
  323. R<@LOCAL>:$+        $@$>30$1            retry after route strip
  324.  
  325. # deliver to known ethernet hosts explicitly specified in our domain
  326. R$*<@$+.LOCAL>$*    $#ether $@$2 $:$1<@$2>$3    user@host.ourdomain
  327. # hosts in no domains are assumed to be local
  328. R$*<@$->$*        $#ether $@$2 $:$1<@$2>$3    user@host
  329.  
  330. # Clean up addresses for external use -- kills LOCAL, route-addr ,=>: 
  331. R$*            $:$>9 $1            Then continue...
  332.  
  333. # resolve UUCP domain
  334. R<@$=V.uucp>:$+        $#uucp  $@$1 $:$2        @host.uucp:...
  335. R$+<@$=V.uucp>        $#uucp  $@$2 $:$1        user@host.uucp
  336. R<@$-.uucp>:$+        $#error $:Never heard of UUCP host $1
  337. R$+<@$-.uucp>        $#error $:Never heard of UUCP host $2
  338.  
  339. # If you want to pass all other explicit domain names up the ladder
  340. # to our forwarder then uncomment the following line.
  341. #R$*<@$*.$+>$*        $#$M    $@$R $:$1<@$2.$3>$4    user@any.domain
  342. # and comment out this one.
  343. R$*<@$+.$->$*        $#ddn $@ $2.$3 $:$1<@$2.$3>$4    user@any.domain
  344.  
  345. # All addresses in the rules ABOVE are absolute (fully qualified domains).
  346. # Addresses BELOW can be partially qualified.
  347.  
  348. R$*@$*            $#error $:I don't understand $1@$2
  349.  
  350. # Local names with % are really not local!
  351. R$+%$+            $@$>30$1%$2            retry
  352.  
  353. # everything else is a local name
  354. R$+            $#local $:$1            local names
  355.