From e04e15ed23ef9e5314a0aad9c46555a501b128dd Mon Sep 17 00:00:00 2001 From: andryyy Date: Thu, 7 Mar 2019 00:07:11 +0100 Subject: [PATCH] [Rspamd] Mime from and rcpt can now be checked by from_mime and rcpt_mime --- data/conf/rspamd/dynmaps/settings.php | 43 +++++++-------------------- 1 file changed, 11 insertions(+), 32 deletions(-) diff --git a/data/conf/rspamd/dynmaps/settings.php b/data/conf/rspamd/dynmaps/settings.php index 4d78456e..3d42bcf3 100644 --- a/data/conf/rspamd/dynmaps/settings.php +++ b/data/conf/rspamd/dynmaps/settings.php @@ -107,8 +107,8 @@ function ucl_rcpts($object, $type) { settings { watchdog { priority = 10; - rcpt = "/null@localhost/i"; - from = "/watchdog@localhost/i"; + rcpt_mime = "/null@localhost/i"; + from_mime = "/watchdog@localhost/i"; apply "default" { actions { reject = 9999.0; @@ -199,12 +199,13 @@ while ($row = array_shift($rows)) { ?> whitelist_ { prepare("SELECT `value` FROM `filterconf` WHERE `object`= :object AND `option` = 'whitelist_from'"); $stmt->execute(array(':object' => $row['object'])); $list_items = $stmt->fetchAll(PDO::FETCH_ASSOC); - while ($item = array_shift($list_items)) { + foreach ($list_items as $item) { ?> from = "//i"; { + whitelist_mime_ { prepare("SELECT `value` FROM `filterconf` - WHERE `object`= :object - AND `option` = 'whitelist_from'"); - $stmt->execute(array(':object' => $row['object'])); - $list_items = $stmt->fetchAll(PDO::FETCH_ASSOC); + foreach ($list_items as $item) { ?> - header = { + from_mime = "//i"; - "From" = "/()/i"; - } - priority = 5; @@ -297,13 +287,13 @@ while ($row = array_shift($rows)) { ?> blacklist_ { prepare("SELECT `value` FROM `filterconf` WHERE `object`= :object AND `option` = 'blacklist_from'"); $stmt->execute(array(':object' => $row['object'])); $list_items = $stmt->fetchAll(PDO::FETCH_ASSOC); - while ($item = array_shift($list_items)) { + foreach ($list_items as $item) { ?> from = "//i"; { prepare("SELECT `value` FROM `filterconf` - WHERE `object`= :object - AND `option` = 'blacklist_from'"); - $stmt->execute(array(':object' => $row['object'])); - $list_items = $stmt->fetchAll(PDO::FETCH_ASSOC); + foreach ($list_items as $item) { ?> - header = { + from_mime = "//i"; - "From" = "/()/i"; - } - priority = 5;