Multiple recipients can also be given.
the following sends a mail message to
two different kinds of command-line arguments.
begin with a
program can function in a number of different ways
depending on which form of
The effects of some of the options in Table 4.2 can also be achieved by running the sendmail executable using different names. Those names and a description of their results are shown in Table 4.3 . Each name can be a hard link with, a symbolic link to, or a copy of sendmail .
The sendmail program can run as a daemon in the background, listening for incoming mail from other machines. The sendmail program reads its configuration file only once, when it first starts as a daemon. It then continues to run forever, never reading the configuration file again. As a consequence, it will never see any changes to that configuration file.
When you change something in the sendmail.cf configuration file, you always need to kill and restart the sendmail daemon. But before you can kill the daemon, you need to know how to correctly restart it. This information is in the /etc/sendmail.pid file or one of your system rc files.
On a Berkeley UNIX-based system, for example, the daemon is usually started like this:
/usr/lib/sendmail -bd -q1h
The actual command to start the sendmail daemon on your system may be different from what we've shown. If you manage many different brands of systems, you'll need to know how to start the daemon on all of them.
This single command has the same effect as the two commands shown for V8.6 below.
Before you can start the sendmail daemon, you need to make sure there is not a daemon running already. Beginning with V8.6, the pid of the currently running daemon is found in the first line of the /etc/sendmail.pid file. The processes of killing the daemon looks like this:
After killing the currently running daemon, you can start a new daemon with the following simple command:
Under old versions of sendmail you need to use the ps (1) program to find the pid of the daemon. How you run ps is different on BSD UNIX and System V UNIX. For BSD UNIX the command that you use and the output that it produces resemble the following:
Here the leftmost number printed by
For System V-based systems you use different arguments for the ps command, and its output differs:
Under old versions of sendmail you must look in your system rc files for the way to restart sendmail . We showed how to find this information in Chapter 3, The Roles of sendmail (see Section 3.4, "Role as a Daemon" ).
getrequests: cannot bind: Address already in use getrequests: cannot bind: Address already in use getrequests: cannot bind: Address already in use getrequests: cannot bind: Address already in use getrequests: cannot bind: Address already in use getrequests: cannot bind: Address already in use getrequests: cannot bind: Address already in use getrequests: cannot bind: Address already in use getrequests: cannot bind: Address already in use getrequests: cannot bind: Address already in use getrequests: cannot bind: Address already in use opendaemonsocket: server SMTP socket wedged: exiting
program can also
display the contents of its queue directory. It
can do this in two ways: by running as a program named
or by being run as
Mail queue is empty
If, on the other hand, there is mail waiting in the queue, the output is far more verbose, possibly containing lines similar to these:
.ps 8 Mail Queue (1 requests) -Q-ID-- -Size- --Q-Time--- ------Sender/Recipient------ GAA29775* 702 Thu Mar 12 16:51 <firstname.lastname@example.org> Deferred: Host fbi.dc.gov is down <email@example.com>
Here, the output produced with the
line shows details about the message and the sender. The
A second line may appear giving a reason for failure (if there was one). A message may be queued intentionally or because it couldn't be delivered.
The third and possibly subsequent lines show the addresses of the recipients.
The output produced by the
Because sendmail may have to search through thousands of names in the aliases file, a version of the file is stored in a separate dbm (3) or db (3) database format file. The use of a database significantly improves lookup speed.
can automatically update the database
file is changed, there will be times
when you will want to rebuild it yourself.
You do this either by running
or with the
There will be a delay while sendmail rebuilds the aliases database; then a summary of what it did is printed:
/etc/aliases: 859 aliases, longest 615 bytes, 28096 bytes total
This line shows that the database
was successfully rebuilt. Beginning with V8.6
, multiple alias files
became possible, so each line (and there might be many) begins with the
name of an alias file. The information then displayed is the number
of aliases processed, the size of the biggest entry
to the right of the
The aliases file and how to manipulate it are covered in Chapter 24, Aliases .
To illustrate, consider the following aliases file:
Although you can figure out what the name
In addition to expanding aliases, the
Assume that the user
to verify the name
larry... User unknown fred... deliverable: mailer local, user fred