Skip to content

Commit

Permalink
patch from issue branch 2.3
Browse files Browse the repository at this point in the history
Issue #175
  • Loading branch information
rsoika committed Feb 8, 2023
1 parent 7b9c1b9 commit 95cd21a
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,19 @@ public void onEvent(@Observes DocumentImportEvent event) {
documentImportService.logMessage("..." + messages.length + " new messages found", event);

for (Message message : messages) {
Address[] fromAddress = message.getFrom();
String subject = message.getSubject();
Address[] fromAddress = null;
String subject = null;
// if we can not open the mail (messaging Exception) than we simply skipp this
// mail
// see Issue #175
try {
fromAddress = message.getFrom();
subject = message.getSubject();
} catch (MessagingException me) {
documentImportService.logMessage("...Failed to read message from inbox: " + me.getMessage(), event);
continue;
}

if (subject == null || subject.trim().isEmpty()) {
subject = DEFAULT_NO_SUBJECT;
}
Expand Down

0 comments on commit 95cd21a

Please sign in to comment.