Adapt the code to work with the new imaplib2

imaplib renamed self.sslobj to self.sock and our overriden open()
functions were failing for that reason when updating imaplib2 to
v2.28. It turns out that all of our custom initializations are being
done by stock imaplib2 now anyway, so there is no need to override them
anymore. This lets us simplify the code we have to worry about.

Move the verifycert() function to the imapserver.py file, it is now a
callback function that is being handed to imaplib from there, so it
makes sense to also define it in our imapserver function...
(this also lets us easily make use of the verifycert function in the
starttls case in the future)

TODO: we need to examine if and why we still need to override the
select() function, it is the only reason why we still wrap the IMAP4
classes.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Sebastian Spaeth
2011-08-15 11:55:42 +02:00
committed by Nicolas Sebrecht
parent 1c0c19ad86
commit 3a91e296f0
3 changed files with 55 additions and 154 deletions

View File

@ -23,6 +23,8 @@ Changes
* Refactor our IMAPServer class. Background work without user-visible
changes.
* Updated bundled imaplib2 to version 2.28
Bug Fixes
---------