From adac2e087d4be4971379291f1a80a93d8360f818 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 14 Aug 2018 16:08:55 +0200 Subject: [PATCH] Make an incase sensitive comparison between smime cert email and from email --- api/src/Mail.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/Mail.php b/api/src/Mail.php index d8e181cbe1..c95d49bb84 100644 --- a/api/src/Mail.php +++ b/api/src/Mail.php @@ -7509,7 +7509,7 @@ class Mail )); // check for email address if both signer email address and // email address of sender are the same. - if (is_array($from) && $from[0] != $cert->email) + if (is_array($from) && strcasecmp($from[0], $cert->email) != 0) { $metadata['unknownemail'] = true; $metadata['msg'] .= ' '.lang('Email address of signer is different from the email address of sender!'); @@ -7517,7 +7517,7 @@ class Mail $AB_bo = new \addressbook_bo(); $certkey = $AB_bo->get_smime_keys($cert->email); - if (!is_array($certkey) || $certkey[$cert->email] != $cert->cert) $metadata['addtocontact'] = true; + if (!is_array($certkey) || strcasecmp($certkey[$cert->email], $cert->cert) != 0) $metadata['addtocontact'] = true; } else // only encrypted message {