public boolean filterEmail(Message message, String filter, Report report) {
Date receivedDate = null;
try {
receivedDate = message.getReceivedDate();
} catch (MessagingException ex) {
report.logIssue(new Issue(ex.getMessage(), Issue.Level.WARNING));
return true;
}
if(receivedDate == null){
report.logIssue(new Issue("Can't get the receive date of message "+message+",ignore this filter", Issue.Level.INFO));
return true;
}
SimpleDateFormat format = new SimpleDateFormat(EmailDataType.DATEFORMAT);
Date dateFilter = null;
try {
dateFilter = format.parse(filter);
} catch (ParseException ex) {
report.logIssue(new Issue(ex.getMessage(), Issue.Level.WARNING));
return true;
}
if(receivedDate.after(dateFilter))
return true;
else