The Recoll desktop search tool can be used to index a maildir directory, for instance that comes from Thunderbird when the maildir format has been activated – user_pref("mail.server.server2.storeContractID", "@mozilla.org/msgstore/maildirstore;1");).
Here is how.
Configuration
Create a specific configuration for your directory. Indeed, it is easier and recommended to have several different configurations, see Multiple indexes.
mkdir $HOME/.recoll-maildir touch $HOME/.recoll-maildir/recoll.conf
Set-up
recoll.conf.topdirs = ~/.maildir/ indexallfilenames = 0 usesystemfilecommand = 0 processwebqueue = 0
That’s it. Recoll automatically detects that it is a maildir directory containing emails in cur, new and tmp.
Indexing
Simply run recollindex -c $HOME/.recoll-maildir.
Querying
Use recoll.
In menu Preferences >> External index dialog, add $HOME/.recoll-maildir/xapiandb as index location.
Then, add a Recoll helper script to open the emails in your favorite email client, say Thunderbird.
In
Preferences >> GUI configuration >> User Interface >> Choose editor applications, untickUse desktop preferences by default(because xdg-open is bad at opening extensionless emails in maildir directories).In
Preferences >> GUI configuration >> User Interface >> Choose editor applications, for Mime typemessage/rfc/822, add a link to a script, eg./home/martin/bin/recoll-thunderbird-open-file %f.In
recoll-thunderbird-open-file:#!/bin/sh cp 1/tmp/.emlthunderbird − file/tmp/$.eml