1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2024-12-04 10:24:42 +02:00

[Rspamd] Fix quarantine and pushover notifications

This commit is contained in:
andryyy 2020-04-11 08:02:15 +02:00
parent 730fa16a69
commit cb599db61e
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
2 changed files with 7 additions and 7 deletions

View File

@ -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
));
}

View File

@ -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'])) {