diff 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
line wrap: on
line diff
--- a/src/plugins/plugin_misc_imap.py	Mon Jan 07 23:54:17 2013 +0100
+++ b/src/plugins/plugin_misc_imap.py	Tue Jan 08 00:46:38 2013 +0100
@@ -426,11 +426,10 @@
         profiles = self.host.memory.getProfilesList()
         if not credentials.username in profiles:
             return defer.fail(cred_error.UnauthorizedLogin())
-        password = self.host.memory.getParamA("Password", "Connection", profile_key=credentials.username)
-        return defer.maybeDeferred(
-            credentials.checkPassword,
-            password).addCallback(
-            self._cbPasswordMatch, credentials.username)
+        d = self.host.memory.asyncGetParamA("Password", "Connection", profile_key=credentials.username)
+        d.addCallback(lambda password: credentials.checkPassword(password))
+        d.addCallback(self._cbPasswordMatch, credentials.username)
+        return d
 
 class ImapServerFactory(protocol.ServerFactory):
     protocol = imap4.IMAP4Server