I am using javamail to access the available folders in james mail server but my code is throwing an exception
try {
Store store = mailSession.getStore();
store.connect("localhost", username , password );
Folder folder = store.getDefaultFolder();
Folder[] f = folder.list("*");
for (Folder fd : f) {
System.out.println(fd.getName());
}
} catch (MessagingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Note : exception is thrown when calling list() method
Exception : Caused by: com.sun.mail.iap.CommandFailedException: A3 NO LIST failed. Search failed.