Sieve filters (beta)

This commit is contained in:
RainLoop Team 2015-01-24 23:09:10 +04:00
parent 94789632f0
commit 929bffccef
45 changed files with 1599 additions and 403 deletions

View file

@ -1025,7 +1025,7 @@ class Actions
*/
private function UseSieve()
{
return false; // TODO
return $this->Config()->Get('capa', 'filters', false);
}
/**

View file

@ -128,6 +128,10 @@ class Application extends \RainLoop\Config\AbstractConfig
'capath' => array('', 'capath must be a correctly hashed certificate directory. (/etc/ssl/certs/)'),
),
'capa' => array(
'filters' => array(true)
),
'login' => array(
'default_domain' => array('', ''),

View file

@ -36,6 +36,9 @@ class Notifications
const CantSendMessage = 302;
const InvalidRecipients = 303;
const CantSaveFilters = 351;
const FiltersAreNotCorrect = 352;
const CantCreateFolder = 400;
const CantRenameFolder = 401;
const CantDeleteFolder = 402;
@ -107,6 +110,9 @@ class Notifications
self::CantSaveMessage => 'CantSaveMessage',
self::CantSendMessage => 'CantSendMessage',
self::InvalidRecipients => 'InvalidRecipients',
self::CantSaveFilters => 'CantSaveFilters',
self::FiltersAreNotCorrect => 'FiltersAreNotCorrect',
self::CantCreateFolder => 'CantCreateFolder',
self::CantRenameFolder => 'CantRenameFolder',
self::CantDeleteFolder => 'CantDeleteFolder',

View file

@ -38,8 +38,21 @@ class Filters extends \RainLoop\Providers\AbstractProvider
*/
public function Save($oAccount, $aFilters, $sRaw = '', $bRawIsActive = false)
{
return $this->IsActive() ? $this->oDriver->Save($oAccount,
$aFilters, $sRaw, $bRawIsActive) : false;
try
{
return $this->IsActive() ? $this->oDriver->Save(
$oAccount, $aFilters, $sRaw, $bRawIsActive) : false;
}
catch (\MailSo\Net\Exceptions\SocketCanNotConnectToHostException $oException)
{
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::ConnectionError, $oException);
}
catch (\Exception $oException)
{
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantSaveFilters, $oException);
}
return false;
}
/**