Description
I love mox's self-documentation design (the config is the docs, and compiled into the executable) and its well-thought-out config organization.
This is just personal opinion and feel free to ignore, but I feel like the sconf format is a roadblock here, and hindering ease of use quite a bit.
Firstly: the requirement to use tabs - the default VIM config on most systems (and many other editors) uses 8-space tabs, which makes indents quite large and unwieldly. Python, the most common and popular "whitespace is significant" language like this, recommends spaces. YAML doesn't even allow tabs. Many modern text editors automatically replace tabs with spaces by default.
So automatically users are fighting against the tide trying to edit mox.conf and domains.conf without breaking them.
Secondly: long lines - my mox.conf has lines that blow out to 126 characters (e.g. CertFile
paths), so while every other service I administer can happily work in a small 80x25 terminal window alongside other windows, mox always forces me to maximize the window or stretch it to take up half my screen. Granted we have big screens now, this isn't 1985, but there's kind of a defacto standard of 80-90 columns ish which makes it nice when dealing with a lot of different services. Incidentally this is also good typography and good for readability.
JSON5 could be an awesome drop-in replacement for sconf (it has a few popular go implementations). Basically JSON but relaxed somewhat, allowing comments, trailing commas, etc.
- Whitespace no longer an issue, spaces/tabs are fine (2-space indents would be good here)
- JSON is super common and well-understood, likely no learning curve for users
- Semantically identical to sconf - I suspect it could be parsed into the exact same internal representation
- No awkward '-' on empty lines
- Small lists (like
IPs
below) can be one-liners
Sample:
{
// Directory where all data is stored, e.g. queue, accounts and messages,
// ACME TLS certs/keys. If this is a relative path, it is relative to the
// directory of mox.conf.
DataDir: "../data",
// Full hostname of system, e.g. mail.<domain>
Hostname: "mail.example.com",
// Listeners are groups of IP addresses and services enabled on those IP
// addresses, such as SMTP/IMAP or internal endpoints for administration
// or Prometheus metrics. All listeners with SMTP/IMAP services enabled
// will serve all configured domains. If the listener is named 'public',
// it will get a few helpful additional configuration checks, for acme
// automatic tls certificates and monitoring of ips in dnsbls if those
// are configured.
Listeners: {
internal: {
// ...
IPs: ["1.2.3.4", "127.0.0.1"],
}
}
// ...
}
Again just my opinion - don't know all the internal considerations so feel free to ignore. But loving this project overall and I feel like it serves an important mission, to help decentralize email and make it more accessible to self-hosters, so would hate the config format to get in the way.