jstedfast / MailKit

A cross-platform .NET library for IMAP, POP3, and SMTP.

Home Page:http://www.mimekit.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IMAP client connected and authenticated but Inbox returns null

nataliaheliova opened this issue · comments

I have very simple code which just connects to imap server and succesfully authenticates. However Inbox property of ImapClient returns null.

Platform:

  • OS: Windows 10, 64bit
  • .NET 8.0
  • MailKit Version: 4.4.0
ImapClient client = new ImapClient();
client.Connect(imapServer, imapPort);
client.Authenticate(imapUsername, imapPassword);
var inbox = client.Inbox;
client.Disconnect(true);

Protocol Logs
Connected to imap://mailslurp.click:1143/?starttls=when-available
S: * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR CHILDREN UNSELECT MOVE APPENDLIMIT AUTH=PLAIN] IMAP4rev1 Service Ready
C: A00000000 AUTHENTICATE PLAIN ********
S: A00000000 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR CHILDREN UNSELECT MOVE APPENDLIMIT] AUTHENTICATE completed
C: A00000001 LIST "" ""
S: * LIST (\Noselect) "/" "/"
S: A00000001 OK LIST completed
C: A00000002 LIST "" "INBOX"
S: A00000002 OK LIST completed
C: A00000003 LOGOUT
S: * BYE Closing connection
S: A00000003 OK LOGOUT completed

As you can see from the log, I am using MailSlurp. Is this server compatible with MailKit? Is it expected that Inbox returns null?
Thanks!

When MailKit tries to list the INBOX, the server doesn't return it in the listing (the listing is empty).

That suggests it doesn't exist.

Your server is broken, imho.

Hi, I work for MailSlurp, there may be a bug in our imap server when selecting for INBOX, I will check and post and update here

@nataliaheliova we have deployed a fix to the MailSlurp imap inbox so that INBOX select works. Can you please retry?

It works. Cool! Thanks a lot :))