From 24a118a3479a8ee0a04b4e3c25689501639e0bc2 Mon Sep 17 00:00:00 2001 From: alec Date: Fri, 4 Feb 2011 16:50:05 +0000 Subject: - Fix STARTTLS for timsieved < 2.3.10 git-svn-id: https://svn.roundcube.net/trunk@4495 208e9e7b-5314-0410-a742-e7e81cd9613c --- plugins/managesieve/Changelog | 2 ++ plugins/managesieve/lib/Net/Sieve.php | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog index 582eb0353..a634815a4 100644 --- a/plugins/managesieve/Changelog +++ b/plugins/managesieve/Changelog @@ -1,3 +1,5 @@ +- Fix STARTTLS for timsieved < 2.3.10 + * version 3.0 [2011-02-01] ----------------------------------------------------------- - Added support for SASL proxy authentication (#1486691) diff --git a/plugins/managesieve/lib/Net/Sieve.php b/plugins/managesieve/lib/Net/Sieve.php index 14989ff0b..d4cc3eeda 100644 --- a/plugins/managesieve/lib/Net/Sieve.php +++ b/plugins/managesieve/lib/Net/Sieve.php @@ -1161,7 +1161,13 @@ class Net_Sieve // The server should be sending a CAPABILITY response after // negotiating TLS. Read it, and ignore if it doesn't. - $this->_doCmd(); + // Doesn't work with older timsieved versions + $regexp = '/^CYRUS TIMSIEVED V([0-9.]+)/'; + if (!preg_match($regexp, $this->_capability['implementation'], $matches) + || version_compare($matches[1], '2.3.10', '>=') + ) { + $this->_doCmd(); + } // RFC says we need to query the server capabilities again now that we // are under encryption. -- cgit v1.2.3