diff --git a/api/src/Mailer.php b/api/src/Mailer.php
index c3ee376e38..4641ce2891 100644
--- a/api/src/Mailer.php
+++ b/api/src/Mailer.php
@@ -1027,7 +1027,7 @@ class Mailer extends Horde_Mime_Mail
{
throw new Exception\WrongUserinput('no certificate found to sign the messase');
}
-
+ if (Cache::getSession('mail', 'smime_passphrase')) $params['passphrase'] = Cache::getSession('mail', 'smime_passphrase');
if (!$smime->verifyPassphrase($params['senderPrivKey'], $params['passphrase']))
{
return false;
diff --git a/api/templates/default/password.xet b/api/templates/default/password.xet
index 6a26757a20..170bb8e09a 100644
--- a/api/templates/default/password.xet
+++ b/api/templates/default/password.xet
@@ -10,6 +10,10 @@
+
+
+
+
diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php
index 604e0b1015..9744e3b076 100644
--- a/mail/inc/class.mail_compose.inc.php
+++ b/mail/inc/class.mail_compose.inc.php
@@ -2992,6 +2992,14 @@ class mail_compose
try {
if ($_formData['smime_sign'] == 'on')
{
+ if ($_formData['smime_passphrase'] != '') {
+ Api\Cache::setSession(
+ 'mail',
+ 'smime_passphrase',
+ $_formData['smime_passphrase'],
+ $GLOBALS['egw_info']['user']['preferences']['mail']['smime_pass_exp'] * 60
+ );
+ }
$smime_success = $this->_encrypt(
$mail,
$_formData['smime_encrypt'] == 'on'? Mail\Smime::TYPE_SIGN_ENCRYPT: Mail\Smime::TYPE_SIGN,
diff --git a/mail/js/app.js b/mail/js/app.js
index fe91aee1fc..e8f697100f 100644
--- a/mail/js/app.js
+++ b/mail/js/app.js
@@ -5734,6 +5734,7 @@ app.classes.mail = AppJS.extend(
smimePassDialog: function (_msg)
{
var self = this;
+ var pass_exp = egw.preference('smime_pass_exp', 'mail');
et2_createWidget("dialog",
{
callback: function(_button_id, _value)
@@ -5744,6 +5745,7 @@ app.classes.mail = AppJS.extend(
pass.set_value(_value.value);
var toolbar = self.et2.getWidgetById('composeToolbar');
toolbar.value = 'send';
+ egw.set_preference('mail', 'smime_pass_exp', _value.pass_exp);
self.compose_submitAction(false);
}
},
@@ -5755,7 +5757,8 @@ app.classes.mail = AppJS.extend(
value:{
content:{
value: '',
- message: _msg
+ message: _msg,
+ 'exp_min': pass_exp
}},
template: egw.webserverUrl+'/api/templates/default/password.xet',
resizable: false