diff options
| -rw-r--r-- | plugins/managesieve/Changelog | 4 | ||||
| -rw-r--r-- | plugins/managesieve/config.inc.php.dist | 6 | ||||
| -rw-r--r-- | plugins/managesieve/managesieve.php | 6 |
3 files changed, 12 insertions, 4 deletions
diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog index 3ba381f1b..b02d06b4e 100644 --- a/plugins/managesieve/Changelog +++ b/plugins/managesieve/Changelog @@ -1,3 +1,7 @@ +* version 2.6 [2010-06-03] +----------------------------------------------------------- +- Support %n and %d variables in managesieve_host option + * version 2.5 [2010-05-04] ----------------------------------------------------------- - Fix filters set label after activation diff --git a/plugins/managesieve/config.inc.php.dist b/plugins/managesieve/config.inc.php.dist index 158c4dedd..513fc998e 100644 --- a/plugins/managesieve/config.inc.php.dist +++ b/plugins/managesieve/config.inc.php.dist @@ -4,7 +4,11 @@ $rcmail_config['managesieve_port'] = 2000; // managesieve server address, default is localhost. -// Use %h variable as replacement for user's IMAP hostname +// Replacement variables supported in host name: +// %h - user's IMAP hostname +// %n - http hostname ($_SERVER['SERVER_NAME']) +// %d - domain (http hostname without the first part) +// For example %n = mail.domain.tld, %d = domain.tld $rcmail_config['managesieve_host'] = 'localhost'; // use or not TLS for managesieve server connection diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php index 97fcc4198..d6e3a363c 100644 --- a/plugins/managesieve/managesieve.php +++ b/plugins/managesieve/managesieve.php @@ -7,7 +7,7 @@ * It's clickable interface which operates on text scripts and communicates * with server using managesieve protocol. Adds Filters tab in Settings. * - * @version 2.5 + * @version 2.6 * @author Aleksander 'A.L.E.C' Machniak <alec@alec.pl> * * Configuration (see config.inc.php.dist) @@ -62,12 +62,12 @@ class managesieve extends rcube_plugin require_once($this->home . '/lib/Net/Sieve.php'); require_once($this->home . '/lib/rcube_sieve.php'); - $host = str_replace('%h', $_SESSION['imap_host'], $this->rc->config->get('managesieve_host', 'localhost')); + $host = rcube_parse_host($this->rc->config->get('managesieve_host', 'localhost')); $port = $this->rc->config->get('managesieve_port', 2000); // try to connect to managesieve server and to fetch the script $this->sieve = new rcube_sieve($_SESSION['username'], - $this->rc->decrypt($_SESSION['password']), $host, $port, + $this->rc->decrypt($_SESSION['password']), $host, $port, $this->rc->config->get('managesieve_usetls', false), $this->rc->config->get('managesieve_disabled_extensions'), $this->rc->config->get('managesieve_debug', false) |
