client.ListMessages from exchange 2010 with date query

Hello



My program is like this and I get a return of 0 message in a large mailbox when use together with query







Dim client As IEWSClient = EWSClient.GetEWSClient(vServerName, vUsename, vPassword, vDomain)



Dim builder As ExchangeQueryBuilder = New ExchangeQueryBuilder()





builder.InternalDate.Since(DateTime.Now.AddDays(-25))





Dim query As MailQuery = builder.GetQuery()



Dim messages As ExchangeMessageInfoCollection = client.ListMessages(client.MailboxInfo.InboxUri, query, false)



Response.Write(“messages: " & messages.Count & " message(s) found.
”)





I get no messages return but I know that there are messages in the last 25 days





The program does return messages if I change the line



Dim messages As ExchangeMessageInfoCollection = client.ListMessages(client.MailboxInfo.InboxUri, query, false)



To



Dim messages As ExchangeMessageInfoCollection = client.ListMessages(client.MailboxInfo.InboxUri )



I am using the Apose.email.dll file version 4.2.0.0, product version 2014.05.29

Hi Tuong,


Thank you for contacting Aspose support team.

I have tested your code with my Exchange account credentials and am afraid to share that it worked fine as it returned me the correct number of mails since last 25 days. Following line was used in testing.

Dim messages As ExchangeMessageInfoCollection = client.ListMessages(client.MailboxInfo.InboxUri, query, False)

For further investigation, I would request you to please provide us the temporary account on this server along with the credentials of this test account which you may block once the testing is done. It will help us to analyze the problem and provide assistance as soon as possible.

Hi Kashif,



Sorry to mis-explain in the previous post



On a large mail box such as Journaling mailbox where the last 25 days will return 5000 items



This is where the query has bug and return 0 item



On a small mail box such as my mail box. I have to use the last 2 years (expected the last 2 year has 3000 item)



The listmessage command return 0 item on my mailbox for the last 2 years but my mailbox has has 3000 items in the last 2 year



I notice the following command also return messages



Dim messages As ExchangeMessageInfoCollection = client.ListMessages(client.MailboxInfo.InboxUri)



Dim messages As ExchangeMessageInfoCollection = client.ListMessages(client.MailboxInfo.InboxUri, 5000)

Hi Tuong,


I have tested the scenario using my account and retrieved messages by using following commands:
  1. ExchangeMessageInfoCollection messages = client.ListMessages(client.MailboxInfo.InboxUri, query, false);
    2. ExchangeMessageInfoCollection messages = client.ListMessages(client.MailboxInfo.InboxUri, query, true);
    3. ExchangeMessageInfoCollection messages = client.ListMessages(client.MailboxInfo.InboxUri);

All the three commands returned me messages between 12000 to 12300 depending upon arguments to the ListMessages.

It seems some specific issue and needs further investigation using your test account. Could you please provide some test account where dummy messages are added and credentials are shared temporarily with us? It will help us to re-produce scenario here and provide assistance as soon as possible.

Hi Kashiif


Below is the code I use

I will PM you the Credential





Dim license As Aspose.Email.License = New Aspose.Email.License()

license.SetLicense(“Aspose.Email.lic”)

Dim vServerName as String = “Tobesentin the private message”

Dim vUsename as String = “Tobesentin the private message”

Dim vPassword as String = “Tobesentin the private message”

Dim vDomain as String = “Tobesentin the private message”







Dim client As IEWSClient = EWSClient.GetEWSClient(vServerName, vUsename, vPassword, vDomain)



Dim vTimeStart as Date = DateTime.Now()

Dim vTimeEnd as Date



Dim builder As ExchangeQueryBuilder = New ExchangeQueryBuilder()

'builder.InternalDate.Before(DateTime.Now.AddDays(1))

builder.InternalDate.Since(DateTime.Now.AddDays(-5))



'builder.SentDate.Since(DateTime.Now.AddDays(-5))





Dim query As Aspose.Email.MailQuery = builder.GetQuery()



Dim messages As ExchangeMessageInfoCollection = client.ListMessages(client.MailboxInfo.InboxUri, query, false) ’ This line return no messages

'Dim messages As ExchangeMessageInfoCollection = client.ListMessages(client.MailboxInfo.InboxUri) ’ This line returns 8187 messages







Response.Write(“messages: " & messages.Count() & " message(s) found.
”)

Hi Tuong,


I have tested your account credentials but am afraid to share that I could not connect to the server through browser and using the code as well. Could you please re-confirm if the server mailbox uri is working or not? I will share my findings as soon as I get connected to the server.

We are sorry for any inconvenience caused to you.

Hi Kashis,

Can you please try it again

https://cov-ex01.coverforce.com.au/ews/Exchange.asmx
is now resolved correctly from external

Sorry

Hi Tuong,


Thank you for sharing the information.

I was able to reproduce this issue at my end using the latest version of Aspose.Email for .NET 4.2.0 and have logged it as NETWORKNET-34414 in our issue tracking system for further investigation by our development team. Once there is any information available in this regard, we’ll update you here via this thread here.

We are sorry for the inconvenience caused to you.

Hi Tuong,

Our development team can’t access the test account you have shared. Could you please renew the test account so that we can further investigate the issue and solve the problem if any. We’ll be thankful for your cooperation in this regard.

Please try again with the same credential



Can you please also send us the IP address you are going to access from



Hi Tuong,

The account credentials are working fine now. For our testing, we don’t use any static IP and the testing is carried out from different accounts. We’ll work further with our investigation now and update you here once there is some update available in this regard.

The issues you have found earlier (filed as NETWORKNET-34414) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.