From f04d607e2bb167c2ca2d1bc6f19aeea5ac7c8598 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 18 Feb 2014 15:22:25 +0000 Subject: [PATCH] harden copyMessages against failure by copying to/from existing but not listed (listMailboxes) folders --- mail/inc/class.mail_bo.inc.php | 8 ++++---- mail/inc/class.mail_ui.inc.php | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mail/inc/class.mail_bo.inc.php b/mail/inc/class.mail_bo.inc.php index 3af89e19ba..a5b0389add 100644 --- a/mail/inc/class.mail_bo.inc.php +++ b/mail/inc/class.mail_bo.inc.php @@ -3062,8 +3062,8 @@ class mail_bo { $sourceFolder = $this->icServer->getMailbox($sourceFolder); $target = emailadmin_account::read($_targetProfileID)->imapServer(); - $_foldername = $target->getMailbox($_foldername); - //error_log(__METHOD__.__LINE__.' Sourceserver:'.$this->icServer->ImapServerId.' TargetServer:'.$_targetProfileID.' TargetFolderObject:'.array2string($_foldername)); + $foldername = $target->getMailbox($_foldername); + //error_log(__METHOD__.__LINE__.' Sourceserver:'.$this->icServer->ImapServerId.' TargetServer:'.$_targetProfileID.' TargetFolderObject:'.array2string($foldername)); $uidsToFetch = new Horde_Imap_Client_Ids(); $uidsToFetch->add($_messageUID); @@ -3085,7 +3085,7 @@ class mail_bo $dataNflags[] = array('data'=>array(array('t'=>'text','v'=>"$body")), 'flags'=>$flags); if ($c==5) { - $ret = $target->append($_foldername,$dataNflags); + $ret = $target->append($foldername,$dataNflags); $retUid->add($ret); unset($dataNflags); time_nanosleep(0,500000);// sleep 500 miliseconds @@ -3094,7 +3094,7 @@ class mail_bo } if (isset($dataNflags)) { - $ret = $target->append($_foldername,$dataNflags); + $ret = $target->append($foldername,$dataNflags); $retUid->add($ret); unset($dataNflags); } diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index c3fb79703b..d9f5adedef 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -4245,6 +4245,7 @@ blockquote[type=cite] { } catch (Exception $e) { + //error_log(__METHOD__.__LINE__.function_backtrace()); $response->call('egw_message',$e->getMessage(),"error"); } }