From 400aecc29b905b717b4a608bd37406451b74de99 Mon Sep 17 00:00:00 2001 From: Katalin Rebhan Date: Tue, 7 Apr 2026 15:12:17 +0200 Subject: [PATCH] nixos/dovecot: remove defaults for PAM and mail driver/path --- nixos/modules/services/mail/dovecot.nix | 59 +++---------------------- nixos/tests/dovecot.nix | 3 ++ 2 files changed, 8 insertions(+), 54 deletions(-) diff --git a/nixos/modules/services/mail/dovecot.nix b/nixos/modules/services/mail/dovecot.nix index 9de696b3045b..a9dd9531fadf 100644 --- a/nixos/modules/services/mail/dovecot.nix +++ b/nixos/modules/services/mail/dovecot.nix @@ -520,23 +520,6 @@ in # 2.3-only options - mail_location = mkOption { - default = if isPre24 then "maildir:/var/spool/mail/%u" else null; - defaultText = literalExpression '' - if isPre24 - then "maildir:/var/spool/mail/%u" - else null - ''; - description = '' - This setting indicates the location for users’ mailboxes. - - This option is exclusive to Dovecot 2.3. - - See . - ''; - type = nullOr str; - }; - plugin = mkOption { default = null; description = "Plugin settings. This option is exclusive to Dovecot 2.3."; @@ -595,40 +578,6 @@ in # 2.4-only options - mail_driver = mkOption { - default = if isPre24 then null else "maildir"; - defaultText = literalExpression '' - if isPre24 - then null - else "maildir" - ''; - description = '' - One of the mailbox formats described at [Mailbox Formats](https://doc.dovecot.org/latest/core/config/mailbox_formats/overview.html#mailbox-formats). - - This option is exclusive to Dovecot 2.4. - - See . - ''; - type = nullOr str; - }; - - mail_path = mkOption { - default = if isPre24 then null else "/var/spool/mail/%{user}"; - defaultText = literalExpression '' - if isPre24 - then null - else "/var/spool/mail/%{user}" - ''; - description = '' - Path to a directory where the mail is stored. - - This option is exclusive to Dovecot 2.4. - - See . - ''; - type = nullOr str; - }; - sieve_script_bin_path = mkOption { default = if isPre24 then null else "/tmp/dovecot-%{user|username|lower}"; defaultText = literalExpression '' @@ -703,7 +652,11 @@ in submission = true; lmtp = true; }; + mail_driver = "maildir"; + mail_home = "/var/vmail/%{user | domain}/%{user | username}"; + mail_path = "~/mail"; + "namespace inbox" = { inbox = true; separator = "/"; @@ -808,9 +761,7 @@ in default = true; }; - enablePAM = mkEnableOption "creating a own Dovecot PAM service and configure PAM user logins" // { - default = true; - }; + enablePAM = mkEnableOption "creating a own Dovecot PAM service and configure PAM user logins"; showPAMFailure = mkEnableOption "showing the PAM failure message on authentication error (useful for OTPW)"; diff --git a/nixos/tests/dovecot.nix b/nixos/tests/dovecot.nix index e85512602f20..ddc8b6632acc 100644 --- a/nixos/tests/dovecot.nix +++ b/nixos/tests/dovecot.nix @@ -11,9 +11,12 @@ services.postfix.enable = true; services.dovecot2 = { enable = true; + enablePAM = true; settings = { dovecot_config_version = dovecot.version; dovecot_storage_version = dovecot.version; + mail_driver = "maildir"; + mail_path = "${config.services.postfix.settings.main.mail_spool_directory}/%{user}"; protocols = [ "imap" "pop3"