Mail Administration Guide

Queue File Format

The sendmail program stores temporary queue files in the queue file /var/spool/mqueue. All such queue files have the form xfAA99999, where AA99999 is the ID for the file and x is the type. Table 2-3 shows the types of queue files.

Table 2-3 Types of Queue Files

Type 

Description 

d

Data file. The message body (excluding the header) is kept in this file. 

q

Queue control file. This file contains the information needed to process the job. 

t

A temporary file. This file is an image of the qf file when it is being rebuilt. When the rebuild is complete, the file is renamed qf.

x

Transcript file that shows everything that happens during that session. 

A qf file contains a series of lines, each beginning with a code letter. Not all lines are included with each message, but a complete list is shown in Table 2-4.

Table 2-4 Codes for the qf File

Code 

Description 

$

A macro definition. The values of certain macros (currently $r and $s) are passed through to the queue run phase.

B

The body type. This line defines the body type. Legal values are 7BIT and 8BITMIME. 

C

The controlling address. The syntax is localuser:aliasname. Recipient addresses following this line will be flagged so that deliveries will be run as the localuser (a user name from the password file or database); aliasname is the name of the alias that expanded to this address (for printing messages).

D

The name of the data file. There might only be one of these lines. 

E

The error recipient name. Error messages are sent to this user instead of the sender. This line is optional. 

F

Flag bits. This can be r, indicating that this is a response message and w, indicating that a warning message has been sent announcing that the mail has been delayed.

H

A header definition. There might be any number of these lines. The order is important: it represents the order in the final message. The syntax is the same as header definitions in the configuration file. 

L

Information to compute the content length. 

M

A message line, which is printed by using sendmail with the -bp flag and is generally used to store status information. It can contain any text.

P

The current message priority, which is used to order the queue. The higher the number, the lower the priority. The priority increases as the message stays in the queue. The initial priority depends on the message class and the size of the message. 

R

A recipient name. There is one line for each recipient. The recipient name is normally completely aliased, but its aliases are redone when the job is processed. The recipient name must be at the end of the qf file.

S

The sender name. There might be only one of these lines. 

T

The job creation or submission time in seconds, which is used to compute when the job times out. 

See Chapter 3, Customizing sendmail Configuration Files for more information.

The queue is automatically run at the interval specified in the sendmail.cf file (the default is every hour). The queue is read and sorted, and then sendmail tries to process all jobs in order. The sendmail program first checks to see if a job is locked. If the job is locked, sendmail ignores the job; if the job is not locked, sendmail processes it.

If a major host goes down for several days, the queue may become prohibitively large and sendmail will spend time sorting the queue. You can fix this by moving the queue to a temporary place and creating a new queue. You can run the old queue later when the host is returned to service.