accounts: handle OfflineImapError severity FOLDER

Throw an OfflineImapError when SELECTing a folder is unsuccessful and
bail out with a FOLDER serverity. In accounts.py catch all
OfflineImapErrors and either just log the error and skip the folder or
bubble it up if it's severe.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Sebastian Spaeth
2011-05-07 18:39:13 +02:00
committed by Nicolas Sebrecht
parent dd82f213f0
commit b3a383d151
3 changed files with 22 additions and 3 deletions

View File

@ -43,9 +43,13 @@ class IMAPFolder(BaseFolder):
def selectro(self, imapobj):
"""Select this folder when we do not need write access.
Prefer SELECT to EXAMINE if we can, since some servers
(Courier) do not stabilize UID validity until the folder is
selected."""
selected.
.. todo: Still valid? Needs verification
:returns: raises :exc:`OfflineImapError` severity FOLDER on error"""
try:
imapobj.select(self.getfullname())
except imapobj.readonly: