76426

MailKit: The IMAP server replied to the 'EXAMINE' command with a 'BAD' response

I got this error on an Exchange 2007 mailbox. I see it is returning the BAD response from the error which is thrown by MailKit:

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

But this doesn't tell me enough detail. So I am running protocol logging, from which I can tell what the problem is. It says:

K00000005 BAD Duplicate folders "Conversation Action Settings", "News Feed", "Quick Step Settings", "Suggested Contacts" were detected in the mailbox. Therefore the user's connection was disconnected.

I would like to get this error text and display it to the user, so they can fix their mailbox (which they can do by deleting the duplicate folders, assuming they know which ones they are). Is there a simple way to get the full response text?

Full protocol log as follows:

S: * OK Microsoft Exchange Server 2007 IMAP4 service ready C: K00000000 CAPABILITY S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=NTLM AUTH=GSSAPI AUTH=PLAIN IDLE NAMESPACE LITERAL+ S: K00000000 OK CAPABILITY completed. C: K00000001 AUTHENTICATE NTLM ... S: K00000001 OK AUTHENTICATE completed. C: K00000002 CAPABILITY S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=NTLM AUTH=GSSAPI AUTH=PLAIN IDLE NAMESPACE LITERAL+ S: K00000002 OK CAPABILITY completed. C: K00000003 NAMESPACE S: * NAMESPACE (("" "/")) NIL NIL S: K00000003 OK NAMESPACE completed. C: K00000004 LIST "" "INBOX" S: * LIST (\Marked \HasNoChildren) "/" INBOX S: K00000004 OK LIST completed. C: K00000005 EXAMINE INBOX S: K00000005 BAD Duplicate folders "Conversation Action Settings", "News Feed", "Quick Step Settings", "Suggested Contacts" were detected in the mailbox. Therefore the user's connection was disconnected. S: * BYE Connection is closed. 15

Answer1:

You can try parsing the ImapCommandException.Message property to get the text following the ':' character that is used in the exception message.

I've also just added a ResponseText property to ImapCommandException so you can get this text w/o needing to parse it if you want to use MailKit built source.

Recommend

  • recv() returns always 0
  • Start a program in active user session with PowerShell remoting
  • How to get Email address from outlook contacts for the names listed in a column?
  • How do I check if a SSLSocket connection is sane on Java?
  • Save disconnected object in entity framework 4
  • Formatting of number from contacts
  • Scroll to anchor link in a Sammy.js project
  • Does pImpl fundamentally solve C++ DLL issue?
  • Sitecore 8: Number of Recipients in List Manager not calculating properly
  • How to read a certificate from a USB token in C#
  • How to activate JS data-filter when page loads?
  • Replace rows by index
  • How should I start to implement RESTful web service?
  • HikariPool-1 - Unusual system clock change detected, soft-evicting connections from pool
  • The symbol you provided is not a function
  • Consuming a web service with the Netbeans Platform
  • What is the equivalent of Android permissions in iOS development? [duplicate]
  • Single django queryset to get n adjacent items
  • Count New Lines in Text File
  • Criterion causing memory consumption to explode, no CAFs in sight
  • chrome video src change not working
  • what makes a request a new request in asp.net C#
  • Debugging VB6 Code From Visual Studio 2010
  • Trouble saving JSON data for use by multiple UIViews [duplicate]
  • Check for zero lines output from command over SSH
  • nonblocking BIO_do_connect blocked when there is no internet connected
  • Diff between two dataframes in pandas
  • Eloquent update method change created_at timestamp
  • Visual Studio 2010 debugger build correctly - compiler pdb and linker pdb not in synch?
  • How to get Eclipse Oxygen to run on Java 9
  • QLPreviewController hide print button in ios6
  • How to define and use opencv mat of user type
  • How to add a column to a Pandas dataframe made of arrays of the n-preceding values of another column
  • Display Images one by one with next and previous functionality
  • XCode can't find symbols for a specific iOS library/framework project
  • log4net write single file for each call to log.info
  • Authorize attributes not working in MVC 4
  • Busy indicator not showing up in wpf window [duplicate]
  • Python/Django TangoWithDjango Models and Databases
  • Net Present Value in Excel for Grouped Recurring CF