Add option for dovecot API port

This commit is contained in:
niten 2023-10-13 13:29:15 -07:00
parent 3016e938ac
commit 0d906369ca
1 changed files with 7 additions and 1 deletions

View File

@ -191,6 +191,12 @@ in {
description =
"Directory containing SSL certificates for IMAP hostname.";
};
api-port = mkOption {
type = nullOr port;
description = "Port to open for Dovecot HTTP admin API.";
default = null;
};
};
};
@ -251,7 +257,7 @@ in {
dovecotAdminConfig = {
source-file = pkgs.writeText "dovecot-admin.conf" (concatStringsSep "\n"
[ "doveadm_password = ${readFile dovecotAdminPasswd}" ]
++ (optional (cfg.ports.dovecot-http-api != null)
++ (optional (cfg.imap.api-port != null)
"doveadm_api_key = ${readFile dovecotApiKey}"));
target-file = "/run/dovecot-secrets/admin.conf";
};