Maildir and mbox formats were using index_sync_changes_read(), which assumed that
they were sorted. So some of the intended expunges weren't actually always being
done. This mainly affected when expunges were being done simultaneously by multiple
processes or by pipelined commands. For example:
printf "a select inbox\nb uid move 2 Trash\nc uid move 1 Trash\nd logout\n" | ./imap
i_array_init(&ctx->sync_list, keyword_count + 2);
if (array_is_created(&sync_trans->expunges)) {
+ mail_index_transaction_sort_expunges(sync_trans);
synclist = array_append_space(&ctx->sync_list);
synclist->array = (void *)&sync_trans->expunges;
}