From cb599db61e911a78cc9ead1c0f041140bd754c29 Mon Sep 17 00:00:00 2001 From: andryyy Date: Sat, 11 Apr 2020 08:02:15 +0200 Subject: [PATCH] [Rspamd] Fix quarantine and pushover notifications --- data/conf/rspamd/meta_exporter/pipe.php | 11 +++++------ data/conf/rspamd/meta_exporter/pushover.php | 3 ++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/data/conf/rspamd/meta_exporter/pipe.php b/data/conf/rspamd/meta_exporter/pipe.php index 77c66419..f7fef484 100644 --- a/data/conf/rspamd/meta_exporter/pipe.php +++ b/data/conf/rspamd/meta_exporter/pipe.php @@ -204,7 +204,6 @@ foreach (json_decode($rcpts, true) as $rcpt) { $loop_c++; error_log("RCPT RESOVLER: http pipe: goto array count on loop #". $loop_c . " is " . count($gotos_array) . PHP_EOL); } - return $rcpt_final_mailboxes; } catch (PDOException $e) { error_log("RCPT RESOVLER: " . $e->getMessage() . PHP_EOL); @@ -213,8 +212,8 @@ foreach (json_decode($rcpts, true) as $rcpt) { } } -foreach ($rcpt_final_mailboxes as $rcpt) { - error_log("QUARANTINE: quarantine pipe: processing quarantine message for rcpt " . $rcpt . PHP_EOL); +foreach ($rcpt_final_mailboxes as $rcpt_final) { + error_log("QUARANTINE: quarantine pipe: processing quarantine message for rcpt " . $rcpt_final . PHP_EOL); try { $stmt = $pdo->prepare("INSERT INTO `quarantine` (`qid`, `subject`, `score`, `sender`, `rcpt`, `symbols`, `user`, `ip`, `msg`, `action`) VALUES (:qid, :subject, :score, :sender, :rcpt, :symbols, :user, :ip, :msg, :action)"); @@ -223,7 +222,7 @@ foreach ($rcpt_final_mailboxes as $rcpt) { ':subject' => $subject, ':score' => $score, ':sender' => $sender, - ':rcpt' => $rcpt, + ':rcpt' => $rcpt_final, ':symbols' => $symbols, ':user' => $user, ':ip' => $ip, @@ -241,8 +240,8 @@ foreach ($rcpt_final_mailboxes as $rcpt) { ) x );'); $stmt->execute(array( - ':rcpt' => $rcpt, - ':rcpt2' => $rcpt, + ':rcpt' => $rcpt_final, + ':rcpt2' => $rcpt_final, ':retention_size' => $retention_size )); } diff --git a/data/conf/rspamd/meta_exporter/pushover.php b/data/conf/rspamd/meta_exporter/pushover.php index 60a890cf..6461610c 100644 --- a/data/conf/rspamd/meta_exporter/pushover.php +++ b/data/conf/rspamd/meta_exporter/pushover.php @@ -177,10 +177,11 @@ foreach (json_decode($rcpts, true) as $rcpt) { foreach ($rcpt_final_mailboxes as $rcpt_final) { + error_log("NOTIFY: pushover pipe: processing pushover message for rcpt " . $rcpt_final . PHP_EOL); $stmt = $pdo->prepare("SELECT * FROM `pushover` WHERE `username` = :username AND `active` = '1'"); $stmt->execute(array( - ':username' => $rcpt + ':username' => $rcpt_final )); $api_data = $stmt->fetch(PDO::FETCH_ASSOC); if (isset($api_data['key']) && isset($api_data['token'])) {