diff options
author | Kali Kaneko <kali@leap.se> | 2014-01-08 23:29:18 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2014-01-08 23:29:18 -0400 |
commit | f9a9a695526afea8eef4ccba8904fb215acc43dd (patch) | |
tree | 975be61ad66fc91e82e516351c5015d4286948a6 /src/leap/mail/imap/service | |
parent | c2cccbcd4225049b35ea2c7be4bbe899532136ca (diff) |
add a flag to be able to close the session
Diffstat (limited to 'src/leap/mail/imap/service')
-rw-r--r-- | src/leap/mail/imap/service/imap.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/leap/mail/imap/service/imap.py b/src/leap/mail/imap/service/imap.py index 234996d..dfd4862 100644 --- a/src/leap/mail/imap/service/imap.py +++ b/src/leap/mail/imap/service/imap.py @@ -71,15 +71,6 @@ class LeapIMAPServer(imap4.IMAP4Server): # populate the test account properly (and only once # per session) - # theAccount = SoledadBackedAccount( - # user, soledad=soledad) - - # --------------------------------- - # XXX pre-populate acct for tests!! - # populate_test_account(theAccount) - # --------------------------------- - #self.theAccount = theAccount - def lineReceived(self, line): """ Attempt to parse a single line from the server. @@ -88,6 +79,9 @@ class LeapIMAPServer(imap4.IMAP4Server): :type line: str """ print "RECV: STATE (%s)" % self.state + if self.theAccount.closed is True and self.state != "unauth": + log.msg("Closing the session. State: unauth") + self.state = "unauth" if "login" in line.lower(): # avoid to log the pass, even though we are using a dummy auth |