home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 29 Fixes_o / 29-Fixes_o.zip / ic32184.zip / sendmail.cf < prev    next >
Text File  |  2002-02-22  |  15KB  |  511 lines

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