about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2020-06-03 23:54:36 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2020-06-17 01:07:27 +0200
commitfc179ef8a6968a171a51de4b69bbd9b147f4cb7e (patch)
tree88e1cd17b1e36dcaa1708ca8eae9cf293d0db1e8
parent3f61850c410602d1f80f947ab78e38335f1a215d (diff)
downloadnixlib-fc179ef8a6968a171a51de4b69bbd9b147f4cb7e.tar
nixlib-fc179ef8a6968a171a51de4b69bbd9b147f4cb7e.tar.gz
nixlib-fc179ef8a6968a171a51de4b69bbd9b147f4cb7e.tar.bz2
nixlib-fc179ef8a6968a171a51de4b69bbd9b147f4cb7e.tar.lz
nixlib-fc179ef8a6968a171a51de4b69bbd9b147f4cb7e.tar.xz
nixlib-fc179ef8a6968a171a51de4b69bbd9b147f4cb7e.tar.zst
nixlib-fc179ef8a6968a171a51de4b69bbd9b147f4cb7e.zip
nixos/dovecot2: add autoexpunge setting
To automatically purge old email.

See also https://wiki.dovecot.org/MailboxSettings
-rw-r--r--nixos/modules/services/mail/dovecot.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/nixos/modules/services/mail/dovecot.nix b/nixos/modules/services/mail/dovecot.nix
index 9fbf0c19752c..ee797f9c42f1 100644
--- a/nixos/modules/services/mail/dovecot.nix
+++ b/nixos/modules/services/mail/dovecot.nix
@@ -125,6 +125,8 @@ let
   mailboxConfig = mailbox: ''
     mailbox "${mailbox.name}" {
       auto = ${toString mailbox.auto}
+  '' + optionalString (mailbox.autoexpunge != null) ''
+    autoexpunge = ${mailbox.autoexpunge}
   '' + optionalString (mailbox.specialUse != null) ''
     special_use = \${toString mailbox.specialUse}
   '' + "}";
@@ -148,6 +150,15 @@ let
         example = "Junk";
         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