Identify IMAP Folder Path Syntax

Summary

Each Mail server can use different Syntax to identify the path to subfolders. This page will cover how to identify the syntax that your mail server is using.

Via JEMHC logs

When you attempt to connect to a subFolder using an incorrect syntax, the Message Source logs will identify what the mailbox name should be prefixed with. Below is an example of the logs:

Screenshot from 2024-07-15 14-08-01.png

Using OpenSSL in a Terminal

Within a Terminal you may be able to use OpenSSL to connect to the mailbox and then search for the available namespaces and list the available folders. For more info about the available commands see: https://www.atmail.com/blog/imap-101-manual-imap-sessions/

Below is an example of how to identify the namespaces and the available folders:

Commands Required:

openssl s_client -connect imap.hostname.com:993 -crlf -quiet A1 login Username Password n namespace A1 list "relevantNameSpace" "*"
Screenshot from 2024-07-15 14-14-06.png

From the above example, you can see that the relevant name space is “INBOX.” and that the subfolders are specified as INBOX.Folder. With this information you know that the subfolders of INBOX need to be specified as “INBOX.Junk”: