summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-08-13 12:39:40 -0300
committerTomás Touceda <chiiph@leap.se>2013-08-13 12:39:40 -0300
commit7cf45f776fcf1d4d401a2fa55d034d2ddffd3591 (patch)
tree855826dc33a9324abf2732ba7405f3e8b1e18fab /mail
parent162e0e2e10bfaf26a5b3414c57790bd063401373 (diff)
parent2e3dc39db27dfc024ff8953c2f1505a1d1914934 (diff)
Merge remote-tracking branch 'kali/bug/3416_do_not_log_pass' into develop
Diffstat (limited to 'mail')
-rw-r--r--mail/changes/bug_3416-do-not-log-pass1
-rw-r--r--mail/src/leap/mail/imap/server.py4
-rw-r--r--mail/src/leap/mail/imap/service/imap.py10
3 files changed, 14 insertions, 1 deletions
diff --git a/mail/changes/bug_3416-do-not-log-pass b/mail/changes/bug_3416-do-not-log-pass
new file mode 100644
index 00000000..137b7a3c
--- /dev/null
+++ b/mail/changes/bug_3416-do-not-log-pass
@@ -0,0 +1 @@
+ o Avoid logging dummy password on imap server. Closes: #3416
diff --git a/mail/src/leap/mail/imap/server.py b/mail/src/leap/mail/imap/server.py
index 813d8503..51df86eb 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.
diff --git a/mail/src/leap/mail/imap/service/imap.py b/mail/src/leap/mail/imap/service/imap.py
index a4ffed6c..1a8c15cf 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):