diff options
-rw-r--r-- | changes/bug_keep_watcher_in_memory | 1 | ||||
-rw-r--r-- | changes/bug_save_doc | 1 | ||||
-rw-r--r-- | src/leap/mx/mail_receiver.py | 11 |
3 files changed, 8 insertions, 5 deletions
diff --git a/changes/bug_keep_watcher_in_memory b/changes/bug_keep_watcher_in_memory new file mode 100644 index 0000000..4ac9541 --- /dev/null +++ b/changes/bug_keep_watcher_in_memory @@ -0,0 +1 @@ + o Keep file watcher in memory to prevent losing file events.
\ No newline at end of file diff --git a/changes/bug_save_doc b/changes/bug_save_doc new file mode 100644 index 0000000..287228a --- /dev/null +++ b/changes/bug_save_doc @@ -0,0 +1 @@ + o Properly save the incoming mail as a doc in couch.
\ No newline at end of file diff --git a/src/leap/mx/mail_receiver.py b/src/leap/mx/mail_receiver.py index 6f9b8a7..5875034 100644 --- a/src/leap/mx/mail_receiver.py +++ b/src/leap/mx/mail_receiver.py @@ -73,16 +73,16 @@ class MailReceiver(Service): Starts the MailReceiver service """ Service.startService(self) - wm = inotify.INotify() - wm.startReading() + self.wm = inotify.INotify() + self.wm.startReading() mask = inotify.IN_CREATE for directory, recursive in self._directories: log.msg("Watching %s --- Recursive: %s" % (directory, recursive)) - wm.watch(filepath.FilePath(directory), mask, - callbacks=[self._process_incoming_email], - recursive=recursive) + self.wm.watch(filepath.FilePath(directory), mask, + callbacks=[self._process_incoming_email], + recursive=recursive) def _gather_uuid_pubkey(self, results): if len(results) < 2: @@ -169,6 +169,7 @@ class MailReceiver(Service): uuid = 0 db = CouchDatabase(self._mail_couch_url, "user-%s" % (uuid,)) + db.put_doc(doc) log.msg("Done exporting") |