[pmg-devel] [PATCH pmg-api] queue administration: try to decode utf8

Dominik Csapak d.csapak at proxmox.com
Fri Nov 25 09:08:46 CET 2022


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 at proxmox.com>
---
 src/PMG/Postfix.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PMG/Postfix.pm b/src/PMG/Postfix.pm
index 43270c8..2708b9b 100644
--- a/src/PMG/Postfix.pm
+++ b/src/PMG/Postfix.pm
@@ -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);
 	}
     }
 
-- 
2.30.2





More information about the pmg-devel mailing list