home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / umsmtp03.zip / sendmail.uml < prev    next >
Text File  |  1995-04-16  |  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. Dwsnowyowl
  151. Cwsnowyowl
  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. DDdemon.co.uk
  183.  
  184.  
  185.  
  186. ########################################################################
  187. #                                                                      #
  188. # MAIL RELAY HOST                                                      #
  189. #                                                                      #
  190. # For dialup lines, it is usually desirable to send all outgoing mail  #
  191. # to a 'local' host (usually belonging to the service provider) as     #
  192. # quickly as possible and then leave it to worry about delivery to     #
  193. # remote (and slow) parts of the net.                                  #
  194. #                                                                      #
  195. # Define the 'V' macro as the full domain name of the relay host.      #
  196. # If you don't have a relay host, comment out the DV line below.       #
  197. #                                                                      #
  198. # Example:                                                             #
  199. #                                                                      #
  200. #   All outgoing mail will be sent to 'post.demon.co.uk' for onward    #
  201. #   delivery, so define the 'V' macro:                                 #
  202. #                                                                      #
  203. #       DVpost.demon.co.uk                                             #
  204. #                                                                      #
  205. # NOTE: Please don't use post.demon.co.uk unless you are a demon       #
  206. #       customer.  Use the mail host run by your service provider.     #
  207. #                                                                      #
  208. ########################################################################
  209. #---EDIT---03---
  210. DVpost.demon.co.uk
  211.  
  212.  
  213. # my official host name (includes host name and domain name)
  214. Dj$w$?D.$D$.
  215.  
  216.  
  217. #####################################################
  218. #   Version Number   (YOU MAY CHANGE THIS AS NEEDED)#
  219. #####################################################
  220. DZ3.0sos
  221.  
  222.  
  223. ######################
  224. #   Special macros   #
  225. ######################
  226.  
  227. # my name
  228. DnMAILER-DAEMON
  229. # UNIX header format
  230. DlFrom $g  $d
  231. # delimiter (operator) characters
  232. Do.:%@!^=/[]
  233. # format of a total name
  234. Dq$g$?x ($x)$.
  235. # SMTP login message
  236. De$j Sendmail $v/$Z ready at $b
  237.  
  238.  
  239. ###############
  240. #   Options   #
  241. ###############
  242.  
  243.  
  244. ########################################################################
  245. #                                                                      #
  246. # LOCATION OF IMPORTANT FILES                                          #
  247. #                                                                      #
  248. ########################################################################
  249.  
  250.  
  251. #=======================================================================
  252. # Location of alias file - use the 'A' option to define the full file
  253. # specification of the sendmail alias file.  It's conventionally called
  254. # \tcpip\etc\aliases on the TCP/IP drive.  Sendmail doesn't mind if this
  255. # file doesn't exist.
  256. #
  257. # Example: OAc:\tcpip\etc\aliases
  258. #=======================================================================
  259. #---EDIT---04---
  260. OAc:\tcpip\etc\aliases
  261.  
  262.  
  263. #=======================================================================
  264. # Location of help file - use the 'H' option to define the full file
  265. # specification of the sendmail help file.  It's conventionally called
  266. # \tcpip\etc\sendmail.hf on the TCP/IP drive.
  267. #
  268. # Example: OHc:\tcpip\etc\sendmail.hf
  269. #=======================================================================
  270. #---EDIT---05---
  271. OHc:\tcpip\etc\sendmail.hf
  272.  
  273.  
  274. #=======================================================================
  275. # Directory used to hold files in the outgoing mail queue - use the 'Q'
  276. # option to define the queue directory.  It's conventionally called
  277. # \tcpip\etc\mqueue on the TCP/IP drive.  Sendmail will crash if this
  278. # directory doesn't exist.
  279. #
  280. # Example: OQc:\tcpip\etc\mqueue
  281. #=======================================================================
  282. #---EDIT---06---
  283. OQc:\tcpip\etc\mqueue
  284.  
  285.  
  286. #=======================================================================
  287. # Location of status file - use the 'S' option to define the full file
  288. # specification of the sendmail status file.  It's conventionally called
  289. # \tcpip\etc\sendmail.st on the TCP/IP drive.  OS/2 sendmail doesn't
  290. # make use of this file so don't worry if you can't find it anywhere.
  291. #
  292. # Example: OSc:\tcpip\etc\sendmail.st
  293. #=======================================================================
  294. #---EDIT---07---
  295. OSc:\tcpip\etc\sendmail.st
  296.  
  297.  
  298. ########################################################################
  299. #                                                                      #
  300. # OTHER SENDMAIL CONFIGURATION OPTIONS                                 #
  301. #                                                                      #
  302. ########################################################################
  303.  
  304. # substitution for space (blank) characters
  305. OB.
  306.  
  307. # (don't) connect to "expensive" mailers
  308. #Oc
  309.  
  310. # default delivery mode
  311. Odbackground
  312.  
  313. # default messages to old style
  314. Oo
  315.  
  316. # queue up everything before starting transmission
  317. Os
  318.  
  319. #=======================================================================
  320. # Time to live in the queue - '7d' means 7 days.
  321. #=======================================================================
  322. OT7d
  323.  
  324. # load average at which we refuse connections
  325. #OX
  326.  
  327. # work recipient factor
  328. #Oy
  329.  
  330. # work msg class factor
  331. #Oz
  332.  
  333. # work time factor
  334. #OZ
  335.  
  336.  
  337. ########################################################################
  338. # Message precedences                                                  #
  339. # Note: could use equal weight so we can let relay decide what to do   #
  340. ########################################################################
  341. Pfirst-class=0
  342. Pspecial-delivery=100
  343. Pbulk=-60
  344. Pjunk=-100
  345.  
  346.  
  347. ########################################################################
  348. # Trusted users                                                        #
  349. ########################################################################
  350. # This parameter is not used by OS/2 Sendmail. 
  351. Tdaemon
  352.  
  353.  
  354. ########################################################################
  355. # Format of headers                                                    #
  356. ########################################################################
  357. H?P?Return-Path: <$g>
  358. HReceived: $?sfrom $s $.by $j ($v/($Z)
  359.       id $i; $b
  360. H?D?Resent-Date: $a
  361. H?D?Date: $a
  362. H?F?Resent-From: $q
  363. H?F?From: $q
  364. H?x?Full-Name: $x
  365. HSubject:
  366. # HPosted-Date: $a
  367. # H?l?Received-Date: $b
  368. H?M?Resent-Message-Id: <$t.$i@$j>
  369. H?M?Message-Id: <$t.$i@$j>
  370.  
  371.  
  372. ########################################################################
  373. #                                                                      #
  374. #                          REWRITING RULES                             #
  375. #                                                                      #
  376. ########################################################################
  377.  
  378.  
  379. ########################################################################
  380. #                                                                      #
  381. #  The Complete Specification of Canonical Syntax is:                  #
  382. #                                                                      #
  383. #   <ahost>       ::= /* ARPA type host name */                        #
  384. #   <uhost>       ::= /* UUCP type host name */                        #
  385. #   <user>        ::= /* target user name */                           #
  386. #                                                                      #
  387. #   <route_node>  ::= @<ahost>: | <uhost>!                             #   
  388. #   <route_path>  ::= <NULL> | <route_node> | <route_path><route_node> #
  389. #   <target>      ::= <user> | <user>@<ahost>                          #
  390. #                                                                      #
  391. #   <address>     ::= <route_path><target>                             #
  392. #                                                                      #
  393. #  This is what we handle, but actually we only look at the minimum    #
  394. #  required to pass the mail on.  Intermediaries with other syntax/    #
  395. #  semantics may be used, provided the addressing is compatible with   #
  396. #  them when the mail arrives there.                                   #
  397. #                                                                      #
  398. ########################################################################
  399.  
  400.  
  401. ########################################################################
  402. #                                                                      #
  403. #                  THE DYNAMIC MACROS $f AND $g                        #
  404. #                                                                      #
  405. #  Macro $f is defined by the sender address as known the current      #
  406. #  host, via the ruleset sequence:  3, 1, 4.                           #
  407. #                                                                      #
  408. #  Macro $g is defined at delivery time for each separate mailer via   #
  409. #  the ruleset sequence:  3, 1, mailer-S, 4.                           #
  410. #                                                                      #
  411. #  The SMTP "MAIL FROM" address will be $g.                            #
  412. #                                                                      #
  413. #  $g is included in many headers and will be expanded if the header   #
  414. #  is newly created by sendmail.                                       #
  415. #                                                                      #
  416. ########################################################################
  417.  
  418.  
  419. ########################################################################
  420. #                                                                      #
  421. #                         THE SMTP INTERFACE                           #
  422. #                                                                      #
  423. #  The SMTP "MAIL FROM" address will be $g.                            #
  424. #                                                                      #
  425. #  The SMTP "RCPT TO" addresses will be computed from the recipient    #
  426. #  addresses in sendmail by applying the same ruleset sequence as for  #
  427. #  "to" headers:  namely, rulesets 3, 2, mailer-R, 4                   #
  428. #                                                                      #
  429. ########################################################################
  430.  
  431.  
  432. ########################################################################
  433. #                                                                      #
  434. #  S1:  Sender Field Pre-rewriting                                     #
  435. #                                                                      #
  436. #  This ruleset is used when defining the $f macro.  In this case it   #
  437. #  is applied after S3 and before S4.                                  #
  438. #                                                                      #
  439. #  This ruleset is applied to all sender type headers after S3 and     #
  440. #  before the mailer specific sender (S) rewrite rules.                #
  441. #  This ruleset is also applied to $f to create $g.                    #
  442. #                                                                      #
  443. ########################################################################
  444. S1
  445.  
  446.  
  447. ########################################################################
  448. #                                                                      #
  449. #  S2:  Recipient Field Pre-rewriting                                  #
  450. #                                                                      #
  451. #  This ruleset is applied to the user part of the 3-tuple output from #
  452. #  S0.  It is followed by application of the mailer specific recipient #
  453. #  [R] rewrite rules.                                                  #
  454. #                                                                      #
  455. #  This ruleset is applied to all recipient type headers after S3 and  #
  456. #  before the mailer specific recipient (R) rewrite rules.             #
  457. #  This ruleset is likewise used to reform the "to" address for SMTP.  #
  458. #                                                                      #
  459. ########################################################################
  460. S2
  461.  
  462.  
  463. ########################################################################
  464. #                                                                      #
  465. #  S4:  Final Output Post-rewriting   (Return to standard form)        #
  466. #                                                                      #
  467. #  This ruleset is applied to the user part of the 3-tuple produced    #
  468. #  from ruleset 0.  It is applied after the mailer specific recipient  #
  469. #  [R] rules.                                                          #
  470. #                                                                      #
  471. #  This ruleset is applied after S1 when defining the $f macro.        #
  472. #  This ruleset is applied last when creating the $g macro from $f.    #
  473. #                                                                      #
  474. #  This ruleset is applied to all headers after the mailer specific    #
  475. #  rewrite rules (whether recipient or sender) have been applied.      #
  476. #  This ruleset is applied last when computing the RCPT TO address for #
  477. #  SMTP.                                                               #
  478. #                                                                      #
  479. ########################################################################
  480. S4
  481.  
  482. #
  483. #  Change LOCAL or LOCAL.D to the full domain name.
  484. #
  485. R$*<@LOCAL>$*        $:$1<@$w$?D.$D$.>$2
  486. R$*<@LOCAL.D>$*        $:$1<@$w$?D.$D$.>$2
  487. R$*<@$-.LOCAL>$*    $:$1<@$2$?D.$D$.>$3
  488.  
  489. R$*<LOCAL>$*        $:$1<$w$?D.$D$.>$2
  490. R$*<LOCAL.D>$*        $:$1<$w$?D.$D$.>$2
  491. R$*<$-.LOCAL>$*        $:$1<$2$?D.$D$.>$3
  492.  
  493. #
  494. #  Remove focus brackets.
  495. #
  496. R$*<$+>$*        $1$2$3
  497.  
  498.  
  499. ########################################################################
  500. #                                                                      #
  501. #  S3:  Address Canonicalization  (Internal rewriting form)            #
  502. #                                                                      #
  503. #  This ruleset turns an address in external format into a format      #
  504. #  which simplifies internal rewriting.  The inverse ruleset is S4.    #
  505. #  This ruleset is applied first to any external address before other  #
  506. #  rewriting is done.                                                  #
  507. #                                                                      #
  508. #  This concept of canonicalization is to be distinguished from usage  #
  509. #  of the nameserver in the $[/$] construct inside the RHS of rewrite  #
  510. #  rules.  This is also sometimes called "canonicalization", but has   #
  511. #  to do not with the syntax of the address but with obtaining the     #
  512. #  correct domain name for the address.                                #
  513. #                                                                      #
  514. #  No stripping of local domains is done for route addresses:          #
  515. #  Rulesets which require this must do it themselves by iteratively    #
  516. #  stripping LOCAL or LOCAL.D and recalling this ruleset to            #
  517. #  canonicalize the next host.item.                                    #
  518. #                                                                      #
  519. #  The term "localization" refers to determining whether the next host #
  520. #  item is really a reference to the current host.  Localization       #
  521. #  assumes that local UUCP host names are in class w.  This is not     #
  522. #  strictly a necessary restriction, but it simplifies the network     #
  523. #  concept and also makes for simpler rewrite rules.  This ruleset     #
  524. #  replaces explicit instances of local host with the internally       #
  525. #  recognized tag "LOCAL" or "LOCAL.D".                                #
  526. #                                                                      #
  527. #  Addresses which do not specify a host name for routing or domain    #
  528. #  will NOT have any reference to the local host appended in any way.  #
  529. #                                                                      #
  530. ########################################################################
  531. S3
  532.  
  533. #
  534. #  Basic textual canonicalization -- note RFC733 heuristic here.
  535. #  This strips off everything but the innermost list between <>'s.
  536. #  Some addresses are of the format: Full Name <address>
  537. #
  538. R$*<$*<$*<$+>$*>$*>$*    $4        3-level <> nesting
  539. R$*<$*<$+>$*>$*        $3        2-level <> nesting
  540. R$*<$+>$*        $2        basic RFC821/822 parsing
  541.  
  542. #
  543. #  Turn an "at" token into "@".
  544. #
  545. #  The I macro specifies space or some equivalent char defined by the OI
  546. #  config option above.
  547. #
  548. R$+ at $+        $:$1@$2        "at" -> "@" for RFC 822
  549.  
  550. #  Change a%b to a@b. This implies that we support a%b%c... as a route
  551. #  based address from right to left.
  552. #  This form of addressing should go away as full domains are supported.
  553. #
  554. R$+%$-            $1@$2
  555.  
  556. #  ====> NOTE <====
  557. #  This configuration file always evaluates mix mode addresses from
  558. #  left to right. No precedence between @ and ! is assumed. The
  559. #  address a!b@c will resolve to the uucp mailer for the remote host
  560. #  'a'. This permits the resolution of very complex route based
  561. #  addresses such as; @a:@b:c!d!user, a!@b:c!user, a!@b.uucp:user@c.
  562. #  Return addresses on mail to/from AIX level 4 machines are also
  563. #  correct. If you wish the address a!b@c to resolve to the TCP
  564. #  mailer for the remote host 'c' then uncomment the following rewrite
  565. #  rule. This approach is compatible with older versions of sendmail.
  566.  
  567. #  Change a!b@c to @c:a!b
  568. #R$-!$-@$+        @$3:$1!$2
  569.  
  570. #
  571. #  Change commas to colons for route addresses.
  572. #
  573. R$+,$+            $1:$2
  574.  
  575. #
  576. #  Pick out route addresses.  Focus and call localizer.
  577. #
  578. R@$+:$+            $@$>9<@$1>:$2        handle <route-addr>
  579. R$-!$+            $@$>8<$1>!$2        UUCP route
  580.  
  581. #  Detect domain!user. Internally convert to user@domain (RFC976).
  582. #  Rule set 8 will detect local addresses and strip any trailing
  583. #  periods.
  584. R$-.$*!$+                $@$>8<$1.$2>!$3
  585.  
  586. #
  587. #  Detect local domain for nonroute addresses.  Focus and localize.
  588. R$+@$+            $:$1<@$2>
  589. R$+<@$=w.$D>        $@$1<@LOCAL.D>
  590. R$+<@$=w>        $@$1<@LOCAL>
  591. R$+<@$=w.UUCP>        $@$1<@LOCAL>
  592.  
  593.  
  594. ##############################################################################
  595. #
  596. # Treat other addresses as aliases for the local machine.  The rules must
  597. # be presented in the form:
  598. #
  599. #   R$+<@site.domain>[TAB]$@$1<@LOCAL>
  600. #
  601. # where [TAB] is a TAB character.
  602. #
  603. # Example:
  604. #
  605. #   We recognise mail sent to our aliases of 'snowyowl.com', 'snowyowl.co.uk'
  606. #   and 'sos.co.uk' and treat it as local mail by defining three extra
  607. #   rules:
  608. #
  609. #    R$+<@snowyowl.com>        $@$1<@LOCAL>
  610. #    R$+<@snowyowl.co.uk>        $@$1<@LOCAL>
  611. #    R$+<@sos.co.uk>            $@$1<@LOCAL>
  612. #
  613. # NOTE: if you don't have a registered domain name for mail that is different
  614. #       from your official host name (as defined by EDITs 01 & 02), you
  615. #       don't want these extra rewriting rules.  If this is the case,
  616. #       please leave the three lines under EDIT---08 commented out.
  617. #
  618. ##############################################################################
  619. #---EDIT---08---
  620. #R$+<@snowyowl.com>        $@$1<@LOCAL>
  621. #R$+<@snowyowl.co.uk>        $@$1<@LOCAL>
  622. #R$+<@sos.co.uk>            $@$1<@LOCAL>
  623.  
  624.  
  625. #=============================================================================
  626. # Normal addresses in the form "user<@domain.name>" are left untouched, 
  627. # but this rule is present to catch local addresses (i.e. those not containing
  628. # an "@").
  629. #=============================================================================
  630. R$+<@$+>            $@$1<@$2>
  631.  
  632. #
  633. # Anything getting this far is treated as a local name, including simple 
  634. # names.  They will NOT have an appended domain.
  635. # This is so the $f macro definition will be the sender address
  636. # as known locally.
  637. #
  638. R$+                $:$1<@LOCAL>        # just a user name
  639.  
  640.  
  641.  
  642. ########################################################################
  643. #                                                                      #
  644. #  S9:    Localize ARPA type route path.                                 #
  645. #                                                                      #
  646. #  This is used only by S3.                                            #
  647. #                                                                      #
  648. ########################################################################
  649. S9
  650.  
  651. R<@$=w.$D>:$*            $@<@LOCAL.D>:$2
  652. R<@$=w>:$*            $@<@LOCAL>:$2
  653. R<@$=w.UUCP>:$*            $@<@LOCAL>:$2
  654.  
  655.  
  656. ##############################################################################
  657. #
  658. # Strip off any of our aliases from the beginning of a routed mail address.
  659. # Incoming mail can often be addressed in the form:
  660. #
  661. #   @snowyowl.demon.co.uk:kempson@snowyowl.com
  662. #
  663. # and its useful to strip off the unnecessary routing hop if the first
  664. # one is actually local.
  665. #
  666. # The rules must be presented in the form:
  667. #
  668. #   R<@host.site.domain>:$*[TAB]$@<@LOCAL>:$1
  669. #
  670. # where [TAB] is a TAB character.
  671. #
  672. # Example:
  673. #
  674. #   We recognise mail sent to our aliases of 'snowyowl.com', 'snowyowl.co.uk'
  675. #   and 'sos.co.uk' and treat it as local mail by defining three extra
  676. #   rules:
  677. #
  678. #       R<@snowyowl.com>:$*        $@<@LOCAL>:$1
  679. #       R<@snowyowl.co.uk>:$*        $@<@LOCAL>:$1
  680. #       R<@sos.co.uk>:$*        $@<@LOCAL>:$1
  681. #
  682. # NOTE: if you don't have a registered domain name for mail that is different
  683. #       from your official host name (as defined by EDITs 01 & 02), you
  684. #       don't want these extra rewriting rules.  If this is the case,
  685. #       please leave the three lines under EDIT---09 commented out.
  686. #
  687. ##############################################################################
  688. #---EDIT---09---
  689. #R<@snowyowl.com>:$*        $@<@LOCAL>:$1
  690. #R<@snowyowl.co.uk>:$*        $@<@LOCAL>:$1
  691. #R<@sos.co.uk>:$*        $@<@LOCAL>:$1
  692.  
  693.  
  694.  
  695.  
  696. ########################################################################
  697. #                                                                      #
  698. #                              MAILERS                                 #
  699. #                                                                      #
  700. ########################################################################
  701.  
  702.  
  703. ########################################################################
  704. #                                                                      #
  705. # LOCAL AND PROGRAM MAILER SPECIFICATION                               #
  706. #                                                                      #
  707. # Mail for this host is presented to the "local" mailer for delivery.  #
  708. #                                                                      #
  709. #                                                                      #
  710. # Local delivery to UltiMail/2                                         #
  711. # ----------------------------                                         #
  712. #                                                                      #
  713. #   We want to pass incoming mail to the UMAILER program provided with #
  714. #   UltiMail/2 Lite - it accepts messages and stores them in           #
  715. #   UltiMail's In-Basket folder.                                       #
  716. #                                                                      #
  717. #   The 'local' mailer should be defined as:                           #
  718. #                                                                      #
  719. #     Mlocal, P=c:\tcpip\umail\umailer.exe, F=lsDFPM, S=10, R=20,      #
  720. #             A=-dest c:\tcpip\umail\server\inbox -to $u               #
  721. #                                                                      #
  722. #                                                                      #
  723. # Local delivery to LAMail                                             #
  724. # ------------------------                                             #
  725. #                                                                      #
  726. #   We want to pass such mail to LAMail for delivery to its InBox.     #
  727. #   There is no explicit .exe program used to perform the delivery -   #
  728. #   a DLL provided by LAMail is used instead.  An 'Mlocal' definition  #
  729. #   is still needed and it should look like this:                      #
  730. #                                                                      #
  731. #     Mlocal, P=c:\tcpip\etc\mail.exe, F=lsDFPM, S=10, R=20,           #
  732. #             A=c:\tcpip\etc\mail $u                                   #
  733. #                                                                      #
  734. #   Warning: there MUST NOT be a real "c:\tcpip\etc\mail.exe" program, #
  735. #         or mail will be passed to it instead of the LAMail DLL.   #
  736. #                                                                      #
  737. # NOTE                                                                 #
  738. # ----                                                                 #
  739. #   The Mlocal definitions must be on one line only - they have been   #
  740. #   wrapped in the examples above to make them more easy to read.      #
  741. #                                                                      #
  742. #   THE Mlocal DEFINITIONS MUST BE ON ONE LINE ONLY - they have been   #
  743. #   wrapped in the examples above to make them more easy to read.      #
  744. #                                                                      #
  745. ########################################################################
  746. #---EDIT---10---
  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\etc\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.