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

asked 26 Sep '11, 15:41

TestCSSL's gravatar image

TestCSSL
183
accept rate: 0%

edited 26 Sep '11, 17:14


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.

link

answered 26 Sep '11, 15:49

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.4k28
accept rate: 31%

Thank you for the help, I will check it out

(26 Sep '11, 15:56) TestCSSL

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

link

answered 27 Sep '11, 08:27

TestCSSL's gravatar image

TestCSSL
183
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×76

Asked: 26 Sep '11, 15:41

Seen: 300 times

Last updated: 27 Sep '11, 08:27