imap — Gromox IMAP server


The IMAP server supports impersonation. The username given to the IMAP login normally specifies both the mailbox and the user performing the access. To use a different identity for authentication, prefix the mailbox name by the user identity and separate it with an exclamation mark, e.g. "myaccount@domain.example!sharedmbox@domain.example". Accessing a store in such manner is only possible when the authenticating user has store ownership over the mailbox.


imap [-c config]


-c config

Read configuration directives from the given file. If this option is not specified, /etc/gromox/imap.cfg will be read if it exists.


Output version information and exit.


Display option summary.

All time-based command-line options and configuration file directives are subject to the syntax described in gromox(7), section "Duration specifications".

Configuration directives (gromox.cfg)

The following directives are recognized when reading from /etc/gromox/gromox.cfg, or when the -c option is used to specify a custom file:


In gromox-imap, this is treated as an alias for imap_fd_limit.

Request that the file descriptor table be at least this large. The magic value 0 indicates that the system default hard limit (rlim_max, cf. setrlimit(2)) should be used.
Default: 0
This flag controls the acceptance of the HAProxy "PROXY" command at the start of a connection. When a (reverse) proxy is placed in front of gromox-imap, the address that gximap normally sees is the proxy address (e.g. ::1). A proxy can use this protocol extension to convey the actual client address, and gximap can pick this up for its own reporting, which in turn is useful for e.g. fail2ban setups.
Default: no

Configuration directives (imap.cfg)

The following directives are recognized when reading from /etc/gromox/imap.cfg, or when the -c option is used to specify a custom file:

The amount of time a user is blocked from connecting to the service after too many failed logins.
Default: 1 minute
Colon-separated list of directories in which further configuration files, especially those used by plugin instances, will be searched.
Default: /etc/gromox/imap:/etc/gromox

Default: 128K

The expected average upper bound of number of mails for a folder. Together with context_num, this directive controls the size of the memory pool for listings.
Default: 64K

Default: 2M

Maximum number of concurrently active sessions.
Default: 200
Colon-separated list of directories in which static data files will be searched.
Default: /usr/share/gromox/imap

Default: en

RFC 2971 specifies the "ID" command with which a client can inquire the program name and version of the server. This is disabled by default, as it can facilitate potential attackers' information gathering.
Default: no
A unique identifier for this system. It is used in the IMAP protocol greeting lines (positive as well as negative). It is furthermore used as a unique identifier among the set of all midb(8gx) clients to construct filenames for the MIDB database/EML cache. The identifier should only use characters allowed for hostnames.
Default: (system hostname)
The number of login tries a user is allowed before the account is blocked.
Default: 10
If an authenticated IMAP connection is idle for the given period, the connection is terminated. RFC 2060 §5.4 recommends 30 minutes minimum. (Connections that have not authenticated are subject to the regular imap_conn_timeout.)
Default: 30 minutes
The password to unlock TLS certificates.
Default: (unset)
Filesystem path to a certificate file for use with encrypted connection. The complete certificate chain should be present (as there is no other config directive to pull CA certs in).
Default: (unset)
Log every incoming IMAP command and the return code of the operation in a minimal fashion to stderr. Level 1 emits commands that have failed execution, level 2 emits all commands.
Default: 0
If an IMAP connection stalls (writing responses to client) for the given period, the connection is terminated. If unauthenticated IMAP connections do not have any activity (requests from clients) for the given period, the connection is terminated.
Default: 3 minutes
This flag controls whether clients must utilize TLS, either by way of implicit TLS (cf. imap_listen_tls_port), or through the STARTTLS command.
Default: false
AF_INET6 socket address to bind the IMAP service to.
Default: ::
The TCP port to expose the IMAP protocol service on. (The IP address is fixed to the wildcard address.)
Default: 143
The TCP port to expose implicit-TLS IMAP protocol service (IMAPS) on. (The IP address is fixed to the wildcard address.)
Default: (unset)
Target for log messages here. Special values: "-" (stderr/syslog depending on parent PID) or "syslog" are recognized.
Default: - (auto)
Maximum verbosity of logging. 1=crit, 2=error, 3=warn, 4=notice, 5=info, 6=debug.
Default: 4 (notice)
Filesystem path to the key file needed to unlock the TLS certificate.
Default: (unset)
Enable RFC 9051 (IMAP 4.2) related logic and protocol elements.
Default: yes
This flag controls the offering of TLS modes. This affects both the implicit TLS port as well as the advertisement of the STARTTLS extension and availability of the STARTTLS command (RFC 2595) to clients.
Default: false
Connection load factor (oversubscription ratio) for a processing thread.
Default: 40
The initial and also minimum number of client processing threads to keep around. This is similar to php-fpm's start_servers/min_spare_servere. (The maximum number of threads, i.e. what would be max_spare_servers, is determined by: context_num divided by imap_thread_charge_num)
Default: 5
An unprivileged user account to switch the process to after startup.
Default: gromox
The lowest TLS version to offer. Possible values are: tls1.0, tls1.1, tls1.2, and, if supported by the system, tls1.3.
Default: tls1.2


  • data_file_path/folder_lang.txt: Translations for IMAP folder names.

  • data_file_path/imap_code.txt: Mapping from internal IMAP error codes to textual descriptions.

  • /usr/lib/gromox/libgxs_*.so: service plugins

See also

gromox(7), midb_agent(4gx)