[pmg-devel] [PATCH pmg-api] fix 4006: do not split from header on ', ' for spamreport mails

Stoiko Ivanov s.ivanov at proxmox.com
Tue Nov 15 10:28:20 CET 2022


This commit follows 0f123331c73bbcb73303f1f07b5318a68c83ad64, which
did the same change for the API calls.

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 src/PMG/CLI/pmgqm.pm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/PMG/CLI/pmgqm.pm b/src/PMG/CLI/pmgqm.pm
index 1e21bf0..dbec8ef 100755
--- a/src/PMG/CLI/pmgqm.pm
+++ b/src/PMG/CLI/pmgqm.pm
@@ -46,8 +46,7 @@ sub get_item_data {
     $item->{subject} = PMG::Utils::rfc1522_to_html(
 	PVE::Tools::trim($head->get('subject')) || 'No Subject');
 
-    my @fromarray = split('\s*,\s*', $head->get('from') || $ref->{sender});
-    my $from = PMG::Utils::rfc1522_to_html(PVE::Tools::trim($fromarray[0]));
+    my $from = PMG::Utils::rfc1522_to_html(PVE::Tools::trim($head->get('from') // $ref->{sender}));
     my $sender = PMG::Utils::rfc1522_to_html(PVE::Tools::trim($head->get('sender')));
 
     if ($sender) {
-- 
2.30.2





More information about the pmg-devel mailing list