if (!not_pop3_only) {
/* either nothing is cached, or only vsize is cached. */
mail->pop3_state = 1;
- } else if (vsize_dec != MAIL_CACHE_DECISION_YES) {
+ } else if (vsize_dec != MAIL_CACHE_DECISION_YES &&
+ (mail->ibox->open_flags & MAILBOX_OPEN_POP3_SESSION) == 0) {
/* if virtual size isn't cached permanently,
POP3 isn't being used */
mail->pop3_state = -1;
MAILBOX_OPEN_NO_INDEX_FILES = 0x10,
/* Keep mailbox exclusively locked all the time while it's open */
MAILBOX_OPEN_KEEP_LOCKED = 0x20,
+ /* Enable if mailbox is used for serving POP3. This allows making
+ better caching decisions. */
+ MAILBOX_OPEN_POP3_SESSION = 0x40
};
enum mailbox_feature {
storage = client->inbox_ns->storage;
- flags = 0;
+ flags = MAILBOX_OPEN_POP3_SESSION;
if (no_flag_updates)
flags |= MAILBOX_OPEN_KEEP_RECENT;
if (lock_session)