rspamd: whitelist tu networks

This commit is contained in:
Rouven Seifert 2023-11-01 22:45:21 +01:00
parent c038ea7ed9
commit a9d4543da7
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09

View file

@ -292,38 +292,58 @@ in
} }
''; '';
"multimap.conf".text = '' "multimap.conf".text =
WHITELIST_SENDER_DOMAIN { let
type = "from"; local_ips = pkgs.writeText "localhost.map" ''
filter = "email:domain"; ::1
map = "/var/lib/rspamd/whitelist.sender.domain.map"; 127.0.0.1
action = "accept"; '';
} tud_ips = pkgs.writeText "tud.map" ''
WHITELIST_SENDER_EMAIL { 141.30.0.0/16
type = "from"; 141.76.0.0/16
map = "/var/lib/rspamd/whitelist.sender.email.map"; '';
action = "accept"; in
} ''
BLACKLIST_SENDER_DOMAIN { WHITELIST_SENDER_DOMAIN {
type = "from"; type = "from";
filter = "email:domain"; filter = "email:domain";
map = "/var/lib/rspamd/blacklist.sender.domain.map"; map = "/var/lib/rspamd/whitelist.sender.domain.map";
action = "reject"; action = "accept";
} }
BLACKLIST_SENDER_EMAIL { WHITELIST_SENDER_EMAIL {
type = "from"; type = "from";
map = "/var/lib/rspamd/blacklist.sender.email.map"; map = "/var/lib/rspamd/whitelist.sender.email.map";
action = "reject"; action = "accept";
} }
BLACKLIST_SUBJECT_KEYWORDS { BLACKLIST_SENDER_DOMAIN {
type = "header"; type = "from";
header = "Subject" filter = "email:domain";
map = "/var/lib/rspamd/blacklist.keyword.subject.map"; map = "/var/lib/rspamd/blacklist.sender.domain.map";
action = "reject"; action = "reject";
regexp = true; }
} BLACKLIST_SENDER_EMAIL {
type = "from";
map = "/var/lib/rspamd/blacklist.sender.email.map";
action = "reject";
}
BLACKLIST_SUBJECT_KEYWORDS {
type = "header";
header = "Subject"
map = "/var/lib/rspamd/blacklist.keyword.subject.map";
action = "reject";
regexp = true;
}
RECEIVED_LOCALHOST {
type = "ip";
action = "accept";
map = ${local_ips};
}
RECEIVED_TU_NETWORKS {
type = "ip";
map = ${tud_ips};
}
''; '';
}; };
}; };
redis = { redis = {