[pmg-devel] [PATCH pmg-api] fix #3141: do not split on ', ' for returning the from header
Dominik Csapak
d.csapak at proxmox.com
Wed Nov 18 13:59:17 CET 2020
this is only used to display it in the gui, simply return the whole
from header instead of trying to find the first part
this was wrong in case someone sent an email with a from header like:
From: "Csapak, Dominik" <d.csapak at proxmox.com>
which would yield '"Csapak' as from part...
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
src/PMG/API2/Quarantine.pm | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/PMG/API2/Quarantine.pm b/src/PMG/API2/Quarantine.pm
index 73fb0ec..750afbe 100644
--- a/src/PMG/API2/Quarantine.pm
+++ b/src/PMG/API2/Quarantine.pm
@@ -131,9 +131,7 @@ my $parse_header_info = sub {
$res->{subject} = PMG::Utils::decode_rfc1522(PVE::Tools::trim($head->get('subject'))) // '';
- my @fromarray = split('\s*,\s*', $head->get('from') || $ref->{sender});
-
- $res->{from} = PMG::Utils::decode_rfc1522(PVE::Tools::trim ($fromarray[0])) // '';
+ $res->{from} = PMG::Utils::decode_rfc1522(PVE::Tools::trim($head->get('from') || $ref->{sender})) // '';
my $sender = PMG::Utils::decode_rfc1522(PVE::Tools::trim($head->get('sender')));
$res->{sender} = $sender if $sender && ($sender ne $res->{from});
--
2.20.1
More information about the pmg-devel
mailing list