diff --git a/admin/inc/class.admin_mail.inc.php b/admin/inc/class.admin_mail.inc.php
index 6ff8d4485d..292d85195a 100644
--- a/admin/inc/class.admin_mail.inc.php
+++ b/admin/inc/class.admin_mail.inc.php
@@ -951,6 +951,21 @@ class admin_mail
$tpl->disableElement('notify_save_default', !$is_multiple || !$edit_access);
$tpl->disableElement('notify_use_default', !$is_multiple);
+ if (isset($content['smimeKeyUpload'])
+ && ($pkcs12 = file_get_contents($content['smimeKeyUpload']['tmp_name'])))
+ {
+ $smime = new Mail\Smime;
+ switch($content['smimeKeyUpload']['type'])
+ {
+ case 'application/x-pkcs12':
+ $cert_info = $smime->extractCertPKCS12($pkcs12, $content['smime_pkcs12_password']);
+ $content['acc_smime_password'] = $cert_info['pkey'];
+ break;
+ case 'application/x-iwork-keynote-sffkey':
+ $content['acc_smime_password'] = $pkcs12;
+ break;
+ }
+ }
if (isset($content['button']))
{
list($button) = each($content['button']);
diff --git a/admin/templates/default/mailaccount.xet b/admin/templates/default/mailaccount.xet
index 77ce513af5..4951dd6f0a 100644
--- a/admin/templates/default/mailaccount.xet
+++ b/admin/templates/default/mailaccount.xet
@@ -285,6 +285,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ s
+
+
+
+
@@ -325,6 +350,7 @@
+
@@ -333,6 +359,7 @@
+