Initial code to deal with imap servers.