feat: update server to Smol Mail protocol 1.1

This commit is contained in:
randogoth 2026-09-27 09:39:01 +03:00
parent 71ad7e04c0
commit 24fe701ca2
8 changed files with 311 additions and 52 deletions

View file

@ -76,20 +76,38 @@
maxEnvelope = mkOption {
type = types.ints.positive;
default = 1048576;
default = 786432;
description = "Maximum accepted envelope size, in bytes.";
};
quota = mkOption {
type = types.ints.positive;
default = 67108864;
description = "Per-mailbox storage quota, in bytes.";
description = "Per-mailbox main-tier storage quota, in bytes.";
};
requestsQuota = mkOption {
type = types.ints.positive;
default = 2097152;
description = "Per-mailbox requests-tier storage quota, in bytes.";
};
retentionDays = mkOption {
type = types.ints.positive;
default = 30;
description = "Days a message is retained before being purged.";
description = "Days a main-tier message is retained before being purged.";
};
requestsRetentionDays = mkOption {
type = types.ints.positive;
default = 7;
description = "Days a requests-tier message is retained before being purged.";
};
maxTokens = mkOption {
type = types.ints.positive;
default = 1024;
description = "Maximum accept tokens a mailbox may hold.";
};
rateConnections = mkOption {
@ -104,6 +122,12 @@
description = "Max SEND operations per minute, per source IP.";
};
rateTokens = mkOption {
type = types.ints.positive;
default = 30;
description = "Max SEND operations per minute, per accept token.";
};
inviteToken = mkOption {
type = types.nullOr types.str;
default = null;
@ -154,9 +178,13 @@
--port ${toString cfg.port}
--max-envelope ${toString cfg.maxEnvelope}
--quota ${toString cfg.quota}
--requests-quota ${toString cfg.requestsQuota}
--retention-days ${toString cfg.retentionDays}
--requests-retention-days ${toString cfg.requestsRetentionDays}
--max-tokens ${toString cfg.maxTokens}
--rate-connections ${toString cfg.rateConnections}
--rate-sends ${toString cfg.rateSends}
--rate-tokens ${toString cfg.rateTokens}
)
${lib.optionalString (cfg.inviteToken != null)
''args+=(--invite-token ${lib.escapeShellArg cfg.inviteToken})''}