From 1b09b3a26141c22f37b6ab3ed9af15fcbddd18f8 Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Thu, 2 Mar 2023 17:34:20 +0100 Subject: Bugfixes 1. correctly read mime parts 2. avoid encoding issues when parsing json form qmauth 3. use 'replace' instead of 'strict' error handling when decoding mails in qmauth.py --- lib/JWebmail/Model/ReadMails/QMailAuthuser.pm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'lib/JWebmail/Model/ReadMails/QMailAuthuser.pm') diff --git a/lib/JWebmail/Model/ReadMails/QMailAuthuser.pm b/lib/JWebmail/Model/ReadMails/QMailAuthuser.pm index 956c137..a61cf01 100644 --- a/lib/JWebmail/Model/ReadMails/QMailAuthuser.pm +++ b/lib/JWebmail/Model/ReadMails/QMailAuthuser.pm @@ -193,7 +193,7 @@ sub execute { close $writer or die 'closing write pipe failed'; - binmode $reader, ':encoding(UTF-8)'; + #binmode $reader, ':encoding(UTF-8)'; my $input = <$reader>; close $reader or die 'closing read pipe failed'; @@ -203,12 +203,15 @@ sub execute { my $resp; if ($rc == 3 || $rc == 0) { - eval { $resp = decode_json $input; 1 } - or $resp = { - info => "error decoding response", - response => $input, - cause => $@, - return_code => $rc, + eval { $resp = decode_json $input if $input; 1 } + or do { + $resp = { + info => "error decoding response", + response => $input, + cause => $@, + return_code => $rc, + }; + $rc = 3; }; } elsif ($rc) { -- cgit v1.2.3