[Rspamd] Fix quarantine and pushover notifications
parent
730fa16a69
commit
cb599db61e
|
@ -204,7 +204,6 @@ foreach (json_decode($rcpts, true) as $rcpt) {
|
||||||
$loop_c++;
|
$loop_c++;
|
||||||
error_log("RCPT RESOVLER: http pipe: goto array count on loop #". $loop_c . " is " . count($gotos_array) . PHP_EOL);
|
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) {
|
catch (PDOException $e) {
|
||||||
error_log("RCPT RESOVLER: " . $e->getMessage() . PHP_EOL);
|
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) {
|
foreach ($rcpt_final_mailboxes as $rcpt_final) {
|
||||||
error_log("QUARANTINE: quarantine pipe: processing quarantine message for rcpt " . $rcpt . PHP_EOL);
|
error_log("QUARANTINE: quarantine pipe: processing quarantine message for rcpt " . $rcpt_final . PHP_EOL);
|
||||||
try {
|
try {
|
||||||
$stmt = $pdo->prepare("INSERT INTO `quarantine` (`qid`, `subject`, `score`, `sender`, `rcpt`, `symbols`, `user`, `ip`, `msg`, `action`)
|
$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)");
|
VALUES (:qid, :subject, :score, :sender, :rcpt, :symbols, :user, :ip, :msg, :action)");
|
||||||
|
@ -223,7 +222,7 @@ foreach ($rcpt_final_mailboxes as $rcpt) {
|
||||||
':subject' => $subject,
|
':subject' => $subject,
|
||||||
':score' => $score,
|
':score' => $score,
|
||||||
':sender' => $sender,
|
':sender' => $sender,
|
||||||
':rcpt' => $rcpt,
|
':rcpt' => $rcpt_final,
|
||||||
':symbols' => $symbols,
|
':symbols' => $symbols,
|
||||||
':user' => $user,
|
':user' => $user,
|
||||||
':ip' => $ip,
|
':ip' => $ip,
|
||||||
|
@ -241,8 +240,8 @@ foreach ($rcpt_final_mailboxes as $rcpt) {
|
||||||
) x
|
) x
|
||||||
);');
|
);');
|
||||||
$stmt->execute(array(
|
$stmt->execute(array(
|
||||||
':rcpt' => $rcpt,
|
':rcpt' => $rcpt_final,
|
||||||
':rcpt2' => $rcpt,
|
':rcpt2' => $rcpt_final,
|
||||||
':retention_size' => $retention_size
|
':retention_size' => $retention_size
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,10 +177,11 @@ foreach (json_decode($rcpts, true) as $rcpt) {
|
||||||
|
|
||||||
|
|
||||||
foreach ($rcpt_final_mailboxes as $rcpt_final) {
|
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`
|
$stmt = $pdo->prepare("SELECT * FROM `pushover`
|
||||||
WHERE `username` = :username AND `active` = '1'");
|
WHERE `username` = :username AND `active` = '1'");
|
||||||
$stmt->execute(array(
|
$stmt->execute(array(
|
||||||
':username' => $rcpt
|
':username' => $rcpt_final
|
||||||
));
|
));
|
||||||
$api_data = $stmt->fetch(PDO::FETCH_ASSOC);
|
$api_data = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
if (isset($api_data['key']) && isset($api_data['token'])) {
|
if (isset($api_data['key']) && isset($api_data['token'])) {
|
||||||
|
|
Loading…
Reference in New Issue