+1 vote

When connecting to outlook via ssl, the getfolders function seems to be removing a left square bracket from the folder name, but only if it is the last letter.

For example: FolderName[

However, the following folder names are just fine:

Folder[]
[Folder]
Folder]
Folder[][ (this one surprisingly comes back correctly)

What is weirder is that a folder named: 'Folder[Name', will return as 'Folder'. It seems to have stripped everything after the bracket.

I can't seem to nail down the behavior of when characters will get stripped from the folder name, but the above examples are consistent. Any thoughts on what is going on? I believe I'm using version 3.0

by (250 points)
I am under a time crunch and was wondering if this would be a suitable workaround for getting folder names:

var response = imap.SendCommand("LIST \"\" \"*\"");

then looping through response.Lines, and extracting the folder name from that string. Any thoughts?
Another option that is more comprehensive, but performs poorly, is to call

imap.Examine("folder")

on all the folders returned by imap.GetFolders(). If an exception is thrown, then I know that is a bad folder name, (which for my purposes will suffice) and I can filter it out.

Is there a more performant way to do a check like this?
Parsing IMAP responses is complicated.

If you have one specific sever to deal with, you may be able to do this, we don't recommend this however.

I can't think of any faster way.
Thank you for detailed bug report.

Fixed in the latest version (3.0.18165.2350).
Awesome, thanks for the quick turnaround.

1 Answer

0 votes

Thank you for detailed bug report.

Fixed in the latest version (3.0.18165.2350).

by (301k points)
...