title: S22.IMAP does not always read attachments
body: <p>I use the <a href="https://github.com/smiley22/S22.Imap" rel="nofollow noreferrer">S22.IMAP</a> library as follows: </p>
  
  <pre><code>using (ImapClient client = new ImapClient(imap, 993,
                     usuario, psw, AuthMethod.Login, true))
  {
      foreach (var uid in client.Search(SearchCondition.Unseen()))
      {
          var message = client.GetMessage(uid);                      
          foreach (Attachment atc in message.Attachments)
          { 
              if (System.IO.Path.GetExtension(atc.Name) == ".xml")
              {
                  String archivoXML_texto = "";
                  byte[] allBytes = new byte[atc.ContentStream.Length];
                  int bytesRead = atc.ContentStream.Read(allBytes, 0, (int)atc.ContentStream.Length);
                  using (MemoryStream memory = new MemoryStream(allBytes))
                  {
                      StreamReader archivoXML = new StreamReader(memory);
                      archivoXML_texto = archivoXML.ReadToEnd();
                      archivoXML.Close();
                      memory.Dispose();
                  }
                  .......
                  .......
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>I have a problem: when I try to read the attachment of some mail,
  I realize in the debugging of the code that is not reading the attachment.
  The strange thing about this event is that it happens with some emails, as well as gmail and private emails (I do not say that all of these domains do not read the attachments), the others read them well.</p>
  
  <p><strong>Questions:</strong></p>
  
  <ol>
  <li><p>I would like to know what would be the cause that prevents me from reading these emails. Could it be that there is some privacy settings, for example in gmail that makes it block the attachments in the code?</p></li>
  <li><p>If this were true, how would you enable it? Or should I change the way the code is implemented?</p></li>
  <li><p>And what would be the best or some good example?</p></li>
  </ol>