From 93a092e6273217b4c8d226adea075fbb1168fd0a Mon Sep 17 00:00:00 2001 From: Michael Kuron Date: Sun, 27 Aug 2017 13:49:34 +0200 Subject: [PATCH] Rspamd user settings: also match From header --- data/conf/rspamd/dynmaps/settings.php | 82 +++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/data/conf/rspamd/dynmaps/settings.php b/data/conf/rspamd/dynmaps/settings.php index 5689ece33..56481e5ea 100644 --- a/data/conf/rspamd/dynmaps/settings.php +++ b/data/conf/rspamd/dynmaps/settings.php @@ -174,6 +174,47 @@ while ($row = array_shift($rows)) { + apply "default" { + MAILCOW_WHITE = -999.0; + } + symbols [ + "MAILCOW_WHITE" + ] + } + whitelist_header_ { +prepare("SELECT GROUP_CONCAT(REPLACE(`value`, '*', '.*') SEPARATOR '|') AS `value` FROM `filterconf` + WHERE `object`= :object + AND `option` = 'whitelist_from'"); + $stmt->execute(array(':object' => $row['object'])); + $grouped_lists = $stmt->fetchAll(PDO::FETCH_COLUMN); + $value_sane = preg_replace("/\.\./", ".", (preg_replace("/\*/", ".*", $grouped_lists[0]))); +?> + request_header = { + "From" = "/()/i"; + } + + priority = 5; + + rcpt = ""; + + priority = 6; + + rcpt = ""; + apply "default" { MAILCOW_WHITE = -999.0; @@ -225,6 +266,47 @@ while ($row = array_shift($rows)) { + apply "default" { + MAILCOW_BLACK = 999.0; + } + symbols [ + "MAILCOW_BLACK" + ] + } + blacklist_header_ { +prepare("SELECT GROUP_CONCAT(REPLACE(`value`, '*', '.*') SEPARATOR '|') AS `value` FROM `filterconf` + WHERE `object`= :object + AND `option` = 'blacklist_from'"); + $stmt->execute(array(':object' => $row['object'])); + $grouped_lists = $stmt->fetchAll(PDO::FETCH_COLUMN); + $value_sane = preg_replace("/\.\./", ".", (preg_replace("/\*/", ".*", $grouped_lists[0]))); +?> + request_header = { + "From" = "/()/i"; + } + + priority = 5; + + rcpt = ""; + + priority = 6; + + rcpt = ""; + apply "default" { MAILCOW_BLACK = 999.0;