[Rspamd] Quarantine, Pushover: Respect active = 2 while processing

This commit is contained in:
andryyy 2020-09-26 21:58:28 +02:00
parent 642ef1a515
commit 1e244e9c0c
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
2 changed files with 6 additions and 6 deletions

View File

@ -124,13 +124,13 @@ foreach (json_decode($rcpts, true) as $rcpt) {
// alias3 ---> mailbox4 // alias3 ---> mailbox4
// //
try { 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( $stmt->execute(array(
':rcpt' => $rcpt ':rcpt' => $rcpt
)); ));
$gotos = $stmt->fetch(PDO::FETCH_ASSOC)['goto']; $gotos = $stmt->fetch(PDO::FETCH_ASSOC)['goto'];
if (empty($gotos)) { 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( $stmt->execute(array(
':rcpt' => '@' . $parsed_rcpt['domain'] ':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); error_log("RCPT RESOVLER:" . $goto . " is not a mailcow handled mailbox or alias address" . PHP_EOL);
} }
else { 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)); $stmt->execute(array(':goto' => $goto));
$goto_branch = $stmt->fetch(PDO::FETCH_ASSOC)['goto']; $goto_branch = $stmt->fetch(PDO::FETCH_ASSOC)['goto'];
if ($goto_branch) { if ($goto_branch) {

View File

@ -98,13 +98,13 @@ foreach (json_decode($rcpts, true) as $rcpt) {
// alias3 ---> mailbox4 // alias3 ---> mailbox4
// //
try { 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( $stmt->execute(array(
':rcpt' => $rcpt ':rcpt' => $rcpt
)); ));
$gotos = $stmt->fetch(PDO::FETCH_ASSOC)['goto']; $gotos = $stmt->fetch(PDO::FETCH_ASSOC)['goto'];
if (empty($gotos)) { 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( $stmt->execute(array(
':rcpt' => '@' . $parsed_rcpt['domain'] ':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); error_log("RCPT RESOVLER:" . $goto . " is not a mailcow handled mailbox or alias address" . PHP_EOL);
} }
else { 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)); $stmt->execute(array(':goto' => $goto));
$goto_branch = $stmt->fetch(PDO::FETCH_ASSOC)['goto']; $goto_branch = $stmt->fetch(PDO::FETCH_ASSOC)['goto'];
if ($goto_branch) { if ($goto_branch) {