Consulting djbware Publications

2. s/qmail file system usage

Starting with s/qmail 4.3 a 'splitted directory' layout may be chosen:

  1. In conf-home you can declare where 's/qmail' lives: Binaries and configuration.
  2. In conf-queue you tell where the queue is located.

There is no need that both parts are on the same mount points. s/qmail will work happily otherwise. Given those settings, within the s/qmail installation all dependent modules are adjusted to those pathes.

2.1 s/qmail installation pathes

Lets give some examples about the choice of pathes:

2.2 s/qmail base directory

Unless otherwise specified s/qmail uses

We denote that as SQMAIL, irrespectively of its current value. Its current setting is defined in conf-home. Rather, since s/sqmail follows the /package principals, there some differences, one should recognize.

Beyond that main directory, the following subdirectories are raised:

Note: The s/qmail binary files and scripts posses a compiled-in path are subject change upon installation.

Optional directories are:

2.3 Queue directory

The queue (denoted as QUEUE) directory needs to reside on a contiguous directory since s/sqmail uses inodes as file name: The file name is equal to its inode. Currently, this can only achieved on the very same file system. However, QUEUE may exist on a diferent file space without any restrictions.

A typical queue layout should show up in the following way:

drwxr-x--- 12 qmailq sqmail 512 Dec 9 14:01 . drwxr-xr-x 11 root sqmail 512 Nov 18 14:49 .. drwx------ 2 qmails sqmail 512 Jan 3 15:54 bounce drwxr-x--- 25 qmailq sqmail 512 Dec 9 14:01 dkim drwx------ 25 qmails sqmail 512 Nov 18 14:49 info drwx------ 25 qmailq sqmail 512 Nov 18 14:49 intd drwx------ 25 qmails sqmail 512 Nov 18 14:49 local drwxr-x--- 2 qmailq sqmail 512 Nov 18 14:49 lock drwxr-x--- 25 qmailq sqmail 512 Nov 18 14:49 mess drwx------ 2 qmailq sqmail 512 Jan 4 16:26 pid drwx------ 25 qmails sqmail 512 Nov 18 14:49 remote drwxr-x--- 25 qmailq sqmail 512 Nov 18 14:49 todo

The directories

posses a number of sub-directories according to conf-split which defaults to '23'. Messages are equally distributed in here for performance reasons.

The spliting of todo corresponds to the BIGTODO feature and supports qmail-send operation to move a file from the TODO (pending) state to the actual execution state, even for a very large message number without significant performance degradation due to stat bottlenecks.

2.4 Binary directories

After installation, the executable s/sqmail files can be found in the following directories:

2.5 Control directory

s/qmail control directory is used by

Currently, s/qmail does not differentiate between a

A configuration file es read upon the start of a service and perhaps by a certain signal, while a control file is taken into account by a service for a session/transaction, thus is read on-the-fly.

In general qmail-send reads it's control files on invocation (except for locals, virtualdomains, concurrencylocal and concurrencyremote which can be actived sending a HUP signal to qmail-send. All other control files are processed on-the-fly, however messages already prepared for sending, are not affected a posteriori changing a control file.

The current settings of the control files can be evaluated by means of the qmail-showctl command. The default settings are described in qmail-control.

2.6 User directory

The ./user/ directory of s/qmail serves three different purposes:

  1. To assign local Unix users with email addresses by means of qmail-users,
  2. to serve as default location for qmail-recipients where the file users/recipients is compiled to a cdb for valid email addresses to accept by qmail-smtpd.
  3. to store the authuser file for SMTP and/or POP3 authentication required for qmail-smtpd, qmail-popup and read by qmail-authuser.

2.7 etc directory

The ./etc directory is an 'alien' directory for s/qmail. Typically it is used to store

configuration databases, the '*.cdb' files.

However, these files are indispensible for the running s/qmail system and the should belong to a particular instance. Therefore, this is the place to live!

2.8 s/qmail filesystem usage

s/qmail follows the idea of minimal system usage, in particular disk usage. However, this may different, if you use s/qmail as large scale MTA: