Ouch - IMAP is complicated.