summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2013-09-06 16:44:41 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2013-09-06 16:44:41 -0300
commit5c336e674b6227365514f14fa37ed85be328d868 (patch)
tree1982736945dcaae12edbd37d1209d9ae08c270ae
parent4aa75432e244268893a90f6c1ef3dfa78c916c6c (diff)
parentbf74c7720808ae4a0a94ea80439bea08e1441acd (diff)
Merge branch 'release-0.3.2'
-rw-r--r--CHANGELOG5
-rw-r--r--src/leap/mx/mail_receiver.py13
2 files changed, 13 insertions, 5 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 543604f..fcc216e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,8 @@
+0.3.2 Sep 6:
+ o Keep file watcher in memory to prevent losing file events.
+ o Properly save the incoming mail as a doc in couch.
+ o Properly parse mail address of the form "Name <user@domain>". Fixes #3653.
+
0.3.1 Aug 23:
o Migrate mx functions to work on the new couchdb structure and
views. Fixes #3502.
diff --git a/src/leap/mx/mail_receiver.py b/src/leap/mx/mail_receiver.py
index 77e7cf4..5875034 100644
--- a/src/leap/mx/mail_receiver.py
+++ b/src/leap/mx/mail_receiver.py
@@ -24,6 +24,7 @@ import os
import uuid as pyuuid
import json
+import email.utils
from email import message_from_string
@@ -72,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:
@@ -168,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")
@@ -218,6 +220,7 @@ class MailReceiver(Service):
"Delivered-To: field")
log.msg("Mail owner: %s" % (owner,))
+ owner = email.utils.parseaddr(owner)[1]
log.msg("%s received a new mail" % (owner,))
dpubk = self._users_cdb.getPubKey(owner)
duuid = self._users_cdb.queryByAddress(owner)