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