/** * checks message sent date againsts a predefined email days cutoff * * @param message * @param migratedAccount * @return * @throws javax.mail.MessagingException */ public boolean isMessageTooOld(Account account, Message message, String context) throws MessagingException { if (message.getSentDate() == null) { log.warn( String.format("we have a message with no sent date for %s, allowing message", context)); return false; } // This should handle the first login case, we want to take up to x days worth of old emails and // not be rejected // by the Too Old check if (account.getLast_received_date() == null) { log.warn( String.format( "we are process an account with no register time. this behavior is not understood yet %s, we will accept this message", context)); return (System.currentTimeMillis() - message.getSentDate().getTime()) > 1000l * 60 * 60 * 24 * emailDaysCutoff; } return isOlder(message.getSentDate(), account.getLast_received_date()); }
public boolean isFirstTime(Account account) { return account.getLast_received_date() == null && account.getLast_mailcheck() == null; }
public boolean isMigratedAccount(Account account) { return account.getLast_received_date() == null && account.getLast_mailcheck() != null; }