1. Top Command.
The argument index is error. It should start from 0.
String argument1 = null;
String argument2 = null;
try {
argument1 = session.getCommandLine().getArgument(0); // Error 1
argument2 = session.getCommandLine().getArgument(1); // Error 2
} catch (ArgumentException ae) {
}
2. IF MailBox is not exist when using POP, the NULL pointer exception will be throwed.
private ArrayList<Mail> getMailList() {
String userDir = sc.getHomeDir(emailAddress.getUserName(), emailAddress.getDomain());
// Fix the null pointer exception (if dir not exit).
File dir = new File(userDir);
if (!dir.exists()) {
dir.mkdirs();
}





