From cabd8d1735b7fbf4762d27692d9dca2cb36963df Mon Sep 17 00:00:00 2001 From: John Goerzen Date: Tue, 4 Mar 2008 08:13:48 -0600 Subject: [PATCH] Revert "fix behaviour for delete/expunge, when lacking rights" This reverts commit c305d63e005c8ca1ae57f1ec54f023e0d0069824. Zak Smith reported it continued to be a problem --- offlineimap/folder/IMAP.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index 6836122..05edaf0 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -424,17 +424,12 @@ class IMAPFolder(BaseFolder): self.addmessagesflags_noconvert(uidlist, ['T']) imapobj = self.imapserver.acquireconnection() try: - # Making sure, that we have the necessary rights - # ensuring that we access readonly: python's braindead imaplib.py - # otherwise might raise an exception during the myrights() call - imapobj.select(self.getfullname(),readonly=1) - if not 'd' in imapobj.myrights(self.getfullname())[1][0].split()[1]: - # no delete/expunge rights + try: + imapobj.select(self.getfullname()) + except imapobj.readonly: UIBase.getglobalui().deletereadonly(self, uidlist) return - if self.expunge: - imapobj.select(self.getfullname()) assert(imapobj.expunge()[0] == 'OK') finally: self.imapserver.releaseconnection(imapobj)