handle lack of INBOX more gracefully in IMAP
authoradam <adam@megacz.com>
Tue, 17 Aug 2004 23:15:17 +0000 (23:15 +0000)
committeradam <adam@megacz.com>
Tue, 17 Aug 2004 23:15:17 +0000 (23:15 +0000)
darcs-hash:20040817231517-5007d-5c33089967de4335d330952ded99b9df47a9ce38.gz

src/org/ibex/mail/protocol/IMAP.java

index 45ff1dc..d418ca5 100644 (file)
@@ -120,6 +120,7 @@ public class IMAP {
             String[] children = (start.length() == 0 ? root : mailbox(start, false)).children();
             for(int i=0; i<children.length; i++) {
                 String s = children[i], pre = ref, kid = start + (start.length() > 0 ? sep+"" : "") + s;                
+                if (mailbox(kid, false) == null) continue;
                 boolean phantom = mailbox(kid, false).phantom();
                 while(true) {
                     if (pre.length() == 0) {
@@ -157,7 +158,7 @@ public class IMAP {
             Account account = null;
             if ((account = auth.login(u,p)) == null) throw new No("Login failed.");
             root = account.getMailbox(IMAP.class);
-            inbox = mailbox("INBOX", false);  // FEATURE: ??
+            inbox = root.slash("INBOX", false);
             if (inbox == null) inbox = root;
         }
         public void unselect() { selected = null; }