I want to get the list of all email as unique addresses by using a library named Java libpst. The problem is that the library suggest to read all the message from the root folder but what about the scenarios when the user creates their own folders to group the emails.
I am using the Java libpst to read the mail addresses from PST files, which suggest to apply the following code:
PSTMessage email = (PSTMessage)pstFile.getRootFolder().getNextChild();
I understand the root folder is the default folder like the inbox, but what about the sent, or other folders created by the owner. Should it be better to iterate all the message in root folder and then goes to all the message for each new subfolder?
Vector<PSTFolder> folderList = pstFile.getRootFolder().getSubFolders();
The function pstFile.getRootFolder().getNextChild(); returns an object of type PSTObject, which might be a PSTMessage (which includes appointments and contacts as well as actual messages), but could also be a PSTFolder.
One way to do this is with a loop:
with processFolder looking something like this (warning untested code!):