mirror of IMAPclient: https://bitbucket.org/mjs0/imapclient