Add config option to use Mailvelope Main Keyring

pull/7348/head
Christopher Gurnee 4 years ago
parent 7f64384bfb
commit cc3779f7ed

@ -70,6 +70,7 @@ RELEASE 1.4.4
- Security: Fix local file inclusion (and code execution) via crafted 'plugins' option [CVE-2020-12640]
- Security: Fix CSRF bypass that could be used to log out an authenticated user [CVE-2020-12626] (#7302)
- Mailvelope: Fix size of iframe for PGP-inlined mail (#7348)
- Mailvelope: Add config option to use Main Keyring (#7348)
RELEASE 1.4.3
-------------

@ -86,3 +86,7 @@ $config['plugins'] = array(
// skin name: folder from skins/
$config['skin'] = 'elastic';
// Use the Main Keyring in Mailvelope? If not, use (creating if required)
// a per-site keyring. Most sites use the Main Keyring, so set this to true.
$config['mailvelope_main_keyring'] = true;

@ -854,6 +854,10 @@ $config['compose_responses_static'] = array(
// Note: Lookup is client-side, so the server must support Cross-Origin Resource Sharing
$config['keyservers'] = array('keys.openpgp.org');
// Use the Main Keyring in Mailvelope? If not, use (creating if required)
// a per-site keyring. This is set to false for backwards compatibility.
$config['mailvelope_main_keyring'] = false;
// ----------------------------------
// ADDRESSBOOK SETTINGS
// ----------------------------------

@ -3711,7 +3711,7 @@ function rcube_webmail()
// Load Mailvelope functionality (and initialize keyring if needed)
this.mailvelope_load = function(action)
{
var keyring = this.env.user_id,
var keyring = this.env.mailvelope_main_keyring ? undefined : this.env.user_id,
fn = function(kr) {
ref.mailvelope_keyring = kr;
ref.mailvelope_init(action, kr);
@ -3722,10 +3722,14 @@ function rcube_webmail()
mailvelope.VERSION_MAJOR = Math.floor(parseFloat(v));
return mailvelope.getKeyring(keyring);
}).then(fn, function(err) {
// attempt to create a new keyring for this app/user
mailvelope.createKeyring(keyring).then(fn, function(err) {
if (keyring) {
// attempt to create a new keyring for this app/user
mailvelope.createKeyring(keyring).then(fn, function(err) {
console.error(err);
});
} else {
console.error(err);
});
}
});
};

@ -93,6 +93,7 @@ $OUTPUT->set_env('save_localstorage', (bool)$RCMAIL->config->get('compose_save_l
$OUTPUT->set_env('is_sent', false);
$OUTPUT->set_env('mimetypes', rcmail_supported_mimetypes());
$OUTPUT->set_env('keyservers', $RCMAIL->config->keyservers());
$OUTPUT->set_env('mailvelope_main_keyring', $RCMAIL->config->get('mailvelope_main_keyring'));
$drafts_mbox = $RCMAIL->config->get('drafts_mbox');
$config_show_sig = $RCMAIL->config->get('show_sig', 1);

@ -85,7 +85,7 @@ if ($uid) {
// set configuration
$RCMAIL->set_env_config(array('delete_junk', 'flag_for_deletion', 'read_when_deleted',
'skip_deleted', 'display_next', 'forward_attachment'));
'skip_deleted', 'display_next', 'forward_attachment', 'mailvelope_main_keyring'));
// set special folders
foreach (array('drafts', 'trash', 'junk') as $mbox) {

@ -33,6 +33,7 @@ if (($_GET['_iid'] || $_POST['_iid']) && $RCMAIL->action=='edit-identity') {
$RCMAIL->overwrite_action('identities');
return;
}
$OUTPUT->set_env('mailvelope_main_keyring', $RCMAIL->config->get('mailvelope_main_keyring'));
}
// add-identity
else {

Loading…
Cancel
Save