From 08f22be8ea6a7884d3348f385c8f77e093d20a2c Mon Sep 17 00:00:00 2001 From: Florian Friesdorf Date: Thu, 19 Jul 2007 17:52:29 +0100 Subject: [PATCH] completed: * fixes behaviour when changing flags, without corresp. rights (s,d,w) --- offlineimap/folder/IMAP.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index 0ab8892..9ed75ef 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -382,9 +382,13 @@ class IMAPFolder(BaseFolder): try: imapobj.select(self.getfullname()) except imapobj.readonly: - # unsure, whether this can be reached - UIBase.getglobalui().flagstoreadonly(self, uidlist, flags) - return + # Above we made sure, we have the necessary rights. + # Ugly hack, to prevent an unnecessary exception: + # readonly: mailbox status changed to READ-ONLY + # imaplib should take care of that itself. + # The connection is anyway released below, so we dont need to + # undo the hack. + imapobj.is_readonly = True r = imapobj.uid('store', imaputil.listjoin(uidlist), operation + 'FLAGS',