mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-29 01:09:10 +01:00
fixed not existing Sieve script gives now an exception
This commit is contained in:
parent
cbd328eb55
commit
f98642df20
@ -2486,24 +2486,25 @@ unset($query['actions']);
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gatherVacation
|
* fetch vacation info from active Server using icServer object
|
||||||
*
|
*
|
||||||
* fetch vacation info from active Server using the oldIMAPObject
|
* @return array|boolean array with vacation on success or false on failure
|
||||||
* @return mixed array/boolean - array with vacation on success; false on failure
|
|
||||||
*/
|
*/
|
||||||
function gatherVacation()
|
function gatherVacation()
|
||||||
{
|
{
|
||||||
$vacation = $this->mail_bo->icServer->acc_sieve_enabled && ($this->mail_bo->icServer->acc_sieve_host||$this->mail_bo->icServer->acc_imap_host);
|
$vacation = $this->mail_bo->icServer->acc_sieve_enabled && ($this->mail_bo->icServer->acc_sieve_host||$this->mail_bo->icServer->acc_imap_host);
|
||||||
//error_log(__METHOD__.__LINE__.' Server:'.self::$icServerID.' Sieve Enabled:'.array2string($vacation));
|
//error_log(__METHOD__.__LINE__.' Server:'.self::$icServerID.' Sieve Enabled:'.array2string($vacation));
|
||||||
if($vacation) {
|
|
||||||
|
if ($vacation && (!($isSieveError = egw_cache::getCache(egw_cache::INSTANCE, 'email',
|
||||||
|
'icServerSIEVE_connectionError'.trim($GLOBALS['egw_info']['user']['account_id']))) || !$isSieveError[self::$icServerID]))
|
||||||
|
{
|
||||||
$sieveServer = $this->mail_bo->icServer;
|
$sieveServer = $this->mail_bo->icServer;
|
||||||
//error_log(__METHOD__.__LINE__.' Sieve Server:'.self::$icServerID.' InstanceOf:'.array2string(($sieveServer instanceof defaultimap)|| ($sieveServer instanceof emailadmin_oldimap)).':'.array2string($sieveServerClass));
|
//error_log(__METHOD__.__LINE__.' Sieve Server:'.self::$icServerID.' InstanceOf:'.array2string(($sieveServer instanceof defaultimap)|| ($sieveServer instanceof emailadmin_oldimap)).':'.array2string($sieveServerClass));
|
||||||
$scriptName = (!empty($GLOBALS['egw_info']['user']['preferences']['mail']['sieveScriptName'])) ? $GLOBALS['egw_info']['user']['preferences']['mail']['sieveScriptName'] : 'felamimail';
|
try {
|
||||||
$sieveServer->getScript($scriptName);
|
$sieveServer->retrieveRules();
|
||||||
$rules = $sieveServer->retrieveRules($sieveServer->scriptName,true);
|
$vacation = $sieveServer->getVacation();
|
||||||
$vacation = $sieveServer->getVacation($sieveServer->scriptName);
|
}
|
||||||
$isSieveError = egw_cache::getCache(egw_cache::INSTANCE,'email','icServerSIEVE_connectionError'.trim($GLOBALS['egw_info']['user']['account_id']),$callback=null,$callback_params=array(),$expiration=60*15);
|
catch (Exception $e)
|
||||||
if ($isSieveError[self::$icServerID])
|
|
||||||
{
|
{
|
||||||
$vacation = false;
|
$vacation = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user