diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 35bfbd0416..153fbff6b2 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -3143,11 +3143,7 @@ class Core { } Long sent = helper.getSent(); - Long received = helper.getReceivedHeader(helper.getResent()); - if (received == null) - received = sent; - if (received == null) - received = 0L; + long received = helper.getPOP3Received(); boolean seen = (received <= account.created); EntityLog.log(context, account.name + " POP sync=" + uidl + "/" + msgid + diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index 718cdc20f4..bc962608b7 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -2509,7 +2509,16 @@ public class MessageHelper { return getReceivedHeader(null); } - Long getReceivedHeader(Long before) throws MessagingException { + long getPOP3Received() throws MessagingException { + Long received = getReceivedHeader(getResent()); + if (received == null) + received = getSent(); + if (received == null) + received = 0L; + return received; + } + + private Long getReceivedHeader(Long before) throws MessagingException { ensureHeaders(); // https://tools.ietf.org/html/rfc5321#section-4.4