What separates a message header from a message body? A blank line. You know that the message body contains the idea that you are trying to convey. But what do the headers contain?
In your e-mail program of choice find the option to display message headers.
You'll see a lot more information now then just the message body.
You'll now see all the headers that were used to route the message from one machine to another.
To see which headers Sendmail might add to your message, look in the sendmail.cf file for lines that start with a capital H.
The format of the header lines that sendmail inserts into the message are defined by the H line. The syntax of this line is one of the following:
Hhname: htemplate
H[?mflags?]hname: htemplate
H[?${macro}?]hname: htemplate
Continuation lines in this spec are reflected directly into the outgoing message. The htemplate is macro-expanded before insertion into the message. If the mflags (surrounded by question marks) are specified, at least one of the specified flags must be stated in the mailer definition for this header to be automatically output. If a ${macro} (surrounded by question marks) is specified, the header will be automatically output if the macro is set. The macro may be set using any of the normal methods, including using the macro storage map in a ruleset. If one of these headers is in the input it is reflected to the output regardless of these flags or macros. Notice: If a ${macro} is used to set a header, then it is useful to add that macro to class $={persistentMacros} which consists of the macros that should be saved across queue runs.
A secondary syntax allows validation of headers as they are being read. To enable validation, use:
HHeader: $>Ruleset
HHeader: $>+Ruleset
The indicated Ruleset is called for the specified Header, and can return $#error to reject or quarantine the message or $#discard to discard the message (as with the other check_* rulesets). The ruleset receives the header field-body as argument, i.e., not the header field-name; see also ${hdr_name} and ${currHeader}. The header is treated as a structured field, that is, text in parentheses is deleted before processing, unless the second form $>+ is used. Note: only one ruleset can be associated with a header; sendmail will silently ignore multiple entries.
For example, the configuration lines:
HMessage-Id: $>CheckMessageId SCheckMessageId R< $+ @ $+ > $@ OK R$* $#error $: Illegal Message-Id
header would refuse any message that had a Message-Id: header of any of the following forms:
Message-Id: <>
Message-Id: some text
Message-Id: <legal text@domain> extra crud
A default ruleset that is called for headers which don't have a specific ruleset defined for them can be specified by:
H*: $>Ruleset
or
H*: $>+Ruleset
Headers can include but are not limited to the following:
bcc
cc
comments
content-length
content-transfer-encoding
content-type
date
disposition
encrypted
errors-to
from
full-name
in-reply-to
keywords
message-id
notification-to
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
to
x400-received
Next Section: Companion Programs - 17 of 32