Headers by Category
The sendmail program contains an internal list of header name
s that are organized conceptually into categories. The names and categories are defined in conf.c (see "Header Behavior in conf.c"). Each category is defined by one or more H_
flags in that file, the names of which are listed under the Flags column of all the tables that follow.
Recommended Headers
Every sendmail.cf file should have a minimal complement of header definitions. Below we present a recommendation. Don't use this as is. The details are not generic to all versions of sendmail, nor are they appropriate for all sites.
H?P?Return-Path: $g HReceived: $?sfrom $s $.by $j ($v/$V) id $i; $bmandatory H?D?Date: $a
mandatory H?F?From: $q
mandatory H?x?Full-Name: $x H?M?Message-Id: <$t.$i@$j>
mandatory H?D?Resent-Date: $a
mandatory H?F?Resent-From: $q
mandatory H?M?Resent-Message-Id: <$t.$i@$j>
mandatory
Each of these is described individually at the end of this chapter. Except for Received:
(see ), none is added to any mail message that already has that particular header present.
The Return-Path:
header (see ) is added only if it is not already present and if the delivery agent for the recipient has the F=P
flag present. Similarly, the Date:
relies on F=D
, the From:
relies on F=F
, the Full-Name:
relies on F=x
, and the Message=Id:
relies on F=M
.
Of those shown, only the seven indicated are truly mandatory and must be declared in every configuration file. The others are highly recommended.
Sender Headers
Certain header name
s are assumed by sendmail to contain information about the various possible senders of a mail message. They are listed in Table 35.3 in descending order of significance. Addresses with the H_FROM flag (see ) are rewritten as sender addresses.
Header | Flags | Defined by | |
---|---|---|---|
Resent-Sender:
| "Forwarding with Resent-Headers" | H_FROM, H_RESENT | RFC822 |
Resent-From:
| From: | H_FROM, H_RESENT | RFC822 |
Resent-Reply-To:
| H_FROM, H_RESENT | RFC822 | |
Sender:
| Sender: | H_FROM | RFC822 |
From:
| H_FROM | RFC822 | |
Apparently-From:
| Apparently-From: | n/a | Smail 3.0 |
Reply-To:
| Reply-To: | H_FROM | RFC822 |
Full-Name:
| Full-Name: | H_ACHECK | obsolete |
Return-Receipt-To:
| Return-Receipt-To: | H_FROM | obsolete |
Errors-To:
| Errors-To: | H_FROM, H_ERRSTO | sendmail |
When returning bounced mail, sendmail always uses the envelope sender's address. If the special header Errors-To:
appears in the message, a copy of the bounced mail is also sent to the address in that header. This is hard-coded into all but SunOS and V8 sendmail, which use the H_ERRSTO header flag (see ) instead. V8 also requires that the UseErrorsTo
(l
) option (see ) be set to true for the Errors-To:
header to be honored.
Recipient Headers
Recipient headers are those from which one or more recipients can be parsed. Addresses in headers with the H_RCPT flag (see ) are rewritten as recipient addresses. When they are invoked with the -t
command-line switch, sendmail gathers a list of recipients from all the headers marked with an H_RCPT flag and delivers a copy of the message to each.
The list of recipient headers used by sendmail is shown in Table 35.4.
Header | Flags | Defined by | |
---|---|---|---|
To:
| To: | H_RCPT | RFC822 |
Resent-To:
| H_RCPT, H_RESENT | RFC822 | |
Cc:
| Cc: | H_RCPT | RFC822 |
Resent-Cc:
| H_RCPT, H_RESENT | RFC822 | |
Bcc:
| H_RCPT, H_ACHECK | RFC822 | |
Resent-Bcc:
| H_RCPT, H_ACHECK, H_RESENT | RFC822 | |
Apparently-To:
| Apparently-To: | H_RCPT | Obsolete |
Identification and Control Headers
Some headers serve to uniquely identify a mail message. Others affect the way sendmail processes a mail message. The complete list of all such identification and control headers is shown in Table 35.5.
Header | Flags | Defined by | |
---|---|---|---|
Message-ID:
| n/a | RFC822 | |
Resent-message-Id:
| H_RESENT | RFC822 | |
Message:
| Message: | H_EOH | Obsolete |
Text:
| Text: | H_EOH | Obsolete |
Precedence:
| "Precedence" | n/a | All sendmails |
Priority:
| Priority: | n/a | and above |
Note that the Precedence:
and Posted-Date:
(below) headers are hard-coded into sendmail rather than being declared in conf.c.
Date and Trace Headers
Date headers are used to document the date and time that the mail message was sent or forwarded. Trace headers (those with an H_TRACE header flag; see ) are used to determine the hop count of a mail message and to document the message's travel from machine to machine. The list date and trace headers is shown in Table 35.6.
Header | Flags | Defined by | |
---|---|---|---|
Date:
| Date: | n/a | RFC822 |
Posted-Date:
| Posted-Date: | n/a | Obsolete |
Resent-Date:
| H_RESENT | RFC822 | |
Received:
| H_TRACE, H_FORCE | RFC822 | |
Via:
| Via: | H_TRACE, H_FORCE | Obsolete |
Mail-From:
| Mail-From: | H_TRACE, H_FORCE | Obsolete |
X-Authentication-Warning:
| X-Authentication-Warning: | n/a | sendmail |
X400-Received:
| -Received: | H_TRACE | IDA and V8 only |
Other RFC822 Headers
Other headers that you will see in mail messages are defined by the RFC822 standard but are not otherwise internally defined by sendmail. A few of them, such as Return-Path:
, should be declared in the configuration file. The others are usually inserted by MUAs. Table 35.7 lists these other RFC822 headers.
Header | Flags | Defined by | |
---|---|---|---|
Return-Path:
| n/a | RFC822 | |
In-Reply-To:
| In-Reply-To: | n/a | RFC822 |
References:
| References: | n/a | RFC822 |
Keywords:
| Keywords: | n/a | RFC822 |
Subject:
| n/a | RFC822 | |
Comments:
| Comments: | H_FORCE | RFC822 |
Encrypted:
| Encrypted: | n/a | RFC822 |
MIME Headers
MIME (Multipurpose Internet Mail Extensions) is documented in RFC1521, with additional details in RFC1344, RFC1426, RFC1428, and RFC1437. The sendmail program cares about MIME only when bouncing messages and when determining how to convert the message body between 8 and 7 bits. Those MIME headers for which sendmail contains special knowledge are shown in Table 35.8.
Header | Flags | Defined By | |
---|---|---|---|
MIME-Version:
| MIME-Version: | n/a | RFC1521 |
Content-Type:
| H_CTYPE | RFC1521 | |
Content-Transfer-Encoding:
| H_CTE | RFC1521 |