Option for not marking dead messages, especially outside of folder specifications
I find mairix(1) to be very performant, but I have some large IMAP mailboxes in claws-mail and a need to quickly reindex specific folders within them. I've been experimenting with abusing mairix databases in the following way:
- Using two nearly-identical mairixrc(5) config files containing:
a. Both having specifying same
base&databaseb. One (example:.mairixrc) specifyingmh=<mailbox>...which is used for initial/full indexing of all mailbox folders & messages c. Another (example:.mairixrc-reindex) specifyingmh=$REINDEX_FOLDER, so using an environment variable which will contain a single directory (no ellipses, so non-recursive) for reindexing just the one mailbox folder and its messages - The initial indexing is performed with
mairix -p -f .mairixrc, as are any subsequent full "get mail" full fetches/syncs from the IMAP server - Upon copying/moving/deleting messages in specific folders, a reindex of any affected folders is performed with
REINDEX_FOLDER="<folder/path>" mairix -Q -F -f .mairixrc-reindex
I have found this to greatly improve the performance of reindexing a specific folder. However, it has the unfortunate side-effect of marking all DB entries for messages in other folders as pruned/dead (see update_database() in db.c), so they will no longer be included in search results.
I propose that it could be helpful to add a new mairix option to not mark dead messages in the database at all. Preferably, not mark dead messages in the database for folders outside of those specified.
I will take a look at implementing this and submit a proposal PR.