Bug/unappreciated behaviour: missing e-mail headers

When I use the FetchMessage() method on the Aspose.Network.Exchange.ExchangeWebServiceClient class (verison 6.4) I don’t get the same e-mail headers as I get when using the Microsoft.Exchange.WebServices.Data.ExchangeService class.<?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” />

Aspose code:

ExchangeWebServiceClient client = new ExchangeWebServiceClient(
https://ourexchange.ourdomain.com/EWS/Exchange.asmx”, “username”, “password”, “domain”);

ExchangeMessageInfoCollection msgCollection = client.ListMessages(client.MailboxInfo.InboxUri);

if (msgCollection.Count < 1)

return;

var msgInfo = msgCollection.Take(1).Single();

var mail = client.FetchMessage(msgInfo.UniqueUri);

TextWriter tw = new StreamWriter(@“C:\temp\AsposeNetwork6-4Output.txt”);

foreach (var header in mail.Headers.AllKeys)

{

tw.WriteLine(string.Format("{0}: {1}", header, mail.Headers[header]));

}

tw.Close();

Aspose output:

Received: from puff.ourdomain.com (111.111.111.111) by rsbgchs01.ourdomain.com (222.222.222.222) with Microsoft SMTP Server (TLS) id 8.3.137.0; Mon, 9 May 2011 10:50:02 +0200,from mail1.ourdomain.com (Not Verified[111.123.19.7]) by puff.ourdomain.com with MailMarshal (v6,8,2,9371) (using TLS: SSLv23) id ; Mon, 09 May 2011 10:49:58 +0200,from TSWWW01 (tswww01.test.ourdomain.com [111.123.18.3]) by mail1.ourdomain.com (8.13.1/8.13.1) with ESMTP id p498o2Dg023910 for <test.servicedesk@ourdomain.com>; Mon, 9 May 2011 10:50:02 +0200

Content-Class: urn:content-classes:message

Thread-Topic: Övrigt

Thread-Index: AcwOJhYMEx7sw0dPQV6aln1hdRvchQ==

Accept-Language: en-US

Content-Language: en-US

X-MS-Exchange-Organization-AuthAs: Anonymous

X-MS-Exchange-Organization-AuthSource: rsbgchs01.ourdomain.com

X-MS-Has-Attach:

X-MS-TNEF-Correlator:

received-spf: Pass (domain ourdomain.com designates 111.123.19.7 as a permitted sender), client-ip=<111.123.19.7>; identity=; helo=;

Content-Type: text/plain; charset=“iso-8859-1”

Content-Transfer-Encoding: quoted-printable

MIME-Version: 1.0

Microsoft code:

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);

service.Credentials = new WebCredentials(“username”, “password”, “domain”);

service.Url = new Uri("https://ourexchange.ourdomain.com/EWS/Exchange.asmx");

var itemList = service.FindItems(WellKnownFolderName.Inbox, new ItemView(1));

if (itemList.TotalCount < 1)

return;

service.LoadPropertiesForItems(itemList, PropertySet.FirstClassProperties);

var mail = itemList.Take(1).Single();

var test = mail as EmailMessage;

TextWriter tw = new StreamWriter(@“C:\temp\MSExchangeManagedApiOutput.txt”);

foreach (var header in mail.InternetMessageHeaders)

{

tw.WriteLine(string.Format("{0}: {1}", header.Name, header.Value));

}

tw.Close();

Microsoft output:

Received: from puff.ourdomain.com (111.111.111.111) by rsbgchs01.ourdomain.com (172.23.1.94) with Microsoft SMTP Server (TLS) id 8.3.137.0; Mon, 9 May 2011 10:50:02 +0200

Received: from mail1.ourdomain.com (Not Verified[111.123.19.7]) by puff.ourdomain.com with MailMarshal (v6,8,2,9371) (using TLS: SSLv23) id ; Mon, 09 May 2011 10:49:58 +0200

Received: from TSWWW01 (tswww01.test.ourdomain.com [111.123.18.3]) by mail1.ourdomain.com (8.13.1/8.13.1) with ESMTP id p498o2Dg023910 for <test.servicedesk@ourdomain.com>; Mon, 9 May 2011 10:50:02 +0200

Received-SPF: Pass (domain ourdomain.com designates 111.123.18.3 as a permitted sender), client-ip=<111.123.19.7>; identity=<firstname.lastname@ourdomain.com>; helo=;

Message-ID: <201105090850.p498o2Dg023910@mail1.ourdomain.com>

X-SVS-Username: Bcc0KDE

X-SVS-SSN: 445001059

MIME-Version: 1.0

Date: Mon, 9 May 2011 10:50:02 +0200

Subject: Övrigt

Content-Type: text/plain

Content-Transfer-Encoding: quoted-printable

Return-Path: firstname.lastname@ourdomain.com

As you can see from the above output the two custom headers X-SVS-Username and X-SVS-SSN are missing when using the Aspose API. Is this an expected behavior/by design? Is there anything I can do about it within your current API? Do you have any plans on changing this behavior? I would prefer not to have to use a mix of API’s to handle our e-mails with custom headers.

Hi Peter,

Thank you for inquiry.

Could you please post a sample message in MSG format here for our reference? Please use MS Outlook to save the sample message with custom headers. You may post here or zip/send me via email using the “Contact” --> “send saqib.razzaq an email” button on this thread.

Ideally, the headers should come with the email using the Aspose API. We will check and fix if we find any problems.

Hello Peter,

Thanks for sending the sample file. I have reproduce the issue at my end and also logged this bug (ID: 27064) in our defect database. We will look into it and will inform you here when it gets fixed. Sorry for the inconvenience.

The issues you have found earlier (filed as 27064) have been fixed in [this update ](http://www.aspose.com/community/files/51/.net-components/aspose.network-for-.net/entry307168.aspx).

This message was posted using Notification2Forum from Downloads module by aspose.notifier.