diff --git a/api/src/Mail.php b/api/src/Mail.php index 3b2c11ba2e..cd0da046cf 100644 --- a/api/src/Mail.php +++ b/api/src/Mail.php @@ -7608,7 +7608,7 @@ class Mail $params = array ( 'type' => 'message', - 'pubkey' => $certkey[$acc_smime['acc_smime_username']], + 'pubkey' => $certkey[strtolower($acc_smime['acc_smime_username'])], 'privkey' => $acc_smime['pkey'], 'passphrase'=> $_passphrase ); diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index 167ab82152..99c54b4a4d 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -3829,7 +3829,7 @@ class mail_compose { $sender_cert = $AB->get_smime_keys($sender); if (!$sender_cert) throw new Exception("S/MIME Encryption failed because no certificate has been found for sender address: " . $sender); - $params['senderPubKey'] = $sender_cert[$sender]; + $params['senderPubKey'] = $sender_cert[strtolower($sender)]; if (isset($sender) && ($type == Mail\Smime::TYPE_SIGN || $type == Mail\Smime::TYPE_SIGN_ENCRYPT)) { @@ -3843,7 +3843,7 @@ class mail_compose $params['recipientsCerts'] = $AB->get_smime_keys($recipients); foreach ($recipients as &$recipient) { - if (!$params['recipientsCerts'][$recipient]) $missingCerts []= $recipient; + if (!$params['recipientsCerts'][strtolower($recipient)]) $missingCerts []= $recipient; } if (is_array($missingCerts)) throw new Exception ('S/MIME Encryption failed because no certificate has been found for following addresses: '. implode ('|', $missingCerts)); }