home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / sendmail / sendmail-5.65c+IDA-1.4.4.1 / doc / 07.sendmailop / op.me < prev    next >
Encoding:
Text File  |  1991-08-13  |  109.9 KB  |  4,700 lines

  1. '\"    %W%    %G%    %U%
  2. .\"
  3. .\" Copyright (c) 1983 Eric P. Allman
  4. .\" Copyright (c) 1988 The Regents of the University of California.
  5. .\" All rights reserved.
  6. .\"
  7. .\" Redistribution and use in source and binary forms are permitted
  8. .\" provided that the above copyright notice and this paragraph are
  9. .\" duplicated in all such forms and that any documentation,
  10. .\" advertising materials, and other materials related to such
  11. .\" distribution and use acknowledge that the software was developed
  12. .\" by the University of California, Berkeley.  The name of the
  13. .\" University may not be used to endorse or promote products derived
  14. .\" from this software without specific prior written permission.
  15. .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  16. .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  17. .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  18. .\"
  19. .\"    @(#)op.me    5.11 (Berkeley) 1/23/89
  20. .\"
  21. .\" pic % | eqn | troff -me
  22. .\"if n .ls 2
  23. .\".he 'Sendmail Installation and Operation Guide''%'
  24. .\".fo 'Version 5.11''Last Mod 1/23/89'
  25. .if t .po 1.25i
  26. .eh 'SMM:07-%''Sendmail Installation and Operation Guide'
  27. .oh 'Sendmail Installation and Operation Guide''SMM:07-%'
  28. .nr si 3n
  29. .de $0
  30. .(x
  31. .in \\$3u*3n
  32. .ti -3n
  33. \\$2.  \\$1
  34. .)x
  35. ..
  36. .de $C
  37. .(x
  38. .in 0
  39. \\$1 \\$2.  \\$3
  40. .)x
  41. ..
  42. .+c
  43. .(l C
  44. .sz 16
  45. .b SENDMAIL
  46. .sz 12
  47. .sp
  48. .b "INSTALLATION AND OPERATION GUIDE"
  49. .sz 10
  50. .sp
  51. .r
  52. Eric Allman
  53. Britton-Lee, Inc.
  54. .sp
  55. .sz 8
  56. Enhancements by Lennart L\(o:vstrand
  57. Rank Xerox EuroPARC, Cambridge, England
  58. .sz 10
  59. .sp
  60. Version 5.11++
  61. .sp
  62. For Sendmail Version 5.65c+IDA-1.4.4
  63. .)l
  64. .sp 2
  65. .pp
  66. .i Sendmail
  67. implements a general purpose internetwork mail routing facility
  68. under the UNIX*
  69. .(f
  70. *UNIX is a registered trademark of AT&T Bell Laboratories.
  71. .)f
  72. operating system.
  73. It is not tied to any one transport protocol \*-
  74. its function may be likened to a crossbar switch,
  75. relaying messages from one domain into another.
  76. In the process,
  77. it can do a limited amount of message
  78. envelope and header editing
  79. to put the message into a format that is appropriate
  80. for the receiving domain.
  81. All of this is done under the control of a configuration file.
  82. .pp
  83. Due to the requirements of flexibility
  84. for
  85. .i sendmail ,
  86. the configuration file can seem somewhat unapproachable.
  87. However, there are only a few basic configurations
  88. for most sites,
  89. for which standard configuration files have been supplied.
  90. Most other configurations
  91. can be built by adjusting an existing configuration file
  92. incrementally.
  93. .pp
  94. Although
  95. .i sendmail
  96. is intended to run
  97. without the need for monitoring,
  98. it has a number of features
  99. that may be used to monitor or adjust the operation
  100. under unusual circumstances.
  101. These features are described.
  102. .pp
  103. Section one describes how to do a basic
  104. .i sendmail
  105. installation.
  106. Section two
  107. explains the day-to-day information you should know
  108. to maintain your mail system.
  109. If you have a relatively normal site,
  110. these two sections should contain sufficient information
  111. for you to install
  112. .i sendmail
  113. and keep it happy.
  114. Section three
  115. describes some parameters that may be safely tweaked.
  116. Section four
  117. has information regarding the command line arguments.
  118. Section five
  119. contains the nitty-gritty information about the configuration
  120. file.
  121. This section is for masochists
  122. and people who must write their own configuration file.
  123. The appendixes give a brief
  124. but detailed explanation of a number of features
  125. not described in the rest of the paper.
  126. .pp
  127. The references in this paper are actually found
  128. in the companion paper
  129. .ul
  130. Sendmail \- An Internetwork Mail Router.
  131. This other paper should be read before this manual
  132. to gain a basic understanding
  133. of how the pieces fit together.
  134. .pn 5
  135. .bp
  136. .sh 1 "BASIC INSTALLATION"
  137. .pp
  138. There are two basic steps to installing sendmail.
  139. The hard part is to build the configuration table.
  140. This is a file that sendmail reads when it starts up
  141. that describes the mailers it knows about,
  142. how to parse addresses,
  143. how to rewrite the message
  144. envelope and header addresses,
  145. and the settings of various options.
  146. Although the configuration table is quite complex,
  147. a configuration can usually be built
  148. by adjusting an existing off-the-shelf configuration.
  149. The second part is actually doing the installation,
  150. i.e., creating the necessary files, etc.
  151. .pp
  152. The remainder of this section will describe the installation of sendmail
  153. assuming you can use one of the existing configurations
  154. and that the standard installation parameters are acceptable.
  155. All pathnames and examples
  156. are given from the root of the
  157. .i sendmail
  158. subtree,
  159. normally
  160. .i /usr/src/usr.lib/sendmail
  161. on 4.3BSD.
  162. .sh 2 "IDA sendmail.cf Configurations"
  163. .pp
  164. The master configuration file that takes advantage of the IDA feature set
  165. is in the file
  166. .i ida/cf/Sendmail.mc.
  167. The
  168. .i ida/cf
  169. directory contains several files that document the many
  170. .i m4 (1)
  171. definitions used to create a sendmail.cf file from Sendmail.mc.
  172. The most important source is inside
  173. .i Sendmail.mc
  174. itself.
  175. This is always likely to be the most up to date source of information.
  176. Other files are:
  177. .i OPTIONS :
  178. provides an overview of the main options you may need when first setting
  179. up your system;
  180. .i CANONICAL :
  181. describes the internal representation of email addresses;
  182. .i DBM-Guide :
  183. a guide to the care and feeding of 
  184. .i sendmail 's
  185. DBM databases.
  186. The sub-directory
  187. .i M4
  188. contains several example
  189. .i m4 (1)
  190. control files that build several different flavors of sendmail.cf files.
  191. .pp
  192. First create a
  193. .i system.m4
  194. control file where
  195. .i system
  196. is the simple hostname of your system.
  197. The configuration file is created by issuing the command,
  198. .b "make \fIsystem\fP.cf" .
  199. Once the configuration file is built, skip ahead to the
  200. .q "Installation by Hand"
  201. section.
  202. .sh 2 "Berkeley sendmail.cf Configurations"
  203. .pp
  204. Configuration files currently in use at Berkeley are in
  205. the directory
  206. .i cf
  207. of the sendmail directory.
  208. While upwardly compatible with IDA sendmail, they do not make
  209. use of the new features in it.
  210. This directory contains three subdirectories:
  211. .i cf ,
  212. .i m4 ,
  213. and
  214. .i sitedep .
  215. The directory
  216. .i cf/m4
  217. contains site-independent
  218. .i m4 (1)
  219. include files that have information common to all configuration files,
  220. while
  221. .i cf/sitedep
  222. contains
  223. .i m4 (1)
  224. include files that have site-specific information in them.
  225. These files are used by the master configuration (\*(lq.mc\*(rq)
  226. in
  227. .i cf/cf
  228. and produce standard configuration files (with
  229. .q .cf
  230. suffix) when run through
  231. .i m4 (1).
  232. .pp
  233. Three off the shelf configurations are supplied
  234. to handle the basic cases:
  235. .np
  236. Internet sites running the nameserver
  237. (or using host tables wherein the fully-qualfied domain
  238. name of each host is listed first)
  239. can use
  240. .i cf/tcpproto.cf .
  241. For simple sites,
  242. you should be able to use this file without modification.
  243. This file is not in
  244. .i m4
  245. format.
  246. .np
  247. UUCP only sites can use
  248. .i cf/uucpproto.cf .
  249. This file is not in
  250. .i m4
  251. format.
  252. .np
  253. A group of machines at a single site
  254. connected by an ethernet (or other networking
  255. that supports TCP/IP)
  256. with (only) one host connected to the outside world
  257. via UUCP
  258. is represented by two configuration files:
  259. .i cf/tcpuucpproto.cf
  260. should be installed on the host with outside connections
  261. and
  262. .i cf/tcpproto.cf
  263. should be installed on all other hosts.
  264. .pp
  265. Some configuration will be needed in each of the
  266. above cases.
  267. Just be sure to correctly fill in the 
  268. .q blanks
  269. as shown in the instructions in the configuration file.
  270. Then install the file as
  271. .i /usr/lib/sendmail.cf .
  272. .pp
  273. If you are running a larger or more complex site, it
  274. is to your advantage to read the
  275. .q README
  276. file in the
  277. .i cf
  278. subdirectory.
  279. This file explains how to use
  280. .i m4 (1)
  281. to automatically create configuration files for
  282. non-standard situations.
  283. .sh 2 "Installation Using the Makefile"
  284. .pp
  285. A makefile exists in the root of the
  286. .i sendmail
  287. directory that will do all of these steps
  288. for a 4.3BSD system.
  289. It may have to be slightly tailored
  290. for use on other systems.
  291. .pp
  292. Before using this makefile, you should create a symbolic link from
  293. .i cf
  294. to the directory containing your configuration files.
  295. You should also have created your configuration file
  296. and left it in the file
  297. .q cf/\fIsystem\fP.cf
  298. where
  299. .i system
  300. is the name of your system
  301. (i.e., what is returned by
  302. .i hostname \|(1)).
  303. If you do not have
  304. .i hostname
  305. you can use the declaration
  306. .q HOST=\fIsystem\fP
  307. on the
  308. .i make \|(1)
  309. command line.
  310. You should also examine the file
  311. .i md/config.m4
  312. and change the
  313. .i m4
  314. macros there to reflect any libraries and compilation flags
  315. you may need.
  316. .pp
  317. The basic installation procedure is to type:
  318. .(b
  319. make
  320. make install
  321. make installcf
  322. .)b
  323. in the root directory of the
  324. .i sendmail
  325. distribution.
  326. This will make all binaries
  327. and install them in the standard places.
  328. The second and third
  329. .i make
  330. commands must be executed as the superuser (root).
  331. .sh 2 "Installation by Hand"
  332. .pp
  333. Along with building a configuration file,
  334. you will have to install the
  335. .i sendmail
  336. startup into your UNIX system.
  337. If you are doing this installation
  338. in conjunction with a regular Berkeley UNIX install,
  339. these steps will already be complete.
  340. Many of these steps will have to be executed as the superuser (root).
  341. .sh 3 "/usr/lib/sendmail"
  342. .pp
  343. The binary for sendmail is located in /usr/lib.
  344. If it becomes necessary to recompile and reinstall the
  345. entire system, the following sequence will do it:
  346. .(b
  347. cd src
  348. make clean
  349. make install
  350. .)b
  351. .sh 3 "/etc/sendmail.cf"
  352. .pp
  353. The configuration file
  354. that you created earlier
  355. should be installed in /etc/sendmail.cf:
  356. .(b
  357. cp ida/cf/\fIsystem\fP.cf /etc/sendmail.cf
  358. .)b
  359. .sh 3 "/usr/ucb/newaliases"
  360. .pp
  361. If you are running delivermail,
  362. it is critical that the
  363. .i newaliases
  364. command be replaced.
  365. This can just be a symbolic or hard link to
  366. .i sendmail :
  367. .(b
  368. rm \-f /usr/ucb/newaliases
  369. ln -s /usr/lib/sendmail /usr/ucb/newaliases
  370.    or
  371. ln /usr/lib/sendmail /usr/ucb/newaliases
  372. .)b
  373. .sh 3 "/usr/spool/mqueue"
  374. .pp
  375. The directory
  376. .i /usr/spool/mqueue
  377. should be created to hold the mail queue.
  378. This directory should be mode 755
  379. and owned by root.
  380. .sh 3 "/usr/lib/aliases*"
  381. .pp
  382. The system aliases are held in three files.
  383. The file
  384. .q /usr/lib/aliases
  385. is the master copy.
  386. A sample is given in
  387. .q lib/aliases
  388. which includes some aliases which
  389. .i must
  390. be defined:
  391. .(b
  392. cp lib/aliases /usr/lib/aliases
  393. .)b
  394. You should extend this file with any aliases that are apropos to your system.
  395. .pp
  396. Normally
  397. .i sendmail
  398. looks at a version of these files maintained by the
  399. .i dbm \|(3)
  400. routines.
  401. These are stored in
  402. .q /usr/lib/aliases.dir
  403. and
  404. .q /usr/lib/aliases.pag.
  405. These can initially be created as empty files,
  406. but they will have to be initialized promptly.
  407. These should be mode 644:
  408. .(b
  409. cp /dev/null /usr/lib/aliases.dir
  410. cp /dev/null /usr/lib/aliases.pag
  411. chmod 644 /usr/lib/aliases.*
  412. newaliases
  413. .)b
  414. .sh 3 "/etc/sendmail.fc"
  415. .pp
  416. If you intend to install the frozen version of the configuration file
  417. (for quick startup)
  418. you should create the file /etc/sendmail.fc
  419. and initialize it.
  420. This step may be safely skipped.
  421. .(b
  422. cp /dev/null /etc/sendmail.fc
  423. /usr/lib/sendmail \-bz
  424. .)b
  425. .sh 3 "/etc/rc or /usr/lib/crontab and /etc/inetd.conf"
  426. .pp
  427. You may wish
  428. to start up a sendmail daemon when your system reboots.
  429. This daemon performs two functions:
  430. it listens on the SMTP socket for connections
  431. (to receive mail from a remote system)
  432. and it processes the queue periodically
  433. to insure that mail gets delivered when hosts come up.
  434. .pp
  435. Add the following lines to
  436. .q /etc/rc
  437. (or
  438. .q /etc/rc.local
  439. as appropriate)
  440. in the area where it is starting up the daemons:
  441. .(b
  442. if [ \-f /usr/lib/sendmail ]; then
  443.     (cd /usr/spool/mqueue; rm \-f [tx]f*)
  444.     /usr/lib/sendmail \-bd \-q30m &
  445.     echo \-n ' sendmail' >/dev/console
  446. fi
  447. .)b
  448. The
  449. .q cd
  450. and
  451. .q rm
  452. commands insure that all temporary and transcript files have been removed;
  453. extraneous files may be left around
  454. if the system goes down in the middle of processing a message.
  455. The line that actually invokes
  456. .i sendmail
  457. has two flags:
  458. .q \-bd
  459. causes it to listen on the SMTP port,
  460. and
  461. .q \-q30m
  462. causes it to run the queue every half hour.
  463. .pp
  464. If you are not running a version of UNIX
  465. that supports Berkeley TCP/IP,
  466. do not include the
  467. .b \-bd
  468. flag.
  469. .pp
  470. Alternatively,
  471. you can run sendmail with the
  472. .q \-q
  473. flag from cron(1M).
  474. In this manner,
  475. running the queue can be timed to occur at specific
  476. times, e.g. a few minutes before uucico.
  477. .pp
  478. Handling SMTP requests can be accomplished
  479. by running sendmail with the
  480. .q \-bs
  481. flag from inetd.
  482. A typical line from the inetd configuration file is:
  483. .(b
  484. smtp    stream    tcp    nowait    daemon    /usr/lib/sendmail    sendmail -bs
  485. .)b
  486. .sh 3 "/usr/lib/sendmail.hf"
  487. .pp
  488. This is the help file used by the SMTP
  489. .b HELP
  490. command.
  491. It should be copied from
  492. .q lib/sendmail.hf :
  493. .(b
  494. cp lib/sendmail.hf /usr/lib
  495. .)b
  496. .sh 3 "/var/log/sendmail.st"
  497. .pp
  498. If you wish to collect statistics
  499. about your mail traffic,
  500. you should create the file
  501. .q /var/log/sendmail.st :
  502. .(b
  503. cp /dev/null /var/log/sendmail.st
  504. chmod 666 /var/log/sendmail.st
  505. .)b
  506. This file does not grow.
  507. It is printed with the program
  508. .q aux/mailstats.
  509. .sh 3 "/usr/ucb/newaliases"
  510. .pp
  511. If
  512. .i sendmail
  513. is invoked as
  514. .q newaliases,
  515. it will simulate the
  516. .b \-bi
  517. flag
  518. (i.e., will rebuild the alias database;
  519. see below).
  520. This should be a link to /usr/lib/sendmail.
  521. .sh 3 "/usr/ucb/mailq"
  522. .pp
  523. If
  524. .i sendmail
  525. is invoked as
  526. .q mailq,
  527. it will simulate the
  528. .b \-bp
  529. flag
  530. (i.e.,
  531. .i sendmail
  532. will print the contents of the mail queue;
  533. see below).
  534. This should be a symbolic or hard link to /usr/lib/sendmail.
  535. .sh 3 "/usr/ucb/bsmtp"
  536. .pp
  537. If
  538. .i sendmail
  539. is invoked as
  540. .q bsmtp,
  541. it will simulate the
  542. .b \-bb
  543. flag (i.e.,
  544. .i sendmail
  545. will start accepting batched SMTP commands from stdin; see below).
  546. This should be a symbolic or hard link to /usr/lib/sendmail.
  547. .sh 1 "NORMAL OPERATIONS"
  548. .sh 2 "Quick Configuration Startup"
  549. .pp
  550. A fast version of the configuration file
  551. may be set up by using the
  552. .b \-bz
  553. flag:
  554. .(b
  555. /usr/lib/sendmail \-bz
  556. .)b
  557. This creates the file
  558. .i /etc/sendmail.fc
  559. (\c
  560. .q "frozen configuration" ).
  561. This file is an image of
  562. .i sendmail 's
  563. data space after reading in the configuration file.
  564. If this file exists,
  565. it is used instead of
  566. .i /etc/sendmail.cf.\0
  567. .i Sendmail.fc
  568. must be rebuilt manually every time
  569. .i sendmail.cf
  570. is changed.
  571. .pp
  572. .b N.B.,
  573. some classes in the
  574. .i sendmail.cf
  575. file may be set via the output of a piped command, e.g.,
  576. .i uuname (1).
  577. In order for
  578. .i sendmail
  579. to note changes in the output of piped commands, the
  580. .i sendmail.fc
  581. file must be re-frozen if it is used.
  582. In particular, re-freeze after adding or deleting entries from the UUCP
  583. L.sys (or Systems) file.
  584. .pp
  585. The frozen configuration file will be ignored
  586. if a
  587. .b \-C
  588. flag is specified
  589. or if sendmail detects that it is out of date.
  590. However, the heuristics are not strong
  591. so this should not be trusted.
  592. .sh 2 "The System Log"
  593. .pp
  594. The system log is supported by the
  595. .i syslogd \|(8)
  596. program.
  597. .sh 3 "Format"
  598. .pp
  599. Each line in the system log
  600. consists of a timestamp,
  601. the name of the machine that generated it
  602. (for logging from several machines
  603. over a local area network),
  604. the word
  605. .q sendmail: ,
  606. and a message.
  607. .sh 3 "Levels"
  608. .pp
  609. If you have
  610. .i syslogd \|(8)
  611. or an equivalent installed,
  612. you will be able to do logging.
  613. There is a large amount of information that can be logged.
  614. The log is arranged as a succession of levels.
  615. At the lowest level
  616. only extremely strange situations are logged.
  617. At the highest level,
  618. even the most mundane and uninteresting events
  619. are recorded for posterity.
  620. As a convention,
  621. log levels under ten
  622. are considered
  623. .q useful;
  624. log levels above ten
  625. are usually for debugging purposes.
  626. .pp
  627. A complete description of the log levels
  628. is given in section 4.6.
  629. .sh 2 "The Mail Queue"
  630. .pp
  631. The mail queue should be processed transparently.
  632. However, you may find that manual intervention is sometimes necessary.
  633. For example,
  634. if a major host is down for a period of time
  635. the queue may become clogged.
  636. Although sendmail ought to recover gracefully when the host comes up,
  637. you may find performance unacceptably bad in the meantime.
  638. .sh 3 "Printing the queue"
  639. .pp
  640. The contents of the queue can be printed
  641. using the
  642. .i mailq
  643. command
  644. (or by specifying the
  645. .b \-bp
  646. flag to sendmail):
  647. .(b
  648. mailq
  649. .)b
  650. This will produce a listing of the queue id's,
  651. the size of the message,
  652. the date the message entered the queue,
  653. and the sender and recipients.
  654. .sh 3 "Format of queue files"
  655. .pp
  656. All queue files have the form
  657. \fIx\fP\|\fBf\fP\fIAA99999\fP
  658. where
  659. .i AA99999
  660. is the
  661. .i id
  662. for this file
  663. and the
  664. .i x
  665. is a type.
  666. The types are:
  667. .ip d
  668. The data file.
  669. The message body (excluding the header) is kept in this file.
  670. '\"    .ip l
  671. '\"    The lock file.
  672. '\"    If this file exists,
  673. '\"    the job is currently being processed,
  674. '\"    and a queue run will not process the file.
  675. '\"    For that reason,
  676. '\"    an extraneous
  677. '\"    .b lf
  678. '\"    file can cause a job to apparently disappear
  679. '\"    (it will not even time out!).
  680. '\"    .ip n
  681. '\"    This file is created when an id is being created.
  682. '\"    It is a separate file to insure that no mail can ever be destroyed
  683. '\"    due to a race condition.
  684. '\"    It should exist for no more than a few milliseconds
  685. '\"    at any given time.
  686. .ip q
  687. The queue control file.
  688. This file contains the information necessary to process the job.
  689. .ip t
  690. A temporary file.
  691. These are an image of the
  692. .b qf
  693. file when it is being rebuilt.
  694. It should be renamed to a
  695. .b qf
  696. file very quickly.
  697. .ip x
  698. A transcript file,
  699. existing during the life of a session
  700. showing everything that happens
  701. during that session.
  702. .pp
  703. The
  704. .b qf
  705. file is structured as a series of lines
  706. each beginning with a code letter.
  707. The lines are as follows:
  708. .ip D
  709. The name of the data file.
  710. There may only be one of these lines.
  711. .ip H
  712. A header definition.
  713. There may be any number of these lines.
  714. The order is important:
  715. they represent the order in the final message.
  716. These use the same syntax
  717. as header definitions in the configuration file.
  718. .ip $r
  719. The protocol used when the message was received.
  720. .ip $s
  721. The sender's canonical host name.
  722. The $r and $s macro values are included only if QUEUE_MACVALUE was
  723. defined in
  724. .i src/conf.h .
  725. .ip R
  726. A recipient address.
  727. This will normally be completely aliased,
  728. but is actually realiased when the job is processed.
  729. There will be one line
  730. for each recipient.
  731. .ip S
  732. The sender address.
  733. There may only be one of these lines.
  734. .ip E
  735. An error address.
  736. If any such lines exist,
  737. they represent the addresses that should receive error messages.
  738. .ip T
  739. The job creation time.
  740. This is used to compute when to time out the job.
  741. .ip P
  742. The current message priority.
  743. This is used to order the queue.
  744. Higher numbers mean lower priorities.
  745. The priority changes
  746. as the message sits in the queue.
  747. The initial priority depends on the message class
  748. and the size of the message.
  749. .ip M
  750. A message.
  751. This line is printed by the
  752. .i mailq
  753. command,
  754. and is generally used to store status information.
  755. It can contain any text.
  756. .pp
  757. As an example,
  758. the following is a queue file sent to
  759. .q mckusick@calder.berkeley.edu
  760. and
  761. .q wnj :
  762. .(b
  763. DdfA13557
  764. Seric
  765. T404261372
  766. P132
  767. Rmckusick@calder.berkeley.edu
  768. Rwnj
  769. H?D?date: Sat, 23 Oct 1982 15:49:32 -0700
  770. H?F?from: eric (Eric Allman)
  771. H?x?full-name: Eric Allman
  772. Hsubject: this is an example message
  773. Hmessage-id: <198209232249.13557@UCBARPA.BERKELEY.EDU>
  774. Hreceived: by UCBARPA.BERKELEY.EDU (3.227 [10/22/82])
  775.     id A13557; Sat, 23 Oct 1982 15:49:32 -0700
  776. HTo: mckusick@calder.berkeley.edu, wnj
  777. .)b
  778. This shows the name of the data file,
  779. the person who sent the message,
  780. the submission time
  781. (in seconds since January 1, 1970),
  782. the message priority,
  783. the message class,
  784. the recipients,
  785. and the headers for the message.
  786. .sh 3 "Forcing the queue"
  787. .pp
  788. .i Sendmail
  789. may be invoked
  790. (manually or via
  791. .i cron \|(1M))
  792. with the -q flag to process the queue.
  793. Alternatively,
  794. when run as a daemon with the
  795. \-bd
  796. \-q\fItime\fP
  797. flags,
  798. .i sendmail
  799. should run the queue automatically
  800. at intervals.
  801. The algorithm is to read and sort the queue,
  802. and then to attempt to process all jobs in order.
  803. When it attempts to run the job,
  804. .i sendmail
  805. first checks to see if the job is locked.
  806. If so, it ignores the job.
  807. .pp
  808. There is no attempt to insure that only one queue processor
  809. exists at any time,
  810. since there is no guarantee that a job cannot take forever
  811. to process.
  812. Due to the locking algorithm,
  813. it is impossible for one job to freeze the queue.
  814. However,
  815. an uncooperative recipient host
  816. or a program recipient
  817. that never returns
  818. can accumulate many processes in your system.
  819. Unfortunately,
  820. there is no way to resolve this
  821. without violating the protocol.
  822. .pp
  823. In some cases,
  824. you may find that a major host going down
  825. for a couple of days
  826. may create a prohibitively large queue.
  827. This will result in
  828. .i sendmail
  829. spending an inordinate amount of time
  830. sorting the queue.
  831. This situation can be fixed by moving the queue to a temporary place
  832. and creating a new queue.
  833. The old queue can be run later when the offending host returns to service.
  834. .pp
  835. To do this,
  836. it is acceptable to move the entire queue directory:
  837. .(b
  838. cd /usr/spool
  839. mv mqueue omqueue; mkdir mqueue; chmod 755 mqueue
  840. .)b
  841. You should then kill the existing daemon
  842. (since it will still be processing in the old queue directory)
  843. and create a new daemon.
  844. .pp
  845. To run the old mail queue,
  846. run the following command:
  847. .(b
  848. /usr/lib/sendmail \-oQ/usr/spool/omqueue \-q
  849. .)b
  850. The
  851. .b \-oQ
  852. flag specifies an alternate queue directory
  853. and the
  854. .b \-q
  855. flag says to just run every job in the queue.
  856. If you have a tendency toward voyeurism,
  857. you can use the
  858. .b \-v
  859. flag to watch what is going on.
  860. .pp
  861. When the queue is finally emptied,
  862. you can remove the directory:
  863. .(b
  864. rm -r /usr/spool/omqueue
  865. .)b
  866. .sh 2 "The Alias Database"
  867. .pp
  868. The alias database exists in two forms.
  869. One is a text form,
  870. maintained in the file
  871. .i /usr/lib/aliases.
  872. The aliases are of the form
  873. .(b
  874. name: name1, name2, ...
  875. .)b
  876. It is possible not
  877. only local names may be aliased,
  878. but even non-locals if the configuration file is properly set up;
  879. e.g.,
  880. .(b
  881. eric@mit-xx: eric@berkeley.EDU
  882. .)b
  883. will have the desired effect if the
  884. .i aliases
  885. database is searched before determining mailer in ruleset 0.
  886. Aliases may be continued by starting any continuation lines
  887. with a space or a tab.
  888. Blank lines and lines beginning with a sharp sign
  889. (\c
  890. .q # )
  891. are comments.
  892. .pp
  893. The second form is processed by the
  894. .i dbm \|(3)
  895. library.
  896. This form is in the files
  897. .i /usr/lib/aliases.dir
  898. and
  899. .i /usr/lib/aliases.pag.
  900. This is the form that
  901. .i sendmail
  902. actually uses to resolve aliases.
  903. This technique is used to improve performance.
  904. .sh 3 "Rebuilding the alias database"
  905. .pp
  906. The DBM version of the database
  907. may be rebuilt explicitly by executing the command
  908. .(b
  909. newaliases
  910. .)b
  911. This is equivalent to giving
  912. .i sendmail
  913. the
  914. .b \-bi
  915. flag:
  916. .(b
  917. /usr/lib/sendmail \-bi
  918. .)b
  919. .pp
  920. If the
  921. .q D
  922. option is specified in the configuration,
  923. .i sendmail
  924. will rebuild the alias database automatically
  925. if possible
  926. when it is out of date.
  927. The conditions under which it will do this are:
  928. .np
  929. The DBM version of the database is mode 666.   -or-
  930. .np
  931. .i Sendmail
  932. is running setuid to root.
  933. .lp
  934. Auto-rebuild can be dangerous
  935. '\"    not a problem due to locking - bl
  936. on heavily loaded machines
  937. with large alias files;
  938. if it might take more than five minutes
  939. to rebuild the database,
  940. there is a chance that several processes will start the rebuild process
  941. simultaneously.
  942. The Potential Problems have been solved by file locking
  943. .sh 3 "Potential problems"
  944. .pp
  945. There are a number of problems that can occur
  946. with the alias database.
  947. Most result from a
  948. .i sendmail
  949. process accessing the DBM version
  950. while it is only partially built.
  951. This can happen under two circumstances:
  952. One process accesses the database
  953. while another process is rebuilding it,
  954. or the process rebuilding the database dies
  955. (due to being killed or a system crash)
  956. before completing the rebuild.
  957. .pp
  958. Sendmail has two techniques to try to relieve these problems.
  959. First, it ignores interrupts while rebuilding the database;
  960. this avoids the problem of someone aborting the process
  961. leaving a partially rebuilt database.
  962. Second,
  963. at the end of the rebuild
  964. it adds an alias of the form
  965. .(b
  966. @: @
  967. .)b
  968. (which is not normally legal).
  969. Before sendmail will access the database,
  970. it checks to insure that this entry exists\**.
  971. .(f
  972. \**The
  973. .q a
  974. option is required in the configuration
  975. for this action to occur.
  976. This should normally be specified
  977. unless you are running
  978. .i delivermail
  979. in parallel with
  980. .i sendmail.
  981. .)f
  982. .i Sendmail
  983. will wait for this entry to appear,
  984. at which point it will force a rebuild itself\**.
  985. .(f
  986. \**Note:
  987. the
  988. .q D
  989. option must be specified in the configuration file
  990. for this operation to occur.
  991. If the
  992. .q D
  993. option is not specified,
  994. a warning message is generated and
  995. .i sendmail
  996. continues.
  997. .)f
  998. .pp
  999. An added problem with DBM files is that the combined length of the
  1000. key\-value pair may not exceed the DBM page size minus 10 bytes or so.
  1001. On most machines this comes to 1014 bytes.
  1002. .i Sendmail 's
  1003. heuristics in detecting such overruns have been known to fail.
  1004. .sh 3 "List owners"
  1005. .pp
  1006. If an error occurs on sending to a certain address,
  1007. say
  1008. .q \fIx\fP ,
  1009. .i sendmail
  1010. will look for an alias
  1011. of the form
  1012. .q owner-\fIx\fP
  1013. to receive the errors.
  1014. This is typically useful
  1015. for a mailing list
  1016. where the submitter of the list
  1017. has no control over the maintenance of the list itself;
  1018. in this case the list maintainer would be the owner of the list.
  1019. For example:
  1020. .(b
  1021. unix-wizards: eric@ucbarpa.berkeley.edu,
  1022.     wnj@monet.berkeley.edu, nosuchuser,
  1023.     sam@matisse.berkeley.edu
  1024. owner-unix-wizards: eric@ucbarpa.berkeley.edu
  1025. .)b
  1026. would cause
  1027. .q eric@ucbarpa.berkeley.edu
  1028. to get the error that will occur
  1029. when someone sends to
  1030. unix-wizards
  1031. due to the inclusion of
  1032. .q nosuchuser
  1033. on the list.
  1034. .sh 2 "Per-User Forwarding (.forward Files)"
  1035. .pp
  1036. As an alternative to the alias database,
  1037. any user may put a file with the name
  1038. .q .forward
  1039. in his or her home directory.
  1040. If this file exists,
  1041. .i sendmail
  1042. redirects mail for that user
  1043. to the list of addresses listed in the .forward file.
  1044. For example, if the home directory for user
  1045. .q mckusick
  1046. has a .forward file with contents:
  1047. .(b
  1048. mckusick@ernie.berkeley.edu
  1049. kirk@calder.berkeley.edu
  1050. .)b
  1051. then any mail arriving for
  1052. .q mckusick
  1053. will be redirected to the specified accounts.
  1054. .lp
  1055. Blank lines and lines beginning with # are ignored.
  1056. .sh 2 "Special Header Lines"
  1057. .pp
  1058. Several header lines have special interpretations
  1059. defined by the configuration file.
  1060. Others have interpretations built into
  1061. .i sendmail
  1062. that cannot be changed without changing the code.
  1063. These builtins are described here.
  1064. .sh 3 "Return-Receipt-To:"
  1065. .pp
  1066. If this header is sent,
  1067. a message will be sent to any specified addresses
  1068. when the final delivery is complete,
  1069. that is,
  1070. when successfully delivered to a mailer with the
  1071. .b l
  1072. flag (local delivery) set in the mailer descriptor.
  1073. .sh 3 "Errors-To:"
  1074. .pp
  1075. If errors occur anywhere during processing,
  1076. this header will cause error messages to go to
  1077. the listed addresses
  1078. rather than to the sender.
  1079. This is intended for mailing lists.
  1080. .sh 3 "Apparently-To:"
  1081. .pp
  1082. If a message comes in with no recipients listed in the message
  1083. (in a To:, Cc:, or Bcc: line)
  1084. then
  1085. .i sendmail
  1086. will add an
  1087. .q "Apparently-To:"
  1088. header line for any recipients it is aware of.
  1089. This is not put in as a standard recipient line
  1090. to warn any recipients that the list is not complete.
  1091. .pp
  1092. At least one recipient line is required under RFC 822.
  1093. .sh 1 "ARGUMENTS"
  1094. .pp
  1095. The complete list of arguments to
  1096. .i sendmail
  1097. is described in detail in Appendix A.
  1098. Some important arguments are described here.
  1099. .sh 2 "Queue Interval"
  1100. .pp
  1101. The amount of time between forking a process
  1102. to run through the queue
  1103. is defined by the
  1104. .b \-q
  1105. flag.
  1106. If you run in mode
  1107. .b f
  1108. or
  1109. .b a
  1110. this can be relatively large,
  1111. since it will only be relevant
  1112. when a host that was down comes back up.
  1113. If you run in
  1114. .b q
  1115. mode
  1116. it should be relatively short,
  1117. since it defines the maximum amount of time that a message
  1118. may sit in the queue.
  1119. .sh 2 "Daemon Mode"
  1120. .pp
  1121. If you allow incoming mail over an IPC connection,
  1122. you might wish to have a daemon running
  1123. (if you do not use
  1124. .i inetd \c
  1125. ).
  1126. This should be set by your
  1127. .i /etc/rc
  1128. file using the
  1129. .b \-bd
  1130. flag,
  1131. or should be handled by inetd, using the
  1132. .b \-bs
  1133. flag.
  1134. The
  1135. .b \-bd
  1136. flag and the
  1137. .b \-q
  1138. flag may be combined in one call:
  1139. .(b
  1140. /usr/lib/sendmail \-bd \-q30m
  1141. .)b
  1142. .sh 2 "Forcing the Queue"
  1143. .pp
  1144. In some cases you may find that the queue has gotten clogged for some reason.
  1145. You can force a queue run
  1146. using the
  1147. .b \-q
  1148. flag (with no value).
  1149. It is entertaining to use the
  1150. .b \-v
  1151. flag (verbose)
  1152. when this is done to watch what happens:
  1153. .(b
  1154. /usr/lib/sendmail \-q \-v
  1155. .)b
  1156. .sh 2 "Debugging"
  1157. .pp
  1158. There are a fairly large number of debug flags
  1159. built into
  1160. .i sendmail .
  1161. Each debug flag has a number and a level,
  1162. where higher levels means to print out more information.
  1163. The convention is that levels greater than nine are
  1164. .q absurd,
  1165. i.e.,
  1166. they print out so much information that you wouldn't normally
  1167. want to see them except for debugging that particular piece of code.
  1168. Debug flags are set using the
  1169. .b \-d
  1170. option;
  1171. the syntax is:
  1172. .(b
  1173. .ta \w'debug-option  'u
  1174. debug-flag:    \fB\-d\fP debug-list
  1175. debug-list:    debug-option [ , debug-option ]
  1176. debug-option:    debug-range [ . debug-level ]
  1177. debug-range:    integer | integer \- integer
  1178. debug-level:    integer
  1179. .)b
  1180. where spaces are for reading ease only.
  1181. For example,
  1182. .(b
  1183. \-d12    Set flag 12 to level 1
  1184. \-d12.3    Set flag 12 to level 3
  1185. \-d3-17    Set flags 3 through 17 to level 1
  1186. \-d3-17.4    Set flags 3 through 17 to level 4
  1187. .)b
  1188. For a complete list of the available debug flags
  1189. consult Appendix F.
  1190. '\"    you will have to look at the code
  1191. '\"    (they are too dynamic to keep this documentation up to date).
  1192. .sh 2 "Trying a Different Configuration File"
  1193. .pp
  1194. An alternative configuration file
  1195. can be specified using the
  1196. .b \-C
  1197. flag; for example,
  1198. .(b
  1199. /usr/lib/sendmail \-Ctest.cf
  1200. .)b
  1201. uses the configuration file
  1202. .i test.cf
  1203. instead of the default
  1204. .i /etc/sendmail.cf.
  1205. If the
  1206. .b \-C
  1207. flag has no value
  1208. it defaults to
  1209. .i sendmail.cf
  1210. in the current directory.
  1211. .pp
  1212. You can also specify a different frozen configuration file with the
  1213. .b \-Z
  1214. option.  It is used the same way as the
  1215. .b \-C
  1216. flag and defaults to
  1217. .i sendmail.fc
  1218. in the current directory.
  1219. .sh 2 "Changing the Values of Options"
  1220. .pp
  1221. Options can be overridden using the
  1222. .b \-o
  1223. flag.
  1224. For example,
  1225. .(b
  1226. /usr/lib/sendmail \-oT2m
  1227. .)b
  1228. sets the
  1229. .b T
  1230. (timeout) option to two minutes
  1231. for this run only.
  1232. .sh 1 "TUNING"
  1233. .pp
  1234. There are a number of configuration parameters
  1235. you may want to change,
  1236. depending on the requirements of your site.
  1237. Most of these are set
  1238. using an option in the configuration file.
  1239. For example,
  1240. the line
  1241. .q OT3d
  1242. sets option
  1243. .q T
  1244. to the value
  1245. .q 3d
  1246. (three days).
  1247. .pp
  1248. Most of these options default appropriately for most sites.
  1249. However,
  1250. sites having very high mail loads may find they need to tune them
  1251. as appropriate for their mail load.
  1252. In particular,
  1253. sites experiencing a large number of small messages,
  1254. many of which are delivered to many recipients,
  1255. may find that they need to adjust the parameters
  1256. dealing with queue priorities.
  1257. .sh 2 "Timeouts"
  1258. .pp
  1259. All time intervals are set
  1260. using a scaled syntax.
  1261. For example,
  1262. .q 10m
  1263. represents ten minutes, whereas
  1264. .q 2h30m
  1265. represents two and a half hours.
  1266. The full set of scales is:
  1267. .(b
  1268. .ta 4n
  1269. s    seconds
  1270. m    minutes
  1271. h    hours
  1272. d    days
  1273. w    weeks
  1274. .)b
  1275. .sh 3 "Queue interval"
  1276. .pp
  1277. The argument to the
  1278. .b \-q
  1279. flag
  1280. specifies how often a subdaemon will run the queue.
  1281. This is typically set to between fifteen minutes
  1282. and one hour.
  1283. .sh 3 "Read timeouts"
  1284. .pp
  1285. It is possible to time out when reading the standard input
  1286. or when reading from a remote SMTP server.
  1287. Technically,
  1288. this is not acceptable within the published protocols.
  1289. However,
  1290. it might be appropriate to set it to something large
  1291. in certain environments
  1292. (such as an hour).
  1293. This will reduce the chance of large numbers of idle daemons
  1294. piling up on your system.
  1295. This timeout is set using the
  1296. .b r
  1297. option in the configuration file.
  1298. .sh 3 "Message timeouts"
  1299. .pp
  1300. After sitting in the queue for a few days,
  1301. a message will time out.
  1302. This is to insure that at least the sender is aware
  1303. of the inability to send a message.
  1304. The timeout is typically set to three days.
  1305. This timeout is set using the
  1306. .b T
  1307. option in the configuration file.
  1308. .pp
  1309. The time of submission is set in the queue,
  1310. rather than the amount of time left until timeout.
  1311. As a result, you can flush messages that have been hanging
  1312. for a short period
  1313. by running the queue
  1314. with a short message timeout.
  1315. For example,
  1316. .(b
  1317. /usr/lib/sendmail \-oT1d \-q
  1318. .)b
  1319. will run the queue
  1320. and flush anything that is one day old or older.
  1321. .sh 2 "Forking During Queue Runs"
  1322. .pp
  1323. By setting the
  1324. .b Y
  1325. option,
  1326. .i sendmail
  1327. will fork before each individual message
  1328. while running the queue.
  1329. This will prevent
  1330. .i sendmail
  1331. from consuming large amounts of memory,
  1332. so it may be useful in memory-poor environments.
  1333. However, if the
  1334. .b Y
  1335. option is not set,
  1336. .i sendmail
  1337. will keep track of hosts that are down during a queue run,
  1338. which can improve performance dramatically.
  1339. .sh 2 "Queue Priorities"
  1340. .pp
  1341. Every message is assigned a priority when it is first instantiated,
  1342. consisting of the message size (in bytes)
  1343. offset by the message class times the
  1344. .q "work class factor"
  1345. and the number of recipients times the
  1346. .q "work recipient factor."
  1347. The priority plus the creation time of the message
  1348. (in seconds since January 1, 1970)
  1349. are used to order the queue.
  1350. Higher numbers for the priority mean that the message will be processed later
  1351. when running the queue.
  1352. .pp
  1353. The message size is included so that large messages are penalized
  1354. relative to small messages.
  1355. The message class allows users to send
  1356. .q "high priority"
  1357. messages by including a
  1358. .q Precedence:
  1359. field in their message;
  1360. the value of this field is looked up in the
  1361. .b P
  1362. lines of the configuration file.
  1363. Since the number of recipients affects the amount of load a message presents
  1364. to the system,
  1365. this is also included into the priority.
  1366. .pp
  1367. The recipient and class factors
  1368. can be set in the configuration file using the
  1369. .b y
  1370. and
  1371. .b z
  1372. options respectively.
  1373. They default to 1000 (for the recipient factor)
  1374. and 1800
  1375. (for the class factor).
  1376. The initial priority is:
  1377. .(b
  1378. .EQ
  1379. pri = " size " - ( class times z ) + ( nrcpt times y )
  1380. .EN
  1381. .)b
  1382. (Remember, higher values for this parameter actually mean
  1383. that the job will be treated with lower priority.)
  1384. .pp
  1385. The priority of a job can also be adjusted each time it is processed
  1386. (that is, each time an attempt is made to deliver it)
  1387. using the
  1388. .q "work time factor,"
  1389. set by the
  1390. .b Z
  1391. option.
  1392. This is added to the priority,
  1393. so it normally decreases the precedence of the job,
  1394. on the grounds that jobs that have failed many times
  1395. will tend to fail again in the future.
  1396. .sh 2 "Load Limiting"
  1397. .pp
  1398. .i Sendmail
  1399. can be asked to queue (but not deliver)
  1400. mail if the system load average gets too high
  1401. using the
  1402. .b x
  1403. option.
  1404. When the load average exceeds the value of the
  1405. .b x
  1406. option,
  1407. the delivery mode is set to
  1408. .b q
  1409. (queue only)
  1410. if the
  1411. .i "Queue Factor"
  1412. (\c
  1413. .b q
  1414. option)
  1415. divided by the difference in the current load average and the
  1416. .b x
  1417. option
  1418. plus one
  1419. exceeds the priority of the message \(em
  1420. that is, the message is queued iff:
  1421. .EQ
  1422. pri > QF over { LA - x + 1 }
  1423. .EN
  1424. The
  1425. .b q
  1426. option defaults to 10000,
  1427. so each point of load average is worth 10000
  1428. priority points
  1429. (as described above, that is, bytes + seconds + offsets).
  1430. .pp
  1431. For drastic cases,
  1432. the
  1433. .b X
  1434. option defines a load average at which sendmail will refuse
  1435. to accept network connections.
  1436. Locally generated mail
  1437. (including incoming UUCP mail)
  1438. is still accepted.
  1439. .sh 2 "Delivery Mode"
  1440. .pp
  1441. There are a number of delivery modes that
  1442. .i sendmail
  1443. can operate in,
  1444. set by the
  1445. .q d
  1446. configuration option.
  1447. These modes
  1448. specify how quickly mail will be delivered.
  1449. Legal modes are:
  1450. .(b
  1451. .ta 4n
  1452. i    deliver interactively (synchronously)
  1453. b    deliver in background (asynchronously)
  1454. q    queue only (don't deliver)
  1455. .)b
  1456. There are tradeoffs.
  1457. Mode
  1458. .q i
  1459. passes the maximum amount of information to the sender,
  1460. but is hardly ever necessary.
  1461. Mode
  1462. .q q
  1463. puts the minimum load on your machine,
  1464. but means that delivery may be delayed for up to the queue interval.
  1465. Mode
  1466. .q b
  1467. is probably a good compromise.
  1468. However, this mode can cause large numbers of processes
  1469. if you have a mailer that takes a long time to deliver a message.
  1470. .sh 2 "Log Level"
  1471. .pp
  1472. The level of logging can be set for sendmail.
  1473. The default using a standard configuration table is level 9.
  1474. The levels are as follows:
  1475. .ip 0
  1476. No logging.
  1477. .ip 1
  1478. Major problems only.
  1479. .ip 2
  1480. Message collections and failed deliveries.
  1481. .ip 3
  1482. Successful deliveries.
  1483. .ip 4
  1484. Messages being deferred
  1485. (due to a host being down, etc.).
  1486. .ip 5
  1487. Normal message queueups.
  1488. .ip 6
  1489. Unusual but benign incidents,
  1490. e.g.,
  1491. trying to process a locked queue file.
  1492. .ip 9
  1493. Log internal queue id to external message id mappings.
  1494. This can be useful for tracing a message
  1495. as it travels between several hosts.
  1496. .ip 12
  1497. Several messages that are basically only of interest
  1498. when debugging.
  1499. .ip 16
  1500. Verbose information regarding the queue.
  1501. .sh 2 "File Modes"
  1502. .pp
  1503. There are a number of files
  1504. that may have a number of modes.
  1505. The modes depend on what functionality you want
  1506. and the level of security you require.
  1507. .sh 3 "To suid or not to suid?"
  1508. .pp
  1509. .i Sendmail
  1510. can safely be made
  1511. setuid to root.
  1512. At the point where it is about to
  1513. .i exec \|(2)
  1514. a mailer,
  1515. it checks to see if the userid is zero;
  1516. if so,
  1517. it resets the userid and groupid to a default
  1518. (set by the
  1519. .b u
  1520. and
  1521. .b g
  1522. options).
  1523. (This can be overridden
  1524. by setting the
  1525. .b S
  1526. flag to the mailer
  1527. for mailers that are trusted
  1528. and must be called as root.)
  1529. However,
  1530. this will cause mail processing
  1531. to be accounted
  1532. (using
  1533. .i sa \|(8))
  1534. to root
  1535. rather than to the user sending the mail.
  1536. .sh 3 "Should my alias database be writable?"
  1537. .pp
  1538. At Berkeley
  1539. we have the alias database
  1540. (/usr/lib/aliases*)
  1541. mode 644.
  1542. While this is not as flexible as if the database
  1543. were mode 666, it avoids potential security problems
  1544. with a globally writable database.
  1545. .pp
  1546. The database that
  1547. .i sendmail
  1548. actually used
  1549. is represented by the two files
  1550. .i aliases.dir
  1551. and
  1552. .i aliases.pag
  1553. (both in /usr/lib).
  1554. The mode on these files should match the mode
  1555. on /usr/lib/aliases.
  1556. If
  1557. .i aliases
  1558. is writable
  1559. and the
  1560. DBM
  1561. files
  1562. (\c
  1563. .i aliases.dir
  1564. and
  1565. .i aliases.pag )
  1566. are not,
  1567. users will be unable to reflect their desired changes
  1568. through to the actual database.
  1569. However,
  1570. if
  1571. .i aliases
  1572. is read-only
  1573. and the DBM files are writable,
  1574. a slightly sophisticated user
  1575. can arrange to steal mail anyway.
  1576. .pp
  1577. If your DBM files are not writable by the world
  1578. or you do not have auto-rebuild enabled
  1579. (with the
  1580. .q D
  1581. option),
  1582. then you must be careful to reconstruct the alias database
  1583. each time you change the text version:
  1584. .(b
  1585. newaliases
  1586. .)b
  1587. If this step is ignored or forgotten
  1588. any intended changes will also be ignored or forgotten.
  1589. .sh 1 "THE WHOLE SCOOP ON THE CONFIGURATION FILE"
  1590. .pp
  1591. This section describes the configuration file
  1592. in detail,
  1593. including hints on how to write one of your own
  1594. if you have to.
  1595. .pp
  1596. There is one point that should be made clear immediately:
  1597. the syntax of the configuration file
  1598. is designed to be reasonably easy to parse,
  1599. since this is done every time
  1600. .i sendmail
  1601. starts up,
  1602. rather than easy for a human to read or write.
  1603. On the
  1604. .q "future project"
  1605. list is a
  1606. configuration-file compiler.
  1607. .pp
  1608. An overview of the configuration file
  1609. is given first,
  1610. followed by details of the semantics.
  1611. .sh 2 "The Syntax"
  1612. .pp
  1613. The configuration file is organized as a series of lines,
  1614. each of which begins with a single character
  1615. defining the semantics for the rest of the line.
  1616. Lines beginning with a space or a tab
  1617. are continuation lines
  1618. (although the semantics are not well defined in many places).
  1619. Blank lines and lines beginning with a sharp symbol
  1620. (`#')
  1621. are comments.
  1622. .sh 3 "R and S \*- rewriting rules"
  1623. .pp
  1624. The core of address parsing
  1625. are the rewriting rules.
  1626. These are an ordered production system.
  1627. .i Sendmail
  1628. scans through the set of rewriting rules
  1629. looking for a match on the left hand side
  1630. (LHS)
  1631. of the rule.
  1632. When a rule matches,
  1633. the address is replaced by the right hand side
  1634. (RHS)
  1635. of the rule.
  1636. .pp
  1637. There are several sets of rewriting rules.
  1638. Some of the rewriting sets are used internally
  1639. and must have specific semantics.
  1640. Other rewriting sets
  1641. do not have specifically assigned semantics,
  1642. and may be referenced by the mailer definitions
  1643. or by other rewriting sets.
  1644. .pp
  1645. The syntax of these two commands are:
  1646. .(b F
  1647. .b S \c
  1648. .i n
  1649. .)b
  1650. Sets the current ruleset being collected to
  1651. .i n .
  1652. If you begin a ruleset more than once
  1653. it deletes the old definition.
  1654. .(b F
  1655. .b R \c
  1656. .i lhs
  1657. .i rhs
  1658. .i comments
  1659. .)b
  1660. The
  1661. fields must be separated
  1662. by at least one tab character;
  1663. there may be embedded spaces
  1664. in the fields.
  1665. The
  1666. .i lhs
  1667. is a pattern that is applied to the input.
  1668. If it matches,
  1669. the input is rewritten to the
  1670. .i rhs .
  1671. The
  1672. .i comments
  1673. are ignored.
  1674. .sh 3 "D \*- define macro"
  1675. .pp
  1676. Macros are named with a single character.
  1677. These may be selected from the entire ASCII set,
  1678. but user-defined macros
  1679. should be selected from the set of upper case letters only.
  1680. Lower case letters
  1681. and special symbols
  1682. are used internally.
  1683. .pp
  1684. The syntax for macro definitions is:
  1685. .(b F
  1686. .b D \c
  1687. .i x\|val
  1688. .)b
  1689. where
  1690. .i x
  1691. is the name of the macro
  1692. and
  1693. .i val
  1694. is the value it should have.
  1695. Macros can be interpolated in most places using the escape sequence
  1696. .b $ \c
  1697. .i x .
  1698. .sh 3 "C and F \*- define classes"
  1699. .pp
  1700. Classes of words may be defined
  1701. to match on the left hand side of rewriting rules,
  1702. where a
  1703. .q word
  1704. is a sequence of characters that does not contain whitespace.
  1705. For example
  1706. a class of all local names for this site
  1707. might be created
  1708. so that attempts to send to oneself
  1709. can be eliminated.
  1710. These can either be defined directly in the configuration file
  1711. or read in from another file.
  1712. Classes may be given names
  1713. from the set of upper case letters.
  1714. Lower case letters and special characters
  1715. are reserved for system use.
  1716. .pp
  1717. The syntax is:
  1718. .(b F
  1719. .b C \c
  1720. .i c\|word1
  1721. .i word2...
  1722. .br
  1723. .b F \c
  1724. .i c\|file
  1725. .i scanf\-string
  1726. .)b
  1727. The first form defines the class
  1728. .i c
  1729. to match any of the named words.
  1730. It is permissible to split them among multiple lines;
  1731. for example, the two forms:
  1732. .(b
  1733. CHmonet ucbmonet
  1734. .)b
  1735. and
  1736. .(b
  1737. CHmonet
  1738. CHucbmonet
  1739. .)b
  1740. are equivalent.
  1741. The second form
  1742. reads the elements of the class
  1743. .i c
  1744. from the named
  1745. .i file .
  1746. The optional
  1747. .i scanf-string
  1748. should accept the information of interest,
  1749. discarding all other input.
  1750. The default scanf string is "%s",
  1751. which accepts every word.
  1752. .sh 3 "M \*- define mailer"
  1753. .pp
  1754. Programs and interfaces to mailers
  1755. are defined in this line.
  1756. The format is:
  1757. .(b F
  1758. .b M \c
  1759. .i name ,
  1760. {\c
  1761. .i field =\c
  1762. .i value \|}*
  1763. .)b
  1764. where
  1765. .i name
  1766. is the name of the mailer
  1767. (used internally only)
  1768. and the
  1769. .q field=name
  1770. pairs define attributes of the mailer.
  1771. Fields are:
  1772. .(b
  1773. .ta 1i
  1774. Path    The pathname of the mailer
  1775. Flags    Special flags for this mailer
  1776. Sender    Rewriting sets for sender addresses
  1777. Recipient    Rewriting sets for recipient addresses
  1778. Argv    An argument vector to pass to this mailer
  1779. Eol    The end-of-line string for this mailer
  1780. Maxsize    The maximum message length to this mailer
  1781. .)b
  1782. Only the first character of the field name is checked.
  1783. .sh 3 "H \*- define header"
  1784. .pp
  1785. The format of the header lines that sendmail inserts into the message
  1786. are defined by the
  1787. .b H
  1788. line.
  1789. The syntax of this line is:
  1790. .(b F
  1791. .b H [\c
  1792. .b ? \c
  1793. .i mflags \c
  1794. .b ? ]\c
  1795. .i hname \c
  1796. .b :
  1797. .i htemplate
  1798. .)b
  1799. Continuation lines in this spec
  1800. are reflected directly into the outgoing message.
  1801. The
  1802. .i htemplate
  1803. is macro expanded before insertion into the message.
  1804. If the
  1805. .i mflags
  1806. (surrounded by question marks)
  1807. are specified,
  1808. at least one of the specified flags
  1809. must be stated in the mailer definition
  1810. for this header to be automatically output.
  1811. If one of these headers is in the input
  1812. it is reflected to the output
  1813. regardless of these flags.
  1814. .pp
  1815. Some headers have special semantics
  1816. that will be described below.
  1817. .sh 3 "O \*- set option"
  1818. .pp
  1819. There are a number of
  1820. .q random
  1821. options that
  1822. can be set from a configuration file.
  1823. Options are represented by single characters.
  1824. The syntax of this line is:
  1825. .(b F
  1826. .b O \c
  1827. .i o\|value
  1828. .)b
  1829. This sets option
  1830. .i o
  1831. to be
  1832. .i value .
  1833. Depending on the option,
  1834. .i value
  1835. may be a string, an integer,
  1836. a boolean
  1837. (with legal values
  1838. .q t ,
  1839. .q T ,
  1840. .q f ,
  1841. or
  1842. .q F ;
  1843. the default is TRUE),
  1844. or
  1845. a time interval.
  1846. .sh 3 "T \*- define trusted users"
  1847. .pp
  1848. Trusted users
  1849. are those users who are permitted
  1850. to override the sender address
  1851. using the
  1852. .b \-f
  1853. flag.
  1854. These typically are
  1855. .q root,
  1856. .q uucp,
  1857. and
  1858. .q network,
  1859. but on some systems it may be convenient
  1860. to extend this list to include other users,
  1861. perhaps to support
  1862. a separate
  1863. UUCP
  1864. login for each host.
  1865. The syntax of this line is:
  1866. .(b F
  1867. .b T \c
  1868. .i user1
  1869. .i user2 ...
  1870. .)b
  1871. There may be more than one of these lines.
  1872. .sh 3 "P \*- precedence definitions"
  1873. .pp
  1874. Values for the
  1875. .q "Precedence:"
  1876. field may be defined using the
  1877. .b P
  1878. control line.
  1879. The syntax of this field is:
  1880. .(b
  1881. \fBP\fP\fIname\fP\fB=\fP\fInum\fP
  1882. .)b
  1883. When the
  1884. .i name
  1885. is found in a
  1886. .q Precedence:
  1887. field,
  1888. the message class is set to
  1889. .i num .
  1890. Higher numbers mean higher precedence.
  1891. Numbers less than zero
  1892. have the special property
  1893. that error messages will not be returned.
  1894. The default precedence is zero.
  1895. For example,
  1896. our list of precedences is:
  1897. .(b
  1898. Pfirst-class=0
  1899. Pspecial-delivery=100
  1900. Pjunk=\-100
  1901. .)b
  1902. .sh 2 "The Semantics"
  1903. .pp
  1904. This section describes the semantics of the configuration file.
  1905. .sh 3 "Special macros, conditionals"
  1906. .pp
  1907. Macros are interpolated
  1908. using the construct
  1909. .b $ \c
  1910. .i x ,
  1911. where
  1912. .i x
  1913. is the name of the macro to be interpolated.
  1914. In particular,
  1915. lower case letters are reserved to have
  1916. special semantics,
  1917. used to pass information in or out of sendmail,
  1918. and some special characters are reserved to
  1919. provide conditionals, etc.
  1920. .pp
  1921. Conditionals can be specified using the syntax:
  1922. .(b
  1923. $?x text1 $| text2 $.
  1924. .)b
  1925. This interpolates
  1926. .i text1
  1927. if the macro
  1928. .b $x
  1929. is set,
  1930. and
  1931. .i text2
  1932. otherwise.
  1933. The
  1934. .q else
  1935. (\c
  1936. .b $| )
  1937. clause may be omitted.
  1938. .pp
  1939. To make sure that a string (phrase) conforms with RFC822, a special
  1940. construct
  1941. .b $! \c
  1942. .i x
  1943. can be used.  When it is expanded, it will be checked against certain
  1944. illegal character and quoted using a pair of double quotes if necessary.
  1945. This would typically be used when defining the
  1946. .i q
  1947. macro as in:
  1948. .(b
  1949. Dq$?x$!x $.<$g>
  1950. .)b
  1951. Here, an address like `Joe User @ Waterloo <juser@waterloo.edu>' would
  1952. be rewritten as `"Joe User @ Waterloo" <juser@waterloo.edu>' in order to
  1953. make it legal.  See more below on the
  1954. .i q
  1955. macro.
  1956. .pp
  1957. The following macros
  1958. .i must
  1959. be defined to transmit information into
  1960. .i sendmail:
  1961. .(b
  1962. .ta 4n
  1963. e    The SMTP entry message
  1964. j    The \*(lqofficial\*(rq domain name for this site
  1965. l    The format of the UNIX from line
  1966. n    The name of the daemon (for error messages)
  1967. o    The set of \*(lqoperators\*(rq in addresses
  1968. q    Default format of sender address
  1969. .)b
  1970. '\"    In addition, you also have the
  1971. '\"    .b $k
  1972. '\"    This is documented below -bl
  1973. '\"    macro:
  1974. '\"    .(b
  1975. '\"    .ta 4n
  1976. '\"    k    Your node's UUCP hostname
  1977. '\"    .)b
  1978. '\"    which is optional to define (it defaults to the value of
  1979. '\"    .b $w,
  1980. '\"    your normal hostname).
  1981. .pp
  1982. The
  1983. .b $e
  1984. macro is printed out when SMTP starts up.
  1985. The first word must be the
  1986. .b $j
  1987. macro.
  1988. The
  1989. .b $j
  1990. macro
  1991. should be in RFC821 format.
  1992. The
  1993. .b $l
  1994. and
  1995. .b $n
  1996. macros can be considered constants
  1997. except under terribly unusual circumstances.
  1998. The
  1999. .b $o
  2000. macro consists of a list of characters
  2001. which will be considered tokens
  2002. and which will separate tokens
  2003. when doing parsing.
  2004. For example, if
  2005. .q @
  2006. were in the
  2007. .b $o
  2008. macro, then the input
  2009. .q a@b
  2010. would be scanned as three tokens:
  2011. .q a,
  2012. .q @,
  2013. and
  2014. .q b.
  2015. Finally, the
  2016. .b $q
  2017. macro specifies how an address should appear in a message
  2018. when it is defaulted.
  2019. For example, on our system these definitions are:
  2020. .(b
  2021. De$j Sendmail $v ready at $b
  2022. DnMAILER-DAEMON
  2023. DlFrom $g  $d
  2024. Do.:%@!^=/
  2025. Dq$g$?x ($x)$.
  2026. Dj$H.$D
  2027. .)b
  2028. An acceptable alternative for the
  2029. .b $q
  2030. macro is
  2031. .q "$?x$x $.<$g>" .
  2032. These correspond to the following two formats:
  2033. .(b
  2034. eric@Berkeley.Edu (Eric Allman)
  2035. Eric Allman <eric@Berkeley.Edu>
  2036. .)b
  2037. .pp
  2038. Some macros are defined by
  2039. .i sendmail
  2040. for interpolation into argv's for mailers
  2041. or for other contexts.
  2042. These macros are:
  2043. .(b
  2044. a    The origination date in RFC 822 format
  2045. b    The current date in RFC 822 format
  2046. c    The hop count
  2047. d    The date in UNIX (ctime) format
  2048. f    The sender (from) address
  2049. g    The sender address relative to the recipient
  2050. h    The recipient host
  2051. i    The queue id
  2052. k    The UUCP node name of this host
  2053. m    Pre\-expansion/canonicalization recipient address
  2054. p    Sendmail's pid
  2055. r    Protocol used
  2056. s    Sender's host name
  2057. t    A numeric representation of the current time
  2058. u    The recipient user
  2059. v    The version number of sendmail
  2060. w    The hostname of this site
  2061. x    The full name of the sender
  2062. y    The basename of the tty special device
  2063. z    The home directory of the recipient
  2064. .)b
  2065. .pp
  2066. There are three types of dates that can be used.
  2067. The
  2068. .b $a
  2069. and
  2070. .b $b
  2071. macros are in RFC 822 format;
  2072. .b $a
  2073. is the time as extracted from the
  2074. .q Date:
  2075. line of the message
  2076. (if there was one),
  2077. and
  2078. .b $b
  2079. is the current date and time
  2080. (used for postmarks).
  2081. If no
  2082. .q Date:
  2083. line is found in the incoming message,
  2084. .b $a
  2085. is set to the current time also.
  2086. The
  2087. .b $d
  2088. macro is equivalent to the
  2089. .b $a
  2090. macro in UNIX
  2091. (ctime)
  2092. format.
  2093. .pp
  2094. The
  2095. .b $f
  2096. macro is the id of the sender
  2097. as originally determined
  2098. (rewritten by rulesets three, one, and four);
  2099. when mailing to a specific host
  2100. the
  2101. .b $g
  2102. macro is set to the address of the sender
  2103. .ul
  2104. relative to the recipient.
  2105. For example,
  2106. if I send to
  2107. .q bollard@matisse.berkeley.edu
  2108. from the machine
  2109. .q ucbarpa.berkeley.edu
  2110. the
  2111. .b $f
  2112. macro will be
  2113. .q eric
  2114. and the
  2115. .b $g
  2116. macro will be
  2117. .q eric@ucbarpa.berkeley.edu.
  2118. .pp
  2119. The
  2120. .b $x
  2121. macro is set to the full name of the sender.
  2122. This can be determined in several ways.
  2123. It can be passed as flag to
  2124. .i sendmail.
  2125. The second choice is the value of the
  2126. .q Full-name:
  2127. line in the header if it exists,
  2128. and the third choice is the comment field
  2129. of a
  2130. .q From:
  2131. line.
  2132. If all of these fail,
  2133. and if the message is being originated locally,
  2134. the full name is looked up in the
  2135. .i /etc/passwd
  2136. file.
  2137. .pp
  2138. For each recipient in a single transaction, the original
  2139. address (before aliasing, munging, etc) from which it was
  2140. derived is looked up.
  2141. If all recipients from the transaction derive
  2142. from a single original recipient,
  2143. .b $m
  2144. is set to that address.
  2145. Otherwise
  2146. .b $m
  2147. is undefined.
  2148. .pp
  2149. This errs in the direction of privacy \- the recipient never sees a
  2150. Bcc: for anyone other than themselves.
  2151. With multiple local Bcc: recipients, this means
  2152. .b $m
  2153. would be null, since they are delivered to /bin/mail in one transaction.
  2154. Nevertheless, mail to a mailing list would normally show the
  2155. originating mailing list address before aliasing, etc.
  2156. .pp
  2157. When sending,
  2158. the
  2159. .b $h ,
  2160. .b $u ,
  2161. and
  2162. .b $z
  2163. macros get set to the host, user, and home directory
  2164. (if local)
  2165. of the recipient.
  2166. The first two are set from the
  2167. .b $@
  2168. and
  2169. .b $:
  2170. part of the rewriting rules, respectively.
  2171. .pp
  2172. The
  2173. .b $p
  2174. and
  2175. .b $t
  2176. macros are used to create unique strings
  2177. (e.g., for the
  2178. .q Message-Id:
  2179. field).
  2180. The
  2181. .b $i
  2182. macro is set to the queue id on this host;
  2183. if put into the timestamp line
  2184. it can be extremely useful for tracking messages.
  2185. The
  2186. .b $k
  2187. macro is set to the UUCP nodename as stored
  2188. in the kernel
  2189. .i utsname
  2190. structure.
  2191. The
  2192. .b $v
  2193. macro is set to be the version number of
  2194. .i sendmail ;
  2195. this is normally put in timestamps
  2196. and has been proven extremely useful for debugging.
  2197. The
  2198. .b $w
  2199. macro is set to the name of this host
  2200. if it can be determined.
  2201. The
  2202. .b $c
  2203. field is set to the
  2204. .q "hop count,"
  2205. i.e., the number of times this message has been processed.
  2206. This can be determined
  2207. by the
  2208. .b \-h
  2209. flag on the command line
  2210. or by counting the timestamps in the message.
  2211. .pp
  2212. The
  2213. .b $r
  2214. and
  2215. .b $s
  2216. fields are set to the protocol used to communicate with sendmail
  2217. and the sending hostname.
  2218. The
  2219. .b $m
  2220. macro is set to the original recipient address
  2221. (before rewriting, alias expansion, etc.);
  2222. it may be included in the \*(lqfor\*(rq clause
  2223. of a Received: header (see RFC822 and RFC1123).
  2224. .sh 3 "Special classes"
  2225. .pp
  2226. The class
  2227. .b $=w
  2228. is set to be the set of all names
  2229. this host is known by.
  2230. This can be used to match local hostnames.
  2231. .sh 3 "The left hand side"
  2232. .pp
  2233. The left hand side of rewriting rules contains a pattern.
  2234. Normal words are simply matched directly.
  2235. Metasyntax is introduced using a dollar sign.
  2236. The metasymbols are:
  2237. .(b
  2238. .ta \w'\fB$=\fP\fIx\fP  'u
  2239. \fB$*\fP    Match zero or more tokens
  2240. \fB$+\fP    Match one or more tokens
  2241. \fB$\-\fP    Match exactly one token
  2242. \fB$=\fP\fIx\fP    Match any sequence of tokens in class \fIx\fP
  2243. \fB$~\fP\fIx\fP    Match any sequence of tokens not in class \fIx\fP
  2244. \fB$%\fP\fIX\fP    Match any sequence of tokens in DBM file or NIS map \fIX\fP
  2245. \fB$^\fP\fIX\fP    Match any sequence of tokens not in DBM file or NIS map \fIX\fP\**
  2246. .)b
  2247. .(f
  2248. \**NIS (nee YP) maps are defined as OK\fIX\fP%\fImap-name\fP while DBM files
  2249. are set via OK\fIXpath-name\fP .
  2250. .)f
  2251. If any of these match,
  2252. they are assigned to the symbol
  2253. .b $ \c
  2254. .i n
  2255. for replacement on the right hand side,
  2256. where
  2257. .i n
  2258. is the index in the LHS.
  2259. For example,
  2260. if the LHS:
  2261. .(b
  2262. $\-:$+
  2263. .)b
  2264. is applied to the input:
  2265. .(b
  2266. UCBARPA:eric
  2267. .)b
  2268. the rule will match, and the values passed to the RHS will be:
  2269. .(b
  2270. .ta 4n
  2271. $1    UCBARPA
  2272. $2    eric
  2273. .)b
  2274. .sh 3 "The right hand side"
  2275. .pp
  2276. When the left hand side of a rewriting rule matches,
  2277. the input is deleted and replaced by the right hand side.
  2278. Tokens are copied directly from the RHS
  2279. unless they begin with a dollar sign.
  2280. Metasymbols are:
  2281. .(b
  2282. .ta \w'$(x key$@arg$:default$)  'u
  2283. \fB$\fP\fIn\fP    Substitute indefinite token \fIn\fP from LHS
  2284. \fB$&\fP\fIx\fP    Force runtime evaluation of macro \fIx\fP
  2285. \fB$[\fP\fIname\fP\fB$:\fP\fIdefault\fP\fB$]\fP    Canonicalize \fIname\fP
  2286. \fB$(\fP\fIx key\fP\fB$@\fP\fIarg\fP\fB$:\fP\fIdefault\fP\fB$)\fP    Lookup the \fIkey\fP in database \fIx\fP, and sprintf \fIarg\fP through the result.
  2287. \fB$>\fP\fIn\fP    \*(lqCall\*(rq ruleset \fIn\fP
  2288. \fB$#\fP\fImailer\fP    Resolve to \fImailer\fP
  2289. \fB$@\fP\fIhost\fP    Specify \fIhost\fP
  2290. \fB$:\fP\fIuser\fP    Specify \fIuser\fP
  2291. .)b
  2292. .pp
  2293. The
  2294. .b $ \c
  2295. .i n
  2296. syntax substitutes the corresponding value from a
  2297. .b $+ ,
  2298. .b $\- ,
  2299. .b $* ,
  2300. .b $= ,
  2301. or
  2302. .b $~
  2303. match on the LHS.
  2304. It may be used anywhere.
  2305. .pp
  2306. A host name enclosed between
  2307. .b $[
  2308. and
  2309. .b $]
  2310. is looked up using the
  2311. .i gethostent \|(3)
  2312. routines and replaced by the canonical name.
  2313. For example,
  2314. .q $[csam$]
  2315. might become
  2316. .q csam.lbl.gov
  2317. and
  2318. .q $[[128.32.130.6]$]
  2319. would become
  2320. .q monet.berkeley.edu.
  2321. '\"    There's no 128.32.130.2 or VANGOGH.BERKELEY.EDU in the Internet host table
  2322. The
  2323. .b $: \c
  2324. .i default
  2325. part is optional and specifies what should be substituted
  2326. in case that the
  2327. .i name
  2328. is not known to 
  2329. .i gethostent \|(3).
  2330. .pp
  2331. General 
  2332. .i dbm \|(3)
  2333. databases may be searched using the
  2334. .b $( \c
  2335. .i "x key" \c
  2336. .b $)
  2337. syntax.  The expression may be supplied with an optional result argument,
  2338. .b $@ \c
  2339. .i arg,
  2340. and a default string,
  2341. .b $: \c
  2342. .i default.
  2343. The database is specified by a single character and defined using the
  2344. .q K
  2345. option as in
  2346. .(b
  2347. OKP/usr/lib/mail/pathtable
  2348. .)b
  2349. which defines database
  2350. .b P
  2351. to be associated with the dbm files /usr/lib/mail/pathtable.{dir,pag}.
  2352. '\"    .lp
  2353. '\"    If DBM_AUTOBUILD is defined in conf.h
  2354. '\"    .(b
  2355. '\"    OKP/usr/lib/mail/pathtable\0\0/usr/lib/mail/paths\0\0%s\t%s\n
  2356. '\"    .)b
  2357. '\"    defines database
  2358. '\"    .b P
  2359. '\"    to be associated with the dbm files /usr/lib/mail/pathtable.{dir,pag}.
  2360. '\"    It also specifies that a text file,
  2361. '\"    .i /usr/lib/mail/paths \c
  2362. '\"    , may be used to regenerate the dbm files using the
  2363. '\"    .i scanf\|(3S)
  2364. '\"    string
  2365. '\"    .i %s\t%s\n
  2366. '\"    (C language character escapes are recognized).
  2367. '\"    The scanf string should accept two strings from the text file input,
  2368. '\"    which should correspond to the dbm
  2369. '\"    key and content strings.
  2370. '\"    The scanf string should also be designed to ignore non\-useful
  2371. '\"    data which may appear in the text file
  2372. '\"    (#\-comments and blank lines are automatically ignored).
  2373. '\"    On each attempted database access,
  2374. '\"    the modification times of the dbm file(s) and the text file
  2375. '\"    are compared,
  2376. '\"    and if the text file is more recent,
  2377. '\"    the dbm files are automatically updated.
  2378. '\"    Unlike using the 'C' and 'F' classes,
  2379. '\"    use of databases does not require you to
  2380. '\"    kill sendmail daemons, re\-freeze the configuration file,
  2381. '\"    and restart the daemons
  2382. '\"    each time a file is modified.
  2383. '\"    .lp
  2384. '\"    Mandatory file locking is used to prevent multiple
  2385. '\"    .i sendmail
  2386. '\"    processes
  2387. '\"    (or other processes)
  2388. '\"    from accessing a database while it is incomplete.
  2389. '\"    In the case of programs other than
  2390. '\"    .i sendmail \c
  2391. '\"    , e.g. a text editor,
  2392. '\"    an error message resembling
  2393. '\"    \*(lqNo more processes\*(rq
  2394. '\"    may result if an attempt is made to write to a locked
  2395. '\"    text file,
  2396. '\"    due to the particular
  2397. '\"    .i errno
  2398. '\"    value which is used for file locking.
  2399. '\"    If this happens, wait awhile and try again
  2400. '\"    (the symbolic name for the error code is EAGAIN).
  2401. '\"    .lp
  2402. '\"    A program may be specified instead of a scanf string (first cahracter '|').
  2403. '\"    The program is expected to update the database files directly, and may have I/O
  2404. '\"    redirected.
  2405. '\"    If a program is used for the update, that program is invoked by
  2406. '\"    .i system\|(2)\|.
  2407. '\"    The database
  2408. '\"    is not locked by sendmail, as that would prevent the program from updating it. The
  2409. '\"    text file is used as the semaphore.
  2410. .lp
  2411. You can also make sendmail search a
  2412. .i "Yellow Pages"
  2413. (a.k.a.
  2414. .i NIS \c
  2415. )
  2416. database if your machine supports this.
  2417. To do this, use the same definition as above but prefix
  2418. the map name with a percent sign, as in:
  2419. .(b
  2420. OKP%mail.aliases
  2421. .)b
  2422. Only maps in your default domain can currently be accessed.
  2423. An expression like
  2424. .q "$(P sun $@ soren $: backbone!sun!soren $)"
  2425. would look for the string
  2426. .q sun
  2427. in the
  2428. .q P
  2429. database and sprintf
  2430. .q soren
  2431. through the result, or substitute
  2432. .q backbone!sun!soren
  2433. if the key could not be found.
  2434. If no 
  2435. .i default
  2436. argument is supplied and the key could not be found, the whole
  2437. expression is replaced with the key.
  2438. .pp
  2439. The aliases database is automatically available as database
  2440. .b @ .
  2441. It can either be defined using the
  2442. .b A
  2443. option or by a
  2444. .b OK@
  2445. declaration and is in both cases allowed to be a YP map.
  2446. .pp
  2447. The
  2448. .b $> \c
  2449. .i n
  2450. syntax
  2451. causes the remainder of the line to be substituted as usual
  2452. and then passed as the argument to ruleset
  2453. .i n .
  2454. The final value of ruleset
  2455. .i n
  2456. then becomes the substitution for this rule.
  2457. .pp
  2458. In most cases, the
  2459. .b $#
  2460. syntax should
  2461. .i only
  2462. be used in ruleset zero.
  2463. It causes evaluation of the ruleset to terminate immediately,
  2464. and signals to sendmail that the address has completely resolved.
  2465. The complete syntax is:
  2466. .(b
  2467. \fB$#\fP\fImailer\fP\fB$@\fP\fIhost\fP\fB$:\fP\fIuser\fP
  2468. .)b
  2469. This specifies the
  2470. {mailer, host, user}
  2471. 3-tuple necessary to direct the mailer.
  2472. If the mailer is local
  2473. the host part may be omitted.
  2474. The
  2475. .i mailer
  2476. and
  2477. .i host
  2478. must be a single word,
  2479. but the
  2480. .i user
  2481. may be multi-part.
  2482. .pp
  2483. A RHS may also be preceded by a
  2484. .b $@
  2485. or a
  2486. .b $:
  2487. to control evaluation.
  2488. A
  2489. .b $@
  2490. prefix causes the ruleset to return with the remainder of the RHS
  2491. as the value.
  2492. A
  2493. .b $:
  2494. prefix causes the rule to terminate immediately,
  2495. but the ruleset to continue;
  2496. this can be used to avoid continued application of a rule.
  2497. The prefix is stripped before continuing.
  2498. .pp
  2499. The
  2500. .b $@
  2501. and
  2502. .b $:
  2503. prefixes may precede
  2504. .b $>
  2505. specs;
  2506. for example:
  2507. .(b
  2508. .ta 8n
  2509. R$+    $:$>7$>8$1
  2510. .)b
  2511. matches anything,
  2512. passes that to ruleset eight and the result of that to ruleset seven,
  2513. and finally continues;
  2514. the
  2515. .b $:
  2516. is necessary to avoid an infinite loop.
  2517. .pp
  2518. Substitution occurs in the order described,
  2519. that is,
  2520. parameters from the LHS are substituted and runtime macros are expanded,
  2521. hostnames are canonicalized and database lookups are performed,
  2522. .q subroutines
  2523. are called,
  2524. and finally
  2525. .b $# ,
  2526. .b $@ ,
  2527. and
  2528. .b $:
  2529. are processed.
  2530. .sh 3 "Semantics of rewriting rule sets"
  2531. .pp
  2532. There are seven rewriting sets
  2533. that have specific semantics.
  2534. These are related as depicted by figure 2.
  2535. .(z
  2536. .hl
  2537. .ie n \{\
  2538. .(c
  2539.                         +---+
  2540.                     --->| 0 |-->resolved address (mailer, $h)
  2541.                    /    +---+
  2542.                   /       : +---+   +----+
  2543.                  /        ->| 5 |-->| SH |-
  2544.                 /        /: +---+   +----+ \e
  2545.                /        / : +---+   +----+  \e
  2546.               /        ---->| 1 |-->| SE |-- \e   +---+
  2547.        +---+ / +---+  /   : +---+   +----+  \e -->|   |
  2548. addr-->| 3 |-->| D |--    :($u)              --->| 4 |-->msg
  2549.        +---+   +---+  \e   \e +---+   +----+  / -->|   |
  2550.                         --->| 2 |-->| RE |-- /   +---+
  2551.                         \e   +---+   +----+  /
  2552.                          \e  +---+   +----+ /
  2553.                           ->| 6 |-->| RH |-
  2554.                             +---+   +----+
  2555. .)c
  2556.  
  2557. .\}
  2558. .el .ie !"\*(.T"" \
  2559. \{\
  2560. .PS
  2561. boxwid = 0.3i
  2562. boxht = 0.3i
  2563. movewid = 0.3i
  2564. moveht = 0.3i
  2565. linewid = 0.3i
  2566. lineht = 0.3i
  2567.  
  2568.     box invis "addr"; arrow
  2569. Box3:    box "3"
  2570. A1:    arrow
  2571. BoxD:    box "D"; line; L1: Here
  2572. C:    [
  2573.     C1:    arrow; box "1"; arrow; box "SE"; line; E1: Here
  2574.         move to C1 down 0.5; right
  2575.     C2:    arrow; Box2: box "2"; arrow; box "RE"; line; E2: Here
  2576.     ] with .w at L1 + (0.5, 0)
  2577. H:    [
  2578.     H1:    arrow; box "5"; arrow; box "SH"; line; F1: Here
  2579.         move to H1 down 1.3; right
  2580.     H2:    arrow; box "6"; arrow; box "RH"; line; F2: Here
  2581.     ] with .w at L1 + (0.5, 0)
  2582.     move to C.e right 0.5
  2583. L4:    arrow; box "4"; arrow; box invis "msg"
  2584.     line from L1 to C.C1
  2585.     line from L1 to C.C2
  2586.     line from C.E1 to L4
  2587.     line from C.E2 to L4
  2588.     line from L1 to H.H1
  2589.     line from L1 to H.H2
  2590.     line from H.F1 to L4
  2591.     line from H.F2 to L4
  2592.     move to BoxD.n up 0.9; right
  2593. Box0:    arrow; RealBox: box "0"
  2594.     arrow; "\|resolved address (mailer, $h)" ljust
  2595.     line from 1/3 of the way between A1 and BoxD.w to Box0
  2596.     move to RealBox.s ; arrow dashed down 0.25 ; box invis ht 0.15 "$u"
  2597.     arrow dashed from last box.s to C.Box2.w
  2598. .PE
  2599. .\}
  2600. .el .sp 2i
  2601. .ce
  2602. Figure 2 \*- Rewriting set semantics
  2603. .(c
  2604. D \*- sender domain addition
  2605. SE \*- mailer-specific sender envelope address rewriting
  2606. SH \*- mailer-specific sender header address rewriting
  2607. RE \*- mailer-specific recipient envelope address rewriting
  2608. RH \*- mailer-specific recipient header address rewriting
  2609. .)c
  2610. .hl
  2611. .)z
  2612. .pp
  2613. Ruleset three
  2614. should turn the address into
  2615. .q "canonical form."
  2616. This form should have the basic syntax:
  2617. .(b
  2618. local-part@host-domain-spec
  2619. .)b
  2620. If no
  2621. .q @
  2622. sign is specified,
  2623. then the
  2624. host-domain-spec
  2625. .i may
  2626. be appended from the
  2627. sender address
  2628. (if the
  2629. .b C
  2630. flag is set in the mailer definition
  2631. corresponding to the
  2632. .i sending
  2633. mailer).
  2634. Ruleset three
  2635. is applied by sendmail
  2636. before doing anything with any address.
  2637. .pp
  2638. Ruleset zero
  2639. is applied after ruleset three
  2640. to addresses that are going to actually specify recipients.
  2641. It must resolve to a
  2642. .i "{mailer, host, user}"
  2643. triple.
  2644. The
  2645. .i mailer
  2646. must be defined in the mailer definitions
  2647. from the configuration file.
  2648. The
  2649. .i host
  2650. is defined into the
  2651. .b $h
  2652. macro
  2653. for use in the argv expansion of the specified mailer.
  2654. The
  2655. .i user
  2656. is defined into the
  2657. .b $u
  2658. macro
  2659. after passing through ruleset two,
  2660. the mailer\-specific recipient envelope rewriting ruleset,
  2661. and ruleset four
  2662. for use in the argv expansion of the specified mailer.
  2663. .pp
  2664. Rulesets one and two
  2665. are applied to all sender and recipient envelope addresses respectively.
  2666. Similarly,
  2667. rulesets five and six are applied to all sender and recipient
  2668. header addresses.
  2669. They are applied before any specification
  2670. in the mailer definition.
  2671. They must never resolve.
  2672. .pp
  2673. Ruleset four is applied to all addresses
  2674. in the message.
  2675. It is typically used
  2676. to translate internal to external form.
  2677. .sh 3 "Mailer flags etc."
  2678. .pp
  2679. There are a number of flags that may be associated with each mailer,
  2680. each identified by a letter of the alphabet.
  2681. Many of them are assigned semantics internally.
  2682. These are detailed in Appendix C.
  2683. Any other flags may be used freely
  2684. to conditionally assign headers to messages
  2685. destined for particular mailers.
  2686. .sh 3 "The \*(lqerror\*(rq mailer"
  2687. .pp
  2688. The mailer with the special name
  2689. .q error
  2690. can be used to generate a user error.
  2691. The (optional) host field is a numeric exit status to be returned,
  2692. and the user field is a message to be printed.
  2693. For example, the entry:
  2694. .(b
  2695. $#error$:Host unknown in this domain
  2696. .)b
  2697. on the RHS of a rule
  2698. will cause the specified error to be generated
  2699. if the LHS matches.
  2700. This mailer is only functional in ruleset zero.
  2701. .sh 2 "Building a Configuration File From Scratch"
  2702. .pp
  2703. Building a configuration table from scratch is an extremely difficult job.
  2704. Fortunately,
  2705. it is almost never necessary to do so;
  2706. nearly every situation that may come up
  2707. may be resolved by changing an existing table.
  2708. In any case,
  2709. it is critical that you understand what it is that you are trying to do
  2710. and come up with a philosophy for the configuration table.
  2711. This section is intended to explain what the real purpose
  2712. of a configuration table is
  2713. and to give you some ideas
  2714. for what your philosophy might be.
  2715. .sh 3 "What you are trying to do"
  2716. .pp
  2717. The configuration table has three major purposes.
  2718. The first and simplest
  2719. is to set up the environment for
  2720. .i sendmail .
  2721. This involves setting the options,
  2722. defining a few critical macros,
  2723. etc.
  2724. Since these are described in other places,
  2725. we will not go into more detail here.
  2726. .pp
  2727. The second purpose is to rewrite addresses in the message.
  2728. This should typically be done in two phases.
  2729. The first phase maps addresses in any format
  2730. into a canonical form.
  2731. This should be done in ruleset three.
  2732. The second phase maps this canonical form
  2733. into the syntax appropriate for the receiving mailer.
  2734. .i Sendmail
  2735. does this in three subphases.
  2736. Rulesets one and two (envelope), and five and six (headers)
  2737. are applied to all sender and recipient addresses respectively.
  2738. After this,
  2739. you may specify per-mailer rulesets
  2740. for both sender and recipient addresses in the envelope and headers;
  2741. this allows mailer-specific customization.
  2742. Finally,
  2743. ruleset four is applied to do any default conversion
  2744. to external form.
  2745. .pp
  2746. The third purpose
  2747. is to map addresses into the actual set of instructions
  2748. necessary to get the message delivered.
  2749. Ruleset zero must resolve to the internal form,
  2750. which is in turn used as a pointer to a mailer descriptor.
  2751. The mailer descriptor describes the interface requirements
  2752. of the mailer.
  2753. .sh 3 "Philosophy"
  2754. .pp
  2755. The particular philosophy you choose will depend heavily
  2756. on the size and structure of your organization.
  2757. I will present a few possible philosophies here.
  2758. .pp
  2759. One general point applies to all of these philosophies:
  2760. it is almost always a mistake
  2761. to try to do full path resolution.
  2762. For example,
  2763. if you are trying to
  2764. '\"    get names of the form
  2765. mail to
  2766. .q user@host
  2767. '\"    to the Arpanet,
  2768. '\"    (ARPAnet is dead, long live the ARPAnet)
  2769. it does not pay to route to
  2770. .q xyzvax!decvax!ucbvax!c70!host!user
  2771. since you then depend on several links not under your control.
  2772. The best approach to this problem
  2773. is simply to forward to
  2774. .q xyzvax
  2775. (assuming that xyzvax is closer to the destination)
  2776. sending an address of
  2777. .q user@host
  2778. and let xyzvax
  2779. worry about it from there.
  2780. In summary,
  2781. just get the message closer to the destination,
  2782. rather than determining the full path.
  2783. This allows downstream sites to compensate
  2784. for conditions which may not be known to you,
  2785. such as a host which is tempoarily out of service,
  2786. or undocumented connections.
  2787. .sh 4 "Large site, many hosts \*- minimum information"
  2788. .pp
  2789. Berkeley is an example of a large site,
  2790. i.e., more than two or three hosts
  2791. and multiple mail connections.
  2792. We have decided that the only reasonable philosophy
  2793. in our environment
  2794. is to designate one host as the guru for our site.
  2795. It must be able to resolve any piece of mail it receives.
  2796. The other sites should have the minimum amount of information
  2797. they can get away with.
  2798. In addition,
  2799. any information they do have
  2800. should be hints rather than solid information.
  2801. .pp
  2802. For example,
  2803. a typical site on our local ether network is
  2804. .q monet.
  2805. When monet receives mail for delivery,
  2806. it checks whether it knows
  2807. that the destination host is directly reachable;
  2808. if so, mail is sent to that host.
  2809. If it receives mail for any unknown host,
  2810. it just passes it directly to
  2811. .q ucbvax,
  2812. our master host.
  2813. Ucbvax may determine that the host name is illegal
  2814. and reject the message,
  2815. or may be able to do delivery.
  2816. However, it is important to note that when a new mail connection is added,
  2817. the only host that
  2818. .i must
  2819. have its tables updated
  2820. is ucbvax;
  2821. the others
  2822. .i may
  2823. be updated if convenient,
  2824. but this is not critical.
  2825. .pp
  2826. This picture is slightly muddied
  2827. due to network connections that are not actually located
  2828. on ucbvax.
  2829. For example,
  2830. some UUCP connections are currently on
  2831. .q ucbarpa.
  2832. However,
  2833. monet
  2834. .i "does not"
  2835. know about this;
  2836. the information is hidden totally between ucbvax and ucbarpa.
  2837. Mail going from monet to a UUCP host
  2838. is transferred via the ethernet
  2839. from monet to ucbvax,
  2840. then via the ethernet from ucbvax to ucbarpa,
  2841. and then is submitted to UUCP.
  2842. Although this involves some extra hops,
  2843. we feel this is an acceptable tradeoff.
  2844. .pp
  2845. An interesting point is that it would be possible
  2846. to update monet
  2847. to send appropriate UUCP mail directly to ucbarpa
  2848. if the load got too high;
  2849. if monet failed to note a host as connected to ucbarpa
  2850. it would go via ucbvax as before,
  2851. and if monet incorrectly sent a message to ucbarpa
  2852. it would still be sent by ucbarpa
  2853. to ucbvax as before.
  2854. The only problem that can occur is loops,
  2855. for example,
  2856. if ucbarpa thought that ucbvax had the UUCP connection
  2857. and vice versa.
  2858. For this reason,
  2859. updates should
  2860. .i always
  2861. happen to the master host first.
  2862. .pp
  2863. This philosophy results as much from the need
  2864. to have a single source for the configuration files
  2865. (typically built using
  2866. .i m4 \|(1)
  2867. or some similar tool)
  2868. as any logical need.
  2869. Maintaining more than three separate tables by hand
  2870. is essentially an impossible job.
  2871. .sh 4 "Small site \*- complete information"
  2872. .pp
  2873. A small site
  2874. (two or three hosts and few external connections)
  2875. may find it more reasonable to have complete information
  2876. at each host.
  2877. This would require that each host
  2878. know exactly where each network connection is,
  2879. possibly including the names of each host on that network.
  2880. As long as the site remains small
  2881. and the the configuration remains relatively static,
  2882. the update problem will probably not be too great.
  2883. .sh 4 "Single host"
  2884. .pp
  2885. This is in some sense the trivial case.
  2886. The only major issue is trying to insure that you don't
  2887. have
  2888. hard\-coded information
  2889. about your environment,
  2890. which could get out of sync with reality.
  2891. For example,
  2892. if you have UUCP connections
  2893. you might find it useful to know about the names of hosts
  2894. connected directly to you,
  2895. but this is really not necessary
  2896. since this may be determined from
  2897. systems files,
  2898. such as
  2899. /usr/lib/uucp/Systems (or /usr/lib/uucp/L.sys)
  2900. using the
  2901. .(b
  2902. .b F \c
  2903. c \c
  2904. .i file\0scanf\-string
  2905. .)b
  2906. or
  2907. .(b
  2908. .b OK \c
  2909. c \c
  2910. .i dbm\-basename\0text\-file\0scanf\-string
  2911. .)b
  2912. lines in
  2913. .i sendmail.cf\|.
  2914. .sh 3 "Relevant issues"
  2915. .pp
  2916. The canonical form you use
  2917. should almost certainly be as specified in
  2918. the Internet protocols
  2919. RFC819 and RFC822.
  2920. Copies of these RFC's are included in the
  2921. .i sendmail
  2922. tapdistribution
  2923. as
  2924. .i doc/rfc819.lpr
  2925. and
  2926. .i doc/rfc822.lpr .
  2927. Note that these RFC's have been amended and supplemented by
  2928. information contained in RFC1123,
  2929. which is also included as
  2930. .i doc/rfc1123.lpr .
  2931. .pp
  2932. RFC822
  2933. describes the format of the mail message itself.
  2934. .i Sendmail
  2935. follows this RFC closely,
  2936. to the extent that many of the standards described in this document
  2937. can not be changed without changing the code.
  2938. In particular,
  2939. the following characters have special interpretations:
  2940. .(b
  2941. < > ( ) " \e ; ,
  2942. .)b
  2943. Any attempt to use these characters for other than their RFC822
  2944. purpose in addresses is probably doomed to disaster.
  2945. .pp
  2946. RFC819
  2947. describes the specifics of the domain-based addressing.
  2948. This is touched on in RFC822 as well.
  2949. Essentially each host is given a name
  2950. which is a right-to-left dot qualified pseudo-path
  2951. from a distinguished root.
  2952. The elements of the path need not be physical hosts;
  2953. the domain is logical rather than physical.
  2954. For example,
  2955. at Berkeley
  2956. one legal host might be
  2957. .q a.CC.Berkeley.EDU ;
  2958. reading from right to left,
  2959. .q EDU
  2960. is a top level domain
  2961. comprising educational institutions,
  2962. .q Berkeley
  2963. is a logical domain name,
  2964. .q CC
  2965. represents the Computer Center,
  2966. (in this case a strictly logical entity),
  2967. and
  2968. .q a
  2969. is a host in the Computer Center.
  2970. .pp
  2971. Beware when reading RFC819
  2972. that there are a number of errors in it.
  2973. .sh 3 "How to proceed"
  2974. .pp
  2975. Once you have decided on a philosophy,
  2976. it is worth examining the available configuration tables
  2977. to decide if any of them are close enough
  2978. to steal major parts of.
  2979. Even under the worst of conditions,
  2980. there is a fair amount of boiler plate that can be collected safely.
  2981. .pp
  2982. The next step is to build ruleset three.
  2983. This will be the hardest part of the job.
  2984. Beware of doing too much to the address in this ruleset,
  2985. since anything you do will reflect through
  2986. to the message.
  2987. In particular,
  2988. stripping of local domains is best deferred,
  2989. since this can leave you with addresses with no domain spec at all.
  2990. Since
  2991. .i sendmail
  2992. likes to append the sending domain to addresses with no domain,
  2993. this can change the semantics of addresses.
  2994. Also try to avoid
  2995. fully qualifying domains in this ruleset.
  2996. Although technically legal,
  2997. this can lead to unpleasantly and unnecessarily long addresses
  2998. reflected into messages.
  2999. The Berkeley configuration files
  3000. define ruleset nine
  3001. to qualify domain names and strip local domains.
  3002. This is called from ruleset zero
  3003. to get all addresses into a cleaner form.
  3004. .pp
  3005. Once you have ruleset three finished,
  3006. the other rulesets should be relatively trivial.
  3007. If you need hints,
  3008. examine the supplied configuration tables.
  3009. .sh 3 "Testing the rewriting rules \*- the \-bt flag"
  3010. .pp
  3011. When you build a configuration table,
  3012. you can do a certain amount of testing
  3013. using the
  3014. .q "test mode"
  3015. of
  3016. .i sendmail .
  3017. For example,
  3018. you could invoke
  3019. .i sendmail
  3020. as:
  3021. .(b
  3022. sendmail \-bt \-Ctest.cf
  3023. .)b
  3024. which would read the configuration file
  3025. .q test.cf
  3026. and enter test mode.
  3027. In this mode,
  3028. you enter lines of the form:
  3029. .(b
  3030. rwset address
  3031. .)b
  3032. where
  3033. .i rwset
  3034. is the rewriting set you want to use
  3035. and
  3036. .i address
  3037. is an address to apply the set to.
  3038. Test mode shows you the steps it takes
  3039. as it proceeds,
  3040. finally showing you the address it ends up with.
  3041. You may use a comma separated list of rwsets
  3042. for sequential application of rules to an input.
  3043. For example:
  3044. .(b
  3045. 3,1,21,4 monet!bollard
  3046. .)b
  3047. first applies ruleset three to the input
  3048. .q monet!bollard.
  3049. Ruleset one is then applied to the output of ruleset three,
  3050. followed similarly by rulesets twenty-one and four.
  3051. .pp
  3052. If you need more detail,
  3053. you can also use the
  3054. .q \-d21
  3055. flag to turn on more debugging.
  3056. For example,
  3057. .(b
  3058. sendmail \-bt \-d21.99
  3059. .)b
  3060. turns on an incredible amount of information;
  3061. a single word address
  3062. is probably going to print out several pages worth of information.
  3063. .sh 3 "Building mailer descriptions"
  3064. .pp
  3065. To add an outgoing mailer to your mail system,
  3066. you will have to define the characteristics of the mailer.
  3067. .pp
  3068. Each mailer must have an internal name.
  3069. This can be arbitrary,
  3070. except that the names
  3071. .q local
  3072. and
  3073. .q prog
  3074. must be defined.
  3075. .pp
  3076. The pathname of the mailer must be given in the P field.
  3077. If this mailer should be accessed via an IPC connection,
  3078. use the string
  3079. .q [IPC]
  3080. instead.
  3081. .pp
  3082. The F field defines the mailer flags.
  3083. You should specify an
  3084. .q f
  3085. or
  3086. .q r
  3087. flag to pass the name of the sender as a
  3088. .b \-f
  3089. or
  3090. .b \-r
  3091. flag respectively.
  3092. These flags are only passed if they were passed to
  3093. .i sendmail,
  3094. so that mailers that give errors under some circumstances
  3095. can be placated.
  3096. If the mailer is not picky
  3097. you can just specify
  3098. .q "\-f $g"
  3099. in the argv template.
  3100. If the mailer must be called as
  3101. .b root
  3102. the
  3103. .q S
  3104. flag should be given;
  3105. this will not reset the userid
  3106. before calling the mailer\**.
  3107. .(f
  3108. \**\c
  3109. .i Sendmail
  3110. must be running setuid to root
  3111. for this to work.
  3112. .)f
  3113. If this mailer is local
  3114. (i.e., will perform final delivery
  3115. rather than another network hop)
  3116. the
  3117. .q l
  3118. flag should be given.
  3119. Quote characters
  3120. (backslashes and " marks)
  3121. can be stripped from addresses if the
  3122. .q s
  3123. flag is specified;
  3124. if this is not given
  3125. they are passed through.
  3126. If the mailer is capable of sending to more than one user
  3127. on the same host
  3128. in a single transaction
  3129. the
  3130. .q m
  3131. flag should be stated.
  3132. If this flag is on,
  3133. then the argv template containing
  3134. .b $u
  3135. will be repeated for each unique user
  3136. on a given host.
  3137. The
  3138. .q e
  3139. flag will mark the mailer as being
  3140. .q expensive,
  3141. which will cause
  3142. .i sendmail
  3143. to defer connection
  3144. until a queue run\**.
  3145. .(f
  3146. \**The
  3147. .q c
  3148. configuration option must be given
  3149. for this to be effective.
  3150. .)f
  3151. .pp
  3152. An unusual case is the
  3153. .q C
  3154. flag.
  3155. This flag applies to the mailer that the message is received from,
  3156. rather than the mailer being sent to;
  3157. if set,
  3158. the domain spec of the sender
  3159. (i.e., the
  3160. .q @host.domain
  3161. part)
  3162. is saved
  3163. and is appended to any addresses in the message
  3164. that do not already contain a domain spec.
  3165. For example,
  3166. a message of the form:
  3167. .(b
  3168. From: eric@ucbarpa.berkeley.edu
  3169. To: wnj@monet.berkeley.edu, mckusick
  3170. .)b
  3171. will be modified to:
  3172. .(b
  3173. From: eric@ucbarpa.berkeley.edu
  3174. To: wnj@monet.berkeley.edu, mckusick@ucbarpa.berkeley.edu
  3175. .)b
  3176. .i "if and only if"
  3177. the
  3178. .q C
  3179. flag is defined in the mailer corresponding to
  3180. .q eric@ucbarpa.berkeley.edu.
  3181. .pp
  3182. Other flags are described
  3183. in Appendix C.
  3184. .pp
  3185. .pp
  3186. The S and R fields in the mailer description
  3187. are per-mailer rewriting sets
  3188. to be applied to sender and recipient addresses
  3189. respectively.
  3190. These are applied after the sending domain is appended
  3191. and the general rewriting sets
  3192. (numbers one, two, five, and six)
  3193. are applied,
  3194. but before the output rewrite
  3195. (ruleset four)
  3196. is applied.
  3197. A typical use is to append the current domain
  3198. to addresses that do not already have a domain.
  3199. For example,
  3200. a header of the form:
  3201. .(b
  3202. From: eric
  3203. .)b
  3204. might be changed to be:
  3205. .(b
  3206. From: eric@ucbarpa.berkeley.edu
  3207. .)b
  3208. or
  3209. .(b
  3210. From: ucbvax!eric
  3211. .)b
  3212. depending on the domain it is being shipped into.
  3213. These sets can also be used
  3214. to do special purpose output rewriting
  3215. in cooperation with ruleset four.
  3216. If required, the R and S rulesets may be specified independently for envelope
  3217. and header addresses by separating them with a slash.  E.g.,
  3218. .q R=13/14
  3219. means that envelope recipient addresses should be sent through ruleset 13
  3220. while those in the header should be passed to ruleset 14. 
  3221. You can disable any mailer specific rewriting by specifying the ruleset as
  3222. zero or by leaving it blank.
  3223. .pp
  3224. The E field defines the string to use
  3225. as an end-of-line indication.
  3226. A string containing only newline is the default.
  3227. The usual backslash escapes
  3228. (\er, \en, \ef, \eb)
  3229. may be used.
  3230. .pp
  3231. Finally,
  3232. an argv template is given as the A field.
  3233. It may have embedded spaces.
  3234. If there is no argv with a
  3235. .b $u
  3236. macro in it,
  3237. .i sendmail
  3238. will speak SMTP
  3239. to the mailer.
  3240. If the pathname for this mailer is
  3241. .q [IPC],
  3242. the argv should be
  3243. .(b
  3244. IPC $h [ \fIport\fP ]
  3245. .)b
  3246. where
  3247. .i port
  3248. is the optional port number
  3249. to connect to.
  3250. .pp
  3251. For example,
  3252. the specifications:
  3253. .(b
  3254. .ta \w'Mlocal, 'u +\w'P=/bin/mail, 'u +\w'F=rlsm, 'u +\w'S=10, 'u +\w'R=20, 'u
  3255. Mlocal,    P=/bin/mail,    F=rlsm    S=10,    R=20,    A=mail \-d $u
  3256. Mether,    P=[IPC],    F=meC,    S=11,    R=21,    A=IPC $h, M=100000
  3257. .)b
  3258. specifies a mailer to do local delivery
  3259. and a mailer for ethernet delivery.
  3260. The first is called
  3261. .q local,
  3262. is located in the file
  3263. .q /bin/mail,
  3264. takes a picky
  3265. .b \-r
  3266. flag,
  3267. does local delivery,
  3268. quotes should be stripped from addresses,
  3269. and multiple users can be delivered at once;
  3270. ruleset ten
  3271. should be applied to sender addresses in the message
  3272. and ruleset twenty
  3273. should be applied to recipient addresses;
  3274. the argv to send to a message will be the word
  3275. .q mail,
  3276. the word
  3277. .q \-d,
  3278. and words containing the name of the receiving user(s).
  3279. If a
  3280. .b \-r
  3281. flag is inserted
  3282. it will be between the words
  3283. .q mail
  3284. and
  3285. .q \-d.
  3286. The second mailer is called
  3287. .q ether,
  3288. it should be connected to via an IPC connection,
  3289. it can handle multiple users at once,
  3290. connections should be deferred,
  3291. and any domain from the sender address
  3292. should be appended to any receiver name
  3293. without a domain;
  3294. sender addresses should be processed by ruleset eleven
  3295. and recipient addresses by ruleset twenty-one.
  3296. There is a 100,000 byte limit on messages passed through this mailer.
  3297. .++ A
  3298. .+c "COMMAND LINE FLAGS"
  3299. .ba 0
  3300. .nr ii 1i
  3301. .pp
  3302. Arguments must be presented with flags before addresses.
  3303. The flags are:
  3304. .ip "\-f\ \fIaddr\fP"
  3305. The sender's machine address is
  3306. .i addr .
  3307. This flag is ignored unless the real user
  3308. is listed as a
  3309. .q "trusted user"
  3310. or if
  3311. .i addr
  3312. contains an exclamation point
  3313. (because of certain restrictions in UUCP).
  3314. .ip "\-r\ \fIaddr\fP"
  3315. An obsolete form of
  3316. .b \-f .
  3317. .ip "\-h\ \fIcnt\fP"
  3318. Sets the
  3319. .q "hop count"
  3320. to
  3321. .i cnt .
  3322. This represents the number of times this message has been processed
  3323. by
  3324. .i sendmail
  3325. (to the extent that it is supported by the underlying networks).
  3326. .i Cnt
  3327. is incremented during processing,
  3328. and if it reaches
  3329. MAXHOP
  3330. (currently 25)
  3331. .i sendmail
  3332. throws away the message with an error.
  3333. .ip \-F\fIname\fP
  3334. Sets the full name of this user to
  3335. .i name .
  3336. .ip \-n
  3337. Don't do aliasing or forwarding.
  3338. .ip \-t
  3339. Read the header for
  3340. .q To: ,
  3341. .q Cc: ,
  3342. and
  3343. .q Bcc:
  3344. lines, and send to everyone listed in those lists.
  3345. The
  3346. .q Bcc:
  3347. line will be deleted before sending.
  3348. Any addresses in the argument vector will be deleted
  3349. from the send list.
  3350. .ip \-b\fIx\fP
  3351. Set operation mode to
  3352. .i x .
  3353. Operation modes are:
  3354. .(b
  3355. .ta 4n
  3356. m    Deliver mail (default)
  3357. a    Run in Internet mode (see below)
  3358. s    Speak SMTP on input side
  3359. d    Run as a daemon
  3360. t    Run in test mode
  3361. v    Just verify addresses, don't collect or deliver
  3362. i    Initialize the alias database if it is out of date
  3363. p    Print the mail queue
  3364. z    Freeze the configuration file
  3365. b    Run in Batched SMTP mode
  3366. .)b
  3367. The special processing for the
  3368. Internet
  3369. includes reading the
  3370. .q "From:"
  3371. line from the header to find the sender,
  3372. printing
  3373. Internet
  3374. style messages
  3375. (preceded by three digit reply codes for compatibility with
  3376. the FTP protocol
  3377. [Neigus73, Postel74, Postel77]),
  3378. and ending lines of error messages with <CRLF>.
  3379. .ip \-q\fItime\fP
  3380. Try to process the queued up mail.
  3381. If the time is given,
  3382. a sendmail will run through the queue at the specified interval
  3383. to deliver queued mail;
  3384. otherwise, it only runs once.
  3385. .ip \-C\fIfile\fP
  3386. Use a different configuration file.
  3387. .i Sendmail
  3388. runs as the invoking user (rather than root)
  3389. when this flag is specified.
  3390. .ip \-M\fIAAnnnnn\fP
  3391. .ip \-M\fInnnnn\fP
  3392. Process the queued message that has the given queue id.
  3393. .ip \-R\fIaddr\fR
  3394. Process queue messages that have the string
  3395. .i addr
  3396. as part of the recipient address(es).
  3397. .ip \-S\fIaddr\fR
  3398. Process queue messages that have the string
  3399. .i addr
  3400. as part of the the sender address.
  3401. .ip \-Z\fIfile\fP
  3402. Use a different frozen configuration file.
  3403. .i Sendmail
  3404. runs as the invoking user (rather than root)
  3405. when this flag is specified.
  3406. .ip \-d\fIlevel\fP
  3407. Set debugging level.
  3408. .ip \-o\fIx\|value\fP
  3409. Set option
  3410. .i x
  3411. to the specified
  3412. .i value .
  3413. These options are described in Appendix B.
  3414. .pp
  3415. There are a number of options that may be specified as
  3416. primitive flags
  3417. (provided for compatibility with
  3418. .i delivermail ).
  3419. These are the e, i, m, and v options.
  3420. Also,
  3421. the f option
  3422. may be specified as the
  3423. .b \-s
  3424. flag.
  3425. .+c "CONFIGURATION OPTIONS"
  3426. .pp
  3427. The following options may be set using the
  3428. .b \-o
  3429. flag on the command line
  3430. or the
  3431. .b O
  3432. line in the configuration file.
  3433. Many of them cannot be specified unless the invoking user is trusted.
  3434. .nr ii 1i
  3435. .ip A\fIfile\fP
  3436. Use the named
  3437. .i file
  3438. as the alias file.
  3439. If no file is specified,
  3440. use
  3441. .i aliases
  3442. in the current directory.
  3443. .ip a\fIN\fP
  3444. If set,
  3445. wait up to
  3446. .i N
  3447. minutes for an
  3448. .q @:@
  3449. entry to exist in the alias database
  3450. before starting up.
  3451. If it does not appear in
  3452. .i N
  3453. minutes,
  3454. rebuild the database
  3455. (if the
  3456. .b D
  3457. option is also set)
  3458. or issue a warning.
  3459. .ip B\fIc\fP
  3460. Set the blank substitution character to
  3461. .i c .
  3462. Unquoted spaces in addresses are replaced by this character.
  3463. .ip c
  3464. If an outgoing mailer is marked as being expensive,
  3465. don't connect immediately.
  3466. This requires that queueing be compiled in,
  3467. since it will depend on a queue run process to
  3468. actually send the mail.
  3469. .ip d\fIx\fP
  3470. Deliver in mode
  3471. .i x .
  3472. Legal modes are:
  3473. .(b
  3474. .ta 4n
  3475. i    Deliver interactively (synchronously)
  3476. b    Deliver in background (asynchronously)
  3477. q    Just queue the message (deliver during queue run)
  3478. .)b
  3479. .ip D
  3480. If set,
  3481. rebuild the alias database if necessary and possible.
  3482. If this option is not set,
  3483. .i sendmail
  3484. will never rebuild the alias database
  3485. unless explicitly requested
  3486. using
  3487. .b \-bi .
  3488. .ip e\fIx\fP
  3489. Dispose of errors using mode
  3490. .i x .
  3491. The values for
  3492. .i x
  3493. are:
  3494. .(b
  3495. p    Print error messages (default)
  3496. q    No messages, just give exit status
  3497. m    Mail back errors
  3498. w    Write back errors (mail if user not logged in)
  3499. e    Mail back errors and give zero exit stat always
  3500. .)b
  3501. .ip f
  3502. Save
  3503. Unix-style
  3504. .q From
  3505. lines at the front of headers.
  3506. Normally they are assumed redundant
  3507. and discarded.
  3508. .ip g\fIn\fP
  3509. Set the default group id
  3510. for mailers to run in
  3511. to
  3512. .i n .
  3513. .ip H\fIfile\fP
  3514. Specify the help file
  3515. for SMTP.
  3516. .ip I
  3517. Insist that the BIND name server be running
  3518. to resolve host names.
  3519. If this is not set and the name server is not running,
  3520. the
  3521. .i /etc/hosts
  3522. file will be considered complete.
  3523. In general, you do want to set this option
  3524. if your
  3525. .i /etc/hosts
  3526. file does not include all hosts known to you
  3527. or if you are using the MX (mail forwarding) feature of the BIND name server.
  3528. The name server will still be consulted
  3529. even if this option is not set, but
  3530. .i sendmail
  3531. will feel free to resort to reading
  3532. .i /etc/hosts
  3533. if the name server is not available.
  3534. Thus, you should
  3535. .i never
  3536. set this option if you do not run the name server.
  3537. .ip i
  3538. Ignore dots in incoming messages.
  3539. .ip K\fIxfile\fP
  3540. Declare the 
  3541. keyed database
  3542. .i x
  3543. to be associated with the 
  3544. .i dbm \|(3)
  3545. file
  3546. .i file.
  3547. (\fIX\fP is a single letter.)
  3548. The database
  3549. .q @
  3550. is always bound to the 
  3551. .i aliases
  3552. database.
  3553. See section 5.2.4.
  3554. .ip L\fIn\fP
  3555. Set the default log level to
  3556. .i n .
  3557. .ip M\fIx\|value\fP
  3558. Set the macro
  3559. .i x
  3560. to
  3561. .i value .
  3562. This is intended only for use from the command line.
  3563. .ip m
  3564. Send to me too,
  3565. even if I am in an alias expansion.
  3566. '\"    .ip N\fInetname\fP
  3567. '\"    The name of the home network;
  3568. '\"    .q ARPA
  3569. '\"    by default.
  3570. '\"    The argument of an SMTP
  3571. '\"    .q HELO
  3572. '\"    command is checked against
  3573. '\"    .q hostname.netname
  3574. '\"    where
  3575. '\"    .i hostname
  3576. '\"    is requested from the kernel for the current connection.
  3577. '\"    If they do not match,
  3578. '\"    .q Received:
  3579. '\"    lines are augmented by the name that is determined in this manner
  3580. '\"    so that messages can be traced accurately.
  3581. .ip o
  3582. Assume that the headers may be in old format,
  3583. i.e.,
  3584. spaces delimit names.
  3585. This actually turns on
  3586. an adaptive algorithm:
  3587. if any recipient address contains a comma, parenthesis,
  3588. or angle bracket,
  3589. it will be assumed that commas already exist.
  3590. If this flag is not on,
  3591. only commas delimit names.
  3592. Headers are always output with commas between the names.
  3593. .ip Q\fIdir\fP
  3594. Use the named
  3595. .i dir
  3596. as the queue directory.
  3597. .ip q\fIfactor\fP
  3598. Use
  3599. .i factor
  3600. as the multiplier in the map function
  3601. to decide when to just queue up jobs rather than run them.
  3602. This value is divided by the difference between the current load average
  3603. and the load average limit
  3604. (\c
  3605. .b x
  3606. flag)
  3607. to determine the maximum message priority
  3608. that will be sent.
  3609. Defaults to 10000.
  3610. .ip r\fItime\fP
  3611. Timeout reads after
  3612. .i time
  3613. interval.
  3614. .ip S\fIfile\fP
  3615. Log statistics in the named
  3616. .i file .
  3617. .ip s
  3618. Be super-safe when running things,
  3619. i.e.,
  3620. always instantiate the queue file,
  3621. even if you are going to attempt immediate delivery.
  3622. .i Sendmail
  3623. always instantiates the queue file
  3624. before returning control the the client
  3625. under any circumstances.
  3626. .ip T\fItime\fP
  3627. Set the queue timeout to
  3628. .i time .
  3629. After this interval,
  3630. messages that have not been successfully sent
  3631. will be returned to the sender.
  3632. .ip t\fIS,D\fP
  3633. Set the local time zone name to
  3634. .i S
  3635. for standard time and
  3636. .i D
  3637. for daylight time;
  3638. this is only used under version six
  3639. of the UNIX\(rg operating system.
  3640. .ip u\fIn\fP
  3641. Set the default userid for mailers to
  3642. .i n .
  3643. Mailers without the
  3644. .i S
  3645. flag in the mailer definition
  3646. will run as this user.
  3647. .ip v
  3648. Run in verbose mode.
  3649. .ip x\fILA\fP
  3650. When the system load average exceeds
  3651. .i LA ,
  3652. just queue messages
  3653. (i.e., don't try to send them).
  3654. .ip X\fILA\fP
  3655. When the system load average exceeds
  3656. .i LA ,
  3657. refuse incoming SMTP connections.
  3658. .ip y\fIfact\fP
  3659. The indicated
  3660. .i fact or
  3661. is added to the priority (thus
  3662. .i lowering
  3663. the priority of the job)
  3664. for each recipient,
  3665. i.e., this value penalizes jobs with large numbers of recipients.
  3666. .ip Y
  3667. If set,
  3668. deliver each job that is run from the queue in a separate process.
  3669. Use this option if you are short of memory,
  3670. since the default tends to consume considerable amounts of memory
  3671. while the queue is being processed.
  3672. .ip z\fIfact\fP
  3673. The indicated
  3674. .i fact or
  3675. is multiplied by the message class
  3676. (determined by the Precedence: field in the user header
  3677. and the
  3678. .b P
  3679. lines in the configuration file)
  3680. and subtracted from the priority.
  3681. Thus, messages with a higher Priority: will be favored.
  3682. .ip Z\fIfact\fP
  3683. The
  3684. .i fact or
  3685. is added to the priority
  3686. every time a job is processed.
  3687. Thus,
  3688. each time a job is processed,
  3689. its priority will be decreased by the indicated value.
  3690. In most environments this should be positive,
  3691. since hosts that are down are all too often down for a long time.
  3692. .+c "MAILER FLAGS"
  3693. The following flags may be set in the mailer description.
  3694. .nr ii 4n
  3695. .ip A
  3696. This is an Internet-compatible mailer,
  3697. and all appropriate modes should be set.
  3698. .ip B
  3699. Do not wait for SMTP responses (used for batch mode SMTP).
  3700. .ip C
  3701. If mail is
  3702. .i received
  3703. from a mailer with this flag set,
  3704. any addresses in the header that do not have an at sign
  3705. (\c
  3706. .q @ )
  3707. after being rewritten by ruleset three
  3708. will have the
  3709. .q @domain
  3710. clause from the sender
  3711. tacked on.
  3712. This allows mail with headers of the form:
  3713. .(b
  3714. From: usera@hosta
  3715. To: userb@hostb, userc
  3716. .)b
  3717. to be rewritten as:
  3718. .(b
  3719. From: usera@hosta
  3720. To: userb@hostb, userc@hosta
  3721. .)b
  3722. automatically.
  3723. .ip D
  3724. This mailer wants a
  3725. .q Date:
  3726. header line.
  3727. .ip E
  3728. Escape lines beginning with
  3729. .q From
  3730. in the message with a `>' sign.
  3731. .ip F
  3732. This mailer wants a
  3733. .q From:
  3734. header line.
  3735. .ip H
  3736. This mailer needs to preview the header and body of the message prior to
  3737. receiving the recipient addresses.
  3738. This is implemented with the non-standard HEAD command issued during the
  3739. initial SMTP conversation.
  3740. The H flag relies on non-standard extensions to SMTP used to communicate
  3741. with DECnet sites via the mail11v3 program.
  3742. .ip I
  3743. This mailer will be speaking SMTP
  3744. to another
  3745. .i sendmail
  3746. \*-
  3747. as such it can use special protocol features.
  3748. This option is not required
  3749. (i.e.,
  3750. if this option is omitted the transmission will still operate successfully,
  3751. although perhaps not as efficiently as possible).
  3752. .ip L
  3753. Limit the line lengths as specified in RFC821.
  3754. .ip M
  3755. This mailer wants a
  3756. .q Message-Id:
  3757. header line.
  3758. .ip N
  3759. This mailer can handle multiple status returns following the DATA command.
  3760. The non-standard MULT command issued during the initial SMTP conversation 
  3761. queries whether the remote mailer will issue multiple status returns.
  3762. The N flag relies on non-standard extensions to SMTP used to communicate
  3763. with DECnet sites via the mail11v3 program.
  3764. .ip P
  3765. This mailer wants a
  3766. .q Return-Path:
  3767. line.
  3768. .ip R
  3769. Send on reserved TCP port.
  3770. .ip S
  3771. Don't reset the userid
  3772. before calling the mailer.
  3773. This would be used in a secure environment
  3774. where
  3775. .i sendmail
  3776. ran as root.
  3777. This could be used to avoid forged addresses.
  3778. This flag is suppressed if given from an
  3779. .q unsafe
  3780. environment
  3781. (e.g, a user's mail.cf file).
  3782. .ip U
  3783. This mailer wants Unix-style
  3784. .q From
  3785. lines with the ugly UUCP-style
  3786. .q "remote from <host>"
  3787. on the end.
  3788. .ip V
  3789. Make all header addresses UUCP !-relative with respect to ourselves
  3790. and the recipient host.  This means that all header lines will have
  3791. working paths relative to the recipient host.  Routes through the
  3792. remote host, i.e. addresses that begin with
  3793. .q remote!
  3794. are stripped of that part unless the ultimate
  3795. recipient resides on the remote host (i.e., there are no more bangs in
  3796. the address).  All other addresses are prefixed with
  3797. .q ourhost!
  3798. if not already there.
  3799. .i Ourhost
  3800. is fetched from the 
  3801. .b $k
  3802. macro, which defaults to your
  3803. UUCP nodename as stored in the kernel
  3804. utsname structure.
  3805. .ip X
  3806. This mailer wants to use the hidden dot algorithm
  3807. as specified in RFC821;
  3808. basically,
  3809. any line beginning with a dot
  3810. will have an extra dot prepended
  3811. (to be stripped at the other end).
  3812. This insures that lines in the message containing a dot
  3813. will not terminate the message prematurely.
  3814. .ip e
  3815. This mailer is expensive to connect to,
  3816. so try to avoid connecting normally;
  3817. any necessary connection will occur during a queue run.
  3818. .ip f
  3819. The mailer wants aa
  3820. .b \-f
  3821. .i from
  3822. flag,
  3823. but only if this is a network forward operation
  3824. (i.e.,
  3825. the mailer will give an error
  3826. if the executing user
  3827. does not have special permissions).
  3828. .ip h
  3829. Upper case should be preserved in host names
  3830. for this mailer.
  3831. .ip l
  3832. This mailer is local
  3833. (i.e.,
  3834. final delivery will be performed).
  3835. .ip m
  3836. This mailer can send to multiple users
  3837. on the same host
  3838. in one transaction.
  3839. When a
  3840. .b $u
  3841. macro occurs in the
  3842. .i argv
  3843. part of the mailer definition,
  3844. that field will be repeated as necessary
  3845. for all qualifying users.
  3846. .ip n
  3847. Do not insert a UNIX-style
  3848. .q From
  3849. line on the front of the message.
  3850. .ip p
  3851. Use the return-path in the SMTP
  3852. .q "MAIL FROM:"
  3853. command or in the UUCP
  3854. .q From_
  3855. line
  3856. rather than just the return address;
  3857. although this is required in RFC821,
  3858. many hosts do not process return paths properly.
  3859. .ip r
  3860. Same as
  3861. .b f ,
  3862. but sends a
  3863. .b \-r
  3864. flag.
  3865. .ip s
  3866. Strip quote characters off of the address
  3867. before calling the mailer.
  3868. .ip u
  3869. Upper case should be preserved in user names
  3870. for this mailer.
  3871. .ip x
  3872. This mailer wants a
  3873. .q Full-Name:
  3874. header line.
  3875. .+c "OTHER CONFIGURATION"
  3876. .rm $0
  3877. .nr ii 1i
  3878. .pp
  3879. There are some configuration changes that can be made by
  3880. recompiling
  3881. .i sendmail .
  3882. These are located in three places:
  3883. .ip src/conf.h
  3884. Configuration parameters that may be tweaked by the installer
  3885. are included in conf.h.
  3886. .ip src/config/\fIos-name.h\fP
  3887. Compilation parameters specific to different operating systems are included in
  3888. .i os-name.h
  3889. where
  3890. .i os-name
  3891. is replaced by the proper name of the target operating system.
  3892. The selected file is included in conf.h
  3893. .ip src/conf.c
  3894. Some special routines and a few variables
  3895. may be defined in conf.c.
  3896. For the most part these are selected from the settings
  3897. in conf.h.
  3898. .uh "Parameters in src/conf.h"
  3899. .pp
  3900. Parameters are defined in conf.h.
  3901. Most of these need not normally be tweaked;
  3902. common parameters are all in sendmail.cf.
  3903. However, the sizes of certain primitive vectors, etc.,
  3904. are included in this file.
  3905. The numbers following the parameters
  3906. are their default value.
  3907. .nr ii 1.5i
  3908. .ip "MAXLINE [1024]"
  3909. The maximum line length of any input line.
  3910. If message lines exceed this length
  3911. they will still be processed correctly;
  3912. however, header lines,
  3913. configuration file lines,
  3914. alias lines,
  3915. etc.,
  3916. must fit within this limit.
  3917. .ip "MAXNAME [256]"
  3918. The maximum length of any name,
  3919. such as a host or a user name.
  3920. .ip "MAXFIELD [4096]"
  3921. The maximum total length of any header field,
  3922. including continuation lines.
  3923. .ip "MAXPV [40]"
  3924. The maximum number of parameters to any mailer.
  3925. This limits the number of recipients that may be passed in one transaction.
  3926. .ip "MAXHOP [17]"
  3927. When a message has been processed more than this number of times,
  3928. sendmail rejects the message
  3929. on the assumption that there has been an aliasing loop.
  3930. This can be determined from the
  3931. .b \-h
  3932. flag
  3933. or by counting the number of trace fields
  3934. (i.e,
  3935. .q Received:
  3936. lines)
  3937. in the message header.
  3938. .ip "MAXATOM [200]"
  3939. The maximum number of atoms
  3940. (tokens)
  3941. in a single address.
  3942. For example,
  3943. the address
  3944. .q "eric@Berkeley"
  3945. is three atoms.
  3946. .ip "MAXMAILERS [25]"
  3947. The maximum number of mailers that may be defined
  3948. in the configuration file.
  3949. .ip "MAXRWSETS [40]"
  3950. The maximum number of rewriting sets
  3951. that may be defined.
  3952. .ip "MAXPRIORITIES [25]"
  3953. The maximum number of values for the
  3954. .q Precedence:
  3955. field that may be defined
  3956. (using the
  3957. .b P
  3958. line in sendmail.cf).
  3959. .ip "MAXTRUST [30]"
  3960. The maximum number of trusted users that may be defined
  3961. (using the
  3962. .b T
  3963. line in sendmail.cf).
  3964. .ip "MAXUSERENVIRON [40]"
  3965. The maximum number of items in the user environment
  3966. that will be passed to subordinate mailers.
  3967. .ip "QUEUESIZE [600]"
  3968. The maximum number of entries that will be processed
  3969. in a single queue run.
  3970. .ip "MAXMXHOSTS [10]"
  3971. The maximum number of MX records
  3972. which can be handled.
  3973. .lp
  3974. A number of other compilation options exist.
  3975. These specify whether or not specific code should be compiled in.
  3976. .nr ii 1.1i
  3977. .ip DBM
  3978. If set,
  3979. the
  3980. .q DBM
  3981. package in UNIX is used
  3982. (see
  3983. .i dbm(3X)
  3984. in [UNIX80]).
  3985. If not set,
  3986. a much less efficient algorithm for processing aliases is used.
  3987. .ip NO_PADDING
  3988. If set, database files will be smaller, as terminating ASCII NULL ('\\0')
  3989. characters are not appended to stored strings.
  3990. The stored length parameter is used to determine actual string length.
  3991. .ip NDBM
  3992. If set,
  3993. the new version of the DBM library
  3994. that allows multiple databases will be used.
  3995. .q DBM
  3996. must also be set.
  3997. .ip MDBM
  3998. If set, Maryland's
  3999. .i mdbm \|(3)
  4000. package should be substituted for the
  4001. .i ndbm \|(3)
  4002. routines.  This should only be used if you want the keyed database
  4003. functionality (\fB$(x key$)\fP), but don't have
  4004. .i ndbm \|(3)
  4005. available.
  4006. .ip GDBM
  4007. Another alternative to
  4008. .i ndbm \|(3).
  4009. This is the GNU database library.
  4010. .ip SDBM
  4011. Yet another alternative to
  4012. .i ndbm \|(3).
  4013. This one is Ozan Yigit's implementation.
  4014. .ip ""
  4015. Only one of NDBM, MDBM, GDBM, or SDBM may be defined.
  4016. '\"    .ip DBM_AUTOBUILD
  4017. '\"    Include code to read the text file source
  4018. '\"    and scanf string or program specification
  4019. '\"    from the 
  4020. '\"    OKc
  4021. '\"    lines of the configuration file,
  4022. '\"    and to automatically rebuild a database
  4023. '\"    when it becomes out of date
  4024. '\"    with respect to the source file.
  4025. '\"    This obviates killing and restarting daemons,
  4026. '\"    and refreezing frozen configuration files
  4027. '\"    when information affecting databases changes.
  4028. '\"    DBM_AUTOBUILD may be used with any variant of DBM,
  4029. '\"    including \*(lqold\*rq DBM,
  4030. '\"    which could not otherwise be used with
  4031. '\"    multiple databases.
  4032. .ip YP
  4033. Include code to handle NIS
  4034. (formerly known as Yellow Pages).
  4035. .ip FUZZY
  4036. Enable code to match local names to the gcos field of the 
  4037. /etc/passwd file.
  4038. '\"    DEBUG appears to be no longer valid
  4039. '\"    .ip DEBUG
  4040. '\"    If set, debugging information is compiled in.
  4041. '\"    To actually get the debugging output,
  4042. '\"    the
  4043. '\"    .b \-d
  4044. '\"    flag must be used.
  4045. .ip LOG
  4046. If set,
  4047. the
  4048. .i syslog
  4049. routine in use at some sites is used.
  4050. This makes an informational log record
  4051. for each message processed,
  4052. and makes a higher priority log record
  4053. for internal system errors.
  4054. .ip QUEUE
  4055. This flag should be set to compile in the queueing code.
  4056. If this is not set,
  4057. mailers must accept the mail immediately
  4058. or it will be returned to the sender.
  4059. .ip SMTP
  4060. If set,
  4061. the code to handle user and server SMTP will be compiled in.
  4062. This is only necessary if your network has some mailer
  4063. that speaks SMTP.
  4064. .ip DAEMON
  4065. If set,
  4066. code to run a daemon is compiled in.
  4067. This code is for 4.2 or 4.3BSD.
  4068. .ip QUEUE_MACVALUE
  4069. Save the computed value of the $r and $s macros
  4070. in the queue file.
  4071. .ip MAIL11V3
  4072. Handle DECnet peculiarities.
  4073. .ip UGLYUUCP
  4074. If you have a UUCP host adjacent to you which is not running
  4075. a reasonable version of
  4076. .i rmail ,
  4077. you will have to set this flag to include the
  4078. .q "remote from sysname"
  4079. info on the from line.
  4080. Otherwise, UUCP gets confused about where the mail came from.
  4081. .ip NOTUNIX
  4082. If you are using a non-UNIX mail format,
  4083. you can set this flag to turn off special processing
  4084. of UNIX-style
  4085. .q "From "
  4086. lines.
  4087. .ip NAMED_BIND
  4088. Compile in code to use the Berkeley Internet Name Domain (BIND) server
  4089. to resolve TCP/IP host names.
  4090. .ip SETPROCTITLE
  4091. If defined,
  4092. .i sendmail
  4093. will change its
  4094. .i argv
  4095. array to indicate its current status.
  4096. This can be used in conjunction with the
  4097. .i ps
  4098. command to find out just what it's up to.
  4099. .ip TTYNAME
  4100. Set macro $y to basename of tty device special file.
  4101. .ip BIT8
  4102. Include national language support.
  4103. Mnemonics with escape codes represent special chars in US ASCII for transport.
  4104. 8\-bit SMTP between cooperating systems can be configured as well.
  4105. .lp
  4106. There are a few file paths defined in conf.h also:
  4107. .ip _PATH_SENDMAILCF
  4108. The location of the configuration file.
  4109. Usually /etc/sendmail.cf.
  4110. .ip _PATH_SENDMAILFC
  4111. The location of the frozen configuration file.
  4112. Usually /etc/sendmail.fc.
  4113. .ip _PATH_SENDMAILPID
  4114. The name of a file which holds the sendmail
  4115. daemon's process id.
  4116. Usually /var/run/sendmail.pid.
  4117. .uh "Parameters in src/config/\fIos-name\fP.h"
  4118. .pp
  4119. Compilation specific parameters are specified here.
  4120. There is one file per operating system in the
  4121. .i src/config
  4122. directory.
  4123. .nr ii 1.5i
  4124. .ip VMUNIX
  4125. Include code for BSD networking (sockets).
  4126. This is required to operate in daemon mode.
  4127. .ip ISC
  4128. Include code for the Interactive Systems Corp variant of System 5 UNIX.
  4129. .ip FCNTL_FLOCK
  4130. Berkeley
  4131. .i flock \|(2)
  4132. emulation using
  4133. .i fcntl \|(2).
  4134. .ip LOCKF_FLOCK
  4135. Berkeley
  4136. .i flock \|(2)
  4137. emulation using
  4138. .i lockf \|(3).
  4139. .ip ""
  4140. One of FCNTL_FLOCK or LOCKF_FLOCK
  4141. should be defined for
  4142. non\-Berkeley operating systems.
  4143. .ip SIG_TYPE
  4144. Indicates whether
  4145. .i signal \|(2)
  4146. returns type
  4147. .i void
  4148. or
  4149. .i int \|.
  4150. .ip TIME_TYPE
  4151. Indicates whether
  4152. .i time \|(3)
  4153. returns type
  4154. .i time_t
  4155. or
  4156. .i long \|.
  4157. .ip SHARE
  4158. Include code for the Convex share scheduler.
  4159. .ip SYSV
  4160. Attempt to compensate for most Berkeleyisms
  4161. for compilation under the
  4162. UNIX \(rg System V operating system.
  4163. .pp
  4164. The next set of parameters signal missing system routines that are either 
  4165. replaced in the
  4166. .i sendmail
  4167. source files (NEED_FOO) or faked with equivalents (LACK_FOO).
  4168. .ip NEED_GETENV
  4169. Include the getenv() routine from
  4170. .i src/setenv.c .
  4171. .ip NEED_SETENV
  4172. Include the setenv() routine from
  4173. .i src/setenv.c .
  4174. .ip NEED_UNSETENV
  4175. Include the unsetenv() routine from
  4176. .i src/setenv.c .
  4177. .ip NEED_VSPRINTF
  4178. Include the portable vprintf() routines\**
  4179. .(f
  4180. \**Contributed by Robert Larson (blarson@skat.usc.edu).
  4181. .)f
  4182. from
  4183. .i src/vprintf.c .
  4184. .ip LACK_WAIT3
  4185. Fake the wait3() call by using wait() and resetting the signal handler
  4186. each time the reapchild() routine is called.
  4187. .ip LACK_SIGBLOCK
  4188. Replace use of sigblock() with sigprocmask().
  4189. .uh "Configuration in src/conf.c"
  4190. .pp
  4191. Not all header semantics are defined in the configuration file.
  4192. Header lines that should only be included by certain mailers
  4193. (as well as other more obscure semantics)
  4194. must be specified in the
  4195. .i HdrInfo
  4196. table in
  4197. .i conf.c .
  4198. This table contains the header name
  4199. (which should be in all lower case)
  4200. and a set of header control flags (described below),
  4201. The flags are:
  4202. .ip H_ACHECK
  4203. Normally when the check is made to see if a header line is compatible
  4204. with a mailer,
  4205. .i sendmail
  4206. will not delete an existing line.
  4207. If this flag is set,
  4208. .i sendmail
  4209. will delete
  4210. even existing header lines.
  4211. That is,
  4212. if this bit is set and the mailer does not have flag bits set
  4213. that intersect with the required mailer flags
  4214. in the header definition in
  4215. sendmail.cf,
  4216. the header line is
  4217. .i always
  4218. deleted.
  4219. .ip H_EOH
  4220. If this header field is set,
  4221. treat it like a blank line,
  4222. i.e.,
  4223. it will signal the end of the header
  4224. and the beginning of the message text.
  4225. .ip H_FORCE
  4226. Add this header entry
  4227. even if one existed in the message before.
  4228. If a header entry does not have this bit set,
  4229. .i sendmail
  4230. will not add another header line if a header line
  4231. of this name already existed.
  4232. This would normally be used to stamp the message
  4233. by everyone who handled it.
  4234. .ip H_TRACE
  4235. If set,
  4236. this is a timestamp
  4237. (trace)
  4238. field.
  4239. If the number of trace fields in a message
  4240. exceeds a preset amount
  4241. the message is returned
  4242. on the assumption that it has an aliasing loop.
  4243. .ip H_RCPT
  4244. If set,
  4245. this field contains recipient addresses.
  4246. This is used by the
  4247. .b \-t
  4248. flag to determine who to send to
  4249. when it is collecting recipients from the message.
  4250. .ip H_FROM
  4251. This flag indicates that this field
  4252. specifies a sender.
  4253. The order of these fields in the
  4254. .i HdrInfo
  4255. table specifies
  4256. .i sendmail's
  4257. preference
  4258. for which field to return error messages to.
  4259. .nr ii 5n
  4260. .lp
  4261. Let's look at a sample
  4262. .i HdrInfo
  4263. specification:
  4264. .(b
  4265. .ta 4n +\w'"return-receipt-to",  'u
  4266. struct hdrinfo    HdrInfo[] =
  4267. \&{
  4268.          /* originator fields, most to least significant  */
  4269.     "resent-sender",    H_FROM,
  4270.     "resent-from",    H_FROM,
  4271.     "sender",    H_FROM,
  4272.     "from",    H_FROM,
  4273.     "full-name",    H_ACHECK,
  4274.          /* destination fields */
  4275.     "to",    H_RCPT,
  4276.     "resent-to",    H_RCPT,
  4277.     "cc",    H_RCPT,
  4278.          /* message identification and control */
  4279.     "message",    H_EOH,
  4280.     "text",    H_EOH,
  4281.          /* trace fields */
  4282.     "received",    H_TRACE|H_FORCE,
  4283.  
  4284.     NULL,    0,
  4285. };
  4286. .)b
  4287. This structure indicates that the
  4288. .q To: ,
  4289. .q Resent-To: ,
  4290. and
  4291. .q Cc:
  4292. fields
  4293. all specify recipient addresses.
  4294. Any
  4295. .q Full-Name:
  4296. field will be deleted unless the required mailer flag
  4297. (indicated in the configuration file)
  4298. is specified.
  4299. The
  4300. .q Message:
  4301. and
  4302. .q Text:
  4303. fields will terminate the header;
  4304. these are specified in new protocols
  4305. [NBS80]
  4306. or used by random dissenters around the network world.
  4307. The
  4308. .q Received:
  4309. field will always be added,
  4310. and can be used to trace messages.
  4311. .pp
  4312. There are a number of important points here.
  4313. First,
  4314. header fields are not added automatically just because they are in the
  4315. .i HdrInfo
  4316. structure;
  4317. they must be specified in the configuration file
  4318. in order to be added to the message.
  4319. Any header fields mentioned in the configuration file but not
  4320. mentioned in the
  4321. .i HdrInfo
  4322. structure have default processing performed;
  4323. that is,
  4324. they are added unless they were in the message already.
  4325. Second,
  4326. the
  4327. .i HdrInfo
  4328. structure only specifies cliched processing;
  4329. certain headers are processed specially by ad hoc code
  4330. regardless of the status specified in
  4331. .i HdrInfo .
  4332. For example,
  4333. the
  4334. .q Sender:
  4335. and
  4336. .q From:
  4337. fields are always scanned on Internet mail
  4338. to determine the sender;
  4339. this is used to perform the
  4340. .q "return to sender"
  4341. function.
  4342. The
  4343. .q "From:"
  4344. and
  4345. .q "Full-Name:"
  4346. fields are used to determine the full name of the sender
  4347. if possible;
  4348. this is stored in the macro
  4349. .b $x
  4350. and used in a number of ways.
  4351. .pp
  4352. The file
  4353. .i conf.c
  4354. also contains the specification of Internet reply codes.
  4355. There are four classifications these fall into:
  4356. .(b
  4357. .sz -1
  4358. .ta \w'char  'u +\w'Arpa_TUsrerr[] =  'u +\w'"888";  'u
  4359. char    Arpa_Info[] =    "050";    /* arbitrary info */
  4360. char    Arpa_TSyserr[] =    "455";    /* some (transient) system error */
  4361. char    Arpa_PSyserr[] =    "554";    /* some (permanent) system error */
  4362. char    Arpa_Usrerr[] =    "554";    /* some (fatal) user error */
  4363. .sz
  4364. .)b
  4365. The class
  4366. .i Arpa_Info
  4367. is for any information that is not required by the protocol,
  4368. such as forwarding information.
  4369. .i Arpa_TSyserr
  4370. and
  4371. .i Arpa_PSyserr
  4372. is printed by the
  4373. .i syserr
  4374. routine.
  4375. TSyserr
  4376. is printed out for transient errors,
  4377. that is,
  4378. errors that are likely to go away without explicit action
  4379. on the part of a systems administrator.
  4380. PSyserr
  4381. is printed for permanent errors.
  4382. The distinction is made based on the value of
  4383. .i errno .
  4384. Finally,
  4385. .i Arpa_Usrerr
  4386. is the result of a user error
  4387. and is generated by the
  4388. .i usrerr
  4389. routine;
  4390. these are generated when the user has specified something wrong,
  4391. and hence the error is permanent,
  4392. i.e.,
  4393. it will not work simply by resubmitting the request.
  4394. .pp
  4395. If it is necessary to restrict mail through a relay,
  4396. the
  4397. .i checkcompat
  4398. routine can be modified.
  4399. This routine is called for every recipient address.
  4400. It can return
  4401. .b TRUE
  4402. to indicate that the address is acceptable
  4403. and mail processing will continue,
  4404. or it can return
  4405. .b FALSE
  4406. to reject the recipient.
  4407. If it returns false,
  4408. it is up to
  4409. .i checkcompat
  4410. to print an error message
  4411. (using
  4412. .i usrerr )
  4413. saying why the message is rejected.
  4414. For example,
  4415. .i checkcompat
  4416. could read:
  4417. .(b
  4418. .re
  4419. .sz -1
  4420. .ta 4n +4n +4n +4n +4n +4n +4n
  4421. bool
  4422. checkcompat(to)
  4423.     register ADDRESS *to;
  4424. \&{
  4425.     if (MsgSize > 50000 && to->q_mailer != LocalMailer)
  4426.     {
  4427.         usrerr("Message too large for non-local delivery");
  4428.         NoReturn = TRUE;
  4429.         return (FALSE);
  4430.     }
  4431.     return (TRUE);
  4432. }
  4433. .sz
  4434. .)b
  4435. This would reject messages greater than 50000 bytes
  4436. unless they were local.
  4437. The
  4438. .i NoReturn
  4439. flag can be sent to suppress the return of the actual body
  4440. of the message in the error return.
  4441. The actual use of this routine is highly dependent on the
  4442. implementation,
  4443. and use should be limited.
  4444. .uh "Configuration in src/daemon.c"
  4445. .pp
  4446. The file
  4447. .i src/daemon.c
  4448. contains a number of routines that are dependent
  4449. on the local networking environment.
  4450. The version supplied is specific to 4.3 BSD.
  4451. .pp
  4452. The routine
  4453. .i maphostname
  4454. is called to convert strings within
  4455. .b $[
  4456. \&...\&
  4457. .b $]
  4458. symbols.
  4459. It can be modified if you wish to provide a more sophisticated service,
  4460. e.g.,
  4461. mapping UUCP host names to full paths.
  4462. .+c "SUMMARY OF SUPPORT FILES"
  4463. .pp
  4464. This is a summary of the support files
  4465. that
  4466. .i sendmail
  4467. creates or generates.
  4468. .nr ii 1i
  4469. .ip "/usr/lib/sendmail"
  4470. The binary of
  4471. .i sendmail .
  4472. .ip /usr/ucb/newaliases
  4473. A link to /usr/lib/sendmail;
  4474. causes the alias database to be rebuilt
  4475. if it is out of date with respect to the text
  4476. version of the aliases file.
  4477. Running this program is completely equivalent to giving
  4478. .i sendmail
  4479. the
  4480. .b \-bi
  4481. flag.
  4482. .ip /usr/ucb/mailq
  4483. Prints a listing of the mail queue.
  4484. This program is equivalent to using the
  4485. .b \-bp
  4486. flag to
  4487. .i sendmail .
  4488. .ip /usr/ucb/bsmtp
  4489. A link to /usr/lib/sendmail; starts up
  4490. .i sendmail
  4491. in Batched SMTP mode (as if supplied with the
  4492. .b \-bb
  4493. option).
  4494. .ip /etc/sendmail.cf
  4495. The configuration file,
  4496. in textual form.
  4497. .ip /etc/sendmail.fc
  4498. The configuration file
  4499. represented as a memory image.
  4500. .ip /usr/lib/sendmail.hf
  4501. The SMTP help file.
  4502. .ip /var/log/sendmail.st
  4503. A statistics file; need not be present.
  4504. .ip /usr/lib/aliases
  4505. The textual version of the alias file.
  4506. .ip /usr/lib/aliases.{pag,dir}
  4507. The alias file in
  4508. .i dbm \|(3)
  4509. format.
  4510. .ip /usr/spool/mqueue
  4511. The directory in which the mail queue
  4512. and temporary files reside.
  4513. .ip /usr/spool/mqueue/qf*
  4514. Control (queue) files for messages.
  4515. .ip /usr/spool/mqueue/df*
  4516. Data files.
  4517. '\"    .ip /usr/spool/mqueue/lf*
  4518. '\"    Seems this went away around 5.64 or 5.65 (replaced by flock()).
  4519. '\"    Lock files
  4520. .ip /usr/spool/mqueue/tf*
  4521. Temporary versions of the qf files,
  4522. used during queue file rebuild.
  4523. '\"    .ip /usr/spool/mqueue/nf*
  4524. '\"    No evidence of this in any of the source code.
  4525. '\"    A file used when creating a unique id.
  4526. .ip /usr/spool/mqueue/xf*
  4527. A transcript of the current session.
  4528. .ip /var/run/sendmail.pid
  4529. Contains the process id of a daemon
  4530. (-bd option)
  4531. if one exists.
  4532. .+c "DEBUG FLAGS"
  4533. .pp
  4534. This is a summary of the flags used with the
  4535. \-d
  4536. option for debugging.
  4537. .ip 0
  4538. Configuration information, including canonical name and UUCP nodename
  4539. (main.c, util.c).
  4540. .ip 1
  4541. From address
  4542. (main() in main.c).
  4543. .ip 2
  4544. delivery status
  4545. (finis() in main.c).
  4546. .ip 3
  4547. Load average
  4548. (conf.c, main.c).
  4549. .ip 4
  4550. Calls to fork(2)
  4551. (getrequests() in daemon.c,
  4552. openmailer(), mailfile(), and sendall() in deliver.c,
  4553. runqueue() and dowork() in queue.c,
  4554. runinchild() in srvrsmtp.c)
  4555. and return of wait(2)
  4556. (waitfor() in util.c).
  4557. .ip 5
  4558. Processing of \*(lqevents\*(rq
  4559. (clock.c).
  4560. .ip 6
  4561. Error handling
  4562. (savemail() and returntosender() in savemail.c).
  4563. .ip 7
  4564. Queue file creation
  4565. (queuename() in queue.c).
  4566. .ip 8
  4567. MX record handling
  4568. (getmxrr() and getcanonname() in domain.c
  4569. and main() in main.c).
  4570. .ip 9
  4571. Host name canonicalization
  4572. (maphostname in daemon.c).
  4573. .ip 10
  4574. Per\-addressee delivery
  4575. (deliver() in deliver.c).
  4576. .ip 11
  4577. Mailer selection
  4578. (openmailer() in deliver.c).
  4579. .ip 12
  4580. Translation of address relative to current mailer
  4581. (remotename() in parseaddr.c).
  4582. .ip 13
  4583. Message delivery
  4584. (sendall() in deliver.c).
  4585. .ip 14
  4586. Header output
  4587. (commaize() in headers.c).
  4588. .ip 15
  4589. Wait for incoming SMTP connections in daemon mode
  4590. (getrequests() in daemon.c).
  4591. .ip 16
  4592. Connect to remote SMTP port
  4593. (makeconnection() in daemon.c).
  4594. .ip 18
  4595. Client\-side SMTP transactions
  4596. (usersmtp.c).
  4597. .ip 20
  4598. Mark start and end of parseaddr()
  4599. routine (parseaddr.c).
  4600. .ip 21
  4601. Rewrite rules
  4602. (parseaddr.c).
  4603. .ip 22
  4604. Conversion of addresses into tokens for rewriting
  4605. (prescan() in parseaddr.c).
  4606. .ip 25
  4607. Recipient addresses
  4608. (sendtolist() in recipient.c).
  4609. .ip 26
  4610. Recipient processing, including checks for local users
  4611. (recipient.c).
  4612. .ip 27
  4613. Alias and forward substitution
  4614. (alias.c).
  4615. .ip 30
  4616. Handle UNIX "From " lines
  4617. (eatfrom() in  collect.c)
  4618. and makrk end of headers,
  4619. adding "Apparently-To:" if there is no recipient
  4620. (collect() in collect.c).
  4621. .ip 31
  4622. Mark start of chompheader routine
  4623. (headers.c).
  4624. .ip 32
  4625. Header processing
  4626. (eatheader() in headers.c).
  4627. .ip 33
  4628. .b $g
  4629. macro substitution
  4630. (crackaddr() in headers.c).
  4631. .ip 35
  4632. Macro definition and expansion
  4633. (macro.c).
  4634. .ip 36
  4635. Symbol table management
  4636. (stab.c).
  4637. .ip 37
  4638. Configuration file processing
  4639. (readcf.c).
  4640. .ip 40
  4641. Generic queue processing
  4642. (queue.c).
  4643. .ip 41
  4644. Order the jobs in the queue
  4645. (orderq() in queue.c).
  4646. .ip 45
  4647. Sender address determination
  4648. (setsender() in envelope.c).
  4649. .ip 50
  4650. End of envelope processing
  4651. (dropenvelope() in envelope.c).
  4652. .ip 51
  4653. End of processing of a queue entry
  4654. (unlockqueue() in queue.c).
  4655. .ip 52
  4656. Dissociation from controlling tty for daemon mode
  4657. (disconnect() in main.c).
  4658. .ip 60
  4659. Keyed database initialization, rebuilding, and lookup
  4660. (daemon.c).
  4661. .\".ro
  4662. .\".ls 1
  4663. .\".tp
  4664. .\".sp 2i
  4665. .\".in 0
  4666. .\".ce 100
  4667. .\".sz 24
  4668. .\".b SENDMAIL
  4669. .\".sz 14
  4670. .\".sp
  4671. .\"INSTALLATION AND OPERATION GUIDE
  4672. .\".sp
  4673. .\".sz 10
  4674. .\"Eric Allman
  4675. .\"Britton-Lee, Inc.
  4676. .\".sp
  4677. .\"Version 5.11
  4678. .\".ce 0
  4679. .pn 2
  4680. .bp
  4681. .ce
  4682. .sz 12
  4683. TABLE OF CONTENTS
  4684. .sz 10
  4685. .sp
  4686. .\" remove some things to avoid "out of temp file space" problem
  4687. .rm sh
  4688. .rm (x
  4689. .rm )x
  4690. .rm ip
  4691. .rm pp
  4692. .rm lp
  4693. .rm he
  4694. .rm fo
  4695. .rm eh
  4696. .rm oh
  4697. .rm ef
  4698. .rm of
  4699. .xp
  4700.