Outlook.com IMAP national characters ENVELOPE bug

Summary

Outlook.com IMAP implementation does not work correctly with messages containing national characters. ENVELOPE retrieved for a message, that has national characters in the subject (correctly encoded using Base64), has ‘?’ characters instead of encoded characters.

Actual:
ENVELOPE ("Fri, 27 Sep 2013 17:59:48 +0200" "za????"

Expected:
ENVELOPE ("Fri, 27 Sep 2013 18:23:23 +0200" "=?utf-8?B?emHFvMOzxYLEhw==?=" ...
-or-
ENVELOPE ("Fri, 27 Sep 2013 18:21:17 +0200" "=?ISO-8859-2?B?emG/87Pm?=" ...

Logs

Mail.dll C: 6d9d6c00b9294efb APPEND Inbox (\SEEN) {243}
Mail.dll S: + Ready
Mail.dll C: Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
Subject: =?utf-8?B?emHFvMOzxYLEhw==?=
Message-ID:
Date: Fri, 27 Sep 2013 17:59:48 +0200

Hello
Mail.dll S: 6d9d6c00b9294efb OK APPEND completed
Mail.dll C: 0a55ca5702664b94 UID FETCH 100065 (UID RFC822.SIZE INTERNALDATE FLAGS ENVELOPE BODYSTRUCTURE)
Mail.dll S: * 3 FETCH (UID 100065 RFC822.SIZE 290 FLAGS (\Seen) INTERNALDATE "27-Sep-2013 15:59:44 +0000" ENVELOPE ("Fri, 27 Sep 2013 17:59:48 +0200" "za????" NIL NIL NIL NIL NIL NIL NIL "") BODYSTRUCTURE ("TEXT" "plain" ("charset" "utf-8") NIL NIL "7BIT" 5 1 NIL NIL NIL NIL))
Mail.dll S: 0a55ca5702664b94 OK FETCH Completed

Workaround

You can workaround this issue, requesting subject header explicitly or downloading all headers (using GetHeadersByUID):

var eml = client.GetSpecificHeadersByUID(uploaded, new[]{"subject"}).EmlData;
string subject = new MailBuilder().CreateFromEml(eml).Subject;

Although slower, correct data is returned:


66496df367914917 UID FETCH 100078 (UID BODY[HEADER.FIELDS (SUBJECT)])
Mail.dll: 13 19:38:29 S: * 7 FETCH (UID 100078 BODY[HEADER.FIELDS ("SUBJECT")] {41}
Mail.dll: 13 19:38:30 S: Subject: =?utf-8?B?emHFvMOzxYLEhw==?=

Mail.dll: 13 19:38:30 S: )
Mail.dll: 13 19:38:30 S: 66496df367914917 OK FETCH Completed

Tags:   

Questions?

Consider using our Q&A forum for asking questions.