From cf431ef62bd8d4b90819e2267b35f7255fd8e0cd Mon Sep 17 00:00:00 2001 From: Katalin Rebhan Date: Mon, 13 Apr 2026 14:17:07 +0200 Subject: [PATCH] nixos/dovecot: hotfix config defaults for sieve-less setups The sieve_script_bin_path setting can only be set when the plugin is loaded, so on sieve-less setups dovecot will refuse to start since sieve_script_bin_path is an invalid setting. Don't set it there. --- nixos/modules/services/mail/dovecot.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/mail/dovecot.nix b/nixos/modules/services/mail/dovecot.nix index a9dd9531fadf..7f7cc10d15d5 100644 --- a/nixos/modules/services/mail/dovecot.nix +++ b/nixos/modules/services/mail/dovecot.nix @@ -163,6 +163,11 @@ let ); isPre24 = versionOlder cfg.package.version "2.4"; + + # HACK: We can not auto-add the default for sieve_script_bin_path unless we have the pigeonhole plugin loaded. Solve this in a better way in the future + hasPigeonhole = builtins.any ( + pkg: pkg.pname or null == "dovecot-pigeonhole" + ) config.environment.systemPackages; in { imports = [ @@ -579,9 +584,9 @@ in # 2.4-only options sieve_script_bin_path = mkOption { - default = if isPre24 then null else "/tmp/dovecot-%{user|username|lower}"; + default = if isPre24 || !hasPigeonhole then null else "/tmp/dovecot-%{user|username|lower}"; defaultText = literalExpression '' - if isPre24 + if isPre24 || !hasPigeonhole then null else "/tmp/dovecot-%{user|username|lower}" '';