Overview of the Queue

The sendmail queue is implemented by placing held messages into one or more directories. Prior to V8.10, there was only one directory, and its name was usually mqueue. Now, the directory or directories to be used are specified in the configuration file with the QueueDirectory option (QueueDirectory):

OQ/var/spool/mqueue                     pre-V8.7 form
O QueueDirectory=/var/spool/mqueue      beginning with V8.7
O QueueDirectory=/var/queues/q.*V8.10 multiple directories

If the QueueDirectory option is missing, the name defaults to mqueue. The location should never be relative (as mqueue). When it is wrongly specified as a relative path name, it is taken as relative to the location where sendmail is run. Because the sendmail daemon is typically started from an rc file at boot time, such relative locations are usually relative to the root (/) directory.[1]

After sendmail has processed its configuration file, it does a chdir(2) into its base queue directory and does all the rest of its work from there. In the first two lines of the previous example, the base queue directory is /var/spool/mqueue. In the last line, the base queue directory is /var/queues. This change into the base queue directory has three side effects:

  • Should the sendmail program fault and produce a core dump, the core image is left in the base queue directory.

  • Any relative pathnames that are given to options in the configuration file are interpreted as relative to the base queue directory. (This is not true for the ...

Get Sendmail, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.