the baked in imap library for python made me weep, this is my attempt to improve it