mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-03 03:50:13 +01:00
Switch sieve from oldimap class to new imap
This commit is contained in:
parent
b25724e7ed
commit
1c31dad881
@ -57,21 +57,13 @@ class mail_sieve
|
||||
|
||||
function __construct()
|
||||
{
|
||||
|
||||
if(empty($GLOBALS['egw_info']['user']['preferences']['mail']['sieveScriptName']))
|
||||
{
|
||||
$GLOBALS['egw']->preferences->add('mail','sieveScriptName','felamimail', 'forced');
|
||||
$GLOBALS['egw']->preferences->save_repository();
|
||||
}
|
||||
$this->scriptName = (!empty($GLOBALS['egw_info']['user']['preferences']['mail']['sieveScriptName'])) ? $GLOBALS['egw_info']['user']['preferences']['mail']['sieveScriptName'] : 'felamimail' ;
|
||||
$this->displayCharset = $GLOBALS['egw']->translation->charset();
|
||||
$this->botranslation =& $GLOBALS['egw']->translation;
|
||||
$this->displayCharset = translation::charset();
|
||||
$profileID = 0;
|
||||
if (isset($GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID']))
|
||||
{
|
||||
$profileID = (int) $GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'];
|
||||
}
|
||||
$this->mailbo = mail_bo::getInstance(false, $profileID, false, $oldIMAPObject=true);
|
||||
$this->mailbo = mail_bo::getInstance(false, $profileID, false,false);
|
||||
|
||||
$this->mailPreferences =& $this->mailbo->mailPreferences;
|
||||
$this->mailConfig = config::read('mail');
|
||||
@ -80,19 +72,8 @@ class mail_sieve
|
||||
$this->currentIdentity = $allIdentities[$defaultIdentity];
|
||||
$this->currentIdentity['identity_string'] = mail_bo::generateIdentityString($allIdentities[$defaultIdentity],true);
|
||||
$this->restoreSessionData();
|
||||
$icServer = $this->mailbo->icServer;
|
||||
if(($icServer instanceof defaultimap) && $icServer->enableSieve)
|
||||
{
|
||||
$this->bosieve = $icServer;
|
||||
$serverclass = get_class($icServer);
|
||||
$classsupportstimedsieve = false;
|
||||
if (!empty($serverclass) && stripos(constant($serverclass . '::CAPABILITIES'), 'timedsieve') !== false)
|
||||
{
|
||||
$classsupportstimedsieve = true;
|
||||
}
|
||||
$this->timed_vacation = $classsupportstimedsieve && $icServer->enableCyrusAdmin &&
|
||||
$icServer->adminUsername && $icServer->adminPassword;
|
||||
}
|
||||
$this->bosieve = $this->mailbo->icServer;
|
||||
$this->timed_vacation = $this->bosieve->enableSieve && $this->bosieve->acc_imap_administration;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -468,10 +449,6 @@ class mail_sieve
|
||||
$defaultIdentity = $this->mailbo->getDefaultIdentity();
|
||||
foreach($allIdentities as &$singleIdentity)
|
||||
{
|
||||
if((empty($vacation))&& !empty($singleIdentity['ident_email']) && $singleIdentity['ident_email']==$allIdentities[$defaultIdentity]['ident_email'])
|
||||
{
|
||||
$selectedAddresses[$singleIdentity['ident_email']] = $singleIdentity['ident_email'];
|
||||
}
|
||||
$predefinedAddresses[$singleIdentity['ident_email']] = $singleIdentity['ident_email'];
|
||||
}
|
||||
asort($predefinedAddresses);
|
||||
@ -532,7 +509,6 @@ class mail_sieve
|
||||
//$this->timed_vacation=true;//this could force the timed vacation thingy even if not supported ;-)
|
||||
if ($this->timed_vacation)
|
||||
{
|
||||
include_once(EGW_API_INC.'/class.jscalendar.inc.php');
|
||||
$ByDate = array('by_date' => lang('By date'));
|
||||
}
|
||||
if (!is_array($content))
|
||||
|
@ -2456,10 +2456,8 @@ unset($query['actions']);
|
||||
$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));
|
||||
if($vacation) {
|
||||
$sieveServerClass = mail_bo::getInstance(false, self::$icServerID, false, $oldIMAPObject=true);
|
||||
$sieveServer = $sieveServerClass->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));
|
||||
if(($sieveServer instanceof defaultimap) || ($sieveServer instanceof emailadmin_oldimap)) {
|
||||
$scriptName = (!empty($GLOBALS['egw_info']['user']['preferences']['mail']['sieveScriptName'])) ? $GLOBALS['egw_info']['user']['preferences']['mail']['sieveScriptName'] : 'felamimail';
|
||||
$sieveServer->getScript($scriptName);
|
||||
$rules = $sieveServer->retrieveRules($sieveServer->scriptName,true);
|
||||
@ -2471,7 +2469,6 @@ unset($query['actions']);
|
||||
}
|
||||
}
|
||||
//error_log(__METHOD__.__LINE__.' Server:'.self::$icServerID.' Vacation retrieved:'.array2string($vacation));
|
||||
}
|
||||
return $vacation;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user