From 6eea6943bc2c0bce4fbb13d22817adfdcea12d5d Mon Sep 17 00:00:00 2001 From: Shawn8901 Date: Sat, 22 Jun 2024 22:04:07 +0200 Subject: [PATCH 1/2] stalwart-mail: include spam-filter config --- pkgs/by-name/st/stalwart-mail/package.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/by-name/st/stalwart-mail/package.nix b/pkgs/by-name/st/stalwart-mail/package.nix index a2594799be07..14df24b62ef8 100644 --- a/pkgs/by-name/st/stalwart-mail/package.nix +++ b/pkgs/by-name/st/stalwart-mail/package.nix @@ -74,6 +74,10 @@ rustPlatform.buildRustPackage { }; postInstall = '' + mkdir -p $out/etc/stalwart + cp resources/config/spamfilter.toml $out/etc/stalwart/spamfilter.toml + cp -r resources/config/spamfilter $out/etc/stalwart/ + mkdir -p $out/lib/systemd/system substitute resources/systemd/stalwart-mail.service $out/lib/systemd/system/stalwart-mail.service \ From ac961ac498c8e1d504dced8c612ca5600a28085c Mon Sep 17 00:00:00 2001 From: Shawn8901 Date: Sat, 22 Jun 2024 22:12:09 +0200 Subject: [PATCH 2/2] nixos/stalwart-mail: set pre-defined spam-filter rules --- nixos/modules/services/mail/stalwart-mail.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nixos/modules/services/mail/stalwart-mail.nix b/nixos/modules/services/mail/stalwart-mail.nix index ed3c5389354c..8ea3c32bea39 100644 --- a/nixos/modules/services/mail/stalwart-mail.nix +++ b/nixos/modules/services/mail/stalwart-mail.nix @@ -62,6 +62,9 @@ in { resolver.public-suffix = lib.mkDefault [ "file://${pkgs.publicsuffix-list}/share/publicsuffix/public_suffix_list.dat" ]; + config.resource = { + spam-filter = lib.mkDefault "file://${cfg.package}/etc/stalwart/spamfilter.toml"; + }; }; # This service stores a potentially large amount of data.