From a241149b6b346949f92bea407f4949d821b67b82 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 18 Mar 2024 02:01:57 +0100 Subject: [PATCH] Resolve #1450 --- .../v/0.0.0/app/libraries/RainLoop/Actions/SMime.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/SMime.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/SMime.php index bf5d09d0f..a3ded4ab1 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/SMime.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/SMime.php @@ -106,10 +106,16 @@ trait SMime $result = $SMIME->decrypt($sBody); if ($result) { $result = ['data' => $result]; - if (\str_contains($result['data'], 'multipart/signed')) { + if (\str_contains($result['data'], 'multipart/signed') + || \preg_match('/smime-type=["\']?signed-data/', $result['data']) + ) { + $signed = $SMIME->verify($result['data'], null, true); $result['signed'] = [ - 'success' => !empty($SMIME->verify($result['data'], null, true)['success']) + 'success' => !empty($signed['success']) ]; + if (!empty($signed['body'])) { + $result['data'] = $signed['body']; + } } }