summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-10-19 06:35:29 +0000
committeralecpl <alec@alec.pl>2011-10-19 06:35:29 +0000
commita561cd35b8eb4c91e634a590774b8d18ed5b8a4a (patch)
tree49ff5bcc9a161e5a86752abe76618225bb643e6e
parent01169b6d5626d5a5bef20e43d86a5605a66ccdf0 (diff)
- Fix handling of folder creation error while moving/copying message
-rw-r--r--program/include/rcube_imap.php20
1 files changed, 14 insertions, 6 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index c35c877e6..c07b39883 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -2586,10 +2586,14 @@ class rcube_imap
// make sure mailbox exists
if ($to_mbox != 'INBOX' && !$this->mailbox_exists($to_mbox)) {
- if (in_array($to_mbox, $this->default_folders))
- $this->create_mailbox($to_mbox, true);
- else
+ if (in_array($to_mbox, $this->default_folders)) {
+ if (!$this->create_mailbox($to_mbox, true)) {
+ return false;
+ }
+ }
+ else {
return false;
+ }
}
$config = rcmail::get_instance()->config;
@@ -2667,10 +2671,14 @@ class rcube_imap
// make sure mailbox exists
if ($to_mbox != 'INBOX' && !$this->mailbox_exists($to_mbox)) {
- if (in_array($to_mbox, $this->default_folders))
- $this->create_mailbox($to_mbox, true);
- else
+ if (in_array($to_mbox, $this->default_folders)) {
+ if (!$this->create_mailbox($to_mbox, true)) {
+ return false;
+ }
+ }
+ else {
return false;
+ }
}
// copy messages