2. s/qmail file system usage
Starting with s/qmail 4.3 a 'splitted directory' layout may be chosen:
- In conf-home you can declare where 's/qmail' lives: Binaries and configuration.
- 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:
- Default installation: /var/qmail while /var/qmail/queue is positioned as usual.
- Collaborative installation: /var/sqmail and the queue at /var/sqmail/queue to use legacy qmail and s/qmail on demand.
- Debian installation: /usr/local/sqmail and /var/sqmail/queue splitted up.
- SmartOS/OmniOS installation: /opt/ooce/sqmail/ (for the binaries and configuration) and /var/queue.
2.2 s/qmail base directory
Unless otherwise specified s/qmail uses
- /var/qmail/
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:
- SQMAIL/alias/: alias directory
- SQMAIL/bin/: directories of executables (binaries and scripts)
- SQMAIL/control/: directory homing the control files
- SQMAIL/ssl/: directory to store X.509 certs, key files and other files required for ucspi-ssl to work
- SQMAIL/users/: sqmail user and recipients
Note: The s/qmail binary files and scripts posses a compiled-in path are subject change upon installation.
Optional directories are:
- SQMAIL/etc: ucspi-ssl and ucspi-tcp6 configuration files
- SQMAIL/skeletons: QMQ skeleton directory
- SQMAIL/svc: supervise directory for /service daemons
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:
The directories
- info,
- intd,
- local,
- mess,
- remote,
- todo, and now
- dkim
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:
- SQMAIL/bin/: These files belong to the s/qmail instance and act upon the current QUEUE/queue/.
- /usr/local/bin/: s/qmail files here are 'general purpose' and are for applicable for all s/qmail instances.
2.5 Control directory
s/qmail control directory is used by
Currently, s/qmail does not differentiate between a
- configuration and
- control file.
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:
- To assign local Unix users with email addresses by means of qmail-users,
- 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.
- 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:
- If splitted, s/qmail home directory is slim and probably stays constant over the entire lifetime. Depending however on your filtering (I've seen cases where admins have several thousand addresses in 'badmailfrom') milage may vary.
- s/qmail's queue is typically empty, except for cases im mails can't be delivered (and bounces). Consider the average size of an email to be 20 Kbytes. In case of huge backlog mail, you probably want to look at QMQ.
- Howeve, s/qmail provides for his daemons an lot of log information. On a busy site, you end with 1 GBbytes up to 10 GBytes written (my experience). It is thus necessary to care for those.