From dc0569066e79ae96184541da6fa28f35a33fbf7b Mon Sep 17 00:00:00 2001 From: Ryan Trinkle Date: Mon, 8 Apr 2024 14:20:46 +0000 Subject: [PATCH] Make imap memory limit configurable --- default.nix | 8 ++++++++ mail-server/dovecot.nix | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/default.nix b/default.nix index dfcb36e..8eb9c5b 100644 --- a/default.nix +++ b/default.nix @@ -712,6 +712,14 @@ in ''; }; + imapMemoryLimit = mkOption { + type = types.int; + default = 256; + description = '' + The memory limit for the imap service, in megabytes. + ''; + }; + enableImapSsl = mkOption { type = types.bool; default = true; diff --git a/mail-server/dovecot.nix b/mail-server/dovecot.nix index e4829d1..6e39923 100644 --- a/mail-server/dovecot.nix +++ b/mail-server/dovecot.nix @@ -276,6 +276,10 @@ in mail_plugins = $mail_plugins imap_sieve } + service imap { + vsz_limit = ${builtins.toString cfg.imapMemoryLimit} MB + } + protocol pop3 { mail_max_userip_connections = ${toString cfg.maxConnectionsPerUser} }