From c0aedfa34a641d5116ae8b8d5c1009c54ffee3b0 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Tue, 14 Aug 2012 03:59:54 -0400
Subject: [PATCH] Merge branch 'master' of github.com:roundcube/roundcubemail

---
 plugins/managesieve/Changelog         |    2 ++
 plugins/managesieve/lib/Net/Sieve.php |    4 +++-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog
index c015ee4..482cff0 100644
--- a/plugins/managesieve/Changelog
+++ b/plugins/managesieve/Changelog
@@ -1,3 +1,5 @@
+- Fixed issue with DBMail bug [http://pear.php.net/bugs/bug.php?id=19077] (#1488594)
+
 * version 5.2 [2012-07-24]
 -----------------------------------------------------------
 - Added GUI for variables setting - RFC5229 (patch from Paweł Słowik)
diff --git a/plugins/managesieve/lib/Net/Sieve.php b/plugins/managesieve/lib/Net/Sieve.php
index a8e36d8..8a0a9b0 100644
--- a/plugins/managesieve/lib/Net/Sieve.php
+++ b/plugins/managesieve/lib/Net/Sieve.php
@@ -1098,7 +1098,9 @@
                     return PEAR::raiseError(trim($response . $line), 6);
                 }
 
-                if (preg_match('/^{([0-9]+)}/i', $line, $matches)) {
+                // "\+?" is added in the regexp to workaround DBMail bug
+                // http://dbmail.org/mantis/view.php?id=963
+                if (preg_match('/^{([0-9]+)\+?}/i', $line, $matches)) {
                     // Matches literal string responses.
                     $line = $this->_recvBytes($matches[1] + 2);
 

--
Gitblit v1.9.1