[PATCH 8/8] Enable folderfiltering for MailDir repositories too

Sebastian Spaeth Sebastian at SSpaeth.de
Mon Aug 29 15:00:17 BST 2011


Currently we only filtered IMAP repositories, this patch enables filtering
for Maildir repositories too.

Signed-off-by: Sebastian Spaeth <Sebastian at SSpaeth.de>
---
 Changelog.draft.rst               |    1 +
 offlineimap/repository/Maildir.py |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/Changelog.draft.rst b/Changelog.draft.rst
index a116553..433d41c 100644
--- a/Changelog.draft.rst
+++ b/Changelog.draft.rst
@@ -28,6 +28,7 @@ Changes
 * Remove the configurability of the Blinkenlights statuschar. It
   cluttered the main configuration file for little gain.
 * Updated bundled imaplib2 to version 2.28.
+* Maildir repositories now also respond to folderfilter= configurations.
 
 Bug Fixes
 ---------
diff --git a/offlineimap/repository/Maildir.py b/offlineimap/repository/Maildir.py
index 6b0736b..10e61a1 100644
--- a/offlineimap/repository/Maildir.py
+++ b/offlineimap/repository/Maildir.py
@@ -175,6 +175,12 @@ class MaildirRepository(BaseRepository):
                                                            self,
                                                            self.accountname,
                                                            self.config))
+                # 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))
-- 
1.7.4.1





More information about the OfflineIMAP-project mailing list