Mailbox size checking, a few todos, and an imap bug fix