quite a big refactor of the imap stuff to have a test mode and to work only on unseen messages