comparison src/plugins/plugin_misc_imap.py @ 574:89f9a50ce7bf

core, plugin imap, plugin smtp: fixed SMTP/IMAP integration. /!\ Profile need to be connected for IMAP server to work (will change in the future)
author Goffi <goffi@goffi.org>
date Tue, 08 Jan 2013 00:46:38 +0100
parents 2a072735e459
children 952322b1d490
comparison
equal deleted inserted replaced
573:db7a03a33612 574:89f9a50ce7bf
424 424
425 def requestAvatarId(self, credentials): 425 def requestAvatarId(self, credentials):
426 profiles = self.host.memory.getProfilesList() 426 profiles = self.host.memory.getProfilesList()
427 if not credentials.username in profiles: 427 if not credentials.username in profiles:
428 return defer.fail(cred_error.UnauthorizedLogin()) 428 return defer.fail(cred_error.UnauthorizedLogin())
429 password = self.host.memory.getParamA("Password", "Connection", profile_key=credentials.username) 429 d = self.host.memory.asyncGetParamA("Password", "Connection", profile_key=credentials.username)
430 return defer.maybeDeferred( 430 d.addCallback(lambda password: credentials.checkPassword(password))
431 credentials.checkPassword, 431 d.addCallback(self._cbPasswordMatch, credentials.username)
432 password).addCallback( 432 return d
433 self._cbPasswordMatch, credentials.username)
434 433
435 class ImapServerFactory(protocol.ServerFactory): 434 class ImapServerFactory(protocol.ServerFactory):
436 protocol = imap4.IMAP4Server 435 protocol = imap4.IMAP4Server
437 436
438 def __init__(self, host): 437 def __init__(self, host):