From 63fbd4395bd38048c22f4459cb16163157c6efe6 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 9 Apr 2013 11:24:33 +0000 Subject: [PATCH] * eMail: handle not checked keep local copy on message forward when no mailaddress is set; make clear not keeping a copy means: FORWARD ONLY for the mailbox in question --- felamimail/inc/class.felamimail_activesync.inc.php | 11 ++++++----- felamimail/inc/class.uipreferences.inc.php | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/felamimail/inc/class.felamimail_activesync.inc.php b/felamimail/inc/class.felamimail_activesync.inc.php index 2fd522491c..9011fe2530 100644 --- a/felamimail/inc/class.felamimail_activesync.inc.php +++ b/felamimail/inc/class.felamimail_activesync.inc.php @@ -315,10 +315,11 @@ class felamimail_activesync implements activesync_plugin_write, activesync_plugi if (empty($waitOnFailure[self::$profileID])) $waitOnFailure[self::$profileID] = array('howlong'=>$this->waitOnFailureDefault,'lastattempt'=>$hereandnow); if ($connectionFailed) { - error_log(__METHOD__.__LINE__."($account) could not open connection!".$this->mail->getErrorMessage()); - //error_log(date('Y-m-d H:i:s').' '.__METHOD__.__LINE__."($account) can not open connection!".$this->mail->getErrorMessage()."\n",3,'/var/lib/egroupware/esync-imap.log'); - //error_log('# Instance='.$GLOBALS['egw_info']['user']['domain'].', User='.$GLOBALS['egw_info']['user']['account_lid'].', URL='. - // ($_SERVER['HTTPS']?'https://':'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."\n\n",3,'/var/lib/egroupware/esync-imap.log'); + //error_log(__METHOD__.__LINE__."($account) could not open connection!".$this->mail->getErrorMessage()); + error_log(date('Y-m-d H:i:s').' '.__METHOD__.__LINE__."($account) can not open connection!".$this->mail->getErrorMessage()."\n",3,'/var/lib/egroupware/esync-imap.log'); + error_log("# Can not open connection for Profile:".self::$profileID.' Device should wait '.array2string($waitOnFailure[self::$profileID])."\n",3,'/var/lib/egroupware/esync-imap.log'); + error_log('# Instance='.$GLOBALS['egw_info']['user']['domain'].', User='.$GLOBALS['egw_info']['user']['account_lid'].', URL='. + ($_SERVER['HTTPS']?'https://':'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."\n\n",3,'/var/lib/egroupware/esync-imap.log'); if ($waitOnFailure[self::$profileID]['howlong'] > $this->waitOnFailureLimit ) { header("HTTP/1.1 500 Internal Server Error"); @@ -326,7 +327,7 @@ class felamimail_activesync implements activesync_plugin_write, activesync_plugi } else { - error_log(__METHOD__.__LINE__.'# Instance='.$GLOBALS['egw_info']['user']['domain'].', User='.$GLOBALS['egw_info']['user']['account_lid']." Can not open connection for Profile:".self::$profileID.' Device should wait '.array2string($waitOnFailure[self::$profileID])); + //error_log(__METHOD__.__LINE__.'# Instance='.$GLOBALS['egw_info']['user']['domain'].', User='.$GLOBALS['egw_info']['user']['account_lid']." Can not open connection for Profile:".self::$profileID.' Device should wait '.array2string($waitOnFailure[self::$profileID])); header("HTTP/1.1 503 Service Unavailable"); header("Retry-After: ".$waitOnFailure[self::$profileID]['howlong']); $waitOnFailure[self::$profileID] = array('howlong'=>$waitOnFailure[self::$profileID]['howlong'] * 2,'lastattempt'=>$hereandnow); diff --git a/felamimail/inc/class.uipreferences.inc.php b/felamimail/inc/class.uipreferences.inc.php index 8e8b4e2cd6..531467c81d 100644 --- a/felamimail/inc/class.uipreferences.inc.php +++ b/felamimail/inc/class.uipreferences.inc.php @@ -226,7 +226,7 @@ //_debug_array($_POST);_debug_array($_POST);_debug_array($_POST); $fwdAddr = (!empty($_POST['forwardingAddress'])?explode(';',$_POST['forwardingAddress']):array()); foreach($fwdAddr as $k => &$fA) $fwA = trim($fwA); - $ogServer->saveSMTPForwarding($GLOBALS['egw_info']['user']['account_id'],$fwdAddr,$_POST['keepLocalCopy']); + $ogServer->saveSMTPForwarding($GLOBALS['egw_info']['user']['account_id'],$fwdAddr,($fwdAddr?$_POST['keepLocalCopy']:true)); } elseif($_POST['cancel']) { ExecMethod('felamimail.uifelamimail.viewMainScreen'); return; @@ -878,9 +878,9 @@ $this->t->set_var('lang_setrecursively',lANG('apply recursively?')); $this->t->set_var('lang_Overview',lang('Overview')); $this->t->set_var('lang_edit_forwarding_address',lang('edit email forwarding address')); - $this->t->set_var('lang_forwarding_address',lang('email forwarding address')); + $this->t->set_var('lang_forwarding_address',''.lang('email forwarding address').''); $this->t->set_var('lang_accomplish_multiple_forwardaddresses',lang('multiple email forwarding addresses can be accomplished by separating them with a semicolon')); - $this->t->set_var('lang_keep_local_copy',lang('keep local copy of email')); + $this->t->set_var('lang_keep_local_copy',''.lang('keep local copy of email').'
'.lang('Note:').lang('if you choose NOT to keep a copy, you are setting your mailbox to FORWARD ONLY!')); $this->t->set_var('hostname_address',lang('hostname / address')); $this->t->set_var('lang_username',lang('username')); $this->t->set_var('lang_password',lang('password'));