title: MailKit.Net.Imap.ImapProtocolException: "Syntax error in IMAP server greeting. Unexpected token: [atom: OK]"
body: <p>code:</p>
  
  <pre><code>using (var client = new ImapClient(new ProtocolLogger("logImap.txt")))
  {
      // For demo-purposes, accept all SSL certificates
      client.ServerCertificateValidationCallback = (s, c, h, e) =&gt; true;
      client.Connect("imap.yandex.ru", 993, true);
      client.Authenticate(login, password);
      // The Inbox folder is always available on all IMAP servers...
      var inbox = client.Inbox;
      inbox.Open(FolderAccess.ReadOnly);
      Console.WriteLine("Total messages: {0}", inbox.Count);
      Console.WriteLine("Recent messages: {0}", inbox.Recent);
      for (int i = 0; i &lt; inbox.Count; i++)
      {
          var message = inbox.GetMessage(i);
          Console.WriteLine("Subject: {0}", message.Subject);
      }
      client.Disconnect(true);
  }
  </code></pre>
  
  <p>Stack trace:</p>
  
  <blockquote>
    <p>MailKit.Net.Imap.ImapEngine.AssertToken(MailKit.Net.Imap.ImapToken,
    MailKit.Net.Imap.ImapTokenType, string, object[])
          MailKit.Net.Imap.ImapEngine.ConnectAsync(MailKit.Net.Imap.ImapStream,
    bool, System.Threading.CancellationToken)
          System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
          System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
          System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
          System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
          MailKit.Net.Imap.ImapClient.ConnectAsync(string, int, MailKit.Security.SecureSocketOptions, bool,
    System.Threading.CancellationToken)
          System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
          System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
          System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
            ...</p>
  </blockquote>
  
  <p>And logImap.txt:</p>
  
  <pre><code>Connected to imaps://imap.yandex.ru:993/
  S: OK IMAP4
  </code></pre>
  
  <p>What can I do with that problem?</p>