Important fix for Rspamd score settings, LUA tag handling changes
parent
a12f957cef
commit
d775af538d
|
@ -4,11 +4,11 @@ The match section performs AND operation on different matches: for example, if y
|
||||||
then the rule matches only when from AND rcpt match. For similar matches, the OR rule applies: if you have multiple rcpt matches,
|
then the rule matches only when from AND rcpt match. For similar matches, the OR rule applies: if you have multiple rcpt matches,
|
||||||
then any of these will trigger the rule. If a rule is triggered then no more rules are matched.
|
then any of these will trigger the rule. If a rule is triggered then no more rules are matched.
|
||||||
*/
|
*/
|
||||||
ini_set('error_reporting', '0');
|
|
||||||
|
|
||||||
header('Content-Type: text/plain');
|
header('Content-Type: text/plain');
|
||||||
require_once "vars.inc.php";
|
require_once "vars.inc.php";
|
||||||
|
|
||||||
|
ini_set('error_reporting', 0);
|
||||||
|
|
||||||
$dsn = $database_type . ':host=' . $database_host . ';dbname=' . $database_name;
|
$dsn = $database_type . ':host=' . $database_host . ';dbname=' . $database_name;
|
||||||
$opt = [
|
$opt = [
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
@ -38,10 +38,17 @@ while ($row = array_shift($rows)) {
|
||||||
WHERE (`object`= :object OR `object`= :object_domain)
|
WHERE (`object`= :object OR `object`= :object_domain)
|
||||||
AND (`option` = 'blacklist_from' OR `option` = 'whitelist_from')");
|
AND (`option` = 'blacklist_from' OR `option` = 'whitelist_from')");
|
||||||
$stmt->execute(array(':object' => $row['object'], ':object_domain' => substr(strrchr($row['object'], "@"), 1)));
|
$stmt->execute(array(':object' => $row['object'], ':object_domain' => substr(strrchr($row['object'], "@"), 1)));
|
||||||
$grouped_lists = $stmt->fetchAll(PDO::FETCH_COLUMN);
|
$grouped_lists = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
$value_sane = preg_replace("/\.\./", ".", (preg_replace("/\*/", ".*", $grouped_lists[0])));
|
array_filter($grouped_lists);
|
||||||
|
while ($grouped_list = array_shift($grouped_lists)) {
|
||||||
|
$value_sane = preg_replace("/\.\./", ".", (preg_replace("/\*/", ".*", $grouped_list['value'])));
|
||||||
|
if (!empty($value_sane)) {
|
||||||
?>
|
?>
|
||||||
from = "/^((?!<?=$value_sane;?>).)*$/";
|
from = "/^((?!<?=$value_sane;?>).)*$/";
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
rcpt = "<?=$row['object'];?>";
|
rcpt = "<?=$row['object'];?>";
|
||||||
<?php
|
<?php
|
||||||
$stmt = $pdo->prepare("SELECT `address` FROM `alias` WHERE `goto` = :object_goto AND `address` NOT LIKE '@%' AND `address` != :object_address");
|
$stmt = $pdo->prepare("SELECT `address` FROM `alias` WHERE `goto` = :object_goto AND `address` NOT LIKE '@%' AND `address` != :object_address");
|
||||||
|
@ -57,7 +64,7 @@ while ($row = array_shift($rows)) {
|
||||||
WHERE `mailbox`.`username` = :object");
|
WHERE `mailbox`.`username` = :object");
|
||||||
$stmt->execute(array(':object' => $row['object']));
|
$stmt->execute(array(':object' => $row['object']));
|
||||||
$rows_aliases_2 = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rows_aliases_2 = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
array_filter($rows_aliases_2);
|
array_filter($rows_aliases_2);
|
||||||
while ($row_aliases_2 = array_shift($rows_aliases_2)) {
|
while ($row_aliases_2 = array_shift($rows_aliases_2)) {
|
||||||
if (!empty($row_aliases_2['aliases'])) {
|
if (!empty($row_aliases_2['aliases'])) {
|
||||||
?>
|
?>
|
||||||
|
@ -106,7 +113,7 @@ while ($row = array_shift($rows)) {
|
||||||
WHERE `target_domain` = :object");
|
WHERE `target_domain` = :object");
|
||||||
$stmt->execute(array(':object' => $row['object']));
|
$stmt->execute(array(':object' => $row['object']));
|
||||||
$rows_domain_aliases = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rows_domain_aliases = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
array_filter($rows_domain_aliases);
|
array_filter($rows_domain_aliases);
|
||||||
while ($row_domain_aliases = array_shift($rows_domain_aliases)) {
|
while ($row_domain_aliases = array_shift($rows_domain_aliases)) {
|
||||||
?>
|
?>
|
||||||
rcpt = "/.*@<?=$row_domain_aliases['alias_domain'];?>/";
|
rcpt = "/.*@<?=$row_domain_aliases['alias_domain'];?>/";
|
||||||
|
@ -122,7 +129,7 @@ while ($row = array_shift($rows)) {
|
||||||
$stmt = $pdo->prepare("SELECT `address` FROM `alias` WHERE `goto` = :object_goto AND `address` NOT LIKE '@%' AND `address` != :object_address");
|
$stmt = $pdo->prepare("SELECT `address` FROM `alias` WHERE `goto` = :object_goto AND `address` NOT LIKE '@%' AND `address` != :object_address");
|
||||||
$stmt->execute(array(':object_goto' => $row['object'], ':object_address' => $row['object']));
|
$stmt->execute(array(':object_goto' => $row['object'], ':object_address' => $row['object']));
|
||||||
$rows_aliases_wl_1 = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rows_aliases_wl_1 = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
array_filter($rows_aliases_wl_1);
|
array_filter($rows_aliases_wl_1);
|
||||||
while ($row_aliases_wl_1 = array_shift($rows_aliases_wl_1)) {
|
while ($row_aliases_wl_1 = array_shift($rows_aliases_wl_1)) {
|
||||||
?>
|
?>
|
||||||
rcpt = "<?=$row_aliases_wl_1['address'];?>";
|
rcpt = "<?=$row_aliases_wl_1['address'];?>";
|
||||||
|
@ -133,7 +140,7 @@ while ($row = array_shift($rows)) {
|
||||||
WHERE `mailbox`.`username` = :object");
|
WHERE `mailbox`.`username` = :object");
|
||||||
$stmt->execute(array(':object' => $row['object']));
|
$stmt->execute(array(':object' => $row['object']));
|
||||||
$rows_aliases_wl_2 = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rows_aliases_wl_2 = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
array_filter($rows_aliases_wl_2);
|
array_filter($rows_aliases_wl_2);
|
||||||
while ($row_aliases_wl_2 = array_shift($rows_aliases_wl_2)) {
|
while ($row_aliases_wl_2 = array_shift($rows_aliases_wl_2)) {
|
||||||
if (!empty($row_aliases_wl_2['aliases'])) {
|
if (!empty($row_aliases_wl_2['aliases'])) {
|
||||||
?>
|
?>
|
||||||
|
@ -178,7 +185,7 @@ while ($row = array_shift($rows)) {
|
||||||
WHERE `target_domain` = :object");
|
WHERE `target_domain` = :object");
|
||||||
$stmt->execute(array(':object' => $row['object']));
|
$stmt->execute(array(':object' => $row['object']));
|
||||||
$rows_domain_aliases = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rows_domain_aliases = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
array_filter($rows_domain_aliases);
|
array_filter($rows_domain_aliases);
|
||||||
while ($row_domain_aliases = array_shift($rows_domain_aliases)) {
|
while ($row_domain_aliases = array_shift($rows_domain_aliases)) {
|
||||||
?>
|
?>
|
||||||
rcpt = "/.*@<?=$row_domain_aliases['alias_domain'];?>/";
|
rcpt = "/.*@<?=$row_domain_aliases['alias_domain'];?>/";
|
||||||
|
@ -194,7 +201,7 @@ while ($row = array_shift($rows)) {
|
||||||
$stmt = $pdo->prepare("SELECT `address` FROM `alias` WHERE `goto` = :object_goto AND `address` NOT LIKE '@%' AND `address` != :object_address");
|
$stmt = $pdo->prepare("SELECT `address` FROM `alias` WHERE `goto` = :object_goto AND `address` NOT LIKE '@%' AND `address` != :object_address");
|
||||||
$stmt->execute(array(':object_goto' => $row['object'], ':object_address' => $row['object']));
|
$stmt->execute(array(':object_goto' => $row['object'], ':object_address' => $row['object']));
|
||||||
$rows_aliases_bl_1 = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rows_aliases_bl_1 = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
array_filter($rows_aliases_bl_1);
|
array_filter($rows_aliases_bl_1);
|
||||||
while ($row_aliases_bl_1 = array_shift($rows_aliases_bl_1)) {
|
while ($row_aliases_bl_1 = array_shift($rows_aliases_bl_1)) {
|
||||||
?>
|
?>
|
||||||
rcpt = "<?=$row_aliases_bl_1['address'];?>";
|
rcpt = "<?=$row_aliases_bl_1['address'];?>";
|
||||||
|
@ -205,7 +212,7 @@ while ($row = array_shift($rows)) {
|
||||||
WHERE `mailbox`.`username` = :object");
|
WHERE `mailbox`.`username` = :object");
|
||||||
$stmt->execute(array(':object' => $row['object']));
|
$stmt->execute(array(':object' => $row['object']));
|
||||||
$rows_aliases_bl_2 = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rows_aliases_bl_2 = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
array_filter($rows_aliases_bl_2);
|
array_filter($rows_aliases_bl_2);
|
||||||
while ($row_aliases_bl_2 = array_shift($rows_aliases_bl_2)) {
|
while ($row_aliases_bl_2 = array_shift($rows_aliases_bl_2)) {
|
||||||
if (!empty($row_aliases_bl_2['aliases'])) {
|
if (!empty($row_aliases_bl_2['aliases'])) {
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -25,6 +25,10 @@ local auth_domain_map = rspamd_config:add_map({
|
||||||
|
|
||||||
rspamd_config.ADD_DELIMITER_TAG = {
|
rspamd_config.ADD_DELIMITER_TAG = {
|
||||||
callback = function(task)
|
callback = function(task)
|
||||||
|
tag = nil
|
||||||
|
local tag_env = nil
|
||||||
|
local tag_to = nil
|
||||||
|
|
||||||
local util = require("rspamd_util")
|
local util = require("rspamd_util")
|
||||||
local rspamd_logger = require "rspamd_logger"
|
local rspamd_logger = require "rspamd_logger"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue