0 votes
by (160 points)
edited

Hello We use imap library and encountered the following error:

Rebex.Net.ImapException: System error (Failure) (NO).
   at Rebex.Net.Imap.BboyfsZ(String , ImapResponse , Boolean )
   at Rebex.Net.Imap.SelectFolder(String folder, Boolean readOnly)
...
Conditions:
Server: Gmail
Error status: 'ProtocolError'
ConnectionState: connected
ConnectionState.NativeErrorCode: '0'
Client.State: 'Ready'
SelectedFolder: 'Inbox'
Application: ASP.NET

The error occurs not constantly. The code check for a new messages once a minute.

Also right after the error occured we can't do anything through imap as we get:

   System.InvalidOperationException: No folder is selected.
   at Rebex.Net.Imap.Search(ImapMessageSet messageSet, ImapListFields fields, ImapSearchParameter[] parameters)

although we had selected a folder before without errors.

Only iisreset helps us. Can you help us with that?

Applies to: Rebex Secure Mail

3 Answers

0 votes
by (58.9k points)
edited

Hello

we need to see the log of the communication, please create it as described at http://www.rebex.net/kb/logging.aspx

and send us the file to support@rebex.net so that we are able to investigate your issue.

By the way, instead of iisreset you could definitely dispose the Imap object and then initialize it again. That should do. You don't have to restart the whole web server.

by (160 points)
edited

I sent you logs to the email. Have you got it?

by (17.7k points)
edited

My colleague made a typo - the right address is support@rebex.net. However, no logs have come from you to any of the two addresses. Could you please resend the logs to the support@rebex.net?

by (17.7k points)
edited

We've already found the original e-mail. We'll analyze the logs either today afternoon or on Monday.

by (160 points)
edited

Am I correct I don't need resend the logs?

by (17.7k points)
edited

Yes, correct.

0 votes
by (134k points)
edited

Unfortunately, Gmail's IMAP servers are known to report this "System error (Failure)" error occasionally for no apparent reason. Even Mark Crispin, the guy who actually created the IMAP protocol, criticised Google for it few years ago, and apparently, it has not been entirely solved since then. Re-trying the operation again usually succeeds, even though the actual command used is identical to the one issued before the error was reported, which also confirms that something is wrong at the server side, not the client side.

A workaround for this server bug is to retry the operation. If that doesn't help, disconnect and connect/login to the server again.

The "No folder is selected" error seems to be caused because you called Imap.Search method after reconnecting to the server without calling Imap.SelectFolder first. Imap.Search and many other methods such as GetMessageList, GetMessageInfo or GetMailMessage will only work after a folder has been selected.

0 votes
by (160 points)
edited

Thank you very much.

...