Sieve filters (alpha / beta version coming soon)

This commit is contained in:
RainLoop Team 2015-01-24 02:35:42 +04:00
parent 02ba68868f
commit 94789632f0
33 changed files with 544 additions and 81 deletions

View file

@ -83,6 +83,11 @@ class Domain
*/
private $iSieveSecure;
/**
* @var bool
*/
private $bSieveAllowRaw;
/**
* @var string
*/
@ -130,6 +135,8 @@ class Domain
$this->iSievePort = $iSievePort;
$this->iSieveSecure = $iSieveSecure;
$this->bSieveAllowRaw = false;
$this->sWhiteList = \trim($sWhiteList);
}
@ -184,6 +191,7 @@ class Domain
!empty($aDomain['imap_secure']) ? $aDomain['imap_secure'] : '');
$bUseSieve = isset($aDomain['sieve_use']) ? (bool) $aDomain['sieve_use'] : false;
$bSieveAllowRaw = isset($aDomain['sieve_allow_raw']) ? (bool) $aDomain['sieve_allow_raw'] : false;
$sSieveHost = empty($aDomain['sieve_host']) ? '' : (string) $aDomain['sieve_host'];
$iSievePort = empty($aDomain['sieve_port']) ? 2000 : (int) $aDomain['sieve_port'];
@ -207,6 +215,8 @@ class Domain
$bUseSieve, $sSieveHost, $iSievePort, $iSieveSecure,
$sOutHost, $iOutPort, $iOutSecure, $bOutShortLogin, $bOutAuth, $bOutUsePhpMail,
$sWhiteList);
$oDomain->SetSieveAllowRaw($bSieveAllowRaw);
}
return $oDomain;
@ -257,6 +267,7 @@ class Domain
'imap_secure = "'.self::ConstConnectionSecurityTypeToStr($this->iIncSecure).'"',
'imap_short_login = '.($this->bIncShortLogin ? 'On' : 'Off'),
'sieve_use = '.($this->bUseSieve ? 'On' : 'Off'),
'sieve_allow_raw = '.($this->bSieveAllowRaw ? 'On' : 'Off'),
'sieve_host = "'.$this->encodeIniString($this->sSieveHost).'"',
'sieve_port = '.$this->iSievePort,
'sieve_secure = "'.self::ConstConnectionSecurityTypeToStr($this->iSieveSecure).'"',
@ -427,6 +438,22 @@ class Domain
return $this->iSieveSecure;
}
/**
* @return bool
*/
public function SieveAllowRaw()
{
return $this->bSieveAllowRaw;
}
/**
* @param bool $bSieveAllowRaw
*/
public function SetSieveAllowRaw($bSieveAllowRaw)
{
$this->bSieveAllowRaw = !!$bSieveAllowRaw;
}
/**
* @return string
*/
@ -524,6 +551,7 @@ class Domain
'SieveHost' => $bAjax ? \MailSo\Base\Utils::IdnToUtf8($this->SieveHost()) : $this->SieveHost(),
'SievePort' => $this->SievePort(),
'SieveSecure' => $this->SieveSecure(),
'SieveAllowRaw' => $this->SieveAllowRaw(),
'OutHost' => $bAjax ? \MailSo\Base\Utils::IdnToUtf8($this->OutHost()) : $this->OutHost(),
'OutPort' => $this->OutPort(),
'OutSecure' => $this->OutSecure(),