summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 0000000..137b7a3
--- /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 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.
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):