ImapException when connecting the second time

Hi,

I have a Windows Service which purpose is to connect to a bunch of mailboxes via Imap (mostly located on the same server). The service checks each mailbox every 10 seconds or so.

All seems to work the first time a connect is made, but the second time I get this exception:

Aspose.Email.Imap.ImapException: Command failure.

at .‡.(„ , Boolean , String )

at .‡.‰(„ )

at .„.‰()

at ..‚‡(String , Int32 )

at ..‚‡(String , Int32 )

at Aspose.Email.Imap.ImapClient.‚‡()

at Aspose.Email.Imap.ImapClient.Connect(Boolean autologin)

at eTrayMailService.EmailUtilities.Aspose.AsposeImapClient.Connect() in C:\Dev\Company\SrcC\Product\MailService\MailService\EmailUtilities\Aspose\AsposeImapClient.cs:line 60.

I am disconnecting and disposing after each cycle in the service, but still I get the error.

Any ideas?

EDIT:

I should probably add that I’m experincing the same problem when connecting to both Exchange Server 2003 and Exchange Server 2007. I use Aspose.Email.dll version 1.9.0.0.

/Andreas

Hi Andreas,


We are sorry for your trouble and inconvenience.

We are currently looking into your said issue and we will shortly update you here regarding our analysis of the issue.

Thanks in advance for your patience.

Hi Andreas,


Thank you for your patience.

I have evaluated your scenario on my end with Exchange Server 2003 and 2010. I am afraid, I am unable to see the problem as discussed in your original post. Please note, I have used the simplest code to periodically connect with exchange using ImapClient, list messages and then disconnect.

I would request you to please provide us your code snippet for our review. It would be of great help, if you can provide us a sample application that could reproduce the problem on our end.

Thanks and Regards,

Hi,

Thank you for your reply.

I have attached a sample project in which I experience the error everytime. The application looks for mails in a given mailbox folder, prints the subject and moves the mail to a given target mailbox folder. This test application resembles our windows service setup very closely.

Insert your imap server address, username, password, select folder (ect. inbox), target folder (ect. inbox/moved) into the app.config. Keep feeding the application mails, and it will eventually fail.

/AndreasK

Hi Andreas,


Thank you for your patience.

I have reported your said issue to the development team under the ticket NETWORKNET-33364. I have also attached the same ticket to your request for tracking purposes. We will look into the matter very soon, and we will keep you posted with updates on this.

Please be patient and spare us little time to fully analyse the problem on our end.

Regards,

Many thanks. Im looking forward to hear from you.

/AndreasK

Hi Babar,

Any ETA on this one?

/AndreasK

Hi AndreasK,


We are sorry for the delayed response and the inconvenience you have to face.

I am afraid that the ticket associated with this thread is pending for analysis and is in the queue. I have also noticed that the development team has scheduled this ticket for v2.1.0 of Aspose.Email for .NET component. Please note that v2.1.0 will be released in the first quarter of the following month (September 2012).

I have also escalated the priority of the ticket and requested the development team to analyze the issue at earliest. As soon as I receive further news, I will post here for your kind reference.

Regards,

That sounds good. Thank you :)

/AndreasK

Hi AndreasK,


It is to inform you that we have tried on our end to reproduce the said issue with Exchange Server and Gmail’s Imap Server. Unfortunately, we are unable to observe the issue, even though we have tried you provided sample code with different versions of .NET Framework.

We have also closely inspected your provided sample application and it appears to be thread safe. Only thing which arouse suspicion is ‘Dispose’ method being invoked in the loop. But error doesn’t arise in this case as well. In general, it may raise error in the real code if dispose is used in the loop, but it depends on a concrete situation. Therefore to look further into this matter, we will require your Imap server address, credentials and folder settings. This will greatly help us in moving forward to fix the issue after identifying the problem cause. If you cannot share the original email account details, then we would request you to please create a test account and move some messages that could raise the exception while using your provided sample application.

Thank you for understanding.
Regards,