From 9dc250c9f2cb15d93bf70f7324a58fd66ba2643b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Thu, 28 Jun 2018 11:48:23 +0200 Subject: [PATCH] [Rspamd] Important fix for settings map --- data/conf/rspamd/dynmaps/settings.php | 37 ++++++++++----------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/data/conf/rspamd/dynmaps/settings.php b/data/conf/rspamd/dynmaps/settings.php index e6a7923b..553a9400 100644 --- a/data/conf/rspamd/dynmaps/settings.php +++ b/data/conf/rspamd/dynmaps/settings.php @@ -35,21 +35,19 @@ function ucl_rcpts($object, $type) { if ($type == 'mailbox') { // Standard aliases $stmt = $pdo->prepare("SELECT `address` FROM `alias` - WHERE `goto` LIKE :object_goto - AND `address` NOT LIKE '@%' - AND `address` != :object_address"); + WHERE `goto` = :object_goto + AND `address` NOT LIKE '@%'"); $stmt->execute(array( - ':object_goto' => '%' . $object . '%', - ':object_address' => $object + ':object_goto' => $object )); $standard_aliases = $stmt->fetchAll(PDO::FETCH_ASSOC); while ($row = array_shift($standard_aliases)) { $local = parse_email($row['address'])['local']; $domain = parse_email($row['address'])['domain']; if (!empty($local) && !empty($domain)) { - $rcpt[] = '/' . $local . '[+].*' . $domain . '/i'; + $rcpt[] = '/' . str_replace('/', '\/', $local) . '[+].*' . str_replace('/', '\/', $domain) . '/i'; } - $rcpt[] = $row['address']; + $rcpt[] = str_replace('/', '\/', $row['address']); } // Aliases by alias domains $stmt = $pdo->prepare("SELECT CONCAT(`local_part`, '@', `alias_domain`.`alias_domain`) AS `alias` FROM `mailbox` @@ -70,13 +68,6 @@ function ucl_rcpts($object, $type) { $rcpt[] = $row['alias']; } } - // Mailbox self - $local = parse_email($row['object'])['local']; - $domain = parse_email($row['object'])['domain']; - if (!empty($local) && !empty($domain)) { - $rcpt[] = '/' . $local . '[+].*' . $domain . '/i'; - } - $rcpt[] = $object; } elseif ($type == 'domain') { // Domain self @@ -126,7 +117,7 @@ while ($row = array_shift($rows)) { - rcpt = ; + rcpt = ; prepare("SELECT `option`, `value` FROM `filterconf` @@ -172,7 +163,7 @@ while ($row = array_shift($rows)) { - rcpt = ; + rcpt = ; - rcpt = ; + rcpt = ; - rcpt = ; + rcpt = ; - rcpt = ; + rcpt = ; - rcpt = ; + rcpt = ; - rcpt = ; + rcpt = ; - rcpt = ; + rcpt = ; - rcpt = ; + rcpt = ;