home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / N / SENDMAIL / _SENDMAI.TAR / usr / doc / sendmail / op / op.me < prev   
Encoding:
Text File  |  1994-04-14  |  166.3 KB  |  6,922 lines

  1. .\" Copyright (c) 1983 Eric P. Allman
  2. .\" Copyright (c) 1983, 1993
  3. .\"    The Regents of the University of California.  All rights reserved.
  4. .\"
  5. .\" Redistribution and use in source and binary forms, with or without
  6. .\" modification, are permitted provided that the following conditions
  7. .\" are met:
  8. .\" 1. Redistributions of source code must retain the above copyright
  9. .\"    notice, this list of conditions and the following disclaimer.
  10. .\" 2. Redistributions in binary form must reproduce the above copyright
  11. .\"    notice, this list of conditions and the following disclaimer in the
  12. .\"    documentation and/or other materials provided with the distribution.
  13. .\" 3. All advertising materials mentioning features or use of this software
  14. .\"    must display the following acknowledgement:
  15. .\"    This product includes software developed by the University of
  16. .\"    California, Berkeley and its contributors.
  17. .\" 4. Neither the name of the University nor the names of its contributors
  18. .\"    may be used to endorse or promote products derived from this software
  19. .\"    without specific prior written permission.
  20. .\"
  21. .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22. .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23. .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24. .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25. .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26. .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27. .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28. .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29. .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30. .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31. .\" SUCH DAMAGE.
  32. .\"
  33. .\"    @(#)op.me    8.36 (Berkeley) 4/14/94
  34. .\"
  35. .\" eqn op.me | pic | troff -me
  36. .eh 'SMM:08-%''Sendmail Installation and Operation Guide'
  37. .oh 'Sendmail Installation and Operation Guide''SMM:08-%'
  38. .\" SD is lib if sendmail is installed in /usr/lib, sbin if in /usr/sbin
  39. .ds SD sbin
  40. .\" SB is bin if newaliases/mailq are installed in /usr/bin, ucb if in /usr/ucb
  41. .ds SB bin
  42. .nr si 3n
  43. .de $0
  44. .(x
  45. .in \\$3u*3n
  46. .ti -3n
  47. \\$2.  \\$1
  48. .)x
  49. ..
  50. .de $C
  51. .(x
  52. .in 0
  53. \\$1 \\$2.  \\$3
  54. .)x
  55. ..
  56. .sc
  57. .+c
  58. .(l C
  59. .sz 16
  60. .b SENDMAIL
  61. .sz 12
  62. .sp
  63. .b "INSTALLATION AND OPERATION GUIDE"
  64. .sz 10
  65. .sp
  66. .r
  67. Eric Allman
  68. University of California, Berkeley
  69. Mammoth Project
  70. eric@CS.Berkeley.EDU
  71. .sp
  72. Version 8.36
  73. .sp
  74. For Sendmail Version 8.6
  75. .)l
  76. .sp 2
  77. .pp
  78. .i Sendmail
  79. implements a general purpose internetwork mail routing facility
  80. under the UNIX*
  81. .(f
  82. *UNIX is a trademark of Unix Systems Laboratories.
  83. .)f
  84. operating system.
  85. It is not tied to any one transport protocol \*-
  86. its function may be likened to a crossbar switch,
  87. relaying messages from one domain into another.
  88. In the process,
  89. it can do a limited amount of message header editing
  90. to put the message into a format that is appropriate
  91. for the receiving domain.
  92. All of this is done under the control of a configuration file.
  93. .pp
  94. Due to the requirements of flexibility
  95. for
  96. .i sendmail ,
  97. the configuration file can seem somewhat unapproachable.
  98. However, there are only a few basic configurations
  99. for most sites,
  100. for which standard configuration files have been supplied.
  101. Most other configurations
  102. can be built by adjusting an existing configuration files
  103. incrementally.
  104. .pp
  105. .i Sendmail
  106. is based on
  107. RFC822 (Internet Mail Format Protocol),
  108. RFC821 (Simple Mail Transport Protocol),
  109. RFC1123 (Internet Host Requirements),
  110. and
  111. RFC1425 (SMTP Service Extensions).
  112. However, since
  113. .i sendmail
  114. is designed to work in a wider world,
  115. in many cases it can be configured to exceed these protocols.
  116. These cases are described herein.
  117. .pp
  118. Although
  119. .i sendmail
  120. is intended to run
  121. without the need for monitoring,
  122. it has a number of features
  123. that may be used to monitor or adjust the operation
  124. under unusual circumstances.
  125. These features are described.
  126. .pp
  127. Section one describes how to do a basic
  128. .i sendmail
  129. installation.
  130. Section two
  131. explains the day-to-day information you should know
  132. to maintain your mail system.
  133. If you have a relatively normal site,
  134. these two sections should contain sufficient information
  135. for you to install
  136. .i sendmail
  137. and keep it happy.
  138. Section three
  139. describes some parameters that may be safely tweaked.
  140. Section four
  141. has information regarding the command line arguments.
  142. Section five
  143. contains the nitty-gritty information about the configuration
  144. file.
  145. This section is for masochists
  146. and people who must write their own configuration file.
  147. Section six
  148. describes configuration that can be done at compile time.
  149. Section seven
  150. gives a brief description of differences
  151. in this version of
  152. .i sendmail .
  153. The appendixes give a brief
  154. but detailed explanation of a number of features
  155. not described in the rest of the paper.
  156. .bp 7
  157. .sh 1 "BASIC INSTALLATION"
  158. .pp
  159. There are two basic steps to installing
  160. .i sendmail .
  161. The hard part is to build the configuration table.
  162. This is a file that
  163. .i sendmail
  164. reads when it starts up
  165. that describes the mailers it knows about,
  166. how to parse addresses,
  167. how to rewrite the message header,
  168. and the settings of various options.
  169. Although the configuration table is quite complex,
  170. a configuration can usually be built
  171. by adjusting an existing off-the-shelf configuration.
  172. The second part is actually doing the installation,
  173. i.e., creating the necessary files, etc.
  174. .pp
  175. The remainder of this section will describe the installation of
  176. .i sendmail
  177. assuming you can use one of the existing configurations
  178. and that the standard installation parameters are acceptable.
  179. All pathnames and examples
  180. are given from the root of the
  181. .i sendmail
  182. subtree,
  183. normally
  184. .i /usr/src/usr.\*(SD/sendmail
  185. on 4.4BSD.
  186. .pp
  187. If you are loading this off the tape,
  188. continue with the next section.
  189. If you have a running binary already on your system,
  190. you should probably skip to section 1.2.
  191. .sh 2 "Compiling Sendmail"
  192. .pp
  193. All
  194. .i sendmail
  195. source is in the
  196. .i src
  197. subdirectory.
  198. If you are running on a 4.4BSD system,
  199. compile by typing
  200. .q make .
  201. On other systems, you may have to make some other adjustments.
  202. .sh 3 "Old versions of make"
  203. .pp
  204. If you are not running the new version of
  205. .b make
  206. you will probably have to use
  207. .(b
  208. make \-f Makefile.dist
  209. .)b
  210. This file does not assume several new syntaxes,
  211. including the
  212. .q +=
  213. syntax in macro definition
  214. and the
  215. .q ".include"
  216. syntax.
  217. .sh 3 "Compilation flags"
  218. .pp
  219. .i Sendmail
  220. supports two different formats
  221. for the
  222. .i aliases
  223. database.
  224. These formats are:
  225. .nr ii 1i
  226. .ip NDBM
  227. The ``new DBM'' format,
  228. available on nearly all systems around today.
  229. This was the preferred format prior to 4.4BSD.
  230. It allows such complex things as multiple databases
  231. and closing a currently open database.
  232. .ip NEWDB
  233. The new database package from Berkeley.
  234. If you have this, use it.
  235. It allows
  236. long records,
  237. multiple open databases,
  238. real in-memory caching,
  239. and so forth.
  240. You can define this in conjunction with one of the other two;
  241. if you do,
  242. old databases are read,
  243. but when a new database is created it will be in NEWDB format.
  244. As a nasty hack,
  245. if you have NEWDB, NDBM, and NIS defined,
  246. and if the file
  247. .i /var/yp/Makefile
  248. exists and is readable,
  249. .i sendmail
  250. will create both new and old versions of the alias file
  251. during a
  252. .i newalias
  253. command.
  254. This is required because the Sun NIS/YP system
  255. reads the DBM version of the alias file.
  256. It's ugly as sin,
  257. but it works.
  258. .lp
  259. If neither of these are defined,
  260. .i sendmail
  261. reads the alias file into memory on every invocation.
  262. This can be slow and should be avoided.
  263. .pp
  264. System V based systems can define
  265. SYSTEM5
  266. to make several small adjustments.
  267. This changes the handling of timezones
  268. and uses the much less efficient
  269. .i lockf
  270. call in preference to
  271. .i flock .
  272. These can be specified separately using the compilation flags
  273. SYS5TZ
  274. and
  275. LOCKF
  276. respectively.
  277. .pp
  278. If you don't have the
  279. .i unsetenv
  280. routine in your system library, define the UNSETENV compilation flag.
  281. .pp
  282. You may also have to define the compilation variable LA_TYPE
  283. to describe how your load average is computed.
  284. This and other flags are detailed in section 6.1.
  285. .sh 3 "Compilation and installation"
  286. .pp
  287. After making the local system configuration described above,
  288. You should be able to compile and install the system.
  289. Compilation can be performed using
  290. .q make\**
  291. .(f
  292. \**where you may have to replace
  293. .q make
  294. with
  295. .q "make \-f Makefile.dist"
  296. as appropriate.
  297. .)f
  298. in the
  299. .b sendmail/src
  300. directory.
  301. You may be able to install using
  302. .(b
  303. make install
  304. .)b
  305. This should install the binary in
  306. /usr/\*(SD
  307. and create links from
  308. /usr/\*(SB/newaliases
  309. and
  310. /usr/\*(SB/mailq
  311. to
  312. /usr/\*(SD/sendmail.
  313. On 4.4BSD systems it will also format and install man pages.
  314. .sh 2 "Configuration Files"
  315. .pp
  316. .i Sendmail
  317. cannot operate without a configuration file.
  318. The configuration defines the mail systems understood at this site,
  319. how to access them,
  320. how to forward email to remote mail systems,
  321. and a number of tuning parameters.
  322. This configuration file is detailed
  323. in the later portion of this document.
  324. .pp
  325. The
  326. .i sendmail
  327. configuration can be daunting at first.
  328. The world is complex,
  329. and the mail configuration reflects that.
  330. The distribution includes an m4-based configuration package
  331. that hides a lot of the complexity.
  332. .pp
  333. These configuration files are simpler than old versions
  334. largely because the world has become simpler;
  335. in particular,
  336. text-based host files are officially eliminated,
  337. obviating the need to
  338. .q hide
  339. hosts behind a registered internet gateway.
  340. .pp
  341. These files also assume that most of your neighbors
  342. use domain-based UUCP addressing;
  343. that is,
  344. instead of naming hosts as
  345. .q host!user
  346. they will use
  347. .q host.domain!user .
  348. The configuration files can be customized to work around this,
  349. but it is more complex.
  350. .pp
  351. I haven't tested these yet on an isolated LAN environment
  352. with a single UUCP connection to the outside world.
  353. If you are in such an environment,
  354. please send comments to
  355. sendmail@CS.Berkeley.EDU.
  356. .pp
  357. Our configuration files are processed by
  358. .i m4
  359. to facilitate local customization;
  360. the directory
  361. .i cf
  362. of the
  363. .i sendmail
  364. distribution directory
  365. contains the source files.
  366. This directory contains several subdirectories:
  367. .nr ii 1i
  368. .ip cf
  369. Both site-dependent and site-independent descriptions of hosts.
  370. These can be literal host names
  371. (e.g.,
  372. .q ucbvax.mc )
  373. when the hosts are gateways
  374. or more general descriptions
  375. (such as
  376. .q "tcpproto.mc"
  377. as a general description of an SMTP-connected host
  378. or
  379. .q "uucpproto.mc"
  380. as a general description of a UUCP-connected host).
  381. Files ending
  382. .b \&.mc
  383. (``Master Configuration'')
  384. are the input descriptions;
  385. the output is in the corresponding
  386. .b \&.cf
  387. file.
  388. The general structure of these files is described below.
  389. .ip domain
  390. Site-dependent subdomain descriptions.
  391. These are tied to the way your organization wants to do addressing.
  392. For example,
  393. .b domain/cs.exposed.m4
  394. is our description for hosts in the CS.Berkeley.EDU subdomain
  395. that want their individual hostname to be externally visible;
  396. .b domain/cs.hidden.m4
  397. is the same except that the hostname is hidden
  398. (everything looks like it comes from CS.Berkeley.EDU).
  399. These are referenced using the
  400. .sm DOMAIN
  401. .b m4
  402. macro in the
  403. .b \&.mc
  404. file.
  405. .ip feature
  406. Definitions of specific features that some particular host in your site
  407. might want.
  408. These are referenced using the
  409. .sm FEATURE
  410. .b m4
  411. macro.
  412. An example feature is
  413. use_cw_file
  414. (which tells
  415. .i sendmail
  416. to read an /etc/sendmail.cw file on startup
  417. to find the set of local names).
  418. .ip hack
  419. Local hacks, referenced using the
  420. .sm HACK
  421. .b m4
  422. macro.
  423. Try to avoid these.
  424. The point of having them here is to make it clear that they smell.
  425. .ip m4
  426. Site-independent
  427. .i m4 (1)
  428. include files that have information common to all configuration files.
  429. This can be thought of as a
  430. .q #include
  431. directory.
  432. .ip mailer
  433. Definitions of mailers,
  434. referenced using the
  435. .sm MAILER
  436. .b m4
  437. macro.
  438. Defined mailer types in this distribution are
  439. fax,
  440. local,
  441. smtp,
  442. uucp,
  443. and usenet.
  444. .ip ostype
  445. Definitions describing various operating system environments
  446. (such as the location of support files).
  447. These are referenced using the
  448. .sm OSTYPE
  449. .b m4
  450. macro.
  451. .ip sh
  452. Shell files used by the
  453. .b m4
  454. build process.
  455. You shouldn't have to mess with these.
  456. .ip siteconfig
  457. Local site configuration information,
  458. such as UUCP connectivity.
  459. They normally contain lists of site information, for example:
  460. .(b
  461. SITE(contessa)
  462. SITE(hoptoad)
  463. SITE(nkainc)
  464. SITE(well)
  465. .)b
  466. They are referenced using the SITECONFIG macro:
  467. .(b
  468. SITECONFIG(site.config.file, name_of_site, X)
  469. .)b
  470. where
  471. .i X
  472. is the macro/class name to use.
  473. It can be U
  474. (indicating locally connected hosts)
  475. or one of W, X, or Y
  476. for up to three remote UUCP hubs.
  477. .pp
  478. If you are in a new domain
  479. (e.g., a company),
  480. you will probably want to create a
  481. cf/domain
  482. file for your domain.
  483. This consists primarily of relay definitions:
  484. for example, Berkeley's domain definition
  485. defines relays for
  486. BitNET,
  487. CSNET,
  488. and UUCP.
  489. Of these,
  490. only the UUCP relay is particularly specific
  491. to Berkeley.
  492. All of these are internet-style domain names.
  493. Please check to make certain they are reasonable for your domain.
  494. .pp
  495. Subdomains at Berkeley are also represented in the
  496. cf/domain
  497. directory.
  498. For example,
  499. the domain
  500. cs-exposed
  501. is the Computer Science subdomain with the local hostname shown
  502. to other users;
  503. cs-hidden
  504. makes users appear to be from the CS.Berkeley.EDU subdomain
  505. (with no local host information included).
  506. You will probably have to update this directory
  507. to be appropriate for your domain.
  508. .pp
  509. You will have to use or create
  510. .b \&.mc
  511. files in the
  512. .i cf/cf
  513. subdirectory for your hosts.
  514. This is detailed in the
  515. cf/README
  516. file.
  517. .sh 2 "Details of Installation Files"
  518. .pp
  519. This subsection describes the files that
  520. comprise the
  521. .i sendmail
  522. installation.
  523. .sh 3 "/usr/\*(SD/sendmail"
  524. .pp
  525. The binary for
  526. .i sendmail
  527. is located in /usr/\*(SD\**.
  528. .(f
  529. \**This is usually
  530. /usr/sbin
  531. on 4.4BSD and newer systems;
  532. many systems install it in
  533. /usr/lib.
  534. I understand it is in /usr/ucblib
  535. on System V Release 4.
  536. .)f
  537. It should be setuid root.
  538. For security reasons,
  539. /, /usr, and /usr/\*(SD
  540. should be owned by root, mode 755\**.
  541. .(f
  542. \**Some vendors ship them owned by bin;
  543. this creates a security hole that is not actually related to
  544. .i sendmail .
  545. Other important directories that should have restrictive ownerships
  546. and permissions are
  547. /bin, /usr/bin, /etc, /usr/etc, /lib, and /usr/lib.
  548. .)f
  549. .sh 3 "/etc/sendmail.cf"
  550. .pp
  551. This is the configuration file for
  552. .i sendmail .
  553. This is the only non-library file name compiled into
  554. .i sendmail \**.
  555. .(f
  556. \**The system libraries can reference other files;
  557. in particular, system library subroutines that
  558. .i sendmail
  559. calls probably reference
  560. .i /etc/passwd
  561. and
  562. .i /etc/resolv.conf .
  563. .)f
  564. Some older systems install it in
  565. .b /usr/lib/sendmail.cf .
  566. .pp
  567. If you want to move this file,
  568. change
  569. .i src/pathnames.h .
  570. .pp
  571. The configuration file is normally created
  572. using the distribution files described above.
  573. If you have a particularly unusual system configuration
  574. you may need to create a special version.
  575. The format of this file is detailed in later sections
  576. of this document.
  577. .sh 3 "/usr/\*(SB/newaliases"
  578. .pp
  579. The
  580. .i newaliases
  581. command should just be a link to
  582. .i sendmail :
  583. .(b
  584. rm \-f /usr/\*(SB/newaliases
  585. ln \-s /usr/\*(SD/sendmail /usr/\*(SB/newaliases
  586. .)b
  587. This can be installed in whatever search path you prefer
  588. for your system.
  589. .sh 3 "/var/spool/mqueue"
  590. .pp
  591. The directory
  592. .i /var/spool/mqueue
  593. should be created to hold the mail queue.
  594. This directory should be mode 700
  595. and owned by root.
  596. .pp
  597. The actual path of this directory
  598. is defined in the
  599. .b Q
  600. option of the
  601. .i sendmail.cf
  602. file.
  603. .sh 3 "/etc/aliases*"
  604. .pp
  605. The system aliases are held in
  606. .q /etc/aliases .
  607. A sample is given in
  608. .q lib/aliases
  609. which includes some aliases which
  610. .i must
  611. be defined:
  612. .(b
  613. cp lib/aliases /etc/aliases
  614. .i "edit /etc/aliases"
  615. .)b
  616. You should extend this file with any aliases that are apropos to your system.
  617. .pp
  618. Normally
  619. .i sendmail
  620. looks at a version of these files maintained by the
  621. .i dbm \|(3)
  622. or
  623. .i db \|(3)
  624. routines.
  625. These are stored either in
  626. .q /etc/aliases.dir
  627. and
  628. .q /etc/aliases.pag
  629. or
  630. .q /etc/aliases.db
  631. depending on which database package you are using.
  632. These can initially be created as empty files,
  633. but they will have to be initialized promptly.
  634. These should be mode 644:
  635. .(b
  636. cp /dev/null /etc/aliases.dir
  637. cp /dev/null /etc/aliases.pag
  638. chmod 644 /etc/aliases.*
  639. newaliases
  640. .)b
  641. The
  642. .i db
  643. routines preset the mode reasonably,
  644. so this step can be skipped.
  645. The actual path of this file
  646. is defined in the
  647. .b A
  648. option of the
  649. .i sendmail.cf
  650. file.
  651. .sh 3 "/etc/rc"
  652. .pp
  653. It will be necessary to start up the
  654. .i sendmail
  655. daemon when your system reboots.
  656. This daemon performs two functions:
  657. it listens on the SMTP socket for connections
  658. (to receive mail from a remote system)
  659. and it processes the queue periodically
  660. to insure that mail gets delivered when hosts come up.
  661. .pp
  662. Add the following lines to
  663. .q /etc/rc
  664. (or
  665. .q /etc/rc.local
  666. as appropriate)
  667. in the area where it is starting up the daemons:
  668. .(b
  669. if [ \-f /usr/\*(SD/sendmail \-a \-f /etc/sendmail.cf ]; then
  670.     (cd /var/spool/mqueue; rm \-f [lnx]f*)
  671.     /usr/\*(SD/sendmail \-bd \-q30m &
  672.     echo \-n ' sendmail' >/dev/console
  673. fi
  674. .)b
  675. The
  676. .q cd
  677. and
  678. .q rm
  679. commands insure that all lock files have been removed;
  680. extraneous lock files may be left around
  681. if the system goes down in the middle of processing a message.
  682. The line that actually invokes
  683. .i sendmail
  684. has two flags:
  685. .q \-bd
  686. causes it to listen on the SMTP port,
  687. and
  688. .q \-q30m
  689. causes it to run the queue every half hour.
  690. .pp
  691. Some people use a more complex startup script,
  692. removing zero length qf files and df files for which there is no qf file.
  693. For example:
  694. .(b
  695. # remove zero length qf files
  696. for qffile in qf*
  697. do
  698.     if [ \-r $qffile ]
  699.     then
  700.         if [ ! \-s $qffile ]
  701.         then
  702.             echo \-n " <zero: $qffile>" > /dev/console
  703.             rm \-f $qffile
  704.         fi
  705.     fi
  706. done
  707. # rename tf files to be qf if the qf does not exist
  708. for tffile in tf*
  709. do
  710.     qffile=`echo $tffile | sed 's/t/q/'`
  711.     if [ \-r $tffile \-a ! \-f $qffile ]
  712.     then
  713.         echo \-n " <recovering: $tffile>" > /dev/console
  714.         mv $tffile $qffile
  715.     else
  716.         echo \-n " <extra: $tffile>" > /dev/console
  717.         rm \-f $tffile
  718.     fi
  719. done
  720. # remove df files with no corresponding qf files
  721. for dffile in df*
  722. do
  723.     qffile=`echo $dffile | sed 's/d/q/'`
  724.     if [ \-r $dffile \-a ! \-f $qffile ]
  725.     then
  726.         echo \-n " <incomplete: $dffile>" > /dev/console
  727.         mv $dffile `echo $dffile | sed 's/d/D/'`
  728.     fi
  729. done
  730. # announce files that have been saved during disaster recovery
  731. for xffile in [A-Z]f*
  732. do
  733.     echo \-n " <panic: $xffile>" > /dev/console
  734. done
  735. .)b
  736. .pp
  737. If you are not running a version of UNIX
  738. that supports Berkeley TCP/IP,
  739. do not include the
  740. .b \-bd
  741. flag.
  742. .sh 3 "/usr/lib/sendmail.hf"
  743. .pp
  744. This is the help file used by the SMTP
  745. .b HELP
  746. command.
  747. It should be copied from
  748. .q lib/sendmail.hf :
  749. .(b
  750. cp lib/sendmail.hf /usr/lib
  751. .)b
  752. The actual path of this file
  753. is defined in the
  754. .b H
  755. option of the
  756. .i sendmail.cf
  757. file.
  758. .sh 3 "/etc/sendmail.st"
  759. .pp
  760. If you wish to collect statistics
  761. about your mail traffic,
  762. you should create the file
  763. .q /etc/sendmail.st :
  764. .(b
  765. cp /dev/null /etc/sendmail.st
  766. chmod 666 /etc/sendmail.st
  767. .)b
  768. This file does not grow.
  769. It is printed with the program
  770. .q mailstats/mailstats.c.
  771. The actual path of this file
  772. is defined in the
  773. .b S
  774. option of the
  775. .i sendmail.cf
  776. file.
  777. .sh 3 "/usr/\*(SB/newaliases"
  778. .pp
  779. If
  780. .i sendmail
  781. is invoked as
  782. .q newaliases,
  783. it will simulate the
  784. .b \-bi
  785. flag
  786. (i.e., will rebuild the alias database;
  787. see below).
  788. This should be a link to /usr/\*(SD/sendmail.
  789. .sh 3 "/usr/\*(SB/mailq"
  790. .pp
  791. If
  792. .i sendmail
  793. is invoked as
  794. .q mailq,
  795. it will simulate the
  796. .b \-bp
  797. flag
  798. (i.e.,
  799. .i sendmail
  800. will print the contents of the mail queue;
  801. see below).
  802. This should be a link to /usr/\*(SD/sendmail.
  803. .sh 1 "NORMAL OPERATIONS"
  804. .sh 2 "The System Log"
  805. .pp
  806. The system log is supported by the
  807. .i syslogd \|(8)
  808. program.
  809. All messages from
  810. .i sendmail
  811. are logged under the
  812. .sm LOG_MAIL
  813. facility.
  814. .sh 3 "Format"
  815. .pp
  816. Each line in the system log
  817. consists of a timestamp,
  818. the name of the machine that generated it
  819. (for logging from several machines
  820. over the local area network),
  821. the word
  822. .q sendmail: ,
  823. and a message.
  824. .sh 3 "Levels"
  825. .pp
  826. If you have
  827. .i syslogd \|(8)
  828. or an equivalent installed,
  829. you will be able to do logging.
  830. There is a large amount of information that can be logged.
  831. The log is arranged as a succession of levels.
  832. At the lowest level
  833. only extremely strange situations are logged.
  834. At the highest level,
  835. even the most mundane and uninteresting events
  836. are recorded for posterity.
  837. As a convention,
  838. log levels under ten
  839. are considered generally
  840. .q useful;
  841. log levels above 64
  842. are reserved for debugging purposes.
  843. Levels from 11\-64 are reserved for verbose information
  844. that some sites might want.
  845. .pp
  846. A complete description of the log levels
  847. is given in section 4.6.
  848. .sh 2 "The Mail Queue"
  849. .pp
  850. The mail queue should be processed transparently.
  851. However, you may find that manual intervention is sometimes necessary.
  852. For example,
  853. if a major host is down for a period of time
  854. the queue may become clogged.
  855. Although
  856. .i sendmail
  857. ought to recover gracefully when the host comes up,
  858. you may find performance unacceptably bad in the meantime.
  859. .sh 3 "Printing the queue"
  860. .pp
  861. The contents of the queue can be printed
  862. using the
  863. .i mailq
  864. command
  865. (or by specifying the
  866. .b \-bp
  867. flag to
  868. .i sendmail ):
  869. .(b
  870. mailq
  871. .)b
  872. This will produce a listing of the queue id's,
  873. the size of the message,
  874. the date the message entered the queue,
  875. and the sender and recipients.
  876. .sh 3 "Forcing the queue"
  877. .pp
  878. .i Sendmail
  879. should run the queue automatically
  880. at intervals.
  881. The algorithm is to read and sort the queue,
  882. and then to attempt to process all jobs in order.
  883. When it attempts to run the job,
  884. .i sendmail
  885. first checks to see if the job is locked.
  886. If so, it ignores the job.
  887. .pp
  888. There is no attempt to insure that only one queue processor
  889. exists at any time,
  890. since there is no guarantee that a job cannot take forever
  891. to process
  892. (however,
  893. .i sendmail
  894. does include heuristics to try to abort jobs
  895. that are taking absurd amounts of time;
  896. technically, this violates RFC 821, but is blessed by RFC 1123).
  897. Due to the locking algorithm,
  898. it is impossible for one job to freeze the entire queue.
  899. However,
  900. an uncooperative recipient host
  901. or a program recipient
  902. that never returns
  903. can accumulate many processes in your system.
  904. Unfortunately,
  905. there is no completely general way to solve this.
  906. .pp
  907. In some cases,
  908. you may find that a major host going down
  909. for a couple of days
  910. may create a prohibitively large queue.
  911. This will result in
  912. .i sendmail
  913. spending an inordinate amount of time
  914. sorting the queue.
  915. This situation can be fixed by moving the queue to a temporary place
  916. and creating a new queue.
  917. The old queue can be run later when the offending host returns to service.
  918. .pp
  919. To do this,
  920. it is acceptable to move the entire queue directory:
  921. .(b
  922. cd /var/spool
  923. mv mqueue omqueue; mkdir mqueue; chmod 700 mqueue
  924. .)b
  925. You should then kill the existing daemon
  926. (since it will still be processing in the old queue directory)
  927. and create a new daemon.
  928. .pp
  929. To run the old mail queue,
  930. run the following command:
  931. .(b
  932. /usr/\*(SD/sendmail \-oQ/var/spool/omqueue \-q
  933. .)b
  934. The
  935. .b \-oQ
  936. flag specifies an alternate queue directory
  937. and the
  938. .b \-q
  939. flag says to just run every job in the queue.
  940. If you have a tendency toward voyeurism,
  941. you can use the
  942. .b \-v
  943. flag to watch what is going on.
  944. .pp
  945. When the queue is finally emptied,
  946. you can remove the directory:
  947. .(b
  948. rmdir /var/spool/omqueue
  949. .)b
  950. .sh 2 "The Alias Database"
  951. .pp
  952. The alias database exists in two forms.
  953. One is a text form,
  954. maintained in the file
  955. .i /etc/aliases.
  956. The aliases are of the form
  957. .(b
  958. name: name1, name2, ...
  959. .)b
  960. Only local names may be aliased;
  961. e.g.,
  962. .(b
  963. eric@prep.ai.MIT.EDU: eric@CS.Berkeley.EDU
  964. .)b
  965. will not have the desired effect.
  966. Aliases may be continued by starting any continuation lines
  967. with a space or a tab.
  968. Blank lines and lines beginning with a sharp sign
  969. (\c
  970. .q # )
  971. are comments.
  972. .pp
  973. The second form is processed by the
  974. .i dbm \|(3)
  975. (or
  976. .i db \|(3))
  977. library.
  978. This form is in the files
  979. .i /etc/aliases.dir
  980. and
  981. .i /etc/aliases.pag.
  982. This is the form that
  983. .i sendmail
  984. actually uses to resolve aliases.
  985. This technique is used to improve performance.
  986. .pp
  987. You can also use
  988. .sm NIS -based
  989. alias files.
  990. For example, the specification:
  991. .(b
  992. OA/etc/aliases
  993. OAnis:mail.aliases@my.nis.domain
  994. .)b
  995. will first search the /etc/aliases file
  996. and then the map named
  997. .q mail.aliases
  998. in
  999. .q my.nis.domain .
  1000. Warning: if you build your own
  1001. .sm NIS -based
  1002. alias files,
  1003. be sure to provide the
  1004. .b \-l
  1005. flag to
  1006. .i makedbm (8)
  1007. to map upper case letters in the keys to lower case;
  1008. otherwise, aliases with upper case letters in their names
  1009. won't match incoming addresses.
  1010. .pp
  1011. Additional flags can be added after the colon
  1012. exactly like a
  1013. .b K
  1014. line \(em for example:
  1015. .(b
  1016. OAnis:-N mail.aliases@my.nis.domain
  1017. .)b
  1018. will search the appropriate NIS map and always include null bytes in the key.
  1019. .sh 3 "Rebuilding the alias database"
  1020. .pp
  1021. The DB or DBM version of the database
  1022. may be rebuilt explicitly by executing the command
  1023. .(b
  1024. newaliases
  1025. .)b
  1026. This is equivalent to giving
  1027. .i sendmail
  1028. the
  1029. .b \-bi
  1030. flag:
  1031. .(b
  1032. /usr/\*(SD/sendmail \-bi
  1033. .)b
  1034. .pp
  1035. If the
  1036. .q D
  1037. option is specified in the configuration,
  1038. .i sendmail
  1039. will rebuild the alias database automatically
  1040. if possible
  1041. when it is out of date.
  1042. Auto-rebuild can be dangerous
  1043. on heavily loaded machines
  1044. with large alias files;
  1045. if it might take more than five minutes
  1046. to rebuild the database,
  1047. there is a chance that several processes will start the rebuild process
  1048. simultaneously.
  1049. .pp
  1050. If you have multiple aliases databases specified,
  1051. the
  1052. .b \-bi
  1053. flag rebuilds all the database types it understands
  1054. (for example, it can rebuild dbm databases but not nis databases).
  1055. .sh 3 "Potential problems"
  1056. .pp
  1057. There are a number of problems that can occur
  1058. with the alias database.
  1059. They all result from a
  1060. .i sendmail
  1061. process accessing the DBM version
  1062. while it is only partially built.
  1063. This can happen under two circumstances:
  1064. One process accesses the database
  1065. while another process is rebuilding it,
  1066. or the process rebuilding the database dies
  1067. (due to being killed or a system crash)
  1068. before completing the rebuild.
  1069. .pp
  1070. Sendmail has two techniques to try to relieve these problems.
  1071. First, it ignores interrupts while rebuilding the database;
  1072. this avoids the problem of someone aborting the process
  1073. leaving a partially rebuilt database.
  1074. Second,
  1075. at the end of the rebuild
  1076. it adds an alias of the form
  1077. .(b
  1078. @: @
  1079. .)b
  1080. (which is not normally legal).
  1081. Before
  1082. .i sendmail
  1083. will access the database,
  1084. it checks to insure that this entry exists\**.
  1085. .(f
  1086. \**The
  1087. .q a
  1088. option is required in the configuration
  1089. for this action to occur.
  1090. This should normally be specified.
  1091. .)f
  1092. .sh 3 "List owners"
  1093. .pp
  1094. If an error occurs on sending to a certain address,
  1095. say
  1096. .q \fIx\fP ,
  1097. .i sendmail
  1098. will look for an alias
  1099. of the form
  1100. .q owner-\fIx\fP
  1101. to receive the errors.
  1102. This is typically useful
  1103. for a mailing list
  1104. where the submitter of the list
  1105. has no control over the maintenance of the list itself;
  1106. in this case the list maintainer would be the owner of the list.
  1107. For example:
  1108. .(b
  1109. unix-wizards: eric@ucbarpa, wnj@monet, nosuchuser,
  1110.     sam@matisse
  1111. owner-unix-wizards: eric@ucbarpa
  1112. .)b
  1113. would cause
  1114. .q eric@ucbarpa
  1115. to get the error that will occur
  1116. when someone sends to
  1117. unix-wizards
  1118. due to the inclusion of
  1119. .q nosuchuser
  1120. on the list.
  1121. .pp
  1122. List owners also cause the envelope sender address to be modified.
  1123. The contents of the owner alias are used if they point to a single user,
  1124. otherwise the name of the alias itself is used.
  1125. For this reason, and to obey Internet conventions,
  1126. a typical scheme would be:
  1127. .(b
  1128. list:    some, set, of, addresses
  1129. list-request:    list-admin-1, list-admin-2, ...
  1130. owner-list:    list-request
  1131. .)b
  1132. .sh 2 "User Information Database"
  1133. .pp
  1134. If you have a version of
  1135. .i sendmail
  1136. with the user information database
  1137. compiled in,
  1138. and you have specified one or more databases using the
  1139. .b U
  1140. option,
  1141. the databases will be searched for a
  1142. .i user :maildrop
  1143. entry.
  1144. If found, the mail will be sent to the specified address.
  1145. .pp
  1146. If the first token passed to user part of the
  1147. .q local
  1148. mailer is an at sign,
  1149. the at sign will be stripped off
  1150. and this step will be skipped.
  1151. .sh 2 "Per-User Forwarding (.forward Files)"
  1152. .pp
  1153. As an alternative to the alias database,
  1154. any user may put a file with the name
  1155. .q .forward
  1156. in his or her home directory.
  1157. If this file exists,
  1158. .i sendmail
  1159. redirects mail for that user
  1160. to the list of addresses listed in the .forward file.
  1161. For example, if the home directory for user
  1162. .q mckusick
  1163. has a .forward file with contents:
  1164. .(b
  1165. mckusick@ernie
  1166. kirk@calder
  1167. .)b
  1168. then any mail arriving for
  1169. .q mckusick
  1170. will be redirected to the specified accounts.
  1171. .pp
  1172. Actually, the configuration file defines a sequence of filenames to check.
  1173. By default, this is the user's .forward file,
  1174. but can be defined to be more generally using the
  1175. .b J
  1176. option.
  1177. If you change this,
  1178. you will have to inform your user base of the change;
  1179. \&.forward is pretty well incorporated into the collective subconscious.
  1180. .sh 2 "Special Header Lines"
  1181. .pp
  1182. Several header lines have special interpretations
  1183. defined by the configuration file.
  1184. Others have interpretations built into
  1185. .i sendmail
  1186. that cannot be changed without changing the code.
  1187. These builtins are described here.
  1188. .sh 3 "Return-Receipt-To:"
  1189. .pp
  1190. If this header is sent,
  1191. a message will be sent to any specified addresses
  1192. when the final delivery is complete,
  1193. that is,
  1194. when successfully delivered to a mailer with the
  1195. .b l
  1196. flag (local delivery) set in the mailer descriptor\**.
  1197. .(f
  1198. \**Some sites disable this header,
  1199. and other (non-\c
  1200. .i sendmail )
  1201. systems do not implement it.
  1202. Do not assume that a failure to get a return receipt
  1203. means that the mail did not arrive.
  1204. Also, do not assume that getting a return receipt
  1205. means that the mail has been read;
  1206. it just means that the message has been delivered
  1207. to the recipient's mailbox.
  1208. .)f
  1209. This header can be disabled with the
  1210. .q noreceipts
  1211. privacy flag.
  1212. .sh 3 "Errors-To:"
  1213. .pp
  1214. If errors occur anywhere during processing,
  1215. this header will cause error messages to go to
  1216. the listed addresses.
  1217. This is intended for mailing lists.
  1218. .pp
  1219. The Errors-To: header was created in the bad old days
  1220. when UUCP didn't understand the distinction between an envelope and a header;
  1221. this was a hack to provide what should now be passed
  1222. as the envelope sender address.
  1223. It should go away.
  1224. It is only used if the
  1225. .b l
  1226. option is set.
  1227. .sh 3 "Apparently-To:"
  1228. .pp
  1229. If a message comes in with no recipients listed in the message
  1230. (in a To:, Cc:, or Bcc: line)
  1231. then
  1232. .i sendmail
  1233. will add an
  1234. .q "Apparently-To:"
  1235. header line for any recipients it is aware of.
  1236. This is not put in as a standard recipient line
  1237. to warn any recipients that the list is not complete.
  1238. .pp
  1239. At least one recipient line is required under RFC 822.
  1240. .sh 2 "IDENT Protocol Support"
  1241. .pp
  1242. .i Sendmail
  1243. supports the IDENT protocol as defined in RFC 1413.
  1244. Although this enhances identification
  1245. of the author of an email message
  1246. by doing a ``call back'' to the originating system to include
  1247. the owner of a particular TCP connection
  1248. in the audit trail
  1249. it is in no sense perfect;
  1250. a determined forger can easily spoof the IDENT protocol.
  1251. The following description is excerpted from RFC 1413:
  1252. .ba +5
  1253. .lp
  1254. 6.  Security Considerations
  1255. .lp
  1256. The information returned by this protocol is at most as trustworthy
  1257. as the host providing it OR the organization operating the host.  For
  1258. example, a PC in an open lab has few if any controls on it to prevent
  1259. a user from having this protocol return any identifier the user
  1260. wants.  Likewise, if the host has been compromised the information
  1261. returned may be completely erroneous and misleading.
  1262. .lp
  1263. The Identification Protocol is not intended as an authorization or
  1264. access control protocol.  At best, it provides some additional
  1265. auditing information with respect to TCP connections.  At worst, it
  1266. can provide misleading, incorrect, or maliciously incorrect
  1267. information.
  1268. .lp
  1269. The use of the information returned by this protocol for other than
  1270. auditing is strongly discouraged.  Specifically, using Identification
  1271. Protocol information to make access control decisions - either as the
  1272. primary method (i.e., no other checks) or as an adjunct to other
  1273. methods may result in a weakening of normal host security.
  1274. .lp
  1275. An Identification server may reveal information about users,
  1276. entities, objects or processes which might normally be considered
  1277. private.  An Identification server provides service which is a rough
  1278. analog of the CallerID services provided by some phone companies and
  1279. many of the same privacy considerations and arguments that apply to
  1280. the CallerID service apply to Identification.  If you wouldn't run a
  1281. "finger" server due to privacy considerations you may not want to run
  1282. this protocol.
  1283. .ba
  1284. .sh 1 "ARGUMENTS"
  1285. .pp
  1286. The complete list of arguments to
  1287. .i sendmail
  1288. is described in detail in Appendix A.
  1289. Some important arguments are described here.
  1290. .sh 2 "Queue Interval"
  1291. .pp
  1292. The amount of time between forking a process
  1293. to run through the queue
  1294. is defined by the
  1295. .b \-q
  1296. flag.
  1297. If you run in mode
  1298. .b f
  1299. or
  1300. .b a
  1301. this can be relatively large,
  1302. since it will only be relevant
  1303. when a host that was down comes back up.
  1304. If you run in
  1305. .b q
  1306. mode
  1307. it should be relatively short,
  1308. since it defines the maximum amount of time that a message
  1309. may sit in the queue.
  1310. .pp
  1311. RFC 1123 section 5.3.1.1 says that this value should be at least 30 minutes
  1312. (although that probably doesn't make sense if you use ``queue-only'' mode).
  1313. .sh 2 "Daemon Mode"
  1314. .pp
  1315. If you allow incoming mail over an IPC connection,
  1316. you should have a daemon running.
  1317. This should be set by your
  1318. .i /etc/rc
  1319. file using the
  1320. .b \-bd
  1321. flag.
  1322. The
  1323. .b \-bd
  1324. flag and the
  1325. .b \-q
  1326. flag may be combined in one call:
  1327. .(b
  1328. /usr/\*(SD/sendmail \-bd \-q30m
  1329. .)b
  1330. .sh 2 "Forcing the Queue"
  1331. .pp
  1332. In some cases you may find that the queue has gotten clogged for some reason.
  1333. You can force a queue run
  1334. using the
  1335. .b \-q
  1336. flag (with no value).
  1337. It is entertaining to use the
  1338. .b \-v
  1339. flag (verbose)
  1340. when this is done to watch what happens:
  1341. .(b
  1342. /usr/\*(SD/sendmail \-q \-v
  1343. .)b
  1344. .pp
  1345. You can also limit the jobs to those with a particular queue identifier,
  1346. sender, or recipient
  1347. using one of the queue modifiers.
  1348. For example,
  1349. .q \-qRberkeley
  1350. restricts the queue run to jobs that have the string
  1351. .q berkeley
  1352. somewhere in one of the recipient addresses.
  1353. Similarly,
  1354. .q \-qSstring
  1355. limits the run to particular senders and
  1356. .q \-qIstring
  1357. limits it to particular identifiers.
  1358. .sh 2 "Debugging"
  1359. .pp
  1360. There are a fairly large number of debug flags
  1361. built into
  1362. .i sendmail .
  1363. Each debug flag has a number and a level,
  1364. where higher levels means to print out more information.
  1365. The convention is that levels greater than nine are
  1366. .q absurd,
  1367. i.e.,
  1368. they print out so much information that you wouldn't normally
  1369. want to see them except for debugging that particular piece of code.
  1370. Debug flags are set using the
  1371. .b \-d
  1372. option;
  1373. the syntax is:
  1374. .(b
  1375. .ta \w'debug-option  'u
  1376. debug-flag:    \fB\-d\fP debug-list
  1377. debug-list:    debug-option [ , debug-option ]
  1378. debug-option:    debug-range [ . debug-level ]
  1379. debug-range:    integer | integer \- integer
  1380. debug-level:    integer
  1381. .)b
  1382. where spaces are for reading ease only.
  1383. For example,
  1384. .(b
  1385. \-d12    Set flag 12 to level 1
  1386. \-d12.3    Set flag 12 to level 3
  1387. \-d3-17    Set flags 3 through 17 to level 1
  1388. \-d3-17.4    Set flags 3 through 17 to level 4
  1389. .)b
  1390. For a complete list of the available debug flags
  1391. you will have to look at the code
  1392. (they are too dynamic to keep this documentation up to date).
  1393. .sh 2 "Trying a Different Configuration File"
  1394. .pp
  1395. An alternative configuration file
  1396. can be specified using the
  1397. .b \-C
  1398. flag; for example,
  1399. .(b
  1400. /usr/\*(SD/sendmail \-Ctest.cf
  1401. .)b
  1402. uses the configuration file
  1403. .i test.cf
  1404. instead of the default
  1405. .i /etc/sendmail.cf.
  1406. If the
  1407. .b \-C
  1408. flag has no value
  1409. it defaults to
  1410. .i sendmail.cf
  1411. in the current directory.
  1412. .sh 2 "Changing the Values of Options"
  1413. .pp
  1414. Options can be overridden using the
  1415. .b \-o
  1416. flag.
  1417. For example,
  1418. .(b
  1419. /usr/\*(SD/sendmail \-oT2m
  1420. .)b
  1421. sets the
  1422. .b T
  1423. (timeout) option to two minutes
  1424. for this run only.
  1425. .pp
  1426. Some options have security implications.
  1427. Sendmail allows you to set these,
  1428. but refuses to run as root thereafter.
  1429. .sh 2 "Logging Traffic"
  1430. .pp
  1431. Many SMTP implementations do not fully implement the protocol.
  1432. For example, some personal computer based SMTPs
  1433. do not understand continuation lines in reply codes.
  1434. These can be very hard to trace.
  1435. If you suspect such a problem, you can set traffic logging using the
  1436. .b \-X
  1437. flag.
  1438. For example,
  1439. .(b
  1440. /usr/\*(SD/sendmail \-X /tmp/traffic -bd
  1441. .)b
  1442. will log all traffic in the file
  1443. .i /tmp/traffic .
  1444. .pp
  1445. This logs a lot of data very quickly and should never be used
  1446. during normal operations.
  1447. After starting up such a daemon,
  1448. force the errant implementation to send a message to your host.
  1449. All message traffic in and out of
  1450. .i sendmail ,
  1451. including the incoming SMTP traffic,
  1452. will be logged in this file.
  1453. .sh 2 "Dumping State"
  1454. .pp
  1455. You can ask
  1456. .i sendmail
  1457. to log a dump of the open files
  1458. and the connection cache
  1459. by sending it a
  1460. .sm SIGUSR1
  1461. signal.
  1462. The results are logged at
  1463. .sm LOG_DEBUG
  1464. priority.
  1465. .sh 1 "TUNING"
  1466. .pp
  1467. There are a number of configuration parameters
  1468. you may want to change,
  1469. depending on the requirements of your site.
  1470. Most of these are set
  1471. using an option in the configuration file.
  1472. For example,
  1473. the line
  1474. .q OT5d
  1475. sets option
  1476. .q T
  1477. to the value
  1478. .q 5d
  1479. (five days).
  1480. .pp
  1481. Most of these options have appropriate defaults for most sites.
  1482. However,
  1483. sites having very high mail loads may find they need to tune them
  1484. as appropriate for their mail load.
  1485. In particular,
  1486. sites experiencing a large number of small messages,
  1487. many of which are delivered to many recipients,
  1488. may find that they need to adjust the parameters
  1489. dealing with queue priorities.
  1490. .sh 2 "Timeouts"
  1491. .pp
  1492. All time intervals are set
  1493. using a scaled syntax.
  1494. For example,
  1495. .q 10m
  1496. represents ten minutes, whereas
  1497. .q 2h30m
  1498. represents two and a half hours.
  1499. The full set of scales is:
  1500. .(b
  1501. .ta 4n
  1502. s    seconds
  1503. m    minutes
  1504. h    hours
  1505. d    days
  1506. w    weeks
  1507. .)b
  1508. .sh 3 "Queue interval"
  1509. .pp
  1510. The argument to the
  1511. .b \-q
  1512. flag
  1513. specifies how often a sub-daemon will run the queue.
  1514. This is typically set to between fifteen minutes
  1515. and one hour.
  1516. RFC 1123 section 5.3.1.1 recommends that this be at least 30 minutes.
  1517. .sh 3 "Read timeouts"
  1518. .pp
  1519. It is possible to time out when reading the standard input
  1520. or when reading from a remote SMTP server.
  1521. These timeouts are set using the
  1522. .b r
  1523. option in the configuration file.
  1524. The argument is a list of
  1525. .i keyword=value
  1526. pairs.
  1527. The recognized keywords, their default values, and the minimum values
  1528. allowed by RFC 1123 section 5.3.2 are:
  1529. .nr ii 1i
  1530. .ip initial
  1531. The wait for the initial 220 greeting message
  1532. [5m, 5m].
  1533. .ip helo
  1534. The wait for a reply from a HELO or EHLO command
  1535. [5m, unspecified].
  1536. This may require a host name lookup, so
  1537. five minutes is probably a reasonable minimum.
  1538. .ip mail\(dg
  1539. The wait for a reply from a MAIL command
  1540. [10m, 5m].
  1541. .ip rcpt\(dg
  1542. The wait for a reply from a RCPT command
  1543. [1h, 5m].
  1544. This should be long
  1545. because it could be pointing at a list
  1546. that takes a long time to expand.
  1547. .ip datainit\(dg
  1548. The wait for a reply from a DATA command
  1549. [5m, 2m].
  1550. .ip datablock\(dg
  1551. The wait for reading a data block
  1552. (that is, the body of the message).
  1553. [1h, 3m].
  1554. This should be long because it also applies to programs
  1555. piping input to
  1556. .i sendmail
  1557. which have no guarantee of promptness.
  1558. .ip datafinal\(dg
  1559. The wait for a reply from the dot terminating a message.
  1560. [1h, 10m].
  1561. If this is shorter than the time actually needed
  1562. for the receiver to deliver the message,
  1563. duplicates will be generated.
  1564. This is discussed in RFC 1047.
  1565. .ip rset
  1566. The wait for a reply from a RSET command
  1567. [5m, unspecified].
  1568. .ip quit
  1569. The wait for a reply from a QUIT command
  1570. [2m, unspecified].
  1571. .ip misc
  1572. The wait for a reply from miscellaneous (but short) commands
  1573. such as NOOP (no-operation) and VERB (go into verbose mode).
  1574. [2m, unspecified].
  1575. .ip command\(dg
  1576. In server SMTP,
  1577. the time to wait for another command.
  1578. [1h, 5m].
  1579. .ip ident
  1580. The timeout waiting for a reply to an IDENT query
  1581. [30s, unspecified].
  1582. .lp
  1583. For compatibility with old configuration files,
  1584. if no ``keyword='' is specified,
  1585. all the timeouts marked with \(dg are set to the indicated value.
  1586. .pp
  1587. Many of the RFC 1123 minimum values
  1588. may well be too short.
  1589. .i Sendmail
  1590. was designed to the RFC 822 protocols,
  1591. which did not specify read timeouts;
  1592. hence,
  1593. .i sendmail
  1594. does not guarantee to reply to messages promptly.
  1595. In particular, a
  1596. .q RCPT
  1597. command specifying a mailing list
  1598. will expand and verify the entire list;
  1599. a large list on a slow system
  1600. may take more than five minutes\**.
  1601. .(f
  1602. \**This verification includes looking up every address
  1603. with the name server;
  1604. this involves network delays,
  1605. and can in some cases can be considerable.
  1606. .)f
  1607. I recommend a one hour timeout \*-
  1608. since this failure is rare,
  1609. a long timeout is not onerous
  1610. and may ultimately help reduce network load.
  1611. .pp
  1612. For example, the line:
  1613. .(b
  1614. Orcommand=25m,datablock=3h
  1615. .)b
  1616. sets the server SMTP command timeout to 25 minutes
  1617. and the input data block timeout to three hours.
  1618. .sh 3 "Message timeouts"
  1619. .pp
  1620. After sitting in the queue for a few days,
  1621. a message will time out.
  1622. This is to insure that at least the sender is aware
  1623. of the inability to send a message.
  1624. The timeout is typically set to three days.
  1625. This timeout is set using the
  1626. .b T
  1627. option in the configuration file.
  1628. .pp
  1629. The time of submission is set in the queue,
  1630. rather than the amount of time left until timeout.
  1631. As a result, you can flush messages that have been hanging
  1632. for a short period
  1633. by running the queue
  1634. with a short message timeout.
  1635. For example,
  1636. .(b
  1637. /usr/\*(SD/sendmail \-oT1d \-q
  1638. .)b
  1639. will run the queue
  1640. and flush anything that is one day old.
  1641. .pp
  1642. Since this option is global,
  1643. and since you can not
  1644. .i "a priori"
  1645. know how long another host outside your domain will be down,
  1646. a five day timeout is recommended.
  1647. This allows a recipient to fix the problem even if it occurs
  1648. at the beginning of a long weekend.
  1649. RFC 1123 section 5.3.1.1 says that this parameter
  1650. should be ``at least 4\-5 days''.
  1651. .pp
  1652. The
  1653. .b T
  1654. option can also take a second timeout indicating a time after which
  1655. a warning message should be sent;
  1656. the two timeouts are separated by a slash.
  1657. For example, the value
  1658. .(b
  1659. 5d/4h
  1660. .)b
  1661. causes email to fail after five days,
  1662. but a warning message will be sent after four hours.
  1663. This should be large enough that the message will have been tried
  1664. several times.
  1665. .sh 2 "Forking During Queue Runs"
  1666. .pp
  1667. By setting the
  1668. .b Y
  1669. option,
  1670. .i sendmail
  1671. will fork before each individual message
  1672. while running the queue.
  1673. This will prevent
  1674. .i sendmail
  1675. from consuming large amounts of memory,
  1676. so it may be useful in memory-poor environments.
  1677. However, if the
  1678. .b Y
  1679. option is not set,
  1680. .i sendmail
  1681. will keep track of hosts that are down during a queue run,
  1682. which can improve performance dramatically.
  1683. .pp
  1684. If the
  1685. .b Y
  1686. option is set,
  1687. .i sendmail
  1688. can not use connection caching.
  1689. .sh 2 "Queue Priorities"
  1690. .pp
  1691. Every message is assigned a priority when it is first instantiated,
  1692. consisting of the message size (in bytes)
  1693. offset by the message class times the
  1694. .q "work class factor"
  1695. and the number of recipients times the
  1696. .q "work recipient factor."
  1697. The priority is used to order the queue.
  1698. Higher numbers for the priority mean that the message will be processed later
  1699. when running the queue.
  1700. .pp
  1701. The message size is included so that large messages are penalized
  1702. relative to small messages.
  1703. The message class allows users to send
  1704. .q "high priority"
  1705. messages by including a
  1706. .q Precedence:
  1707. field in their message;
  1708. the value of this field is looked up in the
  1709. .b P
  1710. lines of the configuration file.
  1711. Since the number of recipients affects the amount of load a message presents
  1712. to the system,
  1713. this is also included into the priority.
  1714. .pp
  1715. The recipient and class factors
  1716. can be set in the configuration file using the
  1717. .b y
  1718. and
  1719. .b z
  1720. options respectively.
  1721. They default to 30000 (for the recipient factor)
  1722. and 1800
  1723. (for the class factor).
  1724. The initial priority is:
  1725. .EQ
  1726. pri = msgsize - (class times bold z) + (nrcpt times bold y)
  1727. .EN
  1728. (Remember, higher values for this parameter actually mean
  1729. that the job will be treated with lower priority.)
  1730. .pp
  1731. The priority of a job can also be adjusted each time it is processed
  1732. (that is, each time an attempt is made to deliver it)
  1733. using the
  1734. .q "work time factor,"
  1735. set by the
  1736. .b Z
  1737. option.
  1738. This is added to the priority,
  1739. so it normally decreases the precedence of the job,
  1740. on the grounds that jobs that have failed many times
  1741. will tend to fail again in the future.
  1742. The
  1743. .b Z
  1744. option defaults to 90000.
  1745. .sh 2 "Load Limiting"
  1746. .pp
  1747. .i Sendmail
  1748. can be asked to queue (but not deliver)
  1749. mail if the system load average gets too high
  1750. using the
  1751. .b x
  1752. option.
  1753. When the load average exceeds the value of the
  1754. .b x
  1755. option,
  1756. the delivery mode is set to
  1757. .b q
  1758. (queue only)
  1759. if the
  1760. .i "Queue Factor"
  1761. (\c
  1762. .b q
  1763. option)
  1764. divided by the difference in the current load average and the
  1765. .b x
  1766. option
  1767. plus one
  1768. exceeds the priority of the message \(em
  1769. that is, the message is queued iff:
  1770. .EQ
  1771. pri > { bold q } over { LA - { bold x } + 1 }
  1772. .EN
  1773. The
  1774. .b q
  1775. option defaults to 600000,
  1776. so each point of load average is worth 600000
  1777. priority points
  1778. (as described above).
  1779. .pp
  1780. For drastic cases,
  1781. the
  1782. .b X
  1783. option defines a load average at which
  1784. .i sendmail
  1785. will refuse
  1786. to accept network connections.
  1787. Locally generated mail
  1788. (including incoming UUCP mail)
  1789. is still accepted.
  1790. .sh 2 "Delivery Mode"
  1791. .pp
  1792. There are a number of delivery modes that
  1793. .i sendmail
  1794. can operate in,
  1795. set by the
  1796. .q d
  1797. configuration option.
  1798. These modes
  1799. specify how quickly mail will be delivered.
  1800. Legal modes are:
  1801. .(b
  1802. .ta 4n
  1803. i    deliver interactively (synchronously)
  1804. b    deliver in background (asynchronously)
  1805. q    queue only (don't deliver)
  1806. .)b
  1807. There are tradeoffs.
  1808. Mode
  1809. .q i
  1810. passes the maximum amount of information to the sender,
  1811. but is hardly ever necessary.
  1812. Mode
  1813. .q q
  1814. puts the minimum load on your machine,
  1815. but means that delivery may be delayed for up to the queue interval.
  1816. Mode
  1817. .q b
  1818. is probably a good compromise.
  1819. However, this mode can cause large numbers of processes
  1820. if you have a mailer that takes a long time to deliver a message.
  1821. .pp
  1822. If you run in mode
  1823. .q q
  1824. (queue only)
  1825. or
  1826. .q b
  1827. (deliver in background)
  1828. .i sendmail
  1829. will not expand aliases and follow .forward files
  1830. upon initial receipt of the mail.
  1831. This speeds up the response to RCPT commands.
  1832. .sh 2 "Log Level"
  1833. .pp
  1834. The level of logging can be set for
  1835. .i sendmail .
  1836. The default using a standard configuration table is level 9.
  1837. The levels are as follows:
  1838. .nr ii 0.5i
  1839. .ip 0
  1840. No logging.
  1841. .ip 1
  1842. Serious system failures and potential security problems.
  1843. .ip 2
  1844. Lost communications (network problems) and protocol failures.
  1845. .ip 3
  1846. Other serious failures.
  1847. .ip 4
  1848. Minor failures.
  1849. .ip 5
  1850. Message collection statistics.
  1851. .ip 6
  1852. Creation of error messages,
  1853. VRFY and EXPN commands.
  1854. .ip 7
  1855. Delivery failures (host or user unknown, etc.).
  1856. .ip 8
  1857. Successful deliveries.
  1858. .ip 9
  1859. Messages being deferred
  1860. (due to a host being down, etc.).
  1861. .ip 10
  1862. Database expansion (alias, forward, and userdb lookups).
  1863. .ip 15
  1864. Automatic alias database rebuilds.
  1865. .ip 20
  1866. Logs attempts to run locked queue files.
  1867. These are not errors,
  1868. but can be useful to note if your queue appears to be clogged.
  1869. .ip 30
  1870. Lost locks (only if using lockf instead of flock).
  1871. .lp
  1872. Additionally,
  1873. values above 64 are reserved for extremely verbose debuggging output.
  1874. No normal site would ever set these.
  1875. .sh 2 "File Modes"
  1876. .pp
  1877. There are a number of files
  1878. that may have a number of modes.
  1879. The modes depend on what functionality you want
  1880. and the level of security you require.
  1881. .sh 3 "To suid or not to suid?"
  1882. .pp
  1883. .i Sendmail
  1884. can safely be made
  1885. setuid to root.
  1886. At the point where it is about to
  1887. .i exec \|(2)
  1888. a mailer,
  1889. it checks to see if the userid is zero;
  1890. if so,
  1891. it resets the userid and groupid to a default
  1892. (set by the
  1893. .b u
  1894. and
  1895. .b g
  1896. options).
  1897. (This can be overridden
  1898. by setting the
  1899. .b S
  1900. flag to the mailer
  1901. for mailers that are trusted
  1902. and must be called as root.)
  1903. However,
  1904. this will cause mail processing
  1905. to be accounted
  1906. (using
  1907. .i sa \|(8))
  1908. to root
  1909. rather than to the user sending the mail.
  1910. .sh 3 "Should my alias database be writable?"
  1911. .pp
  1912. At Berkeley
  1913. we have the alias database
  1914. (/etc/aliases*)
  1915. mode 644.
  1916. While this is not as flexible as if the database
  1917. were more 666, it avoids potential security problems
  1918. with a globally writable database.
  1919. .pp
  1920. The database that
  1921. .i sendmail
  1922. actually used
  1923. is represented by the two files
  1924. .i aliases.dir
  1925. and
  1926. .i aliases.pag
  1927. (both in /etc)
  1928. (or
  1929. .i aliases.db
  1930. if you are running with the new Berkeley database primitives).
  1931. The mode on these files should match the mode
  1932. on /etc/aliases.
  1933. If
  1934. .i aliases
  1935. is writable
  1936. and the
  1937. DBM
  1938. files
  1939. (\c
  1940. .i aliases.dir
  1941. and
  1942. .i aliases.pag )
  1943. are not,
  1944. users will be unable to reflect their desired changes
  1945. through to the actual database.
  1946. However,
  1947. if
  1948. .i aliases
  1949. is read-only
  1950. and the DBM files are writable,
  1951. a slightly sophisticated user
  1952. can arrange to steal mail anyway.
  1953. .pp
  1954. If your DBM files are not writable by the world
  1955. or you do not have auto-rebuild enabled
  1956. (with the
  1957. .q D
  1958. option),
  1959. then you must be careful to reconstruct the alias database
  1960. each time you change the text version:
  1961. .(b
  1962. newaliases
  1963. .)b
  1964. If this step is ignored or forgotten
  1965. any intended changes will also be ignored or forgotten.
  1966. .sh 2 "Connection Caching"
  1967. .pp
  1968. When processing the queue,
  1969. .i sendmail
  1970. will try to keep the last few open connections open
  1971. to avoid startup and shutdown costs.
  1972. This only applies to IPC connections.
  1973. .pp
  1974. When trying to open a connection
  1975. the cache is first searched.
  1976. If an open connection is found, it is probed to see if it is still active
  1977. by sending a
  1978. .sm NOOP
  1979. command.
  1980. It is not an error if this fails;
  1981. instead, the connection is closed and reopened.
  1982. .pp
  1983. Two parameters control the connection cache.
  1984. The
  1985. .b k
  1986. option defines the number of simultaneous open connections
  1987. that will be permitted.
  1988. If it is set to zero,
  1989. connections will be closed as quickly as possible.
  1990. The default is one.
  1991. This should be set as appropriate for your system size;
  1992. it will limit the amount of system resources that
  1993. .i sendmail
  1994. will use during queue runs.
  1995. .pp
  1996. The
  1997. .b K
  1998. option specifies the maximum time that any cached connection
  1999. will be permitted to idle.
  2000. When the idle time exceeds this value
  2001. the connection is closed.
  2002. This number should be small
  2003. (under ten minutes)
  2004. to prevent you from grabbing too many resources
  2005. from other hosts.
  2006. The default is five minutes.
  2007. .sh 2 "Name Server Access"
  2008. .pp
  2009. If your system supports the name server,
  2010. then the probability is that
  2011. .i sendmail
  2012. will be using it regardless of how you configure
  2013. .i sendmail .
  2014. In particular, the system routine
  2015. .i gethostbyname (3)
  2016. is used to look up host names,
  2017. and most vendor versions try some combination of DNS, NIS,
  2018. and file lookup in /etc/hosts.
  2019. .pp
  2020. However, if you do not have a nameserver configured at all,
  2021. such as at a UUCP-only site,
  2022. .i sendmail
  2023. will get a
  2024. .q "connection refused"
  2025. message when it tries to connect to the name server
  2026. (either indirectly by calling
  2027. .i gethostbyname
  2028. or directly by looking up MX records).
  2029. If the
  2030. .b I
  2031. option is set,
  2032. .i sendmail
  2033. will interpret this to mean a temporary failure
  2034. and will queue the mail for later processing;
  2035. otherwise, it ignores the name server data.
  2036. If your name server is running properly,
  2037. the setting of this option is not relevant;
  2038. however, it is important that it be set properly
  2039. to make error handling work properly.
  2040. .pp
  2041. This option also allows you to tweak name server options.
  2042. The command line takes a series of flags as documented in
  2043. .i resolver (3)
  2044. (with the leading
  2045. .q RES_
  2046. deleted).
  2047. Each can be preceded by an optional `+' or `\(mi'.
  2048. For example, the line
  2049. .(b
  2050. OITrue +AAONLY \(miDNSRCH
  2051. .)b
  2052. turns on the AAONLY (accept authoritative answers only)
  2053. and turns off the DNSRCH (search the domain path) options.
  2054. Most resolver libraries default DNSRCH, DEFNAMES, and RECURSE
  2055. flags on and all others off.
  2056. Note the use of the initial ``True'' \*-
  2057. this is for compatibility with previous versions of
  2058. .i sendmail ,
  2059. but is not otherwise necessary.
  2060. .pp
  2061. Version level 1 configurations
  2062. turn DNSRCH and DEFNAMES off when doing delivery lookups,
  2063. but leave them on everywhere else.
  2064. Version 8 of
  2065. .i sendmail
  2066. ignores them when doing canonification lookups
  2067. (that is, when using $[ ... $]),
  2068. and always does the search.
  2069. If you don't want to do automatic name extension,
  2070. don't call $[ ... $].
  2071. .pp
  2072. The search rules for $[ ... $] are somewhat different than usual.
  2073. If the name (that is, the ``...'')
  2074. has at least one dot, it always tries the unmodified name first.
  2075. If that fails, it tries the reduced search path,
  2076. and lastly tries the unmodified name
  2077. (but only for names without a dot,
  2078. since names with a dot have already been tried).
  2079. This allows names such as
  2080. ``utc.CS''
  2081. to match the site in Czechoslovakia
  2082. rather than the site in your local Computer Science department.
  2083. It also prefers A and CNAME records over MX records \*-
  2084. that is, if it finds an MX record it makes note of it,
  2085. but keeps looking.
  2086. This way, if you have a wildcard MX record matching your domain,
  2087. it will not assume that all names match.
  2088. .sh 2 "Moving the Per-User Forward Files"
  2089. .pp
  2090. Some sites mount each user's home directory
  2091. from a local disk on their workstation,
  2092. so that local access is fast.
  2093. However, the result is that .forward file lookups are slow.
  2094. In some cases,
  2095. mail can even be delivered on machines inappropriately
  2096. because of a file server being down.
  2097. The performance can be especially bad if you run the automounter.
  2098. .pp
  2099. The
  2100. .b J
  2101. option allows you to set a path of forward files.
  2102. For example, the config file line
  2103. .(b
  2104. OJ/var/forward/$u:$z/.forward
  2105. .)b
  2106. would first look for a file with the same name as the user's login
  2107. in /var/forward;
  2108. if that is not found (or is inaccessible)
  2109. the file
  2110. .q \&.forward
  2111. in the user's home directory is searched.
  2112. A truly perverse site could also search by sender
  2113. by using $r, $s, or $f.
  2114. .pp
  2115. If you create a directory such as /var/forward,
  2116. it should be mode 1777
  2117. (that is, the sticky bit should be set).
  2118. Users should create the files mode 644.
  2119. .sh 2 "Free Space"
  2120. .pp
  2121. On systems that have the
  2122. .i statfs (2)
  2123. system call,
  2124. you can specify a minimum number of free blocks on the queue filesystem
  2125. using the
  2126. .b b
  2127. option.
  2128. If there are fewer than the indicated number of blocks free
  2129. on the filesystem on which the queue is mounted
  2130. the SMTP server will reject mail
  2131. with the
  2132. 452 error code.
  2133. This invites the SMTP client to try again later.
  2134. .pp
  2135. Beware of setting this option too high;
  2136. it can cause rejection of email
  2137. when that mail would be processed without difficulty.
  2138. .pp
  2139. This option can also specify an advertised
  2140. .q "maximum message size"
  2141. for hosts that speak ESMTP.
  2142. .sh 2 "Privacy Flags"
  2143. .pp
  2144. The
  2145. .b p
  2146. option allows you to set certain
  2147. ``privacy''
  2148. flags.
  2149. Actually, many of them don't give you any extra privacy,
  2150. rather just insisting that client SMTP servers
  2151. use the HELO command
  2152. before using certain commands.
  2153. .pp
  2154. The option takes a series of flag names;
  2155. the final privacy is the inclusive or of those flags.
  2156. For example:
  2157. .(b
  2158. Op needmailhelo, noexpn
  2159. .)b
  2160. insists that the HELO or EHLO command be used before a MAIL command is accepted
  2161. and disables the EXPN command.
  2162. .pp
  2163. The
  2164. .q restrictmailq
  2165. option restricts printing the queue to the group that owns the queue directory.
  2166. It is absurd to set this if you don't also protect the logs.
  2167. .pp
  2168. The
  2169. .q restrictqrun
  2170. option restricts people running the queue
  2171. (that is, using the
  2172. .b \-q
  2173. command line flag)
  2174. to root and the owner of the queue directory.
  2175. .sh 2 "Send to Me Too"
  2176. .pp
  2177. Normally,
  2178. .i sendmail
  2179. deletes the (envelope) sender from any list expansions.
  2180. For example, if
  2181. .q matt
  2182. sends to a list that contains
  2183. .q matt
  2184. as one of the members he won't get a copy of the message.
  2185. If the
  2186. .b \-m
  2187. (me too)
  2188. command line flag, or if the
  2189. .b m
  2190. option is set in the configuration file,
  2191. this behaviour is supressed.
  2192. Some sites like to run the
  2193. .sm SMTP
  2194. daemon with
  2195. .b \-m .
  2196. .sh 1 "THE WHOLE SCOOP ON THE CONFIGURATION FILE"
  2197. .pp
  2198. This section describes the configuration file
  2199. in detail,
  2200. including hints on how to write one of your own
  2201. if you have to.
  2202. .pp
  2203. There is one point that should be made clear immediately:
  2204. the syntax of the configuration file
  2205. is designed to be reasonably easy to parse,
  2206. since this is done every time
  2207. .i sendmail
  2208. starts up,
  2209. rather than easy for a human to read or write.
  2210. On the
  2211. .q "future project"
  2212. list is a
  2213. configuration-file compiler.
  2214. .pp
  2215. An overview of the configuration file
  2216. is given first,
  2217. followed by details of the semantics.
  2218. .sh 2 "Configuration File Lines"
  2219. .pp
  2220. The configuration file is organized as a series of lines,
  2221. each of which begins with a single character
  2222. defining the semantics for the rest of the line.
  2223. Lines beginning with a space or a tab
  2224. are continuation lines
  2225. (although the semantics are not well defined in many places).
  2226. Blank lines and lines beginning with a sharp symbol
  2227. (`#')
  2228. are comments.
  2229. .sh 3 "R and S \*- rewriting rules"
  2230. .pp
  2231. The core of address parsing
  2232. are the rewriting rules.
  2233. These are an ordered production system.
  2234. .i Sendmail
  2235. scans through the set of rewriting rules
  2236. looking for a match on the left hand side
  2237. (LHS)
  2238. of the rule.
  2239. When a rule matches,
  2240. the address is replaced by the right hand side
  2241. (RHS)
  2242. of the rule.
  2243. .pp
  2244. There are several sets of rewriting rules.
  2245. Some of the rewriting sets are used internally
  2246. and must have specific semantics.
  2247. Other rewriting sets
  2248. do not have specifically assigned semantics,
  2249. and may be referenced by the mailer definitions
  2250. or by other rewriting sets.
  2251. .pp
  2252. The syntax of these two commands are:
  2253. .(b F
  2254. .b S \c
  2255. .i n
  2256. .)b
  2257. Sets the current ruleset being collected to
  2258. .i n .
  2259. If you begin a ruleset more than once
  2260. it deletes the old definition.
  2261. .(b F
  2262. .b R \c
  2263. .i lhs
  2264. .i rhs
  2265. .i comments
  2266. .)b
  2267. The
  2268. fields must be separated
  2269. by at least one tab character;
  2270. there may be embedded spaces
  2271. in the fields.
  2272. The
  2273. .i lhs
  2274. is a pattern that is applied to the input.
  2275. If it matches,
  2276. the input is rewritten to the
  2277. .i rhs .
  2278. The
  2279. .i comments
  2280. are ignored.
  2281. .pp
  2282. Macro expansions of the form
  2283. .b $ \c
  2284. .i x
  2285. are performed when the configuration file is read.
  2286. Expansions of the form
  2287. .b $& \c
  2288. .i x
  2289. are performed at run time using a somewhat less general algorithm.
  2290. This for is intended only for referencing internally defined macros
  2291. such as
  2292. .b $h
  2293. that are changed at runtime.
  2294. .sh 4 "The left hand side"
  2295. .pp
  2296. The left hand side of rewriting rules contains a pattern.
  2297. Normal words are simply matched directly.
  2298. Metasyntax is introduced using a dollar sign.
  2299. The metasymbols are:
  2300. .(b
  2301. .ta \w'\fB$=\fP\fIx\fP  'u
  2302. \fB$*\fP    Match zero or more tokens
  2303. \fB$+\fP    Match one or more tokens
  2304. \fB$\-\fP    Match exactly one token
  2305. \fB$=\fP\fIx\fP    Match any phrase in class \fIx\fP
  2306. \fB$~\fP\fIx\fP    Match any word not in class \fIx\fP
  2307. .)b
  2308. If any of these match,
  2309. they are assigned to the symbol
  2310. .b $ \c
  2311. .i n
  2312. for replacement on the right hand side,
  2313. where
  2314. .i n
  2315. is the index in the LHS.
  2316. For example,
  2317. if the LHS:
  2318. .(b
  2319. $\-:$+
  2320. .)b
  2321. is applied to the input:
  2322. .(b
  2323. UCBARPA:eric
  2324. .)b
  2325. the rule will match, and the values passed to the RHS will be:
  2326. .(b
  2327. .ta 4n
  2328. $1    UCBARPA
  2329. $2    eric
  2330. .)b
  2331. .pp
  2332. Additionally, the LHS can include
  2333. .b $@
  2334. to match zero tokens.
  2335. This is
  2336. .i not
  2337. bound to a
  2338. .b $ \c
  2339. .i N
  2340. on the RHS, and is normally only used when it stands alone
  2341. in order to match the null input.
  2342. .sh 4 "The right hand side"
  2343. .pp
  2344. When the left hand side of a rewriting rule matches,
  2345. the input is deleted and replaced by the right hand side.
  2346. Tokens are copied directly from the RHS
  2347. unless they begin with a dollar sign.
  2348. Metasymbols are:
  2349. .(b
  2350. .ta \w'$#mailer\0\0\0'u
  2351. \fB$\fP\fIn\fP    Substitute indefinite token \fIn\fP from LHS
  2352. \fB$[\fP\fIname\fP\fB$]\fP    Canonicalize \fIname\fP
  2353. \fB$(\fP\fImap key\fP \fB$@\fP\fIarguments\fP \fB$:\fP\fIdefault\fP \fB$)\fP
  2354.     Generalized keyed mapping function
  2355. \fB$>\fP\fIn\fP    \*(lqCall\*(rq ruleset \fIn\fP
  2356. \fB$#\fP\fImailer\fP    Resolve to \fImailer\fP
  2357. \fB$@\fP\fIhost\fP    Specify \fIhost\fP
  2358. \fB$:\fP\fIuser\fP    Specify \fIuser\fP
  2359. .)b
  2360. .pp
  2361. The
  2362. .b $ \c
  2363. .i n
  2364. syntax substitutes the corresponding value from a
  2365. .b $+ ,
  2366. .b $\- ,
  2367. .b $* ,
  2368. .b $= ,
  2369. or
  2370. .b $~
  2371. match on the LHS.
  2372. It may be used anywhere.
  2373. .pp
  2374. A host name enclosed between
  2375. .b $[
  2376. and
  2377. .b $]
  2378. is looked up using the
  2379. .i gethostent \|(3)
  2380. routines and replaced by the canonical name\**.
  2381. .(f
  2382. \**This is actually
  2383. completely equivalent
  2384. to $(host \fIhostname\fP$).
  2385. In particular, a
  2386. .b $:
  2387. default can be used.
  2388. .)f
  2389. For example,
  2390. .q $[csam$]
  2391. might become
  2392. .q lbl-csam.arpa
  2393. and
  2394. .q $[[128.32.130.2]$]
  2395. would become
  2396. .q vangogh.CS.Berkeley.EDU.
  2397. .i Sendmail
  2398. recognizes it's numeric IP address
  2399. without calling the name server
  2400. and replaces it with it's canonical name.
  2401. .pp
  2402. The
  2403. .b $(
  2404. \&...
  2405. .b $)
  2406. syntax is a more general form of lookup;
  2407. it uses a named map instead of an implicit map.
  2408. If no lookup is found, the indicated
  2409. .i default
  2410. is inserted;
  2411. if no default is specified and no lookup matches,
  2412. the value is left unchanged.
  2413. .pp
  2414. The
  2415. .b $> \c
  2416. .i n
  2417. syntax
  2418. causes the remainder of the line to be substituted as usual
  2419. and then passed as the argument to ruleset
  2420. .i n .
  2421. The final value of ruleset
  2422. .i n
  2423. then becomes
  2424. the substitution for this rule.
  2425. .pp
  2426. The
  2427. .b $#
  2428. syntax should
  2429. .i only
  2430. be used in ruleset zero
  2431. or a subroutine of ruleset zero.
  2432. It causes evaluation of the ruleset to terminate immediately,
  2433. and signals to
  2434. .i sendmail
  2435. that the address has completely resolved.
  2436. The complete syntax is:
  2437. .(b
  2438. \fB$#\fP\fImailer\fP \fB$@\fP\fIhost\fP \fB$:\fP\fIuser\fP
  2439. .)b
  2440. This specifies the
  2441. {mailer, host, user}
  2442. 3-tuple necessary to direct the mailer.
  2443. If the mailer is local
  2444. the host part may be omitted\**.
  2445. .(f
  2446. \**You may want to use it for special
  2447. .q "per user"
  2448. extensions.
  2449. For example, at CMU you can send email to
  2450. .q jgm+foo ;
  2451. the part after the plus sign
  2452. is not part of the user name,
  2453. and is passed to the local mailer for local use.
  2454. .)f
  2455. The
  2456. .i mailer
  2457. must be a single word,
  2458. but the
  2459. .i host
  2460. and
  2461. .i user
  2462. may be multi-part.
  2463. If the
  2464. .i mailer
  2465. is the builtin IPC mailer,
  2466. the
  2467. .i host
  2468. may be a colon-separated list of hosts
  2469. that are searched in order for the first working address
  2470. (exactly like MX records).
  2471. The
  2472. .i user
  2473. is later rewritten by the mailer-specific envelope rewriting set
  2474. and assigned to the
  2475. .b $u
  2476. macro.
  2477. As a special case, if the value to
  2478. .b $#
  2479. is
  2480. .q local
  2481. and the first character of the
  2482. .b $:
  2483. value is
  2484. .q @ ,
  2485. the
  2486. .q @
  2487. is stripped off, and a flag is set in the address descriptor
  2488. that causes sendmail to not do ruleset 5 processing.
  2489. .pp
  2490. Normally, a rule that matches is retried,
  2491. that is,
  2492. the rule loops until it fails.
  2493. A RHS may also be preceded by a
  2494. .b $@
  2495. or a
  2496. .b $:
  2497. to change this behavior.
  2498. A
  2499. .b $@
  2500. prefix causes the ruleset to return with the remainder of the RHS
  2501. as the value.
  2502. A
  2503. .b $:
  2504. prefix causes the rule to terminate immediately,
  2505. but the ruleset to continue;
  2506. this can be used to avoid continued application of a rule.
  2507. The prefix is stripped before continuing.
  2508. .pp
  2509. The
  2510. .b $@
  2511. and
  2512. .b $:
  2513. prefixes may precede a
  2514. .b $>
  2515. spec;
  2516. for example:
  2517. .(b
  2518. .ta 8n
  2519. R$+    $: $>7 $1
  2520. .)b
  2521. matches anything,
  2522. passes that to ruleset seven,
  2523. and continues;
  2524. the
  2525. .b $:
  2526. is necessary to avoid an infinite loop.
  2527. .pp
  2528. Substitution occurs in the order described,
  2529. that is,
  2530. parameters from the LHS are substituted,
  2531. hostnames are canonicalized,
  2532. .q subroutines
  2533. are called,
  2534. and finally
  2535. .b $# ,
  2536. .b $@ ,
  2537. and
  2538. .b $:
  2539. are processed.
  2540. .sh 4 "Semantics of rewriting rule sets"
  2541. .pp
  2542. There are five rewriting sets
  2543. that have specific semantics.
  2544. These are related as depicted by figure 2.
  2545. .(z
  2546. .hl
  2547. .ie n \{\
  2548. .(c
  2549.                     +---+
  2550.                  -->| 0 |-->resolved address
  2551.                 /   +---+
  2552.                /            +---+   +---+
  2553.               /        ---->| 1 |-->| S |--
  2554.        +---+ / +---+  /     +---+   +---+  \e    +---+
  2555. addr-->| 3 |-->| D |--                      --->| 4 |-->msg
  2556.        +---+   +---+  \e     +---+   +---+  /    +---+
  2557.                         --->| 2 |-->| R |--
  2558.                             +---+   +---+
  2559. .)c
  2560.  
  2561. .\}
  2562. .el .ie !"\*(.T"" \
  2563. \{\
  2564. .PS
  2565. boxwid = 0.3i
  2566. boxht = 0.3i
  2567. movewid = 0.3i
  2568. moveht = 0.3i
  2569. linewid = 0.3i
  2570. lineht = 0.3i
  2571.  
  2572.     box invis "addr"; arrow
  2573. Box3:    box "3"
  2574. A1:    arrow
  2575. BoxD:    box "D"; line; L1: Here
  2576. C:    [
  2577.     C1:    arrow; box "1"; arrow; box "S"; line; E1: Here
  2578.         move to C1 down 0.5; right
  2579.     C2:    arrow; box "2"; arrow; box "R"; line; E2: Here
  2580.     ] with .w at L1 + (0.5, 0)
  2581.     move to C.e right 0.5
  2582. L4:    arrow; box "4"; arrow; box invis "msg"
  2583.     line from L1 to C.C1
  2584.     line from L1 to C.C2
  2585.     line from C.E1 to L4
  2586.     line from C.E2 to L4
  2587.     move to BoxD.n up 0.6; right
  2588. Box0:    arrow; box "0"
  2589.     arrow; box invis "resolved address" width 1.3
  2590.     line from 1/3 of the way between A1 and BoxD.w to Box0
  2591. .PE
  2592. .\}
  2593. .el .sp 2i
  2594. .ce
  2595. Figure 2 \*- Rewriting set semantics
  2596. .(c
  2597. D \*- sender domain addition
  2598. S \*- mailer-specific sender rewriting
  2599. R \*- mailer-specific recipient rewriting
  2600. .)c
  2601. .hl
  2602. .)z
  2603. .pp
  2604. Ruleset three
  2605. should turn the address into
  2606. .q "canonical form."
  2607. This form should have the basic syntax:
  2608. .(b
  2609. local-part@host-domain-spec
  2610. .)b
  2611. If no
  2612. .q @
  2613. sign is specified,
  2614. then the
  2615. host-domain-spec
  2616. .i may
  2617. be appended from the
  2618. sender address
  2619. (if the
  2620. .b C
  2621. flag is set in the mailer definition
  2622. corresponding to the
  2623. .i sending
  2624. mailer).
  2625. Ruleset three
  2626. is applied by
  2627. .i sendmail
  2628. before doing anything with any address.
  2629. .pp
  2630. Ruleset zero
  2631. is applied after ruleset three
  2632. to addresses that are going to actually specify recipients.
  2633. It must resolve to a
  2634. .i "{mailer, host, user}"
  2635. triple.
  2636. The
  2637. .i mailer
  2638. must be defined in the mailer definitions
  2639. from the configuration file.
  2640. The
  2641. .i host
  2642. is defined into the
  2643. .b $h
  2644. macro
  2645. for use in the argv expansion of the specified mailer.
  2646. .pp
  2647. Rulesets one and two
  2648. are applied to all sender and recipient addresses respectively.
  2649. They are applied before any specification
  2650. in the mailer definition.
  2651. They must never resolve.
  2652. .pp
  2653. Ruleset four is applied to all addresses
  2654. in the message.
  2655. It is typically used
  2656. to translate internal to external form.
  2657. .sh 4 "IPC mailers"
  2658. .pp
  2659. Some special processing occurs
  2660. if the ruleset zero resolves to an IPC mailer
  2661. (that is, a mailer that has
  2662. .q [IPC]
  2663. listed as the Path in the
  2664. .b M
  2665. configuration line.
  2666. The host name passed after
  2667. .q $@
  2668. has MX expansion performed;
  2669. this looks the name up in DNS to find alternate delivery sites.
  2670. .pp
  2671. The host name can also be provided as a dotted quad in square brackets;
  2672. for example:
  2673. .(b
  2674. [128.32.149.78]
  2675. .)b
  2676. This causes direct conversion of the numeric value
  2677. to a TCP/IP host address.
  2678. .pp
  2679. The host name passed in after the
  2680. .q $@
  2681. may also be a colon-separated list of hosts.
  2682. Each is separately MX expanded and the results are concatenated
  2683. to make (essentially) one long MX list.
  2684. The intent here is to create
  2685. .q fake
  2686. MX records that are not published in DNS
  2687. for private internal networks.
  2688. .pp
  2689. As a final special case, the host name can be passed in
  2690. as a text string
  2691. in square brackets:
  2692. .(b
  2693. [ucbvax.berkeley.edu]
  2694. .)b
  2695. This form avoids the MX mapping.
  2696. .b N.B.:
  2697. This is intended only for situations where you have a network firewall,
  2698. so that your MX record points to a gateway machine;
  2699. this machine could then do direct delivery to machines
  2700. within your local domain.
  2701. Use of this feature directly violates RFC 1123 section 5.3.5:
  2702. it should not be used lightly.
  2703. .sh 3 "D \*- define macro"
  2704. .pp
  2705. Macros are named with a single character.
  2706. These may be selected from the entire ASCII set,
  2707. but user-defined macros
  2708. should be selected from the set of upper case letters only.
  2709. Lower case letters
  2710. and special symbols
  2711. are used internally.
  2712. .pp
  2713. The syntax for macro definitions is:
  2714. .(b F
  2715. .b D \c
  2716. .i x\|val
  2717. .)b
  2718. where
  2719. .i x
  2720. is the name of the macro
  2721. and
  2722. .i val
  2723. is the value it should have.
  2724. .pp
  2725. Macros are interpolated
  2726. using the construct
  2727. .b $ \c
  2728. .i x ,
  2729. where
  2730. .i x
  2731. is the name of the macro to be interpolated.
  2732. This interpolation is done when the configuration file is read,
  2733. except in
  2734. .b M
  2735. lines.
  2736. The special construct
  2737. .b $& \c
  2738. .i x
  2739. can be used in
  2740. .b R
  2741. lines to get deferred interpolation.
  2742. .pp
  2743. Conditionals can be specified using the syntax:
  2744. .(b
  2745. $?x text1 $| text2 $.
  2746. .)b
  2747. This interpolates
  2748. .i text1
  2749. if the macro
  2750. .b $x
  2751. is set,
  2752. and
  2753. .i text2
  2754. otherwise.
  2755. The
  2756. .q else
  2757. (\c
  2758. .b $| )
  2759. clause may be omitted.
  2760. .pp
  2761. Lower case macro names are reserved to have
  2762. special semantics,
  2763. used to pass information in or out of
  2764. .i sendmail ,
  2765. and special characters are reserved to
  2766. provide conditionals, etc.
  2767. Upper case names
  2768. (that is,
  2769. .b $A
  2770. through
  2771. .b $Z )
  2772. are specifically reserved for configuration file authors.
  2773. .pp
  2774. The following macros are defined and/or used internally by
  2775. .i sendmail
  2776. for interpolation into argv's for mailers
  2777. or for other contexts.
  2778. The ones marked \(dg are information passed into sendmail\**,
  2779. .(f
  2780. \**As of version 8.6,
  2781. all of these macros have reasonable defaults.
  2782. Previous versions required that they be defined.
  2783. .)f
  2784. the ones marked \(dd are information passed both in and out of sendmail,
  2785. and the unmarked macros are passed out of sendmail
  2786. but are not otherwise used internally.
  2787. These macros are:
  2788. .nr ii 5n
  2789. .ip $a
  2790. .b "The origination date in RFC 822 format."
  2791. .ip $b
  2792. .b "The current date in RFC 822 format."
  2793. .ip $c
  2794. .b "The hop count."
  2795. .ip $d
  2796. .b "The current date in UNIX (ctime) format."
  2797. .ip $e\(dg
  2798. .b "The SMTP entry message."
  2799. This is printed out when SMTP starts up.
  2800. The first word must be the
  2801. .b $j
  2802. macro as specified by RFC821.
  2803. Defaults to
  2804. .q "$j Sendmail $v ready at $b" .
  2805. Commonly redefined to include the configuration version number, e.g.,
  2806. .q "$j Sendmail $v/$Z ready at $b"
  2807. .ip $f
  2808. .b "The sender (from) address."
  2809. .ip $g
  2810. .b "The sender address relative to the recipient."
  2811. .ip $h
  2812. .b "The recipient host."
  2813. .ip $i
  2814. .b "The queue id."
  2815. .ip $j\(dd
  2816. .b "The \*(lqofficial\*(rq domain name for this site."
  2817. This is fully qualified if the full qualification can be found.
  2818. It
  2819. .i must
  2820. be redefined to be the fully qualified domain name
  2821. if your system is not configured so that information can find
  2822. it automatically.
  2823. .ip $k
  2824. .b "The UUCP node name (from the uname system call)."
  2825. .ip $l\(dg
  2826. .b "The format of the UNIX from line."
  2827. Unless you have changed the UNIX mailbox format,
  2828. you should not change the default,
  2829. which is
  2830. .q "From $g  $d" .
  2831. .ip $m
  2832. .b "The domain part of the \fIgethostname\fP return value."
  2833. Under normal circumstances,
  2834. .b $j
  2835. is equivalent to
  2836. .b $w.$m .
  2837. .ip $n\(dg
  2838. .b "The name of the daemon (for error messages)."
  2839. Defaults to
  2840. .q MAILER-DAEMON .
  2841. .ip $o\(dg
  2842. .b "The set of \*(lqoperators\*(rq in addresses."
  2843. A list of characters
  2844. which will be considered tokens
  2845. and which will separate tokens
  2846. when doing parsing.
  2847. For example, if
  2848. .q @
  2849. were in the
  2850. .b $o
  2851. macro, then the input
  2852. .q a@b
  2853. would be scanned as three tokens:
  2854. .q a,
  2855. .q @,
  2856. and
  2857. .q b.
  2858. Defaults to
  2859. .q ".:@[]" ,
  2860. which is the minimum set necessary to do RFC 822 parsing;
  2861. a richer set of operators is
  2862. .q ".:%@!/[]" ,
  2863. which adds support for UUCP, the %-hack, and X.400 addresses.
  2864. .ip $p
  2865. .b "Sendmail's process id."
  2866. .ip $q\(dg
  2867. .b "Default format of sender address."
  2868. The
  2869. .b $q
  2870. macro specifies how an address should appear in a message
  2871. when it is defaulted.
  2872. Defaults to
  2873. .q "<$g>" .
  2874. It is commonly redefined to be
  2875. .q "$?x$x <$g>$|$g$."
  2876. or
  2877. .q "$g$?x ($x)$." ,
  2878. corresponding to the following two formats:
  2879. .(b
  2880. Eric Allman <eric@CS.Berkeley.EDU>
  2881. eric@CS.Berkeley.EDU (Eric Allman)
  2882. .)b
  2883. .i Sendmail
  2884. properly quotes names that have special characters
  2885. if the first form is used.
  2886. .ip $r
  2887. .b "Protocol used to receive the message."
  2888. .ip $s
  2889. .b "Sender's host name."
  2890. .ip $t
  2891. .b "A numeric representation of the current time."
  2892. .ip $u
  2893. .b "The recipient user."
  2894. .ip $v
  2895. .b "The version number of \fIsendmail\fP."
  2896. .ip $w\(dd
  2897. .b "The hostname of this site."
  2898. .pp
  2899. The
  2900. .b $w
  2901. macro is set to the root name of this host (but see below for caveats).
  2902. .ip $x
  2903. .b "The full name of the sender."
  2904. .ip $z
  2905. .b "The home directory of the recipient."
  2906. .ip $_
  2907. .b "The validated sender address."
  2908. .pp
  2909. There are three types of dates that can be used.
  2910. The
  2911. .b $a
  2912. and
  2913. .b $b
  2914. macros are in RFC 822 format;
  2915. .b $a
  2916. is the time as extracted from the
  2917. .q Date:
  2918. line of the message
  2919. (if there was one),
  2920. and
  2921. .b $b
  2922. is the current date and time
  2923. (used for postmarks).
  2924. If no
  2925. .q Date:
  2926. line is found in the incoming message,
  2927. .b $a
  2928. is set to the current time also.
  2929. The
  2930. .b $d
  2931. macro is equivalent to the
  2932. .b $b
  2933. macro in UNIX
  2934. (ctime)
  2935. format.
  2936. .pp
  2937. The macros
  2938. .b $w ,
  2939. .b $j ,
  2940. and
  2941. .b $m
  2942. are set to the identity of this host.
  2943. .i Sendmail
  2944. tries to find the fully qualified name of the host
  2945. if at all possible;
  2946. it does this by calling
  2947. .i gethostname (2)
  2948. to get the current hostname
  2949. and then passing that to
  2950. .i gethostbyname (3)
  2951. which is supposed to return the canonical version of that host name.\**
  2952. .(f
  2953. \**For example, on some systems
  2954. .i gethostname
  2955. might return
  2956. .q foo
  2957. which would be mapped to
  2958. .q foo.bar.com
  2959. by
  2960. .i gethostbyname .
  2961. .)f
  2962. Assuming this is successful,
  2963. .b $j
  2964. is set to the fully qualified name
  2965. and
  2966. .b $m
  2967. is set to the domain part of the name
  2968. (everything after the first dot).
  2969. The
  2970. .b $w
  2971. macro is set to the first word
  2972. (everything before the first dot)
  2973. if you have a level 5 or higher configuration file;
  2974. otherwise, it is set to the same value as
  2975. .b $j .
  2976. If the canonification is not successful,
  2977. it is imperative that the config file set
  2978. .b $j
  2979. to the fully qualified domain name\**.
  2980. .(f
  2981. \**Older versions of sendmail didn't pre-define
  2982. .b $j
  2983. at all, so up until 8.6,
  2984. config files
  2985. .i always
  2986. had to define
  2987. .b $j .
  2988. .)f
  2989. .pp
  2990. The
  2991. .b $f
  2992. macro is the id of the sender
  2993. as originally determined;
  2994. when mailing to a specific host
  2995. the
  2996. .b $g
  2997. macro is set to the address of the sender
  2998. .ul
  2999. relative to the recipient.
  3000. For example,
  3001. if I send to
  3002. .q bollard@matisse.CS.Berkeley.EDU
  3003. from the machine
  3004. .q vangogh.CS.Berkeley.EDU
  3005. the
  3006. .b $f
  3007. macro will be
  3008. .q eric
  3009. and the
  3010. .b $g
  3011. macro will be
  3012. .q eric@vangogh.CS.Berkeley.EDU.
  3013. .pp
  3014. The
  3015. .b $x
  3016. macro is set to the full name of the sender.
  3017. This can be determined in several ways.
  3018. It can be passed as flag to
  3019. .i sendmail .
  3020. The second choice is the value of the
  3021. .q Full-name:
  3022. line in the header if it exists,
  3023. and the third choice is the comment field
  3024. of a
  3025. .q From:
  3026. line.
  3027. If all of these fail,
  3028. and if the message is being originated locally,
  3029. the full name is looked up in the
  3030. .i /etc/passwd
  3031. file.
  3032. .pp
  3033. When sending,
  3034. the
  3035. .b $h ,
  3036. .b $u ,
  3037. and
  3038. .b $z
  3039. macros get set to the host, user, and home directory
  3040. (if local)
  3041. of the recipient.
  3042. The first two are set from the
  3043. .b $@
  3044. and
  3045. .b $:
  3046. part of the rewriting rules, respectively.
  3047. .pp
  3048. The
  3049. .b $p
  3050. and
  3051. .b $t
  3052. macros are used to create unique strings
  3053. (e.g., for the
  3054. .q Message-Id:
  3055. field).
  3056. The
  3057. .b $i
  3058. macro is set to the queue id on this host;
  3059. if put into the timestamp line
  3060. it can be extremely useful for tracking messages.
  3061. The
  3062. .b $v
  3063. macro is set to be the version number of
  3064. .i sendmail ;
  3065. this is normally put in timestamps
  3066. and has been proven extremely useful for debugging.
  3067. .pp
  3068. The
  3069. .b $c
  3070. field is set to the
  3071. .q "hop count,"
  3072. i.e., the number of times this message has been processed.
  3073. This can be determined
  3074. by the
  3075. .b \-h
  3076. flag on the command line
  3077. or by counting the timestamps in the message.
  3078. .pp
  3079. The
  3080. .b $r
  3081. and
  3082. .b $s
  3083. fields are set to the protocol used to communicate with
  3084. .i sendmail
  3085. and the sending hostname.
  3086. .pp
  3087. The
  3088. .b $_
  3089. is set to a validated sender host name.
  3090. If the sender is running an RFC 1413 compliant IDENT server,
  3091. it will include the user name on that host.
  3092. .sh 3 "C and F \*- define classes"
  3093. .pp
  3094. Classes of phrases may be defined
  3095. to match on the left hand side of rewriting rules,
  3096. where a
  3097. .q phrase
  3098. is a sequence of characters that do not contain space characters.
  3099. For example
  3100. a class of all local names for this site
  3101. might be created
  3102. so that attempts to send to oneself
  3103. can be eliminated.
  3104. These can either be defined directly in the configuration file
  3105. or read in from another file.
  3106. Classes may be given names
  3107. from the set of upper case letters.
  3108. Lower case letters and special characters
  3109. are reserved for system use.
  3110. .pp
  3111. The syntax is:
  3112. .(b F
  3113. .b C \c
  3114. .i c\|phrase1
  3115. .i phrase2...
  3116. .br
  3117. .b F \c
  3118. .i c\|file
  3119. .)b
  3120. The first form defines the class
  3121. .i c
  3122. to match any of the named words.
  3123. It is permissible to split them among multiple lines;
  3124. for example, the two forms:
  3125. .(b
  3126. CHmonet ucbmonet
  3127. .)b
  3128. and
  3129. .(b
  3130. CHmonet
  3131. CHucbmonet
  3132. .)b
  3133. are equivalent.
  3134. The second form
  3135. reads the elements of the class
  3136. .i c
  3137. from the named
  3138. .i file .
  3139. .pp
  3140. The
  3141. .b $~
  3142. (match entries not in class)
  3143. only matches a single word;
  3144. multi-word entries in the class are ignored in this context.
  3145. .pp
  3146. The class
  3147. .b $=w
  3148. is set to be the set of all names
  3149. this host is known by.
  3150. This can be used to match local hostnames.
  3151. .pp
  3152. The class
  3153. .b $=k
  3154. is set to be the same as
  3155. .b $k ,
  3156. that is, the UUCP node name.
  3157. .pp
  3158. The class
  3159. .b $=m
  3160. is set to the set of domains by which this host is known,
  3161. initially just
  3162. .b $m .
  3163. .pp
  3164. .i Sendmail
  3165. can be compiled to allow a
  3166. .i scanf (3)
  3167. string on the
  3168. .b F
  3169. line.
  3170. This lets you do simplistic parsing of text files.
  3171. For example, to read all the user names in your system
  3172. .i /etc/passwd
  3173. file into a class, use
  3174. .(b
  3175. FL/etc/passwd %[^:]
  3176. .)b
  3177. which reads every line up to the first colon.
  3178. .sh 3 "M \*- define mailer"
  3179. .pp
  3180. Programs and interfaces to mailers
  3181. are defined in this line.
  3182. The format is:
  3183. .(b F
  3184. .b M \c
  3185. .i name ,
  3186. {\c
  3187. .i field =\c
  3188. .i value \|}*
  3189. .)b
  3190. where
  3191. .i name
  3192. is the name of the mailer
  3193. (used internally only)
  3194. and the
  3195. .q field=name
  3196. pairs define attributes of the mailer.
  3197. Fields are:
  3198. .(b
  3199. .ta 1i
  3200. Path    The pathname of the mailer
  3201. Flags    Special flags for this mailer
  3202. Sender    A rewriting set for sender addresses
  3203. Recipient    A rewriting set for recipient addresses
  3204. Argv    An argument vector to pass to this mailer
  3205. Eol    The end-of-line string for this mailer
  3206. Maxsize    The maximum message length to this mailer
  3207. Linelimit    The maximum line length in the message body
  3208. Directory    The working directory for the mailer
  3209. .)b
  3210. Only the first character of the field name is checked.
  3211. .pp
  3212. The following flags may be set in the mailer description.
  3213. Any other flags may be used freely
  3214. to conditionally assign headers to messages
  3215. destined for particular mailers.
  3216. .nr ii 4n
  3217. .ip a
  3218. Run Extended SMTP (ESMTP) protocol (defined in RFCs 1425, 1426, and 1427).
  3219. .ip b
  3220. Force a blank line on the end of a message.
  3221. This is intended to work around some stupid versions of
  3222. /bin/mail
  3223. that require a blank line, but do not provide it themselves.
  3224. It would not normally be used on network mail.
  3225. .ip c
  3226. Do not include comments in addresses.
  3227. This should only be used if you have to work around
  3228. a remote mailer that gets confused by comments.
  3229. .ip C
  3230. If mail is
  3231. .i received
  3232. from a mailer with this flag set,
  3233. any addresses in the header that do not have an at sign
  3234. (\c
  3235. .q @ )
  3236. after being rewritten by ruleset three
  3237. will have the
  3238. .q @domain
  3239. clause from the sender
  3240. tacked on.
  3241. This allows mail with headers of the form:
  3242. .(b
  3243. From: usera@hosta
  3244. To: userb@hostb, userc
  3245. .)b
  3246. to be rewritten as:
  3247. .(b
  3248. From: usera@hosta
  3249. To: userb@hostb, userc@hosta
  3250. .)b
  3251. automatically.
  3252. .ip D
  3253. This mailer wants a
  3254. .q Date:
  3255. header line.
  3256. .ip e
  3257. This mailer is expensive to connect to,
  3258. so try to avoid connecting normally;
  3259. any necessary connection will occur during a queue run.
  3260. .ip E
  3261. Escape lines beginning with
  3262. .q From
  3263. in the message with a `>' sign.
  3264. .ip f
  3265. The mailer wants a
  3266. .b \-f
  3267. .i from
  3268. flag,
  3269. but only if this is a network forward operation
  3270. (i.e.,
  3271. the mailer will give an error
  3272. if the executing user
  3273. does not have special permissions).
  3274. .ip F
  3275. This mailer wants a
  3276. .q From:
  3277. header line.
  3278. .ip g
  3279. Normally,
  3280. .i sendmail
  3281. sends internally generated email (e.g., error messages)
  3282. using the null return address\**
  3283. .(f
  3284. \**Actually, this only applies to SMTP,
  3285. which uses the ``MAIL FROM:<>'' command.
  3286. .)f
  3287. as required by RFC 1123.
  3288. However, some mailers don't accept a null return address.
  3289. If necessary,
  3290. you can set the
  3291. .b g
  3292. flag to prevent
  3293. .i sendmail
  3294. from obeying the standards;
  3295. error messages will be sent as from the MAILER-DAEMON
  3296. (actually, the value of the
  3297. .b $n
  3298. macro).
  3299. .ip h
  3300. Upper case should be preserved in host names
  3301. for this mailer.
  3302. .ip I
  3303. This mailer will be speaking SMTP
  3304. to another
  3305. .i sendmail
  3306. \*-
  3307. as such it can use special protocol features.
  3308. This option is not required
  3309. (i.e.,
  3310. if this option is omitted the transmission will still operate successfully,
  3311. although perhaps not as efficiently as possible).
  3312. .ip l
  3313. This mailer is local
  3314. (i.e.,
  3315. final delivery will be performed).
  3316. .ip L
  3317. Limit the line lengths as specified in RFC821.
  3318. This deprecated option should be replaced by the
  3319. .b L=
  3320. mail declaration.
  3321. For historic reasons, the
  3322. .b L
  3323. flag also sets the
  3324. .b 7
  3325. flag.
  3326. .ip m
  3327. This mailer can send to multiple users
  3328. on the same host
  3329. in one transaction.
  3330. When a
  3331. .b $u
  3332. macro occurs in the
  3333. .i argv
  3334. part of the mailer definition,
  3335. that field will be repeated as necessary
  3336. for all qualifying users.
  3337. .ip M
  3338. This mailer wants a
  3339. .q Message-Id:
  3340. header line.
  3341. .ip n
  3342. Do not insert a UNIX-style
  3343. .q From
  3344. line on the front of the message.
  3345. .ip p
  3346. Use the route-addr style reverse-path in the SMTP
  3347. .q "MAIL FROM:"
  3348. command
  3349. rather than just the return address;
  3350. although this is required in RFC821 section 3.1,
  3351. many hosts do not process reverse-paths properly.
  3352. Reverse-paths are officially discouraged by RFC 1123.
  3353. .ip P
  3354. This mailer wants a
  3355. .q Return-Path:
  3356. line.
  3357. .ip r
  3358. Same as
  3359. .b f ,
  3360. but sends a
  3361. .b \-r
  3362. flag.
  3363. .ip s
  3364. Strip quote characters off of the address
  3365. before calling the mailer.
  3366. .ip S
  3367. Don't reset the userid
  3368. before calling the mailer.
  3369. This would be used in a secure environment
  3370. where
  3371. .i sendmail
  3372. ran as root.
  3373. This could be used to avoid forged addresses.
  3374. This flag is suppressed if given from an
  3375. .q unsafe
  3376. environment
  3377. (e.g, a user's mail.cf file).
  3378. .ip u
  3379. Upper case should be preserved in user names
  3380. for this mailer.
  3381. .ip U
  3382. This mailer wants Unix-style
  3383. .q From
  3384. lines with the ugly UUCP-style
  3385. .q "remote from <host>"
  3386. on the end.
  3387. .ip x
  3388. This mailer wants a
  3389. .q Full-Name:
  3390. header line.
  3391. .ip X
  3392. This mailer want to use the hidden dot algorithm
  3393. as specified in RFC821;
  3394. basically,
  3395. any line beginning with a dot
  3396. will have an extra dot prepended
  3397. (to be stripped at the other end).
  3398. This insures that lines in the message containing a dot
  3399. will not terminate the message prematurely.
  3400. .ip 7
  3401. Strip all output to seven bits.
  3402. This is the default if the
  3403. .b L
  3404. flag is set.
  3405. Note that clearing this option is not
  3406. sufficient to get full eight bit data passed through
  3407. .i sendmail .
  3408. If the
  3409. .b 7
  3410. option is set, this is essentially always set,
  3411. since the eighth bit was stripped on input.
  3412. .pp
  3413. The mailer with the special name
  3414. .q error
  3415. can be used to generate a user error.
  3416. The (optional) host field is an exit status to be returned,
  3417. and the user field is a message to be printed.
  3418. The exit status may be numeric or one of the values
  3419. USAGE, NOUSER, NOHOST, UNAVAILABLE, SOFTWARE, TEMPFAIL, PROTOCOL, or CONFIG
  3420. to return the corresponding EX_ exit code.
  3421. For example, the entry:
  3422. .(b
  3423. $#error $@ NOHOST $: Host unknown in this domain
  3424. .)b
  3425. on the RHS of a rule
  3426. will cause the specified error to be generated
  3427. and the
  3428. .q "Host unknown"
  3429. exit status to be returned
  3430. if the LHS matches.
  3431. This mailer is only functional in ruleset zero.
  3432. .pp
  3433. The mailer named
  3434. .q local
  3435. .i must
  3436. be defined in every configuration file.
  3437. This is used to deliver local mail,
  3438. and is treated specially in several ways.
  3439. Additionally, three other mailers named
  3440. .q prog ,
  3441. .q *file* ,
  3442. and
  3443. .q *include*
  3444. may be defined to tune the delivery of messages to programs,
  3445. files,
  3446. and :include: lists respectively.
  3447. They default to:
  3448. .(b
  3449. Mprog, P=/bin/sh, F=lsD, A=sh \-c $u
  3450. M*file*, P=/dev/null, F=lsDFMPEu, A=FILE
  3451. M*include*, P=/dev/null, F=su, A=INCLUDE
  3452. .)b
  3453. .pp
  3454. The Sender and Recipient rewriting sets
  3455. may either be a simple integer
  3456. or may be two integers separated by a slash;
  3457. if so, the first rewriting set is applied to envelope
  3458. addresses
  3459. and the second is applied to headers.
  3460. .pp
  3461. The Directory
  3462. is actually a colon-separated path of directories to try.
  3463. For example, the definition
  3464. .q D=$z:/
  3465. first tries to execute in the recipient's home directory;
  3466. if that is not available,
  3467. it tries to execute in the root of the filesystem.
  3468. This is intended to be used only on the
  3469. .q prog
  3470. mailer,
  3471. since some shells (such as
  3472. .i csh )
  3473. refuse to execute if they cannot read the home directory.
  3474. Since the queue directory is not normally readable by normal users
  3475. .i csh
  3476. scripts as recipients can fail.
  3477. .sh 3 "H \*- define header"
  3478. .pp
  3479. The format of the header lines that
  3480. .i sendmail
  3481. inserts into the message
  3482. are defined by the
  3483. .b H
  3484. line.
  3485. The syntax of this line is:
  3486. .(b F
  3487. .b H [\c
  3488. .b ? \c
  3489. .i mflags \c
  3490. .b ? ]\c
  3491. .i hname \c
  3492. .b :
  3493. .i htemplate
  3494. .)b
  3495. Continuation lines in this spec
  3496. are reflected directly into the outgoing message.
  3497. The
  3498. .i htemplate
  3499. is macro expanded before insertion into the message.
  3500. If the
  3501. .i mflags
  3502. (surrounded by question marks)
  3503. are specified,
  3504. at least one of the specified flags
  3505. must be stated in the mailer definition
  3506. for this header to be automatically output.
  3507. If one of these headers is in the input
  3508. it is reflected to the output
  3509. regardless of these flags.
  3510. .pp
  3511. Some headers have special semantics
  3512. that will be described below.
  3513. .sh 3 "O \*- set option"
  3514. .pp
  3515. There are a number of
  3516. .q random
  3517. options that
  3518. can be set from a configuration file.
  3519. Options are represented by single characters.
  3520. The syntax of this line is:
  3521. .(b F
  3522. .b O \c
  3523. .i o\|value
  3524. .)b
  3525. This sets option
  3526. .i o
  3527. to be
  3528. .i value .
  3529. Depending on the option,
  3530. .i value
  3531. may be a string, an integer,
  3532. a boolean
  3533. (with legal values
  3534. .q t ,
  3535. .q T ,
  3536. .q f ,
  3537. or
  3538. .q F ;
  3539. the default is TRUE),
  3540. or
  3541. a time interval.
  3542. .pp
  3543. The options supported are:
  3544. .nr ii 1i
  3545. .ip a\fIN\fP
  3546. If set,
  3547. wait up to
  3548. .i N
  3549. minutes for an
  3550. .q @:@
  3551. entry to exist in the alias database
  3552. before starting up.
  3553. If it does not appear in
  3554. .i N
  3555. minutes,
  3556. rebuild the database
  3557. (if the
  3558. .b D
  3559. option is also set)
  3560. or issue a warning.
  3561. .ip "A\fIspec, spec, ...\fP"
  3562. Specify possible alias file(s).
  3563. Each
  3564. .i spec
  3565. should be in the format
  3566. ``\c
  3567. .i class \c
  3568. .b :
  3569. .i file ''
  3570. where
  3571. .i class \c
  3572. .b :
  3573. is optional and defaults to ``implicit''.
  3574. Depending on how
  3575. .i sendmail
  3576. is compiled, valid classes are
  3577. .q implicit
  3578. (search through a compiled-in list of alias file types,
  3579. for back compatibility),
  3580. .q hash
  3581. (if
  3582. .sm NEWDB
  3583. is specified),
  3584. .q dbm
  3585. (if
  3586. .sm NDBM
  3587. is specified),
  3588. .q stab
  3589. (internal symbol table \*- not normally used
  3590. unless you have no other database lookup),
  3591. or
  3592. .q nis
  3593. (if
  3594. .sm NIS
  3595. is specified).
  3596. If a list of
  3597. .i spec s
  3598. are provided,
  3599. .i sendmail
  3600. searches them in order.
  3601. .ip b\fIN\fP/\fIM\fP
  3602. Insist on at least
  3603. .i N
  3604. blocks free on the filesystem that holds the queue files
  3605. before accepting email via SMTP.
  3606. If there is insufficient space
  3607. .i sendmail
  3608. gives a 452 response
  3609. to the MAIL command.
  3610. This invites the sender to try again later.
  3611. The optional
  3612. .i M
  3613. is a maximum message size advertised in the ESMTP EHLO response.
  3614. It is currently otherwise unused.
  3615. .ip B\fIc\fP
  3616. Set the blank substitution character to
  3617. .i c .
  3618. Unquoted spaces in addresses are replaced by this character.
  3619. Defaults to space (i.e., no change is made).
  3620. .ip c
  3621. If an outgoing mailer is marked as being expensive,
  3622. don't connect immediately.
  3623. This requires that queueing be compiled in,
  3624. since it will depend on a queue run process to
  3625. actually send the mail.
  3626. .ip C\fIN\fP
  3627. Checkpoints the queue every
  3628. .i N
  3629. (default 10)
  3630. addresses sent.
  3631. If your system crashes during delivery to a large list,
  3632. this prevents retransmission to any but the last
  3633. .I N
  3634. recipients.
  3635. .ip d\fIx\fP
  3636. Deliver in mode
  3637. .i x .
  3638. Legal modes are:
  3639. .(b
  3640. .ta 4n
  3641. i    Deliver interactively (synchronously)
  3642. b    Deliver in background (asynchronously)
  3643. q    Just queue the message (deliver during queue run)
  3644. .)b
  3645. Defaults to ``b'' if no option is specified,
  3646. ``i'' if it is specified but given no argument
  3647. (i.e., ``Od'' is equivalent to ``Odi'').
  3648. .ip D
  3649. If set,
  3650. rebuild the alias database if necessary and possible.
  3651. If this option is not set,
  3652. .i sendmail
  3653. will never rebuild the alias database
  3654. unless explicitly requested
  3655. using
  3656. .b \-bi .
  3657. .ip e\fIx\fP
  3658. Dispose of errors using mode
  3659. .i x .
  3660. The values for
  3661. .i x
  3662. are:
  3663. .(b
  3664. p    Print error messages (default)
  3665. q    No messages, just give exit status
  3666. m    Mail back errors
  3667. w    Write back errors (mail if user not logged in)
  3668. e    Mail back errors and give zero exit stat always
  3669. .)b
  3670. .ip E\fIfile/message\fP
  3671. Prepend error messages with the indicated message.
  3672. If it begins with a slash,
  3673. it is assumed to be the pathname of a file
  3674. containing a message (this is the recommended setting).
  3675. Otherwise, it is a literal message.
  3676. The error file might contain the name, email address, and/or phone number
  3677. of a local postmaster who could provide assistance
  3678. in to end users.
  3679. If the option is missing or null,
  3680. or if it names a file which does not exist or which is not readable,
  3681. no message is printed.
  3682. .ip f
  3683. Save
  3684. Unix-style
  3685. .q From
  3686. lines at the front of headers.
  3687. Normally they are assumed redundant
  3688. and discarded.
  3689. .ip F\fImode\fP
  3690. The file mode for queue files.
  3691. .ip g\fIn\fP
  3692. Set the default group id
  3693. for mailers to run in
  3694. to
  3695. .i n .
  3696. Defaults to 1.
  3697. The value can also be given as a symbolic group name.
  3698. .ip G
  3699. Allow fuzzy matching on the GECOS field.
  3700. If this flag is set,
  3701. and the usual user name lookups fail
  3702. (that is, there is no alias with this name and a
  3703. .i getpwnam
  3704. fails),
  3705. sequentially search the password file
  3706. for a matching entry in the GECOS field.
  3707. This also requires that MATCHGECOS
  3708. be turned on during compilation.
  3709. This option is not recommended.
  3710. .ip h\fIN\fP
  3711. The maximum hop count.
  3712. Messages that have been processed more than
  3713. .i N
  3714. times are assumed to be in a loop and are rejected.
  3715. Defaults to 25.
  3716. .ip H\fIfile\fP
  3717. Specify the help file
  3718. for SMTP.
  3719. .ip i
  3720. Ignore dots in incoming messages.
  3721. This is always disabled (that is, dots are always accepted)
  3722. when reading SMTP mail.
  3723. .ip I
  3724. Insist that the BIND name server be running
  3725. to resolve host names.
  3726. If this is not set and the name server is not running,
  3727. the
  3728. .i /etc/hosts
  3729. file will be considered complete.
  3730. In general, you do want to set this option
  3731. if your
  3732. .i /etc/hosts
  3733. file does not include all hosts known to you
  3734. or if you are using the MX (mail forwarding) feature of the BIND name server.
  3735. The name server will still be consulted
  3736. even if this option is not set, but
  3737. .i sendmail
  3738. will feel free to resort to reading
  3739. .i /etc/hosts
  3740. if the name server is not available.
  3741. Thus, you should
  3742. .i never
  3743. set this option if you do not run the name server.
  3744. .ip j
  3745. If set, send error messages in MIME format
  3746. (see RFC1341 and RFC1344 for details).
  3747. .ip J\fIpath\fP
  3748. Set the path for searching for users' .forward files.
  3749. The default is
  3750. .q $z/.forward .
  3751. Some sites that use the automounter may prefer to change this to
  3752. .q /var/forward/$u
  3753. to search a file with the same name as the user in a system directory.
  3754. It can also be set to a sequence of paths separated by colons;
  3755. .i sendmail
  3756. stops at the first file it can successfully and safely open.
  3757. For example,
  3758. .q /var/forward/$u:$z/.forward
  3759. will search first in /var/forward/\c
  3760. .i username
  3761. and then in
  3762. .i ~username /.forward
  3763. (but only if the first file does not exist).
  3764. .ip k\fIN\fP
  3765. The maximum number of open connections that will be cached at a time.
  3766. The default is one.
  3767. This delays closing the current connection until
  3768. either this invocation of
  3769. .i sendmail
  3770. needs to connect to another host
  3771. or it terminates.
  3772. Setting it to zero defaults to the old behavior,
  3773. that is, connections are closed immediately.
  3774. .ip K\fItimeout\fP
  3775. The maximum amount of time a cached connection will be permitted to idle
  3776. without activity.
  3777. If this time is exceeded,
  3778. the connection is immediately closed.
  3779. This value should be small (on the order of ten minutes).
  3780. Before
  3781. .i sendmail
  3782. uses a cached connection,
  3783. it always sends a NOOP (no operation) command
  3784. to check the connection;
  3785. if this fails, it reopens the connection.
  3786. This keeps your end from failing if the other end times out.
  3787. The point of this option is to be a good network neighbor
  3788. and avoid using up excessive resources
  3789. on the other end.
  3790. The default is five minutes.
  3791. .ip l
  3792. If there is an
  3793. .q Errors-To:
  3794. header, send error messages to the addresses listed there.
  3795. They normally go to the envelope sender.
  3796. Use of this option causes
  3797. .i sendmail
  3798. to violate RFC 1123.
  3799. .ip L\fIn\fP
  3800. Set the default log level to
  3801. .i n .
  3802. Defaults to 9.
  3803. .ip m
  3804. Send to me too,
  3805. even if I am in an alias expansion.
  3806. .ip M\fIx\|value\fP
  3807. Set the macro
  3808. .i x
  3809. to
  3810. .i value .
  3811. This is intended only for use from the command line.
  3812. .ip n
  3813. Validate the RHS of aliases when rebuilding the alias database.
  3814. .ip o
  3815. Assume that the headers may be in old format,
  3816. i.e.,
  3817. spaces delimit names.
  3818. This actually turns on
  3819. an adaptive algorithm:
  3820. if any recipient address contains a comma, parenthesis,
  3821. or angle bracket,
  3822. it will be assumed that commas already exist.
  3823. If this flag is not on,
  3824. only commas delimit names.
  3825. Headers are always output with commas between the names.
  3826. .ip O\fIoptions\fP
  3827. Set server SMTP options.
  3828. The options are
  3829. .i key=value
  3830. pairs.
  3831. Known keys are:
  3832. .(b
  3833. .ta 1i
  3834. Port    Name/number of listening port (defaults to "smtp")
  3835. Addr    Address mask (defaults INADDR_ANY)
  3836. Family    Address family (defaults to INET)
  3837. Listen    Size of listen queue (defaults to 10)
  3838. .)b
  3839. The
  3840. .i Addr ess
  3841. mask may be a numeric address in dot notation
  3842. or a network name.
  3843. .ip p\fI\|opt,opt,...\fP
  3844. Set the privacy
  3845. .i opt ions.
  3846. ``Privacy'' is really a misnomer;
  3847. many of these are just a way of insisting on stricter adherence
  3848. to the SMTP protocol.
  3849. The
  3850. .i opt ions
  3851. can be selected from:
  3852. .(b
  3853. .ta \w'needvrfyhelo'u+3n
  3854. public    Allow open access
  3855. needmailhelo    Insist on HELO or EHLO command before MAIL
  3856. needexpnhelo    Insist on HELO or EHLO command before EXPN
  3857. noexpn    Disallow EXPN entirely
  3858. needvrfyhelo    Insist on HELO or EHLO command before VRFY
  3859. novrfy    Disallow VRFY entirely
  3860. restrictmailq    Restrict mailq command
  3861. restrictqrun    Restrict \-q command line flag
  3862. noreceipts    Ignore Return-Receipt-To: header
  3863. goaway    Disallow essentially all SMTP status queries
  3864. authwarnings    Put X-Authentication-Warning: headers in messages
  3865. .)b
  3866. The
  3867. .q goaway
  3868. pseudo-flag sets all flags except
  3869. .q restrictmailq
  3870. and
  3871. .q restrictqrun .
  3872. If mailq is restricted,
  3873. only people in the same group as the queue directory
  3874. can print the queue.
  3875. If queue runs are restricted,
  3876. only root and the owner of the queue directory
  3877. can run the queue.
  3878. Authentication Warnings add warnings about various conditions
  3879. that may indicate attempts to spoof the mail system,
  3880. such as using an non-standard queue directory.
  3881. .ip P\fIpostmaster\fP
  3882. If set,
  3883. copies of error messages will be sent to the named
  3884. .i postmaster .
  3885. Only the header of the failed message is sent.
  3886. Since most errors are user problems,
  3887. this is probably not a good idea on large sites,
  3888. and arguably contains all sorts of privacy violations,
  3889. but it seems to be popular with certain operating systems vendors.
  3890. .ip q\fIfactor\fP
  3891. Use
  3892. .i factor
  3893. as the multiplier in the map function
  3894. to decide when to just queue up jobs rather than run them.
  3895. This value is divided by the difference between the current load average
  3896. and the load average limit
  3897. (\c
  3898. .b x
  3899. flag)
  3900. to determine the maximum message priority
  3901. that will be sent.
  3902. Defaults to 600000.
  3903. .ip Q\fIdir\fP
  3904. Use the named
  3905. .i dir
  3906. as the queue directory.
  3907. .ip r\|\fItimeouts\fP
  3908. Timeout reads after
  3909. .i time
  3910. interval.
  3911. The
  3912. .i timeouts
  3913. argument is a list of
  3914. .i keyword=value
  3915. pairs.
  3916. The recognized timeouts and their default values, and their
  3917. minimum values specified in RFC 1123 section 5.3.2 are:
  3918. .(b
  3919. .ta \w'datafinal'u+3n
  3920. initial    wait for initial greeting message [5m, 5m]
  3921. helo    reply to HELO or EHLO command [5m, none]
  3922. mail    reply to MAIL command [10m, 5m]
  3923. rcpt    reply to RCPT command [1h, 5m]
  3924. datainit    reply to DATA command [5m, 2m]
  3925. datablock    data block read [1h, 3m]
  3926. datafinal    reply to final ``.'' in data [1h, 10m]
  3927. rset    reply to RSET command [5m, none]
  3928. quit    reply to QUIT command [2m, none]
  3929. misc    reply to NOOP and VERB commands [2m, none]
  3930. command    command read [1h, 5m]
  3931. ident    IDENT protocol timeout [30s, none]
  3932. .)b
  3933. All but
  3934. .q command
  3935. apply to client SMTP.
  3936. For back compatibility,
  3937. a timeout with no ``keyword='' part
  3938. will set all of the longer values.
  3939. .ip R
  3940. Normally,
  3941. .i sendmail
  3942. tries to eliminate any unnecessary explicit routes
  3943. when sending an error message
  3944. (as discussed in RFC 1123 \(sc 5.2.6).
  3945. For example,
  3946. when sending an error message to
  3947. .(b
  3948. <@known1,@known2,@unknown:user@known3>
  3949. .)b
  3950. .i sendmail
  3951. will strip off the
  3952. .q @known1
  3953. in order to make the route as direct as possible.
  3954. However, if the
  3955. .b R
  3956. option is set, this will be disabled,
  3957. and the mail will be sent to the first address in the route,
  3958. even if later addresses are known.
  3959. This may be useful if you are caught behind a firewall.
  3960. .ip s
  3961. Be super-safe when running things,
  3962. i.e.,
  3963. always instantiate the queue file,
  3964. even if you are going to attempt immediate delivery.
  3965. .i Sendmail
  3966. always instantiates the queue file
  3967. before returning control the client
  3968. under any circumstances.
  3969. .ip S\fIfile\fP
  3970. Log statistics in the named
  3971. .i file .
  3972. .ip t\fItzinfo\fP
  3973. Set the local time zone info to
  3974. .i tzinfo
  3975. \*- for example,
  3976. .q PST8PDT .
  3977. Actually, if this is not set,
  3978. the TZ environment variable is cleared (so the system default is used);
  3979. if set but null, the user's TZ variable is used,
  3980. and if set and non-null the TZ variable is set to this value.
  3981. .ip T\fIrtime/wtime\fP
  3982. Set the queue timeout to
  3983. .i rtime .
  3984. After this interval,
  3985. messages that have not been successfully sent
  3986. will be returned to the sender.
  3987. Defaults to five days.
  3988. The optional
  3989. .i wtime
  3990. is the time after which a warning message is sent.
  3991. If it is missing or zero
  3992. then no warning messages are sent.
  3993. .ip u\fIn\fP
  3994. Set the default userid for mailers to
  3995. .i n .
  3996. Mailers without the
  3997. .i S
  3998. flag in the mailer definition
  3999. will run as this user.
  4000. Defaults to 1.
  4001. The value can also be given as a symbolic user name.
  4002. .ip U\fIudbspec\fP
  4003. The user database specification.
  4004. .ip v
  4005. Run in verbose mode.
  4006. If this is set,
  4007. .i sendmail
  4008. adjusts options
  4009. .b c
  4010. (don't connect to expensive mailers)
  4011. and
  4012. .b d
  4013. (delivery mode)
  4014. so that all mail is delivered completely
  4015. in a single job
  4016. so that you can see the entire delivery process.
  4017. Option
  4018. .b v
  4019. should
  4020. .i never
  4021. be set in the configuration file;
  4022. it is intended for command line use only.
  4023. .ip V\fIfallbackhost\fP
  4024. If specified, the
  4025. .i fallbackhost
  4026. acts like a very low priority MX
  4027. on every host.
  4028. This is intended to be used by sites with poor network connectivity.
  4029. .ip w
  4030. If you are the
  4031. .q best
  4032. (that is, lowest preference)
  4033. MX for a given host,
  4034. you should normally detect this situation
  4035. and treat that condition specially,
  4036. by forwarding the mail to a UUCP feed,
  4037. treating it as local,
  4038. or whatever.
  4039. However, in some cases (such as Internet firewalls)
  4040. you may want to try to connect directly to that host
  4041. as though it had no MX records at all.
  4042. Setting this option causes
  4043. .i sendmail
  4044. to try this.
  4045. The downside is that errors in your configuration
  4046. are likely to be diagnosed as
  4047. .q "host unknown"
  4048. or
  4049. .q "message timed out"
  4050. instead of something more meaningful.
  4051. This option is disrecommended.
  4052. .ip x\fILA\fP
  4053. When the system load average exceeds
  4054. .i LA ,
  4055. just queue messages
  4056. (i.e., don't try to send them).
  4057. Defaults to 8.
  4058. .ip X\fILA\fP
  4059. When the system load average exceeds
  4060. .i LA ,
  4061. refuse incoming SMTP connections.
  4062. Defaults to 12.
  4063. .ip y\fIfact\fP
  4064. The indicated
  4065. .i fact or
  4066. is added to the priority (thus
  4067. .i lowering
  4068. the priority of the job)
  4069. for each recipient,
  4070. i.e., this value penalizes jobs with large numbers of recipients.
  4071. Defaults to 30000.
  4072. .ip Y
  4073. If set,
  4074. deliver each job that is run from the queue in a separate process.
  4075. Use this option if you are short of memory,
  4076. since the default tends to consume considerable amounts of memory
  4077. while the queue is being processed.
  4078. .ip z\fIfact\fP
  4079. The indicated
  4080. .i fact or
  4081. is multiplied by the message class
  4082. (determined by the Precedence: field in the user header
  4083. and the
  4084. .b P
  4085. lines in the configuration file)
  4086. and subtracted from the priority.
  4087. Thus, messages with a higher Priority: will be favored.
  4088. Defaults to 1800.
  4089. .ip Z\fIfact\fP
  4090. The
  4091. .i fact or
  4092. is added to the priority
  4093. every time a job is processed.
  4094. Thus,
  4095. each time a job is processed,
  4096. its priority will be decreased by the indicated value.
  4097. In most environments this should be positive,
  4098. since hosts that are down are all too often down for a long time.
  4099. Defaults to 90000.
  4100. .ip 7
  4101. Strip input to seven bits for compatibility with old systems.
  4102. This shouldn't be necessary.
  4103. .lp
  4104. All options can be specified on the command line using the
  4105. \-o flag,
  4106. but most will cause
  4107. .i sendmail
  4108. to relinquish its setuid permissions.
  4109. The options that will not cause this are
  4110. b, d, e, i, L, m, o, p, r, s, v, C, and 7.
  4111. Also, M (define macro) when defining the r or s macros
  4112. is also considered
  4113. .q safe .
  4114. .sh 3 "P \*- precedence definitions"
  4115. .pp
  4116. Values for the
  4117. .q "Precedence:"
  4118. field may be defined using the
  4119. .b P
  4120. control line.
  4121. The syntax of this field is:
  4122. .(b
  4123. \fBP\fP\fIname\fP\fB=\fP\fInum\fP
  4124. .)b
  4125. When the
  4126. .i name
  4127. is found in a
  4128. .q Precedence:
  4129. field,
  4130. the message class is set to
  4131. .i num .
  4132. Higher numbers mean higher precedence.
  4133. Numbers less than zero
  4134. have the special property
  4135. that if an error occurs during processing
  4136. the body of the message will not be returned;
  4137. this is expected to be used for
  4138. .q "bulk"
  4139. mail such as through mailing lists.
  4140. The default precedence is zero.
  4141. For example,
  4142. our list of precedences is:
  4143. .(b
  4144. Pfirst-class=0
  4145. Pspecial-delivery=100
  4146. Plist=\-30
  4147. Pbulk=\-60
  4148. Pjunk=\-100
  4149. .)b
  4150. People writing mailing list exploders
  4151. are encouraged to use
  4152. .q "Precedence: list" .
  4153. Older versions of
  4154. .i sendmail
  4155. (which discarded all error returns for negative precedences)
  4156. didn't recognize this name, giving it a default precedence of zero.
  4157. This allows list maintainers to see error returns
  4158. on both old and new versions of
  4159. .i sendmail .
  4160. .sh 3 "V \*- configuration version level"
  4161. .pp
  4162. To provide compatibility with old configuration files,
  4163. the
  4164. .b V
  4165. line has been added to define some very basic semantics
  4166. of the configuration file.
  4167. These are not intended to be long term supports;
  4168. rather, they describe compatibility features
  4169. which will probably be removed in future releases.
  4170. .pp
  4171. .b N.B.:
  4172. these version
  4173. .i levels
  4174. have nothing
  4175. to do with the version
  4176. .i number
  4177. on the files.
  4178. For example,
  4179. as of this writing
  4180. version 8 config files
  4181. (specifically, 8.6)
  4182. used version level 5 configurations.
  4183. .pp
  4184. .q Old
  4185. configuration files are defined as version level one.
  4186. Version level two files make the following changes:
  4187. .np
  4188. Host name canonification ($[ ... $])
  4189. appends a dot if the name is recognized;
  4190. this gives the config file a way of finding out if anything matched.
  4191. (Actually, this just initializes the
  4192. .q host
  4193. map with the
  4194. .q \-a.
  4195. flag \*- you can reset it to anything you prefer
  4196. by declaring the map explicitly.)
  4197. .np
  4198. Default host name extension is consistent throughout processing;
  4199. version level one configurations turned off domain extension
  4200. (that is, adding the local domain name)
  4201. during certain points in processing.
  4202. Version level two configurations are expected to include a trailing dot
  4203. to indicate that the name is already canonical.
  4204. .np
  4205. Local names that are not aliases
  4206. are passed through a new distinguished ruleset five;
  4207. this can be used to append a local relay.
  4208. This behaviour can be prevented by resolving the local name
  4209. with an initial `@'.
  4210. That is, something that resolves to a local mailer and a user name of
  4211. .q vikki
  4212. will be passed through ruleset five,
  4213. but a user name of
  4214. .q @vikki
  4215. will have the `@' stripped,
  4216. will not be passed through ruleset five,
  4217. but will otherwise be treated the same as the prior example.
  4218. The expectation is that this might be used to implement a policy
  4219. where mail sent to
  4220. .q vikki
  4221. was handled by a central hub,
  4222. but mail sent to
  4223. .q vikki@localhost
  4224. was delivered directly.
  4225. .pp
  4226. Version level three files
  4227. allow # initiated comments on all lines.
  4228. Exceptions are backslash escaped # marks
  4229. and the $# syntax.
  4230. .pp
  4231. Version level four configurations
  4232. are completely equivalent to level three
  4233. for historical reasons.
  4234. .pp
  4235. Version level five configuration files
  4236. change the default definition of
  4237. .b $w
  4238. to be just the first component of the hostname.
  4239. .pp
  4240. The
  4241. .b V
  4242. line may have an optional
  4243. .b / \c
  4244. .i vendor
  4245. to indicate that this configuration file uses modifications
  4246. specific to a particular vendor\**.
  4247. .(f
  4248. \**And of course, vendors are encouraged to add themselves
  4249. to the list of recognized vendors by editing the routine
  4250. .i setvendor
  4251. in
  4252. .i conf.c .
  4253. .)f
  4254. .sh 3 "K \*- key file declaration"
  4255. .pp
  4256. Special maps can be defined using the line:
  4257. .(b
  4258. Kmapname mapclass arguments
  4259. .)b
  4260. The
  4261. .i mapname
  4262. is the handle by which this map is referenced in the rewriting rules.
  4263. The
  4264. .i mapclass
  4265. is the name of a type of map;
  4266. these are compiled in to
  4267. .i sendmail .
  4268. The
  4269. .i arguments
  4270. are interpreted depending on the class;
  4271. typically,
  4272. there would be a single argument naming the file containing the map.
  4273. .pp
  4274. Maps are referenced using the syntax:
  4275. .(b
  4276. $( \fImap\fP \fIkey\fP $@ \fIarguments\fP $: \fIdefault\fP $)
  4277. .)b
  4278. where either or both of the
  4279. .i arguments
  4280. or
  4281. .i default
  4282. portion may be omitted.
  4283. The
  4284. .i arguments
  4285. may appear more than once.
  4286. The indicated
  4287. .i key
  4288. and
  4289. .i arguments
  4290. are passed to the appropriate mapping function.
  4291. If it returns a value, it replaces the input.
  4292. If it does not return a value and the
  4293. .i default
  4294. is specified, the
  4295. .i default
  4296. replaces the input.
  4297. Otherwise, the input is unchanged.
  4298. .pp
  4299. During replacement of either a map value or default
  4300. the string
  4301. .q %\fIn\fP
  4302. (where
  4303. .i n
  4304. is a digit)
  4305. is replaced by the corresponding
  4306. .i argument .
  4307. Argument zero
  4308. is always the database key.
  4309. For example, the rule
  4310. .(b
  4311. .ta 1.5i
  4312. R$- ! $+    $: $(uucp $1 $@ $2 $: %1 @ %0 . UUCP $)
  4313. .)b
  4314. Looks up the UUCP name in a (user defined) UUCP map;
  4315. if not found it turns it into
  4316. .q \&.UUCP
  4317. form.
  4318. The database might contain records like:
  4319. .(b
  4320. decvax    %1@%0.DEC.COM
  4321. research    %1@%0.ATT.COM
  4322. .)b
  4323. .pp
  4324. The built in map with both name and class
  4325. .q host
  4326. is the host name canonicalization lookup.
  4327. Thus,
  4328. the syntax:
  4329. .(b
  4330. $(host \fIhostname\fP$)
  4331. .)b
  4332. is equivalent to:
  4333. .(b
  4334. $[\fIhostname\fP$]
  4335. .)b
  4336. .pp
  4337. There are four predefined database lookup classes:
  4338. .q dbm ,
  4339. .q btree ,
  4340. .q hash ,
  4341. and
  4342. .q nis .
  4343. The first requires that
  4344. .i sendmail
  4345. be compiled with the
  4346. .b ndbm
  4347. library;
  4348. the second two require the
  4349. .b db
  4350. library,
  4351. and the third requires that
  4352. .i sendmail
  4353. be compiled with NIS support.
  4354. All four accept as arguments the same optional flags
  4355. and a filename
  4356. (or a mapname for NIS;
  4357. the filename is the root of the database path,
  4358. so that
  4359. .q .db
  4360. or some other extension appropriate for the database type
  4361. will be added to get the actual database name).
  4362. Known flags are:
  4363. .ip "\-o"
  4364. Indicates that this map is optional \*- that is,
  4365. if it cannot be opened,
  4366. no error is produced,
  4367. and
  4368. .i sendmail
  4369. will behave as if the map existed but was empty.
  4370. .ip "\-N"
  4371. Normally when maps are written,
  4372. the trailing null byte is not included as part of the key.
  4373. If this flag is indicated it will be included.
  4374. During lookups, only the null-byte-included form will be searched.
  4375. See also
  4376. .b \-O.
  4377. .ip "\-O"
  4378. If neither
  4379. .b \-N
  4380. or
  4381. .b \-O
  4382. are specified,
  4383. .i sendmail
  4384. uses an adaptive algorithm to decide whether or not to look for null bytes
  4385. on the end of keys.
  4386. It starts by trying both;
  4387. if it finds any key with a null byte it never tries again without a null byte
  4388. and vice versa.
  4389. If this flag is specified,
  4390. it never tries with a null byte;
  4391. this can speed matches but is never necessary.
  4392. If both
  4393. .b \-N
  4394. and
  4395. .b \-O
  4396. are specified,
  4397. .i sendmail
  4398. will never try any matches at all \(em
  4399. that is, everything will appear to fail.
  4400. .ip "\-a\fIx\fP"
  4401. Append the string
  4402. .i x
  4403. on successful matches.
  4404. For example, the default
  4405. .i host
  4406. map appends a dot on successful matches.
  4407. .ip "\-f"
  4408. Do not fold upper to lower case before looking up the key.
  4409. .ip "\-m"
  4410. Match only (without replacing the value).
  4411. If you only care about the existence of a key and not the value
  4412. (as you might when searching the NIS map
  4413. .q hosts.byname
  4414. for example),
  4415. this flag prevents the map from substituting the value.
  4416. However,
  4417. The \-a argument is still appended on a match,
  4418. and the default is still taken if the match fails.
  4419. .pp
  4420. The
  4421. .i dbm
  4422. map appends the strings
  4423. .q \&.pag
  4424. and
  4425. .q \&.dir
  4426. to the given filename;
  4427. the two
  4428. .i db -based
  4429. maps append
  4430. .q \&.db .
  4431. For example, the map specification
  4432. .(b
  4433. Kuucp dbm \-o \-N /usr/lib/uucpmap
  4434. .)b
  4435. specifies an optional map named
  4436. .q uucp
  4437. of class
  4438. .q dbm ;
  4439. it always has null bytes at the end of every string,
  4440. and the data is located in
  4441. /usr/lib/uucpmap.{dir,pag}.
  4442. .pp
  4443. The program
  4444. .i makemap (8)
  4445. can be used to build any of the three database-oriented maps.
  4446. It takes the following flags:
  4447. .ip \-f
  4448. Fold upper to lower case in the map.
  4449. .ip \-N
  4450. Include null bytes in keys.
  4451. .ip \-o
  4452. Append to an existing (old) file.
  4453. .ip \-r
  4454. Allow replacement of existing keys;
  4455. normally, re-inserting an existing key is an error.
  4456. .ip \-v
  4457. Print what is happening.
  4458. .lp
  4459. The
  4460. .i sendmail
  4461. daemon does not have to be restarted to read the new maps
  4462. as long as you change them in place;
  4463. file locking is used so that the maps won't be read
  4464. while they are being updated.\**
  4465. .(f
  4466. \**That is, don't create new maps and then use
  4467. .i mv (1)
  4468. to move them into place.
  4469. I consider this a shortfall (a.k.a. bug) in
  4470. .i sendmail
  4471. which should be fixed in a future release.
  4472. .)f
  4473. .pp
  4474. There are also two builtin maps that are,
  4475. strictly speaking,
  4476. not database lookups.
  4477. .pp
  4478. The
  4479. .q host
  4480. map does host domain canonification;
  4481. given a host name it calls the name server
  4482. to find the canonical name for that host.
  4483. .pp
  4484. The
  4485. .q dequote
  4486. map strips double quotes (") from a name.
  4487. It does not strip backslashes.
  4488. It will not strip quotes if the resulting string
  4489. would contain unscannable syntax
  4490. (that is, basic errors like unbalanced angle brackets;
  4491. more sophisticated errors such as unknown hosts are not checked).
  4492. The intent is for use when trying to accept mail from systems such as
  4493. DECnet
  4494. that routinely quote odd syntax such as
  4495. .(b
  4496. "49ers::ubell"
  4497. .)b
  4498. A typical usage is probably something like:
  4499. .(b
  4500. Kdequote dequote
  4501.  
  4502. \&...
  4503.  
  4504. R$\-    $: $(dequote $1 $)
  4505. R$\- $+    $: $>3 $1 $2
  4506. .)b
  4507. Care must be taken to prevent unexpected results;
  4508. for example,
  4509. .(b
  4510. "|someprogram < input > output"
  4511. .)b
  4512. will have quotes stripped,
  4513. but the result is probably not what you had in mind.
  4514. Fortunately these cases are rare.
  4515. .pp
  4516. New classes can be added in the routine
  4517. .b setupmaps
  4518. in file
  4519. .b conf.c .
  4520. .sh 2 "Building a Configuration File From Scratch"
  4521. .pp
  4522. Building a configuration table from scratch is an extremely difficult job.
  4523. Fortunately,
  4524. it is almost never necessary to do so;
  4525. nearly every situation that may come up
  4526. may be resolved by changing an existing table.
  4527. In any case,
  4528. it is critical that you understand what it is that you are trying to do
  4529. and come up with a philosophy for the configuration table.
  4530. This section is intended to explain what the real purpose
  4531. of a configuration table is
  4532. and to give you some ideas
  4533. for what your philosophy might be.
  4534. .pp
  4535. .b "Do not even consider"
  4536. writing your own configuration file
  4537. without carefully studying
  4538. RFC 821, 822, and 1123.
  4539. You should also read RFC 976
  4540. if you are doing UUCP exchange.
  4541. .sh 3 "What you are trying to do"
  4542. .pp
  4543. The configuration table has three major purposes.
  4544. The first and simplest
  4545. is to set up the environment for
  4546. .i sendmail .
  4547. This involves setting the options,
  4548. defining a few critical macros,
  4549. etc.
  4550. Since these are described in other places,
  4551. we will not go into more detail here.
  4552. .pp
  4553. The second purpose is to rewrite addresses in the message.
  4554. This should typically be done in two phases.
  4555. The first phase maps addresses in any format
  4556. into a canonical form.
  4557. This should be done in ruleset three.
  4558. The second phase maps this canonical form
  4559. into the syntax appropriate for the receiving mailer.
  4560. .i Sendmail
  4561. does this in three subphases.
  4562. Rulesets one and two
  4563. are applied to all sender and recipient addresses respectively.
  4564. After this,
  4565. you may specify per-mailer rulesets
  4566. for both sender and recipient addresses;
  4567. this allows mailer-specific customization.
  4568. Finally,
  4569. ruleset four is applied to do any default conversion
  4570. to external form.
  4571. .pp
  4572. The third purpose
  4573. is to map addresses into the actual set of instructions
  4574. necessary to get the message delivered.
  4575. Ruleset zero must resolve to the internal form,
  4576. which is in turn used as a pointer to a mailer descriptor.
  4577. The mailer descriptor describes the interface requirements
  4578. of the mailer.
  4579. .sh 3 "Philosophy"
  4580. .pp
  4581. The particular philosophy you choose will depend heavily
  4582. on the size and structure of your organization.
  4583. I will present a few possible philosophies here.
  4584. There are as many philosophies as there are config designers;
  4585. feel free to develop your own.
  4586. .pp
  4587. One general point applies to all of these philosophies:
  4588. it is almost always a mistake
  4589. to try to do full host route resolution.
  4590. For example,
  4591. if you are on a UUCP-only site
  4592. and you are trying to get names of the form
  4593. .q user@host
  4594. to the Internet,
  4595. it does not pay to route them to
  4596. .q xyzvax!decvax!ucbvax!c70!user@host
  4597. since you then depend on several links not under your control,
  4598. some of which are likely to misparse it anyway.
  4599. The best approach to this problem
  4600. is to simply forward the message for
  4601. .q user@host
  4602. to
  4603. .q xyzvax
  4604. and let xyzvax
  4605. worry about it from there.
  4606. In summary,
  4607. just get the message closer to the destination,
  4608. rather than determining the full path.
  4609. .sh 4 "Large site, many hosts \*- minimum information"
  4610. .pp
  4611. Berkeley is an example of a large site,
  4612. i.e., more than two or three hosts
  4613. and multiple mail connections.
  4614. We have decided that the only reasonable philosophy
  4615. in our environment
  4616. is to designate one host as the guru for our site.
  4617. It must be able to resolve any piece of mail it receives.
  4618. The other sites should have the minimum amount of information
  4619. they can get away with.
  4620. In addition,
  4621. any information they do have
  4622. should be hints rather than solid information.
  4623. .pp
  4624. For example,
  4625. a typical site on our local ether network is
  4626. .q monet
  4627. (actually
  4628. .q monet.CS.Berkeley.EDU ).
  4629. When monet receives mail for delivery,
  4630. it checks whether it knows
  4631. that the destination host is directly reachable;
  4632. if so, mail is sent to that host.
  4633. If it receives mail for any unknown host,
  4634. it just passes it directly to
  4635. .q ucbvax.CS.Berkeley.EDU ,
  4636. our master host.
  4637. Ucbvax may determine that the host name is illegal
  4638. and reject the message,
  4639. or may be able to do delivery.
  4640. However, it is important to note that when a new mail connection is added,
  4641. the only host that
  4642. .i must
  4643. have its tables updated
  4644. is ucbvax;
  4645. the others
  4646. .i may
  4647. be updated if convenient,
  4648. but this is not critical.
  4649. .pp
  4650. This picture is slightly muddied
  4651. due to network connections that are not actually located
  4652. on ucbvax.
  4653. For example,
  4654. some UUCP connections are currently on
  4655. .q ucbarpa.
  4656. However,
  4657. monet
  4658. .i "does not"
  4659. know about this;
  4660. the information is hidden totally between ucbvax and ucbarpa.
  4661. Mail going from monet to a UUCP host
  4662. is transferred via the ethernet
  4663. from monet to ucbvax,
  4664. then via the ethernet from ucbvax to ucbarpa,
  4665. and then is submitted to UUCP.
  4666. Although this involves some extra hops,
  4667. we feel this is an acceptable tradeoff.
  4668. .pp
  4669. An interesting point is that it would be possible
  4670. to update monet
  4671. to send appropriate UUCP mail directly to ucbarpa
  4672. if the load got too high;
  4673. if monet failed to note a host as connected to ucbarpa
  4674. it would go via ucbvax as before,
  4675. and if monet incorrectly sent a message to ucbarpa
  4676. it would still be sent by ucbarpa
  4677. to ucbvax as before.
  4678. The only problem that can occur is loops,
  4679. for example,
  4680. if ucbarpa thought that ucbvax had the UUCP connection
  4681. and vice versa.
  4682. For this reason,
  4683. updates should
  4684. .i always
  4685. happen to the master host first.
  4686. .pp
  4687. This philosophy results as much from the need
  4688. to have a single source for the configuration files
  4689. (typically built using
  4690. .i m4 \|(1)
  4691. or some similar tool)
  4692. as any logical need.
  4693. Maintaining more than three separate tables by hand
  4694. is essentially an impossible job.
  4695. .sh 4 "Small site \*- complete information"
  4696. .pp
  4697. A small site
  4698. (two or three hosts and few external connections)
  4699. may find it more reasonable to have complete information
  4700. at each host.
  4701. This would require that each host
  4702. know exactly where each network connection is,
  4703. possibly including the names of each host on that network.
  4704. As long as the site remains small
  4705. and the configuration remains relatively static,
  4706. the update problem will probably not be too great.
  4707. .sh 4 "Single host"
  4708. .pp
  4709. This is in some sense the trivial case.
  4710. The only major issue is trying to insure that you don't
  4711. have to know too much about your environment.
  4712. For example,
  4713. if you have a UUCP connection
  4714. you might find it useful to know about the names of hosts
  4715. connected directly to you,
  4716. but this is really not necessary
  4717. since this may be determined from the syntax.
  4718. .sh 4 "A completely different philosophy"
  4719. .pp
  4720. This is adapted from Bruce Lilly.
  4721. Any errors in interpretation are mine.
  4722. .pp
  4723. Do minimal changes in ruleset 3:
  4724. fix some common but unambiguous errors (e.g. trailing dot on domains) and
  4725. hide bang paths foo!bar into bar@foo.UUCP.
  4726. The resulting "canonical" form is any valid RFC822/RFC1123/RFC976 address.
  4727. .pp
  4728. Ruleset 0 does the bulk of the work.
  4729. It removes the trailing "@.UUCP" that hides bang paths,
  4730. strips anything not needed to resolve,
  4731. e.g. the phrase from phrase <route-addr> and from named groups,
  4732. rejects unparseable addresses using $#error,
  4733. and finally
  4734. resolves to a mailer/host/user triple.
  4735. Ruleset 0 is rather lengthy
  4736. as it has to handle 3 basic address forms:
  4737. RFC976 bang paths,
  4738. RFC1123 %-hacks
  4739. (including vanilla RFC822 local-part@domain),
  4740. and RFC822 source routes.
  4741. It's also complicated by having to handle named lists.
  4742. .pp
  4743. The header rewriting rulesets 1 and 2
  4744. remove the trailing "@.UUCP" that hides bang paths.
  4745. Ruleset 2 also strips the $# mailer $@ host (for test mode).
  4746. .pp
  4747. Ruleset 4 does absolutely nothing.
  4748. .pp
  4749. The per-mailer rewriting rulesets conform the envelope and
  4750. header addresses to the requirements of the specific
  4751. mailer.
  4752. .pp
  4753. Lots of rulesets-as-subroutines are used.
  4754. .pp
  4755. As a result, header addresses are subject to minimal munging
  4756. (per RFC1123), and the general plan is per RFC822 sect. 3.4.10.
  4757. .sh 3 "Relevant issues"
  4758. .pp
  4759. The canonical form you use
  4760. should almost certainly be as specified in
  4761. the Internet protocols
  4762. RFC819 and RFC822.
  4763. Copies of these RFC's are included on the
  4764. .i sendmail
  4765. tape
  4766. as
  4767. .i doc/rfc819.lpr
  4768. and
  4769. .i doc/rfc822.lpr .
  4770. .pp
  4771. RFC822
  4772. describes the format of the mail message itself.
  4773. .i Sendmail
  4774. follows this RFC closely,
  4775. to the extent that many of the standards described in this document
  4776. can not be changed without changing the code.
  4777. In particular,
  4778. the following characters have special interpretations:
  4779. .(b
  4780. < > ( ) " \e
  4781. .)b
  4782. Any attempt to use these characters for other than their RFC822
  4783. purpose in addresses is probably doomed to disaster.
  4784. .pp
  4785. RFC819
  4786. describes the specifics of the domain-based addressing.
  4787. This is touched on in RFC822 as well.
  4788. Essentially each host is given a name
  4789. which is a right-to-left dot qualified pseudo-path
  4790. from a distinguished root.
  4791. The elements of the path need not be physical hosts;
  4792. the domain is logical rather than physical.
  4793. For example,
  4794. at Berkeley
  4795. one legal host might be
  4796. .q a.CC.Berkeley.EDU ;
  4797. reading from right to left,
  4798. .q EDU
  4799. is a top level domain
  4800. comprising educational institutions,
  4801. .q Berkeley
  4802. is a logical domain name,
  4803. .q CC
  4804. represents the Computer Center,
  4805. (in this case a strictly logical entity),
  4806. and
  4807. .q a
  4808. is a host in the Computer Center.
  4809. .pp
  4810. Beware when reading RFC819
  4811. that there are a number of errors in it.
  4812. .sh 3 "How to proceed"
  4813. .pp
  4814. Once you have decided on a philosophy,
  4815. it is worth examining the available configuration tables
  4816. to decide if any of them are close enough
  4817. to steal major parts of.
  4818. Even under the worst of conditions,
  4819. there is a fair amount of boiler plate that can be collected safely.
  4820. .pp
  4821. The next step is to build ruleset three.
  4822. This will be the hardest part of the job.
  4823. Beware of doing too much to the address in this ruleset,
  4824. since anything you do will reflect through
  4825. to the message.
  4826. In particular,
  4827. stripping of local domains is best deferred,
  4828. since this can leave you with addresses with no domain spec at all.
  4829. Since
  4830. .i sendmail
  4831. likes to append the sending domain to addresses with no domain,
  4832. this can change the semantics of addresses.
  4833. Also try to avoid
  4834. fully qualifying domains in this ruleset.
  4835. Although technically legal,
  4836. this can lead to unpleasantly and unnecessarily long addresses
  4837. reflected into messages.
  4838. The Berkeley configuration files
  4839. define ruleset nine
  4840. to qualify domain names and strip local domains.
  4841. This is called from ruleset zero
  4842. to get all addresses into a cleaner form.
  4843. .pp
  4844. Once you have ruleset three finished,
  4845. the other rulesets should be relatively trivial.
  4846. If you need hints,
  4847. examine the supplied configuration tables.
  4848. .sh 3 "Testing the rewriting rules \*- the \-bt flag"
  4849. .pp
  4850. When you build a configuration table,
  4851. you can do a certain amount of testing
  4852. using the
  4853. .q "test mode"
  4854. of
  4855. .i sendmail .
  4856. For example,
  4857. you could invoke
  4858. .i sendmail
  4859. as:
  4860. .(b
  4861. sendmail \-bt \-Ctest.cf
  4862. .)b
  4863. which would read the configuration file
  4864. .q test.cf
  4865. and enter test mode.
  4866. In this mode,
  4867. you enter lines of the form:
  4868. .(b
  4869. rwset address
  4870. .)b
  4871. where
  4872. .i rwset
  4873. is the rewriting set you want to use
  4874. and
  4875. .i address
  4876. is an address to apply the set to.
  4877. Test mode shows you the steps it takes
  4878. as it proceeds,
  4879. finally showing you the address it ends up with.
  4880. You may use a comma separated list of rwsets
  4881. for sequential application of rules to an input.
  4882. For example:
  4883. .(b
  4884. 3,1,21,4 monet:bollard
  4885. .)b
  4886. first applies ruleset three to the input
  4887. .q monet:bollard.
  4888. Ruleset one is then applied to the output of ruleset three,
  4889. followed similarly by rulesets twenty-one and four.
  4890. .pp
  4891. If you need more detail,
  4892. you can also use the
  4893. .q \-d21
  4894. flag to turn on more debugging.
  4895. For example,
  4896. .(b
  4897. sendmail \-bt \-d21.99
  4898. .)b
  4899. turns on an incredible amount of information;
  4900. a single word address
  4901. is probably going to print out several pages worth of information.
  4902. .pp
  4903. You should be warned that internally,
  4904. .i sendmail
  4905. applies ruleset 3 to all addresses.
  4906. In this version of
  4907. .i sendmail ,
  4908. you will have to do that manually.
  4909. For example, older versions allowed you to use
  4910. .(b
  4911. 0 bruce@broadcast.sony.com
  4912. .)b
  4913. This version requires that you use:
  4914. .(b
  4915. 3,0 bruce@broadcast.sony.com
  4916. .)b
  4917. .sh 3 "Building mailer descriptions"
  4918. .pp
  4919. To add an outgoing mailer to your mail system,
  4920. you will have to define the characteristics of the mailer.
  4921. .pp
  4922. Each mailer must have an internal name.
  4923. This can be arbitrary,
  4924. except that the names
  4925. .q local
  4926. and
  4927. .q prog
  4928. must be defined.
  4929. .pp
  4930. The pathname of the mailer must be given in the P field.
  4931. If this mailer should be accessed via an IPC connection,
  4932. use the string
  4933. .q [IPC]
  4934. instead.
  4935. .pp
  4936. The F field defines the mailer flags.
  4937. You should specify an
  4938. .q f
  4939. or
  4940. .q r
  4941. flag to pass the name of the sender as a
  4942. .b \-f
  4943. or
  4944. .b \-r
  4945. flag respectively.
  4946. These flags are only passed if they were passed to
  4947. .i sendmail ,
  4948. so that mailers that give errors under some circumstances
  4949. can be placated.
  4950. If the mailer is not picky
  4951. you can just specify
  4952. .q "\-f $g"
  4953. in the argv template.
  4954. If the mailer must be called as
  4955. .b root
  4956. the
  4957. .q S
  4958. flag should be given;
  4959. this will not reset the userid
  4960. before calling the mailer\**.
  4961. .(f
  4962. \**\c
  4963. .i Sendmail
  4964. must be running setuid to root
  4965. for this to work.
  4966. .)f
  4967. If this mailer is local
  4968. (i.e., will perform final delivery
  4969. rather than another network hop)
  4970. the
  4971. .q l
  4972. flag should be given.
  4973. Quote characters
  4974. (backslashes and " marks)
  4975. can be stripped from addresses if the
  4976. .q s
  4977. flag is specified;
  4978. if this is not given
  4979. they are passed through.
  4980. If the mailer is capable of sending to more than one user
  4981. on the same host
  4982. in a single transaction
  4983. the
  4984. .q m
  4985. flag should be stated.
  4986. If this flag is on,
  4987. then the argv template containing
  4988. .b $u
  4989. will be repeated for each unique user
  4990. on a given host.
  4991. The
  4992. .q e
  4993. flag will mark the mailer as being
  4994. .q expensive,
  4995. which will cause
  4996. .i sendmail
  4997. to defer connection
  4998. until a queue run\**.
  4999. .(f
  5000. \**The
  5001. .q c
  5002. configuration option must be given
  5003. for this to be effective.
  5004. .)f
  5005. .pp
  5006. An unusual case is the
  5007. .q C
  5008. flag.
  5009. This flag applies to the mailer that the message is received from,
  5010. rather than the mailer being sent to;
  5011. if set,
  5012. the domain spec of the sender
  5013. (i.e., the
  5014. .q @host.domain
  5015. part)
  5016. is saved
  5017. and is appended to any addresses in the message
  5018. that do not already contain a domain spec.
  5019. For example,
  5020. a message of the form:
  5021. .(b
  5022. From: eric@vangogh.CS.Berkeley.EDU
  5023. To: wnj@monet.CS.Berkeley.EDU, mckusick
  5024. .)b
  5025. will be modified to:
  5026. .(b
  5027. From: eric@vangogh.CS.Berkeley.EDU
  5028. To: wnj@monet.CS.Berkeley.EDU, mckusick@vangogh.CS.Berkeley.EDU
  5029. .)b
  5030. .i "if and only if"
  5031. the
  5032. .q C
  5033. flag is defined in the mailer resolved to
  5034. by running
  5035. .q eric@vangogh.CS.Berkeley.EDU
  5036. through rulesets 3 and 0.
  5037. .pp
  5038. Other flags are described
  5039. in Appendix C.
  5040. .pp
  5041. The S and R fields in the mailer description
  5042. are per-mailer rewriting sets
  5043. to be applied to sender and recipient addresses
  5044. respectively.
  5045. These are applied after the sending domain is appended
  5046. and the general rewriting sets
  5047. (numbers one and two)
  5048. are applied,
  5049. but before the output rewrite
  5050. (ruleset four)
  5051. is applied.
  5052. A typical use is to append the current domain
  5053. to addresses that do not already have a domain.
  5054. For example,
  5055. a header of the form:
  5056. .(b
  5057. From: eric
  5058. .)b
  5059. might be changed to be:
  5060. .(b
  5061. From: eric@vangogh.CS.Berkeley.EDU
  5062. .)b
  5063. or
  5064. .(b
  5065. From: ucbvax!eric
  5066. .)b
  5067. depending on the domain it is being shipped into.
  5068. These sets can also be used
  5069. to do special purpose output rewriting
  5070. in cooperation with ruleset four.
  5071. .pp
  5072. The S and R fields
  5073. can be specified as two numbers separated by a slash
  5074. (e.g.,
  5075. .q "S=10/11" ),
  5076. meaning that all envelope addresses will be processed through ruleset 10
  5077. and all header addresses will be processed through ruleset 11.
  5078. With only one number specified,
  5079. both envelope and header rewriting sets are set to the indicated ruleset.
  5080. .pp
  5081. The E field defines the string to use
  5082. as an end-of-line indication.
  5083. A string containing only newline is the default.
  5084. The usual backslash escapes
  5085. (\er, \en, \ef, \eb)
  5086. may be used.
  5087. .pp
  5088. Finally,
  5089. an argv template is given as the A field.
  5090. It may have embedded spaces.
  5091. If there is no argv with a
  5092. .b $u
  5093. macro in it,
  5094. .i sendmail
  5095. will speak SMTP
  5096. to the mailer.
  5097. If the pathname for this mailer is
  5098. .q [IPC],
  5099. the argv should be
  5100. .(b
  5101. IPC $h [ \fIport\fP ]
  5102. .)b
  5103. where
  5104. .i port
  5105. is the optional port number
  5106. to connect to.
  5107. .pp
  5108. For example,
  5109. the specifications:
  5110. .(b
  5111. .ta \w'Mlocal, 'u +\w'P=/bin/mail, 'u +\w'F=rlsm, 'u +\w'S=10, 'u +\w'R=20, 'u
  5112. Mlocal,    P=/bin/mail,    F=rlsm    S=10,    R=20,    A=mail \-d $u
  5113. Mether,    P=[IPC],    F=meC,    S=11,    R=21,    A=IPC $h, M=100000
  5114. .)b
  5115. specifies a mailer to do local delivery
  5116. and a mailer for ethernet delivery.
  5117. The first is called
  5118. .q local,
  5119. is located in the file
  5120. .q /bin/mail,
  5121. takes a picky
  5122. .b \-r
  5123. flag,
  5124. does local delivery,
  5125. quotes should be stripped from addresses,
  5126. and multiple users can be delivered at once;
  5127. ruleset ten
  5128. should be applied to sender addresses in the message
  5129. and ruleset twenty
  5130. should be applied to recipient addresses;
  5131. the argv to send to a message will be the word
  5132. .q mail,
  5133. the word
  5134. .q \-d,
  5135. and words containing the name of the receiving user.
  5136. If a
  5137. .b \-r
  5138. flag is inserted
  5139. it will be between the words
  5140. .q mail
  5141. and
  5142. .q \-d.
  5143. The second mailer is called
  5144. .q ether,
  5145. it should be connected to via an IPC connection,
  5146. it can handle multiple users at once,
  5147. connections should be deferred,
  5148. and any domain from the sender address
  5149. should be appended to any receiver name
  5150. without a domain;
  5151. sender addresses should be processed by ruleset eleven
  5152. and recipient addresses by ruleset twenty-one.
  5153. There is a 100,000 byte limit on messages passed through this mailer.
  5154. .sh 2 "The User Database"
  5155. .pp
  5156. If you have a version of
  5157. .i sendmail
  5158. with the user database package
  5159. compiled in,
  5160. the handling of sender and recipient addresses
  5161. is modified.
  5162. .pp
  5163. The location of this database is controlled with the
  5164. .b U
  5165. option.
  5166. .sh 3 "Structure of the user database"
  5167. .pp
  5168. The database is a sorted (BTree-based) structure.
  5169. User records are stored with the key:
  5170. .(b
  5171. \fIuser-name\fP\fB:\fP\fIfield-name\fP
  5172. .)b
  5173. The sorted database format ensures that user records are clustered together.
  5174. Meta-information is always stored with a leading colon.
  5175. .pp
  5176. Field names define both the syntax and semantics of the value.
  5177. Defined fields include:
  5178. .nr ii 1i
  5179. .ip maildrop
  5180. The delivery address for this user.
  5181. There may be multiple values of this record.
  5182. In particular,
  5183. mailing lists will have one
  5184. .i maildrop
  5185. record for each user on the list.
  5186. .ip "mailname"
  5187. The outgoing mailname for this user.
  5188. For each outgoing name,
  5189. there should be an appropriate
  5190. .i maildrop
  5191. record for that name to allow return mail.
  5192. See also
  5193. .i :default:mailname .
  5194. .ip mailsender
  5195. Changes any mail sent to this address to have the indicated envelope sender.
  5196. This is intended for mailing lists,
  5197. and will normally be the name of an appropriate -request address.
  5198. It is very similar to the owner-\c
  5199. .i list
  5200. syntax in the alias file.
  5201. .ip fullname
  5202. The full name of the user.
  5203. .ip office-address
  5204. The office address for this user.
  5205. .ip office-phone
  5206. The office phone number for this user.
  5207. .ip office-fax
  5208. The office FAX number for this user.
  5209. .ip home-address
  5210. The home address for this user.
  5211. .ip home-phone
  5212. The home phone number for this user.
  5213. .ip home-fax
  5214. The home FAX number for this user.
  5215. .ip project
  5216. A (short) description of the project this person is affiliated with.
  5217. In the University this is often just the name of their graduate advisor.
  5218. .ip plan
  5219. A pointer to a file from which plan information can be gathered.
  5220. .pp
  5221. As of this writing,
  5222. only a few of these fields are actually being used by
  5223. .i sendmail :
  5224. .i maildrop
  5225. and
  5226. .i mailname .
  5227. A
  5228. .i finger
  5229. program that uses the other fields is planned.
  5230. .sh 3 "User database semantics"
  5231. .pp
  5232. When the rewriting rules submit an address to the local mailer,
  5233. the user name is passed through the alias file.
  5234. If no alias is found (or if the alias points back to the same address),
  5235. the name (with
  5236. .q :maildrop
  5237. appended)
  5238. is then used as a key in the user database.
  5239. If no match occurs (or if the maildrop points at the same address),
  5240. forwarding is tried.
  5241. .pp
  5242. If the first token of the user name returned by ruleset 0
  5243. is an
  5244. .q @
  5245. sign, the user database lookup is skipped.
  5246. The intent is that the user database will act as a set of defaults
  5247. for a cluster (in our case, the Computer Science Division);
  5248. mail sent to a specific machine should ignore these defaults.
  5249. .pp
  5250. When mail is sent,
  5251. the name of the sending user is looked up in the database.
  5252. If that user has a
  5253. .q mailname
  5254. record,
  5255. the value of that record is used as their outgoing name.
  5256. For example, I might have a record:
  5257. .(b
  5258. eric:mailname    Eric.Allman@CS.Berkeley.EDU
  5259. .)b
  5260. This would cause my outgoing mail to be sent as Eric.Allman.
  5261. .pp
  5262. If a
  5263. .q maildrop
  5264. is found for the user,
  5265. but no corresponding
  5266. .q mailname
  5267. record exists,
  5268. the record
  5269. .q :default:mailname
  5270. is consulted.
  5271. If present, this is the name of a host to override the local host.
  5272. For example, in our case we would set it to
  5273. .q CS.Berkeley.EDU .
  5274. The effect is that anyone known in the database
  5275. gets their outgoing mail stamped as
  5276. .q user@CS.Berkeley.EDU ,
  5277. but people not listed in the database use the local hostname.
  5278. .sh 3 "Creating the database\**"
  5279. .(f
  5280. \**These instructions are known to be incomplete.
  5281. A future version of the user database is planned
  5282. including things such as finger service \*- and good documentation.
  5283. .)f
  5284. .pp
  5285. The user database is built from a text file
  5286. using the
  5287. .i makemap
  5288. utility
  5289. (in the distribution in the makemap subdirectory).
  5290. The text file is a series of lines corresponding to userdb records;
  5291. each line has a key and a value separated by white space.
  5292. The key is always in the format described above \*-
  5293. for example:
  5294. .(b
  5295. eric:maildrop
  5296. .)b
  5297. This file is normally installed in a system directory;
  5298. for example, it might be called
  5299. .i /etc/userdb .
  5300. To make the database version of the map, run the program:
  5301. .(b
  5302. makemap btree /etc/userdb.db < /etc/userdb
  5303. .)b
  5304. Then create a config file that uses this.
  5305. For example, using the V8 M4 configuration, include the
  5306. following line in your .mc file:
  5307. .(b
  5308. define(\`confUSERDB_SPEC\', /etc/userdb.db)
  5309. .)b
  5310. .sh 1 "OTHER CONFIGURATION"
  5311. .pp
  5312. There are some configuration changes that can be made by
  5313. recompiling
  5314. .i sendmail .
  5315. This section describes what changes can be made
  5316. and what has to be modified to make them.
  5317. .sh 2 "Parameters in src/Makefile"
  5318. .pp
  5319. These parameters are intended to describe the compilation environment,
  5320. not site policy,
  5321. and should normally be defined in src/Makefile.
  5322. .ip NDBM
  5323. If set,
  5324. the new version of the DBM library
  5325. that allows multiple databases will be used.
  5326. If neither NDBM nor NEWDB are set,
  5327. a much less efficient method of alias lookup is used.
  5328. .ip NEWDB
  5329. If set, use the new database package from Berkeley (from 4.4BSD).
  5330. This package is substantially faster than DBM or NDBM.
  5331. If NEWDB and NDBM are both set,
  5332. .i sendmail
  5333. will read DBM files,
  5334. but will create and use NEWDB files.
  5335. .ip NIS
  5336. Include support for NIS.
  5337. If set together with
  5338. .i both
  5339. NEWDB and NDBM,
  5340. .i sendmail
  5341. will create both DBM and NEWDB files if and only if
  5342. the file /var/yp/Makefile
  5343. exists and is readable.
  5344. This is intended for compatibility with Sun Microsystems'
  5345. .i mkalias
  5346. program used on YP masters.
  5347. .ip SYSTEM5
  5348. Set all of the compilation parameters appropriate for System V.
  5349. .ip LOCKF
  5350. Use System V
  5351. .b lockf
  5352. instead of Berkeley
  5353. .b flock .
  5354. Due to the highly unusual semantics of locks
  5355. across forks in
  5356. .b lockf ,
  5357. this should never be used unless absolutely necessary.
  5358. Set by default if
  5359. SYSTEM5 is set.
  5360. .ip SYS5TZ
  5361. Use System V
  5362. time zone semantics.
  5363. .ip HASINITGROUPS
  5364. Set this if your system has the
  5365. .i initgroups()
  5366. call
  5367. (if you have multiple group support).
  5368. This is the default if SYSTEM5 is
  5369. .i not
  5370. defined or if you are on HPUX.
  5371. .ip HASUNAME
  5372. Set this if you have the
  5373. .i uname (2)
  5374. system call (or corresponding library routine).
  5375. Set by default if
  5376. SYSTEM5
  5377. is set.
  5378. .ip HASSTATFS
  5379. Set this if you have the
  5380. .i statfs (2)
  5381. system call.
  5382. This will allow you to give a temporary failure
  5383. message to incoming SMTP email
  5384. when you are low on disk space.
  5385. It is set by default on 4.4BSD and OSF/1 systems.
  5386. .ip HASUSTAT
  5387. Set if you have the
  5388. .i ustat (2)
  5389. system call.
  5390. This is an alternative implementation of disk space control.
  5391. You should only set one of HASSTATFS or HASUSTAT;
  5392. the first is preferred.
  5393. .ip _PATH_SENDMAILCF
  5394. The pathname of the sendmail.cf file.
  5395. .ip _PATH_SENDMAILPID
  5396. The pathname of the sendmail.pid file.
  5397. .ip LA_TYPE
  5398. The load average type.
  5399. Details are described below.
  5400. .lp
  5401. The are several built-in ways of computing the load average.
  5402. .i Sendmail
  5403. tries to auto-configure them based on imperfect guesses;
  5404. you can select one using the
  5405. .i cc
  5406. option
  5407. .b \-DLA_TYPE= \c
  5408. .i type ,
  5409. where
  5410. .i type
  5411. is:
  5412. .ip LA_INT
  5413. The kernel stores the load average in the kernel as an array of long integers.
  5414. The actual values are scaled by a factor FSCALE
  5415. (default 256).
  5416. .ip LA_SHORT
  5417. The kernel stores the load average in the kernel as an array of short integers.
  5418. The actual values are scaled by a factor FSCALE
  5419. (default 256).
  5420. .ip LA_FLOAT
  5421. The kernel stores the load average in the kernel as an array of
  5422. double precision floats.
  5423. .ip LA_MACH
  5424. Use MACH-style load averages.
  5425. .ip LA_SUBR
  5426. Call the
  5427. .i getloadavg
  5428. routine to get the load average as an array of doubles.
  5429. .ip LA_ZERO
  5430. Always return zero as the load average.
  5431. This is the fallback case.
  5432. .lp
  5433. If type
  5434. .sm LA_INT ,
  5435. .sm LA_SHORT ,
  5436. or
  5437. .sm LA_FLOAT
  5438. is specified,
  5439. you may also need to specify
  5440. .sm _PATH_UNIX
  5441. (the path to your system binary)
  5442. and
  5443. .sm LA_AVENRUN
  5444. (the name of the variable containing the load average in the kernel;
  5445. usually
  5446. .q _avenrun
  5447. or
  5448. .q avenrun ).
  5449. .pp
  5450. There are also several compilation flags to indicate the environment
  5451. such as
  5452. .q _AIX3
  5453. and
  5454. .q _SCO_unix_ .
  5455. See the READ_ME
  5456. file for the latest scoop on these flags.
  5457. .sh 2 "Parameters in src/conf.h"
  5458. .pp
  5459. Parameters and compilation options
  5460. are defined in conf.h.
  5461. Most of these need not normally be tweaked;
  5462. common parameters are all in sendmail.cf.
  5463. However, the sizes of certain primitive vectors, etc.,
  5464. are included in this file.
  5465. The numbers following the parameters
  5466. are their default value.
  5467. .nr ii 1.2i
  5468. .ip "MAXLINE [1024]"
  5469. The maximum line length of any input line.
  5470. If message lines exceed this length
  5471. they will still be processed correctly;
  5472. however, header lines,
  5473. configuration file lines,
  5474. alias lines,
  5475. etc.,
  5476. must fit within this limit.
  5477. .ip "MAXNAME [256]"
  5478. The maximum length of any name,
  5479. such as a host or a user name.
  5480. .ip "MAXPV [40]"
  5481. The maximum number of parameters to any mailer.
  5482. This limits the number of recipients that may be passed in one transaction.
  5483. It can be set to any arbitrary number above about 10,
  5484. since
  5485. .i sendmail
  5486. will break up a delivery into smaller batches as needed.
  5487. A higher number may reduce load on your system, however.
  5488. .ip "MAXATOM [100]"
  5489. The maximum number of atoms
  5490. (tokens)
  5491. in a single address.
  5492. For example,
  5493. the address
  5494. .q "eric@CS.Berkeley.EDU"
  5495. is seven atoms.
  5496. .ip "MAXMAILERS [25]"
  5497. The maximum number of mailers that may be defined
  5498. in the configuration file.
  5499. .ip "MAXRWSETS [100]"
  5500. The maximum number of rewriting sets
  5501. that may be defined.
  5502. .ip "MAXPRIORITIES [25]"
  5503. The maximum number of values for the
  5504. .q Precedence:
  5505. field that may be defined
  5506. (using the
  5507. .b P
  5508. line in sendmail.cf).
  5509. .ip "MAXUSERENVIRON [40]"
  5510. The maximum number of items in the user environment
  5511. that will be passed to subordinate mailers.
  5512. .ip "QUEUESIZE [1000]"
  5513. The maximum number of entries that will be processed
  5514. in a single queue run.
  5515. .ip "MAXMXHOSTS [20]"
  5516. The maximum number of MX records we will accept for any single host.
  5517. .lp
  5518. A number of other compilation options exist.
  5519. These specify whether or not specific code should be compiled in.
  5520. .nr ii 1.2i
  5521. .ip DEBUG
  5522. If set, debugging information is compiled in.
  5523. To actually get the debugging output,
  5524. the
  5525. .b \-d
  5526. flag must be used.
  5527. .b "WE STRONGLY RECOMMEND THAT THIS BE LEFT ON."
  5528. Some people, believing that it was a security hole
  5529. (it was, once)
  5530. have turned it off and thus crippled debuggers.
  5531. .ip NETINET
  5532. If set,
  5533. support for Internet protocol networking is compiled in.
  5534. Previous versions of
  5535. .i sendmail
  5536. referred to this as
  5537. .sm DAEMON ;
  5538. this old usage is now incorrect.
  5539. .ip NETISO
  5540. If set,
  5541. support for ISO protocol networking is compiled in
  5542. (it may be appropriate to #define this in the Makefile instead of conf.h).
  5543. .ip LOG
  5544. If set,
  5545. the
  5546. .i syslog
  5547. routine in use at some sites is used.
  5548. This makes an informational log record
  5549. for each message processed,
  5550. and makes a higher priority log record
  5551. for internal system errors.
  5552. .ip MATCHGECOS
  5553. Compile in the code to do ``fuzzy matching'' on the GECOS field
  5554. in /etc/passwd.
  5555. This also requires that option G be turned on.
  5556. .ip NAMED_BIND
  5557. Compile in code to use the
  5558. Berkeley Internet Name Domain (BIND) server
  5559. to resolve TCP/IP host names.
  5560. .ip NOTUNIX
  5561. If you are using a non-UNIX mail format,
  5562. you can set this flag to turn off special processing
  5563. of UNIX-style
  5564. .q "From "
  5565. lines.
  5566. .ip QUEUE
  5567. This flag should be set to compile in the queueing code.
  5568. If this is not set,
  5569. mailers must accept the mail immediately
  5570. or it will be returned to the sender.
  5571. .ip SETPROCTITLE
  5572. If defined,
  5573. .i sendmail
  5574. will change its
  5575. .i argv
  5576. array to indicate its current status.
  5577. This can be used in conjunction with the
  5578. .i ps
  5579. command to find out just what it's up to.
  5580. .ip SMTP
  5581. If set,
  5582. the code to handle user and server SMTP will be compiled in.
  5583. This is only necessary if your machine has some mailer
  5584. that speaks SMTP
  5585. (this means most machines everywhere).
  5586. .ip UGLYUUCP
  5587. If you have a UUCP host adjacent to you which is not running
  5588. a reasonable version of
  5589. .i rmail ,
  5590. you will have to set this flag to include the
  5591. .q "remote from sysname"
  5592. info on the from line.
  5593. Otherwise, UUCP gets confused about where the mail came from.
  5594. .ip USERDB
  5595. Include the
  5596. .b experimental
  5597. Berkeley user information database package.
  5598. This adds a new level of local name expansion
  5599. between aliasing and forwarding.
  5600. It also uses the NEWDB package.
  5601. This may change in future releases.
  5602. .ip IDENTPROTO
  5603. Compile in the IDENT protocol as defined in RFC 1413.
  5604. This defaults on for all systems except Ultrix,
  5605. which apparently has the interesting
  5606. .q feature
  5607. that when it receives a
  5608. .q "host unreachable"
  5609. message it closes all open connections to that host.
  5610. Since some firewall gateways send this error code
  5611. when you access an unauthorized port (such as 113, used by IDENT),
  5612. Ultrix cannot receive email from such hosts.
  5613. .sh 2 "Configuration in src/conf.c"
  5614. .pp
  5615. The following changes can be made in conf.c.
  5616. .sh 3 "Built-in Header Semantics"
  5617. .pp
  5618. Not all header semantics are defined in the configuration file.
  5619. Header lines that should only be included by certain mailers
  5620. (as well as other more obscure semantics)
  5621. must be specified in the
  5622. .i HdrInfo
  5623. table in
  5624. .i conf.c .
  5625. This table contains the header name
  5626. (which should be in all lower case)
  5627. and a set of header control flags (described below),
  5628. The flags are:
  5629. .ip H_ACHECK
  5630. Normally when the check is made to see if a header line is compatible
  5631. with a mailer,
  5632. .i sendmail
  5633. will not delete an existing line.
  5634. If this flag is set,
  5635. .i sendmail
  5636. will delete
  5637. even existing header lines.
  5638. That is,
  5639. if this bit is set and the mailer does not have flag bits set
  5640. that intersect with the required mailer flags
  5641. in the header definition in
  5642. sendmail.cf,
  5643. the header line is
  5644. .i always
  5645. deleted.
  5646. .ip H_EOH
  5647. If this header field is set,
  5648. treat it like a blank line,
  5649. i.e.,
  5650. it will signal the end of the header
  5651. and the beginning of the message text.
  5652. .ip H_FORCE
  5653. Add this header entry
  5654. even if one existed in the message before.
  5655. If a header entry does not have this bit set,
  5656. .i sendmail
  5657. will not add another header line if a header line
  5658. of this name already existed.
  5659. This would normally be used to stamp the message
  5660. by everyone who handled it.
  5661. .ip H_TRACE
  5662. If set,
  5663. this is a timestamp
  5664. (trace)
  5665. field.
  5666. If the number of trace fields in a message
  5667. exceeds a preset amount
  5668. the message is returned
  5669. on the assumption that it has an aliasing loop.
  5670. .ip H_RCPT
  5671. If set,
  5672. this field contains recipient addresses.
  5673. This is used by the
  5674. .b \-t
  5675. flag to determine who to send to
  5676. when it is collecting recipients from the message.
  5677. .ip H_FROM
  5678. This flag indicates that this field
  5679. specifies a sender.
  5680. The order of these fields in the
  5681. .i HdrInfo
  5682. table specifies
  5683. .i sendmail 's
  5684. preference
  5685. for which field to return error messages to.
  5686. .nr ii 5n
  5687. .lp
  5688. Let's look at a sample
  5689. .i HdrInfo
  5690. specification:
  5691. .(b
  5692. .ta 4n +\w'"return-receipt-to",  'u
  5693. struct hdrinfo    HdrInfo[] =
  5694. \&{
  5695.          /* originator fields, most to least significant  */
  5696.     "resent-sender",    H_FROM,
  5697.     "resent-from",    H_FROM,
  5698.     "sender",    H_FROM,
  5699.     "from",    H_FROM,
  5700.     "full-name",    H_ACHECK,
  5701.          /* destination fields */
  5702.     "to",    H_RCPT,
  5703.     "resent-to",    H_RCPT,
  5704.     "cc",    H_RCPT,
  5705.          /* message identification and control */
  5706.     "message",    H_EOH,
  5707.     "text",    H_EOH,
  5708.          /* trace fields */
  5709.     "received",    H_TRACE|H_FORCE,
  5710.  
  5711.     NULL,    0,
  5712. };
  5713. .)b
  5714. This structure indicates that the
  5715. .q To: ,
  5716. .q Resent-To: ,
  5717. and
  5718. .q Cc:
  5719. fields
  5720. all specify recipient addresses.
  5721. Any
  5722. .q Full-Name:
  5723. field will be deleted unless the required mailer flag
  5724. (indicated in the configuration file)
  5725. is specified.
  5726. The
  5727. .q Message:
  5728. and
  5729. .q Text:
  5730. fields will terminate the header;
  5731. these are used by random dissenters around the network world.
  5732. The
  5733. .q Received:
  5734. field will always be added,
  5735. and can be used to trace messages.
  5736. .pp
  5737. There are a number of important points here.
  5738. First,
  5739. header fields are not added automatically just because they are in the
  5740. .i HdrInfo
  5741. structure;
  5742. they must be specified in the configuration file
  5743. in order to be added to the message.
  5744. Any header fields mentioned in the configuration file but not
  5745. mentioned in the
  5746. .i HdrInfo
  5747. structure have default processing performed;
  5748. that is,
  5749. they are added unless they were in the message already.
  5750. Second,
  5751. the
  5752. .i HdrInfo
  5753. structure only specifies cliched processing;
  5754. certain headers are processed specially by ad hoc code
  5755. regardless of the status specified in
  5756. .i HdrInfo .
  5757. For example,
  5758. the
  5759. .q Sender:
  5760. and
  5761. .q From:
  5762. fields are always scanned on ARPANET mail
  5763. to determine the sender\**;
  5764. .(f
  5765. \**Actually, this is no longer true in SMTP;
  5766. this information is contained in the envelope.
  5767. The older ARPANET protocols did not completely distinguish
  5768. envelope from header.
  5769. .)f
  5770. this is used to perform the
  5771. .q "return to sender"
  5772. function.
  5773. The
  5774. .q "From:"
  5775. and
  5776. .q "Full-Name:"
  5777. fields are used to determine the full name of the sender
  5778. if possible;
  5779. this is stored in the macro
  5780. .b $x
  5781. and used in a number of ways.
  5782. .sh 3 "Restricting Use of Email"
  5783. .pp
  5784. If it is necessary to restrict mail through a relay,
  5785. the
  5786. .i checkcompat
  5787. routine can be modified.
  5788. This routine is called for every recipient address.
  5789. It returns an exit status
  5790. indicating the status of the message.
  5791. The status
  5792. .sm EX_OK
  5793. accepts the address,
  5794. .sm EX_TEMPFAIL
  5795. queues the message for a later try,
  5796. and other values
  5797. (commonly
  5798. .sm EX_UNAVAILABLE )
  5799. reject the message.
  5800. It is up to
  5801. .i checkcompat
  5802. to print an error message
  5803. (using
  5804. .i usrerr )
  5805. if the message is rejected.
  5806. For example,
  5807. .i checkcompat
  5808. could read:
  5809. .(b
  5810. .re
  5811. .sz -1
  5812. .ta 4n +4n +4n +4n +4n +4n +4n
  5813. int
  5814. checkcompat(to, e)
  5815.     register ADDRESS *to;
  5816.     register ENVELOPE *e;
  5817. \&{
  5818.     register STAB *s;
  5819.  
  5820.     s = stab("private", ST_MAILER, ST_FIND);
  5821.     if (s != NULL && e\->e_from.q_mailer != LocalMailer &&
  5822.         to->q_mailer == s->s_mailer)
  5823.     {
  5824.         usrerr("No private net mail allowed through this machine");
  5825.         return (EX_UNAVAILABLE);
  5826.     }
  5827.     if (MsgSize > 50000 && to\->q_mailer != LocalMailer)
  5828.     {
  5829.         usrerr("Message too large for non-local delivery");
  5830.         NoReturn = TRUE;
  5831.         return (EX_UNAVAILABLE);
  5832.     }
  5833.     return (EX_OK);
  5834. }
  5835. .sz
  5836. .)b
  5837. This would reject messages greater than 50000 bytes
  5838. unless they were local.
  5839. The
  5840. .i NoReturn
  5841. flag can be sent to suppress the return of the actual body
  5842. of the message in the error return.
  5843. The actual use of this routine is highly dependent on the
  5844. implementation,
  5845. and use should be limited.
  5846. .sh 3 "Load Average Computation"
  5847. .pp
  5848. The routine
  5849. .i getla
  5850. should return an approximation of the current system load average
  5851. as an integer.
  5852. There are four versions included on compilation flags
  5853. as described above.
  5854. .sh 3 "New Database Map Classes"
  5855. .pp
  5856. New key maps can be added by creating a class initialization function
  5857. and a lookup function.
  5858. These are then added to the routine
  5859. .i setupmaps.
  5860. .pp
  5861. The initialization function is called as
  5862. .(b
  5863. \fIxxx\fP_map_init(MAP *map, char *mapname, char *args)
  5864. .)b
  5865. The
  5866. .i map
  5867. is an internal data structure.
  5868. The
  5869. .i mapname
  5870. is the name of the map (used for error messages).
  5871. The
  5872. .i args
  5873. is a pointer to the rest of the configuration file line;
  5874. flags and filenames can be extracted from this line.
  5875. The initialization function must return
  5876. .sm TRUE
  5877. if it successfully opened the map,
  5878. .sm FALSE
  5879. otherwise.
  5880. .pp
  5881. The lookup function is called as
  5882. .(b
  5883. \fIxxx\fP_map_lookup(MAP *map, char buf[], int bufsize, char **av, int *statp)
  5884. .)b
  5885. The
  5886. .i map
  5887. defines the map internally.
  5888. The parameters
  5889. .i buf
  5890. and
  5891. .i bufsize
  5892. have the input key.
  5893. This may be (and often is) used destructively.
  5894. The
  5895. .i av
  5896. is a list of arguments passed in from the rewrite line.
  5897. The lookup function should return a pointer to the new value.
  5898. IF the map lookup fails,
  5899. .i *statp
  5900. should be set to an exit status code;
  5901. in particular, it should be set to
  5902. .sm EX_TEMPFAIL
  5903. if recovery is to be attempted by the higher level code.
  5904. .sh 3 "Queueing Function"
  5905. .pp
  5906. The routine
  5907. .i shouldqueue
  5908. is called to decide if a message should be queued
  5909. or processed immediately.
  5910. Typically this compares the message priority to the current load average.
  5911. The default definition is:
  5912. .(b
  5913. bool
  5914. shouldqueue(pri, ctime)
  5915.     long pri;
  5916.     time_t ctime;
  5917. {
  5918.     if (CurrentLA < QueueLA)
  5919.         return (FALSE);
  5920.     if (CurrentLA >= RefuseLA)
  5921.         return (TRUE);
  5922.     return (pri > (QueueFactor / (CurrentLA \- QueueLA + 1)));
  5923. }
  5924. .)b
  5925. If the current load average
  5926. (global variable
  5927. .i CurrentLA ,
  5928. which is set before this function is called)
  5929. is less than the low threshold load average
  5930. (option
  5931. .b x ,
  5932. variable
  5933. .i QueueLA ),
  5934. .i shouldqueue
  5935. returns
  5936. .sm FALSE
  5937. immediately
  5938. (that is, it should
  5939. .i not
  5940. queue).
  5941. If the current load average exceeds the high threshold load average
  5942. (option
  5943. .b X ,
  5944. variable
  5945. .i RefuseLA ),
  5946. .i shouldqueue
  5947. returns
  5948. .sm TRUE
  5949. immediately.
  5950. Otherwise, it computes the function based on the message priority,
  5951. the queue factor
  5952. (option
  5953. .b q ,
  5954. global variable
  5955. .i QueueFactor ),
  5956. and the current and threshold load averages.
  5957. .pp
  5958. An implementation wishing to take the actual age of the message into account
  5959. can also use the
  5960. .i ctime
  5961. parameter,
  5962. which is the time that the message was first submitted to
  5963. .i sendmail .
  5964. Note that the
  5965. .i pri
  5966. parameter is already weighted
  5967. by the number of times the message has been tried
  5968. (although this tends to lower the priority of the message with time);
  5969. the expectation is that the
  5970. .i ctime
  5971. would be used as an
  5972. .q "escape clause"
  5973. to ensure that messages are eventually processed.
  5974. .sh 3 "Refusing Incoming SMTP Connections"
  5975. .pp
  5976. The function
  5977. .i refuseconnections
  5978. returns
  5979. .sm TRUE
  5980. if incoming SMTP connections should be refused.
  5981. The current implementation is based exclusively on the current load average
  5982. and the refuse load average option
  5983. (option
  5984. .b X ,
  5985. global variable
  5986. .i RefuseLA ):
  5987. .(b
  5988. bool
  5989. refuseconnections()
  5990. {
  5991.     return (CurrentLA >= RefuseLA);
  5992. }
  5993. .)b
  5994. A more clever implementation
  5995. could look at more system resources.
  5996. .sh 3 "Load Average Computation"
  5997. .pp
  5998. The routine
  5999. .i getla
  6000. returns the current load average (as a rounded integer).
  6001. The distribution includes several possible implementations.
  6002. .sh 2 "Configuration in src/daemon.c"
  6003. .pp
  6004. The file
  6005. .i src/daemon.c
  6006. contains a number of routines that are dependent
  6007. on the local networking environment.
  6008. The version supplied assumes you have BSD style sockets.
  6009. .pp
  6010. In previous releases,
  6011. we recommended that you modify the routine
  6012. .i maphostname
  6013. if you wanted to generalize
  6014. .b $[
  6015. \&...\&
  6016. .b $]
  6017. lookups.
  6018. We now recommend that you create a new keyed map instead.
  6019. .sh 1 "CHANGES IN VERSION 8"
  6020. .pp
  6021. The following summarizes changes
  6022. since the last commonly available version of
  6023. .i sendmail
  6024. (5.67):
  6025. .sh 2 "Connection Caching"
  6026. .pp
  6027. Instead of closing SMTP connections immediately,
  6028. those connections are cached for possible future use.
  6029. The advent of MX records made this effective for mailing lists;
  6030. in addition,
  6031. substantial performance improvements can be expected for queue processing.
  6032. .sh 2 "MX Piggybacking"
  6033. .pp
  6034. If two hosts with different names in a single message
  6035. happen to have the same set of MX hosts,
  6036. they can be sent in the same transaction.
  6037. Version 8 notices this and tries to batch the messages.
  6038. .sh 2 "RFC 1123 Compliance"
  6039. .pp
  6040. A number of changes have been made to make
  6041. .i sendmail
  6042. .q "conditionally compliant"
  6043. (that is,
  6044. .i sendmail
  6045. satisfies all of the
  6046. .q MUST
  6047. clauses and most but not all of the
  6048. .q SHOULD
  6049. clauses in RFC 1123).
  6050. .pp
  6051. The major areas of change are (numbers are RFC 1123 section numbers):
  6052. .nr ii \w'5.3.1.1\0\0'u
  6053. .ip 5.2.7
  6054. Response to RCPT command is fast.
  6055. .ip 5.2.8
  6056. Numeric IP addresses are logged in Received: lines.
  6057. .ip 5.2.17
  6058. Self domain literal is properly handled.
  6059. .ip 5.3.2
  6060. Better control over individual timeouts.
  6061. .ip 5.3.3
  6062. Error messages are sent as
  6063. .q From:<> .
  6064. .ip 5.3.3
  6065. Error messages are never sent to
  6066. .q <> .
  6067. .ip 5.3.3
  6068. Route-addrs are pruned.
  6069. .lp
  6070. The areas in which
  6071. .i sendmail
  6072. is not
  6073. .q "unconditionally compliant"
  6074. are:
  6075. .ip 5.2.6
  6076. .i Sendmail
  6077. does do header munging.
  6078. .ip 5.2.10
  6079. .i Sendmail
  6080. doesn't always use the exact SMTP message text
  6081. as listed in RFC 821.
  6082. .ip 5.3.1.1
  6083. .i Sendmail
  6084. doesn't guarantee only one connect for each host in queue runs.
  6085. .ip 5.3.1.1
  6086. .i Sendmail
  6087. doesn't always provide adequate concurrency limits.
  6088. .sh 2 "Extended SMTP Support"
  6089. .pp
  6090. Version 8 includes both sending and receiving support for Extended
  6091. SMTP support as defined by RFC 1425 (basic) and RFC 1427 (SIZE);
  6092. and limited support for RFC 1426 (BODY).
  6093. .sh 2 "Eight-Bit Clean"
  6094. .pp
  6095. Previous versions of
  6096. .i sendmail
  6097. used the 0200 bit for quoting.
  6098. This version avoids that use.
  6099. However, for compatibility with RFC 822,
  6100. you can set option `7' to get seven bit stripping.
  6101. .pp
  6102. Individual mailers can still produce seven bit output using the
  6103. `7' mailer flag.
  6104. .sh 2 "User Database"
  6105. .pp
  6106. The user database is an as-yet experimental attempt
  6107. to provide unified large-site name support.
  6108. We are installing it at Berkeley;
  6109. future versions may show significant modifications.
  6110. .sh 2 "Improved BIND Support"
  6111. .pp
  6112. The BIND support,
  6113. particularly for MX records,
  6114. had a number of annoying
  6115. .q features
  6116. which have been removed in this release.
  6117. In particular,
  6118. these more tightly bind (pun intended) the name server to
  6119. .i sendmail ,
  6120. so that the name server resolution rules are incorporated directly into
  6121. .b sendmail .
  6122. .sh 2 "Keyed Files"
  6123. .pp
  6124. Generalized keyed files is an idea taken directly from
  6125. .sm IDA
  6126. .i sendmail
  6127. (albeit with a completely different implementation).
  6128. They can be useful on large sites.
  6129. .pp
  6130. Version 8 also understands YP.
  6131. .sh 2 "Multi-Word Classes"
  6132. .pp
  6133. Classes can now be multiple words.
  6134. For example,
  6135. .(b
  6136. CShofmann.CS.Berkeley.EDU
  6137. .)b
  6138. allows you to match the entire string
  6139. .q hofmann.CS.Berkeley.EDU
  6140. using the single construct
  6141. .q $=S .
  6142. .sh 2 "Deferred Macro Expansion"
  6143. .pp
  6144. The
  6145. .b $& \c
  6146. .i x
  6147. construct has been adopted from
  6148. .sm IDA .
  6149. .sh 2 "IDENT Protocol Support"
  6150. .pp
  6151. The IDENT protocol as defined in RFC 1413 is supported.
  6152. .sh 2 "Parsing Bug Fixes"
  6153. .pp
  6154. A number of small bugs having to do with things like
  6155. backslash-escaped quotes inside of comments
  6156. have been fixed.
  6157. .sh 2 "Separate Envelope/Header Processing"
  6158. .pp
  6159. Since the From: line is passed in separately from the envelope sender,
  6160. these have both been made visible;
  6161. the
  6162. .b $g
  6163. macro is set to the envelope sender during processing
  6164. of mailer argument vectors
  6165. and the header sender during processing of headers.
  6166. .pp
  6167. It is also possible to specify separate per-mailer
  6168. envelope and header processing.
  6169. The
  6170. .b S enderRWSet
  6171. and
  6172. .b R ecipientRWset
  6173. arguments for mailers
  6174. can be specified as
  6175. .i envelope/header
  6176. to give different rewritings for envelope versus header addresses.
  6177. .sh 2 "Owner-List Propagates to Envelope"
  6178. .pp
  6179. When an alias has an associated owner\-list name,
  6180. that alias is used to change the envelope sender address.
  6181. This will cause downstream errors to be returned to that owner.
  6182. .sh 2 "Dynamic Header Allocation"
  6183. .pp
  6184. The fixed size limit on header lines has been eliminated.
  6185. .sh 2 "New Command Line Flags"
  6186. .pp
  6187. The
  6188. .b \-B
  6189. flag has been added to pass in body type information.
  6190. .pp
  6191. The
  6192. .b \-p
  6193. flag has been added
  6194. to pass in protocol information.
  6195. .pp
  6196. The
  6197. .b \-X
  6198. flag has been added
  6199. to allow logging of all protocol in and out of
  6200. .i sendmail
  6201. for debugging.
  6202. .sh 2 "Enhanced Command Line Flags"
  6203. .pp
  6204. The
  6205. .b \-q
  6206. flag can limit limit a queue run to specific recipients, senders, or queue ids
  6207. using
  6208. .b \-qR\c
  6209. .i substring ,
  6210. .b \-qS\c
  6211. .i substring ,
  6212. or
  6213. .b \-qI\c
  6214. .i substring
  6215. respectively.
  6216. .sh 2 "New and Old Configuration Line Types"
  6217. .pp
  6218. The
  6219. .b T
  6220. (Trusted users) configuration line has been deleted.
  6221. It will still be accepted but will be ignored.
  6222. .pp
  6223. The
  6224. .b K
  6225. line has been added to declare database maps.
  6226. .pp
  6227. The
  6228. .b V
  6229. line has been added to declare the configuration version level.
  6230. .pp
  6231. The
  6232. .b M
  6233. line has a
  6234. .q D=
  6235. field that lets you change into a temporary directory while that mailer
  6236. is running.
  6237. .sh 2 "New Options"
  6238. .pp
  6239. Several new options have been added,
  6240. many to support new features,
  6241. others to allow tuning that was previously available
  6242. only by recompiling.
  6243. They are described in detail in Section 5.1.5.
  6244. Briefly,
  6245. .nr ii 0.5i
  6246. .ip b
  6247. Insist on a minimum number of disk blocks.
  6248. .ip C
  6249. Set checkpoint interval.
  6250. .ip E
  6251. Default error message.
  6252. .ip G
  6253. Enable GECOS matching.
  6254. .ip h
  6255. Maximum hop count.
  6256. .ip j
  6257. Send errors in MIME-encapsulated format.
  6258. .ip J
  6259. Forward file path.
  6260. .ip k
  6261. Connection cache size
  6262. .ip K
  6263. Connection cache lifetime.
  6264. .ip l
  6265. Enable Errors-To: header.
  6266. These headers violate RFC 1123;
  6267. this option is included to provide back compatibility
  6268. with old versions of
  6269. .i sendmail .
  6270. .ip O
  6271. Set incoming SMTP daemon options, such as an alternate SMTP port.
  6272. .ip p
  6273. Privacy options.
  6274. .ip R
  6275. Don't prune route-addrs.
  6276. .ip U
  6277. User database spec.
  6278. .ip V
  6279. Fallback
  6280. .q MX
  6281. host.
  6282. .ip w
  6283. .q "Best MX"
  6284. handling technique.
  6285. .ip 7
  6286. Do not run eight bit clean.
  6287. .sh 2 "Extended Options"
  6288. .pp
  6289. The
  6290. .b r
  6291. (read timeout),
  6292. .b I
  6293. (use BIND),
  6294. and
  6295. .b T
  6296. (queue timeout)
  6297. options have been extended to pass in more information.
  6298. .sh 2 "New Mailer Flags"
  6299. .pp
  6300. Several new mailer flags have been added.
  6301. .ip a
  6302. Try to use ESMTP when creating a connection.
  6303. If this is not set,
  6304. .i sendmail
  6305. will still try if the other end hints that it knows about ESMTP
  6306. in its greeting message;
  6307. this flag says to try even if it doesn't hint.
  6308. If the EHLO (extended hello)
  6309. command fails,
  6310. .i sendmail
  6311. falls back to old SMTP.
  6312. .ip b
  6313. Ensure that there is a blank line at the end of all messages.
  6314. .ip c
  6315. Strip all comments from addresses;
  6316. this should only be used as a last resort
  6317. when dealing with cranky mailers.
  6318. .ip g
  6319. Never use the null sender as the envelope sender,
  6320. even when running SMTP.
  6321. Although this violates RFC 1123,
  6322. it may be necessary when you must deal with some obnoxious old hosts.
  6323. .ip 7
  6324. Strip all output to 7 bits.
  6325. .sh 2 "New Pre-Defined Macros"
  6326. .pp
  6327. The following macros are pre-defined:
  6328. .ip $k
  6329. The UUCP node name,
  6330. nominally from
  6331. .i uname (2)
  6332. call.
  6333. .ip $m
  6334. The domain part of our full hostname.
  6335. .ip $_
  6336. The RFC 1413-provided sender address.
  6337. .sh 2 "New LHS Token"
  6338. .pp
  6339. Version 8 allows
  6340. .b $@
  6341. on the Left Hand Side of an
  6342. .q R
  6343. line to match zero tokens.
  6344. This is intended to be used to match the null input.
  6345. .sh 2 "Bigger Defaults"
  6346. .pp
  6347. Version 8 allows up to 100 rulesets instead of 30.
  6348. It is recommended that rulesets 0\-9 be reserved for
  6349. .i sendmail 's
  6350. dedicated use in future releases.
  6351. .pp
  6352. The total number of MX records that can be used has been raised to 20.
  6353. .pp
  6354. The number of queued messages that can be handled at one time
  6355. has been raised from 600 to 1000.
  6356. .sh 2 "Different Default Tuning Parameters"
  6357. .pp
  6358. Version 8 has changed the default parameters
  6359. for tuning queue costs
  6360. to make the number of recipients more important
  6361. than the size of the message (for small messages).
  6362. This is reasonable if you are connected with reasonably fast links.
  6363. .sh 2 "Auto-Quoting in Addresses"
  6364. .pp
  6365. Previously, the
  6366. .q "Full Name <email address>"
  6367. syntax would generate incorrect protocol output
  6368. if
  6369. .q "Full Name"
  6370. had special characters such as dot.
  6371. This version puts quotes around such names.
  6372. .sh 2 "Symbolic Names On Error Mailer"
  6373. .pp
  6374. Several names have been built in to the $@ portion of the $#error
  6375. mailer.
  6376. .sh 2 "SMTP VRFY Doesn't Expand"
  6377. .pp
  6378. Previous versions of
  6379. .i sendmail
  6380. treated VRFY and EXPN the same.
  6381. In this version,
  6382. VRFY doesn't expand aliases or follow .forward files.
  6383. EXPN still does.
  6384. .pp
  6385. As an optimization, if you run with your default delivery mode being
  6386. queue-only or deliver-in-background,
  6387. the RCPT command will also not chase aliases and .forward files.
  6388. It will chase them when it processes the queue.
  6389. .sh 2 "[IPC] Mailers Allow Multiple Hosts"
  6390. .pp
  6391. When an address resolves to a mailer that has
  6392. .q [IPC]
  6393. as its
  6394. .q Path ,
  6395. the $@ part (host name)
  6396. can be a colon-separated list of hosts instead of a single hostname.
  6397. This asks
  6398. .i sendmail
  6399. to search the list for the first entry that is available
  6400. exactly as though it were an MX record.
  6401. The intent is to route internal traffic through internal networks
  6402. without publishing an MX record to the net.
  6403. MX expansion is still done on the individual items.
  6404. .sh 2 "Aliases Extended"
  6405. .pp
  6406. The implementation has been merged with maps.
  6407. Among other things,
  6408. this supports NIS-based aliases.
  6409. .sh 2 "Portability and Security Enhancements"
  6410. .pp
  6411. A number of internal changes have been made to enhance portability.
  6412. .pp
  6413. Several fixes have been made to increase the paranoia factor.
  6414. .sh 2 "Miscellaneous Changes"
  6415. .pp
  6416. .i Sendmail
  6417. writes a
  6418. .i /etc/sendmail.pid
  6419. file with the current process id of the SMTP daemon.
  6420. .pp
  6421. Two people using the same program in their .forward file
  6422. are considered different
  6423. so that duplicate elimination doesn't delete one of them.
  6424. .pp
  6425. The
  6426. .i mailstats
  6427. program prints mailer names
  6428. and gets the location of the
  6429. .i sendmail.st
  6430. file from
  6431. .i /etc/sendmail.cf .
  6432. .pp
  6433. Many minor bugs have been fixed, such as handling of backslashes
  6434. inside of quotes.
  6435. .pp
  6436. A hook (ruleset 5) has been added
  6437. to allow rewriting of local addresses after aliasing.
  6438. .sh 1 "ACKNOWLEDGEMENTS"
  6439. .pp
  6440. I've worked on
  6441. .i sendmail
  6442. for many years,
  6443. and many employers have been remarkably patient
  6444. about letting me work on a large project
  6445. that was not part of my official job.
  6446. This includes time on the INGRES Project at Berkeley,
  6447. at Britton Lee,
  6448. and again on the Mammoth Project at Berkeley.
  6449. .pp
  6450. Much of the second wave of improvements
  6451. should be credited to Bryan Costales of ICSI.
  6452. As he passed me drafts of his book on
  6453. .i sendmail
  6454. I was inspired to start working on things again.
  6455. Bryan was also available to bounce ideas off of.
  6456. .pp
  6457. Many, many people contributed chunks of code and ideas to
  6458. .i sendmail .
  6459. It has proven to be a group network effort.
  6460. Version 8 in particular was a group project.
  6461. The following people made notable contributions:
  6462. .(l
  6463. Keith Bostic, CSRG, University of California, Berkeley
  6464. Michael J. Corrigan, University of California, San Diego
  6465. Bryan Costales, International Computer Science Institute
  6466. Pa\*:r (Pell) Emanuelsson
  6467. Craig Everhart, Transarc Corporation
  6468. Tom Ivar Helbekkmo, Norwegian School of Economics
  6469. Allan E. Johannesen, WPI
  6470. Jonathan Kamens, OpenVision Technologies, Inc.
  6471. Takahiro Kanbe, Fuji Xerox Information Systems Co., Ltd.
  6472. Brian Kantor, University of California, San Diego
  6473. Murray S. Kucherawy, HookUp Communication Corp.
  6474. Bruce Lilly, Sony U.S.
  6475. Karl London
  6476. Nakamura Motonori, Kyoto University
  6477. John Gardiner Myers, Carnegie Mellon University
  6478. Neil Rickert, Northern Illinois University
  6479. Eric Schnoebelen, Convex Computer Corp.
  6480. Eric Wassenaar, National Institute for Nuclear and High Energy Physics, Amsterdam
  6481. Christophe Wolfhugel, Herve Schauer Consultants (Paris)
  6482. .)l
  6483. I apologize for anyone I have omitted, misspelled, misattributed, or
  6484. otherwise missed.
  6485. Many other people have contributed ideas, comments, and encouragement.
  6486. I appreciate their contribution as well.
  6487. .++ A
  6488. .+c "COMMAND LINE FLAGS"
  6489. .ba 0
  6490. .nr ii 1i
  6491. .pp
  6492. Arguments must be presented with flags before addresses.
  6493. The flags are:
  6494. .ip \-b\fIx\fP
  6495. Set operation mode to
  6496. .i x .
  6497. Operation modes are:
  6498. .(b
  6499. .ta 4n
  6500. m    Deliver mail (default)
  6501. s    Speak SMTP on input side
  6502. d    Run as a daemon
  6503. t    Run in test mode
  6504. v    Just verify addresses, don't collect or deliver
  6505. i    Initialize the alias database
  6506. p    Print the mail queue
  6507. .)b
  6508. .ip \-B\fItype\fP
  6509. Indicate body type.
  6510. .ip \-C\fIfile\fP
  6511. Use a different configuration file.
  6512. .i Sendmail
  6513. runs as the invoking user (rather than root)
  6514. when this flag is specified.
  6515. .ip \-d\fIlevel\fP
  6516. Set debugging level.
  6517. .ip "\-f\ \fIaddr\fP"
  6518. The sender's machine address is
  6519. .i addr .
  6520. .ip \-F\fIname\fP
  6521. Sets the full name of this user to
  6522. .i name .
  6523. .ip "\-h\ \fIcnt\fP"
  6524. Sets the
  6525. .q "hop count"
  6526. to
  6527. .i cnt .
  6528. This represents the number of times this message has been processed
  6529. by
  6530. .i sendmail
  6531. (to the extent that it is supported by the underlying networks).
  6532. .i Cnt
  6533. is incremented during processing,
  6534. and if it reaches
  6535. MAXHOP
  6536. (currently 30)
  6537. .i sendmail
  6538. throws away the message with an error.
  6539. .ip \-n
  6540. Don't do aliasing or forwarding.
  6541. .ip "\-r\ \fIaddr\fP"
  6542. An obsolete form of
  6543. .b \-f .
  6544. .ip \-o\fIx\|value\fP
  6545. Set option
  6546. .i x
  6547. to the specified
  6548. .i value .
  6549. These options are described in Appendix B.
  6550. .ip \-p\fIprotocol\fP
  6551. Set the sending protocol.
  6552. Programs are encouraged to set this.
  6553. The protocol field can be in the form
  6554. .i protocol \c
  6555. .b : \c
  6556. .i host
  6557. to set both the sending protocol and sending host.
  6558. For example,
  6559. .q \-pUUCP:uunet
  6560. sets the sending protocol to UUCP
  6561. and the sending host to uunet.
  6562. (Some existing programs use \-oM to set the r and s macros;
  6563. this is equivalent to using \-p.)
  6564. .ip \-q\fItime\fP
  6565. Try to process the queued up mail.
  6566. If the time is given,
  6567. a
  6568. .i sendmail
  6569. will run through the queue at the specified interval
  6570. to deliver queued mail;
  6571. otherwise, it only runs once.
  6572. .ip \-q\fIXstring\fP
  6573. Run the queue once,
  6574. limiting the jobs to those matching
  6575. .i Xstring .
  6576. The key letter
  6577. .i X
  6578. can be
  6579. .b I
  6580. to limit based on queue identifier,
  6581. .b R
  6582. to limit based on recipient,
  6583. or
  6584. .b S
  6585. to limit based on sender.
  6586. A particular queued job is accepted if one of the corresponding addresses
  6587. contains the indicated
  6588. .i string .
  6589. .ip \-t
  6590. Read the header for
  6591. .q To: ,
  6592. .q Cc: ,
  6593. and
  6594. .q Bcc:
  6595. lines, and send to everyone listed in those lists.
  6596. The
  6597. .q Bcc:
  6598. line will be deleted before sending.
  6599. Any addresses in the argument vector will be deleted
  6600. from the send list.
  6601. .ip "\-X \fIlogfile\fP"
  6602. Log all traffic in and out of
  6603. .i sendmail
  6604. in the indicated
  6605. .i logfile
  6606. for debugging mailer problems.
  6607. This produces a lot of data very quickly and should be used sparingly.
  6608. .pp
  6609. There are a number of options that may be specified as
  6610. primitive flags.
  6611. These are the e, i, m, and v options.
  6612. Also,
  6613. the f option
  6614. may be specified as the
  6615. .b \-s
  6616. flag.
  6617. .+c "QUEUE FILE FORMATS"
  6618. .pp
  6619. This appendix describes the format of the queue files.
  6620. These files live in the directory defined by the
  6621. .b Q
  6622. option in the
  6623. .i sendmail.cf
  6624. file, usually
  6625. .i /var/spool/mqueue
  6626. or
  6627. .i /usr/spool/mqueue .
  6628. .pp
  6629. All queue files have the name
  6630. \fIx\fP\|\fBf\fP\fIAAA99999\fP
  6631. where
  6632. .i AAA99999
  6633. is the
  6634. .i id
  6635. for this message
  6636. and the
  6637. .i x
  6638. is a type.
  6639. The first letter of the id encodes the hour of the day
  6640. that the message was received by the system
  6641. (with A being the hour between midnight and 1:00AM).
  6642. All files with the same id collectively define one message.
  6643. .pp
  6644. The types are:
  6645. .nr ii 0.5i
  6646. .ip d
  6647. The data file.
  6648. The message body (excluding the header) is kept in this file.
  6649. .ip l
  6650. The lock file.
  6651. If this file exists,
  6652. the job is currently being processed,
  6653. and a queue run will not process the file.
  6654. For that reason,
  6655. an extraneous
  6656. .b lf
  6657. file can cause a job to apparently disappear
  6658. (it will not even time out!).
  6659. [Actually, this file is obsolete on most systems that support the
  6660. .b flock
  6661. or
  6662. .b lockf
  6663. system calls.]
  6664. .ip n
  6665. This file is created when an id is being created.
  6666. It is a separate file to insure that no mail can ever be destroyed
  6667. due to a race condition.
  6668. It should exist for no more than a few milliseconds
  6669. at any given time.
  6670. [This is only used on old versions of
  6671. .i sendmail ;
  6672. it is not used 
  6673. on newer versions.]
  6674. .ip q
  6675. The queue control file.
  6676. This file contains the information necessary to process the job.
  6677. .ip t
  6678. A temporary file.
  6679. These are an image of the
  6680. .b qf
  6681. file when it is being rebuilt.
  6682. It should be renamed to a
  6683. .b qf
  6684. file very quickly.
  6685. .ip x
  6686. A transcript file,
  6687. existing during the life of a session
  6688. showing everything that happens
  6689. during that session.
  6690. .pp
  6691. The
  6692. .b qf
  6693. file is structured as a series of lines
  6694. each beginning with a code letter.
  6695. The lines are as follows:
  6696. .ip D
  6697. The name of the data file.
  6698. There may only be one of these lines.
  6699. .ip H
  6700. A header definition.
  6701. There may be any number of these lines.
  6702. The order is important:
  6703. they represent the order in the final message.
  6704. These use the same syntax
  6705. as header definitions in the configuration file.
  6706. .ip C
  6707. The controlling address.
  6708. The syntax is
  6709. .q localuser:aliasname .
  6710. Recipient addresses following this line
  6711. will be flagged so that deliveries will be run as the
  6712. .i localuser
  6713. (a user name from the /etc/passwd file);
  6714. .i aliasname
  6715. is the name of the alias that expanded to this address
  6716. (used for printing messages).
  6717. .ip R
  6718. A recipient address.
  6719. This will normally be completely aliased,
  6720. but is actually realiased when the job is processed.
  6721. There will be one line
  6722. for each recipient.
  6723. .ip S
  6724. The sender address.
  6725. There may only be one of these lines.
  6726. .ip E
  6727. An error address.
  6728. If any such lines exist,
  6729. they represent the addresses that should receive error messages.
  6730. .ip T
  6731. The job creation time.
  6732. This is used to compute when to time out the job.
  6733. .ip P
  6734. The current message priority.
  6735. This is used to order the queue.
  6736. Higher numbers mean lower priorities.
  6737. The priority changes
  6738. as the message sits in the queue.
  6739. The initial priority depends on the message class
  6740. and the size of the message.
  6741. .ip M
  6742. A message.
  6743. This line is printed by the
  6744. .i mailq
  6745. command,
  6746. and is generally used to store status information.
  6747. It can contain any text.
  6748. .ip F
  6749. Flag bits, represented as one letter per flag.
  6750. Defined flag bits are
  6751. .b r
  6752. indicating that this is a response message
  6753. and
  6754. .b w
  6755. indicating that a warning message has been sent
  6756. announcing that the mail has been delayed.
  6757. .ip $
  6758. A macro definition.
  6759. The values of certain macros
  6760. (as of this writing, only
  6761. .b $r
  6762. and
  6763. .b $s )
  6764. are passed through to the queue run phase.
  6765. .ip B
  6766. The body type.
  6767. The remainder of the line is a text string defining the body type.
  6768. If this field is missing,
  6769. the body type is assumed to be
  6770. .q "undefined"
  6771. and no special processing is attempted.
  6772. Legal values are
  6773. .q 7BIT
  6774. and
  6775. .q 8BITMIME .
  6776. .pp
  6777. As an example,
  6778. the following is a queue file sent to
  6779. .q eric@mammoth.Berkeley.EDU
  6780. and
  6781. .q bostic@okeeffe.CS.Berkeley.EDU \**:
  6782. .(f
  6783. \**This example is contrived and probably inaccurate for your environment.
  6784. Glance over it to get an idea;
  6785. nothing can replace looking at what your own system generates.
  6786. .)f
  6787. .(b
  6788. P835771
  6789. T404261372
  6790. DdfAAA13557
  6791. Seric
  6792. Eowner-sendmail@vangogh.CS.Berkeley.EDU
  6793. Ceric:sendmail@vangogh.CS.Berkeley.EDU
  6794. Reric@mammoth.Berkeley.EDU
  6795. Rbostic@okeeffe.CS.Berkeley.EDU
  6796. H?P?return-path: <owner-sendmail@vangogh.CS.Berkeley.EDU>
  6797. Hreceived: by vangogh.CS.Berkeley.EDU (5.108/2.7) id AAA06703;
  6798.     Fri, 17 Jul 92 00:28:55 -0700
  6799. Hreceived: from mail.CS.Berkeley.EDU by vangogh.CS.Berkeley.EDU (5.108/2.7)
  6800.     id AAA06698; Fri, 17 Jul 92 00:28:54 -0700
  6801. Hreceived: from [128.32.31.21] by mail.CS.Berkeley.EDU (5.96/2.5)
  6802.     id AA22777; Fri, 17 Jul 92 03:29:14 -0400
  6803. Hreceived: by foo.bar.baz.de (5.57/Ultrix3.0-C)
  6804.     id AA22757; Fri, 17 Jul 92 09:31:25 GMT
  6805. H?F?from: eric@foo.bar.baz.de (Eric Allman)
  6806. H?x?full-name: Eric Allman
  6807. Hmessage-id: <9207170931.AA22757@foo.bar.baz.de>
  6808. HTo: sendmail@vangogh.CS.Berkeley.EDU
  6809. Hsubject: this is an example message
  6810. .)b
  6811. This shows the name of the data file,
  6812. the person who sent the message,
  6813. the submission time
  6814. (in seconds since January 1, 1970),
  6815. the message priority,
  6816. the message class,
  6817. the recipients,
  6818. and the headers for the message.
  6819. .+c "SUMMARY OF SUPPORT FILES"
  6820. .pp
  6821. This is a summary of the support files
  6822. that
  6823. .i sendmail
  6824. creates or generates.
  6825. Many of these can be changed by editing the sendmail.cf file;
  6826. check there to find the actual pathnames.
  6827. .nr ii 1i
  6828. .ip "/usr/\*(SD/sendmail"
  6829. The binary of
  6830. .i sendmail .
  6831. .ip /usr/\*(SB/newaliases
  6832. A link to /usr/\*(SD/sendmail;
  6833. causes the alias database to be rebuilt.
  6834. Running this program is completely equivalent to giving
  6835. .i sendmail
  6836. the
  6837. .b \-bi
  6838. flag.
  6839. .ip /usr/\*(SB/mailq
  6840. Prints a listing of the mail queue.
  6841. This program is equivalent to using the
  6842. .b \-bp
  6843. flag to
  6844. .i sendmail .
  6845. .ip /etc/sendmail.cf
  6846. The configuration file,
  6847. in textual form.
  6848. .ip /usr/lib/sendmail.hf
  6849. The SMTP help file.
  6850. .ip /etc/sendmail.st
  6851. A statistics file; need not be present.
  6852. .ip /etc/sendmail.pid
  6853. Created in daemon mode;
  6854. it contains the process id of the current SMTP daemon.
  6855. If you use this in scripts;
  6856. use ``head \-1'' to get just the first line;
  6857. later versions of
  6858. .i sendmail
  6859. may add information to subsequent lines.
  6860. .ip /etc/aliases
  6861. The textual version of the alias file.
  6862. .ip /etc/aliases.{pag,dir}
  6863. The alias file in
  6864. .i dbm \|(3)
  6865. format.
  6866. .ip /var/spool/mqueue
  6867. The directory in which the mail queue
  6868. and temporary files reside.
  6869. .ip /var/spool/mqueue/qf*
  6870. Control (queue) files for messages.
  6871. .ip /var/spool/mqueue/df*
  6872. Data files.
  6873. .ip /var/spool/mqueue/tf*
  6874. Temporary versions of the qf files,
  6875. used during queue file rebuild.
  6876. .ip /var/spool/mqueue/xf*
  6877. A transcript of the current session.
  6878. .\".ro
  6879. .\".ls 1
  6880. .\".tp
  6881. .\".sp 2i
  6882. .\".in 0
  6883. .\".ce 100
  6884. .\".sz 24
  6885. .\".b SENDMAIL
  6886. .\".sz 14
  6887. .\".sp
  6888. .\"INSTALLATION AND OPERATION GUIDE
  6889. .\".sp
  6890. .\".sz 10
  6891. .\"Eric Allman
  6892. .\"Britton-Lee, Inc.
  6893. .\".sp
  6894. .\"Version 8.36
  6895. .\".ce 0
  6896. .bp 2
  6897. .rs
  6898. .sp |4i
  6899. .ce 2
  6900. This page intentionally left blank;
  6901. replace it with a blank sheet for double-sided output.
  6902. .bp 3
  6903. .ce
  6904. .sz 12
  6905. TABLE OF CONTENTS
  6906. .sz 10
  6907. .sp
  6908. .\" remove some things to avoid "out of temp file space" problem
  6909. .rm sh
  6910. .rm (x
  6911. .rm )x
  6912. .rm ip
  6913. .rm pp
  6914. .rm lp
  6915. .rm he
  6916. .rm fo
  6917. .rm eh
  6918. .rm oh
  6919. .rm ef
  6920. .rm of
  6921. .xp
  6922.