Skip to content

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
Issue #156
  • Loading branch information
rsoika committed Aug 19, 2021
1 parent 0e48351 commit 6ee87d0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ public class IMAPImportService {
public static final String DETACH_MODE_ALL = "ALL";
public static final String DETACH_MODE_NONE = "NONE";
public static final String ARCHIVE_DEFAULT_NAME = "imixs-archive";

public static final String DEFAULT_NO_SUBJECT = "no subject";

private static Logger logger = Logger.getLogger(IMAPImportService.class.getName());

Expand Down Expand Up @@ -216,14 +218,14 @@ public void onEvent(@Observes DocumentImportEvent event) {
Address[] fromAddress = message.getFrom();
String subject = message.getSubject();
if (subject == null || subject.trim().isEmpty()) {
subject = "no-subject";
subject = DEFAULT_NO_SUBJECT;
}
Date sent = message.getSentDate();
logger.fine("......received mail from: " + fromAddress[0].toString());
logger.fine("......subject = " + subject);
// do we have a subject regular expression provided by the options?
if (subjectPattern != null) {
if (subject == null || subject.isEmpty()) {
if (subject == null || DEFAULT_NO_SUBJECT.equals(subject)) {
// skip this mail
continue;
}
Expand Down

0 comments on commit 6ee87d0

Please sign in to comment.