home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Spezial / SPEZIAL2_97.zip / SPEZIAL2_97.iso / ANWEND / ONLINE / APOP3D12 / APOP3D / SENDMAIL.CF < prev    next >
Text File  |  1997-02-01  |  15KB  |  486 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. # Change activity:                            #
  22. #        2/96  TAB   Added F=F to mLocal, changed version number    #
  23. #        3/96  TAB   Added Prog definition.            #
  24. # Note from IAA:                            #
  25. #        This file was spoiled by several bugs, possibly after    #
  26. #        uncoordinated configuration editing activity of        #
  27. #        several IBM developers. I wonder how it managed to work    #
  28. #        previously. I have corrected some of the most obvious    #
  29. #        things, but I beleive it was only a top of an icberg...    #
  30. #        24/8/96 IAA                        #
  31. #########################################################################
  32.  
  33.  
  34. #
  35. # This configuration file routes outgoing mail as follows:
  36. #
  37. #    1.  If mail is destined for a directly connected domain and
  38. #        an internal gateway is defined, then deliver to the gateway.
  39. #
  40. #    2.  If mail is destined for a directly connected domain and
  41. #        no internal gateway is defined, then deliver directly.
  42. #
  43. #    3.  If mail is destined for a domain which is not directly
  44. #        connected, then deliver to an external gateway.
  45. #
  46. #    4.  If mail is destined for a domain which is not directly
  47. #        connected and an external gateway is not defined,
  48. #        then deliver directly.
  49. #
  50. #    5.  In all cases, rewrite the sender address to look like
  51. #        it came from a mail hub if a mail hub is defined.
  52. #
  53. #    6.  In all cases, deliver addresses destined for the local host
  54. #        directly with no routing through gateways.
  55. #
  56.  
  57.  
  58. #
  59. # Macro Definitions
  60. #
  61. # Note: The values of the V and H macros are merely placeholders.
  62. #       Actual values will get substituted later at send time when
  63. #    sendmail is invoked with the -oM command line flag to override
  64. #    these configuration file values.
  65. #
  66. #    The V and H macros should normally not be changed here.
  67. #
  68. #    Could not understand the above passage. This is definitely not
  69. #    about this .cf file version. You _should_ define both V and H
  70. #    to get mail relay and mail hub features to work. See below. (IAA)
  71.  
  72. # TCP/IP Configuration notebook insists on placing fully qualified
  73. # hostnames in both Dw & Cw (with domains). This dengerous practice
  74. # should be avoided. (IAA)
  75. Dwstargate
  76. Cwstargate
  77.  
  78. # The fully qualified (with domain) name of the internal gateway
  79. #
  80. # All mail destined for the domains defined in macros D through G
  81. # will be sent to this gateway machine
  82. #
  83. # If this macro is not defined, then all mail destined for the domains
  84. # defined in macros D through G will be delivered directly
  85. #
  86. # TCP/IP Configuration notebook erroneously sets it as _external_
  87. # mail relay address. You should correct this by hand later. (IAA)
  88. # DRYour.Internal.Gateway
  89.  
  90. # The fully qualified (with domain) name of the external gateway
  91. #
  92. # All mail destined for domains _not_ defined in macros D through G
  93. # will be sent to this gateway machine
  94. #
  95. # If this macro is not defined, then all mail destined for domains
  96. # _not_ defined in macros D through G will be delivered directly
  97. #
  98. # Note: this is a macro for _real_ external gateway. Set it by hand
  99. # to make mail relay mode work. TCP/IP Conf. Not. will never do it. (IAA)
  100. # DVYour.External.Gateway
  101. DVnoc.rz.offenburg.de
  102.  
  103. # The fully qualified (with domain) name of the external mail hub
  104. #
  105. # All sender addresses for external destination addresses will be
  106. # rewritten to look like they came from this mail hub
  107. # DHYour.External.Mail.Hub
  108.  
  109. # The fully qualified (with domain) name of the internal mail hub
  110. #
  111. # All sender addresses for internal destination addresses will be
  112. # rewritten to look like they came from this mail hub
  113. #
  114. # Since $I is used for UNIX From line below, I used $J for Int.Hub
  115. # macro here and later. It works now. (IAA)
  116. # DJYour.Internal.Mail.Hub
  117. DJ$w
  118.  
  119. # External user id
  120. #
  121. # The user id used for sending mail through the external gateway
  122. #
  123. # All sender addresses for external destination addresses will be
  124. # rewritten to look like they came from this user id
  125. # DPYourExternalUserID
  126.  
  127. # The local domain
  128. #
  129. # The domains defined in macros D through G are considered internal and
  130. # directly connected.  Mail destined for these domains will be delivered
  131. # to an internal gateway defined in macro R
  132. # DDYour.Domain
  133. DDrz.offenburg.de
  134.  
  135. # Internal, directly connected domains
  136. #
  137. # The domains defined in macros D through G are considered internal and
  138. # directly connected.  Mail destined for these domains will be delivered
  139. # to an internal gateway defined in macro R
  140. #
  141. # If macro R is undefined, then mail for internal destinations will be
  142. # delivered directly
  143.  
  144. # Version # of this file
  145. DZ2.13i
  146.  
  147. # Official canonical hostname.
  148. #
  149. # Do not bother setting macro $w (hostname) since sendmail will set
  150. # it for us
  151. #
  152. # Note: We assume $w contains the fully qualified name of the local host
  153. #
  154. # Wrong assumption. Corrected to conform to the well-established format. (IAA)
  155. Dj$w$?D.$D$.
  156.  
  157. #
  158. # Standard macros
  159. #
  160.  
  161. # SMTP initial login message
  162. De$j Sendmail $v/$Z ready at $b
  163. # Name used for error messages
  164. DnMailer-Daemon
  165. # UNIX header format
  166. DlFrom $g  $d
  167. # Delimiter (operator) characters
  168. Do.:%@!^=/[]
  169. # Format of a total name
  170. Dq$?x$x <$g>$|$g$.
  171.  
  172.  
  173. #
  174. # Options
  175. #
  176.  
  177. # Process messages in the background.
  178. Odbackground
  179. # Accept oldstyle addresses
  180. Oo
  181. # SMTP read timeout
  182. Or15m
  183. # Queue directory - this must be changed if TCP/IP is moved!
  184. OQc:\mptn\etc\mqueue
  185. # Always queue for safety
  186. Os
  187. # Time to live in the queue
  188. OT5d/60m
  189. # maximum number of simultanous sendmail sessions
  190. OX4
  191. # connection cache size (default=1; don't set higher than 4!)
  192. Ok1
  193. # inactivity timeout for SMTP connections (default=5 minutes)
  194. OK5
  195.  
  196. # log level
  197. #   0 No logging 
  198. #   1 Log only serious system failures and security problems 
  199. #   2 Log communication failures, such as lost connections 
  200. #   3 Log malformed addresses 
  201. #   4 Log malformed queue file names and similar minor errors 
  202. #   5 Log a record of each message received 
  203. #   6 Log SMTP VRFY attempts and messages returned to the original sender 
  204. #   7 Log delivery failures, except mail deferred due to a temporary lack of resources 
  205. #   8 Log successful deliveries 
  206. #   9 Log mail deferred due to a temporary lack of resources 
  207. # The default is 1. Sendmail uses the \ETC\SYSLOG.SML file for logging. 
  208. OL1
  209.  
  210. #
  211. # Message precedences
  212. # Note: use equal weight so we can let relay decide what to do
  213. #
  214. Pfirst-class=0
  215. Pspecial-delivery=0
  216. Pjunk=0
  217.  
  218. #
  219. # Required headers
  220. #
  221. HReceived: $?sfrom $s $.by $j ($v/$Z) id $i; $b
  222. H?D?Date: $a
  223. H?F?From: $q
  224. H?M?Message-Id: <$t.$i@$j>
  225. H?D?Resent-Date: $a
  226. H?F?Resent-From: $q
  227. H?M?Resent-Message-Id: <$t.$i@$j>
  228. H?x?Full-Name: $x
  229.  
  230.  
  231. #
  232. # Rewriting Rules
  233. #
  234.  
  235.  
  236. #
  237. # Ruleset 3 -- Name Canonicalization
  238. #
  239.  
  240. S3
  241.  
  242. # handle null input (translate to <@> special case)
  243. R$@            $@ <@>
  244.  
  245. # basic textual canonicalization -- note RFC733 heuristic here
  246. R$*<$*>$*<$*>$*        $2$3<$4>$5            strip multiple <> <>
  247. R$*<$*<$+>$*>$*        <$3>$5                2-level <> nesting
  248. R$*<>$*            $@ <@>                MAIL FROM:<> case
  249. R$*<$+>$*        $2                basic RFC821/822 parsing
  250.  
  251. # handle list:; syntax as special case
  252. R$*:;$*            $@ $1 :; <@>
  253.  
  254. # make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
  255. R@ $+ , $+        @ $1 : $2            change all "," to ":"
  256.  
  257. # localize and dispose of route-based addresses
  258. R@ $+ : $+        $@ $>96 < @$1 > : $2        handle <route-addr>
  259.  
  260. # find focus for list syntax
  261. R $+ : $* ; @ $+    $@ $>96 $1 : $2 ; < @ $3 >    list syntax
  262. R $+ : $* ;        $@ $1 : $2;            list syntax
  263.  
  264. # find focus for @ syntax addresses
  265. R$+ @ $+        $: $1 < @ $2 >            focus on domain
  266. R$+ < $+ @ $+ >        $1 $2 < @ $3 >            move gaze right
  267. R$+ < @ $+ >        $@ $>96 $1 < @ $2 >        already canonical
  268.  
  269. # do some sanity checking
  270. R$* < @ $* : $* > $*    $1 < @ $2 $3 > $4        nix colons in addrs
  271.  
  272. # if we have % signs, take the rightmost one
  273. R$* % $*        $1 @ $2                First make them all @s.
  274. R$* @ $* @ $*        $1 % $2 @ $3            Undo all but the last.
  275. R$* @ $*        $@ $>96 $1 < @ $2 >        Insert < > and finish
  276.  
  277. # else we must be a local name
  278.  
  279.  
  280. #
  281. # Ruleset 96 -- bottom half of ruleset 3
  282. #
  283.  
  284. #  At this point, everything should be in a "local_part<@domain>extra" format.
  285. S96
  286.  
  287. # handle special cases for local names
  288. R$* < @ localhost > $*        $: $1 < @ $j . > $2    no domain at all
  289. R$* < @ localhost . $m > $*    $: $1 < @ $j . > $2    local domain
  290. R$* < @ [ $+ ] > $*        $: $1 < @@ [ $2 ] > $3    mark [a.b.c.d]
  291. R$* < @@ $=w > $*        $: $1 < @ $j . > $3    self-literal
  292. R$* < @@ $+ > $*        $@ $1 < @ $2 > $3    canon IP addr
  293.  
  294. # pass to name server to make hostname canonical
  295. R$* < @ $* $~P > $*        $: $1 < @ $[ $2 $3 $] > $4
  296.  
  297. # local host aliases and pseudo-domains are always canonical
  298. R$* < @ $=w > $*        $: $1 < @ $2 . > $3
  299. R$* < @ $* $=P > $*        $: $1 < @ $2 $3 . > $4
  300. R$* < @ $* . . > $*        $1 < @ $2 . > $3
  301.  
  302. # if this is the local hostname, make sure we treat is as canonical
  303. R$* < @ $j > $*            $: $1 < @ $j . > $2
  304.  
  305.  
  306. #
  307. # Ruleset 4 -- Final Output Post-rewriting
  308. #
  309.  
  310. S4
  311.  
  312. R$*<@>            $@ $1                handle <> and list:;
  313.  
  314. # strip trailing dot off possibly canonical name
  315. R$* < @ $+ . > $*    $1 < @ $2 > $3
  316.  
  317. # externalize local domain info
  318. R$* < $+ > $*        $1 $2 $3            defocus
  319. R@ $+ : @ $+ : $+    @ $1 , @ $2 : $3        <route-addr> canonical
  320. R@ $*            $@ @ $1                ... and exit
  321.  
  322.  
  323. # delete duplicate local names
  324. R$+ % $=w @ $=w        $1 @ $j                u%host@host => u@host
  325.  
  326.  
  327. #
  328. # Ruleset 97 -- recanonicalize and call ruleset zero
  329. #        (used for recursive calls)
  330. #
  331.  
  332. S97
  333. R$*            $: $>3 $1
  334. R$*            $@ $>0 $1
  335.  
  336.  
  337. #
  338. # Ruleset 0 -- Parse Address
  339. #
  340.  
  341. S0
  342.  
  343. R<@>            $#local $: <>            special case error msgs
  344. R$* : $* ;        $#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
  345. R<@ $+>            $#error $@ USAGE $: "user address required"
  346. R<$* : $* >        $#error $@ USAGE $: "colon illegal in host name part"
  347.  
  348. # handle numeric address spec
  349. R$* < @ [ $+ ] > $*    $#smtp $@ [$2] $: $1 < @ [$2] > $3    numeric internet spec: send
  350.  
  351. # now delete the local info -- note $=O to find characters that cause forwarding
  352. R$* < @ > $*        $@ $>97 $1        user@ => user
  353. R< @ $=w . > : $*    $@ $>97 $2        @here:... -> ...
  354. R$* $=O $* < @ $=w . >    $@ $>97 $1 $2 $3    ...@here -> ...
  355.  
  356. # short circuit local delivery so email to ourself will work
  357. R$+ < @ $w $* >        $#local $: $1        deliver local address directly
  358. R$+ < @ $=w $* >    $#local $: $1        deliver local address directly
  359.  
  360. # figure out what can be delivered through our local network
  361. R$*                $: < $D > $1
  362. R< $+ > $* < @ $* $D > $*    $@ $>5 $2 < @ $3 $D > $4
  363. R< $* > $*        $2
  364.  
  365. R$*                $: < $E > $1
  366. R< $+ > $* < @ $* $E > $*    $@ $>5 $2 < @ $3 $E > $4
  367. R< $* > $*        $2
  368.  
  369. R$*                $: < $F > $1
  370. R< $+ > $* < @ $* $F > $*    $@ $>5 $2 < @ $3 $F > $4
  371. R< $* > $*        $2
  372.  
  373. R$*                $: < $G > $1
  374. R< $+ > $* < @ $* $G > $*    $@ $>5 $2 < @ $3 $G > $4
  375. R< $* > $*        $2
  376.  
  377. # pass names that still have a host to an external gateway if defined
  378. R$* < @ $* > $*        $@ $>98 < $V > $1 < @ $2 >    glue on gateway
  379.  
  380. # deal with other remote names
  381. R$* < @$* > $*        $#smtp $@ $2 $: $1 < @ $2 > $3    user@host.domain
  382.  
  383. # if this is quoted, strip the quotes and try again
  384. R$+            $: $1                strip quotes
  385. R$+ $=O $+        $@ $>97 $1 $2 $3        try again
  386.  
  387. # handle locally delivered names
  388. R$=L            $#local $: @ $1            special local names
  389. R$+            $#local $: $1            regular local names
  390.  
  391.  
  392. #
  393. # Ruleset 5 -- handle rewriting for internal gateway
  394. #
  395.  
  396. S5
  397.  
  398. # see if we have a gateway
  399. R$+            $: < $R > $1                try relay
  400. R< > $+ < @ $+ $* >    $#smtp $@ $2 $3 $: $1 < @ $2 $3 >    try directly
  401. R< $- : $+ > $+        $: $>95 < $1 : $2 > $3 < @ $2 >
  402. R< $+ > $+        $@ $>95 < $1 > $2 < @ $1 >
  403.  
  404.  
  405. #
  406. # Ruleset 95 -- determine mailer for internal gateway
  407. #
  408.  
  409. S95
  410. R< > $+ < @ $+ >    $#smtp $@ $2 $: $1 < @ $2 >    try directly
  411. R< $- : $+ > $*        $# $1 $@ $2 $: $3        try qualified mailer
  412. R< $=w > $*        $@ $2                delete local host
  413. R< $+ > $+ < @ $+ > < @ $* >    < $1 > $2 @ < $3 >    strip off extra gateway
  414. R< $+ > $*        $#internal $@ $1 $: $2        try gateway
  415.  
  416.  
  417. #
  418. # Ruleset 98 -- determine mailer for external gateway
  419. #
  420.  
  421. S98
  422. R< > $+ < @ $+ >    $#smtp $@ $2 $: $1 < @ $2 >    try directly
  423. R< $=w > $*        $@ $2                delete local host
  424. R< $+ > $*        $#external $@ $1 $: $2        try external gateway
  425.  
  426. #
  427. # Mailer Definitions
  428. #
  429.  
  430.  
  431. #
  432. # SMTP, Local and Program Mailer specifications       
  433. #                                                            Added F=F to Mlocal           TAB
  434.  
  435. Msmtp,    P=[IPC], F=mDFMuX8, S=10, R=0, A=IPC $h
  436. Mlocal,    P=c:\aPOP3d\amail.exe, F=lnsDFMP, S=10, R=0, A=amail $u $f
  437. Mprog,    P=c:\os2\cmd.exe, F=lsDFM, A= /C $u
  438.  
  439.  
  440. S10
  441. R<@>            $n                errors to mailer-daemon
  442. R$+            $: $>11 $1            perform internal rewrite
  443. R$+            $: $>12 $1            perform external rewrite
  444.  
  445.  
  446. #
  447. # Relay Mailer specifications
  448. #
  449.  
  450. Minternal,    P=[IPC], F=mDFMuX8, S=11, R=0, A=IPC $h
  451. Mexternal,    P=[IPC], F=mDFMuX8, S=12, R=0, A=IPC $h
  452.  
  453.  
  454. S11
  455. R<@>            $n                errors to mailer-daemon
  456. R$+            $: $>40 < $J > $1
  457.  
  458. S12
  459. R<@>            $n                errors to mailer-daemon
  460. R$+            $: $>40 < $H > $1
  461. R$+            $: $>41 $1
  462.  
  463. # Rewrite addresses so they look like they are from a hub
  464. S40
  465. R< > $-            $@ $1 < @ $w >            no hub defined, user => user@thishost
  466. R< > $+            $@ $1                no hub defined
  467. R< $+ > $-        $@ $2 < @ $1 >            user => user@hub
  468. R< $+ > $+ < @ $w $* >    $@ $2 < @ $1 >            user@thishost   => user@hub
  469. R< $+ > $+ < @ $=w $* >    $@ $2 < @ $1 >            user@othernames => user@hub
  470. R< $+ > $+ < @ $=w.$D >    $@ $2 < @ $1 >            user@thishostonly      => user@hub
  471. R< $+ > $+        $@ $2                hub defined but no rewrite
  472.  
  473. # Rewrite addresses so they look like they are from a specific user id
  474. S41
  475. R$*            $: < $P > $1            expand with user id macro
  476. R< > $+            $@ $1                no user id macro defined
  477. R< $+ > $+ < @ $H >    $@ $P < @ $H >            user@host => newuser@host
  478. R< $+ > $+        $@ $2                user id macro defined but no rewrite
  479.  
  480.  
  481. # Sendmail configuration file *must* end with a newline - do not remove below newline
  482. OHc:\mptn\etc\sendmail.hf
  483. OAc:\mptn\etc\aliases
  484. OSc:\mptn\etc\sendmail.st
  485. OEc:\mptn\etc\message
  486.