summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/managesieve/Changelog4
-rw-r--r--plugins/managesieve/config.inc.php.dist5
-rw-r--r--plugins/managesieve/lib/rcube_sieve.php30
-rw-r--r--plugins/managesieve/managesieve.php5
4 files changed, 27 insertions, 17 deletions
diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog
index 2f48ab36c..96c4fe0fd 100644
--- a/plugins/managesieve/Changelog
+++ b/plugins/managesieve/Changelog
@@ -1,3 +1,7 @@
+* version 2.8 [2010-07-08]
+-----------------------------------------------------------
+- Added managesieve_auth_type option (#1486731)
+
* version 2.7 [2010-07-06]
-----------------------------------------------------------
- Update Net_Sieve to version 1.3.0 (fixes LOGIN athentication)
diff --git a/plugins/managesieve/config.inc.php.dist b/plugins/managesieve/config.inc.php.dist
index 513fc998e..63dda6cc2 100644
--- a/plugins/managesieve/config.inc.php.dist
+++ b/plugins/managesieve/config.inc.php.dist
@@ -11,6 +11,10 @@ $rcmail_config['managesieve_port'] = 2000;
// For example %n = mail.domain.tld, %d = domain.tld
$rcmail_config['managesieve_host'] = 'localhost';
+// authentication method. Can be CRAM-MD5, DIGEST-MD5, PLAIN, LOGIN, EXTERNAL
+// or none. Optional, defaults to best method supported by server.
+$rcmail_config['managesieve_auth_type'] = null;
+
// use or not TLS for managesieve server connection
// it's because I've problems with TLS and dovecot's managesieve plugin
// and it's not needed on localhost
@@ -39,4 +43,3 @@ $rcmail_config['managesieve_disabled_extensions'] = array();
$rcmail_config['managesieve_debug'] = false;
?>
-
diff --git a/plugins/managesieve/lib/rcube_sieve.php b/plugins/managesieve/lib/rcube_sieve.php
index 2a79f7f14..7333d1dcd 100644
--- a/plugins/managesieve/lib/rcube_sieve.php
+++ b/plugins/managesieve/lib/rcube_sieve.php
@@ -36,27 +36,31 @@ class rcube_sieve
/**
* Object constructor
*
- * @param string Username (to managesieve login)
- * @param string Password (to managesieve login)
- * @param string Managesieve server hostname/address
- * @param string Managesieve server port number
- * @param string Enable/disable TLS use
- * @param array Disabled extensions
+ * @param string Username (for managesieve login)
+ * @param string Password (for managesieve login)
+ * @param string Managesieve server hostname/address
+ * @param string Managesieve server port number
+ * @param string Managesieve authentication method
+ * @param boolean Enable/disable TLS use
+ * @param array Disabled extensions
+ * @param boolean Enable/disable debugging
*/
public function __construct($username, $password='', $host='localhost', $port=2000,
- $usetls=true, $disabled=array(), $debug=false)
+ $auth_type=null, $usetls=true, $disabled=array(), $debug=false)
{
$this->sieve = new Net_Sieve();
- if ($debug)
+ if ($debug) {
$this->sieve->setDebug(true, array($this, 'debug_handler'));
-
- if (PEAR::isError($this->sieve->connect($host, $port, NULL, $usetls)))
+ }
+ if (PEAR::isError($this->sieve->connect($host, $port, NULL, $usetls))) {
return $this->_set_error(SIEVE_ERROR_CONNECTION);
-
- if (PEAR::isError($this->sieve->login($username, $password)))
+ }
+ if (PEAR::isError($this->sieve->login($username, $password,
+ $auth_type ? strtoupper($auth_type) : null))
+ ) {
return $this->_set_error(SIEVE_ERROR_LOGIN);
-
+ }
$this->disabled = $disabled;
}
diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php
index 504c35677..cc71dd81f 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.6
+ * @version 2.8
* @author Aleksander 'A.L.E.C' Machniak <alec@alec.pl>
*
* Configuration (see config.inc.php.dist)
@@ -68,6 +68,7 @@ class managesieve extends rcube_plugin
// 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->config->get('managesieve_auth_type'),
$this->rc->config->get('managesieve_usetls', false),
$this->rc->config->get('managesieve_disabled_extensions'),
$this->rc->config->get('managesieve_debug', false)
@@ -1090,5 +1091,3 @@ class managesieve extends rcube_plugin
return rcube_charset_convert($text, 'UTF7-IMAP', $encoding);
}
}
-
-?>