Namespace Unknown on IMAP CREATE Folder

0 votes
asked Jun 12, 2013 by jrenaud (120 points)
edited Jun 12, 2013

We're using the Rebex.NET.Imap class to manage an IMAP connection and create folders on the IMAP server. When we attempt to create folders on an IMAP server which has not been configured with a default namesapce of "" (currently ".INBOX" and "." exist) the CREATE command fails with "Unknown Namespace".

Is there a way to specify a namespace as part of the Imap.CreateFolder() method?

Applies to: Rebex Secure Mail

1 Answer

0 votes
answered Jun 12, 2013 by Tomas Knopp (58,890 points)
edited Jun 12, 2013

No it is not possible directly from the CreateFolder method. However, you can use combination of methods SendCommand and ReadResponse.

// Send CREATE command with custom parameters
imap.SendCommand("CREATE", "param1", "param2", ..., "paramN");
ImapResponse response = imap.ReadResponse();

// display server response
foreach (ImapResponseLine line in response.GetLines())