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.
This commit is contained in:
parent
7b06c9446c
commit
ff726a73c9
|
@ -1,4 +1,14 @@
|
||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
domains = ''
|
||||||
|
epicgames.com
|
||||||
|
dmail.ai
|
||||||
|
twitter.com
|
||||||
|
x.com
|
||||||
|
gmx.de
|
||||||
|
chess.com
|
||||||
|
'';
|
||||||
|
in
|
||||||
{
|
{
|
||||||
services.rspamd.workers.controller.bindSockets = [{
|
services.rspamd.workers.controller.bindSockets = [{
|
||||||
socket = "/run/rspamd/worker-controller.sock";
|
socket = "/run/rspamd/worker-controller.sock";
|
||||||
|
@ -17,34 +27,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
"maps.d/spf_whitelist.inc.local".text = ''
|
"maps.d/spf_whitelist.inc.local".text = domains;
|
||||||
epicgames.com
|
"maps.d/spf_dkim_whitelist.inc.local".text = domains;
|
||||||
dmail.ai
|
"maps.d/dmarc_whitelist.inc.local".text = domains;
|
||||||
twitter.com
|
"greylist-whitelist-domains.inc".text = domains;
|
||||||
x.com
|
|
||||||
gmx.de
|
|
||||||
'';
|
|
||||||
"maps.d/spf_dkim_whitelist.inc.local".text = ''
|
|
||||||
epicgames.com
|
|
||||||
dmail.ai
|
|
||||||
twitter.com
|
|
||||||
x.com
|
|
||||||
gmx.de
|
|
||||||
'';
|
|
||||||
"maps.d/dmarc_whitelist.inc.local".text = ''
|
|
||||||
epicgames.com
|
|
||||||
dmail.ai
|
|
||||||
twitter.com
|
|
||||||
x.com
|
|
||||||
gmx.de
|
|
||||||
'';
|
|
||||||
"greylist-whitelist-domains.inc".text = ''
|
|
||||||
dmail.ai
|
|
||||||
epicgames.com
|
|
||||||
twitter.com
|
|
||||||
x.com
|
|
||||||
gmx.de
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
services.rspamd.extraConfig = ''
|
services.rspamd.extraConfig = ''
|
||||||
actions {
|
actions {
|
||||||
|
|
Loading…
Reference in a new issue