Miscellaneous > Roundcube Discussion

managesieve plugin fail with dbmail-timsieved

(1/3) > >>

chingson:
After R-Cube 5, Managesieve plug-in always fail with my DBMAIL-timsieved, which shall be compatible to other sieve-daemon. Even all my scripts are created by R-Cube 4.

I found modifying _recvLn() function in Sieve.php can make it back to work. I don't know why empty $lastline need to raise error in source code.

Any comments?

    function _recvLn()
    {
        if (PEAR::isError($lastline = $this->_sock->gets(8192))) {
            return PEAR::raiseError(
                'Failed to read from socket: ' . $lastline->getMessage()
            );
        }

        $lastline = rtrim($lastline);
        $this->_debug("S: $lastline");

        //if ($lastline === '') {
         //   return PEAR::raiseError('Failed to read from socket');
        //}

        return $lastline;
    }

alec:
Please enable managesieve_debug option and privide the log.

chingson:
as the attached documents.

alec:
It looks that DBMail uses Cyrus' timsieved implementation. So, it can have the same bug for which there's already a workaround in Net_Sieve package. Please revert your changes and try with this patch (plugins/managesieve/lib/Net/Sieve.php):

--- Code: ------ Sieve.php   (wersja 5478)
+++ Sieve.php   (kopia robocza)
@@ -1186,7 +1186,7 @@
         // The server should be sending a CAPABILITY response after
         // negotiating TLS. Read it, and ignore if it doesn't.
         // Doesn't work with older timsieved versions
-        $regexp = '/^CYRUS TIMSIEVED V([0-9.]+)/';
+        $regexp = '/TIMSIEVED V*([0-9.]+)/i';
         if (!preg_match($regexp, $this->_capability['implementation'], $matches)
             || version_compare($matches[1], '2.3.10', '>=')
         ) {

--- End code ---

chingson:
I tried but it still fail at _recvLn() when read empty.
The sieve log shows that it is dead at the tail of sieve script reading.


--- Quote from: alec;37418 ---It looks that DBMail uses Cyrus' timsieved implementation. So, it can have the same bug for which there's already a workaround in Net_Sieve package. Please revert your changes and try with this patch (plugins/managesieve/lib/Net/Sieve.php):

--- Code: ---
--- Sieve.php   (wersja 5478)
+++ Sieve.php   (kopia robocza)
@@ -1186,7 +1186,7 @@
         // The server should be sending a CAPABILITY response after
         // negotiating TLS. Read it, and ignore if it doesn't.
         // Doesn't work with older timsieved versions
-        $regexp = '/^CYRUS TIMSIEVED V([0-9.]+)/';
+        $regexp = '/TIMSIEVED V*([0-9.]+)/i';
         if (!preg_match($regexp, $this->_capability['implementation'], $matches)
             || version_compare($matches[1], '2.3.10', '>=')
         ) {

--- End code ---

--- End quote ---

Navigation

[0] Message Index

[#] Next page

Go to full version