On Sun, Mar 06, 2016 at 09:32:47PM +0200, Ilias Tsitsimpis wrote: > I tried to find a way for this to automatically happen when OfflineIMAP > detects that the user is upgrading from an older version (just like the > LocalStatus cache is upgraded) but the only think that came into my mind > is to accept both FMD5 values as valid. > > If anyone has any better idea, I would be happy to try and implement it.
Comments follow. I think the current logic is uselessly complex.... -- %< -- Signed-off-by: Nicolas Sebrecht <nicolas.s-...@laposte.net> --- offlineimap/folder/Maildir.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/offlineimap/folder/Maildir.py b/offlineimap/folder/Maildir.py index 77a774b..1546a2f 100644 --- a/offlineimap/folder/Maildir.py +++ b/offlineimap/folder/Maildir.py @@ -129,6 +129,13 @@ class MaildirFolder(BaseFolder): foldermatch = folderstr in filename # If there was no folder MD5 specified, or if it mismatches, # assume it is a foreign (new) message and ret: uid, fmd5 = None, None + + # XXX: This is wrong behaviour: if FMD5 is missing or mismatches, assume + # the mail is new and **fix UID to None** to avoid any conflict. + + # XXX: If UID is missing, I have no idea what FMD5 can do. Should be + # fixed to None in this case, too. + if foldermatch: uidmatch = re_uidmatch.search(filename) if uidmatch: -- 2.6.0