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 / RCS / op.me,v next >
Encoding:
Text File  |  1991-08-13  |  134.6 KB  |  6,004 lines

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