From 5a109032927aa0d378b55feec218b80151147077 Mon Sep 17 00:00:00 2001 From: "@norpol" <2230917+norpol@users.noreply.github.com> Date: Tue, 15 Jul 2025 17:20:09 +0100 Subject: [PATCH 1/5] stalwart-mail: 0.12.4 -> 0.13.1 --- pkgs/by-name/st/stalwart-mail/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/st/stalwart-mail/package.nix b/pkgs/by-name/st/stalwart-mail/package.nix index 74392a503eca..efce3a65c4ed 100644 --- a/pkgs/by-name/st/stalwart-mail/package.nix +++ b/pkgs/by-name/st/stalwart-mail/package.nix @@ -20,16 +20,16 @@ rustPlatform.buildRustPackage (finalAttrs: { pname = "stalwart-mail" + (lib.optionalString stalwartEnterprise "-enterprise"); - version = "0.12.4"; + version = "0.13.1"; src = fetchFromGitHub { owner = "stalwartlabs"; repo = "stalwart"; tag = "v${finalAttrs.version}"; - hash = "sha256-MUbWGBbb8+b5cp+M5w27A/cHHkMcoEtkN13++FyBvbM="; + hash = "sha256-6zoI+yvE1Ep5jh9XthDqphm2zBA4UzhfK7VCKRWIH8g="; }; - cargoHash = "sha256-G1c7hh0nScc4Cx7A1UUXv6slA6pP0fC6h00zR71BJIo="; + cargoHash = "sha256-t4BLko8vIVHZ44yeQoAhss3OxOlxJCErHm9h+FGG+28="; nativeBuildInputs = [ pkg-config From 0c5b2b081f40fcffdb4a359e4d8d70230a2bdf70 Mon Sep 17 00:00:00 2001 From: "@norpol" <2230917+norpol@users.noreply.github.com> Date: Tue, 15 Jul 2025 17:20:59 +0100 Subject: [PATCH 2/5] stalwart-mail-webadmin: 0.1.28 -> 0.1.31 --- pkgs/by-name/st/stalwart-mail/webadmin.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/st/stalwart-mail/webadmin.nix b/pkgs/by-name/st/stalwart-mail/webadmin.nix index af550fa5b3b8..881942373b62 100644 --- a/pkgs/by-name/st/stalwart-mail/webadmin.nix +++ b/pkgs/by-name/st/stalwart-mail/webadmin.nix @@ -17,13 +17,13 @@ rustPlatform.buildRustPackage (finalAttrs: { pname = "webadmin"; - version = "0.1.28"; + version = "0.1.31"; src = fetchFromGitHub { owner = "stalwartlabs"; repo = "webadmin"; tag = "v${finalAttrs.version}"; - hash = "sha256-OgZ2qs84zVM2zNmBQSPnb9Uy4mahzNC81vbWM9wmrn4="; + hash = "sha256-4+R7QQT0cbKYe6WzgvzreOFULBnWdNcbPC27f4r+M0g="; }; npmDeps = fetchNpmDeps { @@ -31,7 +31,7 @@ rustPlatform.buildRustPackage (finalAttrs: { hash = "sha256-na1HEueX8w7kuDp8LEtJ0nD1Yv39cyk6sEMpS1zix2s="; }; - cargoHash = "sha256-rcgeSdCGIRvpz2xZPw0I753+D3zm9AYbtuUdMSp2I94="; + cargoHash = "sha256-Q05+wH9+NfkfmEDJFLuWVQ7wuDeEu9h1XmOMN6SYdyU="; postPatch = '' # Using local tailwindcss for compilation From 124c3f4850e97a03db39bdf61331eea150ea0676 Mon Sep 17 00:00:00 2001 From: "@norpol" <2230917+norpol@users.noreply.github.com> Date: Tue, 15 Jul 2025 17:33:12 +0100 Subject: [PATCH 3/5] stalwart-mail: add v0.13.x breaking change notice --- doc/release-notes/rl-2511.section.md | 2 ++ nixos/modules/services/mail/stalwart-mail.nix | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/doc/release-notes/rl-2511.section.md b/doc/release-notes/rl-2511.section.md index c7cfe224b1a5..26a4ff2e5f0f 100644 --- a/doc/release-notes/rl-2511.section.md +++ b/doc/release-notes/rl-2511.section.md @@ -33,6 +33,8 @@ - `conftest` since `0.60.0` has moved to use rego `v1` as default. To continue using `v0` use `--rego-version v0`. For more information about upgrading to Rego v1 syntax, see the [upstream docs](https://www.openpolicyagent.org/docs/latest/v0-upgrade/). +- `stalwart-mail` since `0.13.0` "introduces a significant redesign of the MTA’s delivery and queueing subsystem". See [the upgrading announcement for the `0.13.0` release](https://github.com/stalwartlabs/stalwart/blob/89b561b5ca1c5a11f2a768b4a2cfef0f473b7a01/UPGRADING.md#upgrading-from-v012x-and-v011x-to-v013x). + - The `archipelago-minecraft` package was removed, as upstream no longer provides support for the Minecraft APWorld. - `tooling-language-server` has been renamed to `deputy` (both the package and binary), following the rename of the upstream project. diff --git a/nixos/modules/services/mail/stalwart-mail.nix b/nixos/modules/services/mail/stalwart-mail.nix index 9975bcc56672..d9d6e119d9f3 100644 --- a/nixos/modules/services/mail/stalwart-mail.nix +++ b/nixos/modules/services/mail/stalwart-mail.nix @@ -71,6 +71,23 @@ in }; config = lib.mkIf cfg.enable { + assertions = [ + { + assertion = + !( + (lib.hasAttrByPath [ "settings" "queue" ] cfg) + && (builtins.any (lib.hasAttrByPath [ + "value" + "next-hop" + ]) (lib.attrsToList cfg.settings.queue)) + ); + message = '' + Stalwart deprecated `next-hop` in favor of "virtual queues" `queue.strategy.route` \ + with v0.13.0 see [Outbound Strategy](https://stalw.art/docs/mta/outbound/strategy/#configuration) \ + and [release announcement](https://github.com/stalwartlabs/stalwart/blob/main/UPGRADING.md#upgrading-from-v012x-and-v011x-to-v013x). + ''; + } + ]; # Default config: all local services.stalwart-mail.settings = { From b1247d635a5b1fab02e90c5d8c824c7f72157f17 Mon Sep 17 00:00:00 2001 From: "@norpol" <2230917+norpol@users.noreply.github.com> Date: Tue, 15 Jul 2025 17:58:45 +0100 Subject: [PATCH 4/5] stalwart-mail: 0.12.4 -> 0.13.1 migrate tests --- nixos/tests/stalwart/stalwart-mail-config.nix | 2 +- pkgs/by-name/st/stalwart-mail/package.nix | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nixos/tests/stalwart/stalwart-mail-config.nix b/nixos/tests/stalwart/stalwart-mail-config.nix index 800090ab5949..cb2989033763 100644 --- a/nixos/tests/stalwart/stalwart-mail-config.nix +++ b/nixos/tests/stalwart/stalwart-mail-config.nix @@ -50,7 +50,7 @@ in storage.lookup = "rocksdb"; session.rcpt.directory = "'in-memory'"; - queue.outbound.next-hop = "'local'"; + queue.strategy.route = "'local'"; store."rocksdb" = { type = "rocksdb"; diff --git a/pkgs/by-name/st/stalwart-mail/package.nix b/pkgs/by-name/st/stalwart-mail/package.nix index efce3a65c4ed..d91548954927 100644 --- a/pkgs/by-name/st/stalwart-mail/package.nix +++ b/pkgs/by-name/st/stalwart-mail/package.nix @@ -113,6 +113,9 @@ rustPlatform.buildRustPackage (finalAttrs: { # left: [1, 2, 2] # right: [1, 2, 3] "--skip=smtp::queue::retry::queue_retry" + # thread 'smtp::queue::virtualq::virtual_queue' panicked at /build/source/crates/store/src/dispatch/store.rs:548:14: + # called `Result::unwrap()` on an `Err` value: Error(Event { inner: Store(MysqlError), keys: [(Reason, String("Input/output error: Input/output error: Connection refused (os error 111)")), (CausedBy, String("crates/store/src/dispatch/store.rs:301"))] }) + "--skip=smtp::queue::virtualq::virtual_queue" # Missing store type. Try running `STORE= cargo test`: NotPresent "--skip=store::store_tests" # Missing store type. Try running `STORE= cargo test`: NotPresent From bf2c573a869f0c4fb2a0aa7587a1b2b44a47a80d Mon Sep 17 00:00:00 2001 From: "@norpol" <2230917+norpol@users.noreply.github.com> Date: Sat, 26 Jul 2025 23:50:05 +0100 Subject: [PATCH 5/5] stalwart-mail: chore DRY code a bit --- pkgs/by-name/st/stalwart-mail/package.nix | 68 +++++++++++------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/pkgs/by-name/st/stalwart-mail/package.nix b/pkgs/by-name/st/stalwart-mail/package.nix index d91548954927..f22a683eefc3 100644 --- a/pkgs/by-name/st/stalwart-mail/package.nix +++ b/pkgs/by-name/st/stalwart-mail/package.nix @@ -75,86 +75,86 @@ rustPlatform.buildRustPackage (finalAttrs: { --replace "__PATH__" "$out" ''; - checkFlags = [ + checkFlags = lib.forEach [ # Require running mysql, postgresql daemon - "--skip=directory::imap::imap_directory" - "--skip=directory::internal::internal_directory" - "--skip=directory::ldap::ldap_directory" - "--skip=directory::sql::sql_directory" - "--skip=directory::oidc::oidc_directory" - "--skip=store::blob::blob_tests" - "--skip=store::lookup::lookup_tests" - "--skip=smtp::lookup::sql::lookup_sql" + "directory::imap::imap_directory" + "directory::internal::internal_directory" + "directory::ldap::ldap_directory" + "directory::sql::sql_directory" + "directory::oidc::oidc_directory" + "store::blob::blob_tests" + "store::lookup::lookup_tests" + "smtp::lookup::sql::lookup_sql" # thread 'directory::smtp::lmtp_directory' panicked at tests/src/store/mod.rs:122:44: # called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" } - "--skip=directory::smtp::lmtp_directory" + "directory::smtp::lmtp_directory" # thread 'imap::imap_tests' panicked at tests/src/imap/mod.rs:436:14: # Missing store type. Try running `STORE= cargo test`: NotPresent - "--skip=imap::imap_tests" + "imap::imap_tests" # thread 'jmap::jmap_tests' panicked at tests/src/jmap/mod.rs:303:14: # Missing store type. Try running `STORE= cargo test`: NotPresent - "--skip=jmap::jmap_tests" + "jmap::jmap_tests" # Failed to read system DNS config: io error: No such file or directory (os error 2) - "--skip=smtp::inbound::data::data" + "smtp::inbound::data::data" # Expected "X-My-Header: true" but got Received: from foobar.net (unknown [10.0.0.123]) - "--skip=smtp::inbound::scripts::sieve_scripts" + "smtp::inbound::scripts::sieve_scripts" # thread 'smtp::outbound::lmtp::lmtp_delivery' panicked at tests/src/smtp/session.rs:313:13: # Expected " (failed to lookup" but got From: "Mail Delivery Subsystem" - "--skip=smtp::outbound::lmtp::lmtp_delivery" + "smtp::outbound::lmtp::lmtp_delivery" # thread 'smtp::outbound::extensions::extensions' panicked at tests/src/smtp/inbound/mod.rs:45:23: # No queue event received. - "--skip=smtp::outbound::extensions::extensions" + "smtp::outbound::extensions::extensions" # panicked at tests/src/smtp/outbound/smtp.rs:173:5: - "--skip=smtp::outbound::smtp::smtp_delivery" + "smtp::outbound::smtp::smtp_delivery" # panicked at tests/src/smtp/outbound/lmtp.rs - "--skip=smtp::outbound::lmtp::lmtp_delivery" + "smtp::outbound::lmtp::lmtp_delivery" # thread 'smtp::queue::retry::queue_retry' panicked at tests/src/smtp/queue/retry.rs:119:5: # assertion `left == right` failed # left: [1, 2, 2] # right: [1, 2, 3] - "--skip=smtp::queue::retry::queue_retry" + "smtp::queue::retry::queue_retry" # thread 'smtp::queue::virtualq::virtual_queue' panicked at /build/source/crates/store/src/dispatch/store.rs:548:14: # called `Result::unwrap()` on an `Err` value: Error(Event { inner: Store(MysqlError), keys: [(Reason, String("Input/output error: Input/output error: Connection refused (os error 111)")), (CausedBy, String("crates/store/src/dispatch/store.rs:301"))] }) - "--skip=smtp::queue::virtualq::virtual_queue" + "smtp::queue::virtualq::virtual_queue" # Missing store type. Try running `STORE= cargo test`: NotPresent - "--skip=store::store_tests" + "store::store_tests" # Missing store type. Try running `STORE= cargo test`: NotPresent - "--skip=cluster::cluster_tests" + "cluster::cluster_tests" # Missing store type. Try running `STORE= cargo test`: NotPresent - "--skip=webdav::webdav_tests" + "webdav::webdav_tests" # thread 'config::parser::tests::toml_parse' panicked at crates/utils/src/config/parser.rs:463:58: # called `Result::unwrap()` on an `Err` value: "Expected ['\\n'] but found '!' in value at line 70." - "--skip=config::parser::tests::toml_parse" + "config::parser::tests::toml_parse" # error[E0432]: unresolved import `r2d2_sqlite` # use of undeclared crate or module `r2d2_sqlite` - "--skip=backend::sqlite::pool::SqliteConnectionManager::with_init" + "backend::sqlite::pool::SqliteConnectionManager::with_init" # thread 'smtp::reporting::analyze::report_analyze' panicked at tests/src/smtp/reporting/analyze.rs:88:5: # assertion `left == right` failed # left: 0 # right: 12 - "--skip=smtp::reporting::analyze::report_analyze" + "smtp::reporting::analyze::report_analyze" # thread 'smtp::inbound::dmarc::dmarc' panicked at tests/src/smtp/inbound/mod.rs:59:26: # Expected empty queue but got Reload - "--skip=smtp::inbound::dmarc::dmarc" + "smtp::inbound::dmarc::dmarc" # thread 'smtp::queue::concurrent::concurrent_queue' panicked at tests/src/smtp/inbound/mod.rs:65:9: # assertion `left == right` failed - "--skip=smtp::queue::concurrent::concurrent_queue" + "smtp::queue::concurrent::concurrent_queue" # Failed to read system DNS config: io error: No such file or directory (os error 2) - "--skip=smtp::inbound::auth::auth" + "smtp::inbound::auth::auth" # Failed to read system DNS config: io error: No such file or directory (os error 2) - "--skip=smtp::inbound::antispam::antispam" + "smtp::inbound::antispam::antispam" # Failed to read system DNS config: io error: No such file or directory (os error 2) - "--skip=smtp::inbound::vrfy::vrfy_expn" + "smtp::inbound::vrfy::vrfy_expn" # thread 'smtp::management::queue::manage_queue' panicked at tests/src/smtp/inbound/mod.rs:45:23: # No queue event received. # NOTE: Test unreliable on high load systems - "--skip=smtp::management::queue::manage_queue" + "smtp::management::queue::manage_queue" # thread 'responses::tests::parse_responses' panicked at crates/dav-proto/src/responses/mod.rs:671:17: # assertion `left == right` failed: failed for 008.xml # left: ElementEnd # right: Bytes([...]) - "--skip=responses::tests::parse_responses" - ]; + "responses::tests::parse_responses" + ] (test: "--skip=${test}"); doCheck = !(stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);