stalwart-mail: Fix spam-filter missing from /etc (#422909)

This commit is contained in:
Yt 2025-07-21 21:14:24 -04:00 committed by GitHub
commit 1f9fe92184
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 62 additions and 8 deletions

View File

@ -18286,6 +18286,13 @@
];
matrix = "@normalcea:matrix.org";
};
norpol = {
name = "Syd Lightyear";
email = "norpol+nixpkgs@exaple.org";
matrix = "@phileas:asra.gr";
github = "norpol";
githubId = 98636020;
};
nosewings = {
name = "Nicholas Coltharp";
email = "coltharpnicholas@gmail.com";

View File

@ -107,7 +107,7 @@ in
resolver.public-suffix = lib.mkDefault [
"file://${pkgs.publicsuffix-list}/share/publicsuffix/public_suffix_list.dat"
];
spam-filter.resource = lib.mkDefault "file://${cfg.package}/etc/stalwart/spamfilter.toml";
spam-filter.resource = lib.mkDefault "file://${cfg.package.spam-filter}/spam-filter.toml";
webadmin =
let
hasHttpListener = builtins.any (listener: listener.protocol == "http") (
@ -232,6 +232,7 @@ in
happysalada
euxane
onny
norpol
];
};
}

View File

@ -162,6 +162,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
passthru = {
inherit rocksdb; # make used rocksdb version available (e.g., for backup scripts)
webadmin = callPackage ./webadmin.nix { };
spam-filter = callPackage ./spam-filter.nix { };
updateScript = nix-update-script { };
tests.stalwart-mail = nixosTests.stalwart-mail;
};
@ -187,6 +188,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
onny
oddlama
pandapip1
norpol
];
};
})

View File

@ -0,0 +1,43 @@
{
lib,
fetchFromGitHub,
stdenv,
stalwart-mail,
nix-update-script,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "spam-filter";
version = "2.0.3";
src = fetchFromGitHub {
owner = "stalwartlabs";
repo = "spam-filter";
tag = "v${finalAttrs.version}";
hash = "sha256-NhD/qUiGhgESwR2IOzAHfDATRlgWMcCktlktvVfDONk=";
};
buildPhase = ''
bash ./build.sh
'';
installPhase = ''
mkdir -p $out
cp spam-filter.toml $out/
'';
passthru = {
updateScript = nix-update-script { };
};
meta = {
description = "Secure & modern all-in-one mail server Stalwart (spam-filter module)";
homepage = "https://github.com/stalwartlabs/spam-filter";
changelog = "https://github.com/stalwartlabs/spam-filter/blob/${finalAttrs.src.tag}/CHANGELOG.md";
license = with lib.licenses; [
mit
asl20
];
inherit (stalwart-mail.meta) maintainers;
};
})

View File

@ -1,6 +1,7 @@
{
lib,
rustPlatform,
stalwart-mail,
fetchFromGitHub,
trunk,
tailwindcss_3,
@ -14,20 +15,19 @@
zip,
}:
rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
pname = "webadmin";
version = "0.1.28";
src = fetchFromGitHub {
owner = "stalwartlabs";
repo = "webadmin";
tag = "v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-OgZ2qs84zVM2zNmBQSPnb9Uy4mahzNC81vbWM9wmrn4=";
};
npmDeps = fetchNpmDeps {
inherit src;
name = "${pname}-npm-deps";
name = "${finalAttrs.pname}-npm-deps";
hash = "sha256-na1HEueX8w7kuDp8LEtJ0nD1Yv39cyk6sEMpS1zix2s=";
};
@ -71,8 +71,8 @@ rustPlatform.buildRustPackage rec {
meta = {
description = "Secure & modern all-in-one mail server Stalwart (webadmin module)";
homepage = "https://github.com/stalwartlabs/webadmin";
changelog = "https://github.com/stalwartlabs/webadmin/blob/${src.tag}/CHANGELOG.md";
changelog = "https://github.com/stalwartlabs/webadmin/blob/${finalAttrs.src.tag}/CHANGELOG.md";
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [ onny ];
inherit (stalwart-mail.meta) maintainers;
};
}
})

View File

@ -10741,6 +10741,7 @@ with pkgs;
};
stalwart-mail-webadmin = stalwart-mail.webadmin;
stalwart-mail-spam-filter = stalwart-mail.spam-filter;
stalwart-mail-enterprise = stalwart-mail.override {
stalwartEnterprise = true;