Exemple #1
0
 /**
  * put updated sieve script
  * 
  * @param string|Felamimail_Model_Account $_accountId
  * @param Felamimail_Sieve_Backend_Abstract $_script
  * @throws Felamimail_Exception_Sieve
  */
 protected function _putScript($_accountId, $_script)
 {
     $scriptToPut = $_script->getSieve();
     if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
         Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' ' . $scriptToPut);
     }
     try {
         $this->_setSieveBackendAndAuthenticate($_accountId);
         $this->_backend->putScript($this->_scriptName, $scriptToPut);
         $this->activateScript($_accountId);
     } catch (Zend_Mail_Protocol_Exception $zmpe) {
         if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
             Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' ' . $zmpe->getTraceAsString());
         }
         throw new Felamimail_Exception_SievePutScriptFail($zmpe->getMessage());
     }
 }
 /**
  * get sieve script as string
  * 
  * @return string
  */
 public function getSieve()
 {
     $sieve = parent::getSieve();
     $this->save();
     return $sieve;
 }
 /**
  * get sieve script as string
  * 
  * @return string
  */
 public function getSieve()
 {
     $sieve = parent::getSieve();
     $pseudoScript = $this->_getPseudoScript();
     $sieve = $sieve . $pseudoScript;
     return $sieve;
 }