home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 29 Fixes_o / 29-Fixes_o.zip / umf21004.zip / SENDMAIL.UML < prev    next >
Text File  |  1996-04-09  |  12KB  |  436 lines

  1. #########################################################################
  2. #                                    #
  3. #  Sendmail                                #
  4. #  Copyright (c) 1983  Eric P. Allman                    #
  5. #  Berkeley, California                            #
  6. #                                    #
  7. #  Copyright (c) 1983 Regents of the University of California.        #
  8. #  All rights reserved.  The Berkeley software License Agreement    #
  9. #  specifies the terms and conditions for redistribution.        #
  10. #                                    #
  11. #  This configuration file was created specifically for sendmail on the    #
  12. #  IBM OS/2 Operating System.  Please avoid making changes to this file    #
  13. #  because any changes will change the operation of sendmail.        #
  14. #                                    #
  15. #  Created by: William Chung for IBM Ultimedia Mail/2 "Lite"        #
  16. #              and IBM NR/2                        #
  17. #              IBM T.J. Watson Research Center, Hawthorne, NY        #
  18. #                                    #
  19. #              March 21, 1995                        #
  20. #                                    #
  21. #########################################################################
  22.  
  23.  
  24. #
  25. # This configuration file routes outgoing mail as follows:
  26. #
  27. #    1.  If mail is destined for a directly connected domain and
  28. #        an internal gateway is defined, then deliver to the gateway.
  29. #
  30. #    2.  If mail is destined for a directly connected domain and
  31. #        no internal gateway is defined, then deliver directly.
  32. #
  33. #    3.  If mail is destined for a domain which is not directly
  34. #        connected, then deliver to an external gateway.
  35. #
  36. #    4.  If mail is destined for a domain which is not directly
  37. #        connected and an external gateway is not defined,
  38. #        then deliver directly.
  39. #
  40. #    5.  In all cases, rewrite the sender address to look like
  41. #        it came from a mail hub if a mail hub is defined.
  42. #
  43. #    6.  In all cases, deliver addresses destined for the local host
  44. #        directly with no routing through gateways.
  45. #
  46.  
  47.  
  48. #
  49. # Macro Definitions
  50. #
  51. # Note: The values of the V and H macros are merely placeholders.
  52. #       Actual values will get substituted later at send time when
  53. #    sendmail is invoked with the -oM command line flag to override
  54. #    these configuration file values.
  55. #
  56. #    The V and H macros should normally not be changed here.
  57. #
  58.  
  59. # The fully qualified (with domain) name of the internal gateway
  60. #
  61. # All mail destined for the domains defined in macros D through G
  62. # will be sent to this gateway machine
  63. #
  64. # If this macro is not defined, then all mail destined for the domains
  65. # defined in macros D through G will be delivered directly
  66. # DRYour.Internal.Gateway
  67.  
  68. # The fully qualified (with domain) name of the external gateway
  69. #
  70. # All mail destined for domains _not_ defined in macros D through G
  71. # will be sent to this gateway machine
  72. #
  73. # If this macro is not defined, then all mail destined for domains
  74. # _not_ defined in macros D through G will be delivered directly
  75. # DVYour.External.Gateway
  76.  
  77. # The fully qualified (with domain) name of the external mail hub
  78. #
  79. # All sender addresses for external destination addresses will be
  80. # rewritten to look like they came from this mail hub
  81. # DHYour.External.Mail.Hub
  82.  
  83. # The fully qualified (with domain) name of the internal mail hub
  84. #
  85. # All sender addresses for internal destination addresses will be
  86. # rewritten to look like they came from this mail hub
  87. # DIYour.Internal.Mail.Hub
  88.  
  89. # External user id
  90. #
  91. # The user id used for sending mail through the external gateway
  92. #
  93. # All sender addresses for external destination addresses will be
  94. # rewritten to look like they came from this user id
  95. # DPYourExternalUserID
  96.  
  97. # The local domain
  98. #
  99. # The domains defined in macros D through G are considered internal and
  100. # directly connected.  Mail destined for these domains will be delivered
  101. # to an internal gateway defined in macro R
  102. #
  103. # If macro R is undefined, then mail for internal destinations will be
  104. # delivered directly
  105. DDYour.Domain
  106.  
  107. # Internal, directly connected domains
  108. #
  109. # The domains defined in macros D through G are considered internal and
  110. # directly connected.  Mail destined for these domains will be delivered
  111. # to an internal gateway defined in macro R
  112. #
  113. # If macro R is undefined, then mail for internal destinations will be
  114. # delivered directly
  115. DE
  116. DF
  117. DG
  118.  
  119. # Version # of this file
  120. DZ2.12um
  121.  
  122. # Official canonical hostname.
  123. #
  124. # Do not bother setting macro $w (hostname) since sendmail will set
  125. # it for us
  126. #
  127. # Note: We assume $w contains the fully qualified name of the local host
  128. Dj$w
  129.  
  130. #
  131. # Standard macros
  132. #
  133.  
  134. # SMTP initial login message
  135. De$j Sendmail $v/$Z ready at $b
  136. # Name used for error messages
  137. DnMailer-Daemon
  138. # UNIX header format
  139. DlFrom $g  $d
  140. # Delimiter (operator) characters
  141. Do.:%@!^=/[]
  142. # Format of a total name
  143. Dq$?x$x <$g>$|$g$.
  144.  
  145.  
  146. #
  147. # Options
  148. #
  149.  
  150. # Process messages in the background.
  151. Odbackground
  152. # Accept oldstyle addresses
  153. Oo
  154. # SMTP read timeout
  155. Or15m
  156. # Queue directory - this must be changed if TCP/IP is moved!
  157. OQC:\MPTN\ETC\MQUEUE
  158. # Always queue for safety
  159. Os
  160. # Time to live in the queue
  161. OT5d
  162.  
  163. #
  164. # Message precedences
  165. # Note: use equal weight so we can let relay decide what to do
  166. #
  167. Pfirst-class=0
  168. Pspecial-delivery=0
  169. Pjunk=0
  170.  
  171. #
  172. # Required headers
  173. #
  174. HReceived: $?sfrom $s $.by $j ($v/$Z) id $i; $b
  175. H?D?Date: $a
  176. H?F?From: $q
  177. H?M?Message-Id: <$t.$i@$j>
  178. H?D?Resent-Date: $a
  179. H?F?Resent-From: $q
  180. H?M?Resent-Message-Id: <$t.$i@$j>
  181. H?x?Full-Name: $x
  182.  
  183.  
  184. #
  185. # Rewriting Rules
  186. #
  187.  
  188.  
  189. #
  190. # Ruleset 3 -- Name Canonicalization
  191. #
  192.  
  193. S3
  194.  
  195. # handle null input (translate to <@> special case)
  196. R$@            $@ <@>
  197.  
  198. # basic textual canonicalization -- note RFC733 heuristic here
  199. R$*<$*>$*<$*>$*        $2$3<$4>$5            strip multiple <> <>
  200. R$*<$*<$+>$*>$*        <$3>$5                2-level <> nesting
  201. R$*<>$*            $@ <@>                MAIL FROM:<> case
  202. R$*<$+>$*        $2                basic RFC821/822 parsing
  203.  
  204. # handle list:; syntax as special case
  205. R$*:;$*            $@ $1 :; <@>
  206.  
  207. # make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
  208. R@ $+ , $+        @ $1 : $2            change all "," to ":"
  209.  
  210. # localize and dispose of route-based addresses
  211. R@ $+ : $+        $@ $>96 < @$1 > : $2        handle <route-addr>
  212.  
  213. # find focus for list syntax
  214. R $+ : $* ; @ $+    $@ $>96 $1 : $2 ; < @ $3 >    list syntax
  215. R $+ : $* ;        $@ $1 : $2;            list syntax
  216.  
  217. # find focus for @ syntax addresses
  218. R$+ @ $+        $: $1 < @ $2 >            focus on domain
  219. R$+ < $+ @ $+ >        $1 $2 < @ $3 >            move gaze right
  220. R$+ < @ $+ >        $@ $>96 $1 < @ $2 >        already canonical
  221.  
  222. # do some sanity checking
  223. R$* < @ $* : $* > $*    $1 < @ $2 $3 > $4        nix colons in addrs
  224.  
  225. # if we have % signs, take the rightmost one
  226. R$* % $*        $1 @ $2                First make them all @s.
  227. R$* @ $* @ $*        $1 % $2 @ $3            Undo all but the last.
  228. R$* @ $*        $@ $>96 $1 < @ $2 >        Insert < > and finish
  229.  
  230. # else we must be a local name
  231.  
  232.  
  233. #
  234. # Ruleset 96 -- bottom half of ruleset 3
  235. #
  236.  
  237. #  At this point, everything should be in a "local_part<@domain>extra" format.
  238. S96
  239.  
  240. # handle special cases for local names
  241. R$* < @ localhost > $*        $: $1 < @ $j . > $2    no domain at all
  242. R$* < @ localhost . $m > $*    $: $1 < @ $j . > $2    local domain
  243. R$* < @ [ $+ ] > $*        $: $1 < @@ [ $2 ] > $3    mark [a.b.c.d]
  244. R$* < @@ $=w > $*        $: $1 < @ $j . > $3    self-literal
  245. R$* < @@ $+ > $*        $@ $1 < @ $2 > $3    canon IP addr
  246.  
  247. # pass to name server to make hostname canonical
  248. R$* < @ $* $~P > $*        $: $1 < @ $[ $2 $3 $] > $4
  249.  
  250. # local host aliases and pseudo-domains are always canonical
  251. R$* < @ $=w > $*        $: $1 < @ $2 . > $3
  252. R$* < @ $* $=P > $*        $: $1 < @ $2 $3 . > $4
  253. R$* < @ $* . . > $*        $1 < @ $2 . > $3
  254.  
  255. # if this is the local hostname, make sure we treat is as canonical
  256. R$* < @ $j > $*            $: $1 < @ $j . > $2
  257.  
  258.  
  259. #
  260. # Ruleset 4 -- Final Output Post-rewriting
  261. #
  262.  
  263. S4
  264.  
  265. R$*<@>            $@ $1                handle <> and list:;
  266.  
  267. # strip trailing dot off possibly canonical name
  268. R$* < @ $+ . > $*    $1 < @ $2 > $3
  269.  
  270. # externalize local domain info
  271. R$* < $+ > $*        $1 $2 $3            defocus
  272. R@ $+ : @ $+ : $+    @ $1 , @ $2 : $3        <route-addr> canonical
  273. R@ $*            $@ @ $1                ... and exit
  274.  
  275.  
  276. # delete duplicate local names
  277. R$+ % $=w @ $=w        $1 @ $j                u%host@host => u@host
  278.  
  279.  
  280. #
  281. # Ruleset 97 -- recanonicalize and call ruleset zero
  282. #        (used for recursive calls)
  283. #
  284.  
  285. S97
  286. R$*            $: $>3 $1
  287. R$*            $@ $>0 $1
  288.  
  289.  
  290. #
  291. # Ruleset 0 -- Parse Address
  292. #
  293.  
  294. S0
  295.  
  296. R<@>            $#local $: <>            special case error msgs
  297. R$* : $* ;        $#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
  298. R<@ $+>            $#error $@ USAGE $: "user address required"
  299. R<$* : $* >        $#error $@ USAGE $: "colon illegal in host name part"
  300.  
  301. # handle numeric address spec
  302. R$* < @ [ $+ ] > $*    $#smtp $@ [$2] $: $1 < @ [$2] > $3    numeric internet spec: send
  303.  
  304. # now delete the local info -- note $=O to find characters that cause forwarding
  305. R$* < @ > $*        $@ $>97 $1        user@ => user
  306. R< @ $=w . > : $*    $@ $>97 $2        @here:... -> ...
  307. R$* $=O $* < @ $=w . >    $@ $>97 $1 $2 $3    ...@here -> ...
  308.  
  309. # short circuit local delivery so email to ourself will work
  310. R$+ < @ $w $* >        $#local $: $1        deliver local address directly
  311. R$+ < @ $=w $* >    $#local $: $1        deliver local address directly
  312.  
  313. # figure out what can be delivered through our local network
  314. R$*                $: < $D > $1
  315. R< $+ > $* < @ $* $D > $*    $@ $>5 $2 < @ $3 $D > $4
  316. R< $* > $*        $2
  317.  
  318. R$*                $: < $E > $1
  319. R< $+ > $* < @ $* $E > $*    $@ $>5 $2 < @ $3 $E > $4
  320. R< $* > $*        $2
  321.  
  322. R$*                $: < $F > $1
  323. R< $+ > $* < @ $* $F > $*    $@ $>5 $2 < @ $3 $F > $4
  324. R< $* > $*        $2
  325.  
  326. R$*                $: < $G > $1
  327. R< $+ > $* < @ $* $G > $*    $@ $>5 $2 < @ $3 $G > $4
  328. R< $* > $*        $2
  329.  
  330. # pass names that still have a host to an external gateway if defined
  331. R$* < @ $* > $*        $@ $>98 < $V > $1 < @ $2 >    glue on gateway
  332.  
  333. # deal with other remote names
  334. R$* < @$* > $*        $#smtp $@ $2 $: $1 < @ $2 > $3    user@host.domain
  335.  
  336. # if this is quoted, strip the quotes and try again
  337. R$+            $: $1                strip quotes
  338. R$+ $=O $+        $@ $>97 $1 $2 $3        try again
  339.  
  340. # handle locally delivered names
  341. R$=L            $#local $: @ $1            special local names
  342. R$+            $#local $: $1            regular local names
  343.  
  344.  
  345. #
  346. # Ruleset 5 -- handle rewriting for internal gateway
  347. #
  348.  
  349. S5
  350.  
  351. # see if we have a gateway
  352. R$+            $: < $R > $1                try relay
  353. R< > $+ < @ $+ $* >    $#smtp $@ $2 $3 $: $1 < @ $2 $3 >    try directly
  354. R< $- : $+ > $+        $: $>95 < $1 : $2 > $3 < @ $2 >
  355. R< $+ > $+        $@ $>95 < $1 > $2 < @ $1 >
  356.  
  357.  
  358. #
  359. # Ruleset 95 -- determine mailer for internal gateway
  360. #
  361.  
  362. S95
  363. R< > $+ < @ $+ >    $#smtp $@ $2 $: $1 < @ $2 >    try directly
  364. R< $- : $+ > $*        $# $1 $@ $2 $: $3        try qualified mailer
  365. R< $=w > $*        $@ $2                delete local host
  366. R< $+ > $+ < @ $+ > < @ $* >    < $1 > $2 @ < $3 >    strip off extra gateway
  367. R< $+ > $*        $#internal $@ $1 $: $2        try gateway
  368.  
  369.  
  370. #
  371. # Ruleset 98 -- determine mailer for external gateway
  372. #
  373.  
  374. S98
  375. R< > $+ < @ $+ >    $#smtp $@ $2 $: $1 < @ $2 >    try directly
  376. R< $=w > $*        $@ $2                delete local host
  377. R< $+ > $*        $#external $@ $1 $: $2        try external gateway
  378.  
  379.  
  380. #
  381. # Mailer Definitions
  382. #
  383.  
  384.  
  385. #
  386. # SMTP, Local and Program Mailer specifications
  387. #
  388.  
  389. Msmtp,    P=[IPC], F=mDFMuX, S=10, R=0, A=IPC $h
  390. Mlocal,    P=C:\TCPIP\UMAIL\umailer.exe , F=lsm, S=10, R=0, A=-dest C:\TCPIP\UMAIL\SERVER\INBOX -to $u
  391. Mprog,    P=xxx, A=Required by sendmail but unused
  392.  
  393.  
  394. S10
  395. R<@>            $n                errors to mailer-daemon
  396. R$+            $: $>11 $1            perform internal rewrite
  397. R$+            $: $>12 $1            perform external rewrite
  398.  
  399.  
  400. #
  401. # Relay Mailer specifications
  402. #
  403.  
  404. Minternal,    P=[IPC], F=mDFMuX, S=11, R=0, A=IPC $h
  405. Mexternal,    P=[IPC], F=mDFMuX, S=12, R=0, A=IPC $h
  406.  
  407.  
  408. S11
  409. R<@>            $n                errors to mailer-daemon
  410. R$+            $: $>40 < $I > $1
  411.  
  412. S12
  413. R<@>            $n                errors to mailer-daemon
  414. R$+            $: $>40 < $H > $1
  415. R$+            $: $>41 $1
  416.  
  417. # Rewrite addresses so they look like they are from a hub
  418. S40
  419. R< > $-            $@ $1 < @ $w >            no hub defined, user => user@thishost
  420. R< > $+            $@ $1                no hub defined
  421. R< $+ > $-        $@ $2 < @ $1 >            user => user@hub
  422. R< $+ > $+ < @ $w $* >    $@ $2 < @ $1 >            user@thishost   => user@hub
  423. R< $+ > $+ < @ $=w $* >    $@ $2 < @ $1 >            user@othernames => user@hub
  424. R< $+ > $+ < @ $=w.$D >    $@ $2 < @ $1 >            user@thishostonly      => user@hub
  425. R< $+ > $+        $@ $2                hub defined but no rewrite
  426.  
  427. # Rewrite addresses so they look like they are from a specific user id
  428. S41
  429. R$*            $: < $P > $1            expand with user id macro
  430. R< > $+            $@ $1                no user id macro defined
  431. R< $+ > $+ < @ $H >    $@ $P < @ $H >            user@host => newuser@host
  432. R< $+ > $+        $@ $2                user id macro defined but no rewrite
  433.  
  434.  
  435. # Sendmail configuration file *must* end with a newline - do not remove below newline
  436.