mairix icon indicating copy to clipboard operation
mairix copied to clipboard

Option for not marking dead messages, especially outside of folder specifications

Open morgant opened this issue 4 months ago • 0 comments

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:

  1. Using two nearly-identical mairixrc(5) config files containing: a. Both having specifying same base & database b. One (example: .mairixrc) specifying mh=<mailbox>... which is used for initial/full indexing of all mailbox folders & messages c. Another (example: .mairixrc-reindex) specifying mh=$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
  2. The initial indexing is performed with mairix -p -f .mairixrc, as are any subsequent full "get mail" full fetches/syncs from the IMAP server
  3. 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.

morgant avatar Aug 22 '25 14:08 morgant