diff --git a/mail/inc/class.mail_sieve.inc.php b/mail/inc/class.mail_sieve.inc.php index 3471906609..54a531b03a 100644 --- a/mail/inc/class.mail_sieve.inc.php +++ b/mail/inc/class.mail_sieve.inc.php @@ -620,6 +620,8 @@ class mail_sieve { self::setAsyncJob($newVacation); } + //Reset vacationNotice cache which is used in mail_ui get_rows + egw_cache::unsetCache(egw_cache::INSTANCE,'email', 'vacationNotice'+$icServer->acc_id); $msg = lang('Vacation notice sucessfully updated.'); } } diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 789dd469a0..b0096c1410 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -2296,8 +2296,20 @@ class mail_ui $sieveServer = $this->mail_bo->icServer; try { - $sieveServer->retrieveRules(); - $vacation = $sieveServer->getVacation(); + //Get vacation from cache if it's available + $vacationCached = egw_cache::getCache(egw_cache::INSTANCE, 'email', 'vacationNotice'+$sieveServer->acc_id); + + if (!$vacationCached) + { + $sieveServer->retrieveRules(); + $vacation = $sieveServer->getVacation(); + // Set vacation to the instance cache for particular account + egw_cache::setCache(egw_cache::INSTANCE, 'email', 'vacationNotice'+$sieveServer->acc_id, $vacation); + } + else + { + return $vacationCached; + } } catch (PEAR_Exception $ex) { $this->callWizard($ex->getMessage()); }