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} }