From 98981a6cf0847e609944d1cda0bbe0647e3253f4 Mon Sep 17 00:00:00 2001 From: jgoerzen Date: Sat, 6 Jul 2002 01:22:23 +0100 Subject: [PATCH] /head: changeset 84 Fixed read-only folders and UW flag case-sensitivity. Readied 2.0.4. --- head/ChangeLog | 20 ++++++++++++++++++++ head/TODO | 2 ++ head/debian/changelog | 8 ++++++++ head/offlineimap/folder/IMAP.py | 10 ++++++++-- head/offlineimap/imaputil.py | 12 ++++++------ head/offlineimap/repository/IMAP.py | 3 ++- 6 files changed, 46 insertions(+), 9 deletions(-) diff --git a/head/ChangeLog b/head/ChangeLog index 57fc458..b78550c 100644 --- a/head/ChangeLog +++ b/head/ChangeLog @@ -1,3 +1,23 @@ +2002-07-05 09:22 jgoerzen + + * TODO, debian/changelog, offlineimap/imaputil.py, + offlineimap/folder/IMAP.py, offlineimap/repository/IMAP.py: Fixed + read-only folders and UW flag case-sensitivity. Readied 2.0.4. + +2002-07-04 21:32 jgoerzen + + * offlineimap/version.py: Updated for 2.0.3 + +2002-07-04 20:46 jgoerzen + + * offlineimap.conf, offlineimap.py, debian/changelog, + offlineimap/imapserver.py, offlineimap/repository/IMAP.py: Modified + to allow specifying a reference + +2002-07-04 15:36 jgoerzen + + * ChangeLog: Built for 2.0.2 + 2002-07-04 15:36 jgoerzen * debian/changelog: Updated with tunnel feature diff --git a/head/TODO b/head/TODO index 2f1b9ba..38e852a 100644 --- a/head/TODO +++ b/head/TODO @@ -1,2 +1,4 @@ * Add an option to handle the network exception that results if a connection to the IMAP server fails, or there is another socket error. + +* Force unidirectional sync for read-only folders. \ No newline at end of file diff --git a/head/debian/changelog b/head/debian/changelog index e686142..0dc4701 100644 --- a/head/debian/changelog +++ b/head/debian/changelog @@ -1,3 +1,11 @@ +offlineimap (2.0.4) unstable; urgency=low + + * Made OfflineIMAP at least rudimentarily compatible with read-only + folders. It will still fail if they get modified locally, though. + * Flags are handled case-insensitively. Closes: #151993. + + -- John Goerzen Fri, 5 Jul 2002 09:10:29 -0500 + offlineimap (2.0.3) unstable; urgency=low * Added support for specifying references. Closes: #151960. diff --git a/head/offlineimap/folder/IMAP.py b/head/offlineimap/folder/IMAP.py index 1a007b5..17ff55c 100644 --- a/head/offlineimap/folder/IMAP.py +++ b/head/offlineimap/folder/IMAP.py @@ -55,7 +55,10 @@ class IMAPFolder(BaseFolder): def cachemessagelist(self): imapobj = self.imapserver.acquireconnection() try: - imapobj.select(self.getfullname()) + try: + imapobj.select(self.getfullname()) # Needed for fetch below + except imapobj.readonly: + pass self.messagelist = {} response = imapobj.status(self.getfullname(), '(MESSAGES)')[1][0] result = imaputil.imapsplit(response)[1] @@ -82,7 +85,10 @@ class IMAPFolder(BaseFolder): def getmessage(self, uid): imapobj = self.imapserver.acquireconnection() try: - imapobj.select(self.getfullname()) + try: + imapobj.select(self.getfullname()) + except imapobj.readonly: + pass return imapobj.uid('fetch', '%d' % uid, '(BODY.PEEK[])')[1][0][1].replace("\r\n", "\n") finally: self.imapserver.releaseconnection(imapobj) diff --git a/head/offlineimap/imaputil.py b/head/offlineimap/imaputil.py index 0a845db..5b73611 100644 --- a/head/offlineimap/imaputil.py +++ b/head/offlineimap/imaputil.py @@ -76,13 +76,13 @@ def imapsplit(string): return retval def flagsimap2maildir(string): - flagmap = {'\\Seen': 'S', - '\\Answered': 'R', - '\\Flagged': 'F', - '\\Deleted': 'T', - '\\Draft': 'D'} + flagmap = {'\\seen': 'S', + '\\answered': 'R', + '\\flagged': 'F', + '\\deleted': 'T', + '\\draft': 'D'} retval = [] - imapflaglist = flagsplit(string) + imapflaglist = [x.lower() for x in flagsplit(string)] for imapflag in imapflaglist: if flagmap.has_key(imapflag): retval.append(flagmap[imapflag]) diff --git a/head/offlineimap/repository/IMAP.py b/head/offlineimap/repository/IMAP.py index cef804e..be0ef8d 100644 --- a/head/offlineimap/repository/IMAP.py +++ b/head/offlineimap/repository/IMAP.py @@ -55,7 +55,8 @@ class IMAPRepository(BaseRepository): self.imapserver.releaseconnection(imapobj) for string in listresult: flags, delim, name = imaputil.imapsplit(string) - if '\\Noselect' in imaputil.flagsplit(flags): + flaglist = [x.lower() for x in imaputil.flagsplit(flags)] + if '\\noselect' in flaglist: continue foldername = imaputil.dequote(name) if not self.folderfilter(foldername):