Skip to content

nixos/stalwart-mail: fix incorrect config for webadmin and spam-filter#412054

Merged
happysalada merged 1 commit intoNixOS:masterfrom
diogotcorreia:stalwart-fix-webadmin-config
Jun 1, 2025
Merged

nixos/stalwart-mail: fix incorrect config for webadmin and spam-filter#412054
happysalada merged 1 commit intoNixOS:masterfrom
diogotcorreia:stalwart-fix-webadmin-config

Conversation

@diogotcorreia
Copy link
Member

Stalwart 0.11.0 changed the config.resource.spam-filter and config.resource.webadmin keys to be spam-filter.resource and webadmin.resource respectively. The NixOS has been updated accordingly, but unfortunately it has mistakenly used config.spam-filter.resource and config.webadmin.resource, which are incorrect and do not do anything.

This commit changes the default configuration to use the correct keys.

Note that due to infinite recursion, the optionalAttrs has been replaced with mkIf.

Additionally, some tests were added to catch this regression in the future.

Fixes #411351

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

Stalwart 0.11.0 changed the `config.resource.spam-filter` and
`config.resource.webadmin` keys to be `spam-filter.resource` and
`webadmin.resource` respectively. The NixOS has been updated
accordingly, but unfortunately it has mistakenly used
`config.spam-filter.resource` and `config.webadmin.resource`, which are
incorrect and do not do anything.

This commit changes the default configuration to use the correct keys.

Note that due to infinite recursion, the `optionalAttrs` has been
replaced with `mkIf`.

Additionally, some tests were added to catch this regression in the
future.

Fixes NixOS#411351
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels May 29, 2025
@diogotcorreia diogotcorreia requested a review from zimward May 29, 2025 11:19
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels May 29, 2025
diogotcorreia added a commit to diogotcorreia/dotfiles that referenced this pull request May 29, 2025
Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that it fixes the issue on my server.

Copy link
Contributor

@zimward zimward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Shawn8901
Copy link
Contributor

IMHO we should back port this to unbreak our stable users

@onny onny requested review from happysalada and onny June 1, 2025 06:50
@happysalada happysalada merged commit bd63862 into NixOS:master Jun 1, 2025
18 of 19 checks passed
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Jun 1, 2025

Backport failed for release-24.11, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-24.11
git worktree add -d .worktree/backport-412054-to-release-24.11 origin/release-24.11
cd .worktree/backport-412054-to-release-24.11
git switch --create backport-412054-to-release-24.11
git cherry-pick -x b7ab1fa981ffbc2adbc63de403c2b49368ca8c6b

@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Jun 1, 2025

Backport failed for release-25.05, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-25.05
git worktree add -d .worktree/backport-412054-to-release-25.05 origin/release-25.05
cd .worktree/backport-412054-to-release-25.05
git switch --create backport-412054-to-release-25.05
git cherry-pick -x b7ab1fa981ffbc2adbc63de403c2b49368ca8c6b

@diogotcorreia
Copy link
Member Author

I'll backport manually

@diogotcorreia
Copy link
Member Author

Skipped the 24.11 backport because it is not affected by this bug: it still has stalwart 0.10.7 while the bug was introduced in the 0.11.0 update.

@diogotcorreia diogotcorreia added the 8.has: port to stable This PR already has a backport to the stable release. label Jun 2, 2025
diogotcorreia added a commit to diogotcorreia/nixpkgs that referenced this pull request Sep 2, 2025
Since NixOS#411265 and NixOS#412054 were merged at the same time, the test ended
up not waiting for port 80 after the service restart.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nixos/stalwart-mail: webadmin improperly configured

5 participants