More work on imap and message info gathering