nixos/dovecot2: add autoexpunge setting

To automatically purge old email.

See also https://wiki.dovecot.org/MailboxSettings
This commit is contained in:
Maximilian Bosch 2020-06-03 23:54:36 +02:00
parent 3f61850c41
commit fc179ef8a6
No known key found for this signature in database
GPG Key ID: 091DBF4D1FC46B8E

View File

@ -125,6 +125,8 @@ let
mailboxConfig = mailbox: '' mailboxConfig = mailbox: ''
mailbox "${mailbox.name}" { mailbox "${mailbox.name}" {
auto = ${toString mailbox.auto} auto = ${toString mailbox.auto}
'' + optionalString (mailbox.autoexpunge != null) ''
autoexpunge = ${mailbox.autoexpunge}
'' + optionalString (mailbox.specialUse != null) '' '' + optionalString (mailbox.specialUse != null) ''
special_use = \${toString mailbox.specialUse} special_use = \${toString mailbox.specialUse}
'' + "}"; '' + "}";
@ -148,6 +150,15 @@ let
example = "Junk"; example = "Junk";
description = "Null if no special use flag is set. Other than that every use flag mentioned in the RFC is valid."; description = "Null if no special use flag is set. Other than that every use flag mentioned in the RFC is valid.";
}; };
autoexpunge = mkOption {
type = types.nullOr types.str;
default = null;
example = "60d";
description = ''
To automatically remove all email from the mailbox which is older than the
specified time.
'';
};
}; };
}; };
in in