trim addresses used in sieve vacation rules; introduce the cleaning of another cache object

This commit is contained in:
Klaus Leithoff 2012-07-27 09:35:54 +00:00
parent 46be0018df
commit 32842953f4
2 changed files with 10 additions and 4 deletions

View File

@ -589,6 +589,12 @@ class emailadmin_bo extends so_sql
unset($structure[$_profileID]);
egw_cache::setCache(egw_cache::INSTANCE,'email','structureCache'.trim($GLOBALS['egw_info']['user']['account_id']),$structure, $expiration=60*60*1);
}
$rawHeadersCache = egw_cache::getCache(egw_cache::INSTANCE,'email','rawHeadersCache'.trim($GLOBALS['egw_info']['user']['account_id']),$callback=null,$callback_params=array(),$expiration=60*60*1);
if (isset($rawHeadersCache[$_profileID]))
{
unset($rawHeadersCache[$_profileID]);
egw_cache::setCache(egw_cache::INSTANCE,'email','rawHeadersCache'.trim($GLOBALS['egw_info']['user']['account_id']),$rawHeadersCache, $expiration=60*60*1);
}
//reset folderObject cache, to trigger reload
felamimail_bo::resetFolderObjectCache($_profileID);
//reset counter of deleted messages per folder

View File

@ -384,11 +384,11 @@ class emailadmin_script {
if (trim($vacation['forwards'])) {
$if = array();
foreach($vacation['addresses'] as $addr) {
$if[] = 'address :contains ["To","TO","Cc","CC"] "'.$addr.'"';
$if[] = 'address :contains ["To","TO","Cc","CC"] "'.trim($addr).'"';
}
$newscriptbody .= 'if anyof ('.implode(', ',$if).") {\n";
foreach(preg_split('/, ?/',$vacation['forwards']) as $addr) {
$newscriptbody .= "\tredirect \"".$addr."\";\n";
$newscriptbody .= "\tredirect \"".trim($addr)."\";\n";
}
$newscriptbody .= "\tkeep;\n}\n";
}
@ -397,7 +397,7 @@ class emailadmin_script {
$first = 1;
foreach ($vacation['addresses'] as $vaddress) {
if (!$first) $newscriptbody .= ", ";
$newscriptbody .= "\"" . $vaddress . "\"";
$newscriptbody .= "\"" . trim($vaddress) . "\"";
$first = 0;
}
$message = $vacation['text'];
@ -510,7 +510,7 @@ class emailadmin_script {
$first = 1;
foreach ($vacation['addresses'] as $address) {
if (!$first) $newscriptfoot .= ", ";
$newscriptfoot .= "\"" . $address . "\"";
$newscriptfoot .= "\"" . trim($address) . "\"";
$first = 0;
}