From 3f33ca62d76986ab9471cf96e8e520f6ca4477df Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 13 Aug 2013 17:31:22 +0200 Subject: avoid logging dummy password --- mail/src/leap/mail/imap/service/imap.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mail/src') diff --git a/mail/src/leap/mail/imap/service/imap.py b/mail/src/leap/mail/imap/service/imap.py index a4ffed6..1a8c15c 100644 --- a/mail/src/leap/mail/imap/service/imap.py +++ b/mail/src/leap/mail/imap/service/imap.py @@ -17,6 +17,8 @@ """ Imap service initialization """ +from copy import copy + import logging logger = logging.getLogger(__name__) @@ -71,7 +73,13 @@ class LeapIMAPServer(imap4.IMAP4Server): #self.theAccount = theAccount def lineReceived(self, line): - log.msg('rcv: %s' % line) + if "login" in line: + # avoid to log the pass, even though we are using a dummy auth + # by now. + msg = line[:7] + " [...]" + else: + msg = copy(line) + log.msg('rcv: %s' % msg) imap4.IMAP4Server.lineReceived(self, line) def authenticateLogin(self, username, password): -- cgit v1.2.3 From 2e3dc39db27dfc024ff8953c2f1505a1d1914934 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 13 Aug 2013 17:32:09 +0200 Subject: catch uninitialized soledad attr --- mail/src/leap/mail/imap/server.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mail/src') diff --git a/mail/src/leap/mail/imap/server.py b/mail/src/leap/mail/imap/server.py index 813d850..51df86e 100644 --- a/mail/src/leap/mail/imap/server.py +++ b/mail/src/leap/mail/imap/server.py @@ -121,6 +121,9 @@ class IndexedDB(object): leap_assert_type(self.INDEXES, dict) # Ask the database for currently existing indexes. + if not self._soledad: + logger.debug("NO SOLEDAD ON IMAP INITIALIZATION") + return db_indexes = dict(self._soledad.list_indexes()) for name, expression in SoledadBackedAccount.INDEXES.items(): if name not in db_indexes: @@ -788,6 +791,7 @@ class LeapMessage(WithMsgFields): """ return self._doc.content.get(key, None) + class MessageCollection(WithMsgFields, IndexedDB): """ A collection of messages, surprisingly. -- cgit v1.2.3