Posts Tagged ‘Outlook.com’

Outlook.com IMAP looses attachment contents on COPY

Friday, May 23rd, 2014

Outlook.com IMAP looses attachment contents on COPY operation.

Coping an email with an attachment on Outlook.com using IMAP works correct for small attachments:

C: 7554e85569d0465d UID COPY 100828 "Destination"
S: 7554e85569d0465d OK [COPYUID 43582022 100828 100003] COPY completed

With large attachments (~3MB), although COPY command succeeds:

C: 7734b17263a84259 UID COPY 100823 "Destination"
S: 7734b17263a84259 OK [COPYUID 43582022 100823 100001] COPY completed

All contents of the attachments are removed by the server:

------_=_NextPart_001_01CF7412.6651E594
Content-Type: image/jpeg; name="100557_1_DSC_0041 (2).jpg"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="100557_1_DSC_0041 (2).jpg"
MS-Blob-Excluded: messageId=7C7BA5A2-E006-11E3-94A8-2C59E5464128; blobId=0; encodedLength=2925184; resolveError=true; blobHash=F206EC6BB4B95BF30B1382C38A33C9BEC3DBFB4A

------_=_NextPart_001_01CF7412.6651E594--

After COPY operation email message is modified by the server:
attachment contents are removed (attachment must be large enough ~3MB)
– new MIME header: MS-Blob-Excluded is added to the MIME entity representing the attachment.

All IMAP clients are affected.

It seems that this behavior is coded-in on purpose, however it’s a bug and violation of the IMAP protocol.

It would be much wiser to fail on COPY command with appropriate error message, if for some reason (performance?) the operation would result in loosing data.

Outlook.com IMAP national characters ENVELOPE bug

Friday, September 27th, 2013

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

Outlook.com announces IMAP support

Friday, September 13th, 2013

We’re happy to announce that Microsoft finally added IMAP (and OAuth) support for Outlook.com (this includes @hotmail accounts). With yesterday’s announcement, Outlook has a richer email experience across devices and apps.

Here you can find Outlook.com settings.

Outlook: IMAP, POP3, and SMTP settings

Friday, December 14th, 2012

Outlook.com supports access via POP3 and SMTP protocols. Below you can find the configuration settings for those protocols.

All Outlook.com servers (POP3 and SMTP) use implicit SSL (use ConnectSSL method).
SMTP server also supports explicit SSL (you can use Connect method and then secure the channel using StartTLS method)

IMAP

Server: imap-mail.outlook.com
SSL: true-implicit
Port: 993 (default)
User: pat@outlook.com

POP3

Server: pop-mail.outlook.com
SSL: true-implicit
Port: 995 (default)
User: pat@outlook.com

POP access must be turned on via web interface.
In the web interface click “gear icon” in the top, right corner, then select “Options”.

Depending on the UI version:

On the options pane click “Mail/Accounts/POP and IMAP”. In the “POP options” section select “Yes”.

-or-

On the options pane click “Connect devices and apps with POP” link. In the “POP” section mark “Enable”.

SMTP

Server: smtp-mail.outlook.com
SSL: true-explicit
Port: 587 (default)
User: pat@outlook.com

Following are the code samples for Mail.dll .NET IMAP, POP3 and SMTP component.

// C#

using (Imap client = new Imap())
{
    client.ConnectSSL("imap-mail.outlook.com");
    client.UseBestLogin("pat@outlook.com", "password");
    ...
}

using (Pop3 client = new Pop3())
{
    client.ConnectSSL("pop-mail.outlook.com");
    client.UseBestLogin("pat@outlook.com", "password");
    ...
}

using (Smtp client = new Smtp ())
{
    client.Connect("smtp-mail.outlook.com");
    client.StartTLS();
    client.UseBestLogin("pat@outlook.com", "password");
    ...
}
' VB.NET

Using client As New Imap()
	client.ConnectSSL("imap-mail.outlook.com")
	client.UseBestLogin("pat@outlook.com", "password")
	...
End Using

Using client As New Pop3()
	client.ConnectSSL("pop3-mail.outlook.com")		
	client.UseBestLogin("pat@outlook.com", "password")
	...
End Using

Using client As New Smtp()
	client.ConnectSSL("smtp-mail.outlook.com")
	client.StartTLS();
	client.UseBestLogin("pat@outlook.com", "password")
	...
End Using