How to Run sendmail
One way to run sendmail is to provide it
with the name of a recipient as the only command-line
argument. For example, the following sends a mail message to
Multiple recipients can also be given. For example, the
following sends a mail message to
The sendmail program accepts two
different kinds of command-line arguments. Arguments that
do not begin with a
- character (such as
assumed to be recipients. Arguments that
do begin with a
- character are taken as
switches that determine the behavior of
sendmail. The recipients must
always follow all the switched arguments. Any switched
arguments that follow recipients will be interpreted as
recipient addresses, potentially causing bounced
In this chapter, we will cover only a few of these switch-style command-line arguments (see Table 1-1). The complete list of command-line switches, along with an explanation of each, is presented in Chapter 6 on page 220.
Table 1-1. Some command-line switches
Set operating mode.
Run in verbose mode.
Run in debugging mode.
Become a mode (-b)
The sendmail program can function
in a number of different ways depending on which
argument you use. One form, for example, causes
sendmail to display the
contents of the queue. Another causes
sendmail to rebuild the
aliases database. A complete
list of the
-b command-line mode-setting switches ...