Tuesday, October 15, 2002 12:45 PM
POP, or IMAP? I don't think you can do it at all in the POP protocol, even without being limited to using the JavaMail API. For IMAP, in the protocol itself you can request arbitrary folders on the server, but I don't know offhand how to name them within the JavaMail API (depends on the "hierarchy delimiter" used by the specific IMAP server, see below).
Read the Javadoc for the "Store" object in the "javax.mail" package. For the "getFolder" method it says
...name - The name of the Folder. In some Stores, name can be an absolute path if it starts with the hierarchy delimiter. Else it is interpreted relative to the 'root' of this namespace.