From 7d34060217ba7ea0577d9140abf21b49f13a4413 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Mon, 29 Aug 2011 15:09:16 +0200 Subject: [PATCH] Enable folderfiltering for MailDir repositories too Currently we only filtered IMAP repositories, this patch enables filtering for Maildir repositories too. Signed-off-by: Sebastian Spaeth --- Changelog.draft.rst | 2 ++ offlineimap/repository/Maildir.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/Changelog.draft.rst b/Changelog.draft.rst index 632586b..f83735f 100644 --- a/Changelog.draft.rst +++ b/Changelog.draft.rst @@ -29,6 +29,8 @@ Changes * Documentation improvements concerning 'restoreatime' and some code cleanup +* Maildir repositories now also respond to folderfilter= configurations. + Bug Fixes --------- diff --git a/offlineimap/repository/Maildir.py b/offlineimap/repository/Maildir.py index afdfb76..7c3bb1e 100644 --- a/offlineimap/repository/Maildir.py +++ b/offlineimap/repository/Maildir.py @@ -173,6 +173,12 @@ class MaildirRepository(BaseRepository): foldername, self.getsep(), self)) + # filter out the folder? + if not self.folderfilter(foldername): + self.debug("Filtering out '%s'[%s] due to folderfilt" + "er" % (foldername, self)) + retval[-1].sync_this = False + if self.getsep() == '/' and dirname != '': # Recursively check sub-directories for folders too. retval.extend(self._getfolders_scandir(root, foldername))