]> git.proxmox.com Git - pmg-api.git/commitdiff
queue administration: try to decode utf8
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 25 Nov 2022 08:08:46 +0000 (09:08 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 28 Nov 2022 15:15:30 +0000 (16:15 +0100)
similar to how we do the rest of the mail parsing, decode with
decode_rfc1522 instead of mime_to_perl_string and use try_decode_utf8
otherwise

this is only used for the queue administration api for the user
to view

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PMG/Postfix.pm

index 43270c8edce274f67ec0918ae378e81e377f22a6..2708b9b6731642e9ca80564de62f0972b84c9078 100644 (file)
@@ -180,9 +180,9 @@ sub postcat {
     my $res = '';
     while (defined(my $line = <$fh>)) {
        if ($decode) {
-           $res .= mime_to_perl_string($line);
+           $res .= PMG::Utils::decode_rfc1522($line);
        } else {
-           $res .= $line;
+           $res .= PMG::Utils::try_decode_utf8($line);
        }
     }