start page | rating of books | rating of authors | reviews | copyrights

sendmail

sendmailSearch this book
Previous: 35.7 Forwarding with Resent-Headers Chapter 35
Headers
Next: 35.9 Pitfalls
 

35.8 Precedence

The cost of a mail message determines its ability to be sent despite a high machine load and its position in the queue when the queue is processed. Each mail message has a priority and a cost. The initial priority (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 P configuration command. For example, if your sendmail.cf file contained this line:

Pspecial-delivery=100

and your mail message header contained this line:

Precedence: special-delivery

then your mail message would begin its life with a 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 ( X ) option, see Section 34.8.54, RefuseLA (X) , and the QueueLA ( x ) option, see Section 34.8.50, QueueLA (x) ) 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 either the number of recipients in the envelope or (with -t ) 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 ( z ) option (see Section 34.8.8, ClassFactor (z) ) and the RecipientFactor ( y ) option (see Section 34.8.53, RecipientFactor (y) ).

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 ? (see Section 35.4 ) so that it is inserted only for an appropriate delivery agent.

35.8.1 The P Configuration Command

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

P

string=value

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 may be decimal, octal (with a leading 0), or hexadecimal (with a leading 0x).

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

Pspecial-delivery=100 Pfirst-class=0 Plist=-30 Pjunk=-60 Pbulk=-200

You may, 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.


Previous: 35.7 Forwarding with Resent-Headers sendmail Next: 35.9 Pitfalls
35.7 Forwarding with Resent-Headers Book Index 35.9 Pitfalls