home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / N / SENDMAIL / _SENDMAI.TAR / usr / src / sendmail / linux.nodns-smtp.cf next >
Encoding:
Text File  |  1994-08-12  |  15.2 KB  |  603 lines

  1. #
  2. # Copyright (c) 1983 Eric P. Allman
  3. # Copyright (c) 1988, 1993
  4. #    The Regents of the University of California.  All rights reserved.
  5. #
  6. # Redistribution and use in source and binary forms, with or without
  7. # modification, are permitted provided that the following conditions
  8. # are met:
  9. # 1. Redistributions of source code must retain the above copyright
  10. #    notice, this list of conditions and the following disclaimer.
  11. # 2. Redistributions in binary form must reproduce the above copyright
  12. #    notice, this list of conditions and the following disclaimer in the
  13. #    documentation and/or other materials provided with the distribution.
  14. # 3. All advertising materials mentioning features or use of this software
  15. #    must display the following acknowledgement:
  16. #    This product includes software developed by the University of
  17. #    California, Berkeley and its contributors.
  18. # 4. Neither the name of the University nor the names of its contributors
  19. #    may be used to endorse or promote products derived from this software
  20. #    without specific prior written permission.
  21. #
  22. # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  23. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  24. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  25. # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  26. # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  27. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  28. # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  29. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  30. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  31. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  32. # SUCH DAMAGE.
  33. #
  34.  
  35.  
  36. ######################################################################
  37. ######################################################################
  38. #####
  39. #####        SENDMAIL CONFIGURATION FILE
  40. #####
  41. ##### built by root@runty on Fri Aug 12 03:01:07 CDT 1994
  42. ##### in /usr/src/sendmail/cf
  43. #####
  44. ######################################################################
  45. ######################################################################
  46.  
  47. #####  @(#)cf.m4    8.4 (Berkeley) 12/24/93  #####
  48.  
  49. Cwlocalhost
  50. #####  linux for smtp-only setup  #####
  51. #####  @(#)linux.m4    8.2 (Berkeley) 8/21/93  #####
  52.  
  53.  
  54. #####  @(#)nodns.m4    8.1 (Berkeley) 8/6/93  #####
  55.  
  56. #####  @(#)nouucp.m4    8.1 (Berkeley) 6/7/93  #####
  57.  
  58. #####  @(#)always_add_domain.m4    8.1 (Berkeley) 6/7/93  #####
  59.  
  60.  
  61. #####  @(#)proto.m4    8.45 (Berkeley) 3/4/94  #####
  62.  
  63.  
  64. # level 5 config file format
  65. V5
  66.  
  67. ##################
  68. #   local info   #
  69. ##################
  70.  
  71. Cwlocalhost
  72.  
  73.  
  74. CP.
  75.  
  76. # "Smart" relay host (may be null)
  77. DS
  78.  
  79. # who I send unqualified names to (null means deliver locally)
  80. DR
  81.  
  82. # who gets all local email traffic ($R has precedence for unqualified names)
  83. DH
  84.  
  85. # who I masquerade as (null for no masquerading)
  86. DM
  87.  
  88. # class L: names that should be delivered locally, even if we have a relay
  89. # class E: names that should be exposed as from this host, even if we masquerade
  90. #CLroot
  91. CEroot
  92.  
  93. # operators that cannot be in local usernames (i.e., network indicators)
  94. CO @ % 
  95.  
  96. # a class with just dot (for identifying canonical names)
  97. C..
  98.  
  99. # dequoting map
  100. Kdequote dequote
  101.  
  102.  
  103. ######################
  104. #   Special macros   #
  105. ######################
  106.  
  107. # SMTP initial login message
  108. De$j Sendmail $v/$Z ready at $b
  109.  
  110. # UNIX initial From header format
  111. DlFrom $g  $d
  112.  
  113. # my name for error messages
  114. DnMAILER-DAEMON
  115.  
  116. # delimiter (operator) characters
  117. Do.:%@!^/[]
  118.  
  119. # format of a total name
  120. Dq$?x$x <$g>$|$g$.
  121.  
  122. # Configuration version number
  123. DZ8.6.9
  124.  
  125.  
  126. ###############
  127. #   Options   #
  128. ###############
  129.  
  130. # strip message body to 7 bits on input?
  131. O7False
  132.  
  133. # wait (in minutes) for alias file rebuild
  134. Oa10
  135.  
  136. # location of alias file
  137. OA/etc/aliases
  138.  
  139. # minimum number of free blocks on filesystem
  140. Ob4
  141.  
  142. # substitution for space (blank) characters
  143. OB.
  144.  
  145. # avoid connecting to "expensive" mailers on initial submission?
  146. OcFalse
  147.  
  148. # checkpoint queue runs after every N successful deliveries
  149. OC10
  150.  
  151. # default delivery mode
  152. Odbackground
  153.  
  154. # automatically rebuild the alias database?
  155. ODFalse
  156.  
  157. # error message header/file
  158. #OE/etc/sendmail.oE
  159.  
  160. # error mode
  161. #Oep
  162.  
  163. # save Unix-style "From_" lines at top of header?
  164. OfFalse
  165.  
  166. # temporary file mode
  167. OF0600
  168.  
  169. # match recipients against GECOS field?
  170. OGFalse
  171.  
  172. # default GID
  173. Og1
  174.  
  175. # maximum hop count
  176. Oh17
  177.  
  178. # location of help file
  179. OH/usr/lib/sendmail.hf
  180.  
  181. # ignore dots as terminators in incoming messages?
  182. OiFalse
  183.  
  184. # Insist that the BIND name server be running to resolve names
  185. #OI
  186.  
  187. # deliver MIME-encapsulated error messages?
  188. OjTrue
  189.  
  190. # Forward file search path
  191. #OJ/var/forward/$u:$z/.forward.$w:$z/.forward
  192.  
  193. # open connection cache size
  194. Ok2
  195.  
  196. # open connection cache timeout
  197. OK5m
  198.  
  199. # use Errors-To: header?
  200. OlFalse
  201.  
  202. # log level
  203. OL9
  204.  
  205. # send to me too, even in an alias expansion?
  206. OmFalse
  207.  
  208. # verify RHS in newaliases?
  209. OnTrue
  210.  
  211. # default messages to old style headers if no special punctuation?
  212. OoTrue
  213.  
  214. # SMTP daemon options
  215. #OOPort=esmtp
  216.  
  217. # privacy flags
  218. Opauthwarnings
  219.  
  220. # who (if anyone) should get extra copies of error messages
  221. #OPPostmaster
  222.  
  223. # slope of queue-only function
  224. #Oq600000
  225.  
  226. # queue directory
  227. OQ/var/spool/mqueue
  228.  
  229. # read timeout -- now OK per RFC 1123 section 5.3.2
  230. #Ordatablock=10m
  231.  
  232. # queue up everything before forking?
  233. OsTrue
  234.  
  235. # status file
  236. OS/etc/sendmail.st
  237.  
  238. # default message timeout interval
  239. OT5d/4h
  240.  
  241. # time zone handling:
  242. #  if undefined, use system default
  243. #  if defined but null, use TZ envariable passed in
  244. #  if defined and non-null, use that info
  245. #Ot
  246.  
  247. # default UID
  248. Ou1
  249.  
  250. # list of locations of user database file (null means no lookup)
  251. OU
  252.  
  253. # fallback MX host
  254. #OVfall.back.host.net
  255.  
  256. # if we are the best MX host for a site, try it directly instead of config err
  257. OwFalse
  258.  
  259. # load average at which we just queue messages
  260. Ox8
  261.  
  262. # load average at which we refuse connections
  263. OX12
  264.  
  265. # work recipient factor
  266. #Oy30000
  267.  
  268. # deliver each queued job in a separate process?
  269. OYFalse
  270.  
  271. # work class factor
  272. #Oz1800
  273.  
  274. # work time factor
  275. #OZ90000
  276.  
  277. ###########################
  278. #   Message precedences   #
  279. ###########################
  280.  
  281. Pfirst-class=0
  282. Pspecial-delivery=100
  283. Plist=-30
  284. Pbulk=-60
  285. Pjunk=-100
  286.  
  287. #####################
  288. #   Trusted users   #
  289. #####################
  290.  
  291. Troot
  292. Tdaemon
  293. Tuucp
  294.  
  295. #########################
  296. #   Format of headers   #
  297. #########################
  298.  
  299. H?P?Return-Path: $g
  300. HReceived: $?sfrom $s $.$?_($?s$|from $.$_) $.by $j ($v/$Z)$?r with $r$. id $i$?u for $u$.; $b
  301. H?D?Resent-Date: $a
  302. H?D?Date: $a
  303. H?F?Resent-From: $q
  304. H?F?From: $q
  305. H?x?Full-Name: $x
  306. HSubject:
  307. # HPosted-Date: $a
  308. # H?l?Received-Date: $b
  309. H?M?Resent-Message-Id: <$t.$i@$j>
  310. H?M?Message-Id: <$t.$i@$j>
  311. #
  312. ######################################################################
  313. ######################################################################
  314. #####
  315. #####            REWRITING RULES
  316. #####
  317. ######################################################################
  318. ######################################################################
  319.  
  320.  
  321. ###########################################
  322. ###  Rulset 3 -- Name Canonicalization  ###
  323. ###########################################
  324. S3
  325.  
  326. # handle null input (translate to <@> special case)
  327. R$@            $@ <@>
  328.  
  329. # basic textual canonicalization -- note RFC733 heuristic here
  330. R$*<$*>$*<$*>$*        $2$3<$4>$5            strip multiple <> <>
  331. R$*<$*<$+>$*>$*        <$3>$5                2-level <> nesting
  332. R$*<>$*            $@ <@>                MAIL FROM:<> case
  333. R$*<$+>$*        $2                basic RFC821/822 parsing
  334.  
  335. # handle list:; syntax as special case
  336. R$*:;$*            $@ $1 :; <@>
  337.  
  338. # make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
  339. R@ $+ , $+        @ $1 : $2            change all "," to ":"
  340.  
  341. # localize and dispose of route-based addresses
  342. R@ $+ : $+        $@ $>96 < @$1 > : $2        handle <route-addr>
  343.  
  344. # find focus for list syntax
  345. R $+ : $* ; @ $+    $@ $>96 $1 : $2 ; < @ $3 >    list syntax
  346. R $+ : $* ;        $@ $1 : $2;            list syntax
  347.  
  348. # find focus for @ syntax addresses
  349. R$+ @ $+        $: $1 < @ $2 >            focus on domain
  350. R$+ < $+ @ $+ >        $1 $2 < @ $3 >            move gaze right
  351. R$+ < @ $+ >        $@ $>96 $1 < @ $2 >        already canonical
  352.  
  353. # do some sanity checking
  354. R$* < @ $* : $* > $*    $1 < @ $2 $3 > $4        nix colons in addrs
  355.  
  356.  
  357. # if we have % signs, take the rightmost one
  358. R$* % $*        $1 @ $2                First make them all @s.
  359. R$* @ $* @ $*        $1 % $2 @ $3            Undo all but the last.
  360. R$* @ $*        $@ $>96 $1 < @ $2 >        Insert < > and finish
  361.  
  362. # else we must be a local name
  363.  
  364.  
  365. ################################################
  366. ###  Ruleset 96 -- bottom half of ruleset 3  ###
  367. ################################################
  368.  
  369. #  At this point, everything should be in a "local_part<@domain>extra" format.
  370. S96
  371.  
  372. # handle special cases for local names
  373. R$* < @ localhost > $*        $: $1 < @ $j . > $2        no domain at all
  374. R$* < @ localhost . $m > $*    $: $1 < @ $j . > $2        local domain
  375. R$* < @ [ $+ ] > $*        $: $1 < @@ [ $2 ] > $3        mark [a.b.c.d]
  376. R$* < @@ $=w > $*        $: $1 < @ $j . > $3        self-literal
  377. R$* < @@ $+ > $*        $@ $1 < @ $2 > $3        canon IP addr
  378.  
  379. # pass to name server to make hostname canonical
  380. R$* < @ $* $~P > $*        $: $1 < @ $[ $2 $3 $] > $4
  381.  
  382. # local host aliases and pseudo-domains are always canonical
  383. R$* < @ $=w > $*        $: $1 < @ $2 . > $3
  384. R$* < @ $* $=P > $*        $: $1 < @ $2 $3 . > $4
  385. R$* < @ $* . . > $*        $1 < @ $2 . > $3
  386.  
  387. # if this is the local hostname, make sure we treat is as canonical
  388. R$* < @ $j > $*            $: $1 < @ $j . > $2
  389.  
  390.  
  391. ##################################################
  392. ###  Ruleset 4 -- Final Output Post-rewriting  ###
  393. ##################################################
  394. S4
  395.  
  396. R$*<@>            $@ $1                handle <> and list:;
  397.  
  398. # strip trailing dot off possibly canonical name
  399. R$* < @ $+ . > $*    $1 < @ $2 > $3
  400.  
  401. # externalize local domain info
  402. R$* < $+ > $*        $1 $2 $3            defocus
  403. R@ $+ : @ $+ : $+    @ $1 , @ $2 : $3        <route-addr> canonical
  404. R@ $*            $@ @ $1                ... and exit
  405.  
  406.  
  407. # delete duplicate local names
  408. R$+ % $=w @ $=w        $1 @ $j                u%host@host => u@host
  409.  
  410.  
  411.  
  412. ##############################################################
  413. ###   Ruleset 97 -- recanonicalize and call ruleset zero   ###
  414. ###           (used for recursive calls)           ###
  415. ##############################################################
  416.  
  417. S97
  418. R$*            $: $>3 $1
  419. R$*            $@ $>0 $1
  420.  
  421.  
  422. ######################################
  423. ###   Ruleset 0 -- Parse Address   ###
  424. ######################################
  425.  
  426. S0
  427.  
  428. R<@>            $#local $: <>            special case error msgs
  429. R$* : $* ;        $#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
  430. R<@ $+>            $#error $@ USAGE $: "user address required"
  431. R<$* : $* >        $#error $@ USAGE $: "colon illegal in host name part"
  432.  
  433. # handle numeric address spec
  434. R$* < @ [ $+ ] > $*    $: $>98 $1 < @ [ $2 ] > $3    numeric internet spec
  435. R$* < @ [ $+ ] > $*    $#smtp $@ [$2] $: $1 < @ [$2] > $3    still numeric: send
  436.  
  437. # now delete the local info -- note $=O to find characters that cause forwarding
  438. R$* < @ > $*        $@ $>97 $1        user@ => user
  439. R< @ $=w . > : $*    $@ $>97 $2        @here:... -> ...
  440. R$* $=O $* < @ $=w . >    $@ $>97 $1 $2 $3        ...@here -> ...
  441.  
  442. # handle local hacks
  443. R$*            $: $>98 $1
  444.  
  445. # short circuit local delivery so forwarded email works
  446. R$+ < @ $=w . >        $: $1 < @ $2 . @ $H >        first try hub
  447. R$+ < $+ @ $+ >        $#local $: $1            yep ....
  448. R$+ < $+ @ >        $#local $: @ $1            nope, local address
  449.  
  450.  
  451. # resolve fake top level domains by forwarding to other hosts
  452.  
  453.  
  454.  
  455. # pass names that still have a host to a smarthost (if defined)
  456. R$* < @ $* > $*        $: $>95 < $S > $1 < @ $2 > $3    glue on smarthost name
  457.  
  458. # deal with other remote names
  459. R$* < @$* > $*        $#smtp $@ $2 $: $1 < @ $2 > $3        user@host.domain
  460.  
  461. # if this is quoted, strip the quotes and try again
  462. R$+            $: $(dequote $1 $)        strip quotes
  463. R$+ $=O $+        $@ $>97 $1 $2 $3            try again
  464.  
  465. # handle locally delivered names
  466. R$=L            $#local $: @ $1            special local names
  467. R$+            $#local $: $1            regular local names
  468.  
  469. ###########################################################################
  470. ###   Ruleset 5 -- special rewriting after aliases have been expanded   ###
  471. ###           (new sendmail only)                    ###
  472. ###########################################################################
  473.  
  474. S5
  475.  
  476. # see if we have a relay or a hub
  477. R$+            $: < $R > $1            try relay
  478. R< > $+            $: < $H > $1            try hub
  479. R< > $+            $@ $1                nope, give up
  480. R< $- : $+ > $+        $: $>95 < $1 : $2 > $3 < @ $2 >
  481. R< $+ > $+        $@ $>95 < $1 > $2 < @ $1 >
  482.  
  483. ###################################################################
  484. ###  Ruleset 95 -- canonify mailer:host syntax to triple    ###
  485. ###################################################################
  486.  
  487. S95
  488. R< > $*            $@ $1                strip off null relay
  489. R< $- : $+ > $*        $# $1 $@ $2 $: $3        try qualified mailer
  490. R< $=w > $*        $@ $2                delete local host
  491. R< $+ > $*        $#relay $@ $1 $: $2        use unqualified mailer
  492.  
  493. ###################################################################
  494. ###  Ruleset 98 -- local part of ruleset zero (can be null)    ###
  495. ###################################################################
  496.  
  497. S98
  498. #
  499. ######################################################################
  500. ######################################################################
  501. #####
  502. #####            MAILER DEFINITIONS
  503. #####
  504. ######################################################################
  505. ######################################################################
  506.  
  507.  
  508. ##################################################
  509. ###   Local and Program Mailer specification   ###
  510. ##################################################
  511.  
  512. #####  @(#)local.m4    8.6 (Berkeley) 10/24/93  #####
  513.  
  514. Mlocal,        P=/usr/bin/deliver, F=lsDFMShP, S=10, R=20/40,
  515.         A=deliver $u
  516. Mprog,        P=/bin/sh, F=lsDFMeu, S=10, R=20/40, D=$z:/,
  517.         A=sh -c $u
  518.  
  519. S10
  520. R<@>            $n            errors to mailer-daemon
  521. R$+            $: $>40 $1
  522.  
  523. S20
  524. R$+ < @ $* >        $: $1            strip host part
  525.  
  526. S40
  527. R$* < @ $* > $*        $@ $1 < @ $2 > $3    already fully qualified
  528. R$*            $: $1 @ $M        add local qualification
  529. R$* @            $: $1 @ $j        if $M not defined
  530.  
  531. #####################################
  532. ###   SMTP Mailer specification   ###
  533. #####################################
  534.  
  535. #####  @(#)smtp.m4    8.15 (Berkeley) 2/14/94  #####
  536.  
  537. Msmtp,        P=[IPC], F=mDFMuX, S=11/31, R=21, E=\r\n,
  538.         L=990, A=IPC $h
  539. Mesmtp,        P=[IPC], F=mDFMuXa, S=11/31, R=21, E=\r\n,
  540.         L=990, A=IPC $h
  541. Mrelay,        P=[IPC], F=mDFMuXa, S=11/31, R=61, E=\r\n,
  542.         L=2040, A=IPC $h
  543.  
  544. #
  545. #  envelope sender and masquerading recipient rewriting
  546. #
  547. S11
  548. R$+            $: $>51 $1            sender/recipient common
  549. R$* :; <@>        $@ $1 :;            list:; special case
  550. R$*            $@ $>61 $1            qualify unqual'ed names
  551.  
  552.  
  553. #
  554. #  header recipient rewriting if not masquerading recipients
  555. #
  556. S21
  557.  
  558. # do sender/recipient common rewriting
  559. R$+            $: $>51 $1
  560.  
  561. # unqualified names (e.g., "eric") are qualified by local host
  562. R$* < @ $* > $*        $@ $1 < @ $2 > $3        already qualified
  563. R$+            $: $1 < @ $j >            add local domain
  564.  
  565.  
  566. #
  567. #  header sender and masquerading recipient rewriting
  568. #
  569. S31
  570. R$+            $: $>51 $1            sender/recipient common
  571. R$* :; <@>        $@ $1 :;            list:; special case
  572.  
  573. # do special header rewriting
  574. R$* <@> $*        $@ $1 <@> $2            pass null host through
  575. R< @ $* > $*        $@ < @ $1 > $2            pass route-addr through
  576. R$=E < @ $=w . >    $@ $1 < @ $2 >            exposed user as is
  577. R$* < @ $=w . >        $: $1 < @ $2 @ $M >        masquerade as domain
  578. R$* < @ $+ @ >        $@ $1 < @ $2 >            in case $M undefined
  579. R$* < @ $+ @ $+ >    $@ $1 < @ $3 >            $M is defined -- use it
  580. R$*            $@ $>61 $1            qualify unqual'ed names
  581.  
  582.  
  583. #
  584. #  convert pseudo-domain addresses to real domain addresses
  585. #
  586. S51
  587.  
  588. # pass <route-addr>s through
  589. R< @ $+ > $*        $@ < @ $1 > $2            resolve <route-addr>
  590.  
  591. # output fake domains as user%fake@relay
  592.  
  593.  
  594. #
  595. #  common sender and masquerading recipient rewriting
  596. #
  597. S61
  598.  
  599. R$* < @ $* > $*        $@ $1 < @ $2 > $3        already qualified
  600. R$=E            $@ $1 < @ $j>            show exposed names
  601. R$+            $: $1 < @ $M >            user w/o host
  602. R$+ <@>            $: $1 < @ $j >            in case $M undefined
  603.