From f4c5060ecc3367c71265fa5f3410e51a4b4a260e Mon Sep 17 00:00:00 2001 From: euxane Date: Wed, 15 May 2024 00:42:08 +0200 Subject: [PATCH 1/3] nixos/stalwart-mail: set default lookup storage This configuration key is now required. The shared default DB is a good default. --- nixos/modules/services/mail/stalwart-mail.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/services/mail/stalwart-mail.nix b/nixos/modules/services/mail/stalwart-mail.nix index 9cc919fd117d..08b07b885b69 100644 --- a/nixos/modules/services/mail/stalwart-mail.nix +++ b/nixos/modules/services/mail/stalwart-mail.nix @@ -38,6 +38,7 @@ in { store.blob.path = mkDefault "${dataDir}/data/blobs"; storage.data = mkDefault "db"; storage.fts = mkDefault "db"; + storage.lookup = mkDefault "db"; storage.blob = mkDefault "blob"; resolver.type = mkDefault "system"; resolver.public-suffix = mkDefault ["https://publicsuffix.org/list/public_suffix_list.dat"]; From aa107a60c498df364942e4ff7759082eec821224 Mon Sep 17 00:00:00 2001 From: euxane Date: Wed, 15 May 2024 00:45:21 +0200 Subject: [PATCH 2/3] nixos/stalwart-mail: fix vm test for v0.6.0 This migrates the syntax for a few configuration values, which now need to be quoted strings for user values. This also disables the use of a public resolver, which is not accessible in the sandbox. --- nixos/tests/stalwart-mail.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nixos/tests/stalwart-mail.nix b/nixos/tests/stalwart-mail.nix index 634c0e2e3926..581090cd70f4 100644 --- a/nixos/tests/stalwart-mail.nix +++ b/nixos/tests/stalwart-mail.nix @@ -40,12 +40,14 @@ in import ./make-test-python.nix ({ lib, ... }: { }; }; - session.auth.mechanisms = [ "PLAIN" ]; - session.auth.directory = "in-memory"; - storage.directory = "in-memory"; # shared with imap + resolver.public-suffix = [ ]; # do not fetch from web in sandbox - session.rcpt.directory = "in-memory"; - queue.outbound.next-hop = [ "local" ]; + session.auth.mechanisms = "[plain]"; + session.auth.directory = "'in-memory'"; + storage.directory = "in-memory"; + + session.rcpt.directory = "'in-memory'"; + queue.outbound.next-hop = "'local'"; directory."in-memory" = { type = "memory"; From e995bb433e7c6f2bbc023d4b2ed8a5f2af662422 Mon Sep 17 00:00:00 2001 From: euxane Date: Wed, 15 May 2024 01:15:12 +0200 Subject: [PATCH 3/3] stalwart-mail: add nixos vm test passthru --- pkgs/servers/mail/stalwart/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/mail/stalwart/default.nix b/pkgs/servers/mail/stalwart/default.nix index 44b2251ce0c7..be0d9109fa75 100644 --- a/pkgs/servers/mail/stalwart/default.nix +++ b/pkgs/servers/mail/stalwart/default.nix @@ -10,6 +10,7 @@ , stdenv , darwin , nix-update-script +, nixosTests , rocksdb_8_3 }: @@ -60,7 +61,10 @@ rustPlatform.buildRustPackage { # Tests require reading to /etc/resolv.conf doCheck = false; - passthru.update-script = nix-update-script { }; + passthru = { + update-script = nix-update-script { }; + stalwart-mail = nixosTests.stalwart-mail; + }; meta = with lib; { description = "Secure & Modern All-in-One Mail Server (IMAP, JMAP, SMTP)";