We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

ImapClient.ListMessages hangs and never returns

Hi,


I’m using Aspose.Email v5.2 (for .NET) to connect to the mail server using the ImapClient class.
I create a new instance like this:

ImageClient client = new ImageClient(“host”, “port”, “username”, “password”); // Port 993 because I’m using SSL
client.SecurityOptions = Aspose.Email.SecurityOptions.SSLImplicit;

After which I use the following code to get the list of messages:

protected const int MAX_EMAILS = 100;
ImapQueryBuilder imapBuilder = new ImapQueryBuilder();
imapBuilder.HasNoFlags(ImapMessageFlags.IsRead);
_query = imapBuilder.GetQuery();
ImapMessageInfoCollection messageInfos = client.ListMessages(_query, MAX_EMAILS); // This is to list the first 100 emails that are unread

Every now and then I get an exception from the mail server when I call the “client.ListMessages” method with the error message “003 NO Server Unavailable”.
After I get that exception, the program waits for 5 minutes and then it tries again to get the mailbox info (same call, client.ListMessages"). The 2nd time it tries, the mail server (for any reason) doesn’t respond at all. At that point, my program just hangs at the list “client.ListMessages” for hours and it never comes back.

I know I’m not using the latest version from Aspose.Email but this is the version I’ve deployed to the customer and the customer is experiencing this issue. I don’t want to tell them to upgrade to the latest and the problem to still not be fixed.
My question for you is if you guys have encountered this issue with your library where the ListMessages call never returns. If yes, is it fixed? if no, can you take a look at the library and see if there is a scenario where ListMessages would get in a state where it never returns if it doesn’t get a response from the mail server?

Thank you

Hi Corneliu,

Thank you for contacting Aspose Support team.

As mentioned by you as well, you are using quite an old version of the API and there have been a lot of changes after the version 5.2.0. Though we never faced such issue while using this old version as well, we can’t test it further to check if there some issue exists. Even if the issue exists, we can’t fix it unless it is reproduced with the latest version of the API.

We strongly recommend you to download the latest version of the API and test the same functionality at your end. If the issue is reproduced with the latest version of the API as well, we’ll need your sample code and server information to reproduce it at our end and assist you further. In that case, the issue will be resolved in one of the subsequent versions of the API.

Hello Kashif,


Thanks for the quick reply.
I was unable to produce the customer’s issue with their version of Aspose.Email and I think it’s very specific to their environment (the communication with the mail server and so on).
I looked through all the changelogs for each version > 5.2 to see if anything like that was fixed but I couldn’t find something specific to Imap and ListMessages hanging.
I understand your situation as well and we’ll try to reproduce it with version 6.3. If I’m able to reproduce it and provide you with a sample code, roughly how long will it take you guys to release a fix for it?
Thanks!

Hi Corneliu,

We usually do monthly releases at the start of every month. Resolution of an issue may depend on its complexity, but usually most of the issues are fixed in subsequent version. However, if the resolution involves some complexity, then it may take a little long for resolution (though not long enough). Please let us know once you are able to reproduce the problem at your end. We’ll look into it for assisting you further.

That sounds good.

Thanks a lot for your help!

You are welcome.