Commits

Renato Cunha committed 680c172

Added Maildir support.

  • Participants
  • Parent commits 516268e

Comments (0)

Files changed (1)

     def debug(self, ui):
         pass
 
+class maildirsource(object):
+    def __init__(self, name, path):
+        self.name = name
+        self.path = path
+
+    def getmessages(self, ui):
+        box = mailbox.Maildir(self.path, factory=None, create=False)
+        for msg in box:
+            yield msg
+
+    def debug(self, ui):
+        pass
+
 class imapsource(object):
     def __init__(self, name, server, user, password, mailbox):
         self.name = name
     types = {
         'imap': (imapsource, ('server', 'username', 'password', 'mailbox')),
         'mbox': (mboxsource, ('path',)),
+        'maildir': (maildirsource, ('path',)),
         }
     seen = set()
     for key, value in ui.configitems("mbox"):