summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/backend
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-12-16 15:33:25 -0400
committerKali Kaneko <kali@leap.se>2015-12-18 11:20:21 -0400
commit7b80dd1fca9828331f3327c418913539a3a303c0 (patch)
treecc4e73f25cecb2d286fcbb12b664f2eb42f12e76 /src/leap/bitmask/backend
parent98384361a7c49ad4e0ff0127fd923a8b72cc910a (diff)
[feat] adapt to use cred-based authentication for smtp
Diffstat (limited to 'src/leap/bitmask/backend')
-rw-r--r--src/leap/bitmask/backend/components.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/leap/bitmask/backend/components.py b/src/leap/bitmask/backend/components.py
index a07d3bad..e93ca19f 100644
--- a/src/leap/bitmask/backend/components.py
+++ b/src/leap/bitmask/backend/components.py
@@ -797,16 +797,19 @@ class Soledad(object):
def _set_service_tokens_cb(self, result):
- def register_imap_token(imap_token):
- self._service_tokens['imap'] = imap_token
+ def register_service_token(token, service):
+ self._service_tokens[service] = token
if self._signaler is not None:
self._signaler.signal(
self._signaler.soledad_got_service_token,
- ('imap', imap_token))
+ (service, token))
sol = self._soledad_bootstrapper.soledad
d = sol.get_or_create_service_token('imap')
- d.addCallback(register_imap_token)
+ d.addCallback(register_service_token, 'imap')
+ d.addCallback(
+ lambda _: sol.get_or_create_service_token('smtp'))
+ d.addCallback(register_service_token, 'smtp')
d.addCallback(lambda _: result)
return d
@@ -1035,7 +1038,8 @@ class Mail(object):
"""
return threads.deferToThread(
self._smtp_bootstrapper.start_smtp_service,
- self._keymanager_proxy, full_user_id, download_if_needed)
+ self._soledad_proxy, self._keymanager_proxy, full_user_id,
+ download_if_needed)
def start_imap_service(self, full_user_id, offline=False):
"""