KOPANO-GATEWAY.CFG(5)

πŸ“¦ version 8.7.0, in ubuntu jammy

πŸ’– KOPANO-GATEWAY.CFG(5) πŸ’–

Kopano Core user reference Β· KOPANO-GATEWAY.CFG(5)

okay bestie, pull up a chair, we're reading the manual page for kopano-gateway.cfg together and honestly? it's giving essential. let's go 🫢


✨ NAME ✨

kopano-gateway.cfg β€” the Kopano gateway configuration file. that's it, that's the name, she's iconic πŸ’…


🌸 SYNOPSIS 🌸

gateway.cfg

πŸ¦‹ DESCRIPTION πŸ¦‹

so gateway.cfg is the config file for the Kopano Gateway. inside it you'll find the instructions the software needs to set up its logging system, and to turn the POP3, POP3S, IMAP or IMAPS part of the service on or off. like, it's the gateway's whole personality file fr fr.


πŸŽ€ FILE FORMAT πŸŽ€

ngl this part is lowkey the vibe check for the whole file. it's one big section, but you can group the parameters by functionality if that's your thing β€” no cap, do whatever helps you keep it cute.

parameters get written like this:

name = value

the file is line-based. every newline-terminated line is one of four things:

  • a comment
  • nothing (yes, blank lines are valid, she's resting πŸ’€)
  • a parameter
  • a directive

a line that starts with # counts as a comment, and Kopano will just ignore it. parameter names are case sensitive, so Foo and foo are NOT the same girlie, do not play with her like that 😭

lines that start with ! are directives ✨

directives look like this:

!directive [argument(s)]

πŸ“œ the directives that exist πŸ“œ

🧚 include

include and process the argument. that's the whole job, and she does it flawlessly πŸ‘‘

example:

!include common.cfg

that's part one bestie, we're not done yet β€” the rest is coming, don't go anywhere πŸ’œ

✨ EXPLANATION OF EACH PARAMETER ✨

Okay bestie, this is the big one β€” every single knob you can turn, in order, with defaults. Buckle up πŸ’–

  • server_hostname β€” the hostname the server prints to a client in the logon greeting. Leave it empty and DNS gets to figure out the hostname for you. Default: (empty)
  • server_hostname_greeting β€” do we show the hostname in the logon greeting to clients, or not? This one is reloadable with the HUP signal, so you can flip it live without a restart. Slay. Default: no
  • imap_listen β€” a space-separated list of address:port specifiers telling the server where to listen for unencrypted and STARTTLS-ed IMAP connections. IPv6 addresses need to be wrapped in brackets (like [2001:db8::1]:236), and the asterisk is the multi-protocol address wildcard. Default: *:143
  • imaps_listen β€” a space-separated list of address:port specifiers for implicit-SSL IMAP connections, same idea as imap_listen. Normally you'd park this on port 993. Default: (empty)
  • pop3_listen β€” a space-separated list of address:port specifiers for where the server should listen for unencrypted and STARTTLS-ed POP3 connections. IPv6 addresses go in brackets (as in [2001:db8::1]:236), and the asterisk is the multi-protocol address wildcard. Default: *:110
  • pop3s_listen β€” a space-separated list of address:port specifiers for implicit-SSL POP3 connections, similar to pop3_listen. Normally on port 995. Default: (empty)
  • server_socket β€” the http address of the storage server. Default: http://localhost:236/
Lowkey important: it's not advised to specify the UNIX socket here β€” use the http address instead. In the default configuration the gateway will then be trusted by the storage server (as set in its local_admin_users configuration setting). And heads up: unless it's run as an untrusted user via run_as_user, the gateway always authenticates users even if they provide no or wrong credentials! 🫒
  • run_as_user β€” after starting correctly, the gateway process becomes this user, dropping root privileges. Note that the log file needs to be writeable by this user, and the directory too, so new logfiles can be created after logrotation. You can also achieve that by setting the correct group and permissions. Default value is empty, meaning the user is not changed after starting.
  • run_as_group β€” after starting correctly, the gateway process becomes this group, dropping root privileges. Default value is empty, meaning the group is not changed after starting.
  • pid_file β€” write the process ID number into this file. The init.d script uses it to correctly stop/restart the service. Default: /var/run/kopano/gateway.pid
  • running_path β€” change directory to this path when running in daemonize mode. When you use the -F switch to run in the foreground, the directory will not be changed. Default: /
  • coredump_enabled β€” when a crash occurs or an assertion fails, the system can generate a coredump file for use with a crash report. For the details, go read the kopano-coredump(5) manpage. Default: systemdefault
  • process_model β€” you can switch the process model between fork and thread. The forked model uses somewhat more resources, but if a crash is triggered, it only affects one user. In the threaded model, a crash means all users are affected and won't be able to use the service. Choose wisely πŸ’… Default: thread
  • bypass_auth β€” this parameter can be used to skip password verification when connecting over the UNIX socket. Connecting through the UNIX socket can give a big performance gain compared to the TCP socket of kopano-server. Since kopano-gateway is usually running as the user kopano (which is a local_admin_user in kopano-server), this would normally mean kopano-gateway only verifies usernames and no password (because it's running as an administrator). Setting it to no (the default value) forces verification of passwords, even when running as an administrator. For migrations you'll want to set yes. Default: no
  • imap_only_mailfolders β€” make the IMAP and IMAPS service show only the mailfolders. That's the default behaviour. When this option is set to 'no', you'll also be able to select your calendar and contacts and such β€” but those views will not contain all information, since these items can't be converted to an rfc-822 mail item. Default: yes
  • imap_public_folders β€” make the IMAP and IMAPS service also show the public store with subfolders. That's the default behaviour. When this option is set to 'no', IMAP clients will only see the user's folder. Default: yes
  • imap_capability_idle β€” let IMAP clients issue the IDLE command. When an IMAP client is idle, it may receive notifications from the server about changes to the selected folder. This may increase load on the server when many users are using the IMAP service. Default: yes
  • imap_max_messagesize β€” limit the maximum message size (in bytes) that an IMAP client can create. The maximum of this value is 4GB although this is not recommended. If the value is too high it will cause a segmentation fault. This value may contain a k, m or g multiplier. Default: 128M
  • imap_expunge_on_delete β€” normally when you delete an e-mail in an IMAP client, it's only marked as deleted and not removed from the folder. The client should send the EXPUNGE command to actually remove the item from the folder (where Kopano will place it in the soft-delete system). When this option is set to yes, kopano-gateway will issue the expunge command itself, directly after a 'mark as delete' command was received. Default: no
  • imap_max_fail_commands β€” maximum number of failed commands before the client's connection is forcibly closed. This makes sure a client that repeatedly fails on a specific connection (like opening folders over and over again that don't exist) doesn't affect the overall performance of the gateway process. With the default value set to 10, normal operation will work for most production environments. With IMAP migrations, this value should be set higher, because many traditional IMAP migration tools try to fetch folders which didn't necessarily exist before β€” so in a migration scenario, set this higher, at minimum to the number of folders to be migrated from the largest mailbox. Default: 10
  • imap_ignore_command_idle β€” some MUAs send commands via idle, causing the connection to reach imap_max_fail_commands and leaving the client in a broken state. Those clients include Apple Mail. If you experience problems, or you use Apple Mail, set this option to yes. Default: no
  • disable_plaintext_auth β€” disable all plaintext POP3 and IMAP authentications unless SSL/TLS is used (except for connections originating from localhost, to allow saslauthd with rimap). Obviously, this requires at least ssl_private_key_file and ssl_certificate_file to take effect. Default: no
  • ssl_private_key_file β€” the gateway uses this file as the private key for SSL TLS. The file can be created with:
openssl genrsa -out /etc/kopano/gateway/privkey.pem 2048

Default: /etc/kopano/gateway/privkey.pem

  • ssl_certificate_file β€” the gateway uses this file as the certificate for SSL TLS. A self-signed certificate can be created with:
openssl req -new -x509 -key /etc/kopano/gateway/privkey.pem -out /etc/kopano/gateway/cert.pem -days 1095

Default: /etc/kopano/gateway/cert.pem

  • ssl_verify_client β€” enable client certificate verification with the value yes. All other values disable the verification. Default: no
  • ssl_verify_file β€” the file to verify the clients' certificates with. Default: value not set.
  • ssl_verify_path β€” the path with the files to verify the clients' certificates with. Default: value not set.
  • ssl_protocols β€” a space-separated list of disabled or enabled protocol names. The supported protocol names depend on the system's SSL library; depending on version, one or more of the following are available: TLSv1.3, TLSv1.2, TLSv1.1, SSLv3, SSLv2. To disable a protocol, prefix the name with an exclamation mark. Default: !SSLv2 !SSLv3 !TLSv1 !TLSv1.1
  • ssl_ciphers β€” a colon-separated list of disabled or enabled SSL/TLS ciphers. The supported cipher names depend on the system's SSL library and are generally plentiful. To disable a cipher or cipher group, prefix the name with a minus or exclamation mark. The details and meaning of the syntax are described in ciphers(1). Default: DEFAULT:!LOW:!SSLv2:!SSLv3:!TLSv1.0:!TLSv1.1:!EXPORT:!DH:!PSK:!kRSA:!aDSS:!aNULL:+AES
  • ssl_prefer_server_ciphers β€” in SSLv3 and newer, the server side gets to make the ultimate cipher pick out of the set that both ends support. In doing so, it can either use the client preference list, or, if this directive is set to "yes", its own list (as determined by ssl_cipher). Default: yes
  • ssl_curves β€” ECDH curves to use for SSL. Default: X25519:P-521:P-384:P-256
  • log_method β€” the method that should be used for logging. Valid values are:
    • syslog β€” use the syslog service. Messages will be sent using the "mail" facility tag. See also journald.conf(5) or syslog.conf(5).
    • file β€” log to a file. The filename will be specified in log_file.
    • auto β€” autoselect mode: if log_file is set, that will be used. Else, syslog will be used if it looks like it is available. Else, stderr. Default: auto
  • log_file β€” when logging to a file, specify the filename in this parameter. Use - (minus sign) for stderr output. Default: -
  • log_level β€” the level of output for logging, in the range from 0 to 6. "0" means no logging, "1" for critical messages only, "2" for error or worse, "3" for warning or worse, "4" for notice or worse, "5" for info or worse, "6" debug. Default: 3
  • log_timestamp β€” specify whether to prefix each log line with a timestamp in 'file' logging mode. Default: 1
  • log_buffer_size β€” buffer logging in what sized blocks. The special value 0 selects line buffering. Default: 0

πŸ”„ RELOADING πŸ”„

These options are reloadable by sending the kopano-gateway process a HUP signal:

  • log_level

That's it. That's the list. One icon. ✨


πŸ“ FILES πŸ“

  • /etc/kopano/gateway.cfg β€” the Kopano gateway configuration file.

πŸ‘‘ AUTHOR πŸ‘‘

Written by Kopano.


🌈 SEE ALSO 🌈


Kopano 8 🌸 November 2016 πŸ¦‹ KOPANO-GATEWAY.CFG(5)

And that's a wrap bestie β€” go forth and configure, you absolute main character πŸ’…πŸ«Ά

πŸ“¦ where this page comes from