From e178ca36de6960de3979b66ac99373675f3f9f9d Mon Sep 17 00:00:00 2001 From: Michael Kuron Date: Sun, 27 Aug 2017 13:45:18 +0200 Subject: [PATCH] Rspamd user settings: make regexes case-insensitive This is necessary because the user web UI normalizes to lowercase --- data/conf/rspamd/dynmaps/settings.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/data/conf/rspamd/dynmaps/settings.php b/data/conf/rspamd/dynmaps/settings.php index 23052d3f5..5689ece33 100644 --- a/data/conf/rspamd/dynmaps/settings.php +++ b/data/conf/rspamd/dynmaps/settings.php @@ -47,7 +47,7 @@ function ucl_rcpts($object, $type) { $local = parse_email($row['address'])['local']; $domain = parse_email($row['address'])['domain']; if (!empty($local) && !empty($domain)) { - $rcpt[] = '/' . $local . '\+.*' . $domain . '/'; + $rcpt[] = '/' . $local . '\+.*' . $domain . '/i'; } $rcpt[] = $row['address']; } @@ -65,7 +65,7 @@ function ucl_rcpts($object, $type) { $local = parse_email($row['alias'])['local']; $domain = parse_email($row['alias'])['domain']; if (!empty($local) && !empty($domain)) { - $rcpt[] = '/' . $local . '\+.*' . $domain . '/'; + $rcpt[] = '/' . $local . '\+.*' . $domain . '/i'; } $rcpt[] = $row['alias']; } @@ -74,20 +74,20 @@ function ucl_rcpts($object, $type) { $local = parse_email($row['object'])['local']; $domain = parse_email($row['object'])['domain']; if (!empty($local) && !empty($domain)) { - $rcpt[] = '/' . $local . '\+.*' . $domain . '/'; + $rcpt[] = '/' . $local . '\+.*' . $domain . '/i'; } $rcpt[] = $object; } elseif ($type == 'domain') { // Domain self - $rcpt[] = '/.*@' . $object . '/'; + $rcpt[] = '/.*@' . $object . '/i'; $stmt = $pdo->prepare("SELECT `alias_domain` FROM `alias_domain` WHERE `target_domain` = :object"); $stmt->execute(array(':object' => $row['object'])); $alias_domains = $stmt->fetchAll(PDO::FETCH_ASSOC); array_filter($alias_domains); while ($row = array_shift($alias_domains)) { - $rcpt[] = '/.*@' . $row['alias_domain'] . '/'; + $rcpt[] = '/.*@' . $row['alias_domain'] . '/i'; } } if (!empty($rcpt)) { @@ -152,7 +152,7 @@ while ($row = array_shift($rows)) { $grouped_lists = $stmt->fetchAll(PDO::FETCH_COLUMN); $value_sane = preg_replace("/\.\./", ".", (preg_replace("/\*/", ".*", $grouped_lists[0]))); ?> - from = "/()/"; + from = "/()/i"; @@ -203,7 +203,7 @@ while ($row = array_shift($rows)) { $grouped_lists = $stmt->fetchAll(PDO::FETCH_COLUMN); $value_sane = preg_replace("/\.\./", ".", (preg_replace("/\*/", ".*", $grouped_lists[0]))); ?> - from = "/()/"; + from = "/()/i";