On 22.9.2004, at 22:20, dovecot@spam.turbolink.net wrote:
Only reason why it would do rereading there is if the message wasn't at the expected position in the mbox file. And if no-one else modified the mbox, the only reason for it is if Dovecot had somehow corrupted the message offset in index file.
How/where exactly could I check for these conditions? I'm pretty familiar with gdb but not with the new indexing code. I set a breakpoint on mbox_sync and tried to follow it through but I haven't been able to pinpoint exactly where the decision is made to re-read or not.
mbox_sync_has_changed() does the first quick check. If it shows it's changed, the mbox is locked and the timestamp/size is again checked against indexes in mbox_sync_do().
With dirty syncing mbox_sync_do() first tries to check only for new mails (partial=true), if it fails then it reads everything.