From 6e5fbebc0e5e6388cf03ce0f7267638081294b77 Mon Sep 17 00:00:00 2001 From: Vladimir Nesov Date: Fri, 17 Aug 2012 17:52:20 +0000 Subject: [PATCH] fix: createfolders setting is ignored if readonly is True If 'readonly' is True, folders shouldn't be created (regardless of 'createfolders' option). With old behavior, instead folders were always created when 'readonly' is True (even if 'createfolders' was also False), which is a serious bug (offlineimap was creating folders in all read-only repositories). 'createfolders' should only play a role if 'readonly' is False, in which case folders should only be created if 'createfolders' is True. Submitted-by: Vladimir Nesov Signed-off-by: Nicolas Sebrecht --- Changelog.rst | 1 + offlineimap/repository/Base.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changelog.rst b/Changelog.rst index 4b31f39..aa0d903 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -8,6 +8,7 @@ ChangeLog WIP (add new stuff for the next release) ======================================== +* Don't create folders if readonly is enabled. * Learn to deal with readonly folders to properly detect this condition and act accordingly. One example is Gmail's "Chats" folder that is read-only, but contains logs of the quick chats. (E. Ryabinkin) diff --git a/offlineimap/repository/Base.py b/offlineimap/repository/Base.py index 81050b0..febaf3f 100644 --- a/offlineimap/repository/Base.py +++ b/offlineimap/repository/Base.py @@ -134,7 +134,7 @@ class BaseRepository(CustomConfig.ConfigHelperMixin, object): It is disabled by either setting the whole repository 'readonly' or by using the 'createfolders' setting.""" - return self._readonly or self.getconfboolean('createfolders', True) + return (not self._readonly) and self.getconfboolean('createfolders', Tr def makefolder(self, foldername): """Create a new folder"""