O'Reilly logo

Sendmail, 3rd Edition by Bryan Costales

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Printing the Queue

When sendmail is run under the name mailq, or when it is given the -bp command-line switch, it prints the contents of the queue and exits.

Before printing the queue’s contents, sendmail prereads all the qf files in the queue and sorts the mail messages internally. This is done so that the queue’s contents are displayed in the same order in which the messages will be processed during a queue run.

If there are no messages in the queue (no qf files), sendmail prints the following message and exits or, if there are multiple queues, goes on to the next queue:

/path is empty

Here, /path is the full pathname of the queue directory.

If the queue is not empty, sendmail prints the number of messages (number of qf files) in the queue:

/path (num requests)

The num is the number of queued messages (requests) in the queue directory. If this is more than the maximum number of messages that can be processed at one time (defined by the MaxQueueRunSize option (MaxQueueRunSize),[9] sendmail prints:

/path (num requests, only ## printed)

The ## is the value of the MaxQueueRunSize option.

Note that it can take several minutes to presort and print extremely full queues (queues with more than 10,000 messages in them). To see how many messages are queued, and to avoid the delay of a presort, you can add a small MaxQueueRunSize to your invocation of mailq:

% mailq -OMaxQueueRunSize=1

This will cause sendmail to swiftly print the number of queued messages, regardless of how many are queued. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required