summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/services/mail
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/services/mail')
-rw-r--r--src/leap/bitmask/services/mail/conductor.py13
-rw-r--r--src/leap/bitmask/services/mail/repair.py14
2 files changed, 19 insertions, 8 deletions
diff --git a/src/leap/bitmask/services/mail/conductor.py b/src/leap/bitmask/services/mail/conductor.py
index addf9bef..c16801d4 100644
--- a/src/leap/bitmask/services/mail/conductor.py
+++ b/src/leap/bitmask/services/mail/conductor.py
@@ -72,6 +72,8 @@ class IMAPControl(object):
"""
Starts imap service.
"""
+ from leap.bitmask.config import flags
+
logger.debug('Starting imap service')
leap_assert(sameProxiedObjects(self._soledad, None)
is not True,
@@ -81,12 +83,17 @@ class IMAPControl(object):
"We need a non-null keymanager for initializing imap "
"service")
+ offline = flags.OFFLINE
self.imap_service, self.imap_port, \
self.imap_factory = imap.start_imap_service(
self._soledad,
self._keymanager,
- userid=self.userid)
- self.imap_service.start_loop()
+ userid=self.userid,
+ offline=offline)
+
+ if offline is False:
+ logger.debug("Starting loop")
+ self.imap_service.start_loop()
def stop_imap_service(self):
"""
@@ -339,7 +346,7 @@ class MailConductor(IMAPControl, SMTPControl):
self._mail_machine = None
self._mail_connection = mail_connection.MailConnection()
- self.userid = None
+ self._userid = None
@property
def userid(self):
diff --git a/src/leap/bitmask/services/mail/repair.py b/src/leap/bitmask/services/mail/repair.py
index 30571adf..660e9f11 100644
--- a/src/leap/bitmask/services/mail/repair.py
+++ b/src/leap/bitmask/services/mail/repair.py
@@ -131,16 +131,20 @@ class MBOXPlumber(object):
Gets the user id for this account.
"""
print "Got authenticated."
- self.uid = self.srp.get_uid()
- if not self.uid:
- print "Got BAD UID from provider!"
+
+ # XXX this won't be needed anymore after we keep a local
+ # cache of user uuids, so we'll be able to pick it from
+ # there.
+ self.uuid = self.srp.get_uuid()
+ if not self.uuid:
+ print "Got BAD UUID from provider!"
return self.exit()
- print "UID: %s" % (self.uid)
+ print "UUID: %s" % (self.uuid)
secrets, localdb = get_db_paths(self.uid)
self.sol = initialize_soledad(
- self.uid, self.userid, self.passwd,
+ self.uuid, self.userid, self.passwd,
secrets, localdb, "/tmp", "/tmp")
self.acct = SoledadBackedAccount(self.userid, self.sol)