How the Queue Is Processed
Over time, messages can gather in the queue awaiting delivery. They remain there until sendmail performs a queue run to process the queue. The sendmail program can be told either to process the queue periodically (when run as a daemon) or to process the queue once, then exit. Each time sendmail processes the queue, it also performs a series of operations that are intended to improve the efficiency with which it delivers messages.
First the queue directory is opened for reading. If that directory cannot be opened, sendmail syslog(3)s the following message at LOG_CRIT and exits:
cannot opendir(/var/queue): reason hereThis error is usually the result of a user running
sendmail in an unsafe manner, with a
-C command-line argument, for example. It can also
result from sendmail attempting to open an
NFS-mounted queue directory, where root is
mapped to nobody.
Next, the qf files are read to gather their
priorities and times (the P and
T lines). If a qf file cannot
be opened, it is quietly ignored unless a -d41.2
debugging command-line switch is specified, in which case the
following error message is printed:
orderq: cannot open qfdB928RR04181 (reason)
Prior to V8.7 sendmail, there was a hard limit on the number of messages that could be processed at any time. If more than QUEUESIZE (defined in conf.h, typically 1000) messages were in queue, only the first QUEUESIZE (1000) of them would be processed! Ordinarily, this was not a problem. But it could quickly become ...
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