From f1e1232849dc8671d188079d8aa6cc54756bf221 Mon Sep 17 00:00:00 2001 From: Der-Jan Date: Wed, 21 Dec 2022 10:39:14 +0100 Subject: [PATCH] Add Message-ID to pushover --- data/conf/rspamd/meta_exporter/pushover.php | 9 +++++---- data/web/templates/edit/mailbox.twig | 2 +- data/web/templates/user/Pushover.twig | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/data/conf/rspamd/meta_exporter/pushover.php b/data/conf/rspamd/meta_exporter/pushover.php index 4c8092d14..10265d15f 100644 --- a/data/conf/rspamd/meta_exporter/pushover.php +++ b/data/conf/rspamd/meta_exporter/pushover.php @@ -54,6 +54,7 @@ $rcpts = $headers['X-Rspamd-Rcpt']; $sender = $headers['X-Rspamd-From']; $ip = $headers['X-Rspamd-Ip']; $subject = $headers['X-Rspamd-Subject']; +$messageid= $json_body->message_id; $priority = 0; $symbols_array = json_decode($headers['X-Rspamd-Symbols'], true); @@ -245,13 +246,13 @@ foreach ($rcpt_final_mailboxes as $rcpt_final) { "token" => $api_data['token'], "user" => $api_data['key'], "title" => sprintf("%s", str_replace( - array('{SUBJECT}', '{SENDER}', '{SENDER_NAME}', '{SENDER_ADDRESS}', '{TO_NAME}', '{TO_ADDRESS}'), - array($subject, $sender, $sender_name, $sender_address, $to_name, $to_address), $title) + array('{SUBJECT}', '{SENDER}', '{SENDER_NAME}', '{SENDER_ADDRESS}', '{TO_NAME}', '{TO_ADDRESS}', '{MSG_ID}'), + array($subject, $sender, $sender_name, $sender_address, $to_name, $to_address, $messageid), $title) ), "priority" => $priority, "message" => sprintf("%s", str_replace( - array('{SUBJECT}', '{SENDER}', '{SENDER_NAME}', '{SENDER_ADDRESS}', '{TO_NAME}', '{TO_ADDRESS}', '\n'), - array($subject, $sender, $sender_name, $sender_address, $to_name, $to_address, PHP_EOL), $text) + array('{SUBJECT}', '{SENDER}', '{SENDER_NAME}', '{SENDER_ADDRESS}', '{TO_NAME}', '{TO_ADDRESS}', '{MSG_ID}', '\n'), + array($subject, $sender, $sender_name, $sender_address, $to_name, $to_address, $messageid, PHP_EOL), $text) ), "sound" => $attributes['sound'] ?? "pushover" ); diff --git a/data/web/templates/edit/mailbox.twig b/data/web/templates/edit/mailbox.twig index 9eb7c9513..7f5bc26e3 100644 --- a/data/web/templates/edit/mailbox.twig +++ b/data/web/templates/edit/mailbox.twig @@ -275,7 +275,7 @@

{{ lang.user.pushover_info|format(mailbox)|raw }}

-

{{ lang.edit.pushover_vars|raw }}: {SUBJECT}, {SENDER}, {SENDER_ADDRESS}, {SENDER_NAME}, {TO_NAME}, {TO_ADDRESS}

+

{{ lang.edit.pushover_vars|raw }}: {SUBJECT}, {SENDER}, {SENDER_ADDRESS}, {SENDER_NAME}, {TO_NAME}, {TO_ADDRESS}, {MSG_ID}

diff --git a/data/web/templates/user/Pushover.twig b/data/web/templates/user/Pushover.twig index 5bd6b1a45..8a0a07d44 100644 --- a/data/web/templates/user/Pushover.twig +++ b/data/web/templates/user/Pushover.twig @@ -9,7 +9,7 @@

{{ lang.user.pushover_info|format(mailcow_cc_username)|raw }}

-

{{ lang.edit.pushover_vars|raw }}: {SUBJECT}, {SENDER}, {SENDER_ADDRESS}, {SENDER_NAME}, {TO_NAME}, {TO_ADDRESS}

+

{{ lang.edit.pushover_vars|raw }}: {SUBJECT}, {SENDER}, {SENDER_ADDRESS}, {SENDER_NAME}, {TO_NAME}, {TO_ADDRESS}, {MSG_ID}