mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 14:07:04 +03:00
Sieve filters (beta)
This commit is contained in:
parent
94789632f0
commit
929bffccef
45 changed files with 1599 additions and 403 deletions
|
|
@ -1025,7 +1025,7 @@ class Actions
|
|||
*/
|
||||
private function UseSieve()
|
||||
{
|
||||
return false; // TODO
|
||||
return $this->Config()->Get('capa', 'filters', false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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('', ''),
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue