Archived Forum Post

Index of archived forum posts

Question:

"Failed to select/examine mailbox" IMAP Error

Mar 25 '14 at 04:15

Get this error. There are no slashes in the email address.

ChilkatLog:
  SelectMailbox:
    DllDate: Aug 15 2013
    ChilkatVersion: 9.4.1.42
    UnlockPrefix: SDDOCSIMAPMAIL
    Username: VMREADER1:administrator
    Architecture: Little Endian; 32-bit
    Language: .NET 4.0
    VerboseLogging: 0
    mailbox: Inbox
    selectMailboxInner:
      mailboxPath: Inbox
      separatorChar: .
      Escaping quotes and backslashes in mailbox name...
      utf7EncodedMailboxPath: Inbox
      getCompleteResponse:
        Timeout waiting to read socket or accept connection
        timeoutMs: 60000
        recvUntilMatch: Socket timeout.
        getImapResponseLine: Socket timeout.
        Failed to get next response line from IMAP server.
      --getCompleteResponse
    --selectMailboxInner
    Failed to select/examine mailbox
    mailbox: Inbox
    imapSelectResponse: 
    Failed.
  --SelectMailbox
--ChilkatLog

Answer

This problem should already be fixed in v9.5.0


Answer

Still get this:

ChilkatLog:
  SelectMailbox:
    DllDate: Mar  6 2014
    ChilkatVersion: 9.5.0.16
    UnlockPrefix: SDDOCSIMAPMAIL
    Username: VMREADER1:administrator
    Architecture: Little Endian; 32-bit
    Language: .NET 4.0
    VerboseLogging: 0
    mailbox: Inbox
    selectMailboxInner:
      mailboxPath: Inbox
      separatorChar: .
      Escaping quotes and backslashes in mailbox name...
      utf7EncodedMailboxPath: Inbox
      getCompleteResponse:
        Timeout waiting to read socket or accept connection
        timeoutMs: 60000
        recvUntilMatch: Socket operation timeout.
        getImapResponseLine: Socket operation timeout.
        Failed to get next response line from IMAP server.
      --getCompleteResponse
    --selectMailboxInner
    Failed to select/examine mailbox
    mailbox: Inbox
    imapSelectResponse: 
    Failed.
  --SelectMailbox
--ChilkatLog

Answer

Any update on this?


Answer

I am not able to reproduce the problem. I haven't heard of any other customer with the problem. Here's my LastErrorText using GMail:

If you wish, please send me the account credentials for a test email account (to support@chilkatsoft.com) and I'll quickly run the test to see if I get the same error.

ChilkatLog:
  SelectMailbox:
    DllDate: Mar 24 2014
    ChilkatVersion: 9.5.0.21
    UnlockPrefix: UNTTSTIMAPMAILQ
    Username: CHILKAT13:Matt
    Architecture: Little Endian; 32-bit
    Language: Visual C++ 11.0 (32-bit)
    VerboseLogging: 0
    mailbox: Inbox
    selectMailboxInner:
      mailboxPath: Inbox
      separatorChar: /
      Escaping quotes and backslashes in mailbox name...
      utf7EncodedMailboxPath: Inbox
    --selectMailboxInner
    UidNext: 3623
    UidValidity: 3
    Success.
  --SelectMailbox
--ChilkatLog


Answer

Thanks. I used your test email account, but found no problem. Here's my LastErrorText for Connect, Login, and SelectMailbox:

ChilkatLog:
  Connect_Imap:
    DllDate: Mar 24 2014
    ChilkatVersion: 9.5.0.21
    UnlockPrefix: UNTTSTIMAPMAILQ
    Username: CHILKAT13:Matt
    Architecture: Little Endian; 32-bit
    Language: Visual C++ 11.0 (32-bit)
    VerboseLogging: 1
    hostname: imap.secureserver.net
    port: 993
    connect2:
      hostname: imap.secureserver.net
      port: 993
      ssl: 1
      connectImplicitSsl:
        connectSocket:
          domainOrIpAddress: imap.secureserver.net
          port: 993
          connectTimeoutMs: 30000
          connect_ipv6_or_ipv4:
            Multi-threaded domain to IP address resolution
            AddrInfoList:
              AddrInfo:
                ai_flags: 0
                ai_family: 2
                ai_socktype: 0
                ai_protocol: 0
                ai_addrlen: 16
                ai_canonname: (NULL)
              --AddrInfo
            --AddrInfoList
            connecting to IPV4 address...
            ipAddress: 72.167.218.82
            connect:
              Waiting for the connect to complete...
              myIP: 192.168.1.100
              myPort: 50763
              socket connect successful.
            --connect
          --connect_ipv6_or_ipv4
        --connectSocket
        Secure Channel Established.
      --connectImplicitSsl
    --connect2
    Turning on TCP_NODELAY.
    socketOptions:
      SO_SNDBUF: 65536
      SO_RCVBUF: 65536
      TCP_NODELAY: 1
    --socketOptions
    ConnectionType: SSL/TLS
    ImapCmdResp: * OK [CAPABILITY IMAP4rev1 UNSELECT STARTTLS ID CHILDREN NAMESPACE IDLE] Courier-IMAP ready. Copyright 1998-2004 Double Precision, Inc.  See COPYING for distribution information.
  --Connect_Imap
--ChilkatLog

ChilkatLog: Login: DllDate: Mar 24 2014 ChilkatVersion: 9.5.0.21 UnlockPrefix: UNTTSTIMAPMAILQ Username: CHILKAT13:Matt Architecture: Little Endian; 32-bit Language: Visual C++ 11.0 (32-bit) VerboseLogging: 1 login: xxx ConnectionType: SSL/TLS ImapCmdSent: aaab LOGIN "xxx" "xxx" getCompleteResponse: ImapCmdResp: aaab OK LOGIN Full IMAP support is enabled --getCompleteResponse Success. --Login --ChilkatLog

ChilkatLog: SelectMailbox: DllDate: Mar 24 2014 ChilkatVersion: 9.5.0.21 UnlockPrefix: UNTTSTIMAPMAILQ Username: CHILKAT13:Matt Architecture: Little Endian; 32-bit Language: Visual C++ 11.0 (32-bit) VerboseLogging: 1 mailbox: Inbox selectMailboxInner: mailboxPath: Inbox separatorChar: . Escaping quotes and backslashes in mailbox name... utf7EncodedMailboxPath: Inbox ImapCmdSent: aaac SELECT "Inbox" getCompleteResponse: ImapCmdResp: * FLAGS (Draft Answered Flagged Deleted Seen Recent) ImapCmdResp: * OK [PERMANENTFLAGS (Draft Answered Flagged Deleted Seen)] Limited ImapCmdResp: * 1 EXISTS ImapCmdResp: * 0 RECENT ImapCmdResp: * OK [UIDVALIDITY 1] Ok ImapCmdResp: * OK [UIDNEXT 2] Predicted next UID ImapCmdResp: aaac OK [READ-WRITE] SELECT completed. --getCompleteResponse --selectMailboxInner UidNext: 2 UidValidity: 1 Success. --SelectMailbox --ChilkatLog

qa_imapSelectMailbox success.


Answer

Hello! I have had the same problem after selecting mailbox. I check all mailboxes in my email account one after another and execute next code by timer (for example every 5 minutes):

if (!CheckConnection())
return;

foreach (string mailbox in GetAllMailboxes())
{   
if (Imap.SelectMailBox(mailbox))
    GetMessagesFromMailbox(mailbox);
}

Sometimes, Imap.SelectMailBox("mailbox") returns false and all next calls of the Imap.SelectMailBox("mailbox") return false. What should I do in this case and how can I recognize this situation? (I use chilkat 9.5.0 for .Net 4.0) Should I close each mailbox after using?