home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / elm23-2.zip / sendmail.cf < prev   
Text File  |  1996-07-22  |  48KB  |  941 lines

  1. ########################################################################
  2. # File: sendmail.uml             Version 3.0               16-Apr-1995 #
  3. #                                Niel Kempson <kempson@snowyowl.co.uk> #
  4. ########################################################################
  5. #                                                                      #
  6. # CHANGE LOG                                                           #
  7. #                                                                      #
  8. #   1.0 [27-Nov-1994] Niel Kempson <kempson@snowyowl.co.uk>            #
  9. #       Initial release.                                               #
  10. #                                                                      #
  11. #   2.0 [05-Feb-1995] Niel Kempson <kempson@snowyowl.co.uk>            #
  12. #       Clarified use of 'Cw' macro and added support for LAMail.      #
  13. #                                                                      #
  14. #   3.0 [16-Apr-1995] Niel Kempson <snowyowl.co.uk>                    #
  15. #       Further clarifications for some bits that evidently weren't    #
  16. #       clear enough :-(                                               #
  17. #                                                                      #
  18. ########################################################################
  19. #                                                                      #
  20. #                                                                      #
  21. #  Sendmail                                                            #
  22. #  Copyright (c) 1983  Eric P. Allman                                  #
  23. #  Berkeley, California                                                #
  24. #                                                                      #
  25. #  Copyright (c) 1983 Regents of the University of California.         #
  26. #  All rights reserved.  The Berkeley software License Agreement       #
  27. #  specifies the terms and conditions for redistribution.              #
  28. #                                                                      #
  29. #  This configuration file was modified specifically for IBM's         #
  30. #  SENDMAIL product for the IBM OS/2 Operating System.  Please avoid   #
  31. #  making changes to this file, as it will change the operation of     #
  32. #  SENDMAIL.                                                           #
  33. #                                                                      #
  34. #  Modified by: Ed Overly    &   Daniel Barton       @ IBM             #
  35. #              Yorktown, NY  Research Triangle Park, NC                #
  36. #                                                                      #
  37. #----------------------------------------------------------------------#
  38. #                                                                      #
  39. # Changes to allow UltiMail/2 Lite to work as an SMTP client rather    #
  40. # than the usual POP client.  You will need to edit this file and      #
  41. # customise it for your setup.                                         #
  42. #                                                                      #
  43. #   1.  Use an editor that preserves TAB characters.  Do NOT use the   #
  44. #       EPM or TEDIT editors that come with OS/2 - they expand TABs    #
  45. #       into spaces and will cause this file to be useless.  The E     #
  46. #       editor is OK.                                                  #
  47. #                                                                      #
  48. #   2.  Search for the string "---EDIT---" in this file and edit the   #
  49. #       following line(s) in accordance with the notes in the adjacent #
  50. #       comment.  There are 10 occurrences of "---EDIT---" after this  #
  51. #       line.  PLEASE make sure that you check each of them before     #
  52. #       firing up sendmail.                                            #
  53. #                                                                      #
  54. #   3.  There are explicit paths specified in this file; the examples  #
  55. #       presented assume that your IAK installation is in the default  #
  56. #       location of C:\TCPIP.  If this is not the case, please check   #
  57. #       carefully the paths specified under EDITs 04,05,06,07,10.      #
  58. #                                                                      #
  59. #   4.  For the examples predefined in this file:                      #
  60. #                                                                      #
  61. #       o   official host name: snowyowl.demon.co.uk                   #
  62. #                                                                      #
  63. #       o   other aliases: snowyowl.com, snowyowl.co.uk, sos.co.uk     #
  64. #                                                                      #
  65. #          o   IBM TCP/IP installed in C:\TCPIP                           #
  66. #                                                                      #
  67. #       o   all outgoing mail sent to post.demon.co.uk for onward      #
  68. #           routing and delivery                                       #
  69. #                                                                      #
  70. #   5.  After configuration, this file should be installed as          #
  71. #       <ETC-DIR>\sendmail.uml, where <ETC-DIR> is the TCP/IP ETC      #
  72. #       directory (usually C:\TCPIP\ETC).                              #
  73. #                                                                      #
  74. #   6.  UltiMail/2 Lite will use this file automatically, but sendmail #
  75. #       will need to be told to use it as well.  When you start the    #
  76. #       sendmail daemon, be sure to specify the -C option as shown in  #
  77. #       this example:                                                  #
  78. #                                                                      #
  79. #           sendmail -bd -d1.1 -q5m -Cc:\tcpip\etc\sendmail.uml        #
  80. #                                                                      #
  81. #   7.  If you want to use this file with LAMail, ensure that it is    #
  82. #    called X:\tcpip\etc\sendmail.cf (where X: is your TCP/IP disk).#
  83. #                                                                      #
  84. ########################################################################
  85.  
  86.  
  87.  
  88. ########################################################################
  89. #                                                                      #
  90. # Host name definition (YOU MUST DEFINE THESE)                         #
  91. #                                                                      #
  92. # The Dw macro defines the "official" host name that will be reported  #
  93. # on any outgoing mail as part of the "From" address.  It can contain  #
  94. # only one host name, without the domain name appended (i.e. no dots   #
  95. # allowed).                                                            #
  96. #                                                                      #
  97. # The Cw class macro defines all of the host names for which we will   #
  98. # accept incoming mail as destined for this machine.  It can contain   #
  99. # a list of host names, separated by whitespace.  The host names must  #
  100. # not have the domain name appended (i.e. no dots allowed).  As a      #
  101. # minimum, the Cw class must include the "official" host name as       #
  102. # defined in the Dw macro.                                             #
  103. #                                                                      #
  104. # YOU MUST DEFINE Cw OR SENDMAIL WILL NEVER RECOGNISE INCOMING MAIL AS #
  105. # "LOCAL" AND WILL BOUNCE IT BACK TO THE SENDER.  Normally, the Dw and #
  106. # Cw definitions are identical.                                    #
  107. #                                                                      #
  108. # Complicated Example:                                                 #
  109. #                                                                      #
  110. #   The full domain name of the host is 'snowyowl.demon.co.uk', so     #
  111. #   define the 'w' macro:                                              #
  112. #                                                                      #
  113. #       Dwsnowyowl                                                     #
  114. #                                                                      #
  115. #   We also wish to accept mail addressed to 'sos-gate.demon.co.uk',   #
  116. #   so add 'sos-gate' to the minimum essential definition of the 'w'   #
  117. #   class ('Cwsnowyowl'):                                               #
  118. #                                                                      #
  119. #       Cwsnowyowl  sos-gate                                           #
  120. #                                                                      #
  121. # Normal Examples:                                                     #
  122. #                                                                      #
  123. #   The full domain name of the host is 'company.com', so define:      #
  124. #                                                                      #
  125. #       Dwcompany                                                      #
  126. #       Cwcompany                                                      #
  127. #       DDcom                                                          #
  128. #                                                                      #
  129. #   The full domain name of the host is 'myhost.cts.com', so define:   #
  130. #                                                                      #
  131. #       Dwmyhost                                                       #
  132. #       Cwmyhost                                                       #
  133. #       DDcts.com                                                      #
  134. #                                                                      #
  135. #   (Remember that Cw MUST be defined, normally to the same as Dw.)    #
  136. #   (DD isn't defined until EDIT--02.)                                 #
  137. #                                                                      #
  138. #----------------------------------------------------------------------#
  139. #                                                                      #
  140. #   NOTE:   If you want to support aliases in another domain           #
  141. #        (e.g. snowyowl.com), these are defined later under EDITs   #
  142. #           08 and 09.                                                 #
  143. #                                                                      #
  144. #   NOTE:   You MUST define Cw or sendmail will never recognise        #
  145. #           incoming mail as "local" and will bounce it back to the    #
  146. #           sender.  Normally, the Dw and Cw definitions are identical.#
  147. #                                                                      #
  148. ########################################################################
  149. #---EDIT---01---
  150. Dwhostname
  151. Cwhostname
  152.  
  153.  
  154.  
  155. ########################################################################
  156. #                                                                      #
  157. # Local domain name. (DEFINE THIS IF DOMAINS ARE USED)                 #
  158. # **WARNING**                                                          #
  159. #                                                                      #
  160. # When domain names are used, SMTP transactions utilize the            #
  161. # full domain (official) name of the host. All host names with         #
  162. # no domains (abbreviated) are expanded with the local domain          #
  163. # by the mail service. This is consistent with Internet text standards.#
  164. # All hosts sending or RECEIVING mail must recognize their official    #
  165. # host names. When using domains enter the official host name in       #
  166. # /etc/hosts and be certain that all network nameservers recognize     #
  167. # official host names.                                                 #
  168. #                                                                      #
  169. # Define the D macro to be the whole domain for the local host.        #
  170. # This configuration file supports four part domains. It can be        #
  171. # expanded to support n part domains.                                  #
  172. #                                                                      #
  173. # Example:                                                             #
  174. #                                                                      #      
  175. #   The full domain name of the host is 'snowyowl.demon.co.uk', so     #
  176. #   define the 'D' macro:                                              #
  177. #                                                                      #
  178. #       DDdemon.co.uk                                                  #
  179. #                                                                      #
  180. ########################################################################
  181. #---EDIT---02---
  182. DDfull.domain.name
  183.  
  184. ########################################################################
  185. #                                                                      #
  186. # MAIL RELAY HOST                                                      #
  187. #                                                                      #
  188. # For dialup lines, it is usually desirable to send all outgoing mail  #
  189. # to a 'local' host (usually belonging to the service provider) as     #
  190. # quickly as possible and then leave it to worry about delivery to     #
  191. # remote (and slow) parts of the net.                                  #
  192. #                                                                      #
  193. # Define the 'V' macro as the full domain name of the relay host.      #
  194. # If you don't have a relay host, comment out the DV line below.       #
  195. #                                                                      #
  196. # Example:                                                             #
  197. #                                                                      #
  198. #   All outgoing mail will be sent to 'post.demon.co.uk' for onward    #
  199. #   delivery, so define the 'V' macro:                                 #
  200. #                                                                      #
  201. #       DVpost.demon.co.uk                                             #
  202. #                                                                      #
  203. # NOTE: Please don't use post.demon.co.uk unless you are a demon       #
  204. #       customer.  Use the mail host run by your service provider.     #
  205. #                                                                      #
  206. ########################################################################
  207. #---EDIT---03---
  208. DVmail.relay.host
  209.  
  210.  
  211. # my official host name (includes host name and domain name)
  212. Dj$w$?D.$D$.
  213.  
  214.  
  215. #####################################################
  216. #   Version Number   (YOU MAY CHANGE THIS AS NEEDED)#
  217. #####################################################
  218. DZ3.0ars
  219.  
  220.  
  221. ######################
  222. #   Special macros   #
  223. ######################
  224.  
  225. # my name
  226. DnMAILER-DAEMON
  227. # UNIX header format
  228. #DlFrom $g  $d
  229. DlFrom $g $d remote from $s
  230. # delimiter (operator) characters
  231. Do.:%@!^=/[]
  232. # format of a total name
  233. Dq$g$?x ($x)$.
  234. # SMTP login message
  235. De$j Sendmail $v/$Z ready at $b
  236.  
  237.  
  238. ###############
  239. #   Options   #
  240. ###############
  241.  
  242.  
  243. ########################################################################
  244. #                                                                      #
  245. # LOCATION OF IMPORTANT FILES                                          #
  246. #                                                                      #
  247. ########################################################################
  248.  
  249.  
  250. #=======================================================================
  251. # Location of alias file - use the 'A' option to define the full file
  252. # specification of the sendmail alias file.  It's conventionally called
  253. # \tcpip\etc\aliases on the TCP/IP drive.  Sendmail doesn't mind if this
  254. # file doesn't exist.
  255. #
  256. # Example: OAc:\tcpip\etc\aliases
  257. #=======================================================================
  258. #---EDIT---04---
  259. OAc:\tcpip\etc\aliases
  260.  
  261.  
  262. #=======================================================================
  263. # Location of help file - use the 'H' option to define the full file
  264. # specification of the sendmail help file.  It's conventionally called
  265. # \tcpip\etc\sendmail.hf on the TCP/IP drive.
  266. #
  267. # Example: OHc:\tcpip\etc\sendmail.hf
  268. #=======================================================================
  269. #---EDIT---05---
  270. OHc:\tcpip\etc\sendmail.hf
  271.  
  272.  
  273. #=======================================================================
  274. # Directory used to hold files in the outgoing mail queue - use the 'Q'
  275. # option to define the queue directory.  It's conventionally called
  276. # \tcpip\etc\mqueue on the TCP/IP drive.  Sendmail will crash if this
  277. # directory doesn't exist.
  278. #
  279. # Example: OQc:\tcpip\etc\mqueue
  280. #=======================================================================
  281. #---EDIT---06---
  282. OQc:\tcpip\etc\mqueue
  283.  
  284.  
  285. #=======================================================================
  286. # Location of status file - use the 'S' option to define the full file
  287. # specification of the sendmail status file.  It's conventionally called
  288. # \tcpip\etc\sendmail.st on the TCP/IP drive.  OS/2 sendmail doesn't
  289. # make use of this file so don't worry if you can't find it anywhere.
  290. #
  291. # Example: OSc:\tcpip\etc\sendmail.st
  292. #=======================================================================
  293. #---EDIT---07---
  294. OSc:\tcpip\etc\sendmail.st
  295.  
  296.  
  297. ########################################################################
  298. #                                                                      #
  299. # OTHER SENDMAIL CONFIGURATION OPTIONS                                 #
  300. #                                                                      #
  301. ########################################################################
  302.  
  303. # substitution for space (blank) characters
  304. OB.
  305.  
  306. # (don't) connect to "expensive" mailers
  307. #Oc
  308.  
  309. # default delivery mode
  310. Odbackground
  311.  
  312. # default messages to old style
  313. Oo
  314.  
  315. # queue up everything before starting transmission
  316. Os
  317.  
  318. #=======================================================================
  319. # Time to live in the queue - '7d' means 7 days.
  320. #=======================================================================
  321. OT7d
  322.  
  323. # load average at which we refuse connections
  324. #OX
  325.  
  326. # work recipient factor
  327. #Oy
  328.  
  329. # work msg class factor
  330. #Oz
  331.  
  332. # work time factor
  333. #OZ
  334.  
  335.  
  336. ########################################################################
  337. # Message precedences                                                  #
  338. # Note: could use equal weight so we can let relay decide what to do   #
  339. ########################################################################
  340. Pfirst-class=0
  341. Pspecial-delivery=100
  342. Pbulk=-60
  343. Pjunk=-100
  344.  
  345.  
  346. ########################################################################
  347. # Trusted users                                                        #
  348. ########################################################################
  349. # This parameter is not used by OS/2 Sendmail. 
  350. Tdaemon
  351.  
  352.  
  353. ########################################################################
  354. # Format of headers                                                    #
  355. ########################################################################
  356. # H?P?Return-Path: <$g>
  357. HReceived: $?sfrom $s $.by $j ($v/$Z)
  358.       id $i; $b
  359. H?D?Resent-Date: $a
  360. H?D?Date: $a
  361. H?F?Resent-From: $q
  362. H?F?From: $q
  363. H?x?Full-Name: $x
  364. HSubject:
  365. # HPosted-Date: $a
  366. # H?l?Received-Date: $b
  367. H?M?Resent-Message-Id: <$t.$i@$j>
  368. H?M?Message-Id: <$t.$i@$j>
  369.  
  370.  
  371. ########################################################################
  372. #                                                                      #
  373. #                          REWRITING RULES                             #
  374. #                                                                      #
  375. ########################################################################
  376.  
  377.  
  378. ########################################################################
  379. #                                                                      #
  380. #  The Complete Specification of Canonical Syntax is:                  #
  381. #                                                                      #
  382. #   <ahost>       ::= /* ARPA type host name */                        #
  383. #   <uhost>       ::= /* UUCP type host name */                        #
  384. #   <user>        ::= /* target user name */                           #
  385. #                                                                      #
  386. #   <route_node>  ::= @<ahost>: | <uhost>!                             #   
  387. #   <route_path>  ::= <NULL> | <route_node> | <route_path><route_node> #
  388. #   <target>      ::= <user> | <user>@<ahost>                          #
  389. #                                                                      #
  390. #   <address>     ::= <route_path><target>                             #
  391. #                                                                      #
  392. #  This is what we handle, but actually we only look at the minimum    #
  393. #  required to pass the mail on.  Intermediaries with other syntax/    #
  394. #  semantics may be used, provided the addressing is compatible with   #
  395. #  them when the mail arrives there.                                   #
  396. #                                                                      #
  397. ########################################################################
  398.  
  399.  
  400. ########################################################################
  401. #                                                                      #
  402. #                  THE DYNAMIC MACROS $f AND $g                        #
  403. #                                                                      #
  404. #  Macro $f is defined by the sender address as known the current      #
  405. #  host, via the ruleset sequence:  3, 1, 4.                           #
  406. #                                                                      #
  407. #  Macro $g is defined at delivery time for each separate mailer via   #
  408. #  the ruleset sequence:  3, 1, mailer-S, 4.                           #
  409. #                                                                      #
  410. #  The SMTP "MAIL FROM" address will be $g.                            #
  411. #                                                                      #
  412. #  $g is included in many headers and will be expanded if the header   #
  413. #  is newly created by sendmail.                                       #
  414. #                                                                      #
  415. ########################################################################
  416.  
  417.  
  418. ########################################################################
  419. #                                                                      #
  420. #                         THE SMTP INTERFACE                           #
  421. #                                                                      #
  422. #  The SMTP "MAIL FROM" address will be $g.                            #
  423. #                                                                      #
  424. #  The SMTP "RCPT TO" addresses will be computed from the recipient    #
  425. #  addresses in sendmail by applying the same ruleset sequence as for  #
  426. #  "to" headers:  namely, rulesets 3, 2, mailer-R, 4                   #
  427. #                                                                      #
  428. ########################################################################
  429.  
  430.  
  431. ########################################################################
  432. #                                                                      #
  433. #  S1:  Sender Field Pre-rewriting                                     #
  434. #                                                                      #
  435. #  This ruleset is used when defining the $f macro.  In this case it   #
  436. #  is applied after S3 and before S4.                                  #
  437. #                                                                      #
  438. #  This ruleset is applied to all sender type headers after S3 and     #
  439. #  before the mailer specific sender (S) rewrite rules.                #
  440. #  This ruleset is also applied to $f to create $g.                    #
  441. #                                                                      #
  442. ########################################################################
  443. S1
  444.  
  445.  
  446. ########################################################################
  447. #                                                                      #
  448. #  S2:  Recipient Field Pre-rewriting                                  #
  449. #                                                                      #
  450. #  This ruleset is applied to the user part of the 3-tuple output from #
  451. #  S0.  It is followed by application of the mailer specific recipient #
  452. #  [R] rewrite rules.                                                  #
  453. #                                                                      #
  454. #  This ruleset is applied to all recipient type headers after S3 and  #
  455. #  before the mailer specific recipient (R) rewrite rules.             #
  456. #  This ruleset is likewise used to reform the "to" address for SMTP.  #
  457. #                                                                      #
  458. ########################################################################
  459. S2
  460.  
  461.  
  462. ########################################################################
  463. #                                                                      #
  464. #  S4:  Final Output Post-rewriting   (Return to standard form)        #
  465. #                                                                      #
  466. #  This ruleset is applied to the user part of the 3-tuple produced    #
  467. #  from ruleset 0.  It is applied after the mailer specific recipient  #
  468. #  [R] rules.                                                          #
  469. #                                                                      #
  470. #  This ruleset is applied after S1 when defining the $f macro.        #
  471. #  This ruleset is applied last when creating the $g macro from $f.    #
  472. #                                                                      #
  473. #  This ruleset is applied to all headers after the mailer specific    #
  474. #  rewrite rules (whether recipient or sender) have been applied.      #
  475. #  This ruleset is applied last when computing the RCPT TO address for #
  476. #  SMTP.                                                               #
  477. #                                                                      #
  478. ########################################################################
  479. S4
  480.  
  481. #
  482. #  Change LOCAL or LOCAL.D to the full domain name.
  483. #
  484. R$*<@LOCAL>$*        $:$1<@$w$?D.$D$.>$2
  485. R$*<@LOCAL.D>$*        $:$1<@$w$?D.$D$.>$2
  486. R$*<@$-.LOCAL>$*    $:$1<@$2$?D.$D$.>$3
  487.  
  488. R$*<LOCAL>$*        $:$1<$w$?D.$D$.>$2
  489. R$*<LOCAL.D>$*        $:$1<$w$?D.$D$.>$2
  490. R$*<$-.LOCAL>$*        $:$1<$2$?D.$D$.>$3
  491.  
  492. #
  493. #  Remove focus brackets.
  494. #
  495. R$*<$+>$*        $1$2$3
  496.  
  497.  
  498. ########################################################################
  499. #                                                                      #
  500. #  S3:  Address Canonicalization  (Internal rewriting form)            #
  501. #                                                                      #
  502. #  This ruleset turns an address in external format into a format      #
  503. #  which simplifies internal rewriting.  The inverse ruleset is S4.    #
  504. #  This ruleset is applied first to any external address before other  #
  505. #  rewriting is done.                                                  #
  506. #                                                                      #
  507. #  This concept of canonicalization is to be distinguished from usage  #
  508. #  of the nameserver in the $[/$] construct inside the RHS of rewrite  #
  509. #  rules.  This is also sometimes called "canonicalization", but has   #
  510. #  to do not with the syntax of the address but with obtaining the     #
  511. #  correct domain name for the address.                                #
  512. #                                                                      #
  513. #  No stripping of local domains is done for route addresses:          #
  514. #  Rulesets which require this must do it themselves by iteratively    #
  515. #  stripping LOCAL or LOCAL.D and recalling this ruleset to            #
  516. #  canonicalize the next host.item.                                    #
  517. #                                                                      #
  518. #  The term "localization" refers to determining whether the next host #
  519. #  item is really a reference to the current host.  Localization       #
  520. #  assumes that local UUCP host names are in class w.  This is not     #
  521. #  strictly a necessary restriction, but it simplifies the network     #
  522. #  concept and also makes for simpler rewrite rules.  This ruleset     #
  523. #  replaces explicit instances of local host with the internally       #
  524. #  recognized tag "LOCAL" or "LOCAL.D".                                #
  525. #                                                                      #
  526. #  Addresses which do not specify a host name for routing or domain    #
  527. #  will NOT have any reference to the local host appended in any way.  #
  528. #                                                                      #
  529. ########################################################################
  530. S3
  531.  
  532. #
  533. #  Basic textual canonicalization -- note RFC733 heuristic here.
  534. #  This strips off everything but the innermost list between <>'s.
  535. #  Some addresses are of the format: Full Name <address>
  536. #
  537. R$*<$*<$*<$+>$*>$*>$*    $4        3-level <> nesting
  538. R$*<$*<$+>$*>$*        $3        2-level <> nesting
  539. R$*<$+>$*        $2        basic RFC821/822 parsing
  540.  
  541. #
  542. #  Turn an "at" token into "@".
  543. #
  544. #  The I macro specifies space or some equivalent char defined by the OI
  545. #  config option above.
  546. #
  547. R$+ at $+        $:$1@$2        "at" -> "@" for RFC 822
  548.  
  549. #  Change a%b to a@b. This implies that we support a%b%c... as a route
  550. #  based address from right to left.
  551. #  This form of addressing should go away as full domains are supported.
  552. #
  553. R$+%$-            $1@$2
  554.  
  555. #  ====> NOTE <====
  556. #  This configuration file always evaluates mix mode addresses from
  557. #  left to right. No precedence between @ and ! is assumed. The
  558. #  address a!b@c will resolve to the uucp mailer for the remote host
  559. #  'a'. This permits the resolution of very complex route based
  560. #  addresses such as; @a:@b:c!d!user, a!@b:c!user, a!@b.uucp:user@c.
  561. #  Return addresses on mail to/from AIX level 4 machines are also
  562. #  correct. If you wish the address a!b@c to resolve to the TCP
  563. #  mailer for the remote host 'c' then uncomment the following rewrite
  564. #  rule. This approach is compatible with older versions of sendmail.
  565.  
  566. #  Change a!b@c to @c:a!b
  567. #R$-!$-@$+        @$3:$1!$2
  568.  
  569. #
  570. #  Change commas to colons for route addresses.
  571. #
  572. R$+,$+            $1:$2
  573.  
  574. #
  575. #  Pick out route addresses.  Focus and call localizer.
  576. #
  577. R@$+:$+            $@$>9<@$1>:$2        handle <route-addr>
  578. R$-!$+            $@$>8<$1>!$2        UUCP route
  579.  
  580. #  Detect domain!user. Internally convert to user@domain (RFC976).
  581. #  Rule set 8 will detect local addresses and strip any trailing
  582. #  periods.
  583. R$-.$*!$+                $@$>8<$1.$2>!$3
  584.  
  585. #
  586. #  Detect local domain for nonroute addresses.  Focus and localize.
  587. R$+@$+            $:$1<@$2>
  588. R$+<@$=w.$D>        $@$1<@LOCAL.D>
  589. R$+<@$=w>        $@$1<@LOCAL>
  590. R$+<@$=w.UUCP>        $@$1<@LOCAL>
  591.  
  592.  
  593. ##############################################################################
  594. #
  595. # Treat other addresses as aliases for the local machine.  The rules must
  596. # be presented in the form:
  597. #
  598. #   R$+<@site.domain>[TAB]$@$1<@LOCAL>
  599. #
  600. # where [TAB] is a TAB character.
  601. #
  602. # Example:
  603. #
  604. #   We recognise mail sent to our aliases of 'snowyowl.com', 'snowyowl.co.uk'
  605. #   and 'sos.co.uk' and treat it as local mail by defining three extra
  606. #   rules:
  607. #
  608. #    R$+<@snowyowl.com>        $@$1<@LOCAL>
  609. #    R$+<@snowyowl.co.uk>        $@$1<@LOCAL>
  610. #    R$+<@sos.co.uk>            $@$1<@LOCAL>
  611. #
  612. # NOTE: if you don't have a registered domain name for mail that is different
  613. #       from your official host name (as defined by EDITs 01 & 02), you
  614. #       don't want these extra rewriting rules.  If this is the case,
  615. #       please leave the three lines under EDIT---08 commented out.
  616. #
  617. ##############################################################################
  618. #---EDIT---08---
  619. #R$+<@full.domain.name>        $@$1<@LOCAL>
  620.  
  621.  
  622. #=============================================================================
  623. # Normal addresses in the form "user<@domain.name>" are left untouched, 
  624. # but this rule is present to catch local addresses (i.e. those not containing
  625. # an "@").
  626. #=============================================================================
  627. R$+<@$+>            $@$1<@$2>
  628.  
  629. #
  630. # Anything getting this far is treated as a local name, including simple 
  631. # names.  They will NOT have an appended domain.
  632. # This is so the $f macro definition will be the sender address
  633. # as known locally.
  634. #
  635. R$+                $:$1<@LOCAL>        # just a user name
  636.  
  637.  
  638.  
  639. ########################################################################
  640. #                                                                      #
  641. #  S9:    Localize ARPA type route path.                                 #
  642. #                                                                      #
  643. #  This is used only by S3.                                            #
  644. #                                                                      #
  645. ########################################################################
  646. S9
  647.  
  648. R<@$=w.$D>:$*            $@<@LOCAL.D>:$2
  649. R<@$=w>:$*            $@<@LOCAL>:$2
  650. R<@$=w.UUCP>:$*            $@<@LOCAL>:$2
  651.  
  652.  
  653. ##############################################################################
  654. #
  655. # Strip off any of our aliases from the beginning of a routed mail address.
  656. # Incoming mail can often be addressed in the form:
  657. #
  658. #   @snowyowl.demon.co.uk:kempson@snowyowl.com
  659. #
  660. # and its useful to strip off the unnecessary routing hop if the first
  661. # one is actually local.
  662. #
  663. # The rules must be presented in the form:
  664. #
  665. #   R<@host.site.domain>:$*[TAB]$@<@LOCAL>:$1
  666. #
  667. # where [TAB] is a TAB character.
  668. #
  669. # Example:
  670. #
  671. #   We recognise mail sent to our aliases of 'snowyowl.com', 'snowyowl.co.uk'
  672. #   and 'sos.co.uk' and treat it as local mail by defining three extra
  673. #   rules:
  674. #
  675. #       R<@snowyowl.com>:$*        $@<@LOCAL>:$1
  676. #       R<@snowyowl.co.uk>:$*        $@<@LOCAL>:$1
  677. #       R<@sos.co.uk>:$*        $@<@LOCAL>:$1
  678. #
  679. # NOTE: if you don't have a registered domain name for mail that is different
  680. #       from your official host name (as defined by EDITs 01 & 02), you
  681. #       don't want these extra rewriting rules.  If this is the case,
  682. #       please leave the three lines under EDIT---09 commented out.
  683. #
  684. ##############################################################################
  685. #---EDIT---09---
  686. #R<@full.domain.name>:$*        $@<@LOCAL>:$1
  687.  
  688.  
  689.  
  690.  
  691. ########################################################################
  692. #                                                                      #
  693. #                              MAILERS                                 #
  694. #                                                                      #
  695. ########################################################################
  696.  
  697.  
  698. ########################################################################
  699. #                                                                      #
  700. # LOCAL AND PROGRAM MAILER SPECIFICATION                               #
  701. #                                                                      #
  702. # Mail for this host is presented to the "local" mailer for delivery.  #
  703. #                                                                      #
  704. #                                                                      #
  705. # Local delivery to UltiMail/2                                         #
  706. # ----------------------------                                         #
  707. #                                                                      #
  708. #   We want to pass incoming mail to the UMAILER program provided with #
  709. #   UltiMail/2 Lite - it accepts messages and stores them in           #
  710. #   UltiMail's In-Basket folder.                                       #
  711. #                                                                      #
  712. #   The 'local' mailer should be defined as:                           #
  713. #                                                                      #
  714. #     Mlocal, P=c:\tcpip\umail\umailer.exe, F=lsDFPM, S=10, R=20,      #
  715. #             A=-dest c:\tcpip\umail\server\inbox -to $u               #
  716. #                                                                      #
  717. #                                                                      #
  718. # Local delivery to LAMail                                             #
  719. # ------------------------                                             #
  720. #                                                                      #
  721. #   We want to pass such mail to LAMail for delivery to its InBox.     #
  722. #   There is no explicit .exe program used to perform the delivery -   #
  723. #   a DLL provided by LAMail is used instead.  An 'Mlocal' definition  #
  724. #   is still needed and it should look like this:                      #
  725. #                                                                      #
  726. #     Mlocal, P=c:\tcpip\etc\mail.exe, F=lsDFPM, S=10, R=20,           #
  727. #             A=c:\tcpip\etc\mail $u                                   #
  728. #                                                                      #
  729. #   Warning: there MUST NOT be a real "c:\tcpip\etc\mail.exe" program, #
  730. #         or mail will be passed to it instead of the LAMail DLL.   #
  731. #                                                                      #
  732. # NOTE                                                                 #
  733. # ----                                                                 #
  734. #   The Mlocal definitions must be on one line only - they have been   #
  735. #   wrapped in the examples above to make them more easy to read.      #
  736. #                                                                      #
  737. #   THE Mlocal DEFINITIONS MUST BE ON ONE LINE ONLY - they have been   #
  738. #   wrapped in the examples above to make them more easy to read.      #
  739. #                                                                      #
  740. ########################################################################
  741. #---EDIT---10---
  742.  
  743. #
  744. # delivery
  745. #
  746. Mlocal, P=c:\tcpip\bin\rcvmail.exe, F=lsDFPM,  S=10, R=20, A=-u c:/tcpip/mail $u
  747.  
  748. #
  749. # UltiMail/2 delivery
  750. #
  751. #Mlocal, P=c:\tcpip\umail\umailer.exe, F=lsDFPM, S=10, R=20, A=-dest c:\tcpip\umail\server\inbox -to $u
  752.  
  753. #
  754. #LAMail delivery
  755. #
  756. #Mlocal, P=c:\tcpip\bin\mail.exe, F=lsDFPM, S=10, R=20, A=c:\tcpip\etc\mail $u
  757.  
  758. Mprog,  P=/bin/sh,         F=lsDFM,   S=10, R=20, A=sh -c $u
  759.  
  760.  
  761.  
  762. ########################################################################
  763. #                                                                      #
  764. #  S10:  Local/Prog Mailers Sender rules                               #
  765. #                                                                      #
  766. ########################################################################
  767. S10
  768.  
  769.  
  770. ########################################################################
  771. #                                                                      #
  772. #  S20:  Local/Prog Mailers Recipient rules                            #
  773. #                                                                      #
  774. ########################################################################
  775. S20
  776.  
  777.  
  778. ########################################################################
  779. #                                                                      #
  780. #                      TCP Mailer Specification                        #
  781. #                                                                      #
  782. ########################################################################
  783. Mtcp,     P=[IPC], F=mDFMueXL,  S=14, R=24, A=IPC $h
  784.  
  785.  
  786. ########################################################################
  787. #                                                                      #
  788. #  S14:  TCP Mailer Sender Rules                                       #
  789. #                                                                      #
  790. #  This ruleset is applied in the following circumstances:             #
  791. #                                                                      #
  792. #  1)  To process sender type headers.  These have header names:       #
  793. #                                                                      #
  794. #       "resent-sender"                                                #
  795. #       "resent-from"                                                  #
  796. #       "resent-reply-to"                                              #
  797. #       "sender"                                                       #
  798. #       "from"                                                         #
  799. #       "reply-to"                                                     #
  800. #       "return-receipt-to"                                            #
  801. #       "errors-to"                                                    #
  802. #                                                                      #
  803. #  2)  To define the $g macro from the $f macro.                       #
  804. #                                                                      #
  805. #  In either case, it is applied after ruleset 1, and is followed by   #
  806. #  ruleset 4.                                                          #
  807. #                                                                      #
  808. #  Watch out if one of those headers is newly created and includes the #
  809. #  expanded $g macro!  This ruleset will have been used to create $g,  #
  810. #  and will then be applied to the result of the expansion of $g.      #
  811. #  This ruleset must handle this!                                      #
  812. #                                                                      #
  813. #  The $g macro is used in many places.                                #
  814. #                                                                      #
  815. ########################################################################
  816. S14
  817.  
  818.  
  819.  
  820. ########################################################################
  821. #                                                                      #
  822. #  S24:  TCP Mailer Recipient rules                                    #
  823. #                                                                      #
  824. #  This ruleset is applied in the following cases:                     #
  825. #                                                                      #
  826. #  1)  To process recipient type headers being sent out through this   #
  827. #      mailer.  These headers are the ones with header names:          #
  828. #                                                                      #
  829. #       "to"                                                           #
  830. #       "resent-to"                                                    #
  831. #       "cc"                                                           #
  832. #       "resent-cc"                                                    #
  833. #       "bcc"                                                          #
  834. #       "resent-bcc"                                                   #
  835. #                                                                      #
  836. #     but NOT:                                                         #
  837. #                                                                      #
  838. #       "Apparently-to"                                                #
  839. #                                                                      #
  840. #  2)  To process the user part of the 3-tuple from S0 which resolves  #
  841. #      to this mailer.  This is the complete "to" address for ordinary #
  842. #      tcp usage, or is the original UUCP path if we are relaying      #
  843. #      using DU.                                                       #
  844. #                                                                      #
  845. #  3)  To process the "to" address to form the SMTP RCPT TO address.   #
  846. #                                                                      #
  847. #  In all cases, this ruleset is applied after ruleset 2, and is       #
  848. #  followed by ruleset 4.                                              #
  849. #                                                                      #
  850. #  Remember that this ruleset applies to all "to" type headers in the  #
  851. #  mail transmitted via this mailer.  This does not include            #
  852. #  "Apparently-to:" headers.  Not all "To:" headers point to the       #
  853. #  current mail target!  For instance, if the mail originated on this  #
  854. #  host and some targets were local, there may be local "To:" headers  #
  855. #  that must be processed by this ruleset!  The idea here is to make   #
  856. #  sure that the headers will be properly understood in the context of #
  857. #  the next host to which the mail will go.                            #
  858. #                                                                      #
  859. ########################################################################
  860. S24
  861.  
  862. #
  863. #  Leave route based addresses alone.  They are already completely
  864. #  intelligible in any context.
  865. #
  866. R<$+>$+            $@<$1>$2
  867.  
  868. #
  869. #  Fully qualify our host name with full domain.
  870. #
  871. R$+<@LOCAL>        $@$1<@LOCAL.D>
  872.  
  873. #
  874. #  Fully qualify nonlocal host names in our local domain.
  875. #
  876. R$+<@$->        $@$1<@$2.LOCAL>
  877.  
  878. #
  879. #  Leave all other typical domain addresses alone.
  880. #
  881. R$+<$+>            $@$1<$2>
  882.  
  883. #
  884. #  Append full local domain where none exists at all.  This handles the
  885. #  case of local targets whose (missing) host would cause misunderstanding
  886. #  in the next host.
  887. #
  888. R$+            $@$1<@LOCAL.D>
  889.  
  890.  
  891. ########################################################################
  892. #                                                                      #
  893. #      Rule Zero                                                       #
  894. #                                                                      #
  895. #  Resolve sender or recipient address to mailer/host/user 3-tuple.    #
  896. #  This may require iteration in use of S3 to strip leading route      #
  897. #  items which pertain to the current host.                            #
  898. #                                                                      #
  899. #  Sendmail will pass the user portion of the 3-tuple through ruleset  #
  900. #  2 + the mailer specific recipient ruleset + ruleset 4.              #
  901. #                                                                      #
  902. ########################################################################
  903. S0
  904.  
  905. #
  906. #  Handle route addresses that begin with LOCAL or LOCAL.D
  907. #
  908. R<$*LOCAL$*>$-$+    $>3$4
  909.  
  910. #  Change a%b<$*> to <$*>:a@b.
  911. #  This form of addressing should go away as full domains are supported.
  912. #
  913. R$+%$-<$*>        <$3>:$1@$2
  914.  
  915. #
  916. #  Handle explicit local delivery.
  917. #
  918. #  The entire prefix is treated as local user.
  919. R$+<@LOCAL$*>        $#local $:$1
  920.  
  921. #
  922. #  Canonicalize anything else which has an @focus.  This excludes simple
  923. #  names, which are local.
  924. #
  925. R$*<@$+>$*        $:$1<@$[$2$]>$3
  926.  
  927. #=============================================================================
  928. # Send domain address (including domain literals or IP quads) to the mail
  929. # relay defined by macro 'V' for onward delivery.  If macro 'V' hasn't been 
  930. # defined, attempt delivery directly.
  931. #=============================================================================
  932. R$*<@$+>$*        $#tcp $?V $@$V $:$1<@$2>$3 $| $@$2 $:$1<@$2>$3 $.
  933.  
  934. #
  935. #  Remaining names must be local.
  936. #  User is whatever is left.
  937. #
  938. R$+            $#local $:$1
  939.  
  940.