]> code.delx.au - offlineimap/commitdiff
/offlineimap/head: changeset 251
authorjgoerzen <jgoerzen>
Mon, 30 Sep 2002 20:47:05 +0000 (21:47 +0100)
committerjgoerzen <jgoerzen>
Mon, 30 Sep 2002 20:47:05 +0000 (21:47 +0100)
Checked in a work-around for IMAP servers that misbehave with LIST ""
""

offlineimap/head/offlineimap/imapserver.py

index 730fb4dac5c8b1d83b5ed2fc89713dacb8a21d2d..8c546c54d38c1fbb979bf834cd91632c55e816e9 100644 (file)
@@ -135,8 +135,13 @@ class IMAPServer:
             imapobj.login(self.username, self.password)
 
         if self.delim == None:
+            listres = imapobj.list(self.reference, '""')[1]
+            if listres == [None] or listres == None:
+                # Some buggy IMAP servers do not respond well to LIST "" ""
+                # Work around them.
+                listres = imapobj.list(self.reference, '"*"')[1]
             self.delim, self.root = \
-                        imaputil.imapsplit(imapobj.list(self.reference, '""')[1][0])[1:]
+                        imaputil.imapsplit(listres[0])[1:]
             self.delim = imaputil.dequote(self.delim)
             self.root = imaputil.dequote(self.root)