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 <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht 2017-06-12 00:18:53 +02:00
parent fc77de5af6
commit 05ff68c7e1

View File

@ -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