summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-08-31 03:17:19 -0300
committerVictor Shyba <victor1984@riseup.net>2017-09-02 05:59:11 -0300
commit83f386ea7258e9ecb92c3d5dbcb09ed514f437b4 (patch)
tree7f1971f8ebab32293e43006874b3e13296c41baa /pkg
parent5b754b03d80be6b820350fdc7cbec3219077476b (diff)
[feature] add support for soledad incoming api
-- Related: #8664
Diffstat (limited to 'pkg')
-rw-r--r--pkg/mx.tac10
-rw-r--r--pkg/requirements-leap.pip1
2 files changed, 9 insertions, 2 deletions
diff --git a/pkg/mx.tac b/pkg/mx.tac
index 42d40a8..fe01a0e 100644
--- a/pkg/mx.tac
+++ b/pkg/mx.tac
@@ -21,6 +21,7 @@ import ConfigParser
from functools import partial
from leap.mx import couchdbhelper
+from leap.mx import soledadhelper
from leap.mx.mail_receiver import MailReceiver
from leap.mx.alias_resolver import AliasResolverFactory
from leap.mx.check_recipient_access import CheckRecipientAccessFactory
@@ -66,6 +67,11 @@ cdb = couchdbhelper.ConnectedCouchDB(server,
username=user,
password=password)
+incoming_api = False
+if config.has_section("incoming api"):
+ args = [config.get("incoming api", option) for option in ["host", "port", "token"]]
+ incoming_api = soledadhelper.SoledadIncomingAPI(*args)
+
application = service.Application("LEAP MX")
@@ -91,11 +97,11 @@ fingerprint_map.setServiceParent(application)
directories = []
for section in config.sections():
if section in ("couchdb", "alias map", "check recipient",
- "fingerprint map", "bounce"):
+ "fingerprint map", "bounce", "incoming api"):
continue
to_watch = config.get(section, "path")
recursive = config.getboolean(section, "recursive")
directories.append([to_watch, recursive])
-mr = MailReceiver(cdb, directories, bounce_from, bounce_subject)
+mr = MailReceiver(cdb, directories, bounce_from, bounce_subject, incoming_api)
mr.setServiceParent(application)
diff --git a/pkg/requirements-leap.pip b/pkg/requirements-leap.pip
index 1cfe861..da61bde 100644
--- a/pkg/requirements-leap.pip
+++ b/pkg/requirements-leap.pip
@@ -1,2 +1,3 @@
leap.common>=0.5.1
leap.soledad.common>=0.8.0
+treq