4 ms·
I was surprised the first time I saw Daniel J. Bernstein's qmail configuration. Qmail uses separate configuration files for each parameter being set. The direc
by todd8 5y ago
I was surprised the first time I saw Daniel J. Bernstein's qmail configuration. Qmail uses separate configuration files for each parameter being set. The directory /var/qmail/control contains most of these files.
For example, to set the maximum message size to by 10Mb and to set the timeout to be 30 seconds:
echo 10000000 > /var/qmail/control/databytes
echo 30 > /var/qmail/control/timeoutsmtpd
There are many more files like this that hold simple values. /var/qmail/control/locals is a file that is a list of domain names, one per line.
Dictionaries are just subdirectories with one file per entry, for example this is how aliases are defined to qmail:
echo fred > /var/qmail/alias/.qmail-postmaster
echo fred > /var/qmail/alias/.qmail-mailer-daemon
See [1] for more about qmail.
DJB also created a simple, portable encoding for serializing data called netstrings, see [2]. XML, YAML, JSON, TOML, and INI files all have some advantages over netstrings, but netstrings are simple to understand and simple to parse correctly.
[1] https://www.oreilly.com/library/view/qmail/1565926285/ch04.html https://www.oreilly.com/library/view/qmail/1565926285/ch04.h...
[2] https://en.wikipedia.org/wiki/Netstring https://en.wikipedia.org/wiki/Netstring
- transfire 5y agoI used this system myself for a project. It has some downsides, but overall it worked pretty dang well.