From 1e244e9c0c43a350e4365679cf0e32ef2c65efa8 Mon Sep 17 00:00:00 2001 From: andryyy Date: Sat, 26 Sep 2020 21:58:28 +0200 Subject: [PATCH] [Rspamd] Quarantine, Pushover: Respect active = 2 while processing --- data/conf/rspamd/meta_exporter/pipe.php | 6 +++--- data/conf/rspamd/meta_exporter/pushover.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/conf/rspamd/meta_exporter/pipe.php b/data/conf/rspamd/meta_exporter/pipe.php index 42a1128b..f7fef484 100644 --- a/data/conf/rspamd/meta_exporter/pipe.php +++ b/data/conf/rspamd/meta_exporter/pipe.php @@ -124,13 +124,13 @@ foreach (json_decode($rcpts, true) as $rcpt) { // alias3 ---> mailbox4 // try { - $stmt = $pdo->prepare("SELECT `goto` FROM `alias` WHERE `address` = :rcpt AND (`active` = '1' OR `active` = '2')"); + $stmt = $pdo->prepare("SELECT `goto` FROM `alias` WHERE `address` = :rcpt AND `active` = '1'"); $stmt->execute(array( ':rcpt' => $rcpt )); $gotos = $stmt->fetch(PDO::FETCH_ASSOC)['goto']; if (empty($gotos)) { - $stmt = $pdo->prepare("SELECT `goto` FROM `alias` WHERE `address` = :rcpt AND (`active` = '1' OR `active` = '2')"); + $stmt = $pdo->prepare("SELECT `goto` FROM `alias` WHERE `address` = :rcpt AND `active` = '1'"); $stmt->execute(array( ':rcpt' => '@' . $parsed_rcpt['domain'] )); @@ -169,7 +169,7 @@ foreach (json_decode($rcpts, true) as $rcpt) { error_log("RCPT RESOVLER:" . $goto . " is not a mailcow handled mailbox or alias address" . PHP_EOL); } else { - $stmt = $pdo->prepare("SELECT `goto` FROM `alias` WHERE `address` = :goto AND (`active` = '1' OR `active` = '2')"); + $stmt = $pdo->prepare("SELECT `goto` FROM `alias` WHERE `address` = :goto AND `active` = '1'"); $stmt->execute(array(':goto' => $goto)); $goto_branch = $stmt->fetch(PDO::FETCH_ASSOC)['goto']; if ($goto_branch) { diff --git a/data/conf/rspamd/meta_exporter/pushover.php b/data/conf/rspamd/meta_exporter/pushover.php index 28f751bc..8c1ab320 100644 --- a/data/conf/rspamd/meta_exporter/pushover.php +++ b/data/conf/rspamd/meta_exporter/pushover.php @@ -98,13 +98,13 @@ foreach (json_decode($rcpts, true) as $rcpt) { // alias3 ---> mailbox4 // try { - $stmt = $pdo->prepare("SELECT `goto` FROM `alias` WHERE `address` = :rcpt AND (`active` = '1' OR `active` = '2')"); + $stmt = $pdo->prepare("SELECT `goto` FROM `alias` WHERE `address` = :rcpt AND `active` = '1'"); $stmt->execute(array( ':rcpt' => $rcpt )); $gotos = $stmt->fetch(PDO::FETCH_ASSOC)['goto']; if (empty($gotos)) { - $stmt = $pdo->prepare("SELECT `goto` FROM `alias` WHERE `address` = :rcpt AND (`active` = '1' OR `active` = '2')"); + $stmt = $pdo->prepare("SELECT `goto` FROM `alias` WHERE `address` = :rcpt AND `active` = '1'"); $stmt->execute(array( ':rcpt' => '@' . $parsed_rcpt['domain'] )); @@ -143,7 +143,7 @@ foreach (json_decode($rcpts, true) as $rcpt) { error_log("RCPT RESOVLER:" . $goto . " is not a mailcow handled mailbox or alias address" . PHP_EOL); } else { - $stmt = $pdo->prepare("SELECT `goto` FROM `alias` WHERE `address` = :goto AND (`active` = '1' OR `active` = '2')"); + $stmt = $pdo->prepare("SELECT `goto` FROM `alias` WHERE `address` = :goto AND `active` = '1'"); $stmt->execute(array(':goto' => $goto)); $goto_branch = $stmt->fetch(PDO::FETCH_ASSOC)['goto']; if ($goto_branch) {