Most users do not run sendmail directly. Instead, they use one of many mail user agents (MUAs) to compose a mail message. Those programs invisibly pass the mail message to sendmail , creating the appearance of instantaneous transmission. The sendmail program then takes care of delivery in its own seemingly mysterious fashion.
Although most users don't run sendmail directly, it is perfectly legal to do so. You, like many system managers, may need to do so to track down and solve mail problems.
Here's a demonstration of one way to run sendmail by hand. First create a file named sendstuff with the following contents:
Second, mail this file to yourself with the following command line,
Here, you run
directly by specifying its full pathname.
When you run
, any command-line arguments
that do not begin with a
Now view the mail message that you just sent. How you do this will vary. Many users just type mail to view their mail. Others use the mh (1) package and type inc to receive and show to view their mail. No matter how you normally view your mail, save the mail message that you just received to a file. It will look something like this:
From you@Here.US.EDU Fri Dec 13 08:11:44 1996 Received: (from you@localhost) by Here.US.EDU (8.8.4/8.8.4) id AA04599 for you; Fri, 13 Dec 96 08:11:44 -0700 Date: Fri, 13 Dec 96 08:11:43 From: you@Here.US.EDU (Your Full Name) Message-Id: <9631121611.AA02124@Here.US.EDU> To: you may be Apparently-To: This is a one line message.
The first thing to note is that this file begins with seven lines of text that were not in your original message. Those lines were added by sendmail and your local delivery program and are called the header .
The last line of the file is the original line from your sendstuff file. It is separated from the header by one blank line. The body of a mail message comes after the header and consists of everything that follows the first blank line (see Figure 1.1 ).
Ordinarily, when you send mail with your MUA, the MUA adds a header and feeds both the header and the body to sendmail . This time, however, you ran sendmail directly and supplied only a body; the header was added by sendmail .