From: Jan Schneider Date: Thu, 23 Sep 2010 11:13:26 +0000 (+0200) Subject: Don't try to check status of non-existant mailboxes. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=89e97a82e73bb02772e04d76c48ed56eb013e140;p=horde.git Don't try to check status of non-existant mailboxes. --- diff --git a/imp/compose-mimp.php b/imp/compose-mimp.php index 432452ca6..0cd9fdc58 100644 --- a/imp/compose-mimp.php +++ b/imp/compose-mimp.php @@ -66,9 +66,11 @@ $sent_mail_folder = $identity->getValue('sent_mail_folder'); $readonly_drafts = false; $imp_imap = $injector->getInstance('IMP_Imap')->getOb(); if (!empty($draft)) { - $readonly_drafts = $imp_imap->isReadOnly(IMP::folderPref($draft, true)); + $draft = IMP::folderPref($draft, true); + $readonly_drafts = $imp_folder->exists($draft) && + $imp_imap->isReadOnly($draft); } -$save_sent_mail = $imp_imap->isReadOnly($sent_mail_folder) +$save_sent_mail = ($imp_folder->exists($sent_mail_folder) && $imp_imap->isReadOnly($sent_mail_folder)) ? false : $prefs->getValue('save_sent_mail'); diff --git a/imp/compose.php b/imp/compose.php index bb948a723..328bd84d0 100644 --- a/imp/compose.php +++ b/imp/compose.php @@ -97,13 +97,17 @@ if ($vars->compose_formToken) { $compose_disable = !IMP::canCompose(); /* Determine if mailboxes are readonly. */ +$imp_folder = $injector->getInstance('IMP_Folder'); $readonly_drafts = $readonly_sentmail = false; $draft = $prefs->getValue('drafts_folder'); $imp_imap = $injector->getInstance('IMP_Imap')->getOb(); if (!empty($draft)) { - $readonly_drafts = $imp_imap->isReadOnly(IMP::folderPref($draft, true)); + $draft = IMP::folderPref($draft, true); + $readonly_drafts = $imp_folder->exists($draft) && + $imp_imap->isReadOnly($draft); } -$readonly_sentmail = $imp_imap->isReadOnly($sent_mail_folder); +$readonly_sentmail = $imp_folder->exists($sent_mail_folder) && + $imp_imap->isReadOnly($sent_mail_folder); if ($readonly_sentmail) { $save_sent_mail = false; }