From c24757321ef4ce2d1a775a095dce3bdea362ca43 Mon Sep 17 00:00:00 2001 From: Gonne Date: Tue, 4 Mar 2025 07:39:36 +0100 Subject: [PATCH] Hack around sieve execution for multiple recipients. --- nixos/modules/mail.nix | 4 ++++ nixos/modules/mailman.nix | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/nixos/modules/mail.nix b/nixos/modules/mail.nix index 24d144c..88bc59e 100644 --- a/nixos/modules/mail.nix +++ b/nixos/modules/mail.nix @@ -184,6 +184,10 @@ in { } {"else" = false;} ]; + # The sieve script only handles the last RCPT TO command (https://stalw.art/docs/sieve/variables). + # Since we want it to run for every recipient, we need to accept them one at a time. :-( + # This setting throws a temporary error for the second RCPT TO command after which the HRZ retries in a new connection. + max-recipients = 1; }; data.script = "'redirects'"; }; diff --git a/nixos/modules/mailman.nix b/nixos/modules/mailman.nix index 1c8eaba..b090ef0 100644 --- a/nixos/modules/mailman.nix +++ b/nixos/modules/mailman.nix @@ -43,7 +43,11 @@ in { webHosts = [cfg.hostName]; serve.enable = true; # # Don't include confirmation tokens in reply addresses, because we would need to send them to HRZ otherwise. - settings.mta.verp_confirmations = "no"; + settings.mta = { + verp_confirmations = "no"; + max_recipients = "1"; # We can only send to one recipient at a time due to how forwarding currently works. See also the mail module. + max_sessions_per_connection = "1"; + }; }; };