I am trying to fetch IMAP headers from Yahoo Mail. It works fine when I try to grab the first 100 headers but it disconnects when I try to get the headers of all 32,000+ emails. I get an exception saying that "The IMAP server has unexpectedly disconnected".
I tried using Gmail to grab up to 19,000 headers and it works fine.
Any ideas or is there any limitations? I have included the protocol log here: https://www.dropbox.com/s/6109m1ii113af0c/protocollog.txt?dl=0
Upgrade your MailKit. The problem is probably that your list of UIDs is too long causing your IMAP server to disconnect.
The latest version of MailKit will break apart the list of UIDs into multiple duplicate commands with smaller subsets of the UIDs in order to avoid creating a command-line that is too long for the IMAP server to handle.