fix imap import for Python 3