25.10 Precedence

The cost of a mail message determines its ability to be sent despite a high machine load (and its position in the queue depending on the setting of the QueueSortOrder option, QueueSortOrder). Each mail message has a precedence and a cost. The initial precedence (sometimes called class) of a mail message is defined by the optional presence of a Precedence: header line inside the message with a symbol corresponding to a value defined by the P configuration command.

For example, if your sendmail.cf file contained this line:


and your mail message header contained this line:

Precedence: special-delivery

your mail message would begin its life with a precedence class of 100. We'll cover how this is done soon.

After the message's initial class value is set, that value is never changed. As soon as the class is determined, the initial cost is calculated. This cost is the value that is used to determine if a message will be sent despite a high machine load (defined by the RefuseLA option, RefuseLA, and the QueueLA option, QueueLA) and to determine its order in queue processing. The formula for the initial calculation is the following:

cost = nbytes - (class * z) + (recipients * y)

where nbytes is the total size in bytes of the message, recipients is the number of recipients specified in the To:, Cc:, and Bcc: header lines (after alias expansion), and z and y are the values of the ClassFactor option (RefuseLA) and the RecipientFactor option (QueueLA).

The Precedence: header should rarely be declared in the configuration file. Instead, it is added to messages by MUAs and by mailing-list software. If it is declared in the configuration file, it should be prefixed with an appropriate ?flag? (Section 25.4) so that it is inserted only for an appropriate delivery agent.

25.10.1 The P Configuration Command

The P configuration command must begin a line. This command is composed of four parts:


The string is text, such as special-delivery. Everything between the P and the = (including any whitespace) is taken as is for string. The value is evaluated as a signed integer and can be decimal, octal (with a leading 0), or hexadecimal (with a leading 0x).

Although you can define any string you choose, only five have any universal meaning. Those five usually appear in sendmail.cf files like this:


You can, of course, define your own precedence strings for internal mail, but they will be ignored (evaluate to 0) by all outside sendmail programs.

The classes junk and bulk are also recognized by many other programs. Newer versions of the vacation(1) program, for example, silently skip replying to messages that have a Precedence: header line of junk or bulk.

As a general rule, special-delivery is rarely used. Most mail has a class of first-class. Mailing lists should always have a class of list or bulk.

Because your local sendmail.cf file is where values are given to these class names, you are free to modify those values locally. The values affect only the delivery at your site.

Old versions of sendmail didn't return errors on messages with a negative precedence. V8 sendmail does but omits the message body.

    Part I: Build and Install
    Part II: Administration
    Part III: The Configuration File
    Chapter 21. The D (Define a Macro) Configuration Command
    Chapter 24. The O (Options) Configuration Command