nixcfg/systems/x86_64-linux/mx/rspamd.nix
Harald Hoyer ff726a73c9 feat: refactor domain whitelist in rspamd.nix
This update introduces a more efficient way for managing whitelisted domains in rspamd.nix. Instead of repeating the list of domains across multiple configurations, the domains are now defined only once in a dedicated variable. This improves the maintainability and readability of the code.
2024-06-22 18:10:12 +02:00

43 lines
1 KiB
Nix

{ pkgs, lib, ... }:
let
domains = ''
epicgames.com
dmail.ai
twitter.com
x.com
gmx.de
chess.com
'';
in
{
services.rspamd.workers.controller.bindSockets = [{
socket = "/run/rspamd/worker-controller.sock";
mode = "0660";
}];
services.rspamd.locals = {
"settings.conf".text = ''
bogenschiessen {
from = "bogensport-jugend@gmx.de";
apply {
actions {
reject = 100.0;
greylist = null; # Disable greylisting (from 1.8.1)
"add header" = 100.0; # Please note the space, NOT an underscore
}
}
}
'';
"maps.d/spf_whitelist.inc.local".text = domains;
"maps.d/spf_dkim_whitelist.inc.local".text = domains;
"maps.d/dmarc_whitelist.inc.local".text = domains;
"greylist-whitelist-domains.inc".text = domains;
};
services.rspamd.extraConfig = ''
actions {
reject = null;
greylist = 4; # Apply greylisting when reaching this score
add_header = 4; # Add header when reaching this score
}
'';
}