decode the result from imap server