[PATCH] avoid removing of data when user removed a maildir

Łukasz Żarnowiecki dolohow at outlook.com
Mon Jun 20 21:41:37 BST 2016


On Fri, Jun 17, 2016 at 08:05:46PM +0200, Nicolas Sebrecht wrote:
> When a maildir is removed it must be considered new for the sync. However, the
> local cache of the folder remains. This means the sync of the folder removes all
> the missing emails.

I actually did that several times and I did not loose any emails.

> WARNING: I did NOT tested this specific use case. I'm confident the changes
> should work correctly. At least, this did not hurt my usual syncs.

I will try to verfiy that tomorrow.  Hope it will work as always ;)

> +    def purge(self):
> +        """Remove any pre-existing database."""
> +
> +        try:
> +            os.unlink(self.filename)
> +        except OSError:
> +            pass

Maybe it would be better to log that stuff with ui.debug?  You know,
just in case.

> +    def purge(self):
> +        """Remove any pre-existing database."""
> +
> +        try:
> +            os.unlink(self.filename)
> +        except OSError:
> +            pass

Code duplication, is there any way to put that in some common place?




More information about the OfflineIMAP-project mailing list