From 9bcfef6ab035e179622139c1820bc43e93df6f5c Mon Sep 17 00:00:00 2001 From: niten Date: Fri, 13 Oct 2023 12:57:58 -0700 Subject: [PATCH] Add admin ports & service --- dovecot.nix | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/dovecot.nix b/dovecot.nix index 71bc134..80293b8 100644 --- a/dovecot.nix +++ b/dovecot.nix @@ -43,6 +43,16 @@ in { description = "Port on which to serve metrics data."; default = 5034; }; + admin = mkOption { + type = port; + description = "Port on which to listen for admin requests."; + default = 5925; + }; + http-admin = mkOption { + type = nullOr port; + description = "Port on which to listen for admin HTTP API requests."; + default = null; + }; }; mail-user = mkOption { @@ -386,7 +396,7 @@ in { mail_plugins = $mail_plugins sieve fts fts_solr } - plugin { + plugins { fts = solr fts_solr = url=http://${cfg.solr.host}:${ toString cfg.solr.port @@ -445,6 +455,23 @@ in { inbox = yes } + service doveadm { + unix_listener doveadm-server { + user = ${config.services.dovecot2.user} + group = ${config.services.dovecot2.group} + } + inet_listener { + port = ${toString cfg.ports.admin} + } + ${ + optionalString (!isNull cfg.ports.http-admin) '' + inet_listener http { + port = ${toString cfg.ports.http-admin} + } + '' + } + } + plugin { sieve_plugins = sieve_imapsieve sieve_extprograms sieve = file:${cfg.state-directory}/sieves/%u/scripts;active=${cfg.state-directory}/sieves/%u/active.sieve