sendmailSearch this book
Previous: 35.5 Header Behavior in conf.cChapter 35
Next: 35.7 Forwarding with Resent-Headers

35.6 Headers by Category

The sendmail program contains an internal list of header names that are organized conceptually into categories. The names and categories are defined in conf.c (see Section 35.5, "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.

35.6.1 Recommended Headers

Every 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; $b<- mandatory
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 Section 35.10.25), none is added to any mail message that already has that particular header present.

The Return-Path: header (see Section 35.10.28) 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.

35.6.2 Sender Headers

Certain header names 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 Section 35.5.9) are rewritten as sender addresses.

Table 35.3: Sender Headers (Most to Least Significant)
HeaderFlagsDefined by
Resent-Sender:Section 35.7, "Forwarding with Resent-Headers"H_FROM, H_RESENTRFC822
Resent-From:Section 35.10.14, From:H_FROM, H_RESENTRFC822
Resent-Reply-To:Section 35.7H_FROM, H_RESENTRFC822
Sender:Section 35.10.30, Sender:H_FROMRFC822
From:Section 35.10.14H_FROMRFC822
Apparently-From:Section 35.10.1, Apparently-From:n/aSmail 3.0
Reply-To:Section 35.10.27, Reply-To:H_FROMRFC822
Full-Name:Section 35.10.15, Full-Name:H_ACHECKobsolete
Return-Receipt-To:Section 35.10.29, Return-Receipt-To:H_FROMobsolete
Errors-To:Section 35.10.13, Errors-To:H_FROM, H_ERRSTOsendmail

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 Section 35.5.11) instead. V8 also requires that the UseErrorsTo (l) option (see Section 34.8.74) be set to true for the Errors-To: header to be honored.

35.6.3 Recipient Headers

Recipient headers are those from which one or more recipients can be parsed. Addresses in headers with the H_RCPT flag (see Section 35.5.2) 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.

Table 35.4: Recipient Headers
HeaderFlagsDefined by
To:Section 35.10.33, To:H_RCPTRFC822
Resent-To:Section 35.7H_RCPT, H_RESENTRFC822
Cc:Section 35.10.5, Cc:H_RCPTRFC822
Resent-Cc:Section 35.7H_RCPT, H_RESENTRFC822
Bcc:Section 35.10.4H_RCPT, H_ACHECKRFC822
Resent-Bcc:Section 35.7H_RCPT, H_ACHECK, H_RESENTRFC822
Apparently-To:Section 35.10.2, Apparently-To:H_RCPTObsolete

35.6.4 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.

Table 35.5: Identification and Control Headers
HeaderFlagsDefined by
Message-ID:Section 35.10.19n/aRFC822
Resent-message-Id:Section 35.7H_RESENTRFC822
Message:Section 35.10.20, Message:H_EOHObsolete
Text:Section 35.10.32, Text:H_EOHObsolete
Precedence:Section 35.8, "Precedence"n/aAll sendmails
Priority:Section 35.10.24, Priority:n/aV8.7 and above

Note that the Precedence: and Posted-Date: (below) headers are hard-coded into sendmail rather than being declared in conf.c.

35.6.5 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 Section 35.5.8) 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.

Table 35.6: Date and Trace Headers
HeaderFlagsDefined by
Date:Section 35.10.10, Date:n/aRFC822
Posted-Date:Section 35.10.22, Posted-Date:n/aObsolete
Resent-Date:Section 35.7H_RESENTRFC822
Received:Section 35.10.25H_TRACE, H_FORCERFC822
Via:Section 35.10.34, Via:H_TRACE, H_FORCEObsolete
Mail-From:Section 35.10.18, Mail-From:H_TRACE, H_FORCEObsolete
X-Authentication-Warning:Section 35.10.35, X-Authentication-Warning:n/aV8 sendmail
X400-Received:Section 35.10.36, X400-Received:H_TRACEIDA and V8 only

35.6.6 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.

Table 35.7: Other RFC822 Headers
HeaderFlagsDefined by
Return-Path:Section 35.10.28n/aRFC822
In-Reply-To:Section 35.10.16, In-Reply-To:n/aRFC822
References:Section 35.10.26, References:n/aRFC822
Keywords:Section 35.10.17, Keywords:n/aRFC822
Subject:Section 35.10.31n/aRFC822
Comments:Section 35.10.6, Comments:H_FORCERFC822
Encrypted:Section 35.10.12, Encrypted:n/aRFC822

35.6.7 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.

Table 35.8: MIME Headers
HeaderFlagsDefined By
MIME-Version:Section 35.10.21, MIME-Version:n/aRFC1521
Content-Type:Section 35.10.9H_CTYPERFC1521
Content-Transfer-Encoding:Section 35.10.8H_CTERFC1521

Previous: 35.5 Header Behavior in conf.csendmailNext: 35.7 Forwarding with Resent-Headers
35.5 Header Behavior in conf.cBook Index35.7 Forwarding with Resent-Headers