exmdb_provider(4gx) — http(8gx) service plugin for exmdb connections


exmdb_provider is a service plugin for http(8gx). It offers a plethora of individual functions (124 of them) for operating on mailbox stores. In addition, this functionality is also exposed by way of a Gromox-specific network protocol on port 5000.

Configuration file directives


Default: 2 hours

Log every incoming exmdb network RPC and the return code of the operation in a minimal fashion to stderr. Level 1 emits RPCs with a failure return code, level 2 emits all RPCs. Note that direct function calls from within the process image are not logged this way, so this will not show exmdb_provider invocations from exchange_emsmdb(4gx).
Default: 0
An IPv6 address (or v4-mapped address) for exposing the timer service on.
Default: ::1
The TCP port number for exposing the timer service on.
Default: 5000

Default: 20


Default: unlimited


Default: unlimited


Default: 1000


Default: 200000


Default: 4


Default: 4


Default: 10


Default: ;

Default: 0 (use SQLite default)
Enables/disables synchronous mode for SQLite databases. See https://www.sqlite.org/pragma.html#pragma_synchronous for details.
Default: off
Selects the particular journal mode for SQLite databases; off selects DELETE mode, on selects WAL mode. See https://www.sqlite.org/pragma.html#pragma_journal_mode for details.
Default: on

Default: 5000


Default: (unspecified)

Multiserver selection map

The SQL column users.homedir specifies a home directory location in an abstract namespace. This abstract namespace is shared between all Gromox programs, and can be used to divide users into custom subsets and steer connections to different servers.

exmdb_list.txt specifies how to map from this namespace to exmdb servers. The file is used by exmdb clients to select the right server to connect to, and the file is used by exmdb_provider to set up its own data structures.

Each line in this file consists of 4 columns separated by whitespace:

  • Initial prefix to match a user’s exmdb home directory on. The pattern should almost always end in a ‘/’ character, otherwise a prefix of “/home” is able to match a userdir of “/home2/username” as well, which may be undesired.

  • The type of mail stores that are served beneath the prefix. This must either be “private” or “public”.

  • The IPv6 (or v4-mapped) address of the midb server to use for this prefix.

  • The port number.

In the absence of exmdb_list.txt, two implicit default entries are used:

/var/lib/gromox/user/ private ::1 5000
/var/lib/gromox/domain/ public ::1 5000

Network protocol

The transmissions on the socket are simple concatenations of protocol data units built using the NDR format. The PDU length is present within the PDU itself near the start.

     leuint32_t length;
     char pdu[];
pdu := {
     uint8_t call_id;
     string directory;
     switch (call_id) {


  • config_file_path/exmdb_acl.txt: A file with one address (IPv6 or v4-mapped) per line of allowed clients. In its absence, ::1 is default-whitelisted.

  • config_file_path/exmdb_list.txt: exmdb multiserver selection map.

  • data_file_path/mail_bounce/

config_file_path and data_file_path is determined by the configuration of the program that loaded the exmdb_provider plugin.

See also

gromox(7), http(8gx)