From ee092b0d5a94bcc9eb01470c6e8e67d90e5a31dd Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 4 Sep 2017 10:20:04 +0200 Subject: [PATCH] S/MIME: - Rephrase warning message for reading encrypted mails with no relevant pubkey and privkey - If no mimeType provided set it to default type from mime object --- api/src/Mail.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/src/Mail.php b/api/src/Mail.php index bdd1e29b2b..071e35340e 100644 --- a/api/src/Mail.php +++ b/api/src/Mail.php @@ -7346,7 +7346,7 @@ class Mail ), $_params); $metadata = array ( - 'mimeType' => $params['mimeType'] + 'mimeType' => $params['mimeType']?$params['mimeType']:$_mime_part->getType() ); $this->smime = new Mail\Smime; $message = $this->getMessageRawBody($params['uid'], null, $params['mailbox']); @@ -7358,7 +7358,9 @@ class Mail } catch(\Horde_Crypt_Exception $e) { - throw new Mail\Smime\PassphraseMissing(lang('Could not decrypt S/MIME data. This message may not be encrypted by your public key.')); + throw new Mail\Smime\PassphraseMissing(lang('Could not decrypt '. + 'S/MIME data. This message may not be encrypted by your '. + 'public key and not being able to find corresponding private key.')); } $metadata['encrypted'] = true; }