* Mail: fix S/MIME encrypted only composed mail fails

This commit is contained in:
Hadi Nategh 2018-08-17 11:50:26 +02:00
parent 1ef14cc4c8
commit 229752b4dd

View File

@ -3821,11 +3821,12 @@ class mail_compose
try try
{ {
$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];
if (isset($sender) && ($type == Mail\Smime::TYPE_SIGN || $type == Mail\Smime::TYPE_SIGN_ENCRYPT)) if (isset($sender) && ($type == Mail\Smime::TYPE_SIGN || $type == Mail\Smime::TYPE_SIGN_ENCRYPT))
{ {
$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];
$acc_smime = Mail\Smime::get_acc_smime($this->mail_bo->profileID, $params['passphrase']); $acc_smime = Mail\Smime::get_acc_smime($this->mail_bo->profileID, $params['passphrase']);
$params['senderPrivKey'] = $acc_smime['pkey']; $params['senderPrivKey'] = $acc_smime['pkey'];
$params['extracerts'] = $acc_smime['extracerts']; $params['extracerts'] = $acc_smime['extracerts'];