home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / smail-3.1.28 / guide / admin / config next >
Encoding:
Text File  |  1992-09-05  |  30.5 KB  |  901 lines

  1. .\" @(#)guide/admin/config    1.5 9/6/92 04:13:42
  2. .NH
  3. Setting up Run-time Configuration Files
  4. .PP
  5. The
  6. .B smail3.1
  7. binary is preloaded with a complete configuration and needs no
  8. run-time configuration files.  This preloaded configuration file is
  9. tunable over a small range through the
  10. .I EDITME
  11. file, and should be sufficient for many sites.  However, if this
  12. configuration is not sufficient for your site, or if you wish to
  13. define a router that uses
  14. .I method
  15. files, then you can write run-time configuration files to adapt smail
  16. to fit your needs.
  17. .NH 2
  18. Types of Run-time Configuration Files
  19. .PP
  20. There are five types of run-time configuration files:
  21. .RS
  22. .IP \(bu
  23. one or two
  24. .B config
  25. files, used to set values for a variety of smail variables,
  26. .IP \(bu
  27. a
  28. .B directors
  29. file, describing the rules for resolving local addresses,
  30. .IP \(bu
  31. a
  32. .B routers
  33. file, describing the rules for resolving remote addresses,
  34. .IP \(bu
  35. a
  36. .B transports
  37. file, describing the possible methods for performing delivery,
  38. .IP \(bu
  39. and zero or more
  40. .B method
  41. files, which match hosts to transports.
  42. .RE
  43. .LP
  44. The following sections give
  45. overviews of the formats of these files, with examples of their use.
  46. For a complete format description see the man page
  47. .I smail (5).
  48. .NH 3
  49. Config Files
  50. .PP
  51. Any machine may have a primary and a secondary
  52. .B config
  53. file which redefines the values for a number of smail variables.
  54. These files can be used to define names for the localhost, define
  55. where files reside, setup the values for site-definable message header
  56. fields and more.  Values set in the primary config file override
  57. values predefined in the smail binary.  Values set in the secondary
  58. config file override values defined in the smail binary or in the
  59. primary configuration file.  Also, the name of the secondary config
  60. file can be redefined in the primary configuration file.
  61. .PP
  62. The capability for having two such files is useful in networked
  63. environments with distributed filesystems.  For example, on the Sun
  64. network at Amdahl Corp., we define the name of the primary
  65. configuration file to be
  66. .I /usr/local/lib/smail/config
  67. which is found on our fileservers.  This file is maintained by the
  68. group that maintains the mailers running on all of the Suns.  The
  69. primary configuration file defines a secondary configuration file
  70. named
  71. .I /private/usr/lib/smail/config .
  72. If such a file exists on a given workstation, it can be used to
  73. redefine the mailer behavior on that workstation without requiring
  74. different binaries.
  75. .PP
  76. Because this second configuration file can redefine the paths to any
  77. other configuration file or directory, any aspect of the mailer
  78. behavior can be changed.  Thus, a gateway machine can use the same
  79. primary config file, director file and transport file as the other
  80. suns while using its own private router file.  In addition, a
  81. machine on which a new delivery agent is being tested can define
  82. a private config file that points to its own router and transport
  83. files.
  84. .PP
  85. The format for either config file consists of text records that set a
  86. variable equal to some value.  To set a variable to a string or
  87. numeric value, use the form:
  88. .DS I
  89. \fIvariable\fP = \fIvalue\fP
  90. .DE
  91. For example, the file
  92. .DS I
  93. postmaster = tron@glotz.uucp
  94. domains = wall.com
  95. spool_mode = 0664
  96. .DE
  97. sets the default address for the postmaster to ``tron@glotz.uucp'',
  98. sets the run-time equivalent of the EDITME variable DOMAINS to
  99. ``wall.com'' and sets the permission mode for spool files to allow the
  100. file owner and group to write it.
  101. .PP
  102. Boolean attributes can be set using the notation:
  103. .DS I
  104. +\fIboolean-variable\fP
  105. .DE
  106. and can be reset using the notation:
  107. .DS I
  108. \-\fIboolean-variable\fP
  109. .DE
  110. The ``\-\fIvariable\fP'' notation can also be used to set a numeric
  111. variable to zero and to unset a value for a string variable.  For
  112. example, the following config file disables the use of an external
  113. transport file and tells smail that configuration files are not
  114. optional:
  115. .DS I
  116. \-transport_file
  117. +require_configs
  118. .DE
  119. Comments using the shell `#' notation and blank lines are allowed in
  120. config files.  In addition, records can be extended by including white
  121. space at the beginning of successive lines.  For example, the
  122. following config file sets the
  123. .B Received:
  124. header field to use for messages to a multi-line value and sets the
  125. name of a user that has few access capabilities:
  126. .DS I
  127. .ta .5i 2.5i
  128. # Use a verbose format for the Received: header field
  129. received_field = "Received: by $primary_name
  130.     with smail ($version_string)
  131.     id <$message_id@$primary_name); $date"
  132. .sp \n(PDu
  133. nobody = unknown    # unknown has few access capabilities
  134. .TA
  135. .DE
  136. .PP
  137. The complete list of variables that can be set in the config files is
  138. described in the man page
  139. .I smail (5).
  140. .NH 3
  141. Directors, routers and Transports Files
  142. .PP
  143. The
  144. .B directors ,
  145. .B routers
  146. and
  147. .B transports
  148. files all have the same format.  These files describe entries in a
  149. table where each entry describes the attributes for one director,
  150. router or transport.  The order of entries in the director and router
  151. files is import, in that directors and routers are called in the order
  152. stated in the table.  The order of entries in the transport file is
  153. not important.
  154. .PP
  155. An entry in one of these files defines:
  156. .RS
  157. .IP \(bu
  158. a name by which that entry is
  159. known.
  160. .IP \(bu
  161. a driver which implements the function for that entry.
  162. .IP \(bu
  163. a set of
  164. .I generic
  165. attributes from a set that can be applied to any entry in the file.
  166. .IP \(bu
  167. a set of
  168. .I driver-specific
  169. attributes, from a set that can be applied only to entries that use
  170. the specified driver.
  171. .RE
  172. .PP
  173. As an example, the director file entry below specifies the attributes
  174. for a director that reads aliases from a file
  175. .I /private/usr/lib/aliases :
  176. .DS I
  177. .ta .5i
  178. # read aliases from a file private to one machine on the network
  179. private_aliases:
  180.     driver=aliasfile, owner=owner\-$user ;
  181.     file=/private/usr/lib/aliases
  182. .TA
  183. .DE
  184. This entry is named
  185. .I private_aliases ,
  186. and depends upon the low-level director driver routine named
  187. .I aliasfile .
  188. Errors found while processing addresses found by this director
  189. are sent to an address formed by prepending ``owner\-'' to
  190. the name of the alias, and these the aliases are stored in the file
  191. .I /private/usr/lib/aliases .
  192. The
  193. .I aliasfile
  194. director driver implements a general mechanism for looking up aliases
  195. stored in a database.  By default, this database is simply a file
  196. containing ASCII records in no particular order.  The file
  197. .I /private/usr/lib/aliases
  198. could contain:
  199. .DS I
  200. .ta .5i 3i
  201. # tron is the postmaster for this particular machine
  202. Postmaster: tron
  203. .sp \n(PDu
  204. # list the users that are likely to use futatsu frequently
  205. Futatsu-Users:
  206.     tron,    # Ronald S. Karr
  207.     chongo,    # Landon Curt Noll
  208.     deleanu    # Jay Deleanu
  209. .TA
  210. .DE
  211. Notice that, as with other configuration files, an alias can be
  212. extended across multiple lines by beginning successive lines with
  213. whitespace.
  214. .PP
  215. The separation between
  216. .I generic
  217. attributes and
  218. .I driver-specific
  219. attributes mirrors the internal design of
  220. .B smail3.1 .
  221. Above the driver level, there exist routines that implement aspects of
  222. drivers, routers and transports that do not depend upon the specific
  223. means for performing the operation.  These higher-level functions can
  224. be manipulated through the
  225. .I generic
  226. attributes.  On the other hand, the drivers that actually perform
  227. these operations accept a different set of attributes to control their
  228. behavior.  In the case of a driver thats read or writes to a file, a
  229. .B file
  230. attribute usually exists.  In the case of a driver that executes a
  231. program a
  232. .B cmd
  233. attribute usually exists to specify how that program is to be invoked.
  234. .PP
  235. The complete description of the director, router and transport files
  236. is contained in the
  237. .I smail (5)
  238. man page.  Included in the man page is a description for all of the
  239. drivers that are included in the
  240. .B smail3.1
  241. source distribution.  The following sections describe the preloaded
  242. configuration.  To serve as examples, these sections include
  243. configuration files which are the equivalent of the preloaded
  244. configuration.
  245. .NH 2
  246. The Preloaded Configuration
  247. .PP
  248. In order to gain a better understanding of how configuration files can
  249. be used to change the behavior of smail, it is useful to know what
  250. smail will do if run-time configuration files were not used.  This
  251. behavior is defined in the preloaded configuration which is in the
  252. source file
  253. .I src/default.c .
  254. .PP
  255. The preloaded configuration currently comes in two flavors: one flavor
  256. is for systems that have Berkeley-style networking with TCP/IP, the
  257. other flavor is for sites that do not have such networking.  The
  258. difference between the two is that a networking configuration defines
  259. two extra routers to match network hosts by name or by internet
  260. address.  Also, one extra transport is defined to deliver using SMTP
  261. over a TCP/IP connection to a network host.
  262. .NH 3
  263. The Preloaded Director Configuration
  264. .PP
  265. If a
  266. .I directors
  267. configuration file is not found at run-time, then the default
  268. pre-loaded configuration is used.  The default director configuration
  269. supports the following directors:
  270. .iP "aliasinclude and forwardinclude"
  271. For local addresses of the form
  272. .B :include:filename
  273. these addresses will be expanded into a list of addresses contained in
  274. the given ASCII file.  The files to which these addresses refer are
  275. called
  276. .I "mailing list"
  277. files.  This form of local address can come from any alias file,
  278. forward file or mailing list file.  Users cannot supply such addresses
  279. themselves.
  280. .iP "aliases"
  281. This director scans for entries in an alias database.  The name of
  282. this database, and the method by which this file is searched can be
  283. changed in the
  284. .I EDITME
  285. file.  As distributed, aliases are taken from the file
  286. .I /usr/lib/aliases ,
  287. which is an unsorted ASCII text file.  This alias file is optional,
  288. and is ignored if it does not exist.  Any errors found while resolving
  289. addresses produced by an alias are mailed to an address with the
  290. string ``owner\-'' prepended to the name of the alias, if such a local
  291. address is defined.
  292. .iP "dotforward"
  293. A user may have a file named
  294. .I .forward
  295. in his or her home directory.  If such a file exists it will be
  296. scanned for addresses.  Any mail to a user that has such a file will
  297. be redirected to the addresses contained within it.  The file can
  298. contain addresses which specify files or shell commands as recipients.
  299. If the forward file is owned by root or by the user himself, then
  300. deliveries to any shell commands or files are performed under the
  301. user's user and group id.  Any errors found while resolving this list
  302. of addresses are mailed to the Postmaster.  In a forward file for the
  303. user
  304. .I root ,
  305. deliveries to shell command and file addresses are performed under an
  306. unprivileged user and group ID.  The same is true in the case of
  307. forward files that were not owned by root or by the given user.
  308. Finally, shell command and file addresses are not allowed at all in
  309. forward files that are in remotely accessible directories.
  310. .iP "forwardto"
  311. The mailbox file for a user may contain a line of the form
  312. .DS I
  313. Forward to \fIaddress\fP, \fIaddress\fP ...
  314. .DE
  315. as an alternate method for a user to forward his mail.  Only one line
  316. is read from this file so addresses cannot be placed across multiple
  317. lines.  The comments that apply to a
  318. .I forward
  319. file also apply to this use of a mailbox file, except that it is
  320. assumed that a mailbox file is not in a remotely accessible directory.
  321. .iP user
  322. A user is matched by name, either in upper or lower case, with
  323. delivery to that user being performed using a transport by the name of
  324. ``local''.
  325. .uP real-user
  326. A user can also be matched by name if the username is prefixed by
  327. ``real\-''.  Delivery is performed by a transport named ``local''.
  328. .iP lists
  329. Mailing list files can be created under a mailing list directory.
  330. This is a directory named
  331. .I lists
  332. under the directory containing smail utilities and configuration files
  333. (typically
  334. .I /usr/lib/smail ).
  335. A new mailing list can be creating by making a file in this directory
  336. which contains a list of addresses.  The basename of this file
  337. determines the local address which will be expanded to this list of
  338. addresses.  For example, a file named
  339. .I info-smail
  340. could be created with a list of recipient addresses for the
  341. ``info-smail'' mailing list.  Errors in delivering to this list of
  342. addresses are mailed to a local address with the name ``owner\-''
  343. prepended to the basename of the file, if such an address is defined.
  344. .iP smart_user
  345. If a local address is not matched by any other means, mail to that
  346. address can be sent to another machine using the
  347. .B smartuser
  348. director.  The address to which this mail is redirected can be defined
  349. in a
  350. .I config
  351. file by setting the variable
  352. .B smart_user .
  353. For example, the following config file line could be used to redirect
  354. mail to the host amdahl.uts.amdahl.com:
  355. .DS I
  356. smart_user = $user@amdahl.uts.amdahl.com
  357. .DE
  358. If this variable is not set, then the
  359. .B smart_user
  360. director is ignored.
  361. .PP
  362. The order of entries in the director file determines the order in
  363. which operations are attempted.  If a director matches an address then
  364. no other directors are called attempted to expand or resolve that
  365. address.  A director file which is equivalent to the preloaded
  366. configuration is:
  367. .DS I
  368. .ta .5i 3i
  369. # aliasinclude \- expand ":include:filename" addresses
  370. #    produced by alias files
  371. aliasinclude:
  372.     driver = aliasinclude,    # use this special-case driver
  373.     nobody;    # associate nobody user with addresses
  374.         #  when mild permission violations
  375.         #  are encountered
  376. .sp \n(PDu
  377.     copysecure,    # get permissions from alias director
  378.     copyowners    # get owners from alias director
  379. .DE
  380. .DS I
  381. .ta .5i 3i
  382. # forwardinclude \- expand ":include:filename" addresses
  383. #    produced by forward files
  384. forwardinclude:
  385.     driver = forwardinclude,    # use this special-case driver
  386.     nobody;
  387. .sp \n(PDu
  388.     copysecure,    # get perms from forwarding director
  389.     copyowners    # get owners from forwarding director
  390. .DE
  391. .DS I
  392. .ta .5i 3i
  393. # aliases \- search for alias expansions stored in a database
  394. aliases:
  395.     driver = aliasfile,    # general-purpose aliasing director
  396.     \-nobody,    # all addresses are associated
  397.         # with nobody by default, so setting
  398.         # this is not useful.
  399.     owner = owner\-$user;    # problems go to an owner address
  400. .sp \n(PDu
  401.     file = /usr/lib/aliases,
  402.     modemask = 002,
  403.     optional,    # ignore if file does not exist
  404.     proto = lsearch
  405. .DE
  406. .DS I
  407. .ta .5i 3i
  408. # dotforward \- expand .forward files in user home directories
  409. dotforward:
  410.     driver = forwardfile,    # general-purpose forwarding director
  411.     owner = Postmaster,    # problems go to the user's mailbox
  412.     nobody,
  413.     sender_okay;    # sender never removed from expansion
  414. .sp \n(PDu
  415.     file = ~/.forward,    # .forward file in home directories
  416.     checkowner,    # the user can own this file
  417.     owners = root,    # or root can own the file
  418.     modemask = 002,    # it should not be globally writable
  419.     caution = daemon:root,    # don't run things as root or daemon
  420.     # be extra careful of remotely accessible home directories
  421.     unsecure = "~ftp:~uucp:~nuucp:/tmp:/usr/tmp"
  422. .DE
  423. .DS I
  424. .ta .5i 3i
  425. # forwardto \- expand a "Forward to " in user mailbox files
  426. #
  427. # This emulates the V6/V7/System-V forwarding mechanism which uses a
  428. # line of forward addresses stored at the beginning of user mailbox
  429. # files prefixed with the string "Forward to "
  430. forwardto:
  431.     driver = forwardfile,
  432.     owner = Postmaster, nobody, sender_okay;
  433. .sp \n(PDu
  434.     file = /usr/mail/${lc:user}, # the mailbox file for System V
  435.     forwardto,    # enable "Forward to " function
  436.     checkowner,    # the user can own this file
  437.     owners = root,    # or root can own the file
  438.     modemask = 0002,    # under System V, group mail can write
  439.     caution = daemon:root    # don't run things as root or daemon
  440. .DE
  441. .DS I
  442. .ta .5i 3i
  443. # user \- match users on the local host with delivery to their mailboxes
  444. user:    driver = user;    # driver to match usernames
  445. .sp \n(PDu
  446.     transport = local    # local transport goes to mailboxes
  447. .DE
  448. .DS I
  449. .ta .5i 3i
  450. # real_user \- match usernames when prefixed with the string "real\-"
  451. #
  452. # This is useful for allowing an address which explicitly delivers to
  453. # a user's mailbox file.  For example, errors in a .forward file
  454. # expansion can be delivered here, or forwarding loops between
  455. # multiple machines can be resolved by using a real-username address.
  456. real_user:
  457.     driver = user;
  458. .sp \n(PDu
  459.     transport = local,
  460.     prefix = "real\-"    # for example, match real-root
  461. .DE
  462. .DS I
  463. .ta .5i 3i
  464. # lists \- expand mailing lists stored in a list directory
  465. #
  466. # mailing lists can be created simply by creating a file in the
  467. # /usr/lib/smail/lists directory.
  468. lists:    driver = forwardfile,
  469.     caution,    # flag all addresses with caution
  470.     nobody,    # and then associate the nobody user
  471.     owner = owner\-$user;    # system V sites may wish to use
  472.         # o\-$user, as owner\-$user may be
  473.         # too long for a 14-char filename.
  474. .sp \n(PDu
  475.     # map the name of the mailing list to lower case
  476.     file = lists/${lc:user}
  477. .DE
  478. .DS I
  479. .ta .5i 3i
  480. # smart_user \- a partially specified smartuser director
  481. #
  482. # If the config file attribute smart_user is defined as a string such
  483. # as "$user@domain-gateway" then users not matched otherwise will be
  484. # sent off to the host "domain-gateway".
  485. #
  486. # If the smart_user attribute is not defined, this director is ignored.
  487. smart_user:
  488.     driver = smartuser;    # special-case driver
  489. .sp \n(PDu
  490.     # do not match addresses which cannot be made into valid
  491.     # RFC822 local addresses without the use of double quotes.
  492.     well_formed_only
  493. .TA
  494. .DE
  495. .NH 3
  496. The Preloaded Router Configuration
  497. .PP
  498. If a
  499. .I routers
  500. configuration file is not found at run-time, then the default
  501. pre-loaded configuration is used.  The default router configuration
  502. supports the following routers:
  503. .iP inet_addrs
  504. This router will match hosts specified as internet addresses enclosed
  505. in square brackets.  Delivery to such hosts is always performed using
  506. the
  507. .B smtp
  508. transport (described in a later section).  Any hostname with square
  509. brackets that does not match the form of an internet address will be
  510. considered an error.  An example of an internet address is
  511. .B [192.2.12.142] .
  512. This router is only available on machines that support BSD compatible
  513. networking facilities.
  514. .iP inet_hosts
  515. This will match internet hostnames that can be matched through the
  516. .I gethostbyname (3N)
  517. library routine.  Often this library function will match any host in
  518. the file
  519. .I /etc/hosts .
  520. Deliveries to hosts matched with this router are always performed using
  521. the
  522. .B smtp
  523. transport (described in a later section).  This router is only
  524. available on machines that support BSD compatible networking
  525. facilities.
  526. .iP paths
  527. A path database is used to match hosts for which routes are known.
  528. Normally, this path database is stored in the file
  529. .I /usr/lib/smail/paths .
  530. Often this database will be generated from map files distributed over
  531. the USENET newsgroup
  532. .B comp.mail.maps ,
  533. though path databases can also be created through other means.  A
  534. paths database associates a path with specific hostname or domain.  A
  535. path is defined as a set of hostnames separated by single exclamation
  536. points (`!'), with the last host being followed by the string `%s'.
  537. An example of a simple path database is a file containing:
  538. .DS I
  539. .ta \w'.curds.org'u+2n
  540. \&.curds.org    curds-vax!%s
  541. \&.whey.edu    foo!whey-3b20!%s
  542. bar    foo!bar!%s
  543. foo    foo!%s
  544. .DE
  545. Each path in this database specifies the sequence of hosts, from first
  546. to last, through which a mail message must pass to reach the host
  547. specified on the left-hand-side.  For more information on path
  548. databases see
  549. .I pathalias (8)
  550. and
  551. .I mkpath (8).
  552. Depending upon the configuration specified in the
  553. .I EDITME
  554. configuration file, this path file may need to be sorted, or it may
  555. be stored in a database created with the
  556. .I dbm (3X)
  557. library routines (see
  558. .I mkdbm (8)
  559. for information on how to create these databases).  Delivery to hosts
  560. matched with this router is performed using the
  561. .B uux
  562. transport, which is described in a later section.
  563. .iP uucp_neighbors
  564. The program
  565. .I /usr/bin/uuname
  566. is used to obtain a list of sites that the local host communicates
  567. with over UUCP (see
  568. .I uucp (1)).
  569. This router compares hostnames against this list and causes delivery
  570. to be performed using the
  571. .B uux
  572. transport whenever a match is found.
  573. .iP smart_host
  574. If a hostname is not matched by any other means, mail to that host can
  575. be sent to another machine using the
  576. .B smarthost
  577. router.  The path through which this mail is redirected can be
  578. defined in a
  579. .I config
  580. file by setting the variable
  581. .B smart_path .
  582. For example, the following config file line could be used to redirect
  583. mail to the neighboring host
  584. .I amdahl :
  585. .DS I
  586. smart_path = amdahl
  587. .DE
  588. If this variable is not set, then the
  589. .B smart_user
  590. director is ignored.  Delivery is performed using the transport named
  591. in the
  592. .I config
  593. file variable
  594. .B smart_transport .
  595. If this variable is not set then the
  596. .B uux
  597. transport is used.
  598. .PP
  599. The order of entries in the router file determines the order in which
  600. operations are attempted.  If a router matches a hostname completely,
  601. then no other operations are attempted to resolve that host.  If a
  602. router matches a host partially, as a domain in the right-hand side of
  603. the hostname, then subsequent routers may also find routes.  The
  604. router which finds the best match, based on number of characters
  605. matched, wins.  In the case of a tie, the router earliest in the
  606. router file wins.  A router file which is equivalent to the preloaded
  607. configuration file is:
  608. .DS I
  609. .ta .5i 3i
  610. # inet_addrs and inet_hosts are only defined when BSD networking
  611. # exists
  612. .sp \n(PDu
  613. # inet_addrs \- match domain literals containing literal IP addresses
  614. #
  615. # For example, [128.103.1.1] will match harvard.harvard.edu on the
  616. # internet.  The library routine gethostbyaddr(3N) will be called to
  617. # see if a reverse mapping to the canonical hostname is available.
  618. inet_addrs:
  619.     driver = gethostbyaddr,    # router to match IP domain literals
  620.     transport = smtp;    # deliver using SMTP over TCP/IP
  621. .sp \n(PDu
  622.     fail_if_error,    # fail malformed domain literal addrs
  623.     check_for_local    # see if this is really the local host
  624. .DE
  625. .DS I
  626. .ta .5i 3i
  627. # inet_hosts \- match hostnames with gethostbyname(3N)
  628. inet_hosts:
  629.     driver = gethostbyname,    # match hosts with the library function
  630.     transport = smtp
  631. .DE
  632. .DS I
  633. .ta .5i 3i
  634. # paths \- route using a paths file, like that produced by the
  635. #    pathalias program
  636. paths:    driver = pathalias,    # general-use paths router
  637.     transport = uux;    # for matches, deliver over UUCP
  638. .sp \n(PDu
  639.     file = paths,    # sorted file containing path info
  640.     proto = bsearch,    # use a binary search
  641.     optional,    # ignore if the file does not exist
  642.     domain = uucp    # strip ending ".uucp" before searching
  643. .DE
  644. .DS I
  645. .ta .5i 3i
  646. # uucp_neighbors \- match neighbors accessible over UUCP
  647. uucp_neighbors:
  648.     driver = uuname,    # use a program which returns neighbors
  649.     transport = uux;
  650. .sp \n(PDu
  651.     cmd = /usr/bin/uuname,    # specifically, use the uuname program
  652.     domain = uucp
  653. .DE
  654. .DS I
  655. .ta .5i 3i
  656. # smart_host \- a partially specified smarthost director
  657. #
  658. # If the config file attribute smart_path is defined as a path from
  659. # the local host to a remote host, then hostnames not matched
  660. # otherwise will be sent off to the stated remote host.  The config
  661. # file attribute smart_transport can be used to specify a different
  662. # transport.
  663. #
  664. # If the smart_path attribute is not defined, this router is ignored.
  665. smart_host:
  666.     driver = smarthost,    # special-case driver
  667.     transport = uux    # by default deliver over UUCP
  668. .TA
  669. .DE
  670. .NH 3
  671. The Preloaded Transport Configuration
  672. .PP
  673. If a
  674. .I transports
  675. configuration file is not found at run-time, then the default
  676. pre-loaded configuration is used.  The default transport configuration
  677. supports the following transports:
  678. .iP local
  679. Deliver to users on the local machine.  Mailbox files for local users
  680. are generally found under the directory
  681. .I /usr/spool/mail
  682. or under
  683. .I /usr/mail ,
  684. and have the same name as the corresponding user.
  685. To support the generally available user interfaces, such as
  686. .I Mail (1)
  687. and
  688. .I mailx (1),
  689. certain transformations are performed on the message.  Namely, a line
  690. containing the return address of the sender and a time stamp is
  691. prepended to the message, a blank line is appended at the end, and any
  692. line beginning with the word ``From'' will have the character `>'
  693. prepended to it.  An example of one of the lines prepended to the
  694. message is:
  695. .DS I
  696. From amdahl!futatsu!tron Mon Apr 18 16:11:13 1988
  697. .DE
  698. In addition, a ``Return-Path:'' header field is
  699. inserted which duplicates the return address of the sender.
  700. .iP pipe
  701. Local addresses which begin with a vertical bar character (`|') are
  702. delivered using this transport (the transport name
  703. .B pipe
  704. is reserved for this purpose).  The
  705. .B pipe
  706. transport executes a shell command by calling the program
  707. .I /bin/sh .
  708. The message is passed on the standard input to this command.  The
  709. shell command is formed by removing the vertical bar character from
  710. the beginning of the address.  The alias or forward address which
  711. produced the pipe command address is stored in the environment as
  712. "$ADDR".
  713. .iP file
  714. Local addresses which begin with a slash (`/') or a tilde character
  715. (`~') are delivered using this transport (the transport name
  716. .B file
  717. is reserved for this purpose).  The
  718. .B file
  719. transport appends to a file identified by the local address string.
  720. If the local address string begins with a slash, then it identifies an
  721. absolute path.  If the string begins with ``~\fIusername/\fP'', then
  722. this substring is replaced by the home directory of the given user.
  723. If the string begins simply with ``~/'', then this substring will be
  724. replaced with any home directory associated with the address; e.g.,
  725. a file address in a user's
  726. .I ~/.forward
  727. file will be associated with that user's home directory.
  728. .iP uux
  729. The
  730. .B uux
  731. transport is used as the normal form of delivery over UUCP.  This
  732. transport will deliver up to five addresses at a time by calling the
  733. program
  734. .I uux (1)
  735. to deliver mail to the program
  736. .I rmail (1)
  737. on a remote system.  The request is queued, and actual delivery is not
  738. attempted immediately.  To force an immediate attempt to contact the
  739. remote site, use the
  740. .B demand
  741. transport.
  742. .iP demand
  743. The
  744. .B demand
  745. transport is used to deliver up to five addresses at a time by calling
  746. the program
  747. .I uux (1)
  748. to deliver to a remote
  749. .I rmail (1)
  750. program.  In contrast to
  751. .B uux
  752. this transport forces an immediate attempt to contact the remote site.
  753. .iP uusmtp
  754. The
  755. .B uusmtp
  756. transport is used to deliver using Batched SMTP over UUCP.  It will
  757. deliver to an unlimited number of addresses by calling the program
  758. .I uux (1)
  759. to deliver to a remote
  760. .I rsmtp (1)
  761. program.  The request is queued, and actual delivery is not attempted
  762. immediately.
  763. .iP demand_uusmtp
  764. This transport is used to deliver to an unlimited number of addresses
  765. by calling the program
  766. .I uux (1)
  767. to deliver to a remote
  768. .I rsmtp (1)
  769. program.  This transport forces an immediate attempt to contact the
  770. remote site.
  771. .iP smtp
  772. For sites that have BSD networking facilities, this transport is
  773. available, which performs delivery by opening a TCP/IP virtual circuit
  774. to a remote host and engaging in an interactive SMTP dialogue to perform
  775. delivery.
  776. .PP
  777. The order of entries in the transport file is not important, unless
  778. transport entries with duplicate names exist.  In this case, the
  779. transport earlier in the transport file is always used.  A transport
  780. file which is equivalent to the preloaded configuration file is:
  781. .DS I
  782. .ta .5i 3i
  783. # local \- deliver mail to local users
  784. #
  785. # By default, smail will append directly to user mailbox files.
  786. local:    driver = appendfile,    # append message to a file
  787.     return_path,    # include a Return-Path: field
  788.     local,    # use local forms for delivery
  789.     from,    # supply a From_ envelope line
  790.     unix_from_hack;    # insert > before From in body
  791. .sp \n(PDu
  792.     file = /usr/mail/${lc:user},# use this location for System V
  793.     group = mail,    # group to own file for System V
  794.     mode = 0660,    # under System V, group mail can access
  795.     suffix = "\n"    # append an extra newline
  796. .DE
  797. .DS I
  798. .ta .5i 3i
  799. # pipe \- deliver mail to shell commands
  800. #
  801. # This is used implicitly when smail encounters addresses which begin with
  802. # a vertical bar character, such as "|/usr/lib/news/recnews talk.bizarre".
  803. # The vertical bar is removed from the address before being given to the
  804. # transport.
  805. pipe:    driver = pipe,    # pipe message to another program
  806.     return_path, local, from, unix_from_hack;
  807. .sp \n(PDu
  808.     cmd = "/bin/sh \-c $user",# send address to the Bourne Shell
  809.     parent_env,    # environment info from parent addr
  810.     pipe_as_user,    # use user-id associated with address
  811.     umask = 0022,    # umask for child process
  812.     \-log_output    # do not log stdout/stderr
  813. .DE
  814. .DS I
  815. .ta .5i 3i
  816. # file \- deliver mail to files
  817. #
  818. # This is used implicitly when smail encounters addresses which begin with
  819. # a slash or twiddle character, such as "/usr/info/list_messages" or
  820. # perhaps "~/Mail/inbox".
  821. file:    driver = appendfile,
  822.     return_path, local, from, unix_from_hack;
  823. .sp \n(PDu
  824.     file = $user,    # file is taken from address
  825.     append_as_user,    # use user-id associated with address
  826.     expand_user,    # expand ~ and $ within address
  827.     suffix = "\n",
  828.     mode = 0644
  829. .DE
  830. .DS I
  831. .ta .5i 3i
  832. # uux \- deliver to the rmail program on a remote UUCP site
  833. uux:    driver = pipe,
  834.     uucp,    # use UUCP-style addressing forms
  835.     from,    # supply a From_ envelope line
  836.     max_addrs = 5,    # at most 5 addresses per invocation
  837.     max_chars = 200;    # at most 200 chars of addresses
  838. .sp \n(PDu
  839.     # the \-r flag prevents immediate delivery, parentheses around the
  840.     # $user variable prevent special interpretation by uux.
  841.     cmd = "/usr/bin/uux \- \-r $host!rmail $(($user)$)",
  842.     umask = 0022,
  843.     pipe_as_sender
  844. .DE
  845. .DS I
  846. .ta .5i 3i
  847. # demand \- deliver to a remote rmail program, polling on demand
  848. demand:    driver = pipe,
  849.     uucp, from, max_addrs = 5, max_chars = 200;
  850. .sp \n(PDu
  851.     # with no \-r flag, try to contact remote site immediately
  852.     cmd = "/usr/bin/uux \- $host!rmail $(($user)$)",
  853.     umask = 0022, pipe_as_sender
  854. .DE
  855. .DS I
  856. .ta .5i 3i
  857. # uusmtp \- deliver to the rsmtp program on a remote UUCP site
  858. #
  859. # The rsmtp program is assumed to to take batched SMTP requests.
  860. uusmtp:    driver = pipe,
  861.     bsmtp,    # send batched SMTP commands
  862.     inet,    # use internet forms for addressing
  863.     \-max_addrs,    # there is no limit on the number or
  864.     \-max_chars;    #  total size of recipient addresses.
  865. .sp \n(PDu
  866.     # supply \-r to prevent immediate delivery, the recipient addresses
  867.     # are stored in the data sent to the standard input of rsmtp.
  868.     cmd = "/usr/bin/uux \- \-r $host!rsmtp",
  869.     umask = 0022, pipe_as_sender
  870. .DE
  871. .DS I
  872. .ta .5i 3i
  873. # demand_uusmtp \- deliver to a remote rsmtp program, polling on demand
  874. demand_uusmtp:
  875.     driver = pipe, inet,
  876.     bsmtp, \-max_addrs, \-max_chars;
  877. .sp \n(PDu
  878.     # with no \-r flag, try to contact remote site immediately
  879.     cmd = "/usr/bin/uux \- $host!rsmtp",
  880.     umask = 0022, pipe_as_sender
  881. .DE
  882. .DS I
  883. .ta .5i 3i
  884. # smtp \- deliver using SMTP over TCP/IP
  885. #
  886. # Connect to a remote host using TCP/IP and initiate an SMTP conversation
  887. # to deliver the message.  The smtp transport is included only if BSD
  888. # networking exists.
  889. #
  890. # NOTE:    This is hardly optimal, a backend should exist which can handle
  891. #    multiple messages per connection.
  892. #
  893. # ALSO:    It may be necessary to restrict max_addrs to 100, as this is the
  894. #    lower limit SMTP requires an implementation to handle for one
  895. #    message.
  896. smtp:    driver = smtp,
  897.     \-max_addrs,
  898.     \-max_chars, inet
  899. .TA
  900. .DE
  901.