home *** CD-ROM | disk | FTP | other *** search
/ ftp.ulg.ac.be / 2014.06.ftp.ulg.ac.be.tar / ftp.ulg.ac.be / local / aix / sendmail.cf.3.2 < prev    next >
Text File  |  1993-07-28  |  48KB  |  1,312 lines

  1. #  aix_sccsid[] = "com/cmd/send/sendmail.cf, cmdsend, bos320, 9201320 AIX 1/8/92 10:17:56"
  2. # COMPONENT_NAME: CMDSEND sendmail.cf
  3. # FUNCTIONS: 
  4. #
  5. # ORIGINS: 10  26  27 
  6. #
  7. # (C) COPYRIGHT International Business Machines Corp. 1985, 1989
  8. # All Rights Reserved
  9. # Licensed Materials - Property of IBM
  10. #
  11. # US Government Users Restricted Rights - Use, duplication or
  12. # disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  13. #
  14. ############################################################
  15. #
  16. #  Sendmail
  17. #  Copyright (c) 1983  Eric P. Allman
  18. #  Berkeley, California
  19. #
  20. #  Copyright (c) 1983 Regents of the University of California.
  21. #  All rights reserved.  The Berkeley software License Agreement
  22. #  specifies the terms and conditions for redistribution.
  23. #
  24. ###########################################################
  25. #
  26. #  Sendmail.cf for full domains.
  27. #
  28. ############################################################
  29.  
  30. #################################################################
  31. #
  32. # If you want to rebuild the configuration file while the sendmail
  33. # daemon is running, you may issue a command "kill -1" to the 
  34. # current process id (pid) of the sendmail daemon. The current
  35. # pid is saved in /etc/sendmail.pid.
  36. #
  37. #################################################################
  38.  
  39. #################################################################
  40. #                                #
  41. # WARNING:  DON'T REMOVE LINES OF THE FORM #XY (like #OL below) #
  42. # OR THE EDCONFIG EDITOR WON'T WORK FOR THOSE LINES!!!          #
  43. #                                #
  44. #################################################################
  45.  
  46. ###########################################
  47. #   Important Program Control Functions   #
  48. ###########################################
  49.  
  50. # log level - turn it on early.
  51. #OL
  52. OL9
  53.  
  54. # queue directory - specify directory containing log file
  55. #OQ
  56. OQ/var/spool/mqueue
  57.  
  58. #
  59. # Define main mail relay (A. Pirard)
  60. #
  61. DRsmtp.ulg.ac.be
  62.  
  63.  
  64. ###########################################
  65. #
  66. # Host name definition 
  67. #
  68. # Define macro for your hostname for all return addresses.
  69. # Define class to recognize all aliases of your host name.
  70. # The hostname should not include your local domain (defined
  71. # below). For example, if your fully qualified hostname
  72. # is 'airmail.aus.ibm.com' this line would be set to 'Dwairmail'.
  73. #
  74. # By default, hostname is set to the value returned by the 'hostname'
  75. # command less any domain extensions. For example, if 'hostname' returns
  76. # 'airmail.aus.ibm.com', the default hostname would be 'airmail', and the
  77. # default domain name would be 'aus.ibm.com'. Define these macros if you
  78. # wish to override these defaults.
  79. #
  80. # The default aliases are those defined in /etc/hosts for the local
  81. # hostname.
  82. #
  83. #DwYourHostName
  84. #CwYourHostName YourHostAliases
  85. ###########################################
  86.  
  87. ###########################################
  88. #
  89. # Local domain name. (DEFINE THIS IF DOMAINS ARE USED)
  90. # **WARNING**
  91. # When domain names are used, SMTP transactions utilize the
  92. # full domain (official) name of the host. All host names with
  93. # no domains (abbreviated) are expanded with the local domain
  94. # by the mail service. This is consistent with Internet text standards.
  95. # All hosts sending or RECEIVING mail must recognize their official
  96. # host names. When using domains enter the official host name in
  97. # /etc/hosts and be certain that all network name servers recognize
  98. # official host names.
  99. #
  100. # ====> NOTE <====
  101. # In compliance with rfc1123, "Received:" lines should contain a domain
  102. # literal. This will occur if the official hostname contains the full domain 
  103. # when set with the 'hostname' command or the host and domain name macros
  104. # are set accordingly and the hostname contains the full domain in  
  105. # /etc/hosts or the nameserver.
  106. #
  107. # Define the D macro to be the whole domain for the local host.
  108. # This configuration file supports four part domains. It can be expanded
  109. # to support n part domains. For example, if your fully qualified
  110. # hostname is 'airmail.aus.ibm.com` this line would be set to
  111. # 'DDaus.ibm.com'.
  112. #
  113. #DDgrandchild.child.parent.top
  114. ############################################
  115.  
  116. #############################################
  117. #
  118. # Domain parts. These MUST be defined if DD (above) is defined.
  119. # Input names for all parts of the domain (up to 4 parts).
  120. # ALWAYS START WITH E. E will be the lowest level of the domain name (i.
  121. # e. 'grandchild' in the four part example). For example, the domain
  122. # "aus.ibm.com" would be entered as follows:
  123. #   1) DDaus.ibm.com
  124. #   2) DEaus
  125. #   3) DFibm
  126. #   4) DGcom
  127. # DH would not be used when entering a three part domain.
  128. #
  129. #DElowestLevel
  130. #DFnextLevel
  131. #DGnextLevel
  132. #DHnextLevel
  133. ###########################################
  134.  
  135. #
  136. #  Automatically define classes that equal the macros.
  137. #
  138. CE$E
  139. CF$F
  140. CG$G
  141. CH$H
  142.  
  143. ###################################################################
  144. #
  145. # Host name for RSCS relay (YOU MAY OPTIONALLY DEFINE THIS)
  146. #
  147. # Optionally defined macro specifying name of the host for relaying
  148. # all RSCS traffic.  This would be a VM host on the network with
  149. # VM TCP/IP (Program number 5798-FAL) installed.
  150. #
  151. # Defining this macro eliminates the requirement for you to explicitly 
  152. # reference the relaying host in your RSCS route addresses.  For 
  153. # instance, if the VM host with VM TCP/IP is called "vme" and the
  154. # final RSCS destination is "vmz" then you would normally specify the
  155. # address as "@vme:uid@vmz" or "uid%vmz@vme". If you define the
  156. # macro "DVvme" then you only need specify "uid@vmz.RSCS". Note that
  157. # the full domain name of the host (vme.dom1.dom2.dom3) is not entered.
  158. # Sendmail does the appropriate canonicalization. Class "V" 
  159. # defines all domain synonyms for RSCS. This line MUST be uncommented
  160. # when defining this macro.
  161. #DVRelayHostName
  162. #CVRSCS BITNET NETNORTH EARN EARNET VNET
  163. DVsmtp.ulg.ac.be
  164. CVRSCS BITNET NETNORTH EARN EARNET VNET
  165. #
  166. ###################################################################
  167.  
  168. ###################################################################
  169. #
  170. # Host name for UUCP relay (YOU MAY OPTIONALLY DEFINE THIS)
  171. #
  172. # Optionally defined macro specifying name of host to which you want 
  173. # to relay all UUCP traffic.  This would be a host on the network 
  174. # with modems.  You do not have to define this to use UUCP.
  175. #
  176. # Defining this macro eliminates the requirement for you to explicitly 
  177. # reference the relaying host in your UUCP route addresses.  For 
  178. # instance, if the host with modems is called "cat", you normally would 
  179. # have to specify a UUCP address as "cat!route_path".  If you define 
  180. # macro "DUcat", then you only need specify "route_path".
  181. #
  182. #DURelayHostName
  183. DUsmtp.ulg.ac.be
  184. #
  185. ###################################################################
  186.  
  187. ###################################################################
  188. #
  189. # Host name for DECnet relay 
  190. # (YOU MAY OPTIONALLY DEFINE THIS)
  191. #
  192. # Optionally defined macro specifying name of host to which you want 
  193. # to relay all DECnet mail traffic via dnamail facility.  
  194. # This would be a host on the network with tcp/ip, sendmail server and 
  195. # DECnet software installed.  
  196. #
  197. # If this macro is not defined, it implies that the
  198. # DECnet software runs locally or is not installed.
  199. #
  200. #DSRelayHostName
  201. DSsmtp.ulg.ac.be
  202. #
  203. ###################################################################
  204.  
  205. ###################################################################
  206. #
  207. # Host name for X400 relay (YOU MAY OPTIONALLY DEFINE THIS)
  208. #
  209. # Optionally defined macro specifying name of host to which you want 
  210. # to relay all X400 mail traffic.  This would be a host on the network 
  211. # with tcp/ip, sendmail server and RFC987 gateway software installed.  
  212. #
  213. # If this macro is not defined, it implies that the RFC987 gateway 
  214. # software runs locally or is not installed.
  215. #
  216. #DXRelayHostName
  217. DXsmtp.ulg.ac.be
  218. #
  219. ###################################################################
  220.  
  221. ###################################################################
  222. #
  223. # Host name for Internet relay  (YOU MAY OPTIONALLY DEFINE THIS)
  224. #
  225. # Optionally defined macro specifying name of host to which you want
  226. # to relay Internet mail. This would be a host on the network with
  227. # tcpip and sendmail server.
  228. #
  229. # Defining this macro will allow you to forward any mail that cannot
  230. # be resolved to the local domain, to the named relay host. If you
  231. # wish ALL mail to be forwarded to the relay host, comment out the 
  232. # appropriate rules in ruleset 0. (They are specified in the ruleset)
  233. #
  234. #DRRelayHostName
  235. #
  236. ###################################################################
  237.  
  238. ####################### WARNING #############################
  239. # SMTP transactions utilize the full domain (official) name # 
  240. # of the host and changes may violate rfc1123.                    #
  241. #############################################################
  242.  
  243. # my official hostname
  244. Dj$w$?D.$D$.
  245.  
  246. #####################################################
  247. #   Version Number   (YOU MAY CHANGE THIS AS NEEDED)#
  248. #####################################################
  249.  
  250. #DZ
  251. DZ4.03
  252.  
  253.  
  254. ######################
  255. #   Special macros   #
  256. ######################
  257.  
  258. # my name
  259. DnMAILER-DAEMON
  260. # UNIX header format
  261. DlFrom $g  $d
  262. # delimiter (operator) characters
  263. Do.:%@!^=/[]
  264. # format of a total name
  265. Dq$g$?x ($x)$.
  266. # SMTP login message
  267. De$j Sendmail $v/$Z ready at $b
  268.  
  269.  
  270. ###################
  271. ###   Options   ###
  272. ###################
  273.  
  274. # location of alias file
  275. #OA
  276. OA/etc/aliases
  277.  
  278. # substitution for space (blank) characters
  279. #OB
  280. OB.
  281.  
  282. # (don't) connect to "expensive" mailers
  283. #Oc
  284.  
  285. # default delivery mode
  286. #Od
  287. Odbackground
  288.  
  289. # default GID
  290. #Og
  291. Og1
  292.  
  293. # alternate address limit for multihomed hosts
  294. # for rfc1123 compliance at least two addresses should be tried 
  295. #Oh 
  296. Oh2
  297.  
  298. # If the I option is set, sendmail treats "connection refused" and "timed out"
  299. # errors from the name server as non-fatal, leaving the message in the queue
  300. # for future delivery attempts.
  301. OI
  302.  
  303. # location of sendmail.nl file
  304. #Ol
  305. #Ol/etc/sendmail.nl
  306.  
  307. # treat incoming 8-bit characters as ISO 8859/1 characters
  308. #Ow
  309.  
  310. # no NL encoding of outgoing mail (just like version prior to AIX3.0).
  311. Ok
  312.  
  313. # The J option enables spaces to be used as the LHS/RHS delimiter in
  314. # rewrite rules, in addition to tabs.
  315. #OJ
  316.  
  317. # Define whether and how to use a name server for resolving recipients.
  318. #
  319. # Possible values are:
  320. #    MR    use Mail Rename records to resolve recipient users
  321. #    MB    use Mail Box records to resolve recipient users
  322. #    MG    use Mail Group records to resolve recipient users
  323. #    MX    use Mail Exchanger records to resolve recipient hosts
  324. #    ANY     query for ANY records, rather than just CNAMEs, when
  325. #          canonicalizing the recipient host; NOTE that this
  326. #          cannot be used when there may be wildcard MX records
  327. #          for the local domain or any of its parents, since
  328. #          sendmail will accept this response as the
  329. #          canonicalized hostname and end up with something like
  330. #          "host.domain.local.domain"
  331. #    ALL    use all of the above
  332. #
  333. # You may use any combination of these, although it is recommended that
  334. # you specify MB if MR is specified.  For example, "OK MG MX" would enable
  335. # the use of Mail Group and Mail Exchanger resource records.
  336. #
  337. # The default is not to use a name server for resolving recipients.
  338. #
  339. #OK MX
  340.  
  341. # Name of the codeset for Japanese network.
  342. # Sendmail will convert mail from/to the codeset of a locale to/from
  343. # the codeset of the network specified with this option.
  344. # Note: The OOcodeset option must also be set when using the Obcodeset option.
  345. #Obcodeset
  346.  
  347. # Name of the current locale's codeset for Japanese environments.
  348. # Sendmail will convert mail from/to the codeset of the network to/from the 
  349. # codeset specified with this option.
  350. # Note: The Obcodeset option must also be set when using the OOcodeset option.
  351. #OOcodeset
  352.  
  353. # default messages to old style
  354. #Oo
  355. Oo
  356.  
  357. # map name for NIS aliases
  358. #Opmail.aliases
  359.  
  360. # Slope of q function
  361. #Oq
  362.  
  363. # read timeout -- violates protocols
  364. #Or
  365. Or5m
  366.  
  367. # SMTP timeouts (with rfc1123 recommended times)
  368. # uncomment these timeouts to comply with rfc1123
  369. #
  370. # read timeout while awaiting initial 220 greeting message
  371. #OU5m 
  372. # read timeout while awaiting reply to MAIL command
  373. #OV5m
  374. # read timeout while awaiting reply to RCPT command
  375. #OE5m
  376. # read timeout while awaiting reply to DATA command
  377. #OR5m
  378. # timeout while awaiting completion to transmit a chunk of data
  379. #OG3m
  380. # read timeout while awaiting 250 OK after sending '.'       
  381. #OW10m
  382.  
  383. # status file
  384. #OS
  385. OS/etc/sendmail.st
  386.  
  387. # queue up everything before starting transmission
  388. #Os
  389. Os
  390.  
  391. # default timeout interval
  392. #OT
  393. OT3d
  394.  
  395. # default UID
  396. #Ou
  397. Ou1
  398.  
  399. # load average at which we just queue messages
  400. #Ox
  401.  
  402. # load average at which we refuse connections
  403. #OX
  404.  
  405. # work recipient factor
  406. #Oy
  407.  
  408. # work msg class factor
  409. #Oz
  410.  
  411. # work time factor
  412. #OZ
  413.  
  414.  
  415. ###########################
  416. #   Message precedences   #
  417. ###########################
  418.  
  419. Pfirst-class=0
  420. Pspecial-delivery=100
  421. Pbulk=-60
  422. Pjunk=-100
  423.  
  424.  
  425. #####################
  426. #   Trusted users   #
  427. #####################
  428.  
  429. Troot
  430. Tdaemon
  431. Tuucp
  432. Tkinet
  433.  
  434.  
  435. #########################
  436. #   Format of headers   #
  437. #########################
  438.  
  439. H?P?Return-Path: <$g>
  440. HReceived: $?sfrom $s $.by $j ($v/$Z)
  441.           id $i; $b
  442. H?D?Resent-Date: $a
  443. H?D?Date: $a
  444. H?F?Resent-From: $q
  445. H?F?From: $q
  446. H?x?Full-Name: $x
  447. HSubject:
  448. # HPosted-Date: $a
  449. # H?l?Received-Date: $b
  450. H?M?Resent-Message-Id: <$t.$i@$j>
  451. H?M?Message-Id: <$t.$i@$j>
  452.  
  453.  
  454. ################################################################################
  455. #                                                                              #
  456. #                           REWRITING RULES                                    #
  457. #                                                                              #
  458. ################################################################################
  459.  
  460.  
  461. ################################################################################
  462. #                                                                              #
  463. #  The Complete Specification of Canonical Syntax is:                          #
  464. #                                                                              #
  465. #   <ahost>       ::= /* ARPA type host name */                                #
  466. #   <uhost>       ::= /* UUCP type host name */                                #
  467. #   <dhost>       ::= /* DECnet type host name */                              #
  468. #   <xhost>       ::= /* X400 type host name */                                #
  469. #   <user>        ::= /* target user name */                                   #
  470. #                                                                              #
  471. #   <route_node>  ::= @<ahost>: | <uhost>! | <dhost> :: | /C=...<xhost>        #
  472. #   <route_path>  ::= <NULL> | <route_node> | <route_path><route_node>         #
  473. #   <target>      ::= <user> | <user>@<ahost> | <uhost>!<user> |               #
  474. #                              <dhost>::<user> | /C=...<xhost>.../DD=<user>    #
  475. #   <address>     ::= <route_path><target>                                     #
  476. #                                                                              #
  477. #  This is what we handle, but actually we only look at the minimum required   #
  478. #  to pass the mail on.  Intermediaries with other syntax/semantics may be     #
  479. #  used, provided the addressing is compatible with them when the mail arrives #
  480. #  there.                                                                      #
  481. #                                                                              #
  482. ################################################################################
  483.  
  484.  
  485. ################################################################################
  486. #                                                                              #
  487. #                     THE DYNAMIC MACROS $f AND $g                             #
  488. #                                                                              #
  489. #  Macro $f is defined by the sender address as known the current host, via    #
  490. #  the ruleset sequence:  3, 1, 4.                                             #
  491. #                                                                              #
  492. #  Macro $g is defined at delivery time for each separate mailer via the       #
  493. #  ruleset sequence:  3, 1, mailer-S, 4.                                       #
  494. #                                                                              #
  495. #  The SMTP "MAIL FROM" address will be $g.                                    #
  496. #                                                                              #
  497. #  $g is included in many headers and will be expanded if the header is        #
  498. #  newly created by sendmail.                                                  #
  499. #                                                                              #
  500. ################################################################################
  501.  
  502.  
  503. ################################################################################
  504. #                                                                              #
  505. #                           THE SMTP INTERFACE                                 #
  506. #                                                                              #
  507. #  The SMTP "MAIL FROM" address will be $g.                                    #
  508. #                                                                              #
  509. #  The SMTP "RCPT TO" addresses will be computed from the recipient addresses  #
  510. #  in sendmail by applying the same ruleset sequence as for "to" headers:      #
  511. #  namely, rulesets 3, 2, mailer-R, 4.                                         #
  512. #                                                                              #
  513. ################################################################################
  514.  
  515.  
  516. ################################################################################
  517. #                                                                              #
  518. #  S1:  Sender Field Pre-rewriting                                             #
  519. #                                                                              #
  520. #  This ruleset is used when defining the $f macro.  In this case it is        #
  521. #  applied after S3 and before S4.                                             #
  522. #                                                                              #
  523. #  This ruleset is applied to all sender type headers after S3 and before      #
  524. #  the mailer specific sender (S) rewrite rules.                               #
  525. #  This ruleset is also applied to $f to create $g.                            #
  526. #                                                                              #
  527. ################################################################################
  528. S1
  529.  
  530.  
  531. ################################################################################
  532. #                                                                              #
  533. #  S2:  Recipient Field Pre-rewriting                                          #
  534. #                                                                              #
  535. #  This ruleset is applied to the user part of the 3-tuple output from S0.     #
  536. #  It is followed by application of the mailer specific recipient (R) rewrite  #
  537. #  rules.                                                                      #
  538. #                                                                              #
  539. #  This ruleset is applied to all recipient type headers after S3 and          #
  540. #  before the mailer specific recipient (R) rewrite rules.                     #
  541. #  This ruleset is likewise used to reform the "to" address for SMTP.          #
  542. #                                                                              #
  543. ################################################################################
  544. S2
  545.  
  546.  
  547. ################################################################################
  548. #                                                                              #
  549. #  S4:  Final Output Post-rewriting   (Return to standard form)                #
  550. #                                                                              #
  551. #  This ruleset is applied to the user part of the 3-tuple produced from       #
  552. #  ruleset 0.  It is applied after the mailer specific recipient (R) rules.    #
  553. #                                                                              #
  554. #  This ruleset is applied after S1 when defining the $f macro.                #
  555. #  This ruleset is applied last when creating the $g macro from $f.            #
  556. #                                                                              #
  557. #  This ruleset is applied to all headers after the mailer specific            #
  558. #  rewrite rules (whether recipient or sender) have been applied.              #
  559. #  This ruleset is applied last when computing the RCPT TO address for SMTP.   #
  560. #                                                                              #
  561. ################################################################################
  562. S4
  563.  
  564. #
  565. #  Change LOCAL or LOCAL.D to the real name.
  566. #
  567. R/C=$*<@LOCAL>        $:/C=$1
  568. R$*<@LOCAL>$*        $:$1<@$w>$2
  569. R$*<@LOCAL.D>$*        $:$1<@$w$?D.$D$.>$2
  570. R$*<@$-.LOCAL>$*    $:$1<@$2$?D.$D$.>$3
  571.  
  572. R$*<LOCAL>$*        $:$1<$w>$2
  573. R$*<LOCAL.D>$*        $:$1<$w$?D.$D$.>$2
  574. R$*<$-.LOCAL>$*        $:$1<$2$?D.$D$.>$3
  575.  
  576. #
  577. #  Remove focus brackets.
  578. #
  579. R$*<$+>$*        $1$2$3
  580. R$+:/C=$+        $:/C=$2
  581. R$+!/C=$+        $:/C=$2
  582.  
  583.  
  584.  
  585. ################################################################################
  586. #                                                                              #
  587. #  S3:  Address Canonicalization  (Internal rewriting form)                    #
  588. #                                                                              #
  589. #  This ruleset turns an address in external format into a format which        #
  590. #  simplifies internal rewriting.  The inverse ruleset is S4.                  #
  591. #  This ruleset is applied first to any external address before other re-      #
  592. #  writing is done.                                                            #
  593. #                                                                              #
  594. #  This concept of canonicalization is to be distinguished from usage of the   #
  595. #  nameserver in the $[/$] construct inside the RHS of rewrite rules.  This is #
  596. #  also sometimes called "canonicalization", but has to do not with the syntax #
  597. #  of the address but with obtaining the correct domain name for the address.  #
  598. #                                                                              #
  599. #  No stripping of local domains is done for route addresses:  Rulesets which  #
  600. #  require this must do it themselves by iteratively stripping LOCAL or        #
  601. #  LOCAL.D and recalling this ruleset to canonicalize the next host.item.      #
  602. #                                                                              #
  603. #  The term "localization" refers to determining whether the next host item    #
  604. #  is really a reference to the current host.  Localization assumes that local #
  605. #  UUCP host names are in class w.  This is not strictly a necessary restric-  #
  606. #  tion, but it simplifies the network concept and also makes for simpler      #
  607. #  rewrite rules.  This ruleset replaces explicit instances of local host      #
  608. #  with the internally recognized tag "LOCAL" or "LOCAL.D".                    #
  609. #                                                                              #
  610. #  Addresses which do not specify a host name for routing or domain will NOT   #
  611. #  have any reference to the local host appended in any way.                   #
  612. #                                                                              #
  613. ################################################################################
  614. S3
  615.  
  616. #
  617. #  Basic textual canonicalization -- note RFC733 heuristic here.
  618. #  This strips off everything but the innermost list between <>'s.
  619. #  Some addresses are of the format: Full Name <address>
  620. #
  621. R$*<$*<$*<$+>$*>$*>$*        $4        3-level <> nesting
  622. R$*<$*<$+>$*>$*            $3        2-level <> nesting
  623. R$*<$+>$*            $2        basic RFC821/822 parsing
  624.  
  625. #  Change a%b to a@b. This implies that we support a%b%c... as a route
  626. #  based address from right to left.
  627. #  This form of addressing should go away as full domains are supported.
  628. #
  629. R$+%$-            $1@$2
  630.  
  631. #  ====> NOTE <====
  632. #  This configuration file always evaluates mix mode addresses from
  633. #  left to right. No precedence between @,!,:: or /C= is assumed. The
  634. #  address a!b@c will resolve to the uucp mailer for the remote host
  635. #  'a'. This permits the resolution of very complex route based
  636. #  addresses such as; @a:@b:c!d!e::user, a!@b:c!user, a!@b.uucp:user@c.
  637. #  Return addresses on mail to/from uucp or DECnet machines are also correct.
  638. #  X400 addresses are detected by a leading "/C=" and are passed intact to
  639. #  the X400 mailer. The address /C=US/ADMD=ptt/PRMD=pco/DD=b!user resolves
  640. #  to the X400 mailer. The recipient sendmail sees b!user and routes to
  641. #  the uucp mailer. The address @a:/C=US/ADMD=ptt/PRMD=pco/DD=user
  642. #  resolves to the tcp mailer for the remote host 'a'. This is how the
  643. #  X400 relay is implemented.
  644.  
  645. #  If you wish the address a!b@c to resolve to the TCP
  646. #  mailer for the remote host 'c' then uncomment the following rewrite
  647. #  rule. This approach is compatible with older versions of sendmail.
  648.  
  649. #  Change a!b@c to @c:a!b
  650. #R$+!$+@$+        @$3:$1!$2
  651.  
  652. #
  653. #  Change commas to colons for route addresses.
  654. #
  655. R$+,$+            $1:$2
  656.  
  657. # Uncomment the following rule for compliance with rfc1123, which 
  658. # restricts the use of explicit source routes.
  659. #R@$*:$*        $2
  660.  
  661. #
  662. #  Pick out route addresses.  Focus and call localizer.
  663. #
  664. R/C=$*            $?X$:@$X:/C=$1$|$:/C=$1
  665.  
  666. R@$+:$+            $@$>9<@$1>:$2            handle <route-addr>
  667. R$-!$+            $@$>8<$1>!$2            UUCP route
  668.  
  669. # Uncomment the following rule for Ki Research kiNET's DECnet 
  670. #R$-::$+            $@$>17<$1>::$2            DECnet addr
  671.  
  672. # Detect X400. Focus and localize.
  673. R/C=$+@LOCAL        $@/C=$1<@LOCAL>
  674. R/C=$+            $@</C=$1>            X400 route addr
  675. #  Detect domain!user. Internally convert to user@domain (RFC976).
  676. #  Rule set 8 will detect local addresses and strip any trailing
  677. #  periods.
  678. R$-.$*!$+        $@$>8<$1.$2>!$3
  679.  
  680. # Uncomment the following rule for Ki Research kiNET's DECnet
  681. #  Detect domain::user.
  682. #R$-.$*::$+        $@$>17<$1.$2>::$3        DECnet addr
  683. #
  684. #  Detect local domain for nonroute addresses.  Focus and localize.
  685. #
  686. R$+@$+            $:$1<@$2>
  687.  
  688. R$+<@$=w$?E.$=E$.$?F.$=F$.$?G.$=G$.$?H.$=H$.>        $@$1<@LOCAL.D>
  689. R$+<@$=w>        $@$1<@LOCAL>
  690. R$+<@$=w.UUCP>        $@$1<@LOCAL>
  691.  
  692. #
  693. #  Anything else is left as-is!  This includes simple names.
  694. #  They will NOT have an appended domain.
  695. #  This is so the $f macro definition will be the sender address
  696. #  as known locally.
  697. #
  698.  
  699.  
  700. ################################################################################
  701. #
  702. #  S9:  Localize ARPA type route path.  Depend on classes/macros E,F,G,H being
  703. #  defined in order as used.  They need not all be used.
  704. #
  705. #  This is used only by S3.
  706. #
  707. ################################################################################
  708. S9
  709.  
  710. R<@$=w.$=E.$=F.$=G.$=H>:$*        $@<@LOCAL.D>:$6
  711. R$?H$|<@$=w.$=E.$=F.$=G>:$*$.        $@<@LOCAL.D>:$5    if $H isn't defined
  712. R$?G$|<@$=w.$=E.$=F>:$*$.        $@<@LOCAL.D>:$4    if $G isn't defined
  713. R$?F$|<@$=w.$=E>:$*$.            $@<@LOCAL.D>:$3    if $F isn't defined
  714. R<@$=w>:$*                $@<@LOCAL>:$2
  715. R<@$=w.UUCP>:$*                $@<@LOCAL>:$2
  716.  
  717. ################################################################################
  718. #
  719. # S8:  Localize UUCP route path.  This is used only by S3.
  720. #
  721. ################################################################################
  722. S8
  723.  
  724. R<$=w.$=E.$=F.$=G.$=H>!$+        $@<LOCAL.D>!$6
  725. R$?H$|<$=w.$=E.$=F.$=G>!$+$.        $@<LOCAL.D>!$5    if $H isn't defined
  726. R$?G$|<$=w.$=E.$=F>!$+$.        $@<LOCAL.D>!$4    if $G isn't defined
  727. R$?F$|<$=w.$=E>!$+$.            $@<LOCAL.D>!$3    if $F isn't defined
  728. R<$=w>!$+                $@<LOCAL>!$2
  729. R<$+.>!$+                <$1>!$2
  730. # We have a non-local domain. If you want these changed to
  731. # user@domain for resolution uncomment the following lines.
  732. # R<$-.$+>!$+                $@<@$1.$2>:$3
  733. # R<$+.>!$+                $@<@$1>:$2
  734. R<$+.>!$+                <$1>!$2
  735.  
  736. ################################################################################
  737. #
  738. # S17:  Localize DECnet route path.  This is used only by S3.
  739. #
  740. ################################################################################
  741. S17
  742.  
  743. # Uncomment the following rules for Ki Research kiNET's DECnet
  744. #R<$=w.$=E.$=F.$=G.$=H>::$+        $@<LOCAL.D>::$6
  745. #R$?H$|<$=w.$=E.$=F.$=G>::$+$.        $@<LOCAL.D>::$5    if $H isn't defined
  746. #R$?G$|<$=w.$=E.$=F>::$+$.        $@<LOCAL.D>::$4    if $G isn't defined
  747. #R$?F$|<$=w.$=E>::$+$.            $@<LOCAL.D>::$3    if $F isn't defined
  748. #R<$=w>::$+                $@<LOCAL>::$2
  749. # We have a non-local domain. If you want these changed to
  750. # user@domain for resolution uncomment the following lines.
  751. # R<$-.$+>::$+                $@<@$1.$2>:$3
  752. # R<$+>::$+                <$1>::$2
  753.  
  754. ################################################################################
  755. #                                                                              #
  756. #                                MAILERS                                       #
  757. #                                                                              #
  758. ################################################################################
  759.  
  760.  
  761. ################################################################################
  762. #                                                                              #
  763. #               Local and Program Mailer specification                         #
  764. #                                                                              #
  765. ################################################################################
  766.  
  767. #
  768. Mlocal, P=/bin/bellmail, F=lsDFMmnu, S=10, R=20, A=mail $u
  769. Mprog,  P=/bin/sh,       F=lsDFM,   S=10, R=20, A=sh -c $u
  770.  
  771.  
  772. ################################################################################
  773. #                                                                              
  774. #  S10:  Local/Prog Mailers Sender rules
  775. #                                                                              
  776. ################################################################################
  777. S10
  778.  
  779. ################################################################################
  780. #                                                                              
  781. #  S20:  Local/Prog Mailers Recipient rules
  782. #                                                                              
  783. ################################################################################
  784. S20
  785.  
  786.  
  787. ################################################################################
  788. #                                                                              #
  789. #                   UUCP Mailer Specification                                  #
  790. #                                                                              #
  791. ################################################################################
  792.  
  793. Muucp,  P=/usr/bin/uux, F=DFMhuU, S=13, R=23, M=100000,
  794.         A=uux - -r -n -a$f -gC $h!rmail ($u)
  795.  
  796. ################################################################################
  797. #                                                                              #
  798. #                        DECnet                                             #
  799. #                                           #
  800. # Note: Modify this mailer to accomodate appropriate DECnet mailer being used. #
  801. ################################################################################
  802.  
  803. Mkinet,  P=/usr/etc/dna/bin/dnamail, F=MNsf, S=16, R=26,
  804.         A=dnamail -f $f -n $h $u
  805.  
  806. ################################################################################
  807. #                                                                              
  808. #  S16:  DECnet (kinet) Sender rules
  809. #                                                                              
  810. ################################################################################
  811. S16
  812.  
  813. ################################################################################
  814. #                                                                              
  815. #  S26:  DECnet (kinet) Recipient rules
  816. #                                                                              
  817. ################################################################################
  818. S26
  819.  
  820.  
  821. ################################################################################
  822. #
  823. #  S13:  UUCP Mailer Sender Rules
  824. #
  825. #  This ruleset is applied in the following circumstances:
  826. #
  827. #  1)  To process sender type headers.  These have header names:
  828. #
  829. #    "resent-sender"
  830. #    "resent-from"
  831. #    "resent-reply-to"
  832. #    "sender"
  833. #    "from"
  834. #    "reply-to"
  835. #    "return-receipt-to"
  836. #    "errors-to"
  837. #
  838. #  2)  To define the $g macro from the $f macro.  The definition of $g must
  839. #      contain a bang character if UGLY UUCP From lines are to be gen'd.
  840. #
  841. #  In either case, it is applied after ruleset 1, and is followed by ruleset 4.
  842. #
  843. #  Watch out if one of those headers is newly created and includes the expanded
  844. #  $g macro!  This ruleset will have been used to create $g, and will then be
  845. #  applied to the result of the expansion of $g.  This ruleset must handle
  846. #  this!
  847. #
  848. #  The $g macro is used in many places.
  849. #
  850. ################################################################################
  851. S13
  852.  
  853. #
  854. #  We have just canonicalized a From: address or the $f macro.  Remove any
  855. #  instances of local host from route addresses.  This also works to take
  856. #  care of the instance of a newly expanded $g in a new From: line.
  857. #
  858. R<$*LOCAL$*>$-$+    $>3$4
  859.  
  860. #
  861. #  Remove any local domain.
  862. #
  863. R$+<@LOCAL$*>        $1
  864.  
  865. #
  866. #  Fully qualify any domain which remains.
  867. #
  868. R$+<@$->        $1<@$2.LOCAL>
  869.  
  870. #
  871. #  Prefix sender address with UUCP target host name.  This creates or adds
  872. #  to the route.  Note that definition of $g will cause prefix of $w.  Then
  873. #  processing a new From: line containing expanded $g will add another $w prefix
  874. #  unless it is stripped above.
  875. #
  876. R$+            $:$w!$1            add it back
  877.  
  878.  
  879. ################################################################################
  880. #
  881. #  S23:  UUCP Mailer Recipient rules
  882. #
  883. #  This ruleset is applied in the following cases:
  884. #
  885. #  1)  To process recipient type headers being sent out through this mailer.  
  886. #      These headers are the ones with header names:
  887. #
  888. #    "to"
  889. #    "resent-to"
  890. #    "cc"
  891. #    "resent-cc"
  892. #    "bcc"
  893. #    "resent-bcc"
  894. #
  895. #  2)  To process the user part of the 3-tuple from S0 which resolves 
  896. #      to this mailer.  What is processed will be the path remaining after
  897. #      the next host is stripped.  This is enclosed in focus braces to
  898. #      distinguish it from a recipient header line address.
  899. #
  900. #  In either case, this ruleset is applied after ruleset 2, and is followed by 
  901. #  ruleset 4.
  902. #
  903. #  Remember that this ruleset applies to all "to" type headers in the mail 
  904. #  transmitted via this mailer.  This does not inclue "Apparently-to:" headers.
  905. #  Not all "To:" headers point to the current mail target!  For instance, if 
  906. #  the mail originated on this host and some targets were local, there may be 
  907. #  local "To:" headers that must be processed by this ruleset!
  908. #  The idea here is to make sure that the headers will be properly understood
  909. #  in the context of the next host to which the mail will go.
  910. #
  911. #  A subtlety to be kept in mind is that when this is applied to the user part
  912. #  of the 3-tuple output from S0, that that user part is not preprocessed
  913. #  by S3 before treatment by this ruleset.  However, when a header is being
  914. #  processed, S3 will have been used.  The difference arises from the fact
  915. #  that S3 generates the LOCAL tag, whereas the user part of a UUCP address 
  916. #  may contain the current host name as the first target.  This would be typical
  917. #  of a test scenario to UUCP to a remote, and have that remote UUCP back
  918. #  to us.
  919. #
  920. ################################################################################
  921. S23
  922.  
  923. #
  924. #  Items that come in from S0 get left alone.
  925. #
  926. R<$+>            $@$1
  927.  
  928. #
  929. #  Leave route based addresses alone.  They are already completely intelligible
  930. #  in any context.
  931. #
  932. R<$+>$+            $@<$1>$2
  933.  
  934. #
  935. #  Fully qualify our hostname with full domain.
  936. #
  937. R$+<@LOCAL>        $@$1<@LOCAL.D>
  938.  
  939. #
  940. #  Add full domain to other host names in local domain.
  941. #
  942. R$+<@$->        $@$1<@$2.LOCAL>
  943.  
  944. #
  945. #  Leave all other typical domain addresses alone.
  946. #
  947. R$+<$+>            $@$1<$2>
  948.  
  949. #
  950. #  Append full local domain where none exists at all.  This handles the case
  951. #  of local targets whose (missing) host would cause misunderstanding in the
  952. #  next host.
  953. #
  954. R$+            $@$1<@LOCAL.D>
  955.  
  956.  
  957. ################################################################################
  958. #                                                                              #
  959. #                   TCP Mailer Specification                                   #
  960. #                                                                              #
  961. ################################################################################
  962.  
  963. Mtcp,    P=[IPC], F=mDFMueXLNu,  S=14, R=24, A=IPC $h, E=\r\n
  964.  
  965.  
  966. ################################################################################
  967. #
  968. #  S14:  TCP Mailer Sender Rules
  969. #
  970. #  This ruleset is applied in the following circumstances:
  971. #
  972. #  1)  To process sender type headers.  These have header names:
  973. #
  974. #    "resent-sender"
  975. #    "resent-from"
  976. #    "resent-reply-to"
  977. #    "sender"
  978. #    "from"
  979. #    "reply-to"
  980. #    "return-receipt-to"
  981. #    "errors-to"
  982. #
  983. #  2)  To define the $g macro from the $f macro.
  984. #
  985. #  In either case, it is applied after ruleset 1, and is followed by ruleset 4.
  986. #
  987. #  Watch out if one of those headers is newly created and includes the expanded
  988. #  $g macro!  This ruleset will have been used to create $g, and will then be
  989. #  applied to the result of the expansion of $g.  This ruleset must handle
  990. #  this!
  991. #
  992. #  The $g macro is used in many places.
  993. #
  994. ################################################################################
  995. S14
  996. #
  997. #
  998. #  We have just canonicalized a From: address or the $f macro.  Remove any
  999. #  instances of local host from route addresses.  This also works to take
  1000. #  care of the instance of a newly expanded $g in a new From: line.
  1001. #
  1002. R</C=$+>        $@<@LOCAL.D>:/C=$1
  1003. R/C=$+<@$+>        $@<@LOCAL.D>:/C=$1
  1004. R<$*LOCAL$*>$-$+    $>3$4
  1005. #
  1006. #  Prepend our domain to route based paths that come through.
  1007. #
  1008. R<$+>$+            $@<@LOCAL.D>:$1$2
  1009.  
  1010. #
  1011. #  Fully qualify our domain.
  1012. #
  1013. R$+<@LOCAL>        $@$1<@LOCAL.D>
  1014.  
  1015. #
  1016. #  Fully qualify other hosts in our local domain.
  1017. #
  1018. R$+<@$->        $@$1<@$2.LOCAL>
  1019.  
  1020. #
  1021. #  Leave all other typical domain addresses alone.
  1022. #
  1023. R$+<$+>            $@$1<$2>
  1024. #
  1025. #  Append full local domain where none exists at all.
  1026. #
  1027. R$+            $@$1<@LOCAL.D>
  1028.  
  1029.  
  1030. ################################################################################
  1031. #
  1032. #  S24:  TCP Mailer Recipient rules
  1033. #
  1034. #  This ruleset is applied in the following cases:
  1035. #
  1036. #  1)  To process recipient type headers being sent out through this mailer.  
  1037. #      These headers are the ones with header names:
  1038. #
  1039. #    "to"
  1040. #    "resent-to"
  1041. #    "cc"
  1042. #    "resent-cc"
  1043. #    "bcc"
  1044. #    "resent-bcc"
  1045. #
  1046. #      but NOT:
  1047. #
  1048. #    "Apparently-to"
  1049. #
  1050. #  2)  To process the user part of the 3-tuple from S0 which resolves 
  1051. #      to this mailer.  This is the complete "to" address for ordinary
  1052. #      tcp usage, or is the original UUCP path if we are relaying using DU.
  1053. #
  1054. #  3)  To process the "to" address to form the SMTP RCPT TO address.
  1055. #
  1056. #  In all cases, this ruleset is applied after ruleset 2, and is followed by 
  1057. #  ruleset 4.
  1058. #
  1059. #  Remember that this ruleset applies to all "to" type headers in the mail 
  1060. #  transmitted via this mailer.  This does not inclue "Apparently-to:" headers.
  1061. #  Not all "To:" headers point to the current mail target!  For instance, if 
  1062. #  the mail originated on this host and some targets were local, there may be 
  1063. #  local "To:" headers that must be processed by this ruleset!
  1064. #  The idea here is to make sure that the headers will be properly understood
  1065. #  in the context of the next host to which the mail will go.
  1066. #
  1067. ################################################################################
  1068. S24
  1069.  
  1070. R</C=$+>        $@</C=$1>
  1071. #
  1072. #  Leave route based addresses alone.  They are already completely intelligible
  1073. #  in any context.
  1074. #
  1075. R<$+>$+            $@<$1>$2
  1076.  
  1077. #
  1078. #  Fully qualify our hostname with full domain.
  1079. #
  1080. R$+<@LOCAL>        $@$1<@LOCAL.D>
  1081.  
  1082. #
  1083. #  Fully qualify nonlocal host names in our local domain.
  1084. #
  1085. R$+<@$->        $@$1<@$2.LOCAL>
  1086.  
  1087. #
  1088. #  Leave all other typical domain addresses alone.
  1089. #
  1090. R$+<$+>            $@$1<$2>
  1091.  
  1092. #
  1093. #  Append full local domain where none exists at all.  This handles the case
  1094. #  of local targets whose (missing) host would cause misunderstanding in the
  1095. #  next host.
  1096. #
  1097. R$+            $@$1<@LOCAL.D>
  1098.  
  1099. #    The following two mailers and their Rulesets are newly defined.
  1100.  
  1101. ################################################################################
  1102. #                                                                              #
  1103. #    Forwarding to RFC987 gateway mailer specification
  1104. #                                                                              #
  1105. ################################################################################
  1106. Mto987gateway, P=[IPC], F=mDFMueX, S=15, R=25, A=IPC $h
  1107.  
  1108. ################################################################################
  1109. #                                                                              #
  1110. #    The RFC987 gateway mailer specification                       #
  1111. #                                                                              #
  1112. #  The RFC987 gateway simulation program and its path can be renamed to any    #
  1113. #  name and path by modifying the following Mailer definition below.           #
  1114. #                                           #
  1115. ################################################################################
  1116. M987gateway, P=/usr/lpp/osimf/etc/x400mailer, F=sBFMhulmnSC, S=15, R=25,
  1117.      A=gateway -f /etc/x400gw.cfg $f $u
  1118.  
  1119.  
  1120. ################################################################################
  1121. #
  1122. #  S15:  RFC987 gateway Mailer Sender Rules
  1123. #
  1124. #  This ruleset is applied in the following circumstances:
  1125. #
  1126. #  1)  To process sender type headers.  These have header names:
  1127. #
  1128. #    "resent-sender"
  1129. #    "resent-from"
  1130. #    "resent-reply-to"
  1131. #    "sender"
  1132. #    "from"
  1133. #    "reply-to"
  1134. #    "return-receipt-to"
  1135. #    "errors-to"
  1136. #
  1137. #  2)  To define the $g macro from the $f macro.
  1138. #
  1139. #  In either case, it is applied after ruleset 1, and is followed by ruleset 4.
  1140. #
  1141. #  Watch out if one of those headers is newly created and includes the expanded
  1142. #  $g macro!  This ruleset will have been used to create $g, and will then be
  1143. #  applied to the result of the expansion of $g.  This ruleset must handle
  1144. #  this!
  1145. #
  1146. #  The $g macro is used in many places.
  1147. #
  1148. ################################################################################
  1149. S15
  1150.  
  1151. #
  1152. #  Fully qualify our hostname with full domain.
  1153. #
  1154. R$+<@LOCAL>        $@$1<@LOCAL.D>
  1155.  
  1156. #
  1157. #  Fully qualify nonlocal host names in our local domain.
  1158. #
  1159. R$+<@$->        $@$1<@$2.LOCAL>
  1160.  
  1161. #
  1162. #  Leave all other typical domain addresses alone.
  1163. #
  1164. R$+<$+>            $@$1<$2>
  1165.  
  1166. ################################################################################
  1167. #
  1168. #  S25:  RFC987 gateway Mailer Recipient rules
  1169. #
  1170. #
  1171. S25
  1172.  
  1173. R$+        $:<$1>
  1174.  
  1175. ################################################################################
  1176. #                                                                              #
  1177. #  S7:  Address stripping for comparison against sendmail.nl lists             #
  1178. #                                                                              #
  1179. #  This ruleset is applied to an address before checking to see if the         #
  1180. #  address exists in one of the lists in the sendmail.nl file.                 #
  1181. #  Its function is to strip off information which is irrelevant to             #
  1182. #  determining the final destination system.  This normally means all          #
  1183. #  information to the left of the last "@" for domain addresses and            #
  1184. #  the user name which is to the right of the last "!" in a bang               #
  1185. #  path address.  This ruleset should only be modified if there are            #
  1186. #  addressing schemes which must be accomodated.                               #
  1187. #                                                                              #
  1188. ################################################################################
  1189. S7
  1190.  
  1191. #Domain addresssing (up to 6 level)
  1192. R$+@$-.$-.$-.$-.$-.$-    @$2.$3.$4.$5.$6.$7
  1193. R$+@$-.$-.$-.$-.$-    @$2.$3.$4.$5.$6
  1194. R$+@$-.$-.$-.$-        @$2.$3.$4.$5
  1195. R$+@$-.$-.$-        @$2.$3.$4
  1196. R$+@$-.$-        @$2.$3
  1197. R$+@$-            @$2
  1198.  
  1199. #Bang addressing
  1200. R$+!$-            $1!
  1201.  
  1202.  
  1203.  
  1204. ################################################################################
  1205. #                                                                              #
  1206. #  S6:  Parsing addresses for nameserver queries                               #
  1207. #                                                                              #
  1208. #  This ruleset is applied to an address before querying the nameserver        #
  1209. #  for any MB, MR, or MG records that match the address.  It will only         #
  1210. #  parse an address of the form "user@domain"; it returns the result in        #
  1211. #  the form "user.domain", which is suitable for the nameserver query,         #
  1212. #  and it prepends a "$#" token to indicate success.                           #
  1213. #                                                                              #
  1214. ################################################################################
  1215. S6
  1216.  
  1217. #
  1218. # Pass only addresses consisting of exactly one token, an '@', and one
  1219. # or more tokens.
  1220. #
  1221. R$-@$+            $#$1.$2                
  1222.  
  1223. ################################################################################
  1224. #                                                                              #
  1225. #     Rule Zero                                                                #
  1226. #                                                                              #
  1227. #  Resolve sender or recipient address to mailer/host/user 3-tuple.            #
  1228. #  This may require iteration in use of S3 to strip leading route items        #
  1229. #  which pertain to the current host.                                          #
  1230. #                                                                              #
  1231. #  Sendmail will pass the user portion of the 3-tuple through ruleset 2 +      #
  1232. #  the mailer specific recipient ruleset + ruleset 4.                          #
  1233. #                                                                              #
  1234. ################################################################################
  1235. S0
  1236.  
  1237. #
  1238. #  Handle route addresses that begin with LOCAL or LOCAL.D
  1239. #
  1240. R<$*LOCAL$*>$-$+    $>3$4
  1241.  
  1242. #  Change a%b<$*> to <$*>:a@b.
  1243. #  This form of addressing should go away as full domains are supported.
  1244. #
  1245. R$+%$-<$*>        <$3>:$1@$2
  1246. #
  1247. #  Handle explicit local delivery.
  1248. #
  1249. #  The entire prefix is treated as local user.
  1250. R/C=$+/S=$-$*<@LOCAL$*>        $#local$:$2
  1251. R$+<@LOCAL$*>        $#local$:$1
  1252.  
  1253. #
  1254. #  Resolve X.400 addresses to the RFC987 gateway mailer.
  1255. #
  1256. R</C=$*>        $#987gateway$:/C=$1
  1257.  
  1258. #
  1259. #  Resolve UUCP to local uucp mailer or remote one via tcp.
  1260. #  For tcp relay, user is full uucp route.  For uucp mailer, user is
  1261. #  the uucp route as seen from the next host.
  1262. #  UUCP hostnames are not passed through the nameserver canonicalizer.
  1263. #
  1264. R$+<@$-.UUCP>        $?U$#tcp$@$[$U$]$:$1<@$2.UUCP>$|$#uucp$@$2$:<$1>$.
  1265. R<@$+.UUCP>:$+        $?U$#tcp$@$[$U$]$:<@$1.UUCP>:$2$|$#uucp$@$1$:<$2>$.
  1266. R<$+>!$+        $?U$#tcp$@$[$U$]$:<$1>!$2$|$#uucp$@$1$:<$2>$.
  1267.  
  1268. # Uncomment the following rule for Ki Research kiNET's DECnet
  1269. #
  1270. #  Resolve DECnet to local DECnet mailer or remote one via
  1271. #  tcp.  For tcp relay, user is full DECnet route.  For 
  1272. #  DECnet mailer, user is the DECnet route as seen from the next host.
  1273. #  DECnet hostnames are not passed through the nameserver canonicalizer.
  1274. #
  1275. #R<$+>::$+        $?S$#tcp$@$[$S$]$:<$1>::$2$|$#kinet$@$1$:<$2>$.
  1276.  
  1277. #  Resolve any RSCS relays. Note that relay is canonicalized.
  1278. #
  1279. R$+<@$-.$=V>        $?V$#tcp$@$[$V$]$:$1<@$2.$3>
  1280. R<@$+.$=V>:$+        $?V$#tcp$@$[$V$]$:<@$1.$2>:$3
  1281. #
  1282. #  Canonicalize anything else which has an @focus.  This excludes simple names,
  1283. #  which are local.
  1284. #
  1285. R$*<@$+>$*        $:$1<@$[$2$]>$3
  1286.  
  1287. #
  1288. #  Send domain address to tcp.  This includes domain literals [IP quads].
  1289. #  User is full focused path.
  1290. #
  1291.  
  1292. #  Resolve addresses that are in our local domain.
  1293. R$*<@$-.$=E.$=F.$=G.$=H>$*    $#tcp$@$2.$3.$4.$5.$6$:$1<@$2.$3.$4.$5.$6>$7
  1294. R$?H$|$*<@$-.$=E.$=F.$=G>$*$.    $#tcp$@$2.$3.$4.$5$:$1<@$2.$3.$4.$5>$6
  1295. R$?G$|$*<@$-.$=E.$=F>$*$.    $#tcp$@$2.$3.$4$:$1<@$2.$3.$4>$5
  1296. R$?F$|$*<@$-.$=E>$*$.        $#tcp$@$2.$3$:$1<@$2.$3>$4
  1297.  
  1298. #  If the DR macro is defined, addresses that do not resolve to local
  1299. #  domain are forwarded to relay host. Comment the above 4 rules if you
  1300. #  want everything sent to the relay host.
  1301.  
  1302. R$*<@$+>$*        $?R$#tcp$@$[$R$]$:$1<@$2>$3$|$#tcp$@$2$:$1<@$2>$3$.    
  1303.  
  1304. #
  1305. #  Remaining names must be local.
  1306. #  User is whatever is left.
  1307. #
  1308. R$+            $#local$:$1
  1309.