diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-09-07 07:25:54 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-09-07 07:25:54 +0000 |
| commit | 43752a8d04b5b2ccc5b85b907c96887be32d50ed (patch) | |
| tree | 5aa2880e44b2d76e241b23fcc9cfe5c5dc2415f2 | |
| parent | 6c8f69857832b4a3188cd1b9230f950f4054e10b (diff) | |
- Add managesieve_script_name option for default name of the script (#1487956)
git-svn-id: https://svn.roundcube.net/trunk@5187 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | plugins/managesieve/Changelog | 1 | ||||
| -rw-r--r-- | plugins/managesieve/config.inc.php.dist | 3 | ||||
| -rw-r--r-- | plugins/managesieve/managesieve.php | 14 |
3 files changed, 13 insertions, 5 deletions
diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog index e5d2fecd9..23232f5d8 100644 --- a/plugins/managesieve/Changelog +++ b/plugins/managesieve/Changelog @@ -1,5 +1,6 @@ - Added possibility to create a filter based on selected message "in-place" - Fixed import from Horde-INGO (#1488064) +- Add managesieve_script_name option for default name of the script (#1487956) * version 4.3 [2011-07-28] ----------------------------------------------------------- diff --git a/plugins/managesieve/config.inc.php.dist b/plugins/managesieve/config.inc.php.dist index 905cfef18..d080347a1 100644 --- a/plugins/managesieve/config.inc.php.dist +++ b/plugins/managesieve/config.inc.php.dist @@ -31,6 +31,9 @@ $rcmail_config['managesieve_usetls'] = false; // default contents of filters script (eg. default spam filter) $rcmail_config['managesieve_default'] = '/etc/dovecot/sieve/global'; +// The name of the script which will be used when there's no user script +$rcmail_config['managesieve_script_name'] = 'managesieve'; + // Sieve RFC says that we should use UTF-8 endcoding for mailbox names, // but some implementations does not covert UTF-8 to modified UTF-7. // Defaults to UTF7-IMAP diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php index 8161516f1..da3d4c069 100644 --- a/plugins/managesieve/managesieve.php +++ b/plugins/managesieve/managesieve.php @@ -205,14 +205,18 @@ class managesieve extends rcube_plugin else { // if script not exists build default script contents $script_file = $this->rc->config->get('managesieve_default'); - $script_name = 'roundcube'; + $script_name = $this->rc->config->get('managesieve_script_name'); + + if (empty($script_name)) + $script_name = 'roundcube'; + if ($script_file && is_readable($script_file)) $content = file_get_contents($script_file); - // add script and set it active - if ($this->sieve->save_script($script_name, $content)) - if ($this->sieve->activate($script_name)) - $_SESSION['managesieve_active'] = $script_name; + // add script and set it active + if ($this->sieve->save_script($script_name, $content)) + if ($this->sieve->activate($script_name)) + $_SESSION['managesieve_active'] = $script_name; } } |
