Added 'keyservers' option to define list of HKP servers for Enigma/Mailvelope (#6326)

pull/6806/head
Aleksander Machniak 5 years ago
parent 1423536ce0
commit f6807bcc4c

@ -10,6 +10,7 @@ CHANGELOG Roundcube Webmail
- Support PECL memcached extension as a session and cache storage driver (experimental)
- installto.sh: Add possibility to run the update even on the up-to-date installation (#6533)
- Plugin API: Add 'render_folder_selector' hook
- Added 'keyservers' option to define list of HKP servers for Enigma/Mailvelope (#6326)
- Redis: Support connection to unix socket
- Elastic: Add Prev/Next buttons on message page toolbar (#6648)
- Elastic: Close search options on Enter key press in quick-search input (#6660)

@ -813,6 +813,10 @@ $config['compose_responses_static'] = array(
// array('name' => 'Canned Response 2', 'text' => 'Static Response Two'),
);
// List of HKP key servers for PGP public key lookups in Enigma/Mailvelope
// Default: array("keys.fedoraproject.org", "keybase.io")
$config['keyservers'] = array();
// ----------------------------------
// ADDRESSBOOK SETTINGS
// ----------------------------------

@ -138,6 +138,8 @@ class enigma_ui
$this->enigma->include_script('enigma.js');
$this->rc->output->set_env('keyservers', $this->rc->config->keyservers());
$this->js_loaded = true;
}

@ -3977,7 +3977,7 @@ function rcube_webmail()
{
// query with publickey.js
var deferreds = [],
pk = new PublicKey(),
pk = new PublicKey(this.env.keyservers),
lock = ref.display_message('', 'loading');
$.each(emails, function(i, email) {
@ -4094,7 +4094,7 @@ function rcube_webmail()
ul.on('click', 'button.importkey', function() {
var btn = $(this),
keyid = btn.attr('rel'),
pk = new PublicKey(),
pk = new PublicKey(ref.env.keyservers),
lock = ref.display_message('', 'loading');
// fetch from keyserver and import to Mailvelope keyring

@ -578,6 +578,26 @@ class rcube_config
return "\n";
}
/**
* Returns list of configured PGP key servers
*
* @return array|null List of keyservers' URLs
*/
public function keyservers()
{
$list = (array) $this->prop['keyservers'];
foreach ($list as $idx => $host) {
if (!preg_match('|^[a-z]://|', $host)) {
$host = "https://$host";
}
$list[$idx] = slashify($host);
}
return !empty($list) ? $list : null;
}
/**
* Return the mail domain configured for the given host
*

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

Loading…
Cancel
Save