summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/managesieve/Changelog1
-rw-r--r--plugins/managesieve/config.inc.php.dist3
-rw-r--r--plugins/managesieve/managesieve.php14
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;
}
}