IMAP optimization
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 4 Dec 2008 19:49:01 +0000 (12:49 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 4 Dec 2008 21:29:06 +0000 (14:29 -0700)
imp/imp-dimp.php

index e86c257..51ce218 100644 (file)
@@ -155,6 +155,12 @@ ob_start();
 
 $result = false;
 
+/* We know we are going to be exclusively dealing with this mailbox, so
+ * select it on the IMAP server (saves some STATUS calls). */
+if ($folder && !$imp_search->isSearchMbox($folder)) {
+    $imp_imap->ob->openMailbox($folder);
+}
+
 switch ($action) {
 case 'CreateFolder':
 case 'CreateSubfolder':