nixos/dovecot: remove defaults for PAM and mail driver/path

This commit is contained in:
Katalin Rebhan 2026-04-07 15:12:17 +02:00
commit 400aecc29b
No known key found for this signature in database
GPG key ID: EFE0B72BBC351517
2 changed files with 8 additions and 54 deletions

View file

@ -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 <https://doc.dovecot.org/2.3/settings/core/#core_setting-mail_location>.
'';
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 <https://doc.dovecot.org/latest/core/config/mail_location.html#mail_driver>.
'';
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 <https://doc.dovecot.org/latest/core/config/mail_location.html#mail_path>.
'';
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)";

View file

@ -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"