[Tickets #8105] Driver Timsieve saves invalid sieve file without displaying error message

bugs at horde.org bugs at horde.org
Fri Mar 20 14:38:06 UTC 2009


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/8105
------------------------------------------------------------------------------
  Ticket             | 8105
  Created By         | noethen at uni-paderborn.de
  Summary            | Driver Timsieve saves invalid sieve file without
                     | displaying error message
  Queue              | Ingo
  Version            | 1.2.1
  Type               | Bug
  State              | Unconfirmed
  Priority           | 1. Low
  Milestone          |
  Patch              | 1
  Owners             |
------------------------------------------------------------------------------


noethen at uni-paderborn.de (2009-03-20 10:38) wrote:

Hello,

when the user adds a invalid rule - for ex. over custom header  
"replay-to:" where the colon is wrong, the user gets no feedback. The  
script is saved to the server (the server ignores the wrong filter  
rule) and the user doesn't know why the rule doesn't work.

Here is my patched function - as in fact we include the  
"INGO-Sieve-Script" from a main sieve script, so i disabled the  
activation - only the script is uploaded/installed.

    /**
      * Sets a script running on the backend.
      *
      * @param string $script    The sieve script.
      *
      * @return mixed  True on success, PEAR_Error on error.
      */
     function setScriptActive($script)
     {
         $res = $this->_connect();
         if (is_a($res, 'PEAR_Error')) {
             return $res;
         }

         if (!strlen($script)) {
             return $this->_sieve->setActive('');
         }

         $res = $this->_sieve->haveSpace($this->_params['scriptname'],
                                         strlen($script));
         if (is_a($res, 'PEAR_ERROR')) {
             return $res;
         }

         // IMT PATCHED

/*
         return $this->_sieve->installScript($this->_params['scriptname'],
                                             $script, true);
*/
          $return =  $this->_sieve->installScript($this->_params['scriptname'],
                                                      $script, false);


         // Check if the uploaded script is valid - server doesn't  
return error when script is invalid, so here i fetch the script again  
and check for errors.

         $tmp = $this->_sieve->getScript($this->_params['scriptname']);

         if (is_a($tmp, 'PEAR_ERROR'))
                 return $tmp;


         return $return;

     }







More information about the bugs mailing list