IMAP servers may differ in the separator character used in mailbox folder hierarchy paths. Common separator chars are ‘.’ and ‘/’. For example:
Inbox.Vendors.Chilkat
or
Inbox/Vendors/Chilkat
Chilkat IMAP methods that require a folder path in any argument must use the correct separator character. The default separator char is ‘.’.
The Chilkat.Imap.SeparatorChar property can be set to specify the separator character. If you need to programmatically determine the SeparatorChar at runtime, you can call Chilkat.Imap.ListMailboxes because the IMAP server includes the separator character in a LIST response. The SeparatorChar property is automatically set as a side-effect of calling ListMailboxes.
Sample Ruby code (from https://www.example-code.com/ruby/imap_subFolder.asp ):
...
# The default value of the mailbox hierarchy separator char
# is a period '.' char.
print "Separator Char: " + imap.get_SeparatorChar() + "\n"
# If you know your IMAP server's separator char, you may
# explicitly set it. For example:
imap.put_SeparatorChar("/")
print "Separator Char: " + imap.get_SeparatorChar() + "\n"
# If you don't know the value of the separator char, the
# Chilkat IMAP component sets it automatically during
# a ListMailboxes call. (The reason is that the IMAP separator
# char is specified in the IMAP list mailboxes response.)
mboxes = imap.ListMailboxes("","*")
print "Separator Char: " + imap.get_SeparatorChar() + "\n"
# To select a sub-folder, start with the top-level mailbox
# and build a path using the separator char. The top-level
# mailbox should be named "Inbox":
s = imap.get_SeparatorChar()
folderPath = "Inbox" + s + "oldEmail"
success = imap.SelectMailbox(folderPath)
if (success != true)
print imap.lastErrorText() + "\n"
exit
end
print "Number of messages in " + folderPath + ": " + imap.get_NumMessages().to_s() + "\n";