The Format of Headers Section:
Mail headers are those lines found at the beginning of a mail message that provide administrative
information about the mail message, such as when and from where it was sent. The Format of
Headers section defines the headers that sendmail inserts into mail. The header definitions from the
Red Hat sendmail.cf
file are shown in the listing below
H?P?Return-Path: <$g>
HReceived: $?sfrom $s $.$?_($?s$|from $.$_)
$.$?{auth_type}(authenticated$?{auth_ssf} (${auth_ssf} bits)$.)
$.by $j ($v/$Z)$?r with $r$. id $i$?{tls_version}
(using ${tls_version} with cipher ${cipher} (${cipher_bits} bits)
verified ${verify})$.$?u
for $u; $|;
$.$b
H?D?Resent-Date: $a
H?D?Date: $a
H?F?Resent-From: $?x$x <$g>$|$g$.
H?F?From: $?x$x <$g>$|$g$.
H?x?Full-Name: $x
H?M?Resent-Message-Id: <$t.$i@$j>
H?M?Message-Id: <$t.$i@$j>
Each header line begins with the H command, which is optionally followed by header flags enclosed in question marks. The header flags control whether or not the header is inserted into mail that is bound for a specific mailer. If no flags are specified, the header is used for all mailers. If a flag is specified, the header is used only for a mailer that has the same flag set in the mailer's definition. (Mailer definitions are covered later in this tutorial.) Header flags only control header insertion. If a header is received in the input, it is passed to the output, regardless of the flag settings.
Each line also contains a header name, a colon, and a header template. These fields define the
structure of the actual header. Macros in the header template are expanded before the header is
inserted into a message. Look at the first header in the sample. $g says to use the value stored in
the g macro, which holds the sender's e-mail address. Assume the sender is David. After the macro
expansion, the header might containReturn-Path: <david@wren.foobirds.com>
Note:
The second header shows examples of long macro names, such as {auth_ type}.
The sample headers provide examples of a conditional syntax that can be used in header templates
and macro definitions. It is an if/else construct where $? is the "if," $| is the "else," and $. is the
"endif." A simple example from the previous listing isH?F?Resent-From: $?x$x <$g>$|$g$
.
The header template $?x$x ©$g>$|$g$ says that if ($?) macro x exists, use $x <$g> as the header
template, else ($|) use $g as the template. Macro x contains the full name of the sender. Thus if it
exists, the header isResent-From: David Craig <david@wren.foobirds.org>
If x doesn't exist, the header isResent-From: david@wren.foobirds.org
The headers provided in your system's sendmail.cf file should be correct and sufficient for your installation. Header formats are defined in RFC standards documents. There is no need to create customized headers.