0 votes
by (360 points)
edited

When I call the following code, it only returns the "Inbox", instead of the full folder list.

    ConnectAndLogin();
    var md = new MailData();
    var folders = _imap.GetFolderList("", ImapFolderListMode.All, true);
    md.MessageCount = 0;
    md.UnseenMessageCountInFolder = new Dictionary<string, int>();
    md.MessagesInFolder = new Dictionary<string, List<MailMessage>>();
    foreach (ImapFolder folder in folders)
    {
        var list = GetMessageList(folder.Name);
        var count = GetUnseenMessageCount(folder.Name);
        md.MessagesInFolder.Add(folder.Name,list);
        md.UnseenMessageCountInFolder.Add(folder.Name, count);
        md.MessageCount += GetMessageCount(folder.Name);
    }
    _imap.Disconnect();

Is this some bug in the code, or am I doing something wrong? A few days ago this code returned all folders, and suddenly it only returned the "Inbox". In the meanwhile I didn't change anything in the code where I call that function.

Sidenote: MailData is a custom class for storing the recieved data.

I don't know which part of the log is relevant to you, so here is the log from when the function above was called:

The log ain't correct: it picks the other webservice(the one for POP).

Note: I was using imap.gmx.com as login server

Applies to: Rebex Secure Mail

2 Answers

0 votes
by (147k points)
edited
 
Best answer

There doesn't appear to be anything wrong with your code. It looks like something was changed at the server in the meantime.

To see the actual communication between the client and the server, including the list of folders as sent by he server, create a communication log using Imap object's LogWriter property and add the relevant part to your post (or mail it to support@rebex.net). We might be able to spot something.

by (360 points)
edited

Thank you for the help, I will check it out

0 votes
by (360 points)
edited

Problem solved :)

I was using data from a settings file, and that one logged in to a POP server.
That is why it went wrong and I only got the Inbox folder.

Thanks anyway

...