1# Global configuration directives23These directives can be specified outside of any4configuration blocks and they are applied to all modules.56Some directives can be overridden on per-module basis (e.g. hostname).78### state_dir _path_9Default: `/var/lib/maddy`1011The path to the state directory. This directory will be used to store all12persistent data and should be writable.1314---1516### runtime_dir _path_17Default: `/run/maddy`1819The path to the runtime directory. Used for Unix sockets and other temporary20objects. Should be writable.2122---2324### hostname _domain_25Default: not specified2627Internet hostname of this mail server. Typicall FQDN is used. It is recommended28to make sure domain specified here resolved to the public IP of the server.2930---3132### auth_map _module-reference_33Default: `identity`3435Use the specified table to translate SASL usernames before passing it to the36authentication provider.3738Before username is looked up, it is normalized using function defined by39`auth_map_normalize`.4041Note that `auth_map` does not affect the storage account name used. You probably42should also use `storage_map` in IMAP config block to handle this.4344This directive is useful if used authentication provider does not support45using emails as usernames but you still want users to have separate mailboxes46on separate domains. In this case, use it with `email_localpart` table:4748```49 auth_map email_localpart50```5152With this configuration, `user@example.org` and `user@example.com` will use53`user` credentials when authenticating, but will access `user@example.org` and54`user@example.com` mailboxes correspondingly. If you want to also accept55`user` as a username, use `auth_map email_localpart_optional`.5657If you want `user@example.org` and `user@example.com` to have the same mailbox,58also set `storage_map` in IMAP config block to use `email_localpart`59(or `email_localpart_optional` if you want to also accept just "user"):6061```62 storage_map email_localpart63```6465In this case you will need to create storage accounts without domain part in66the name:6768```69maddy imap-acct create user # instead of user@example.org70```7172---7374### auth_map_normalize _function_75Default: `auto`7677Normalization function to apply to SASL usernames before mapping78them to storage accounts.7980Available options:8182- `auto` `precis_casefold_email` for valid emails, `precis_casefold` otherwise.83- `precis_casefold_email` PRECIS UsernameCaseMapped profile + U-labels form for domain84- `precis_casefold` PRECIS UsernameCaseMapped profile for the entire string85- `precis_email` PRECIS UsernameCasePreserved profile + U-labels form for domain86- `precis` PRECIS UsernameCasePreserved profile for the entire string87- `casefold` Convert to lower case88- `noop` Nothing8990---9192### autogenerated_msg_domain _domain_93Default: not specified9495Domain that is used in From field for auto-generated messages (such as Delivery96Status Notifications).9798---99100### tls `file` _cert-file_ _pkey-file_ | _module-reference_ | `off`101Default: not specified102103Default TLS certificate to use for all endpoints.104105Must be present in either all endpoint modules configuration blocks or as106global directive.107108You can also specify other configuration options such as cipher suites and TLS109version. See maddy-tls(5) for details. maddy uses reasonable110cipher suites and TLS versions by default so you generally don't have to worry111about it.112113---114115### tls_client { ... }116Default: not specified117118This is optional block that specifies various TLS-related options to use when119making outbound connections. See TLS client configuration for details on120directives that can be used in it. maddy uses reasonable cipher suites and TLS121versions by default so you generally don't have to worry about it.122123---124125### log _targets..._ | `off`126Default: `stderr`127128Write log to one of more "targets".129130The target can be one or the following:131132- `stderr` – Write logs to stderr.133- `stderr_ts` – Write logs to stderr with timestamps.134- `syslog` – Send logs to the local syslog daemon.135- _file path_ – Write (append) logs to file.136137Example:138139```140log syslog /var/log/maddy.log141```142143**Note:** Maddy does not perform log files rotation, this is the job of the144logrotate daemon. Send SIGUSR1 to maddy process to make it reopen log files.145146---147148### debug _boolean_149Default: `no`150151Enable verbose logging for all modules. You don't need that unless you are152reporting a bug.153