1

I am using MailKit and calling this, which works most of the time.

imap.Inbox.Open(FolderAccess.ReadOnly);

From time to time some servers and accounts, including my own gmail account, refuse to let me read them:

The IMAP server replied to the 'EXAMINE' command with a 'NO' response.

Is this something I could prevent? Too many calls or conflicting with another mail client reading at the same time? It is quite hard to test these theories and maybe somebody knows?

mike nelson
  • 21,218
  • 14
  • 66
  • 75

1 Answers1

3

I would probably recommend getting a protocol log in order to figure out what exactly is going on. The IMAP server might also provide additional info in some error messages that might aid in figuring out the problem.

The way to get a protocol log using IMAP is this:

using (var client = new ImapClient (new ProtocolLogger ("C:\\Temp\\imap.log")) {
    // ...
}

Then you'll be able to open the log file using any text editor.

jstedfast
  • 35,744
  • 5
  • 97
  • 110
  • @mikenelson you found the reason? – coder771 Oct 20 '16 at 10:20
  • I didn't find it as I did not see it logged again (although i may have missed it). In the latest mailkit I believe there should be the full error response rather than just NO, as per my other similar question about BAD http://stackoverflow.com/questions/39958480/mailkit-the-imap-server-replied-to-the-examine-command-with-a-bad-response – mike nelson Oct 20 '16 at 20:15
  • Protocol logging is definitely the way though, I just turn it on permanently so can look back and see details if these errors crop up. Since they crop up very sporadically in the wild. I save out each connection log with a unique name in dated folders, and delete folders more than 3 days old. – mike nelson Oct 20 '16 at 20:19
  • Thanks for the advise. Will add this stuff this code to my project :) – simply good Nov 29 '19 at 19:40