1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-14 10:16:21 +00:00

#180: expain that only unread emails will be imported, fix logo display

This commit is contained in:
Benjamin Gamard
2018-02-28 13:08:30 +01:00
parent 2b23a1d048
commit 1ce5ba4f06
5 changed files with 11 additions and 6 deletions

View File

@@ -18,6 +18,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.mail.*;
import javax.mail.search.FlagTerm;
import java.util.Date;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
@@ -114,7 +115,7 @@ public class InboxService extends AbstractScheduledService {
Folder inbox = null;
try {
inbox = openInbox();
return inbox.getMessageCount();
return inbox.search(new FlagTerm(new Flags(Flags.Flag.SEEN), false)).length;
} catch (Exception e) {
log.error("Error testing inbox", e);
return -1;