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.ptf.U428241 < prev    next >
Text File  |  1994-06-09  |  49KB  |  1,327 lines

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