Some headers should be inserted into a mail message only if
a certain delivery agent is used.
For example, one traditionally should include the
header when mail is being delivered with UUCP but should not include it
for most other delivery agents.
The mechanism that governs inclusion is a list
of flags that prefix the header definition in the configuration file.
Those flags are composed of a series of one or more letters, all of
which are surrounded with a pair of
When sendmail decides whether a header is to be added
to the mail message, it compares the
flags listed with
the flags of the delivery agent's
Mhub, P=[IPC], S=Hubset, R=0, F=mDFMuXa, T=DNS/RFC822/SMTP, A=IPC $h flags
If a given flag (letter) appears in both, the header is added to the mail message. Otherwise, it is not.
Traditionally, for example, the
x flag is used to indicate
the need for a
Full-Name: header. But our hub
delivery agent does not have an
x in its
Since that is the only delivery agent we use, we need to add
that flag to the client.cf file.
Full-Name: header is used to display the full name
of the sender, as taken from the gecos field of the
passwd(5) file. You saw above how the hub machine tries
to add the sender's full name to the
But since you don't necessarily have control over the hub, you should
Full-Name: header locally, so that the full name
is displayed even if the hub fails to add it.
The way to declare the
Full-Name: header is like this:
H?x?Full-Name: $?x$x$. # Add full name if available
The value given to the
Full-Name: header is just like
the conditional that you saw earlier. If (
$?) the macro
contains a value, use that value (
$x), and endif (
We use this conditional test so that the full name is added only if
it is known.
Next, to make the
Full-Name: effective, you need to
x flag to the
hub delivery agent declaration:
Mhub, P=[IPC], S=Hubset, R=0, F=
xmDFMuXa, T=DNS/RFC822/SMTP, A=IPC $h add
Now any mail that uses the
hub delivery agent for a recipient
(in other words, all mail)
will add a
Full-Name: header to the message if there is not
already one there. If the full name is known (
$x has a value),
that name follows the
Full-Name: header on the same line;
otherwise, the header contains only the header name and is omitted entirely.
Date: header is required in all messages to show the
time and day that the message originated.
It is a good idea to include
in its definition so that custom delivery agents
that do not need the
Date: can be designed later.
H?D?Date: $a # Add if F=D
F=D flag already exists in the
hub delivery agent:
Mhub, P=[IPC], S=Hubset, R=0, F=xm
DFMuXa, T=DNS/RFC822/SMTP, A=IPC $h add the date if missing
D was originally put in this delivery agent definition
Date: header in mind.
Message-ID: header is used to uniquely identify
each mail message. It must be inserted into the message when
it is first created (first handled by sendmail). The form
Message-ID: header is very specific:
H?M?Message-Id: <$t.$i@$j> # Add if F=M
Mhub, P=[IPC], S=Hubset, R=0, F=xmDF
MuXa, T=DNS/RFC822/SMTP, A=IPC $h add the message identifier if missing
The field following the
Message-ID: must follow
particular rules. First, it must be surrounded by angle brackets.
Then, what appears between the angle brackets must look like a legal
The address must be composed of pieces of information that uniquely identify the mail message worldwide. We create that address in a way that is commonly used in most configuration files:
$t is the current date and time represented by an integer.
is the local unique identifier for the queue file for this message
(even if the message isn't queued), and
$j is your host's
fully qualified domain name. Other information may be used, provided that
the result looks like a legal address and provided that no two identical
identifiers ever go out.