/offlineimap/head: changeset 445

- Now checks that SELECT succeeded when entering a folder.

- Verifies that folders listed on folderincludes actually exist by
  trying to enter them. Thus, if they do not exist, they can be
  created on the first run.
This commit is contained in:
jgoerzen 2003-04-18 05:31:25 +01:00
parent ced2acc6cf
commit 79ab74a418
3 changed files with 17 additions and 5 deletions

View File

@ -4,6 +4,10 @@ offlineimap (3.99.13) unstable; urgency=low
* Fixed line-ending code to deal with files with mixed \n and \r\n
codes. This is a rare case, but now is more onerous because we now
have to find headers.
* Now checks that SELECT succeeded when entering a folder.
* Verifies that folders listed on folderincludes actually exist by trying
to enter them. Thus, if they do not exist, they can be created on the
first run.
-- John Goerzen <jgoerzen@complete.org> Thu, 17 Apr 2003 18:02:13 -0500

View File

@ -69,7 +69,7 @@ class IMAPFolder(BaseFolder):
try:
# Primes untagged_responses
imapobj.select(self.getfullname(), readonly = 1)
assert(imapobj.select(self.getfullname(), readonly = 1)[0] == 'OK')
try:
# Some mail servers do not return an EXISTS response if
# the folder is empty.

View File

@ -153,10 +153,18 @@ class IMAPRepository(BaseRepository):
retval.append(self.getfoldertype()(self.imapserver, foldername,
self.nametrans(foldername),
self.accountname, self))
for foldername in self.folderincludes:
retval.append(self.getfoldertype()(self.imapserver, foldername,
self.nametrans(foldername),
self.accountname, self))
if len(self.folderincludes):
imapobj = self.imapserver.acquireconnection()
try:
for foldername in self.folderincludes:
if imapobj.select(foldername, readonly = 1)[0] == 'OK':
retval.append(self.getfoldertype()(self.imapserver,
foldername,
self.nametrans(foldername),
self.accountname, self))
finally:
self.imapserver.releaseconnection(imapobj)
retval.sort(lambda x, y: self.foldersort(x.getvisiblename(), y.getvisiblename()))
self.folders = retval
return retval