diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index 7c6617ed07..604e0b1015 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -212,23 +212,29 @@ class mail_compose 'onExecute' => 'javaScript:app.mail.compose_saveDraft2fm', 'hint' => 'Save the drafted message as eml file into VFS' ), - 'smime_sign' => array ( - 'caption' => 'SMIME Sign', - 'icon' => 'smimeSignature', - 'group' => ++$group, - 'onExecute' => 'javaScript:app.mail.compose_setToggle', - 'checkbox' => true, - 'hint' => 'Sign your message with smime certificate' - ), - 'smime_encrypt' => array ( - 'caption' => 'SMIME Encryption', - 'icon' => 'smimeEncryption', - 'group' => ++$group, - 'onExecute' => 'javaScript:app.mail.compose_setToggle', - 'checkbox' => true, - 'hint' => 'Encrypt your message with smime certificate' - ) + ); + $credentials = Mail\Credentials::read($this->mail_bo->profileID, Mail\Credentials::SMIME, $GLOBALS['egw_info']['user']['account_id']); + if ($credentials['acc_smime_password']) + { + $actions = array_merge($actions, array( + 'smime_sign' => array ( + 'caption' => 'SMIME Sign', + 'icon' => 'smimeSignature', + 'group' => ++$group, + 'onExecute' => 'javaScript:app.mail.compose_setToggle', + 'checkbox' => true, + 'hint' => 'Sign your message with smime certificate' + ), + 'smime_encrypt' => array ( + 'caption' => 'SMIME Encryption', + 'icon' => 'smimeEncryption', + 'group' => ++$group, + 'onExecute' => 'javaScript:app.mail.compose_setToggle', + 'checkbox' => true, + 'hint' => 'Encrypt your message with smime certificate' + ))); + } foreach (self::$priorities as $key => $priority) { $actions['prty']['children'][$key] = array( diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 1a5840809b..e4d01f8c17 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -3087,6 +3087,12 @@ $filter['before']= date("d-M-Y", $cutoffdate2); } catch(Mail\Smime\PassphraseMissing $e) { + $credentials = Mail\Credentials::read($this->mail_bo->profileID, Mail\Credentials::SMIME, $GLOBALS['egw_info']['user']['account_id']); + if (empty($credentials['acc_smime_password'])) + { + self::callWizard($e->getMessage().' '.lang('Please configure your S/MIME private key in Encryption tab.')); + } + // do NOT include any default CSS $smimeHtml = $this->get_email_header(). '
'.