[PATCH] problem upgrading from offlineimap 6.3.4 to 6.6.1

Nicolas Sebrecht nicolas.s-dev at laposte.net
Wed Mar 9 09:49:45 GMT 2016


On Sun, Mar 06, 2016 at 10:11:54PM +0100, Nicolas Sebrecht wrote:

> Comments follow. I think the current logic is uselessly complex....
> 
> -- %< --
> 
> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev at 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.

The more I think about those 15 lines of code, the more I think this
_parse_filename() method is critical to avoid data loss and UID
conflicts.

The name of this method is a bit lying around. It's from there it's
later decided if the file is considered new mail or not (whether UID is
None).

> +
>          if foldermatch:
>              uidmatch = re_uidmatch.search(filename)
>              if uidmatch:

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list