Managesieve allowed hosts (#6292)

* Introduce managesieve_allowed_hosts setting

If managesieve_allowed_hosts has been set, then check that the array contains the current mail_host for the user session. If not, just return. This will cause the managesieve plugin to not appear under the settings menu.

* Include managesieve_allowed_hosts example

An example of the managesieve_allowed_hosts setting is included. By default, it is left commented to preserve existing behaviour.
pull/6302/head
Athanasios Douitsis 6 years ago committed by Aleksander Machniak
parent 71eec07d25
commit b497908040

@ -121,3 +121,10 @@ $config['managesieve_raw_editor'] = true;
// list_sets, enable_disable_set, delete_set, new_set, download_set, new_rule, delete_rule
// Note: disabling list_sets removes the Filter sets widget from the UI and means the set defined in managesieve_script_name will always be used (and activated)
$config['managesieve_disabled_actions'] = array();
// Allowed hosts
// Only activate managesieve for selected hosts
// If this is not set, existing behaviour is maintained.
// If set, managesieve will work only for hosts contained in the managesieve_allowed_hosts array
// $config['managesieve_allowed_hosts'] = array('host1.mydomain.com','host2.mydomain.com');

@ -101,7 +101,13 @@ class managesieve extends rcube_plugin
function settings_actions($args)
{
$this->load_config();
if( $this->rc->config->get('managesieve_allowed_hosts') !== null &&
! in_array( $this->rc->user->data['mail_host'],
$this->rc->config->get('managesieve_allowed_hosts') ) ){
return;
}
$vacation_mode = (int) $this->rc->config->get('managesieve_vacation');
$forward_mode = (int) $this->rc->config->get('managesieve_forward');

Loading…
Cancel
Save