Implement RFC822 message fetching in imap client and RETR in pop3 server