This chapter contains ten useful tables that cover headers and their use:
Table 25-2 lists all the well-defined headers by name (Section 25.2.1 [V8.13]).
Table 25-3 lists header flags as used in
conf.c
(Section 25.2.2
[V8.13]).
Table 25-4 lists mc configuration commands that relate to headers (Section 25.2.3 [V8.13]).
Table 25-5 lists sender headers by name (Section 25.2.4 [V8.13]).
Table 25-6 lists recipient headers by name (Section 25.2.5 [V8.13]).
Table 25-7 lists identification and control headers by name (Section 25.2.6 [V8.13]).
Table 25-8 lists date and trace headers by name (Section 25.2.7 [V8.13]).
Table 25-9 lists other standard headers by name (Section 25.2.8 [V8.13]).
Table 25-10 lists MIME headers by name (Section 25.2.9 [V8.13]).
Table 25-11 lists Resent-
headers
by name (Section 25.2.10
[V8.13]).
The name
portion of the
H
configuration
command
must be one of the names shown in Table 25-2. Other
names do not produce an error but might confuse other programs that
process them. Names marked with an asterisk are defined by RFC2822.
Table 25-2. Header names
apparently-to |
bcc* |
cc* |
comments* |
content-length |
content-transfer-encoding |
content-type |
date* |
delivery-receipt-to |
disposition |
encrypted |
errors-to |
from* |
full-name |
in-reply-to* |
keywords* |
mail-from |
message |
message-id* |
notification-to |
posted-date |
precedence |
received* |
references* |
reply-to* |
resent-bcc* |
resent-cc* |
resent-date* |
resent-from* |
resent-message-id* |
resent-reply-to |
resent-sender* |
resent-to* |
return-path* |
return-receipt-to |
sender* |
subject |
text |
to* |
via |
x400-received |
The sendmail program has a built-in understanding of many header names. How those names are used is determined by a set of flags in the source file that conf.c supplied with the source distribution. Site policy determines which flags are applied to which headers, but in general, conf.c applies them in the way that is best suited for almost all Internet sites.
If you desire to redefine the flags for a particular header name,
look for the name’s declaration in the C-language
structure definition HdrInfo
in
conf.c. Be sure to read the comments in that
file. Changes to header flags represent a permanent site policy
change and should not be undertaken lightly.
The flags that determine header use are listed in Table 25-3. Note that each flag name is prefixed with an H_.
Table 25-3. Header flags in conf.c
Flag |
sendmail text reference |
Version |
Description |
---|---|---|---|
H_ACHECK |
§25.6.1[3ed] |
V5 and above |
Always process
|
H_BCC |
§25.6.2[3ed] |
V8.7 and above |
Strip value from header |
H_BINDLATE |
§25.6.3[3ed] |
V8.10 and above |
Expand macros at time of delivery only |
H_CHECK |
§25.6.4[3ed] |
V5 and above |
Process
|
H_CTE |
§25.6.5[3ed] |
V8.7 and above |
Is “content transfer encoding” |
H_CTYPE |
§25.6.6[3ed] |
V8.7 and above |
Is “content type” |
H_DEFAULT |
§25.6.7[3ed] |
V5 and above |
If already in headers, don’t insert |
H_ENCODABLE |
§25.6.8[3ed] |
V8.8 and above |
Field can be RFC2047-encoded |
H_EOH |
§25.6.9[3ed] |
V5 and above |
Terminates all headers |
H_ERRSTO |
§25.6.10[3ed] |
V8.1 to V8.6 |
An |
H_ERRORSTO |
§25.6.10[3ed] |
V8.7 and above |
An |
H_FORCE |
§25.6.11[3ed] |
V5 and above |
Insert header (allows duplicates) |
H_FROM |
§25.6.12[3ed] |
V5 and above |
Contains a sender address |
H_RCPT |
§25.6.13[3ed] |
V5 and above |
Contains a recipient address |
H_RECEIPTTO |
§25.6.14[3ed] |
V8.7 and above |
Header field has return-receipt information |
H_RESENT |
§25.6.15[3ed] |
V5 and above |
Is a |
H_STRIPCOMM |
§25.6.16[3ed] |
V8.10 and above |
Strip comments for header checks |
H_TRACE |
§25.6.17[3ed] |
V5 and above |
Count these to get the hop count |
H_USER |
§25.6.18[3ed] |
V8.11 and above |
Came from a local user via SMTP |
H_VALID |
§25.6.19[3ed] |
V5 and above |
Has a validated field value |
Table 25-4 lists a number of m4 macros that you may use in your mc configuration file. They deal directly with headers.
Table 25-4. Header-related mc macros
Macro |
sendmail text reference |
Sets What |
---|---|---|
|
§25.12.18[3ed] |
Define the format for the |
|
§25.12.29[3ed] |
Define the format for the |
|
§24.9.76[3ed] |
Declare the |
|
§24.9.61[3ed] |
Declare the |
|
§24.9.64[3ed] |
Declare the |
|
§24.9.103[3ed] |
Declare the |
|
§24.9.116[3ed] |
Declare the |
|
§24.9.75[3ed] |
Declare the |
|
§24.9.93[3ed] |
Declare the |
confMESSAGEID_HEADER |
Section 25.1.2 [V8.13] |
Declares the |
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 25-5 in descending order of significance. Addresses
with the H_FROM flag (§25.6.12) are rewritten as sender
addresses.
Table 25-5. Sender headers (most to least significant)
Header |
sendmail text reference |
Flags |
Defined by |
---|---|---|---|
|
§25.2.10[3ed] |
H_FROM, H_RESENT |
RFC2822 |
|
§25.12.18[3ed] |
H_FROM, H_RESENT |
RFC2822 |
|
§25.2.10[3ed] |
H_FROM, H_RESENT |
RFC2822 |
|
§25.12.32[3ed] |
H_FORCE, H_ACHECK, H_BINDLATE |
RFC2822 |
|
§25.12.34[3ed] |
H_FROM |
RFC2822 |
|
§25.12.18[3ed] |
H_FROM |
RFC2822 |
|
§25.12.1[3ed] |
n/a |
Smail 3.0 |
|
§25.12.31[3ed] |
H_FROM |
RFC2822 |
|
§25.12.15[3ed] |
H_FROM |
RFC2298 |
|
§25.12.33[3ed] |
H_RECEIPTTO |
Obsolete |
|
§25.12.33[3ed] |
H_RECEIPTTO |
As of V8.13, a synonym for |
|
§25.12.17[3ed] |
H_FROM, H_ERRORSTO |
sendmail (deprecated) |
|
§25.12.19[3ed] |
H_ACHECK |
UUCP (obsolete) |
Note that when returning bounced mail, sendmail
always uses the envelope sender’s address. If the
special header Errors-To
: appears in the message,
and if the UseErrorsTo
option
(§24.9.116[3ed]) is set, a copy
of the bounced mail is also sent to the address in that header.
Recipient headers are those from
which one or more recipients can be
parsed. Addresses in headers with the H_RCPT flag
(§25.6.13) are rewritten as recipient addresses. When
sendmail is invoked with the
-t
command-line switch, it 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 25-6.
Table 25-6. Recipient headers
Header |
sendmail text reference |
Flags |
Defined by |
---|---|---|---|
|
§25.12.37[3ed] |
H_RCPT |
RFC2822 |
|
§25.2.10[3ed] |
H_RCPT, H_RESENT |
RFC2822 |
|
§25.12.5[3ed] |
H_RCPT |
RFC2822 |
|
§25.2.10[3ed] |
H_RCPT, H_RESENT |
RFC2822 |
|
§25.12.4[3ed] |
H_RCPT, H_BCC |
RFC2822 |
|
§25.2.10[3ed] |
H_RCPT, H_BCC, H_RESENT |
RFC2822 |
|
§25.12.2[3ed] |
H_RCPT |
Obsolete |
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 25-7.
Table 25-7. Identification and control headers
Header |
sendmail text reference |
Flags |
Defined by |
---|---|---|---|
|
§25.12.23[3ed] |
none |
RFC2822 |
|
§25.2.10[3ed] |
H_RESENT |
RFC2822 |
|
§25.12.24[3ed] |
H_EOH |
Obsolete |
|
§25.12.36[3ed] |
H_EOH |
Obsolete |
|
§25.10[3ed] |
n/a |
All sendmails |
|
§25.12.28[3ed] |
n/a |
Many (maps to X.400) |
Note that the Precedence
: and
Posted-Date
: headers (discussed next) are
hardcoded into sendmail rather than being
declared in conf.c.
Date headers are used to document the date and time that a mail message was sent or forwarded. Trace headers (those with an H_TRACE header flag; §25.6.17[3ed]) 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 are shown in Table 25-8.
Table 25-8. Date and trace headers
Header |
sendmail text reference |
Flags |
Defined by |
---|---|---|---|
|
§25.12.13[3ed] |
none |
RFC2822 |
|
§25.12.26[3ed] |
n/a |
Obsolete |
|
§25.2.10[3ed] |
H_RESENT |
RFC2822 |
|
§25.12.29[3ed] |
H_TRACE, H_FORCE |
RFC2822 |
|
§25.12.38[3ed] |
H_TRACE, H_FORCE |
Obsolete |
|
§25.12.22[3ed] |
H_TRACE, H_FORCE |
Obsolete |
|
§25.12.39[3ed] |
H_FORCE |
V8 sendmail |
|
§25.12.40[3ed] |
H_TRACE, H_FORCE |
IDA and V8 only |
Some headers that you will see in mail messages are defined by the
RFC2822 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 25-9 lists these other headers.
Table 25-9. Other headers
Header |
sendmail text reference |
Flags |
Defined by |
---|---|---|---|
|
§25.12.20[3ed] |
n/a |
RFC2822 |
|
§25.12.30[3ed] |
n/a |
RFC2822 |
|
§25.12.21[3ed] |
n/a |
RFC2822 |
|
§25.12.35[3ed] |
H_ENCODABLE |
RFC2822 |
|
§25.12.6[3ed] |
H_FORCE, H_ENCODABLE |
RFC2822 |
|
§25.12.16[3ed] |
n/a |
RFC822 |
|
§25.12.10[3ed] |
H_ACHECK |
|
MIME is documented in RFC2045, RFC2046, RFC2047, RFC2048, and RFC2049. The sendmail program only cares about MIME when bouncing messages and when determining how to convert the message body between 7 and 8 bits. The MIME headers for which sendmail possesses special knowledge are shown in Table 25-10.
Table 25-10. MIME headers
Header |
sendmail text reference |
Flags |
Defined by |
---|---|---|---|
|
§25.12.25[3ed] |
n/a |
RFC2045 |
|
§25.12.8[3ed] |
n/a |
RFC2183 |
|
§25.12.9[3ed] |
n/a |
RFC2045 |
|
§25.12.11[3ed] |
H_CTE |
RFC2045 |
|
§25.12.11[3ed] |
H_CTYPE |
RFC2045 |
Some MUAs allow users to
forward (resend, bounce, or redirect)
messages to other users. For example, the
mush(1) MUA forwards the current message to the
user named fred
with the following command:
message 1 of 3> m -f fred
Messages can also be forwarded with dist(1) from mh(1) and from within other MUAs.
When messages are forwarded, header lines that describe the
forwarding user must begin with the Resent-
prefix. When a user receives such a message, that user sees two
similar header lines:
From: original-sender Resent-From: forwarding-sender
When both the original From
: and the forwarded
Resent-From
: appear in the same header, the
Resent-
form is always considered the most recent.
If sendmail
finds any header with a name
beginning with Resent-
, it marks that message as
one that is being forwarded, preserves all Resent-
headers, and creates any needed ones.
The few header names sendmail
examines to see
whether a mail message has been forwarded are listed in Table 25-11.
18.119.159.150