diff --git a/offlineimap.conf b/offlineimap.conf index 1958632..bdd622f 100644 --- a/offlineimap.conf +++ b/offlineimap.conf @@ -494,7 +494,8 @@ localfolders = ~/Test # example, finding messages older than 3 months), without parsing each # file/message content. # -# If enabled, this prevents the -q (quick mode) CLI option to work correctly. +# This option is not compatible with -q (quick mode) CLI option for GmailMaildir +# types. # # Default: no. # diff --git a/offlineimap/folder/Base.py b/offlineimap/folder/Base.py index 60cf431..7819616 100644 --- a/offlineimap/folder/Base.py +++ b/offlineimap/folder/Base.py @@ -123,10 +123,6 @@ class BaseFolder(object): Should be implemented only for folders that suggest threads.""" raise NotImplementedError - # XXX: we may need someting like supports_quickstatus() to check - # XXX: if user specifies 'quick' flag for folder that doesn't - # XXX: support quick status queries, so one believes that quick - # XXX: status checks will be done, but it won't really be so. def quickchanged(self, statusfolder): """ Runs quick check for folder changes and returns changed status: True -- changed, False -- not changed. diff --git a/offlineimap/folder/GmailMaildir.py b/offlineimap/folder/GmailMaildir.py index 71624a2..65626ea 100644 --- a/offlineimap/folder/GmailMaildir.py +++ b/offlineimap/folder/GmailMaildir.py @@ -1,5 +1,5 @@ # Maildir folder support with labels -# Copyright (C) 2002 - 2011 John Goerzen & contributors +# Copyright (C) 2002 - 2016 John Goerzen & contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,14 +17,14 @@ import os +import six from sys import exc_info + from .Maildir import MaildirFolder from offlineimap import OfflineImapError import offlineimap.accounts from offlineimap import imaputil -import six - class GmailMaildirFolder(MaildirFolder): """Folder implementation to support adding labels to messages in a Maildir. """ @@ -44,6 +44,10 @@ class GmailMaildirFolder(MaildirFolder): def quickchanged(self, statusfolder): """Returns True if the Maildir has changed. Checks uids, flags and mtimes""" + if self._utime_from_header is True: + raise Exception("GmailMaildir does not support quick mode" + " when 'utime_from_header' is enabled.") + self.cachemessagelist() # Folder has different uids than statusfolder => TRUE if sorted(self.getmessageuidlist()) != \ @@ -57,7 +61,7 @@ class GmailMaildirFolder(MaildirFolder): for (uid, message) in self.getmessagelist().items(): if message['mtime'] > statusfolder.getmessagemtime(uid): return True - return False #Nope, nothing changed + return False # Nope, nothing changed. # Interface from BaseFolder