1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2024-12-23 02:04:46 +02:00

[Web] fix invalid rspamd map check

This commit is contained in:
FreddleSpl0it 2024-04-04 09:30:30 +02:00
parent 0807c122f6
commit c68a436a22
No known key found for this signature in database
GPG Key ID: 00E14E7634F4BEC5

View File

@ -143,6 +143,7 @@ function rspamd_maps($_action, $_data = null) {
return false; return false;
} }
$maps = (array)$_data['map']; $maps = (array)$_data['map'];
$valid_maps = array();
foreach ($maps as $map) { foreach ($maps as $map) {
foreach ($RSPAMD_MAPS as $rspamd_map_type) { foreach ($RSPAMD_MAPS as $rspamd_map_type) {
if (!in_array($map, $rspamd_map_type)) { if (!in_array($map, $rspamd_map_type)) {
@ -151,9 +152,12 @@ function rspamd_maps($_action, $_data = null) {
'log' => array(__FUNCTION__, $_action, '-'), 'log' => array(__FUNCTION__, $_action, '-'),
'msg' => array('global_map_invalid', $map) 'msg' => array('global_map_invalid', $map)
); );
continue; } else {
array_push($valid_maps, $map);
} }
} }
}
foreach ($valid_maps as $map) {
try { try {
if (file_exists('/rspamd_custom_maps/' . $map)) { if (file_exists('/rspamd_custom_maps/' . $map)) {
$map_content = trim($_data['rspamd_map_data']); $map_content = trim($_data['rspamd_map_data']);