Q: How can I search for messages in all folders or in a selection of folders?
In addition to the quicksearch, that allows filtering out messages in folders
recursively, you can use `mairix` to do global searches in Claws Mail.
To illustrate this topic, we'll detail the necessary steps to make a global search
in a MH config (in our example, ~/Mail).
- install mairix from http://www.rpcurnow.force9.co.uk/mairix/. mairix is a program
for indexing and searching email messages stored in Maildir, MH or mbox folders.
- create a folder in Claws Mail where the search results will be stored in (in
our example: ~/Mail/Search).
- create a mairix config file (~/.mairixrc for instance):
base=~/Mail
mh=*
omit=drafts:queue:trash:Junk:Search
database=~/.mairix_db
mfolder=Search
mformat=mh
in that example, the root of all folders to search in is our MH storage location
(~/Mail), search will omit drafts, queue, trash, Junk and Search folders located
in ~/Mail, and will place results into the Search folder.
See `man mairix` for more information about the mairix configuration file.
- add an action in Claws Mail to start the mairix search:
> ~/.claws-mail/tools/mairix.sh ~/.mairixrc
make sure that you've installed mairix.sh from the Tools pages (http://www.claws-mail.org/tools/claws-mail-mairix.tar.gz)
into ~/.claws-mail/tools or wherever you want, provided that you set the correct
path in the action text.
Now call the action. You'll be asked for the text to search for. Search results - symlinks
to the existing message files, will be placed into the target folder, making it like
a virtual folder. Removing messages from that folder will NOT remove the original message files.
The text to search for is an expression to pass to mairix. See `man mairix` for all search
patterns.
You can create as many mairix config files as you want (be sure that you set a
different database value in each of them), then create the corresponding actions
that call mairix.sh with the config filename in parameter.