diff --git a/Changelog.draft.rst b/Changelog.draft.rst index cfbd1b9..679ccef 100644 --- a/Changelog.draft.rst +++ b/Changelog.draft.rst @@ -19,6 +19,9 @@ New Features Changes ------- +* Slight performance enhancement uploading mails to an IMAP server in the + common case. + Bug Fixes --------- diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index 6f4cf92..3dbcaa8 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -567,10 +567,6 @@ class IMAPFolder(BaseFolder): "failed (error). Server reponded: %s\nMessage content was: " "%s" % (self, self.getrepository(), str(e), dbg_output), OfflineImapError.ERROR.MESSAGE) - # Checkpoint. Let it write out stuff, etc. Eg searches for - # just uploaded messages won't work if we don't do this. - typ, dat = imapobj.check() - assert(typ == 'OK') # get the new UID, default to 0 (=unknown) uid = 0 @@ -587,6 +583,11 @@ class IMAPFolder(BaseFolder): else: # Don't support UIDPLUS + # Checkpoint. Let it write out stuff, etc. Eg searches for + # just uploaded messages won't work if we don't do this. + typ, dat = imapobj.check() + assert(typ == 'OK') + uid = self.savemessage_searchforheader(imapobj, headername, headervalue) # If everything failed up to here, search the message