home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / sendma88.zip / sendmail.cf < prev    next >
Text File  |  2002-12-30  |  16KB  |  537 lines

  1. Dwmail.yourdomain.com
  2. Cwmail.yourdomain.com yourdomain.com
  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. DHyourdomanin.com
  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. DDyourdomain.net
  113. DI
  114. DR
  115.  
  116. # Internal, directly connected domains
  117. #
  118. # The domains defined in macros D through G are considered internal and
  119. # directly connected.  Mail destined for these domains will be delivered
  120. # to an internal gateway defined in macro R
  121. #
  122. # If macro R is undefined, then mail for internal destinations will be
  123. # delivered directly
  124. DE
  125. DF
  126. DG
  127.  
  128. # Version # of this file                                                            TAB
  129. DZ2.0
  130.  
  131. # Official canonical hostname.
  132. #
  133. # Do not bother setting macro $w (hostname) since sendmail will set
  134. # it for us
  135. #
  136. # Note: We assume $w contains the fully qualified name of the local host
  137. Dj$w
  138.  
  139. #
  140. # Standard macros
  141. #
  142.  
  143. # SMTP initial login message
  144. De$j Sendmail $v/$Z ready at $b
  145. # Name used for error messages
  146. DnMailer-Daemon
  147. # UNIX header format
  148. DlFrom $g  $d
  149. # Delimiter (operator) characters
  150. Do.:%@!^=/[]
  151. # Format of a total name
  152. Dq$?x$x <$g>$|$g$.
  153.  
  154.  
  155. #
  156. # Map definitions
  157. #
  158.  
  159. # dequote map (used mainly in anti-spam/relay rules)
  160. Kdequote dequote
  161.  
  162. #
  163. # Options
  164. #
  165.  
  166. # Process messages in the background.
  167. #Odbackground
  168. Odq
  169. # Accept oldstyle addresses
  170. Oo
  171. # SMTP read timeout
  172. #Or2m
  173. Or15m
  174. # Queue directory - this must be changed if TCP/IP is moved!
  175. OQD:\MPTN\ETC\MQUEUE
  176. # Always queue for safety
  177. Os
  178. # Time to live in the queue
  179. OT5d
  180. #Ob/1000
  181.  
  182. ## ADDED HERE FOR RULESETS CONTROLLING SPAMMING CONTROL 
  183. ## files to be used in check_mail
  184. F{SpamName} -o d:\etc\sendmail\SpamName
  185. F{SpamList} -o d:\etc\sendmail\SpamList
  186.                                          
  187. # Allowed recipient domains
  188. FR  d:\etc\sendmail\sendmail.cr
  189.                                          
  190. # Allowed secure interfaces
  191. F{LocalIfc} -o d:\etc\sendmail\LocalIfc
  192. F{LocalIP} -o d:\etc\sendmail\LocalIP
  193.                                          
  194. # files to be used in check_relay
  195. F{DeniedIP} -o d:\etc\sendmail\DeniedIP
  196.  
  197.  
  198. #
  199. # Message precedences
  200. # Note: use equal weight so we can let relay decide what to do
  201. #
  202. Pfirst-class=0
  203. Pspecial-delivery=0
  204. Pjunk=0
  205.  
  206. #
  207. # Required headers
  208. #
  209. HReceived: $?sfrom $s $.by $j ($v/$Z) id $i; $b
  210. H?D?Date: $a
  211. H?F?From: $q
  212. H?M?Message-Id: <$t.$i@$j>
  213. H?D?Resent-Date: $a
  214. H?F?Resent-From: $q
  215. H?M?Resent-Message-Id: <$t.$i@$j>
  216. H?x?Full-Name: $x
  217.  
  218.  
  219. #
  220. # Rewriting Rules
  221. #
  222.  
  223.  
  224. #
  225. # Ruleset 3 -- Name Canonicalization
  226. #
  227.  
  228. S3
  229.  
  230. # handle null input (translate to <@> special case)
  231. R$@            $@ <@>
  232.  
  233. # basic textual canonicalization -- note RFC733 heuristic here
  234. R$*<$*>$*<$*>$*        $2$3<$4>$5            strip multiple <> <>
  235. R$*<$*<$+>$*>$*        <$3>$5                2-level <> nesting
  236. R$*<>$*            $@ <@>                MAIL FROM:<> case
  237. R$*<$+>$*        $2                basic RFC821/822 parsing
  238.  
  239. # handle list:; syntax as special case
  240. R$*:;$*            $@ $1 :; <@>
  241.  
  242. # make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
  243. R@ $+ , $+        @ $1 : $2            change all "," to ":"
  244.  
  245. # localize and dispose of route-based addresses
  246. R@ $+ : $+        $@ $>96 < @$1 > : $2        handle <route-addr>
  247.  
  248. # find focus for list syntax
  249. R $+ : $* ; @ $+    $@ $>96 $1 : $2 ; < @ $3 >    list syntax
  250. R $+ : $* ;        $@ $1 : $2;            list syntax
  251.  
  252. # find focus for @ syntax addresses
  253. R$+ @ $+        $: $1 < @ $2 >            focus on domain
  254. R$+ < $+ @ $+ >        $1 $2 < @ $3 >            move gaze right
  255. R$+ < @ $+ >        $@ $>96 $1 < @ $2 >        already canonical
  256.  
  257. # do some sanity checking
  258. R$* < @ $* : $* > $*    $1 < @ $2 $3 > $4        nix colons in addrs
  259.  
  260. # if we have % signs, take the rightmost one
  261. R$* % $*        $1 @ $2                First make them all @s.
  262. R$* @ $* @ $*        $1 % $2 @ $3            Undo all but the last.
  263. R$* @ $*        $@ $>96 $1 < @ $2 >        Insert < > and finish
  264.  
  265. # else we must be a local name
  266.  
  267.  
  268. #
  269. # Ruleset 96 -- bottom half of ruleset 3
  270. #
  271.  
  272. #  At this point, everything should be in a "local_part<@domain>extra" format.
  273. S96
  274.  
  275. # handle special cases for local names
  276. R$* < @ localhost > $*        $: $1 < @ $j . > $2    no domain at all
  277. R$* < @ localhost . $m > $*    $: $1 < @ $j . > $2    local domain
  278. R$* < @ [ $+ ] > $*        $: $1 < @@ [ $2 ] > $3    mark [a.b.c.d]
  279. R$* < @@ $=w > $*        $: $1 < @ $j . > $3    self-literal
  280. R$* < @@ $+ > $*        $@ $1 < @ $2 > $3    canon IP addr
  281.  
  282. # pass to name server to make hostname canonical
  283. R$* < @ $* $~P > $*        $: $1 < @ $[ $2 $3 $] > $4
  284.  
  285. # local host aliases and pseudo-domains are always canonical
  286. R$* < @ $=w > $*        $: $1 < @ $2 . > $3
  287. R$* < @ $* $=P > $*        $: $1 < @ $2 $3 . > $4
  288. R$* < @ $* . . > $*        $1 < @ $2 . > $3
  289.  
  290. # if this is the local hostname, make sure we treat is as canonical
  291. R$* < @ $j > $*            $: $1 < @ $j . > $2
  292.  
  293.  
  294. #
  295. # Ruleset 4 -- Final Output Post-rewriting
  296. #
  297.  
  298. S4
  299.  
  300. R$*<@>            $@ $1                handle <> and list:;
  301.  
  302. # strip trailing dot off possibly canonical name
  303. R$* < @ $+ . > $*    $1 < @ $2 > $3
  304.  
  305. # externalize local domain info
  306. R$* < $+ > $*        $1 $2 $3            defocus
  307. R@ $+ : @ $+ : $+    @ $1 , @ $2 : $3        <route-addr> canonical
  308. R@ $*            $@ @ $1                ... and exit
  309.  
  310.  
  311. # delete duplicate local names
  312. R$+ % $=w @ $=w        $1 @ $j                u%host@host => u@host
  313.  
  314.  
  315. #
  316. # Ruleset 97 -- recanonicalize and call ruleset zero
  317. #        (used for recursive calls)
  318. #
  319.  
  320. S97
  321. R$*            $: $>3 $1
  322. R$*            $@ $>0 $1
  323.  
  324.  
  325. #
  326. # Ruleset 0 -- Parse Address
  327. #
  328.  
  329. S0
  330.  
  331. R<@>            $#local $: <>            special case error msgs
  332. R$* : $* ;        $#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
  333. R<@ $+>            $#error $@ USAGE $: "user address required"
  334. R<$* : $* >        $#error $@ USAGE $: "colon illegal in host name part"
  335.  
  336. # handle numeric address spec
  337. R$* < @ [ $+ ] > $*    $#smtp $@ [$2] $: $1 < @ [$2] > $3    numeric internet spec: send
  338.  
  339. # now delete the local info -- note $=O to find characters that cause forwarding
  340. R$* < @ > $*        $@ $>97 $1        user@ => user
  341. R< @ $=w . > : $*    $@ $>97 $2        @here:... -> ...
  342. R$* $=O $* < @ $=w . >    $@ $>97 $1 $2 $3    ...@here -> ...
  343.  
  344. # short circuit local delivery so email to ourself will work
  345. R$+ < @ $w $* >        $#local $: $1        deliver local address directly
  346. R$+ < @ $=w $* >    $#local $: $1        deliver local address directly
  347.  
  348. # figure out what can be delivered through our local network
  349. R$*                $: < $D > $1
  350. R< $+ > $* < @ $* $D > $*    $@ $>5 $2 < @ $3 $D > $4
  351. R< $* > $*        $2
  352.  
  353. R$*                $: < $E > $1
  354. R< $+ > $* < @ $* $E > $*    $@ $>5 $2 < @ $3 $E > $4
  355. R< $* > $*        $2
  356.  
  357. R$*                $: < $F > $1
  358. R< $+ > $* < @ $* $F > $*    $@ $>5 $2 < @ $3 $F > $4
  359. R< $* > $*        $2
  360.  
  361. R$*                $: < $G > $1
  362. R< $+ > $* < @ $* $G > $*    $@ $>5 $2 < @ $3 $G > $4
  363. R< $* > $*        $2
  364.  
  365. # pass names that still have a host to an external gateway if defined
  366. R$* < @ $* > $*        $@ $>98 < $V > $1 < @ $2 >    glue on gateway
  367.  
  368. # deal with other remote names
  369. R$* < @$* > $*        $#smtp $@ $2 $: $1 < @ $2 > $3    user@host.domain
  370.  
  371. # if this is quoted, strip the quotes and try again
  372. R$+            $: $1                strip quotes
  373. R$+ $=O $+        $@ $>97 $1 $2 $3        try again
  374.  
  375. # handle locally delivered names
  376. R$=L            $#local $: @ $1            special local names
  377. R$+            $#local $: $1            regular local names
  378.  
  379.  
  380. #
  381. # Ruleset 5 -- handle rewriting for internal gateway
  382. #
  383.  
  384. S5
  385.  
  386. # see if we have a gateway
  387. R$+            $: < $R > $1                try relay
  388. R< > $+ < @ $+ $* >    $#smtp $@ $2 $3 $: $1 < @ $2 $3 >    try directly
  389. R< $- : $+ > $+        $: $>95 < $1 : $2 > $3 < @ $2 >
  390. R< $+ > $+        $@ $>95 < $1 > $2 < @ $1 >
  391.  
  392.  
  393. #
  394. # Ruleset 95 -- determine mailer for internal gateway
  395. #
  396.  
  397. S95
  398. R< > $+ < @ $+ >    $#smtp $@ $2 $: $1 < @ $2 >    try directly
  399. R< $- : $+ > $*        $# $1 $@ $2 $: $3        try qualified mailer
  400. R< $=w > $*        $@ $2                delete local host
  401. R< $+ > $+ < @ $+ > < @ $* >    < $1 > $2 @ < $3 >    strip off extra gateway
  402. R< $+ > $*        $#internal $@ $1 $: $2        try gateway
  403.  
  404.  
  405. #
  406. # Ruleset 98 -- determine mailer for external gateway
  407. #
  408.  
  409. S98
  410. R< > $+ < @ $+ >    $#smtp $@ $2 $: $1 < @ $2 >    try directly
  411. R< $=w > $*        $@ $2                delete local host
  412. R< $+ > $*        $#external $@ $1 $: $2        try external gateway
  413.  
  414.  
  415. # RULESETS FOR SPAMMMING CONTROL : check_mail , check_rcpt , check_relay 
  416.                                          
  417. #******************************
  418. # this is the check_mail ruleset
  419. #******************************
  420.                                          
  421. Scheck_mail
  422. R$={{SpamName}}            $#error $@ unavailable  $: "you are banned"
  423. R$*@$*$={{SpamList}}        $#error $@ unavailable  $: "We don't accept junk mail from your domain"
  424. R$*@$*$={{SpamList}}.        $#error $@ unavailable  $: "We don't accept junk mail from your domain"
  425. R$={{SpamName}}.        $#error $@ unavailable  $: "You are banned"
  426. R$*<$*@$*$={{SpamList}}>$*    $#error $@ unavailable  $: "We don't accept junk mail from your domain"
  427. R<$={{SpamName}}>        $#error $@ unavailable  $: "You are banned"
  428. R$*<$*@$*$={{SpamList}}.>$*    $#error $@ unavailable  $: "We don't accept junk mail from your domain"
  429. R<$={{SpamName}}.>        $#error $@ unavailable  $: "You are banned."
  430. R$*                $@ ok
  431.                                          
  432.                                          
  433. #******************************
  434. # this  is  the check_rcpt rule set
  435. #******************************
  436.                                          
  437. #anything  terminating locally  is ok
  438. Scheck_rcpt
  439. #R<$+@S* $=R>        $@ ok
  440. R<$+@$* $=R>        $@ ok
  441. R<$*@$=R>        $@ ok
  442. R<$*@$*$=R>        $@ ok
  443. R$*@$*$=R        $@ ok
  444. R$+@$*$=R        $@ ok
  445.                                          
  446. #R$*            $: $& client_addr
  447. #R$={{LocalIP}}        $@ ok
  448. #R$*$={{LocalIP}}$*    $@ ok
  449. #R<$={{LocalIP}}>    $@ ok
  450.                                          
  451. #R$*            $: $& client_ifc
  452. #R$={{LocalIfc}}        $@ ok
  453. #R$*$={{LocalIfc}}$*    $@ ok
  454. #R<$={{LocalIfc}}>    $@ ok
  455.  
  456. #
  457. #anything arriving at a secure interface is ok
  458. #
  459. R$*            $: $( dequote "" $& client_ifc $)
  460. R$={{LocalIfc}}        $@ ok
  461.  
  462. # anything else is bogus
  463. #R$*            $#error $:"550  relaying denied"
  464. R$*            $#error $:"550  relaying denied on " $& client_ifc
  465.                                          
  466. #*****************************
  467. # this is the check_relay rule set
  468. #*****************************
  469. Scheck_relay
  470. R$*            $: $& client_addr
  471. R$={{DeniedIP}} $*        $#error $: "550  no access from your IP address"
  472. R$={{DeniedIP}}        $#error $: "550  no access from your IP address"
  473. R<$={{DeniedIP}} $*>    $#error $: "550  no access from your IP address"
  474. R<$={{DeniedIP}}>    $#error $: "550  no access from your IP address"
  475.  
  476.  
  477.  
  478. #
  479. # Mailer Definitions
  480. #
  481.  
  482.  
  483. #
  484. # SMTP, Local and Program Mailer specifications       
  485. #                                                            Added F=F to Mlocal           TAB
  486.  
  487. Msmtp,  P=[IPC], E=\r\n, F=mDFMuX, S=10, R=0, A=IPC $h
  488. Mlocal, P=d:\WPop3S\mailer.exe, F=lnsDFP, S=10, R=20, A=d:\mptn\etc\mail\ $u
  489. Mprog,    P=d:\os2\cmd.exe, F=lsDFM, A=/c $u
  490.  
  491. S10
  492. R<@>            $n                errors to mailer-daemon
  493. R$+            $: $>11 $1            perform internal rewrite
  494. R$+            $: $>12 $1            perform external rewrite
  495.  
  496.  
  497. #
  498. # Relay Mailer specifications
  499. #
  500.  
  501. Minternal,    P=[IPC], F=mDFMuX, S=11, R=0, A=IPC $h
  502. Mexternal,    P=[IPC], F=mDFMuX, S=12, R=0, A=IPC $h
  503.  
  504.  
  505. S11
  506. R<@>            $n                errors to mailer-daemon
  507. R$+            $: $>40 < $I > $1
  508.  
  509. S12
  510. R<@>            $n                errors to mailer-daemon
  511. R$+            $: $>40 < $H > $1
  512. R$+            $: $>41 $1
  513.  
  514. # Rewrite addresses so they look like they are from a hub
  515. S40
  516. R< > $-            $@ $1 < @ $w >            no hub defined, user => user@thishost
  517. R< > $+            $@ $1                no hub defined
  518. R< $+ > $-        $@ $2 < @ $1 >            user => user@hub
  519. R< $+ > $+ < @ $w $* >    $@ $2 < @ $1 >            user@thishost   => user@hub
  520. R< $+ > $+ < @ $=w $* >    $@ $2 < @ $1 >            user@othernames => user@hub
  521. R< $+ > $+ < @ $=w.$D >    $@ $2 < @ $1 >            user@thishostonly      => user@hub
  522. R< $+ > $+        $@ $2                hub defined but no rewrite
  523.  
  524. # Rewrite addresses so they look like they are from a specific user id
  525. S41
  526. R$*            $: < $P > $1            expand with user id macro
  527. R< > $+            $@ $1                no user id macro defined
  528. R< $+ > $+ < @ $H >    $@ $P < @ $H >            user@host => newuser@host
  529. R< $+ > $+        $@ $2                user id macro defined but no rewrite
  530.  
  531.  
  532. # Sendmail configuration file *must* end with a newline - do not remove below newline
  533. OHd:\etc\sendmail\sendmail.hf
  534. OAd:\etc\sendmail\aliases
  535. OSd:\etc\sendmail\sendmail.st
  536. OE/d:\etc\sendmail\message
  537.