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 emptyHere, /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(numrequests)
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(numrequests, 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=1This will cause sendmail to swiftly print the number of queued messages, regardless of how many are queued. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access