From 05ff68c7e1c0dfed865c642588e253b77f6ebc07 Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Mon, 12 Jun 2017 00:18:53 +0200 Subject: [PATCH] IMAP/IMAP: continue to sync if the local side does not return a valid UID on upload There's no reason we should abort the full sync. Github-ref: https://github.com/OfflineIMAP/offlineimap/issues/479 Tested-by: https://github.com/secomi Signed-off-by: Nicolas Sebrecht --- offlineimap/folder/UIDMaps.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/offlineimap/folder/UIDMaps.py b/offlineimap/folder/UIDMaps.py index 9e9d712..48d1e96 100644 --- a/offlineimap/folder/UIDMaps.py +++ b/offlineimap/folder/UIDMaps.py @@ -267,8 +267,12 @@ class MappedIMAPFolder(IMAPFolder): newluid = self._mb.savemessage(-1, content, flags, rtime) if newluid < 1: - raise ValueError("Backend could not find uid for message, " - "returned %s"% newluid) + raise OfflineImapError("server of repository '%s' did not return " + "a valid UID (got '%s') for UID '%s' from '%s'"% ( + self._mb.getname(), newluid, uid, self.getname() + ), + OfflineImapError.ERROR.MESSAGE + ) with self.maplock: self.diskl2r[newluid] = uid self.diskr2l[uid] = newluid