summaryrefslogtreecommitdiff
path: root/src/leap/mail/imap
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-02-19 00:58:17 -0400
committerIvan Alejandro <ivanalejandro0@gmail.com>2015-02-20 17:35:29 -0300
commit1a0c34b145f0dfc1ea34d3670d93b4a0ce9ae4db (patch)
treecaf2c259b766649621b5ddec83dd18f75e10407a /src/leap/mail/imap
parent68e28e1590fcddf4937afd9de340542aff8c6868 (diff)
change environment variable for mail config
Diffstat (limited to 'src/leap/mail/imap')
-rw-r--r--src/leap/mail/imap/service/imap-server.tac38
1 files changed, 10 insertions, 28 deletions
diff --git a/src/leap/mail/imap/service/imap-server.tac b/src/leap/mail/imap/service/imap-server.tac
index 651f71b..49a29b1 100644
--- a/src/leap/mail/imap/service/imap-server.tac
+++ b/src/leap/mail/imap/service/imap-server.tac
@@ -23,9 +23,9 @@ For now, and for debugging/testing purposes, you need
to pass a config file with the following structure:
[leap_mail]
-userid = "user@provider"
-uuid = "deadbeefdeadabad"
-passwd = "supersecret" # optional, will get prompted if not found.
+userid = 'user@provider'
+uuid = 'deadbeefdeadabad'
+passwd = 'supersecret' # optional, will get prompted if not found.
"""
import ConfigParser
import getpass
@@ -53,38 +53,17 @@ def initialize_soledad(uuid, email, passwd,
:param tempdir: path to temporal dir
:rtype: Soledad instance
"""
- # XXX TODO unify with an authoritative source of mocks
- # for soledad (or partial initializations).
- # This is copied from the imap tests.
-
server_url = "http://provider"
cert_file = ""
- class Mock(object):
- def __init__(self, return_value=None):
- self._return = return_value
-
- def __call__(self, *args, **kwargs):
- return self._return
-
- class MockSharedDB(object):
-
- get_doc = Mock()
- put_doc = Mock()
- lock = Mock(return_value=('atoken', 300))
- unlock = Mock(return_value=True)
-
- def __call__(self):
- return self
-
- Soledad._shared_db = MockSharedDB()
soledad = Soledad(
uuid,
passwd,
secrets,
localdb,
server_url,
- cert_file)
+ cert_file,
+ syncable=False)
return soledad
@@ -95,9 +74,9 @@ def initialize_soledad(uuid, email, passwd,
print "[+] Running LEAP IMAP Service"
-bmconf = os.environ.get("LEAP_MAIL_CONF", "")
+bmconf = os.environ.get("LEAP_MAIL_CONFIG", "")
if not bmconf:
- print ("[-] Please set LEAP_MAIL_CONF environment variable "
+ print ("[-] Please set LEAP_MAIL_CONFIG environment variable "
"pointing to your config.")
sys.exit(1)
@@ -131,6 +110,7 @@ tempdir = "/tmp/"
# Ad-hoc soledad/keymanager initialization.
+print "[~] user:", userid
soledad = initialize_soledad(uuid, userid, passwd, secrets,
localdb, gnupg_home, tempdir)
km_args = (userid, "https://localhost", soledad)
@@ -144,6 +124,8 @@ km_kwargs = {
}
keymanager = KeyManager(*km_args, **km_kwargs)
+# XXX Do we need to wait until keymanager is properly initialized?
+
##################################################
# Ok, let's expose the application object for the twistd application