This project is read-only.

Cannot retrieve Folder when mailbox has subfolders

Topics: Issues
Apr 5, 2013 at 3:18 PM
I have a simple setup with a mailbox with 3 top level folders. When using this library I can connect to them perfectly with an ImapClient.

However, as soon as I add a subfolder, to the INBOX, the ImapClient.Folders (or GetFolders()), will not return anymore. My program hangs on that call. I waited for over a minute for it to return.

Is this a known bug or am I doing something wrong?

Code snippet:
client = new ImapClient(server, port);
client.LogIn(login, password);
foreach (Folder folder in client.Folders)
       nodes.Add(new TreeNode(folder.Name));
Apr 5, 2013 at 10:48 PM
Hi vzorge,

hm, the issue described sounds strange, but i can think of a possible reason for it. I'll try to fix it in the next days and let you know, so you can test if the problem still occurs.

Best regards,

Pavel Azanov
Apr 12, 2013 at 6:35 PM
Edited Apr 14, 2013 at 11:54 AM
Hi vzorge,

I updated the code in the repository, please check if the problem described still occurs.

If the problem is not gone, I'd ask you to provide me with some test credentials for an account to debug the code on. You can send them directly to or Best regards,

Pavel Azanov
Apr 19, 2013 at 10:59 AM
Edited Apr 19, 2013 at 11:02 AM
Hey Pavel,

We tried out your latest release. The AddFlag and RemoveFlag work like a charm. Thank you 8-)

The connection problem still persists though. You can check out our code at if you want to look into what we have done.

We connect to an internal mail server on the network here, so that won't work for you. The problem occurs in the loadFolders() method when we try to loop through the Folders.

Disclaimer: We are doing this small project in our spare time and it is really just starting up, so don't laugh too much at our code ;^)

Apr 19, 2013 at 2:31 PM
Hi Vincent,

Happy to hear the last updates work fine!

Yes, currently I'm working on the issue with this infinite loop, because there are more people who reported this problem, but still wasn't able to simulate the same situation with my server/application. Hope can do this as soon as possible.

I took a look at your project and can only say the code is clean and easy to read and understand. :) Wish you good luck developing it!

May 2, 2013 at 12:40 AM
Hi Vincent,

seems like I found the reason for the infinite loop on folder request.
Can you check if you still experience the issue using the latest code from the repository?

Kind regards,

Pavel Azanov