/* Copyright (c) 2016-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "index-storage.h"
#include "index-mail.h"
#include "index-pop3-uidl.h"
struct mail_index_transaction *trans,
{
}
{
const void *data;
/* We'll assume that if the header exists, it's up-to-date. normally
UIDLs are set only during migration, so this value never changes.
Also even if it does, it becomes out-of-date only when the mailbox
is modified with old Dovecot versions. To fix that we'd have to
add and keep updating "max tracked uid" in this header for every
saved mail, which isn't worth it. */
/* this header isn't set yet */
return TRUE;
}
}
{
if (exists) {
}
} else {
/* skipping mails. we don't know the state. */
}
}
{
const void *data;
bool seen_all_msgs;
/* header already set and nothing to change */
return;
}
/* First check that we actually looked at UIDL for all messages.
Otherwise we can't say for sure if the newest messages had UIDLs. */
if (trans->prev_pop3_uidl_tracking_seq !=
return;
/* Just to be sure: Refresh the index and check again. POP3 keeps
transactions open for duration of the entire session. Maybe another
process already added new mails (and already updated this header).
This check is racy, but normally UIDLs aren't added after migration
so it's a bit questionable if it's even worth having this check in
there. */
if (!seen_all_msgs)
return;
/* check if we have already the same header */
return;
}
}