Do a select on a mailbox with the readonly parameter == True is not a good idea if you are going to make changes inside this mailbox (like a store command)
Go back to passwords stored in session. This time, we use pycrypto to encrypt passwords using the AES algorithm.
http://www.dlitz.net/software/pycrypto/
IMAP connections are now refreshed.