Needs to have a testing IMAP server (or something that speaks IMAP?) with a known dataset so as to test each of the exported functions. Will be necessary to provide some instrumentation to catch success of things like starttls, or switching from passthrough to commands and back again ... A medium sized project.